/* ==========================================================================
   PandaFIBC — Long-form editorial components
   Used by: buyer's guide, manufacturer ranking, market report, glossary
   ========================================================================== */

.lf {
    --lf-border: #E2E8F0;
    --lf-ink: #1E293B;
    --lf-muted: #475569;
    --lf-tint: #F8FAFC;
    --lf-accent: #EB5C20;
}

/* ---------- reading column ---------- */
.lf .entry-content {
    max-width: 860px;
}

.lf .entry-content > h2 {
    margin-top: 2.6rem;
    padding-top: .2rem;
    font-size: clamp(1.45rem, 2.2vw, 1.9rem);
    line-height: 1.3;
    color: var(--lf-ink);
    scroll-margin-top: 96px;
}

.lf .entry-content > h3 {
    margin-top: 1.9rem;
    font-size: 1.18rem;
    color: var(--lf-ink);
    scroll-margin-top: 96px;
}

.lf .entry-content p,
.lf .entry-content li {
    color: #334155;
}

.lf .entry-content ul,
.lf .entry-content ol {
    margin: 0 0 1.2rem 1.15rem;
    padding-left: .4rem;
}

.lf .entry-content li {
    margin: .45rem 0;
}

.lf .entry-content a {
    color: var(--lf-accent);
    text-decoration: underline;
    text-underline-offset: 2px;
}

