/* calm.css — the shared parts of the calmer site (issue #30, the review "CalCOFI.io, calmer", D1–D17).
   Every page re-cut under issue #30 is built from these, so the front door, the three catalogs and the
   three kinds of detail page read as one system. Page-specific rules live in style.css under the page's
   own section; nothing here is page-specific.

   The five rules: one ground, one column · a head of four things (name, one sentence, one picture, one
   line of numbers) · what the page is about stays open · the dense views stay, one click away (a view tab
   or a fold, unchanged) · every fold is titled with its answer.

   Markup (all classes prefixed calm-, so nothing collides with style.css):

     <main class="calm-page">
       <nav class="calm-crumb">…</nav>
       <header class="calm-head [calm-head-1]">          (calm-head-1: no picture, one column)
         <div class="calm-head-l">
           <div class="calm-name"><i class="calm-mark cc-i cc-i-cat-fish"></i><h1>…</h1></div>
           <p class="calm-sub">…</p>   <p class="calm-sentence">…</p>   <p class="calm-facts">…</p>
           <dl class="calm-nums"><div><dd>12,345</dd><dt>observations</dt></div>…</dl>
         </div>
         <figure class="calm-head-r calm-pic">…<figcaption class="calm-cap">…</figcaption></figure>
       </header>
       <section class="calm-sec"><h2><i class="cc-i cc-i-el-observed"></i>Observed in <span class="calm-ans">4 datasets</span></h2>
         <ul class="calm-rows"><li class="calm-row"><div class="calm-row-l"><div class="calm-row-n">…</div>
           <div class="calm-row-m">…</div></div><div class="calm-row-r">(years strip svg)</div></li></ul>
       </section>
       <p class="calm-ways"><a href="…"><i class="cc-i cc-i-way-erddap"></i>ERDDAP</a><span class="calm-sep"></span>…</p>
       <div class="calm-folds">
         <details class="calm-fold" id="cite"><summary><i class="cc-i cc-i-el-cite"></i>Cite
           <span class="calm-ans">Scripps CalCOFI, 2026</span><i class="calm-chev cc-i cc-i-ui-down"></i></summary>
           <div class="calm-body">…</div></details>
       </div>
     </main>

   A catalog's head is .calm-cathead: .calm-siblings (Datasets · Species · Measurements, the current one
   aria-current="page"), h1, one sentence, then the one search (_includes/one_search.html). Its list is
   .calm-list > details.calm-item (summary = one generous row; the body opens to the rest). Dense views are
   .calm-views: assets/tabs.js's .tabset markup, each tab button carrying a view-* icon.

   Icons are brand/v2/icons.css masks: <i class="cc-i cc-i-NAME"></i>, drawn in the text colour. The
   sub-element families added for issue #30 are el-* (a section or fold of a page), view-* (a dense view),
   way-* (a way in) and door-* (the front door's seven doors); the same thing wears the same glyph on every
   page, so a reader can track "Cite" or "Every endpoint" or "R" across datasets, species and measurements. */

.calm-page { max-width: var(--container); margin: 0 auto; padding-block: calc(var(--space) * 3) calc(var(--space) * 7); padding-left: var(--gutter-l, 16px); padding-right: var(--gutter-r, 16px); }
.calm-page .cc-i { flex: none; }

/* ── crumb ─────────────────────────────────────────────────────────────────────────────────── */
.calm-crumb { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 8px; margin: 0 0 14px; font-size: var(--fs-sm); color: var(--muted); }
.calm-crumb a { color: var(--muted); text-decoration: none; }
.calm-crumb a:hover { color: var(--accent); }
.calm-crumb .calm-rank { font-family: var(--mono); font-size: 10.5px; text-transform: uppercase; letter-spacing: 0.04em; margin-right: 3px; opacity: .8; }
.calm-crumb .calm-sep-t { opacity: .6; }

