/* ---------------------------------------------------------------------------
   The Learn section as pages: /learn/<topic>, and the browse block on /learn.
   ---------------------------------------------------------------------------
   Both are generated — see scripts/gen-learn.js — so this file is the only
   place their appearance is decided.

   Two rules shape it. First, these pages are read rather than scanned, unlike
   every other page on this site: one column, a real measure, generous leading,
   nothing in the margin competing for attention. Second, the definition list is
   the payload, so it gets the structure — a hairline per entry, the headword in
   the interface font and the example set apart — while the written sections
   above it stay plain prose.

   `.lt` borrows the measure and rhythm of doc.css deliberately: the pages that
   are meant to be believed and the pages that are meant to be learned from
   should feel like the same kind of document.
--------------------------------------------------------------------------- */

.lt {
    max-width: 760px;
    margin: 0 auto;
    padding: 54px 22px 110px;
}

/* --- Breadcrumb ---------------------------------------------------------- */
.lt-crumb {
    display: flex;
    align-items: center;
    gap: 8px;
    font-family: "JetBrains Mono", ui-monospace, monospace;
    font-size: 11.5px;
    letter-spacing: 0.06em;
    color: var(--faint);
}

.lt-crumb a {
    color: var(--muted);
    text-decoration: none;
    border-bottom: 1px solid transparent;
}

.lt-crumb a:hover,
.lt-crumb a:focus-visible {
    color: var(--txt);
    border-bottom-color: var(--violet);
}

/* --- Masthead ------------------------------------------------------------ */
.lt-eyebrow {
    display: flex;
    align-items: center;
    gap: 9px;
    margin-top: 26px;
    font-family: "JetBrains Mono", ui-monospace, monospace;
    font-size: 11.5px;
    font-weight: 700;
    letter-spacing: 0.16em;
    text-transform: uppercase;
    color: var(--violet);
}

.lt-ico {
    font-size: 15px;
    line-height: 1;
}

.lt h1 {
    margin: 14px 0 0;
    font-size: clamp(32px, 5vw, 46px);
    font-weight: 800;
    letter-spacing: -0.035em;
    line-height: 1.06;
}

.lt-lede {
    margin: 16px 0 0;
    padding-bottom: 30px;
    border-bottom: 1px solid var(--card-brd);
    font-size: 17px;
    line-height: 1.65;
    color: var(--muted);
}

/* --- Written sections ---------------------------------------------------- */
.lt h2 {
    margin: 46px 0 12px;
    font-size: 21px;
    font-weight: 700;
    letter-spacing: -0.022em;
}

.lt p {
    margin: 0 0 14px;
    font-size: 15.5px;
    line-height: 1.74;
    color: #c2c6d6;
}

.lt b,
.lt strong {
    color: var(--txt);
    font-weight: 650;
}

.lt a {
    color: var(--txt);
    text-decoration: none;
    border-bottom: 1px solid rgba(139, 92, 246, 0.5);
}

.lt a:hover,
.lt a:focus-visible {
    color: #fff;
    border-bottom-color: var(--violet);
}

.lt-note {
    font-size: 14px !important;
    color: var(--faint) !important;
}

/* --- The definition list ------------------------------------------------- */
.lt-terms {
    margin: 22px 0 0;
    border-top: 1px solid var(--card-brd);
}

.lt-terms dt {
    margin: 0;
    padding: 22px 0 0;
    font-size: 16.5px;
    font-weight: 700;
    letter-spacing: -0.012em;
    color: var(--txt);
    /* So a #anchor from the index doesn't land the headword under the sticky
       header of a narrow viewport. */
    scroll-margin-top: 84px;
}

.lt-terms dd {
    margin: 0;
    padding: 7px 0 22px;
    border-bottom: 1px solid var(--card-brd);
}

.lt-terms dd p {
    margin: 0;
    font-size: 15px;
    line-height: 1.7;
    color: #c2c6d6;
}

.lt-terms code {
    font-family: "JetBrains Mono", ui-monospace, monospace;
    font-size: 0.88em;
    padding: 1.5px 5px;
    border-radius: 5px;
    background: rgba(139, 92, 246, 0.11);
    color: #cbb6ff;
}

/* The worked example is the part people actually read, so it is set apart
   rather than run on from the definition. */
.lt-eg {
    margin-top: 9px !important;
    padding-left: 13px;
    border-left: 2px solid rgba(139, 92, 246, 0.35);
    color: var(--muted) !important;
    font-size: 14.5px !important;
}

.lt-eg span {
    font-family: "JetBrains Mono", ui-monospace, monospace;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: var(--faint);
    margin-right: 6px;
}

/* --- Where you'll see these ---------------------------------------------- */
.lt-see ul {
    margin: 0;
    padding-left: 20px;
}

