/* fire-page.css — the rail-and-window fire history page.
   Shared by every fire that has a sections.json. Extracted from the
   Eagle Canyon prototype so a change here reaches all of them. */
/* ============================================================================
     Fire page, rail-and-window layout — PROTOTYPE

     Built to match Fire-Map/recreation-map: a narrow rail of buttons on the
     left and one wide window on the right, running nearly the full width of
     the browser rather than inside a centred column.

     Additive only. fire-cover.css and fire-cover.js are untouched, so the
     existing cover page is unaffected.
     ========================================================================= */

  :root{
    --rail-width:220px;
    --rail-border:#d8d2c4;
    --rail-bg:#fbf9f3;
    --panel-head-bg:#f0e8d7;
    /* the group headers are a darker step of the same warm ground,
       not black, so the rail stays inside the palette */
    --grp-bg:#dcd0b4;
    --grp-bg-hover:#d3c5a2;
    --grp-rule:#b6a582;
    --grp-text:#2a2620;
    --grp-chev:#6b6152;
    --panel-body-bg:#fbf9f3;
    --rail-muted:#6e6359;
    --rail-text:#2a2620;

    --bg:#fbf9f3;
    --surface:#fbf9f3;
    --surface-2:#f0ebe2;
    --text:#1d1a17;
    --accent:#8f3a12;
    --accent-dark:#6f2c0d;
    --line:#d8d2c4;
    --line-soft:#e6e0d3;
    --muted:#5c554c;
    --faint:#736b60;
    --serif-display:'Playfair Display','Cormorant Garamond',Georgia,'Times New Roman',serif;
    --sans:'Source Sans 3',-apple-system,BlinkMacSystemFont,'Helvetica Neue',Arial,sans-serif;
  }

  body{margin:0;background:var(--bg);color:var(--text);font-family:var(--sans);
    -webkit-font-smoothing:antialiased}

  .skip-link{position:absolute;left:-999px}
  .skip-link:focus{left:8px;top:8px;background:var(--surface);padding:8px 12px;z-index:50}

  /* ---------- masthead, same proportions as the recreation map ---------- */

  .site-masthead{background:#f7f3e9;padding:.35rem 0 0;border-bottom:1px solid var(--line)}
  .site-masthead .wrap{max-width:100%;margin:0 auto;padding:0 1rem}
  .masthead-row{display:grid;grid-template-columns:1fr auto 1fr;align-items:center;
    gap:1.5rem;min-height:96px}
  .masthead-brand{display:flex;align-items:center;gap:.85rem;text-decoration:none;
    color:var(--text);justify-self:start}
  .masthead-brand img,.masthead-utils img{height:72px;width:auto;display:block;flex-shrink:0}
  .masthead-title{font-family:var(--serif-display);font-weight:700;font-style:italic;
    font-size:2.6rem;line-height:1.05;margin:0;text-align:center;color:var(--text)}
  .masthead-title .mh-kicker{display:block;font-family:var(--sans);font-style:normal;
    font-weight:700;font-size:.72rem;letter-spacing:.16em;text-transform:uppercase;
    color:var(--accent);margin-bottom:.42rem}
  .masthead-title .mh-sub{display:block;font-family:var(--sans);font-style:normal;
    font-weight:400;font-size:.82rem;letter-spacing:.02em;color:var(--muted);margin-top:.38rem}
  .masthead-utils{display:flex;align-items:center;gap:1rem;justify-self:end}
  .masthead-utils a img{height:44px;width:auto;display:block}
  .mh-close{font-family:var(--sans);font-size:.78rem;font-weight:600;letter-spacing:.08em;
    text-transform:uppercase;color:var(--text);text-decoration:none;background:transparent;
    border:1px solid var(--text);border-radius:2px;padding:.6rem .9rem;white-space:nowrap}
  .mh-close:hover{background:var(--text);color:#f7f3e9}

  #site-menu{margin-top:.35rem;padding:0;border-top:1px solid #303030;
    border-bottom:1px solid var(--line)}

  /* ---------- the page, full width like the map pages ---------- */

  .v2-wide{max-width:1400px;margin:0 auto;padding:10px 14px 14px}

  /* ---------- pieces the window borrows ----------
     The overview and the progression map now arrive inside the window on the
     right, where they have the full width to work with. */

  .v2-card{background:var(--rail-bg);border:1px solid var(--rail-border);
    border-radius:4px;overflow:hidden;margin-top:20px}
  .v2-card-head{padding:6px 10px;background:var(--panel-head-bg);
    border-bottom:1px solid var(--rail-border);font-size:13.5px;font-weight:600;
    color:var(--rail-text);display:flex;align-items:center;justify-content:space-between;gap:8px}
  .v2-card-head a{font-size:11.5px;font-weight:600;letter-spacing:.05em;
    text-transform:uppercase;color:var(--accent);text-decoration:none}
  .v2-card-head a:hover{text-decoration:underline}

  /* The map gets real height now that it is not squeezed into a top band. */
  .v2-map{position:relative;background:var(--surface);padding:10px;
    display:flex;align-items:center;justify-content:center}
  .v2-map img{width:auto;max-width:100%;height:min(56vh,540px);
    object-fit:contain;display:block}
  .v2-map .cap{margin:0;padding:6px 10px 2px;font-size:11.5px;color:var(--muted);
    text-align:center}

  .v2-meta{margin-top:14px;padding-top:11px;border-top:1px solid var(--line-soft);
    font-size:13px;color:var(--muted)}
  .v2-meta b{color:var(--accent-dark);text-transform:uppercase;
    letter-spacing:.07em;font-size:11px}

/* ---------- rail + window ---------- */

  .v2-layout{
    display:grid;
    grid-template-columns:var(--rail-width) minmax(0,1fr);
    gap:12px;
    align-items:start;
  }

  /* section bodies, drawn by fire-sections.js */
  .v2-window .fs-facts{display:grid;grid-template-columns:repeat(auto-fill,minmax(290px,1fr));gap:9px;margin:0}
  .v2-window .fs-fact{border:1px solid var(--line-soft);border-radius:4px;padding:9px 11px;
    background:var(--surface-2)}
  .v2-window .fs-fact dt{font-size:10px;letter-spacing:.1em;text-transform:uppercase;
    color:var(--accent);font-weight:700;margin:0 0 4px}
  .v2-window .fs-fact dd{margin:0;font-family:var(--sans);font-size:14.5px;font-weight:400;line-height:1.52;
    color:var(--text)}
  .v2-window .fs-prog{width:100%;border-collapse:collapse;font-size:13.5px;margin:0 0 4px;
    background:var(--surface-2);border:1px solid var(--line-soft);border-radius:4px;overflow:hidden}
  .v2-window .fs-prog th{font-size:10px;font-weight:700;letter-spacing:.1em;text-transform:uppercase;
    color:var(--accent);text-align:left;padding:9px 11px;border-bottom:1px solid var(--line-soft)}
  .v2-window .fs-prog td{padding:9px 11px;vertical-align:top;border-bottom:1px solid var(--line-soft);
    line-height:1.45;max-width:none}
  .v2-window .fs-prog tr:last-child td{border-bottom:none}
  .v2-window .fs-day{font-family:var(--serif-display);font-weight:600;white-space:nowrap;width:92px}
  .v2-window .fs-acres{font-family:var(--serif-display);text-align:right;white-space:nowrap;width:84px}
  .v2-window .fs-sources{margin:0;padding-left:21px}
  .v2-window .fs-sources li{margin-bottom:7px}
  .v2-window .fs-empty{color:var(--faint);font-style:italic}
  .v2-window ul,.v2-window ol{max-width:74ch;font-size:15.5px;line-height:1.6;
    margin:0 0 13px;padding-left:21px;color:var(--text)}
  .v2-window li{margin-bottom:6px}
  .v2-window a{color:var(--accent)}
  .v2-window a:hover{color:var(--accent-dark)}
  @media (max-width:820px){
    .v2-window .fs-facts{grid-template-columns:repeat(2,1fr)}
    .v2-window .fs-prog{font-size:12.5px}
    .v2-window .fs-day,.v2-window .fs-acres{width:auto}
  }
  .v2-head{margin:0 0 10px}
  .v2-head [hidden]{display:none}
  .v2-eyebrow{font-size:11px;font-weight:700;letter-spacing:.13em;text-transform:uppercase;
    color:var(--accent);margin:0 0 5px}
  .v2-fire-title{font-family:var(--serif-display);font-size:32px;font-weight:700;
    line-height:1.15;margin:0 0 4px;color:var(--text)}
  .v2-sub{color:var(--muted);font-size:13.5px;margin:0 0 10px}
  .v2-deck{font-family:var(--serif-display);font-style:italic;font-size:17px;line-height:1.55;
    color:#3a3632;margin:0;padding-bottom:16px;border-bottom:1px solid var(--line-soft);
    max-width:80ch}
  @media (max-width:820px){ .v2-fire-title{font-size:26px} .v2-deck{font-size:15.5px} }
  .v2-rail{display:flex;flex-direction:column;gap:5px;min-width:0;
    font-size:13px;color:var(--rail-text)}

  /* Same face as the map rail buttons, without the expand behaviour. */
  .v2-btn{
    appearance:none;
    width:100%;
    display:flex;
    align-items:center;
    justify-content:space-between;
    gap:6px;
    padding:7px 10px;
    background:var(--panel-head-bg);
    border:1px solid var(--rail-border);
    border-radius:4px;
    font-family:var(--sans);
    font-size:14.5px;
    font-weight:600;
    line-height:1.3;
    color:var(--rail-text);
    text-align:left;
    cursor:pointer;
    transition:background .12s,color .12s,border-color .12s;
  }
  .v2-btn:hover{background:#e7dcc4}
  .v2-btn:focus-visible{outline:2px solid var(--accent);outline-offset:2px}
  .v2-btn .n{font-size:12px;font-weight:700;font-variant-numeric:tabular-nums;
    color:var(--rail-muted)}
  .v2-btn .t{flex:1 1 auto;font-weight:400;color:var(--rail-muted)}
  .v2-btn .t.ph{font-style:italic}

  /* Selected: filled, plus a solid left edge so it does not rely on colour. */
  .v2-btn[aria-selected="true"]{
    background:var(--panel-head-bg);
    border-color:var(--grp-rule);
    box-shadow:inset 3px 0 0 var(--accent);
  }
  .v2-btn[aria-selected="true"] .n{color:var(--accent)}
  .v2-btn[aria-selected="true"] .t{color:var(--rail-text);font-weight:700}

  .v2-rail-note{
    margin:2px 0 0;padding:7px 10px;
    background:var(--rail-bg);border:1px solid var(--rail-border);border-radius:4px;
    color:var(--rail-muted);font-size:12px;line-height:1.35;
  }

  /* The window. Wide like the map stage, but the reading text inside is held to
     a comfortable measure so lines never run the full width of a big screen. */
  .v2-window{
    min-width:0;
    background:var(--rail-bg);
    border:1px solid var(--rail-border);
    border-radius:4px;
    min-height:420px;
    /* fire-page.js measures where the window starts and hands back the room
       that is left, so the head can change height without pushing it under
       the fold */
    height:var(--v2-winh,calc(100vh - 190px));
    overflow-y:auto;
    overscroll-behavior:contain;
    padding:22px 26px 30px;
  }
  .v2-window::-webkit-scrollbar{width:10px}
  .v2-window::-webkit-scrollbar-thumb{background:var(--line);border-radius:5px}

  .v2-window h3{font-family:var(--sans);font-size:22px;font-weight:700;
    text-transform:uppercase;letter-spacing:.055em;
    margin:0 0 4px;color:var(--text)}
  .v2-window .sub{font-size:12.5px;color:var(--muted);margin:0 0 18px;
    padding-bottom:13px;border-bottom:1px solid var(--line-soft)}
  .v2-window .book-title{font-family:var(--serif, "Cormorant Garamond", Georgia, serif);
    font-size:22px;font-weight:600;color:var(--text);
    margin:0 0 20px;padding-bottom:14px;
    border-bottom:1px solid var(--line-soft);
    font-style:italic;letter-spacing:.01em;line-height:1.35}

  .v2-window p{max-width:74ch;font-size:16.5px;line-height:1.7;color:var(--text)}

  /* Subheads: the same face as the title, two steps down, so a long section
     reads as a set of chunks rather than one wall. */
  .v2-window .fs-sub{
    max-width:74ch;
    margin:30px 0 10px;
    font-family:var(--sans);
    font-size:15.5px;
    font-weight:700;
    text-transform:uppercase;
    letter-spacing:.06em;
    line-height:1.35;
    color:var(--accent-dark);
  }
  .v2-window .fs-sub:first-child{margin-top:4px}
  .v2-window h3 + .fs-sub{margin-top:8px}
  /* bold inside a paragraph marks a lead-in, not a shout: enough weight to
     find, not enough to read on its own */
  .v2-window p strong,
  .v2-window li strong{font-weight:600;color:var(--text)}

  .v2-placeholder{
    margin-top:18px;padding:16px 18px;max-width:72ch;
    background:var(--panel-body-bg);border:1px dashed var(--rail-border);border-radius:3px;
    font-size:14px;line-height:1.6;color:var(--muted);
  }
  .v2-placeholder b{color:var(--text)}

  /* ---------- the brief, and the band of statistics ---------- */

  .v2-brief{
    display:grid;grid-template-columns:minmax(0,1fr) 232px;
    gap:20px;align-items:start;margin:0 0 9px;
  }
  .v2-brief[hidden]{display:none}
  .v2-brief-k{
    margin:0 0 5px;font-family:var(--sans);font-size:10.5px;font-weight:700;
    letter-spacing:.13em;text-transform:uppercase;color:var(--accent);
  }
  .v2-brief-p{
    margin:0;max-width:78ch;font-family:var(--sans);
    font-size:15.5px;line-height:1.6;color:var(--text);
  }

  .v2-brief-fig{margin:0;border:1px solid var(--rail-border);background:var(--panel-head-bg);border-radius:3px}
  .v2-brief-fig a{display:block;line-height:0}
  .v2-brief-fig img{display:block;width:100%;height:84px;object-fit:contain;padding:6px}
  .v2-brief-fig figcaption{
    padding:4px 8px 5px;border-top:1px solid var(--rail-border);
    font-family:var(--sans);font-size:10px;line-height:1.3;color:var(--muted);
  }

  /* the thin band is also the rule between the head and everything below it */
  .v2-strip{
    display:grid;grid-auto-flow:column;grid-auto-columns:1fr;
    border-top:1px solid var(--rail-border);
    border-bottom:2px solid var(--grp-rule);
    margin:0 0 12px;
  }
  .v2-strip[hidden]{display:none}
  .v2-cell{
    display:flex;align-items:baseline;gap:6px;flex-wrap:wrap;
    padding:5px 12px 6px;border-left:1px solid var(--rail-border);min-width:0;
  }
  .v2-cell:first-child{border-left:0;padding-left:0}
  .v2-cell .k{
    flex:0 0 100%;font-family:var(--sans);font-size:9.5px;font-weight:700;
    letter-spacing:.11em;text-transform:uppercase;color:var(--faint);
    line-height:1.2;margin-bottom:1px;
  }
  .v2-cell .v{font-family:var(--sans);font-size:18px;font-weight:600;line-height:1.1;color:var(--text)}
  .v2-cell .v.text{font-size:15px;font-weight:600}
  .v2-cell .v small{font-family:var(--sans);font-size:11px;font-weight:600;margin-left:2px}
  .v2-cell .s{
    font-family:var(--sans);font-size:10px;line-height:1.25;color:var(--muted);
    min-width:0;overflow-wrap:anywhere;
  }

  @media (max-width:980px){
    .v2-brief{grid-template-columns:1fr;gap:14px}
    .v2-brief-fig{max-width:320px}
    .v2-strip{grid-auto-flow:row;grid-template-columns:1fr 1fr;grid-auto-columns:auto}
    .v2-cell{border-left:0;border-top:1px solid var(--rail-border);padding-left:0}
    .v2-cell:nth-child(2n){padding-left:12px;border-left:1px solid var(--rail-border)}
    .v2-cell:first-child,.v2-cell:nth-child(2){border-top:0}
  }

  /* ---------- grouped rail ---------- */

  /* the rail gets the same room as the window, and scrolls inside it, so a
     fire with a lot of groups never pushes the page itself into a scroll */
  .v2-rail{
    max-height:var(--v2-winh,none);
    overflow-y:auto;overscroll-behavior:contain;
    padding-right:4px;
  }

  .v2-grp{margin-bottom:9px}
  .v2-grp:last-child{margin-bottom:0}

  /* the group header only opens and closes, so it is deliberately not
     dressed as one of the section buttons */
  .v2-grphead{font-size:13.5px;
    appearance:none;width:100%;display:flex;align-items:center;
    justify-content:space-between;gap:8px;
    padding:8px 10px;
    background:var(--grp-bg);border:1px solid var(--grp-rule);border-radius:4px;
    font-family:var(--sans);font-size:11.5px;font-weight:700;
    letter-spacing:.1em;text-transform:uppercase;
    color:var(--grp-text);text-align:left;cursor:pointer;
    transition:background .14s ease;
  }
  .v2-grphead:hover{background:var(--grp-bg-hover);border-color:var(--grp-rule)}
  .v2-grphead:focus-visible{outline:2px solid var(--accent);outline-offset:2px}
  .v2-grpname{flex:1 1 auto;min-width:0}

  .v2-chev{
    flex:0 0 auto;width:8px;height:8px;
    border-right:1.6px solid var(--grp-chev);border-bottom:1.6px solid var(--grp-chev);
    transform:rotate(45deg) translate(-2px,-2px);
    transition:transform .16s ease;
  }
  .v2-grphead[aria-expanded="true"] .v2-chev{transform:rotate(-135deg) translate(-2px,-2px)}

  .v2-grpbody{padding:7px 0 2px 0;display:flex;flex-direction:column;gap:5px}
  .v2-grpbody .v2-btn[role="tab"] + .v2-out{margin-top:11px}
  .v2-grpbody[hidden]{display:none}
  .v2-grpnote{
    margin:0 2px 3px;font-size:11.5px;line-height:1.45;
    color:var(--rail-muted);font-style:italic;
  }

  /* links out of the page, and the things that do not exist yet */
  .v2-out{text-decoration:none}
  .v2-out .n{color:var(--accent);font-size:12px}
  .v2-badge{
    font-style:normal;font-size:10.5px;letter-spacing:.05em;
    color:var(--faint);white-space:nowrap;
  }
  .v2-out.is-empty{opacity:.5;cursor:default}
  .v2-out.is-empty:hover{background:var(--panel-head-bg)}
  .v2-out.is-empty .n{color:var(--faint)}

  @media (prefers-reduced-motion:reduce){
    .v2-chev,.v2-grphead{transition:none}
  }

  /* ---------- photographs ---------- */

  .fs-gallery{
    display:grid;gap:16px;margin:4px 0 2px;
    grid-template-columns:repeat(auto-fill,minmax(230px,1fr));
  }
  .fs-shot{margin:0}
  .fs-shot-open{
    display:block;width:100%;padding:0;border:1px solid var(--line);border-radius:2px;
    background:var(--surface-2);cursor:zoom-in;overflow:hidden;line-height:0;
    transition:border-color .15s ease;
  }
  .fs-shot-open:hover,.fs-shot-open:focus-visible{border-color:var(--accent);outline:none}
  .fs-shot-open img{width:100%;height:158px;object-fit:cover;display:block}
  .fs-shot figcaption{
    font-size:12.5px;line-height:1.5;color:var(--muted);padding-top:7px;
  }
  .fs-credit{color:var(--faint);font-style:italic}
  .fs-credit::before{content:"— "}

  /* the frame itself */
  .fs-lb[hidden]{display:none}
  .fs-lb{
    position:fixed;inset:0;z-index:200;
    display:grid;align-items:center;justify-items:center;
    grid-template-columns:64px minmax(0,1fr) 64px;
    background:rgba(20,17,14,.93);padding:26px 10px 54px;
  }
  body.fs-lb-on{overflow:hidden}
  .fs-lb-frame{
    grid-column:2;margin:0;display:flex;flex-direction:column;align-items:center;
    max-height:100%;min-width:0;
  }
  .fs-lb-frame img{
    max-width:100%;max-height:76vh;object-fit:contain;display:block;
    background:#000;border:1px solid rgba(255,255,255,.14);
  }
  .fs-lb-frame figcaption{
    color:#e9e2d6;font-size:13.5px;line-height:1.55;max-width:74ch;
    padding:12px 6px 0;text-align:center;
  }
  .fs-lb-frame .fs-credit{color:#b3a999}
  .fs-lb-close{
    position:absolute;top:12px;right:16px;z-index:1;
    background:none;border:0;color:#e9e2d6;font-size:34px;line-height:1;
    padding:2px 10px;cursor:pointer;
  }
  .fs-lb-nav{
    background:none;border:0;color:#e9e2d6;font-size:48px;line-height:1;
    padding:8px 14px;cursor:pointer;opacity:.7;
  }
  .fs-lb-nav:hover,.fs-lb-nav:focus-visible{opacity:1;outline:none}
  .fs-lb-prev{grid-column:1}
  .fs-lb-next{grid-column:3}
  .fs-lb-nav[hidden]{visibility:hidden;display:block}
  .fs-lb-count{
    position:absolute;bottom:16px;left:0;right:0;text-align:center;margin:0;
    color:#b3a999;font-size:12px;letter-spacing:.09em;text-transform:uppercase;
  }
  @media (max-width:640px){
    .fs-lb{grid-template-columns:40px minmax(0,1fr) 40px;padding:14px 4px 48px}
    .fs-lb-nav{font-size:34px;padding:6px 4px}
    .fs-shot-open img{height:132px}
  }

  /* ---------- narrow screens ---------- */

  @media (max-width:900px){
    .masthead-row{grid-template-columns:1fr;gap:.6rem;text-align:center;min-height:0;
      padding:.6rem 0}
    .masthead-brand,.masthead-utils{justify-self:center}
    .masthead-title{font-size:1.9rem}
    .v2-top{grid-template-columns:1fr}
    .v2-layout{grid-template-columns:1fr}
    .v2-rail{flex-direction:row;flex-wrap:wrap}
    .v2-rail .v2-btn{width:auto;flex:0 0 auto}
    .v2-window{height:auto;min-height:360px;padding:18px 16px 24px}
  }

  /* ============================================================
     In-overlay chrome hiding
     When a topic page (or any page using this shell) is loaded
     inside the site-overlay iframe, the outer overlay already
     shows a header with the topic name, "Open full page", and
     "Close". The inner site masthead and site menu would then be
     redundant chrome — two logos, two titles, two scrollbars.
     Hide them when <html> or <body> carries data-in-overlay="1",
     set by topic-page.js on boot if window.self !== window.top.
     ============================================================ */
  html[data-in-overlay="1"] .site-masthead,
  body[data-in-overlay="1"] .site-masthead {
    display: none;
  }
  html[data-in-overlay="1"] main.v2-wide,
  body[data-in-overlay="1"] main.v2-wide {
    padding-top: 0;
  }