/* ---------- direct answer box (AI-friendly, conclusion first) ---------- */
.lf-answer {
    background: linear-gradient(180deg, #FFF7F2 0%, #FFFFFF 100%);
    border: 1px solid #FBD9C6;
    border-left: 4px solid var(--lf-accent);
    border-radius: 0 10px 10px 0;
    padding: 20px 24px;
    margin: 0 0 2rem;
}

.lf-answer strong.lf-answer-title {
    display: block;
    font-size: .78rem;
    letter-spacing: .09em;
    text-transform: uppercase;
    color: var(--lf-accent);
    margin-bottom: .55rem;
}

.lf-answer p {
    margin: 0 0 .6rem;
    font-size: 1.05rem;
    line-height: 1.75;
}

.lf-answer p:last-child {
    margin-bottom: 0;
}

/* ---------- key figures ---------- */
.lf-kpis {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
    gap: 14px;
    margin: 1.8rem 0 2.2rem;
}

.lf-kpi {
    background: var(--lf-tint);
    border: 1px solid var(--lf-border);
    border-radius: 10px;
    padding: 16px 14px;
    text-align: center;
}

.lf-kpi b {
    display: block;
    font-size: 1.5rem;
    line-height: 1.15;
    color: var(--lf-accent);
    font-weight: 800;
}

.lf-kpi span {
    display: block;
    font-size: .82rem;
    color: var(--lf-muted);
    margin-top: 4px;
}

/* ---------- table of contents ---------- */
.lf-toc {
    background: var(--lf-tint);
    border: 1px solid var(--lf-border);
    border-radius: 12px;
    padding: 20px 24px;
    margin: 0 0 2.4rem;
}

.lf-toc h2 {
    margin: 0 0 .8rem !important;
    padding: 0 !important;
    font-size: .82rem !important;
    letter-spacing: .09em;
    text-transform: uppercase;
    color: var(--lf-muted) !important;
}

.lf-toc ol {
    margin: 0 !important;
    padding-left: 1.25rem;
    columns: 2;
    column-gap: 28px;
}

.lf-toc li {
    margin: .3rem 0;
    font-size: .95rem;
    break-inside: avoid;
}

.lf-toc a {
    color: var(--lf-ink) !important;
    text-decoration: none !important;
    border-bottom: 1px dashed transparent;
}

.lf-toc a:hover {
    border-bottom-color: var(--lf-accent);
    color: var(--lf-accent) !important;
}

@media (max-width: 640px) {
    .lf-toc ol {
        columns: 1;
    }
}

/* ---------- data tables ---------- */
.lf-table-wrap {
    overflow-x: auto;
    margin: 1.4rem 0 2rem;
    border: 1px solid var(--lf-border);
    border-radius: 10px;
    -webkit-overflow-scrolling: touch;
}

.lf table {
    width: 100%;
    border-collapse: collapse;
    font-size: .93rem;
    min-width: 560px;
    background: #fff;
}

.lf table caption {
    caption-side: top;
    text-align: left;
    padding: 12px 14px;
    font-size: .82rem;
    color: var(--lf-muted);
    background: var(--lf-tint);
    border-bottom: 1px solid var(--lf-border);
}

.lf table th {
    background: #0F172A;
    color: #fff;
    font-weight: 600;
    text-align: left;
    padding: 11px 14px;
    font-size: .84rem;
    letter-spacing: .02em;
    vertical-align: top;
    white-space: nowrap;
}

.lf table td {
    padding: 11px 14px;
    border-top: 1px solid var(--lf-border);
    vertical-align: top;
    color: #334155;
    line-height: 1.6;
}

.lf table tbody tr:nth-child(even) td {
    background: #FBFDFF;
}

.lf table tbody tr:hover td {
    background: #FFF7F2;
}

.lf table td.num,
.lf table th.num {
    text-align: right;
    font-variant-numeric: tabular-nums;
}

.lf table tr.is-self td {
    background: #FFF3EC !important;
    font-weight: 600;
}

/* ---------- callout / note ---------- */
.lf-note {
    background: var(--lf-tint);
    border-left: 3px solid #94A3B8;
    border-radius: 0 8px 8px 0;
    padding: 14px 18px;
    margin: 1.5rem 0;
    font-size: .95rem;
    color: var(--lf-muted);
}

.lf-note b {
    color: var(--lf-ink);
}

.lf-warn {
    background: #FFF8ED;
    border-left: 3px solid #D97706;
    border-radius: 0 8px 8px 0;
    padding: 14px 18px;
    margin: 1.5rem 0;
    font-size: .95rem;
    color: #7C2D12;
}

/* ---------- decision checklist ---------- */
.lf-check {
    list-style: none;
    margin: 1.2rem 0 2rem !important;
    padding: 0 !important;
}

.lf-check li {
    position: relative;
    padding: 10px 0 10px 34px;
    border-bottom: 1px solid var(--lf-border);
}

.lf-check li::before {
    content: "";
    position: absolute;
    left: 0;
    top: 12px;
    width: 18px;
    height: 18px;
    border-radius: 4px;
    border: 1.5px solid #CBD5E1;
    background: #fff;
}

.lf-check li b {
    color: var(--lf-ink);
}

/* ---------- FAQ ---------- */
.lf-faq {
    margin: 1.4rem 0 2rem;
}

.lf-faq details {
    border: 1px solid var(--lf-border);
    border-radius: 10px;
    margin-bottom: 10px;
    background: #fff;
    overflow: hidden;
}

.lf-faq details[open] {
    border-color: #FBD9C6;
    box-shadow: 0 4px 16px rgba(15, 23, 42, .05);
}

.lf-faq summary {
    cursor: pointer;
    padding: 15px 18px;
    font-weight: 600;
    color: var(--lf-ink);
    list-style: none;
    display: flex;
    justify-content: space-between;
    gap: 14px;
    align-items: flex-start;
    font-size: 1rem;
    line-height: 1.5;
}

.lf-faq summary::-webkit-details-marker {
    display: none;
}

.lf-faq summary::after {
    content: "+";
    flex: none;
    color: var(--lf-accent);
    font-size: 1.3rem;
    line-height: 1;
    font-weight: 700;
}

.lf-faq details[open] summary::after {
    content: "–";
}

.lf-faq details > div {
    padding: 0 18px 16px;
    color: #334155;
    font-size: .97rem;
    line-height: 1.75;
}

.lf-faq details > div p:last-child {
    margin-bottom: 0;
}

/* ---------- sources ---------- */
.lf-src {
    margin: 2.4rem 0 0;
    padding: 18px 20px;
    background: var(--lf-tint);
    border: 1px solid var(--lf-border);
    border-radius: 10px;
    font-size: .85rem;
    color: var(--lf-muted);
}

.lf-src h3 {
    margin: 0 0 .6rem;
    font-size: .78rem !important;
    letter-spacing: .09em;
    text-transform: uppercase;
    color: var(--lf-ink) !important;
}

.lf-src ol {
    margin: 0 0 0 1.1rem !important;
    padding: 0 !important;
}

.lf-src li {
    margin: .35rem 0;
    font-size: .85rem;
    line-height: 1.6;
    word-break: break-word;
}

/* ---------- glossary ---------- */
.lf-gloss {
    margin: 0;
}

.lf-gloss dt {
    font-weight: 700;
    color: var(--lf-ink);
    font-size: 1.06rem;
    margin-top: 1.6rem;
    scroll-margin-top: 96px;
}

.lf-gloss dt span {
    font-weight: 400;
    color: var(--lf-muted);
    font-size: .88rem;
}

.lf-gloss dd {
    margin: .4rem 0 0;
    color: #334155;
    line-height: 1.75;
}

.lf-alpha {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin: 1.4rem 0 2rem;
}

.lf-alpha a {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 34px;
    height: 34px;
    border-radius: 8px;
    background: var(--lf-tint);
    border: 1px solid var(--lf-border);
    font-size: .85rem;
    font-weight: 600;
    color: var(--lf-ink) !important;
    text-decoration: none !important;
}

.lf-alpha a:hover {
    background: var(--lf-accent);
    border-color: var(--lf-accent);
    color: #fff !important;
}

/* ---------- print ---------- */
@media print {
    .lf-toc,
    .lf-answer,
    .lf-faq {
        break-inside: avoid;
    }

    .lf table {
        font-size: .78rem;
    }
}