.lt-see li {
    margin-bottom: 10px;
    font-size: 15px;
    line-height: 1.7;
    color: #c2c6d6;
}

.lt-see li::marker {
    color: var(--faint);
}

/* --- Other topics -------------------------------------------------------- */
.lt-chips {
    display: flex;
    flex-wrap: wrap;
    gap: 9px;
}

.lt-chip {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 8px 13px;
    border: 1px solid var(--card-brd);
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.025);
    font-size: 13.5px;
    font-weight: 600;
    color: var(--muted) !important;
    border-bottom: 1px solid var(--card-brd) !important;
    transition:
        border-color 0.16s ease,
        color 0.16s ease,
        background 0.16s ease;
}

.lt-chip:hover,
.lt-chip:focus-visible {
    color: var(--txt) !important;
    border-color: rgba(139, 92, 246, 0.5) !important;
    background: rgba(139, 92, 246, 0.07);
}

.lt-chip-ico {
    font-size: 14px;
    line-height: 1;
}

.lt-chip-n {
    font-family: "JetBrains Mono", ui-monospace, monospace;
    font-size: 11px;
    color: var(--faint);
}

.lt-fine {
    margin-top: 48px !important;
    padding-top: 22px;
    border-top: 1px solid var(--card-brd);
    font-size: 13px !important;
    color: var(--faint) !important;
}

/* ===========================================================================
   The browse block on /learn.
   ===========================================================================
   Sits under the search box. learn.js hides it while a search is running, so
   the two never argue about who owns the page.
=========================================================================== */

.lb {
    max-width: 1100px;
    margin: 10px auto 0;
    padding: 0 4px 40px;
}

.lb-lede-top {
    max-width: 720px;
    margin: 0 0 8px;
    font-size: 16.5px;
    line-height: 1.65;
    color: var(--muted);
}

.lb h2 {
    margin: 40px 0 12px;
    font-size: 20px;
    font-weight: 700;
    letter-spacing: -0.02em;
}

.lb > p {
    max-width: 720px;
    margin: 0 0 14px;
    font-size: 15.5px;
    line-height: 1.74;
    color: #c2c6d6;
}

.lb a {
    color: var(--txt);
    text-decoration: none;
    border-bottom: 1px solid rgba(139, 92, 246, 0.45);
}

.lb a:hover,
.lb a:focus-visible {
    color: #fff;
    border-bottom-color: var(--violet);
}

.lb-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 16px;
    margin-top: 18px;
}

.lb-card {
    display: flex;
    flex-direction: column;
    padding: 20px;
    border: 1px solid var(--card-brd);
    border-radius: var(--radius);
    background: var(--card);
}

.lb-head {
    display: flex;
    align-items: center;
    gap: 10px;
    border-bottom: 0 !important;
}

.lb-head:hover h3,
.lb-head:focus-visible h3 {
    color: #fff;
}

.lb-ico {
    font-size: 18px;
    line-height: 1;
}

.lb-card h3 {
    margin: 0;
    flex: 1;
    font-size: 17px;
    font-weight: 700;
    letter-spacing: -0.02em;
    color: var(--txt);
    transition: color 0.16s ease;
}

.lb-n {
    font-family: "JetBrains Mono", ui-monospace, monospace;
    font-size: 11px;
    font-weight: 700;
    color: var(--faint);
}

.lb-lede {
    margin: 11px 0 0;
    font-size: 14px;
    line-height: 1.62;
    color: var(--muted);
}

/* Every headword in the category, linked to its anchor on the topic page. This
   is the part that makes the index worth crawling and worth scanning: you can
   see whether the word you want is in the book without opening anything. */
.lb-terms {
    margin: 14px 0 0;
    padding-top: 13px;
    border-top: 1px solid var(--card-brd);
    font-size: 12.5px;
    line-height: 2;
    color: var(--faint);
}

.lb-terms a {
    color: var(--muted);
    border-bottom: 0 !important;
    /* Headwords are two and three words long ("Call Option (CE)", "Time Value
       (Extrinsic)"), and letting them wrap mid-name turned the list into an
       unreadable run of fragments. They break between terms, never inside one. */
    white-space: nowrap;
}

.lb-terms a:hover,
.lb-terms a:focus-visible {
    color: var(--txt);
    text-decoration: underline;
    text-underline-offset: 3px;
}

.lb-sep {
    margin: 0 6px;
    color: rgba(255, 255, 255, 0.14);
}

@media (max-width: 700px) {
    .lt {
        padding: 40px 16px 80px;
    }
    .lb-grid {
        grid-template-columns: 1fr;
    }
}

@media (prefers-reduced-motion: reduce) {
    .lt-chip,
    .lb-card h3 {
        transition: none;
    }
}