/* ── the head: name · one sentence · one picture · one line of numbers ─────────────────────── */
.calm-head { display: grid; grid-template-columns: minmax(0, 7fr) minmax(0, 5fr); gap: 10px 48px; align-items: start; margin-bottom: 10px; }
.calm-head.calm-head-1 { grid-template-columns: minmax(0, 1fr); }
.calm-head-l, .calm-head-r { min-width: 0; }
.calm-head-r { display: flex; flex-direction: column; gap: 6px; margin: 0; }
.calm-name { display: flex; align-items: center; gap: 16px; margin: 0 0 2px; }
.calm-name .calm-mark { width: 56px; height: 44px; flex: none; color: var(--fg); opacity: .9; }
.calm-name .calm-mark.cc-i { width: 44px; height: 44px; }
.calm-name svg.calm-mark { fill: var(--fg); }
.calm-name h1 { font-family: var(--display); font-weight: 500; font-size: clamp(36px, 4.4vw, 60px); line-height: 0.95; text-transform: uppercase; letter-spacing: 0.02em; margin: 0; text-wrap: balance; overflow-wrap: anywhere; }
.calm-name h1.calm-it, .calm-name h1 i { font-style: italic; }
.calm-common { margin: 0 0 6px; font-family: var(--display); font-weight: 400; font-size: 26px; line-height: 1; color: var(--muted); }
.calm-sub { margin: 0 0 8px; font-size: 16px; color: var(--muted); max-width: 64ch; }
.calm-sentence { margin: 0 0 14px; font-size: 1.05em; line-height: 1.45; max-width: 62ch; }
.calm-facts { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 12px; margin: 0 0 14px; font-size: var(--fs-sm); color: var(--muted); }
.calm-facts a { color: var(--accent); text-decoration: none; }
.calm-facts a:hover { text-decoration: underline; }
.calm-facts .cc-i { margin-right: 3px; }
.calm-nums { display: flex; flex-wrap: wrap; gap: 6px 24px; margin: 0 0 6px; padding: 0; }
.calm-nums > div { display: flex; flex-direction: column; min-width: 0; }
.calm-nums dd { margin: 0; font-family: var(--display); font-weight: 500; font-size: 28px; line-height: 1; letter-spacing: 0.02em; font-variant-numeric: tabular-nums; }
.calm-nums dt { font-size: 11.5px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.08em; color: var(--muted); }
.calm-pic { position: relative; border-radius: var(--radius-card, 12px); overflow: hidden; background: var(--panel); aspect-ratio: 3 / 2; max-width: 100%; }
.calm-pic img { display: block; width: 100%; height: 100%; object-fit: cover; }
.calm-pic.calm-fig { aspect-ratio: auto; background: var(--panel-2); border: 1px solid var(--border); padding: 16px 18px 14px; overflow: visible; }
.calm-pic.calm-fig svg { display: block; width: 100%; height: auto; }
.calm-cap { margin: 0; font-size: 12.5px; line-height: 1.35; color: var(--muted); }
.calm-cap a { color: var(--muted); }

/* ── an open section and its rows ──────────────────────────────────────────────────────────── */
.calm-sec { margin-top: 22px; border-top: 1px solid var(--border); padding-top: 16px; }
.calm-sec > h2 { margin: 0 0 10px; font-size: 1.05em; font-weight: 700; text-transform: uppercase; letter-spacing: 0.04em; display: flex; flex-wrap: wrap; align-items: baseline; gap: 6px 10px; }
.calm-sec > h2 > .cc-i { align-self: center; color: var(--muted); }
.calm-ans { font-weight: 400; text-transform: none; letter-spacing: 0; font-size: 14.5px; color: var(--muted); }
.calm-rows { list-style: none; margin: 0; padding: 0; }
.calm-rows > li { padding: 10px 0; border-top: 1px solid var(--border); }
.calm-rows > li:first-child { border-top: 0; padding-top: 0; }
.calm-row { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 540px); gap: 6px 28px; align-items: center; }
.calm-row-l, .calm-row-r { min-width: 0; }
.calm-row-n { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 10px; font-size: 17px; font-weight: 700; }
.calm-row-n a { color: var(--accent); text-decoration: none; }
.calm-row-n a:hover { text-decoration: underline; }
.calm-row-n .cc-i { align-self: center; color: var(--muted); }
.calm-row-m { font-family: var(--mono); font-size: 12.5px; color: var(--muted); font-variant-numeric: tabular-nums; margin-top: 2px; display: flex; flex-wrap: wrap; gap: 2px 12px; }
.calm-strip { display: block; width: 100%; height: auto; }

/* ── the ways in: one line of links ────────────────────────────────────────────────────────── */
.calm-ways { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 16px; margin: 16px 0 0; }
.calm-ways > a { display: inline-flex; align-items: center; gap: 6px; font-weight: 700; font-size: 12.5px; line-height: 1.3; text-transform: uppercase; letter-spacing: 0.08em; color: var(--fg); text-decoration: none; border-bottom: 1px solid currentColor; padding: 2px 0 1px; }
.calm-ways > a:hover { color: var(--accent); }
.calm-ways > a .cc-i { font-size: 15px; color: var(--muted); }
.calm-ways > a:hover .cc-i { color: inherit; }
.calm-ways .calm-sep { width: 1px; height: 16px; background: var(--border); }
.calm-ways .calm-lab { font-size: 11.5px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.08em; color: var(--muted); }

/* ── a fold titled with its answer ─────────────────────────────────────────────────────────── */
.calm-folds { margin-top: 22px; }
.calm-fold { border-top: 1px solid var(--border); }
.calm-fold:last-child { border-bottom: 1px solid var(--border); }
.calm-fold > summary { position: relative; cursor: pointer; list-style: none; display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 10px; padding: 14px 30px 14px 0; font-weight: 700; font-size: 16px; text-transform: uppercase; letter-spacing: 0.04em; }
.calm-fold > summary::-webkit-details-marker { display: none; }
.calm-fold > summary > .cc-i:first-child { align-self: center; color: var(--muted); font-size: 18px; }
/* the chevron is pinned to the summary's right edge: in a wrapping flex row (the answer wraps under the
   title on a phone) margin-left: auto dropped it to a third line of its own */
