/* ═══════════════════════════════════════════════════════════════════════════
   resources.html on the rb.css system.
   P6/F1: one white sheet. The header (title, dek), the "Start here" paths
   (four ordered lists that jump to rows), then the categories as a ruled
   accordion: the first open, the closed headings are the index (name,
   count, plus), one tight ruled list. Each entry is a ruled
   row: the title is the link, the action label a quiet ink link.
   Closes on the red kolam band, as the homepage and workshop do.
   Loaded after rb.css; nothing here changes shared components.
   ═══════════════════════════════════════════════════════════════════════════ */

/* ─────────────── nav: mark the current page (scoped; see report) ─────────────── */

/* ─────────────── header sheet ─────────────── */
.lib-head { padding-top: 8px; }
.lib-sheet { background: var(--sheet); padding: 72px var(--sheet-pad) 0; }
.lib-top {
    display: grid;
    grid-template-columns: repeat(12, minmax(0, 1fr));
    column-gap: var(--col-gap);
    align-items: end;
}
.lib-top h1 {
    grid-column: 1 / span 7;
    font-weight: 500;
    font-size: clamp(56px, 6.3vw, 92px);
    line-height: .95;
    letter-spacing: -0.052em;
    text-wrap: balance;
}
.lib-dek { grid-column: 8 / span 5; padding-bottom: 6px; }
.lib-dek > p:first-child { font-size: 19px; line-height: 1.5; color: var(--ink-2); max-width: 30em; }
.lib-verified { margin-top: 14px; font-size: 15px; color: #5e5e5e; }
.lib-blog { margin-top: 14px; font-size: 17px; color: var(--ink-2); }
.lib-blog .ln { display: inline-block; padding-block: 10px; }

/* ─────────────── library sheet ─────────────── */
/* The library continues the header's sheet: no grey gap between them. */
.lib { padding-top: 0; padding-bottom: 96px; }
.lib-body {
    background: var(--sheet);
    display: grid;
    grid-template-columns: repeat(12, minmax(0, 1fr));
    column-gap: var(--col-gap);
    align-items: start;
    padding: 0 var(--sheet-pad) 96px;
}

/* Start here: four reading paths, ruled like the rows below. */
.paths { grid-column: 1 / -1; margin-top: 64px; padding: 0; }  /* reset rb.css section padding */
.paths h2 { font-size: clamp(28px, 2.4vw, 36px); font-weight: 500; letter-spacing: -0.035em; line-height: 1.1; }
.paths-dek { margin-top: 10px; font-size: 17px; line-height: 1.5; color: var(--ink-2); max-width: 40em; }
.paths-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    column-gap: var(--col-gap);
    row-gap: 32px;
    margin-top: 28px;
}
.path { border-top: 1.5px solid var(--ink); padding-top: 16px; }
.path summary { list-style: none; cursor: default; display: flex; align-items: baseline; justify-content: space-between; gap: 12px; }
.path summary::-webkit-details-marker { display: none; }
.path h3 { font-size: 19px; font-weight: 500; letter-spacing: -0.02em; line-height: 1.25; }
.path > p { margin-top: 6px; font-size: 15px; line-height: 1.45; color: #5e5e5e; }
.path ol { margin: 14px 0 0; padding: 0; list-style: none; counter-reset: step; }
.path li { counter-increment: step; display: flex; gap: 10px; border-top: 1px solid var(--rule); }
.path li::before { content: counter(step); flex: none; width: 1.1em; padding-top: 10px; font-size: 15px; color: var(--red-ink); font-variant-numeric: tabular-nums; }
.path li a {
    display: block; padding: 9px 0 10px; min-height: 44px; box-sizing: border-box;
    font-size: 16px; line-height: 1.35; color: var(--ink);
    text-decoration: underline; text-decoration-color: #b4b4b4; text-decoration-thickness: 1px; text-underline-offset: 3px;
    transition: color .15s, text-decoration-color .15s;
}
.path li a:hover { color: var(--red-ink); text-decoration-color: var(--red); }
.resource-row:target { background: linear-gradient(90deg, rgba(216, 54, 26, .06), rgba(216, 54, 26, 0) 70%); }

/* categories: the first open, the rest a ruled list of closed headings
   that doubles as the page's index (F1: no separate jump list). */
.lib-cats { grid-column: 1 / -1; min-width: 0; margin-top: 64px; border-top: 1.5px solid var(--ink); }
.cat-details summary {
    list-style: none;
    cursor: pointer;
    display: flex;
    align-items: baseline;
    gap: 8px 20px;
    padding: 22px 0 20px;
    border-bottom: 1px solid var(--rule);
    min-height: 44px;
}
.cat-details summary::-webkit-details-marker { display: none; }
.cat-details summary h2 {
    font-size: clamp(26px, 2.3vw, 34px);
    font-weight: 500;
    letter-spacing: -0.04em;
    line-height: 1.05;
    text-wrap: balance;
}
.cat-details[open] summary { border-bottom: 1.5px solid var(--ink); }
/* Closed headings read as an index: one size down, tighter rows. */
.cat-details:not([open]) summary { padding: 15px 0 13px; }
.cat-details:not([open]) summary h2 { font-size: clamp(22px, 1.75vw, 26px); letter-spacing: -0.03em; }
.cat-details:not([open]) summary::after { font-size: 26px; }
.cat-details[open] .resource-list { padding-bottom: 40px; }
/* The category name is a permalink to its own section; the count and the
   +/- marker still toggle the list. */
.cat-details summary h2 a { padding-block: 8px; color: inherit; text-decoration: none; transition: color .15s; }
.cat-details summary h2 a:hover { color: var(--red-ink); }
.cat-count { margin-left: auto; flex: none; font-size: 16px; color: var(--ink-2); white-space: nowrap; }
.cat-details summary::after {
    content: "\2212";
    flex: none;
    width: 24px;
    text-align: right;
    font-size: 30px;
    line-height: 1;
    color: var(--red);
}
.cat-details:not([open]) summary::after { content: "+"; }
.cat-details summary:hover .cat-count { color: var(--ink); }
.cat:target .cat-details summary h2 a { color: var(--red-ink); }

/* rows: the title is the link; the action label is a quiet ink link */
.resource-row {
    display: grid;
    grid-template-columns: minmax(0, 5fr) minmax(0, 7fr);
    grid-template-rows: auto auto 1fr;
    column-gap: var(--col-gap);
    padding: 24px 0 22px;
    border-bottom: 1px solid var(--rule);
}
.resource-row-head { display: contents; }
.resource-row h3 {
    grid-column: 1; grid-row: 1;
    font-size: 21px;
    font-weight: 500;
    letter-spacing: -0.02em;
    line-height: 1.22;
}
/* P5: the title reads as the link at rest (a light rule under it, ink on
   hover turns vermilion). F3: each row is one link. The title's link covers
   the whole row; the action label (same URL, kept in the markup but out of
   the tab order and the accessibility tree) is a quiet meta line, never a
   second underlined link. */
.resource-row { position: relative; }
.resource-row h3 a {
    padding-block: 10px;  /* inline: widens the hit area, not the layout */
    color: var(--ink);
    text-decoration: underline;
    text-decoration-color: #b4b4b4;
    text-decoration-thickness: 1.5px;
    text-underline-offset: 4px;
    transition: color .15s, text-decoration-color .15s;
}
.resource-row h3 a::after { content: ""; position: absolute; inset: 0; }
.resource-row h3 a:focus-visible { outline: none; }
.resource-row:has(h3 a:focus-visible) { outline: 2px solid var(--red-ink); outline-offset: 4px; }
.resource-row:hover h3 a { color: var(--red-ink); text-decoration-color: var(--red); }
/* level and cost: two quiet labels under the title */
.resource-tags {
    grid-column: 1; grid-row: 2;
    display: flex; flex-wrap: wrap; gap: 6px;
    margin-top: 10px;
}
.resource-tags span {
    font-size: 13px; line-height: 1; letter-spacing: .01em;
    color: var(--ink-2);
    padding: 5px 8px 4px;
    border: 1px solid var(--rule);
    border-radius: 3px;
    white-space: nowrap;
}
.resource-row .resource-meta {
    grid-column: 1; grid-row: 3;
    align-self: start;
    justify-self: start;
    margin-top: 8px;
    font-size: 15px;
    font-weight: 400;
    line-height: 1.4;
    color: #5e5e5e;  /* 6.4:1 on white */
    text-decoration: none;
    pointer-events: none;
}
.resource-row > p {
    grid-column: 2; grid-row: 1 / span 3;
    font-size: 17px;
    line-height: 1.55;
    color: var(--ink-2);
    max-width: 38em;
}

/* ─────────────── closing band (red, below) ─────────────── */
.close .hero-ctas { gap: 12px 28px; }
.close .ln { display: inline-flex; align-items: center; min-height: 44px; font-size: 18px; }

/* ═══════════════════ responsive ═══════════════════ */
@media (max-width: 1100px) {
    .lib-top h1 { grid-column: 1 / -1; }
    .lib-dek { grid-column: 1 / span 9; margin-top: 28px; padding-bottom: 0; }
    .resource-row { display: flex; flex-direction: column; padding: 22px 0 20px; }
    .resource-row > p { margin-top: 8px; }
    .resource-row .resource-meta { order: 3; margin-top: 8px; }
    .paths-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 820px) {
    html { scroll-padding-top: 88px; }
    .lib-sheet { padding: 36px var(--sheet-pad) 0; }
    .lib-top { display: block; }
    .lib-top h1 { font-size: clamp(42px, 12.2vw, 72px); line-height: .96; }
    .lib-dek { margin-top: 20px; }
    .lib-dek > p:first-child { font-size: 17px; line-height: 1.45; }
    .lib-blog { margin-top: 6px; font-size: 16px; }


    .lib { padding-top: 0; padding-bottom: 48px; }
    .lib-body { display: block; padding: 28px var(--sheet-pad) 48px; }
    .lib-cats { margin-top: 48px; }
    .paths { margin-top: 4px; }
    .paths-grid { grid-template-columns: minmax(0, 1fr); row-gap: 0; margin-top: 22px; border-bottom: 1px solid var(--rule); }
    .path { border-top: 1px solid var(--rule); padding-top: 0; }
    .paths-grid .path:first-child { border-top: 1.5px solid var(--ink); }
    .path summary { cursor: pointer; align-items: center; min-height: 44px; padding: 12px 0; }
    .path summary::after { content: "+"; flex: none; color: var(--red-ink); font-size: 24px; line-height: 1; }
    .path[open] summary::after { content: "\2212"; }
    .path[open] summary { padding-bottom: 4px; }
    .path[open] > ol { margin-bottom: 14px; }
    .paths-dek { font-size: 16px; }
    .cat-details summary {
        display: grid; grid-template-columns: minmax(0, 1fr) auto;
        align-items: center; column-gap: 16px; row-gap: 2px;
        padding: 14px 0 12px;
    }
    .cat-details summary h2 { grid-column: 1; font-size: clamp(23px, 6.6vw, 28px); text-wrap: pretty; }
    .cat-details:not([open]) summary { padding: 11px 0 9px; }
    .cat-details:not([open]) summary h2 { font-size: 21px; }
    .cat-count { grid-column: 1; margin-left: 0; font-size: 15px; }
    .cat-details summary::after { grid-column: 2; grid-row: 1 / span 2; width: 18px; }
    .cat-details[open] .resource-list { padding-bottom: 24px; }
    .resource-row { padding: 16px 0 16px; }
    .resource-row h3 { font-size: 19px; }
    .resource-row > p { font-size: 16px; margin-top: 6px; }
    .resource-row .resource-meta { font-size: 15px; }
    .close .ln { font-size: 17px; }
}

/* ─────────────── closing band: the vermilion kolam band ───────────────
   F1: the same red band that ends the homepage, workshop and certification
   pages (rb.css .close, the #kolam symbol drawn by rb-motion.js on view).
   One inner edge: the band's copy starts on the page's text line. */
.res-close .wrap { padding-left: calc(var(--gut) + var(--sheet-pad)); padding-right: calc(var(--gut) + var(--sheet-pad)); }
.res-close .fine a { color: #fff; }
.res-close .hero-ctas { column-gap: 32px; }
.res-close .ln { color: #fff; text-decoration-color: rgba(255, 255, 255, .7); }
.res-close .ln:hover { color: #fff; text-decoration-color: #fff; text-decoration-thickness: 2.5px; }
@media (max-width: 820px) {
    .res-close .hero-ctas { flex-direction: column; align-items: stretch; gap: 4px; }
}
/* F5: the kolam sits whole inside the band at every desktop width, as on
   the workshop and certification pages. The drawing fills 87% of its box,
   so a 6.4% inset per side puts the drawn line on the page's inner edge.
   Phones use rb.css. */
@media (min-width: 1360px) {
    .res-close .close-kolam {
        --ks: clamp(460px, 38vw, 600px);
        width: var(--ks); height: var(--ks); margin-top: calc(var(--ks) / -2);
        right: calc(var(--gut) + var(--sheet-pad) - var(--ks) * .064);
    }
}
/* 821-1359: the copy needs the width, so the kolam sits whole under it on
   the inner right edge. */
@media (min-width: 821px) and (max-width: 1359px) {
    .res-close .wrap { padding-bottom: 392px; }
    .res-close .close-kolam { width: 320px; height: 320px; top: auto; bottom: 36px; right: calc(var(--gut) + var(--sheet-pad) - 20px); margin-top: 0; }
}
