/* The Strata section: strata.html and strata/*.html (seven pages).
   Link it after flat.css on every Strata page:
     strata.html        <link rel="stylesheet" href="flat/pages/strata-section.css" />
     strata/<page>.html <link rel="stylesheet" href="../flat/pages/strata-section.css" />
   Holds only what flat.css lacks. Tokens only, .sf- prefix, no shadows, no gradients,
   pastel tints only. Everything reads its colours from the semantic tokens, so it keeps
   working on a band (where --bg-tint steps up to paper), inside a frame, and inside the
   .flat-ink scope (the closing band and footer).
   Markup for every component: docs/strata-section/COMPONENTS.md.

   1. Loop strip        ol.sf-loop
   2. Story figure      figure.sf-figure
   3. Availability chip span.chip.chip--sm.sf-avail (and the demo chip .sf-demo)
   4. Story rows        ol.sf-story (strata.html only)
   5. Availability table .sf-table (strata.html only)
   6. Sub-page pager    nav.sf-pager
   7. Closing band      section.flat-ink.section--ink.sf-close
   8. Closer look       dialog.lightbox.sf-zoom (built by strata-section.js) */


/* == 1. Loop strip ========================================================
   Seven pill links joined by short rules. It never wraps: when the column is
   narrower than the strip, the strip scrolls sideways on its own and the page
   does not. strata-section.js scrolls the lit step into view. */
.sf-loop {
  position: relative;               /* offsetParent for the scroll script */
  list-style: none;
  /* Room for the 4 px focus ring, which overflow would otherwise clip. */
  padding: 6px 6px 8px;
  margin-inline: -6px;
  display: flex;
  flex-wrap: nowrap;
  align-items: center;
  overflow-x: auto;
  overscroll-behavior-x: contain;
  scroll-snap-type: x proximity;
  scroll-padding-inline: var(--sp-5);
  -webkit-overflow-scrolling: touch;
  scrollbar-width: thin;
  scrollbar-color: var(--line-strong) transparent;
}
/* Zero specificity, so a .mt-* utility on the strip still sets its top margin. */
:where(.sf-loop) { margin-block: 0; }
.sf-loop > li { display: flex; align-items: center; flex-shrink: 0; scroll-snap-align: start; }
/* The join: a short neutral rule between two steps. */
.sf-loop > li + li::before {
  content: '';
  width: 14px; height: 2px;
  margin-inline: 4px;
  border-radius: 1px;
  background: var(--line-strong);
}
.sf-loop a {
  display: inline-flex; align-items: center; gap: 7px;
  height: 34px; padding: 0 13px;
  border-radius: var(--r-pill);
  background: var(--bg-tint);
  color: var(--fg-2);
  font-size: var(--fs-micro); font-weight: var(--fw-semibold); line-height: 1;
  white-space: nowrap;
  transition: background var(--dur) var(--ease), color var(--dur) var(--ease);
}
.sf-loop a:hover { background: var(--bg-sunken); color: var(--fg-1); }
.sf-loop a:focus-visible { border-radius: var(--r-pill); }
.sf-loop .icon { width: 16px; height: 16px; color: var(--fg-accent); }
/* The lit step: teal tint, teal-deep text. More than one step may be lit. */
.sf-loop a[aria-current="step"] { background: var(--teal-tint); color: var(--teal-text); }
.sf-loop a[aria-current="step"] .icon { color: var(--teal-text); }
/* Under the crumbs on a sub-page. */
.crumbs + .sf-loop { margin-top: var(--sp-4); }


/* == 2. Story figure ======================================================
   One product still with a hairline edge, sized to itself, then a one-sentence
   caption in plain text. No painted frame and no chips: the still is the only
   container. The corner button opens the closer look. */