.calm-fold > summary .calm-chev { position: absolute; right: 4px; top: 17px; margin: 0; color: var(--muted); transition: transform 200ms; font-size: 18px; }
.calm-fold[open] > summary .calm-chev { transform: rotate(180deg); }
.calm-fold > summary:hover { color: var(--accent); }
.calm-fold > summary:hover > .cc-i { color: var(--accent); }
.calm-body { padding: 0 0 20px; font-size: 15.5px; line-height: 1.45; min-width: 0; }
.calm-body > p { margin: 0 0 8px; max-width: 70ch; }
.calm-body > svg { display: block; width: 100%; max-width: 860px; height: auto; }
@media (prefers-reduced-motion: reduce) { .calm-fold > summary .calm-chev { transition: none; } }

/* ── a catalog: head, list of rows that open, view tabs ─────────────────────────────────────── */
.calm-cathead { margin: 0 0 18px; }
.calm-siblings { display: flex; flex-wrap: wrap; gap: 4px 18px; margin: 0 0 10px; font-size: 12.5px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.08em; }
.calm-siblings a { display: inline-flex; align-items: center; gap: 6px; color: var(--muted); text-decoration: none; padding-bottom: 2px; border-bottom: 2px solid transparent; }
.calm-siblings a:hover { color: var(--accent); }
.calm-siblings a[aria-current="page"] { color: var(--fg); border-bottom-color: var(--accent); }
.calm-cathead h1 { font-family: var(--display); font-weight: 500; font-size: clamp(40px, 4.4vw, 60px); line-height: 0.95; text-transform: uppercase; letter-spacing: 0.02em; margin: 0 0 6px; }
.calm-cathead .calm-sentence { margin-bottom: 12px; }
.calm-cathead .dsearch { margin-bottom: 0; }
.calm-bar { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 16px; margin: 0 0 8px; }
.calm-bar .calm-views { margin: 0; }
.calm-group { margin: 18px 0 4px; font-size: 12.5px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.08em; color: var(--muted); display: flex; align-items: center; gap: 8px; }
.calm-list { list-style: none; margin: 0; padding: 0; border-top: 1px solid var(--border); }
.calm-item { border-bottom: 1px solid var(--border); }
.calm-item > summary { cursor: pointer; list-style: none; display: grid; grid-template-columns: 32px minmax(0, 1fr) auto 18px; gap: 4px 14px; align-items: center; padding: 12px 2px; min-height: 56px; }
.calm-item > summary::-webkit-details-marker { display: none; }
.calm-item > summary:hover .calm-item-t { color: var(--accent); }
.calm-item-g { font-size: 26px; color: var(--fg); opacity: .85; display: flex; align-items: center; justify-content: center; }
.calm-item-g svg { width: 30px; height: 30px; fill: currentColor; }
.calm-item-tx { min-width: 0; }
.calm-item-t { font-size: 17px; font-weight: 700; line-height: 1.25; overflow-wrap: anywhere; }
.calm-item-s { font-size: 14px; color: var(--muted); line-height: 1.35; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.calm-item-k { font-family: var(--mono); font-size: 12.5px; color: var(--muted); font-variant-numeric: tabular-nums; text-align: right; white-space: nowrap; }
.calm-item > summary .calm-chev { color: var(--muted); transition: transform 200ms; }
.calm-item[open] > summary .calm-chev { transform: rotate(180deg); }
.calm-item-b { padding: 2px 2px 18px 46px; font-size: 15px; line-height: 1.45; }
.calm-item-b > p { margin: 0 0 8px; max-width: 72ch; }
.calm-views .tabrow button .cc-i { margin-right: 6px; font-size: 15px; }

/* ── phone ─────────────────────────────────────────────────────────────────────────────────── */
@media (max-width: 760px) {
  .calm-head { grid-template-columns: minmax(0, 1fr); }
  .calm-row { grid-template-columns: minmax(0, 1fr); }
  .calm-nums { gap: 6px 18px; }
  .calm-nums dd { font-size: 24px; }
  .calm-name { gap: 12px; }
  .calm-name .calm-mark { width: 40px; height: 32px; }
  .calm-name .calm-mark.cc-i { width: 32px; height: 32px; }
  .calm-item > summary { grid-template-columns: 26px minmax(0, 1fr) 18px; }
  .calm-item-k { grid-column: 2; text-align: left; white-space: normal; }
  .calm-item > summary .calm-chev { grid-column: 3; grid-row: 1; }
  .calm-item-s { white-space: normal; }
  .calm-item-b { padding-left: 0; }
}