/* :where() keeps this at zero specificity, so a .mt-* utility on the figure still wins. */
:where(.sf-figure) { margin: 0; }
.sf-figure { min-width: 0; }
.sf-figure__frame { position: relative; width: fit-content; max-width: 100%; }
.sf-figure picture { display: block; }
.sf-figure__img {
  display: block;
  max-width: 100%;
  height: auto;
  border: 1px solid var(--line-strong);
  border-radius: var(--r-card);
  background: var(--paper);
}
/* A crop is 1x from a 1080p capture: never wider than itself, never cropped by CSS. */
.sf-figure__img--cap { max-height: 520px; width: auto; }
.sf-figure[data-zoom] .sf-figure__img { cursor: zoom-in; }
.sf-figure__caption {
  margin-top: var(--sp-2);
  max-width: var(--measure);
  color: var(--fg-2);
}
/* The closer-look opener the script adds to a [data-zoom] figure: an icon in the still's corner. */
.sf-figure__zoom {
  position: absolute; top: var(--sp-2); right: var(--sp-2);
  display: inline-flex; align-items: center; justify-content: center;
  width: 32px; height: 32px; padding: 0;
  border: 1px solid var(--line-strong); border-radius: var(--r-mark);
  background: var(--paper); color: var(--fg-2); cursor: pointer;
  opacity: 0; transition: opacity var(--dur) var(--ease);
}
.sf-figure__frame:hover .sf-figure__zoom, .sf-figure__zoom:focus-visible { opacity: 1; }
@media (hover: none) { .sf-figure__zoom { opacity: 1; } }
.sf-figure__zoom:hover { color: var(--fg-1); }
.sf-figure__zoom .icon { width: 16px; height: 16px; }
/* A still from another vendor's system carries that system's mark above it, so it is not read as Certant. */
.sf-figure__source { display: flex; align-items: center; gap: var(--sp-2); margin-bottom: var(--sp-2); font-size: var(--fs-micro); font-weight: var(--fw-semibold); color: var(--fg-2); }
.sf-figure__source img { display: block; height: 18px; width: auto; }
/* The one line per page that says whose data the stills show. */
.sf-note { margin-top: var(--sp-3); max-width: var(--measure); font-size: var(--fs-micro); color: var(--fg-3); }
/* Two figures side by side that share one caption (the documents hero). */
.sf-figure-pair { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--sp-4); align-items: center; }
/* One above the other, for a wide strip that has to stay readable (the documents hero). */
.sf-figure-pair--stack { grid-template-columns: minmax(0, 1fr); }
@media (max-width: 800px) {
  .sf-figure-pair { grid-template-columns: 1fr; }
}


/* == 3. Availability chip and demo chip ===================================
   Two availability labels only, word for word:
     toggle-right  "Switched on per customer"
     package-plus  "Add-on, available on request"
   Neutral ground (the chip's own --bg-tint: cloud on white, paper on a band).
   Never bronze: bronze means pending. */
.sf-avail, .sf-demo { white-space: nowrap; }
.sf-avail { --_text: var(--fg-1); }


/* == 4. Story rows (strata.html #story) ===================================
   Seven rows: copy first in the DOM (a phone reads the heading before the
   picture), the figure beside it from 801 px. A very wide crop takes the
   full column under its copy (.sf-story__step--wide). */
:where(.sf-story) { margin: 0; }
.sf-story { list-style: none; padding: 0; display: flex; flex-direction: column; gap: var(--sp-8); }
.sf-story__step {
  display: grid;
  grid-template-columns: minmax(0, 5fr) minmax(0, 7fr);
  gap: var(--sp-7);
  align-items: center;
}
.sf-story__step--wide { grid-template-columns: 1fr; gap: var(--sp-5); }
.sf-story__step > div > p { margin: var(--sp-3) 0 0; }
.sf-story__step .link { margin-top: var(--sp-4); }
/* Thumbnails: tall crops stop at 400 px so a row stays a row. */
.sf-story .sf-figure__img { width: auto; max-height: 400px; }
@media (max-width: 800px) {
  .sf-story { gap: var(--sp-7); }
  .sf-story__step { grid-template-columns: 1fr; gap: var(--sp-4); }
  .sf-story .sf-figure__img { max-height: 340px; }
}


/* == 5. Availability table (strata.html #availability) ====================
   A .table.table--stack on a .tint--panel. The first column names the thing,
   the last holds one chip. Below 700 px flat.css stacks each row. */
.sf-table tbody th { width: 30%; }
.sf-table td:last-child { white-space: nowrap; }
@media (max-width: 700px) {
  .sf-table tbody th { width: auto; }
  .sf-table td:last-child { white-space: normal; }
  /* 23 rows: keep each to a name, one short line and the chip, with no column labels. */
  .sf-table tr { padding: 10px 0; }
  .sf-table tbody th, .sf-table td { padding: 2px 0; }
  .sf-table tbody th { font-size: var(--fs-sm); }
  .sf-table td[data-label]::before { display: none; }
  .sf-table td:not(:last-child) { font-size: var(--fs-micro); color: var(--fg-2); }
  .sf-table td:last-child { padding-top: 4px; }
}


/* == 6. Sub-page pager ====================================================
   Previous, all of Strata, next. Bare links, no ground until hover. */
.sf-pager {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr);
  gap: var(--sp-4);
  align-items: center;
}
.sf-pager__link {
  display: flex; flex-direction: column; gap: 4px;
  padding: var(--sp-4) var(--sp-5);
  border-radius: var(--r-card);
  color: var(--fg-1);
  transition: background var(--dur) var(--ease);
}
.sf-pager__link:hover { background: var(--bg-tint); color: var(--fg-1); }
.sf-pager__step { font-size: var(--fs-micro); font-weight: var(--fw-semibold); color: var(--fg-3); }
.sf-pager__title {
  display: inline-flex; align-items: center; gap: var(--sp-2);
  font-size: var(--fs-h4); font-weight: var(--fw-bold); line-height: 1.3;
  color: var(--link-default);
}
.sf-pager__link:hover .sf-pager__title { color: var(--link-hover); }
.sf-pager__prev { grid-column: 1; justify-self: start; }
.sf-pager__all  { grid-column: 2; justify-self: center; }
.sf-pager__next { grid-column: 3; justify-self: end; align-items: flex-end; text-align: right; }
/* Pull the outer links into the gutter so their text lines up with the column edge. */
.sf-pager__prev { margin-left: calc(-1 * var(--sp-5)); }
.sf-pager__next { margin-right: calc(-1 * var(--sp-5)); }
@media (max-width: 600px) {
  .sf-pager { grid-template-columns: 1fr; gap: var(--sp-2); }
  .sf-pager__prev, .sf-pager__all, .sf-pager__next { grid-column: 1; justify-self: stretch; align-items: flex-start; text-align: left; }
  .sf-pager__link { padding-inline: 0; }
  .sf-pager__prev, .sf-pager__next { margin-inline: 0; }
  .sf-pager__link:hover { background: none; }
}


/* == 7. Closing band ======================================================
   The question on the left, the governance line on the right. */
.sf-close__aside { display: flex; flex-direction: column; align-items: flex-start; gap: var(--sp-3); align-self: center; }
.sf-close__rule {
  margin: 0;
  max-width: 28ch;
  font-size: var(--fs-h3); font-weight: var(--fw-bold); line-height: var(--lh-snug);
  color: var(--fg-1);
}


/* == 8. Closer look (dialog built by strata-section.js) ===================
   Reuses .lightbox from flat.css. On a wide screen the still fills the dialog
   (never past its own width); on a phone it keeps its own pixel width and the
   frame scrolls sideways, so the figures in it can be read. */
.sf-zoom .viz-frame { display: block; }
.sf-zoom img { display: block; max-width: 100%; height: auto; margin-inline: auto; border-radius: var(--r-card); }
@media (max-width: 800px) {
  .sf-zoom img { max-width: none; }
}
