/*
 * Lees & doe: the HTML version of a magazine page (Pages/Shared/_MagazinePage.cshtml and partials).
 * Only visible in reading mode (reader.css hides .page-live in the magazine view).
 * Breakpoints: 1100 (narrow desktop), 800 (tablet), 760 (one leaf, as reader.css), 540 (phone); figures
 * switch to their narrow drawing with a container query at 560 px of figure width.
 * Lees & doe is the readable mode: no text below 12 px, also not for labels and running heads.
 */
@layer components {
  /* --- Page frame ------------------------------------------------------------------------------ */
  .reading-mode .magazine-page {
    background: var(--paper);
    box-shadow:
      0 2px 2px color-mix(in srgb, var(--ink) 6%, transparent),
      7px 10px 30px color-mix(in srgb, var(--ink) 11%, transparent);
    min-height: 850px;
    border: 1px solid var(--line);
  }
  .reading-mode .magazine-page.page-cover {
    min-height: 0;
  }
  .page-inner {
    padding: 33px 38px 24px;
  }
  /* Labels (base.css: 11 px) are 12 px in Lees & doe, the readable mode. */
  .page-live .eyebrow {
    font-size: 12px;
  }
  .page-running {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    gap: 4px 12px;
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    border-bottom: 1px solid var(--line);
    padding-bottom: 12px;
    margin-bottom: 25px;
  }
  .page-running > span:first-child {
    font-family: var(--display);
    font-weight: 800;
    font-size: 13px;
    letter-spacing: -0.5px;
  }
  .page-running b {
    color: color-mix(in srgb, var(--lime) 45%, var(--green));
    padding-left: 5px;
  }
  .subject-pill {
    font-weight: 700;
  }
  .page-running .subject-pill {
    color: var(--subject);
  }
  .page-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 29px;
    padding-top: 13px;
    border-top: 1px solid var(--line);
    font-size: 12px;
    color: var(--muted);
  }
  .page-footer b {
    font: 800 22px var(--display);
    color: var(--green);
  }

  /*
   * Subject colours come from Content/magazines.json `subjects`: Pages/Index.cshtml sets --subject (text and
   * accents, ≥ 4.5:1 on white) and --subject-tint (box backgrounds) on every page. These are the fallbacks.
   */
  .magazine-page {
    --subject: var(--green);
    --subject-tint: var(--tint);
  }

  /* --- Cover ---------------------------------------------------------------------------------- */
  /* The photo hero (masthead, cover lines, features); below it the cover page's own lead and teasers. */
  .cover {
    background: var(--paper);
  }
  .cover-hero {
    position: relative;
    isolation: isolate;
    width: 100%;
    aspect-ratio: 0.85;
    min-height: 830px;
    overflow: hidden;
    background: var(--green);
    color: white;
  }
  .cover-photo {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: 54% center;
    z-index: -3;
  }
  .cover-shade {
    position: absolute;
    inset: 0;
    background: linear-gradient(
      180deg,
      color-mix(in srgb, var(--green) 66%, transparent) 0%,
      transparent 35%,
      color-mix(in srgb, var(--green) 60%, transparent) 65%,
      color-mix(in srgb, var(--green) 95%, transparent) 100%
    );
    z-index: -2;
  }
  .cover-topline {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    font-size: 12px;
    letter-spacing: 0.1em;
    padding: 22px 26px 0;
    font-weight: 600;
  }
  .cover-masthead {
    font: 800 clamp(78px, 8.5vw, 125px) / 0.98 var(--display);
    letter-spacing: -8px;
    padding: 13px 21px 0;
    margin: 0;
    display: flex;
    align-items: center;
    justify-content: space-between;
  }
  .cover-masthead span {
    font-size: 72px;
    letter-spacing: 0;
    color: var(--lime);
  }
  .cover-deck {
    padding: 14px 29px;
    margin: 0;
    font-size: 12px;
    font-weight: 800;
    letter-spacing: 0.2em;
  }
  .cover-story {
    position: absolute;
    bottom: 118px;
    left: 30px;
    right: 20px;
  }
  .cover-label {
    font-size: 12px;
    letter-spacing: 0.12em;
    background: var(--lime);
    color: var(--on-accent);
    padding: 6px 10px;
    display: inline-block;
    font-weight: 800;
    transform: rotate(-2deg);
  }
  .cover-story h2 {
    font: 800 clamp(42px, 5.4vw, 75px) / 0.95 var(--display);
    letter-spacing: -2px;
    margin: 19px 0 18px;
    text-shadow: 1px 2px 10px color-mix(in srgb, var(--green) 40%, transparent);
    outline: 0;
  }
  .cover-story h2 em {
    font-style: normal;
    color: var(--lime);
  }
  .cover-story p {
    font-size: 16px;
    line-height: 1.35;
    font-weight: 500;
    margin: 0;
    max-width: 330px;
  }
  .cover-bottom {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    padding: 23px 28px;
    display: grid;
    grid-template-columns: 1fr 1fr 1fr;
    gap: 17px;
    border-top: 1px solid color-mix(in srgb, white 35%, transparent);
    background: color-mix(in srgb, var(--green) 45%, transparent);
  }
  .cover-bottom button {
    background: transparent;
    text-align: left;
    color: white;
    padding: 0;
    cursor: pointer;
  }
  .cover-bottom button + button {
    border-left: 1px solid color-mix(in srgb, white 35%, transparent);
    padding-left: 17px;
  }
  .cover-bottom b {
    display: block;
    color: var(--lime);
    font-size: 12px;
    letter-spacing: 0.08em;
    margin-bottom: 6px;
  }
  .cover-bottom small {
    font-size: 13px;
    line-height: 1.3;
    display: block;
  }
  .cover-caption {
    margin: 0;
    padding: 9px 26px;
    font-size: 12px;
    line-height: 1.45;
    color: var(--muted);
    border-bottom: 1px solid var(--line);
  }
  .cover-panel {
    padding: 26px 30px 30px;
  }
  .cover-title {
    font: 800 30px/1.1 var(--display);
    letter-spacing: -0.6px;
    margin: 0 0 10px;
  }
  .cover-lead {
    font-size: 19px;
    line-height: 1.55;
    font-weight: 500;
    margin: 0 0 22px;
  }
  /* Cover lines: a big entry point (page or number) with its teaser; a line that names a page opens it. */
  .cover-lines {
    list-style: none;
    margin: 0 0 8px;
    padding: 0;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
    gap: 12px;
  }
  .cover-lines li {
    display: grid;
    background: var(--subject-tint);
    border-top: 4px solid var(--subject);
    border-radius: 0 0 6px 6px;
  }
  .cover-lines li:not(:has(button)),
  .cover-lines button {
    display: grid;
    gap: 4px;
    align-content: start;
    padding: 14px 16px;
  }
  .cover-lines button {
    width: 100%;
    text-align: left;
    background: none;
    color: var(--ink);
  }
  .cover-lines strong {
    font: 800 30px/1.05 var(--display);
    letter-spacing: -0.5px;
    color: var(--subject);
  }
  .cover-lines span {
    font-size: 15px;
    line-height: 1.45;
  }
  @media (hover: hover) {
    .cover-lines button:hover span {
      text-decoration: underline;
      text-underline-offset: 3px;
    }
  }
  .cover-section h3 {
    font: 750 20px var(--display);
    margin: 22px 0 6px;
  }
  .cover-section p {
    font-size: 17px;
    line-height: 1.65;
    margin: 0;
  }

  /* --- Article --------------------------------------------------------------------------------- */
  .article-header h2 {
    font: 800 45px/1.06 var(--display);
    letter-spacing: -1.6px;
    margin: 12px 0 18px;
    outline: 0;
    overflow-wrap: anywhere;
  }
  .article-header .eyebrow {
    color: var(--subject);
    font-size: 12px;
  }
  .article-lead {
    font-size: 21px;
    line-height: 1.55;
    font-weight: 500;
    margin: 0 0 25px;
  }
  .article-image {
    margin: 0 0 27px;
  }
  /*
   * Lees & doe never crops an image: schemas and diagrams (the IceCube detector, the AlphaFold structure) and
   * photos that a question refers to (the nautilus spiral) are shown whole. The box has the common 3:2 photo
   * shape (reserved before the image loads, so nothing jumps); other shapes get a quiet margin.
   */
  .article-image img,
  .secondary-article img {
    display: block;
    width: 100%;
    height: auto;
    aspect-ratio: 3 / 2;
    object-fit: contain;
    background: color-mix(in srgb, var(--bg) 60%, var(--paper));
    border-radius: 3px;
  }
  /* Mascot and character art is drawn on transparent paper: show it whole (class set from magazines.json). */
  .article-image.is-mascot img {
    aspect-ratio: auto;
    height: 300px;
    padding: 12px;
  }
  .article-image figcaption {
    font-size: 12px;
    line-height: 1.45;
    color: var(--muted);
    padding-top: 8px;
  }
  .article-body {
    columns: 1;
    column-gap: 30px;
    max-width: 700px;
    margin: 25px auto;
  }
  .article-body > section {
    break-inside: avoid;
    margin-bottom: 25px;
    min-width: 0;
  }
  .article-body h3 {
    font: 750 22px/1.2 var(--display);
    letter-spacing: -0.5px;
    margin: 0 0 8px;
    overflow-wrap: anywhere;
  }
  .article-body p {
    font-size: 20px;
    line-height: 1.75;
    margin: 0;
    white-space: pre-line;
    overflow-wrap: anywhere;
  }
  .page-story .article-header {
    padding-left: 18px;
    border-left: 5px solid var(--subject);
  }
  .page-story .article-image img {
    height: auto;
    max-height: none;
    aspect-ratio: auto;
  }

  /* --- Boxes ----------------------------------------------------------------------------------- */
  .callout {
    display: flex;
    gap: 16px;
    align-items: center;
    background: var(--lime);
    padding: 23px 20px;
    margin-top: 24px;
    border-radius: 3px;
    position: relative;
    min-height: 145px;
  }
  .callout-symbol {
    font-size: 45px;
    line-height: 1;
    color: var(--green);
  }
  .callout > div {
    padding-right: 92px;
  }
  .callout.has-mascot > div {
    padding-right: 80px;
  }
  .callout h3 {
    font: 750 20px var(--display);
    margin: 0 0 6px;
    letter-spacing: -0.4px;
    overflow-wrap: anywhere;
  }
  .callout p {
    font-size: 14px;
    line-height: 1.55;
    margin: 0;
  }
  .callout img {
    position: absolute;
    height: 116px;
    width: 80px;
    object-fit: contain;
    right: 9px;
    bottom: 4px;
  }
  .fact-strip {
    display: flex;
    gap: 14px;
    background: var(--subject-tint);
    padding: 20px;
    margin: 23px 0;
    flex-wrap: wrap;
    border-radius: 3px;
    list-style: none;
  }
  .fact-strip > li {
    flex: 1;
    min-width: 125px;
  }
  .fact-strip > li + li {
    border-left: 1px solid color-mix(in srgb, var(--subject) 30%, var(--subject-tint));
    padding-left: 14px;
  }
  .fact-strip strong {
    display: block;
    font: 800 34px/1.1 var(--display);
    letter-spacing: -1px;
    color: var(--subject);
  }
  .fact-strip span {
    display: block;
    font-size: 13px;
    line-height: 1.45;
    margin-top: 7px;
  }
  .solution,
  .article-sources {
    margin-top: 24px;
    padding: 13px 17px;
    background: var(--surface);
    font-size: 14px;
    border-radius: 3px;
  }
  .solution summary,
  .article-sources summary {
    font-weight: 700;
    cursor: pointer;
  }
  .solution p {
    font-size: 14px;
    white-space: pre-line;
  }
  .article-sources ul {
    padding-left: 18px;
  }
  .article-sources li {
    margin: 8px 0;
  }
  .editor-note {
    display: flex;
    gap: 25px;
    background: var(--tint);
    padding: 25px;
    align-items: center;
    border-radius: 3px;
  }
  .editor-note img {
    width: 145px;
    height: 140px;
    object-fit: contain;
    flex-shrink: 0;
  }
  .editor-note h3 {
    font: 750 20px var(--display);
    margin: 0 0 8px;
  }
  .editor-note p {
    font-size: 14px;
    margin: 0 0 13px;
    line-height: 1.6;
  }
  .in-page-contents {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0 23px;
    margin: 25px 0;
  }
  .in-page-contents button {
    background: none;
    text-align: left;
    display: grid;
    grid-template-columns: 28px 1fr;
    gap: 0 12px;
    align-items: center;
    padding: 13px 0;
    border-bottom: 1px solid var(--line);
  }
  .in-page-contents button > span {
    grid-row: span 2;
    font: 800 25px var(--display);
    color: var(--green);
  }
  .in-page-contents strong {
    font-size: 13px;
    font-weight: 700;
    line-height: 1.3;
  }
  .in-page-contents small {
    font-size: 12px;
    margin-top: 3px;
    color: var(--muted);
  }
  /* A saved page (Bewaren, js/reader/bookmarks.js). */
  .in-page-contents button.bookmarked strong::after {
    content: ' ★' / ', bewaard';
    color: var(--green);
  }

  /* --- Experiments ----------------------------------------------------------------------------- */
  .experiment-layout {
    display: grid;
    grid-template-columns: 185px 1fr;
    gap: 28px;
    margin: 28px 0;
  }
  .experiment-layout.no-materials,
  .experiment-layout.no-steps {
    grid-template-columns: minmax(0, 1fr);
  }
  .experiment-layout h3 {
    font: 750 25px var(--display);
    margin: 0 0 17px;
  }
  .materials {
    background: var(--subject-tint);
    padding: 20px;
    border-radius: 3px;
    font-size: 14px;
  }
  .materials ul {
    padding-left: 17px;
    margin: 17px 0 0;
  }
  .materials li {
    margin-bottom: 11px;
  }
  .layout-lab .materials {
    border-top: 4px solid var(--subject);
  }
  .steps {
    list-style: none;
    counter-reset: steps;
    padding: 0;
    margin: 0;
  }
  .steps li {
    counter-increment: steps;
    position: relative;
    padding-left: 39px;
    margin-bottom: 18px;
    font-size: 15px;
    line-height: 1.6;
  }
  .steps li::before {
    content: counter(steps);
    position: absolute;
    left: 0;
    top: 0;
    background: var(--green);
    color: var(--lime);
    width: 27px;
    height: 27px;
    display: grid;
    place-items: center;
    border-radius: 50%;
    font: 700 15px var(--display);
  }
  .safety {
    background: var(--warn-tint);
    border-left: 4px solid var(--warn);
    padding: 15px 19px;
    margin: 22px 0;
    font-size: 15px;
    line-height: 1.55;
    border-radius: 0 3px 3px 0;
  }
  .safety b {
    color: var(--warn);
  }
  .safety b {
    display: block;
    margin-bottom: 5px;
  }

  /* --- Comic ----------------------------------------------------------------------------------- */
  .comic-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px 14px;
    margin: 25px 0;
  }
  .comic-grid figure {
    margin: 0;
    background: var(--surface);
    border-radius: 3px;
    overflow: hidden;
  }
  .comic-art {
    aspect-ratio: 1;
    background-size: 200% 300%;
    background-position: calc(var(--col) * 100%) calc(var(--row) * 50%);
  }
  .comic-grid figcaption {
    font-size: 13px;
    line-height: 1.5;
    padding: 12px 14px;
    min-height: 70px;
  }

  /* --- Answers and credits --------------------------------------------------------------------- */
  .answer-grid {
    display: grid;
    grid-template-columns: repeat(var(--size), 1fr);
    border: 2px solid var(--green);
    max-width: 270px;
  }
  .answer-grid span {
    display: grid;
    place-items: center;
    aspect-ratio: 1;
    background: var(--paper);
    border: 1px solid color-mix(in srgb, var(--subject) 25%, var(--paper));
    font-weight: 700;
  }
  .answer-text {
    font-size: 14px;
    white-space: pre-line;
  }
  .page-credits h3 {
    font: 750 22px var(--display);
  }
  .source-list {
    font-size: 13px;
    padding-left: 22px;
  }
  .source-list li {
    padding: 5px 0;
    overflow-wrap: anywhere;
  }
  .source-list p {
    font-size: 12px;
    margin: 4px 0;
    color: var(--muted);
  }
  .photo-credits {
    columns: 2;
    column-gap: 25px;
    font-size: 12px;
  }
  .photo-credits p {
    break-inside: avoid;
    margin: 0 0 13px;
    overflow-wrap: anywhere;
  }
  .photo-credits small {
    font-size: 12px;
  }
  .illustration-credits {
    columns: 2;
    column-gap: 25px;
    font-size: 12px;
  }
  .illustration-credits p {
    break-inside: avoid;
    line-height: 1.6;
    margin: 0 0 15px;
  }
  .illustration-credits small {
    font-size: 12px;
  }

  /* --- Editorial modules: sidebars and secondary articles -------------------------------------- */
  .editorial-body.has-sidebars {
    display: grid;
    grid-template-columns: minmax(0, 2.1fr) minmax(185px, 1fr);
    gap: 28px;
    margin-top: 28px;
  }
  .editorial-body.has-sidebars .article-body {
    margin: 0;
    max-width: none;
  }
  .editorial-sidebars {
    min-width: 0;
    display: grid;
    gap: 20px;
    align-content: start;
  }
  .editorial-sidebar {
    background: var(--subject-tint);
    padding: 22px;
    overflow-wrap: break-word;
    border-top: 3px solid var(--subject);
    margin: 0;
  }
  .page-contents .editorial-sidebar {
    margin: 24px 0;
  }
  .editorial-sidebar .eyebrow {
    font-size: 12px;
    color: color-mix(in srgb, var(--subject) 85%, var(--ink));
  }
  .editorial-sidebar h3 {
    font: 800 23px/1.15 var(--display);
    margin: 12px 0 16px;
  }
  .editorial-sidebar p,
  .sidebar-items li {
    font-size: 14px;
    line-height: 1.65;
  }
  .editorial-sidebar > p {
    margin-bottom: 20px;
  }
  .sidebar-items {
    list-style: none;
    margin: 20px 0 0;
    padding: 0;
  }
  .sidebar-items li {
    margin: 0 0 18px;
  }
  .sidebar-items strong {
    display: block;
    font-weight: 800;
  }
  .sidebar-items p {
    margin: 4px 0 0;
  }
  .sidebar-timeline .sidebar-items {
    border-left: 2px solid var(--subject);
    margin-left: 5px;
    padding-left: 18px;
  }
  .sidebar-timeline li {
    position: relative;
  }
  .sidebar-timeline li::before {
    content: '';
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--subject);
    position: absolute;
    left: -23px;
    top: 7px;
  }
  .sidebar-profile {
    background: color-mix(in srgb, var(--subject) 10%, var(--paper));
  }
  .module-sources {
    font-size: 12px;
    line-height: 1.5;
    margin-top: 16px;
  }
  .module-sources summary {
    cursor: pointer;
    text-decoration: underline;
    text-underline-offset: 3px;
  }
  .module-sources ul {
    padding-left: 18px;
  }
  .module-sources li {
    margin: 8px 0;
  }
  .secondary-articles {
    display: grid;
    gap: 25px;
    margin: 34px 0 20px;
  }
  .secondary-article {
    border-top: 4px solid var(--subject);
    background: color-mix(in srgb, var(--bg) 48%, var(--paper));
    padding: 28px;
  }
  .layout-split .secondary-article {
    border-top-width: 6px;
  }
  .secondary-article h3 {
    font: 800 30px/1.1 var(--display);
    letter-spacing: -0.7px;
    margin: 11px 0 17px;
  }
  .secondary-lead {
    font-size: 18px;
    line-height: 1.65;
    font-weight: 600;
  }
  .secondary-article figure {
    margin: 18px 0;
  }
  .secondary-article figcaption {
    font-size: 12px;
    line-height: 1.5;
    margin-top: 8px;
  }
  .secondary-copy h4 {
    font: 750 20px/1.25 var(--display);
    margin: 22px 0 8px;
  }
  .secondary-copy p {
    font-size: 17px;
    line-height: 1.7;
    margin: 0 0 16px;
  }

  /* --- Page layouts (page.layout in the edition JSON) ------------------------------------------ */
  .layout-feature .article-header h2 {
    font-size: clamp(38px, 4vw, 60px);
  }
  .layout-briefs .article-body {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 20px;
    columns: auto;
    max-width: none;
  }
  .layout-briefs .article-body > section {
    padding: 20px 17px;
    background: var(--paper);
    border-top: 3px solid var(--subject);
    margin: 0;
  }
  .layout-briefs .article-body h3 {
    font-size: 21px;
  }
  .layout-briefs .article-body p {
    font-size: 15px;
    line-height: 1.65;
  }
  .layout-fieldnotes .article-body {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(min(100%, 280px), 1fr));
    gap: 16px;
  }
  .layout-fieldnotes .article-body > section {
    background: var(--subject-tint);
    padding: 19px;
    margin: 0;
    border-top: 3px solid var(--subject);
  }
  .layout-challenge .article-header {
    border-left: 5px solid var(--subject);
    padding-left: 22px;
  }
  .layout-atlas .article-header h2 {
    font-size: 52px;
  }
  .layout-timeline .article-body {
    border-left: 2px solid var(--subject);
    padding-left: 23px;
  }
  .layout-timeline .article-body h3 {
    color: var(--subject);
  }
  .layout-notebook .article-body > section {
    padding: 22px;
    border: 1px solid var(--line);
    background: repeating-linear-gradient(
      var(--paper),
      var(--paper) 28px,
      color-mix(in srgb, var(--ink) 8%, transparent) 29px
    );
  }

  /* --- Spread panorama (live HTML of a real spread) -------------------------------------------- */
  .spread-panorama {
    height: 265px;
    background-size: cover;
    background-position: center;
    position: relative;
    margin: 0 -38px 25px;
  }
  .panorama-caption {
    font-size: 12px;
    line-height: 1.45;
    color: var(--muted);
    margin: -14px 0 25px;
  }

  /* --- Infographics (Pages/Shared/_Infographic.cshtml, SVG from Pages/FigureKinds.cs) ------------- */
  .infographic {
    /* Colour roles of the figure SVG: the page subject colour and tones derived from it and the palette. */
    --f-accent: var(--subject);
    --f-title: color-mix(in srgb, var(--subject) 88%, var(--ink));
    /* A contrasting second hue; the color-mix fallback is for browsers without relative colour syntax. */
    --f-second: color-mix(in srgb, var(--ink) 55%, var(--subject));
    --f-third: color-mix(in srgb, var(--ink) 78%, var(--paper));
    --f-ink: var(--ink);
    --f-grid: color-mix(in srgb, var(--ink) 22%, var(--subject-tint));
    --f-card: color-mix(in srgb, var(--paper) 75%, white);
    --f-bg: var(--subject-tint);
    container-type: inline-size;
    margin: 28px auto;
    max-width: 700px;
    padding: 22px 24px 20px;
    background: var(--subject-tint);
    border-top: 4px solid var(--subject);
    border-radius: 0 0 6px 6px;
    break-inside: avoid;
  }
  @supports (color: hsl(from red h s l)) {
    .infographic {
      --f-second: hsl(from var(--subject) calc(h + 150) s clamp(26, l, 38));
    }
  }
  .infographic h3 {
    font: 800 25px/1.15 var(--display);
    margin: 8px 0 14px;
    letter-spacing: -0.6px;
    overflow-wrap: anywhere;
  }
  .diagram-heading .eyebrow {
    color: var(--f-title);
  }
  .fig-canvas svg {
    display: block;
    width: 100%;
    height: auto;
    overflow: visible;
  }
  .fig-narrow {
    display: none;
  }
  /* The narrow layout (phones, narrow windows) keeps labels ≥ 13 px without sideways scrolling. */
  @container (max-width: 560px) {
    .fig-wide {
      display: none;
    }
    .fig-narrow {
      display: block;
      max-width: 380px;
      margin-inline: auto;
    }
  }
  .fig-svg text {
    font-family: var(--body);
    fill: var(--f-ink);
  }
  .fig-svg :where(line:not([stroke])) {
    stroke: var(--f-ink);
    stroke-linecap: round;
  }
  .fig-svg path {
    stroke-linecap: round;
    stroke-linejoin: round;
  }
  .fig-svg .fd {
    font-family: var(--display);
  }
  .fig-svg .f-accent {
    fill: var(--f-accent);
  }
  .fig-svg .f-title {
    fill: var(--f-title);
  }
  .fig-svg .f-second {
    fill: var(--f-second);
  }
  .fig-svg .f-third {
    fill: var(--f-third);
  }
  .fig-svg .f-ink {
    fill: var(--f-ink);
  }
  .fig-svg .f-grid {
    fill: var(--f-grid);
  }
  .fig-svg .f-card {
    fill: var(--f-card);
  }
  .fig-svg .f-bg {
    fill: var(--f-bg);
  }
  .fig-svg .s-accent {
    stroke: var(--f-accent);
  }
  .fig-svg .s-title {
    stroke: var(--f-title);
  }
  .fig-svg .s-second {
    stroke: var(--f-second);
  }
  .fig-svg .s-third {
    stroke: var(--f-third);
  }
  .fig-svg .s-ink {
    stroke: var(--f-ink);
  }
  .fig-svg .s-grid {
    stroke: var(--f-grid);
  }
  .fig-svg .s-card {
    stroke: var(--f-card);
  }
  .fig-svg .s-bg {
    stroke: var(--f-bg);
  }
  .infographic figcaption {
    font-size: 13px;
    line-height: 1.55;
    color: var(--muted);
    margin-top: 14px;
  }
  /* Fallback when a figure cannot be drawn: one labelled card per label (arrows only for sequences). */
  .diagram-cards {
    list-style: none;
    margin: 0;
    padding: 0;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 12px;
    counter-reset: card;
  }
  .diagram-cards li {
    background: var(--paper);
    border-top: 4px solid var(--subject);
    padding: 14px 16px;
    border-radius: 0 0 6px 6px;
  }
  .diagram-cards strong {
    display: block;
    font-size: 16px;
    color: var(--f-title);
  }
  .diagram-cards p {
    font-size: 14px;
    line-height: 1.55;
    margin: 6px 0 0;
  }
  .diagram-cards.is-sequence li {
    counter-increment: card;
  }
  .diagram-cards.is-sequence strong::before {
    content: counter(card) ' → ';
  }

  /* --- Speech bubbles (page.speech, Pages/Shared/_SpeechBubbles.cshtml) ----------------------------- */
  /* Character avatar (image, or the initial on the character colour) with the words in a bubble. */
  .speech-bubbles {
    display: grid;
    gap: 14px;
    margin: 4px 0 28px;
  }
  .speech-bubble {
    display: grid;
    grid-template-columns: 56px minmax(0, 1fr);
    grid-template-areas:
      'avatar name'
      'avatar text';
    column-gap: 16px;
    align-items: start;
    margin: 0;
    max-width: 640px;
  }
  .speech-avatar {
    grid-area: avatar;
    width: 56px;
    height: 56px;
    border-radius: 50%;
    border: 3px solid var(--speaker-color);
    background: color-mix(in srgb, var(--speaker-color) 12%, var(--paper));
    overflow: hidden;
    display: grid;
    place-items: center;
  }
  .speech-avatar img {
    width: 100%;
    height: 100%;
    object-fit: contain;
  }
  .speech-avatar.is-initial {
    background: var(--speaker-color);
    color: white;
    font: 800 25px/1 var(--display);
  }
  .speech-name {
    grid-area: name;
    margin: 0 0 4px 16px;
    font-size: 13px;
    font-weight: 800;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: var(--speaker-color);
  }
  .speech-text {
    grid-area: text;
    position: relative;
    margin: 0;
    padding: 12px 18px;
    background: var(--paper);
    border: 2px solid var(--speaker-color);
    border-radius: 18px;
  }
  /* The tail points at the speaker. */
  .speech-text::before {
    content: '';
    position: absolute;
    left: -9px;
    top: 14px;
    width: 14px;
    height: 14px;
    background: var(--paper);
    border-left: 2px solid var(--speaker-color);
    border-bottom: 2px solid var(--speaker-color);
    transform: rotate(45deg);
  }
  .speech-text p {
    margin: 0;
    font-size: 17px;
    line-height: 1.5;
  }

  /* --- Level (page.level: 1–3 stars) -------------------------------------------------------------- */
  .page-level {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    margin: 0 0 20px;
    padding: 4px 14px 4px 10px;
    border-radius: 999px;
    background: var(--subject-tint);
    font-size: 14px;
    font-weight: 700;
  }
  .level-stars {
    font-size: 17px;
    letter-spacing: 2px;
    line-height: 1;
  }
  .level-stars .on {
    color: var(--subject);
  }
  .level-stars .off {
    color: var(--subject);
    font-weight: 400;
  }

  /* --- Real spreads: the shared headline and lead (spreadTitle / spreadLead) ---------------------- */
  .spread-intro {
    margin: 0 0 24px;
    padding-left: 16px;
    border-left: 5px solid var(--subject);
  }
  .spread-title {
    font: 800 30px/1.08 var(--display);
    letter-spacing: -0.8px;
    color: var(--subject);
    margin: 0 0 8px;
  }
  .spread-lead {
    font-size: 19px;
    line-height: 1.5;
    font-weight: 600;
    margin: 0;
  }
  .spread-intro.is-continued {
    border-left-width: 3px;
  }
  .spread-intro.is-continued .spread-title {
    font-size: 17px;
    letter-spacing: 0;
    margin: 0;
  }

  /* --- Glossary sidebar (sidebar kind "glossary") ------------------------------------------------ */
  .glossary-list {
    margin: 16px 0 0;
    display: grid;
    gap: 10px;
  }
  .glossary-list > div {
    padding-bottom: 10px;
    border-bottom: 1px solid color-mix(in srgb, var(--subject) 22%, transparent);
  }
  .glossary-list dt {
    font-weight: 800;
    color: color-mix(in srgb, var(--subject) 85%, var(--ink));
  }
  .glossary-list dd {
    margin: 2px 0 0;
    font-size: 14px;
    line-height: 1.55;
  }

  /* --- Comic ------------------------------------------------------------------------------------ */
  .panel-number {
    display: inline-grid;
    place-items: center;
    width: 22px;
    height: 22px;
    margin-right: 6px;
    border-radius: 50%;
    background: var(--subject);
    color: white;
    font-size: 12px;
    font-weight: 800;
    vertical-align: 1px;
  }
  .comic-caption {
    font-size: 13px;
    line-height: 1.5;
    color: var(--muted);
    margin: -10px 0 20px;
  }

  /* --- Answers page: drawn solutions (Pages/Shared/_Solutions.cshtml) ----------------------------- */
  .solution-grids {
    display: flex;
    flex-wrap: wrap;
    gap: 26px;
    margin: 28px 0;
  }
  .solution-grid {
    margin: 0;
    flex: 1 1 220px;
    max-width: 330px;
  }
  .solution-grid figcaption {
    font: 750 17px var(--display);
    margin-bottom: 10px;
  }
  .solution-grid .answer-grid {
    max-width: none;
    border: 2px solid var(--ink);
  }
  .solution-grid:has(.sudoku-answer) {
    max-width: 250px;
  }
  .sudoku-answer span.given {
    background: var(--surface);
  }
  .sudoku-answer span.filled {
    color: color-mix(in srgb, var(--subject) 85%, var(--ink));
  }
  .sudoku-answer span.box-right {
    border-right: 2px solid var(--ink);
  }
  .sudoku-answer span.box-bottom {
    border-bottom: 2px solid var(--ink);
  }
  .word-answer span {
    font-size: 13px;
    font-weight: 600;
  }
  .word-answer span.hit {
    background: var(--lime);
    color: var(--on-accent);
    font-weight: 800;
  }
  /* The same marks as the playable maze (activities.css): lime trail, ● start, ★ exit. */
  .maze-answer span {
    border: 0;
    font-size: 13px;
    line-height: 1;
  }
  .maze-answer span.wall {
    background: var(--ink);
  }
  .maze-answer span.route {
    background: var(--lime);
  }
  .maze-answer span.start,
  .maze-answer span.exit {
    background: var(--lime);
    color: var(--warn);
    font-weight: 900;
    box-shadow: inset 0 0 0 2px var(--warn);
  }

  /* --- Narrow desktop -------------------------------------------------------------------------- */
  @media (max-width: 1100px) {
    .cover-hero {
      min-height: 780px;
    }
    .cover-masthead {
      font-size: 87px;
      letter-spacing: -5px;
    }
    .cover-masthead span {
      font-size: 49px;
    }
    .cover-story h2 {
      font-size: 62px;
    }
    .cover-bottom {
      padding: 20px;
      gap: 12px;
    }

    .page-inner {
      padding: 27px;
    }
    .article-header h2 {
      font-size: 37px;
    }

    .experiment-layout {
      grid-template-columns: 150px 1fr;
      gap: 18px;
    }
    .materials {
      padding: 16px;
    }
    .callout > div {
      padding-right: 60px;
    }
    .callout-symbol {
      font-size: 35px;
    }
    .comic-grid {
      gap: 15px 10px;
    }
    .comic-grid figcaption {
      font-size: 12px;
      padding: 10px;
    }
  }

  /* --- Tablet ---------------------------------------------------------------------------------- */
  @media (max-width: 800px) {
    .reading-mode .magazine-page {
      min-height: 780px;
    }
    .cover-hero {
      min-height: 0;
    }
    .cover-masthead {
      font-size: clamp(74px, 15vw, 115px);
    }
    .cover-masthead span {
      font-size: 64px;
    }
    .cover-story h2 {
      font-size: clamp(54px, 9vw, 69px);
    }
    .page-inner {
      padding: 30px;
    }
    .experiment-layout {
      grid-template-columns: 175px 1fr;
    }
    .editorial-body.has-sidebars {
      grid-template-columns: 1fr;
    }
    .layout-briefs .article-body {
      grid-template-columns: repeat(2, minmax(0, 1fr));
    }
  }
  @media (max-width: 759.98px) {
    .layout-fieldnotes .article-body {
      grid-template-columns: minmax(0, 1fr);
    }
    .layout-atlas .article-header h2 {
      font-size: 38px;
    }
  }

  /* --- Phone ----------------------------------------------------------------------------------- */
  @media (max-width: 540px) {
    /* Figures use the whole page width on phones, so their labels stay large enough to read. */
    .infographic {
      margin-inline: -20px;
      padding: 18px 12px 16px;
      border-radius: 0;
    }
    .reading-mode .magazine-page {
      min-height: 565px;
    }
    /* Phones: the hero is a column (masthead, story, feature list) over the photo, so the 12 px labels and
       a longer cover story never overlap; it is at least as tall as the 0.69 cover. */
    .cover-hero {
      display: flex;
      flex-direction: column;
      aspect-ratio: auto;
      min-height: max(565px, 145vw);
    }
    .cover-topline {
      padding: 17px 17px 0;
      letter-spacing: 0.04em;
    }
    .cover-masthead {
      font-size: clamp(56px, 16vw, 85px);
      letter-spacing: -4px;
      padding: 10px 15px 0;
    }
    .cover-masthead span {
      font-size: 39px;
    }
    .cover-deck {
      padding: 11px 19px;
      letter-spacing: 0.12em;
    }
    .cover-story {
      position: static;
      margin: auto 15px 0 19px;
      padding: 28px 0 16px;
    }
    .cover-label {
      padding: 4px 7px;
    }
    .cover-story h2 {
      font-size: clamp(38px, 11vw, 59px);
      letter-spacing: -1.5px;
      margin: 14px 0;
    }
    .cover-story p {
      font-size: 12px;
      max-width: 210px;
    }
    .cover-bottom {
      padding: 16px 16px;
      gap: 10px;
    }
    /* Phones: the cover features become a short list (three columns would need tiny type). */
    .cover-bottom {
      position: static;
      grid-template-columns: 1fr;
      gap: 0;
      padding: 4px 16px;
    }
    .cover-bottom b {
      letter-spacing: 0.04em;
      margin-bottom: 2px;
    }
    .cover-bottom small {
      font-size: 13px;
    }
    .cover-bottom button {
      padding: 7px 0;
    }
    .cover-bottom button + button {
      padding-left: 0;
      border-left: 0;
      border-top: 1px solid color-mix(in srgb, white 35%, transparent);
    }
    .page-inner {
      padding: 21px 20px;
    }
    .page-running {
      letter-spacing: 0.04em;
      margin-bottom: 22px;
    }
    .page-running > span:first-child {
      font-size: 13px;
    }
    .article-header h2 {
      font-size: 34px;
      letter-spacing: -1.2px;
    }

    .article-body p {
      font-size: 18px;
    }
    .callout {
      padding: 19px 17px;
      gap: 13px;
    }
    .callout-symbol {
      display: none;
    }
    .callout > div {
      padding-right: 58px;
    }
    .callout.has-mascot > div {
      padding-right: 60px;
    }
    .callout h3 {
      font-size: 19px;
    }
    .callout p {
      font-size: 13px;
    }
    .callout img {
      height: 93px;
      width: 65px;
    }
    .fact-strip {
      gap: 15px;
      padding: 18px;
    }
    .fact-strip > div {
      min-width: 100px;
    }
    .fact-strip strong {
      font-size: 29px;
    }
    .fact-strip span {
      font-size: 12px;
    }
    .fact-strip > div + div {
      padding-left: 10px;
    }
    .editor-note {
      padding: 18px;
      gap: 15px;
      display: block;
    }
    .editor-note img {
      width: 110px;
      float: right;
      margin-left: 10px;
    }
    .in-page-contents {
      grid-template-columns: 1fr;
      margin-top: 16px;
    }
    .in-page-contents strong {
      font-size: 14px;
    }
    .in-page-contents small {
      font-size: 12px;
    }
    .in-page-contents button {
      padding: 12px 0;
    }
    .experiment-layout {
      display: block;
    }
    .materials {
      padding: 18px;
      margin-bottom: 25px;
    }
    .materials ul {
      display: grid;
      grid-template-columns: 1fr 1fr;
      gap: 5px 18px;
      font-size: 13px;
    }
    .comic-grid figcaption {
      min-height: 85px;
    }
    .photo-credits {
      columns: 1;
      font-size: 12px;
    }
    .illustration-credits {
      columns: 1;
    }
    .source-list {
      font-size: 14px;
    }
    .source-list p {
      font-size: 12px;
    }
    .secondary-article {
      padding: 23px 19px;
    }
    .secondary-article h3 {
      font-size: 26px;
    }
    .secondary-copy p {
      font-size: 16px;
    }
    .layout-briefs .article-body {
      grid-template-columns: 1fr;
    }
    .layout-feature .article-header h2 {
      font-size: 36px;
    }
    .spread-panorama {
      margin-left: -20px;
      margin-right: -20px;
      height: 210px;
    }
  }
  /* Feature pages: larger reading text (after the general rules, same specificity). */
  .layout-feature .article-body p {
    font-size: 20px;
    line-height: 1.75;
  }
  @media (max-width: 540px) {
    .layout-feature .article-body p {
      font-size: 18px;
    }
  }
}

/* Configurable editorial compositions: the registry keys match web and A4 print. */
@layer components {
  .editorial-composition { min-width: 0; }
  .editorial-composition section, .editorial-composition aside { min-width: 0; }
  .editorial-composition p { overflow-wrap: anywhere; }
  .variety-grid { display: grid; gap: 22px; grid-template-columns: repeat(2,minmax(0,1fr)); }
  .variety-card { padding: 22px; border-top: 2px solid var(--subject); background: var(--subject-tint); }
  .variety-card:nth-child(even) { background: color-mix(in srgb,var(--subject-tint) 40%,var(--paper)); }
  .variety-card h3 { margin-top: 7px; }
  .variety-number { font: 800 17px var(--display); color: var(--subject); }
  .variety-photo-essay .variety-card { padding: 0; background: transparent; border: 0; }
  .variety-photo-essay .variety-number, .variety-debate-dossier .variety-number { display: none; }
  .composition-photo-essay .composition-photo figcaption { max-width: 50ch; border-left: 3px solid var(--subject); padding-left: 14px; }
  .variety-myth-lab .variety-card { border-top: 0; border-left: 5px solid var(--subject); }
  .variety-notebook-cards { grid-template-columns: minmax(0,57%) minmax(0,1fr); }
  .variety-notebook-cards .variety-card:first-child { grid-column: 1/-1; }
  .variety-puzzle-trail { grid-template-columns: 1fr; border-left: 3px solid var(--subject); margin-left: 18px; }
  .variety-puzzle-trail .variety-card { position: relative; border: 0; margin-left: 21px; }
  .variety-puzzle-trail .variety-number { position: absolute; display: grid; place-items: center; left: -38px; top: 18px; border-radius: 50%; width: 30px; height: 30px; background: var(--subject); color: white; font-size: 13px; }
  .variety-case-file { grid-template-columns: minmax(0,63%) minmax(0,1fr); }
  .variety-case-file .variety-card:nth-child(2) { border-left: 2px solid var(--subject); border-top: 0; }
  .variety-debate-dossier .variety-card { background: transparent; border-top-width: 5px; }
  @media (max-width: 600px) { .variety-grid { grid-template-columns: 1fr; } .variety-card { padding: 18px; } }
  /* Long Dutch compound words remain inside narrow reading cards. */
  .article-lead { overflow-wrap: anywhere; }
  .reading-mode .riddle { min-width: 0; }
  .reading-mode .riddle :is(h3, p, strong) { overflow-wrap: anywhere; }
  .composition-photo { margin: 0 0 24px; }
  .composition-photo-surface { position: relative; }
  .composition-photo img { display: block; width: 100%; height: auto; }
  .composition-photo figcaption { font-size: 13px; line-height: 1.45; margin-top: 8px; color: var(--muted); }
  .composition-copy .composition-sections { max-width: 68ch; }
  .layout-feature-opening .article-header h2 { font-size: clamp(36px, 5vw, 62px); line-height: 1.04; }
  /* A subsequent leaf continues the copy instead of repeating the feature opening. */
  .is-article-continuation .article-header { padding: 0; border: 0; }
  .is-article-continuation .article-header h2 {
    font-size: clamp(22px, 3vw, 28px);
    line-height: 1.2;
    letter-spacing: -.5px;
    margin: 5px 0 10px;
  }
  .is-article-continuation .article-lead {
    font-size: 20px;
    line-height: 1.65;
    font-weight: 400;
    margin-bottom: 16px;
  }
  .is-article-continuation .article-image img,
  .is-article-continuation .composition-photo:not(.photo-with-points) img {
    max-height: 300px;
    aspect-ratio: auto;
    object-fit: contain;
  }
  @media (max-width: 540px) {
    .is-article-continuation .article-lead { font-size: 18px; }
  }
  .composition-feature-opening .composition-photo { margin-inline: -16px; }
  .composition-feature-opening .composition-sections section:first-child p { font-size: 1.12em; }
  .interview-rows { display: grid; gap: 22px; }
  .interview-row { display: grid; grid-template-columns: minmax(0, 31%) minmax(0, 1fr); gap: 22px; border-top: 2px solid var(--subject); padding-top: 17px; }
  .interview-row h3 { margin: 0; }
  .interview-row h3 span { display: block; font: 800 29px var(--display); color: var(--subject); margin-bottom: 8px; }
  .interview-row p { margin: 0; }
  .editorial-timeline { list-style: none; margin: 0 0 26px 15px; padding: 0 0 0 28px; border-left: 3px solid var(--subject); }
  .editorial-timeline li { position: relative; margin: 0; padding-bottom: 24px; }
  .editorial-timeline li::before { content: ''; position: absolute; left: -37px; top: 7px; width: 15px; height: 15px; background: var(--subject); border: 3px solid var(--paper); border-radius: 50%; }
  .editorial-timeline h3 { margin-top: 0; }
  .comparison-panels { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 20px; }
  .comparison-panels[data-columns="3"] { grid-template-columns: repeat(3,minmax(0,1fr)); }
  .comparison-panel { padding: 22px; background: var(--subject-tint); border-top: 5px solid var(--subject); }
  .comparison-panel:nth-child(even) { background: color-mix(in srgb, var(--paper) 85%, var(--subject)); }
  .comparison-letter { display: inline-block; font: 800 42px var(--display); color: var(--subject); }
  .photo-point { position: absolute; transform: translate(-50%,-50%); display: grid; place-items: center; width: 31px; height: 31px; border-radius: 50%; background: var(--paper); color: var(--ink); border: 2px solid var(--subject); font-weight: 800; text-decoration: none; box-shadow: 0 1px 5px #0005; }
  .photo-point:focus-visible { outline: 3px solid var(--ink); outline-offset: 3px; }
  .photo-point-notes { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 18px; padding-left: 24px; }
  .photo-point-notes li { padding: 10px; background: var(--subject-tint); scroll-margin-top: 90px; }
  .photo-point-notes h3 { margin-top: 0; }
  .field-notebook-sheets { border: 1px solid var(--line); background: repeating-linear-gradient(to bottom,transparent 0,transparent 31px,color-mix(in srgb,var(--subject) 10%,transparent) 32px); }
  .field-notebook-entry { display: grid; grid-template-columns: 42px minmax(0,1fr); gap: 18px; padding: 20px 22px; border-bottom: 1px solid var(--line); }
  .field-notebook-entry:last-child { border-bottom: 0; }
  .notebook-entry-number { border-right: 2px solid var(--subject); font: 800 22px var(--display); color: var(--subject); }
  .field-notebook-entry h3 { margin-top: 0; }
  .data-story-grid { display: grid; grid-template-columns: minmax(0,30%) minmax(0,1fr); gap: 28px; }
  .data-value-rail { padding: 0; margin: 0; list-style: none; }
  .data-value-rail li { padding: 18px 16px; margin-bottom: 18px; background: var(--subject-tint); }
  .data-value-rail strong { display: block; font: 800 clamp(26px,4vw,44px) var(--display); line-height: 1.12; color: var(--subject); overflow-wrap: anywhere; }
  .data-value-rail span { display: block; margin-top: 12px; overflow-wrap: anywhere; }
  .comic-notes-grid { display: grid; grid-template-columns: minmax(0,68%) minmax(0,1fr); gap: 20px; }
  .editorial-comic-panels { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 14px; align-content: start; }
  .editorial-comic-panels figure { margin: 0; background: var(--subject-tint); }
  .editorial-comic-panels .comic-art { aspect-ratio: 1; background-size: 200% 300%; background-position: calc(var(--col)*100%) calc(var(--row)*50%); }
  .editorial-comic-panels figcaption { padding: 10px; font-size: 14px; line-height: 1.4; }
  .comic-margin-notes { border-left: 3px solid var(--subject); padding-left: 16px; }
  .comic-margin-notes h3 { font-size: 18px; }
  .comic-margin-notes p { font-size: 15px; line-height: 1.5; }
  .composition-sidebars { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 20px; margin-top: 24px; }
  .next-edition { display: grid; grid-template-columns: minmax(0,1fr); gap: 20px; background: var(--subject-tint); border-top: 4px solid var(--subject); margin-top: 30px; padding: 24px; }
  .next-edition:has(img) { grid-template-columns: 160px minmax(0,1fr); }
  .next-edition img { width: 160px; height: 150px; object-fit: contain; }
  .next-edition h3 { margin: 0 0 10px; font: 800 26px var(--display); }
  .next-edition-date { margin: 0 0 8px; font-size: 14px; }
  .next-edition ul { margin-bottom: 0; padding-left: 20px; }
  @media (max-width:760px) {
    .interview-row, .data-story-grid, .comic-notes-grid { grid-template-columns: minmax(0,1fr); gap: 16px; }
    .interview-row h3 span { display: inline-block; margin: 0 12px 0 0; }
    .data-value-rail { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 12px; }
    .data-value-rail li { margin: 0; }
    .comic-margin-notes { border-left: 0; border-top: 3px solid var(--subject); padding: 16px 0 0; }
  }
  @media (max-width:540px) {
    .reading-mode .riddle-grid { grid-template-columns: minmax(0,1fr); }
    .comparison-panels, .comparison-panels[data-columns], .photo-point-notes, .composition-sidebars, .next-edition:has(img) { grid-template-columns: minmax(0,1fr); }
    .composition-feature-opening .composition-photo { margin-inline: 0; }
    .field-notebook-entry { padding: 16px 12px; grid-template-columns: 30px minmax(0,1fr); gap: 12px; }
    .editorial-comic-panels figcaption { font-size: 13px; }
    .next-edition { padding: 18px; }
  }
}
/* --- Cover fallback ------------------------------------------------------------------------------
   Lees & doe shows the print renderer's page 1 (Pages/Shared/_CoverPrint.cshtml). Until an edition's previews carry a
   cover record (manifest.cover), _MagazinePage.cshtml falls back to this HTML cover: one large portrait, masthead,
   headline and cover lines. The six legacy cover styles (cover-variety.css) are retired. */
@layer components {
  .cover.cover-magazine {
    container-type: inline-size;
    --cover-ink: var(--on-primary, white);
    --cover-surface: var(--green);
    --cover-story-surface: var(--green);
    --cover-story-ink: var(--on-primary, white);
    --cover-highlight: var(--lime);
    --cover-pad: clamp(16px, 4cqw, 36px);
    color: var(--cover-ink);
    background: var(--cover-surface);
  }
  .cover.cover-magazine .cover-hero {
    display: grid;
    grid-template-areas: "top" "head" "deck" "space" "story" "bottom";
    grid-template-columns: minmax(0, 1fr);
    grid-template-rows: auto auto auto minmax(100px, 1fr) auto auto;
    position: relative;
    isolation: isolate;
    width: 100%;
    aspect-ratio: 210 / 297;
    min-height: 620px;
    padding: var(--cover-pad);
    gap: clamp(8px, 1.5cqw, 14px);
    overflow: hidden;
    background: var(--cover-surface);
    color: var(--cover-ink);
  }
  .cover.cover-magazine .cover-photo {
    position: absolute;
    inset: 11.88% auto auto 6.26%;
    width: 87.48%;
    height: 82.47%;
    max-height: none;
    padding: 0;
    border: 0;
    margin: 0;
    object-fit: cover;
    object-position: center;
    z-index: -3;
  }
  .cover.cover-magazine .cover-shade {
    display: block;
    position: absolute;
    inset: 0;
    z-index: -2;
    background: linear-gradient(180deg,
      var(--cover-surface) 0%,
      var(--cover-surface) 14%,
      color-mix(in srgb, var(--cover-surface) 75%, transparent) 24%,
      transparent 39%,
      transparent 52%,
      color-mix(in srgb, var(--cover-surface) 58%, transparent) 65%,
      color-mix(in srgb, var(--cover-surface) 97%, transparent) 83%,
      var(--cover-surface) 100%);
  }
  .cover.cover-magazine .cover-topline {
    grid-area: top;
    padding: 0;
    min-width: 0;
    align-items: start;
    font-size: clamp(9px, 1.35cqw, 13px);
    line-height: 1.35;
    letter-spacing: .04em;
    text-transform: uppercase;
  }
  .cover.cover-magazine .cover-issue { flex: none; text-align: right; }
  .cover.cover-magazine .cover-masthead {
    grid-area: head;
    min-width: 0;
    padding: 0;
    font-size: clamp(39px, 13.2cqw, 116px);
    line-height: .98;
    font-weight: 850;
    letter-spacing: -.055em;
    gap: 8px;
    white-space: nowrap;
    color: var(--cover-ink);
  }
  .cover.cover-magazine .cover-masthead span { font-size: .55em; flex: none; color: var(--cover-highlight); }
  .cover.cover-magazine .cover-deck {
    grid-area: deck;
    padding: 0;
    min-width: 0;
    font-size: clamp(9px, 1.45cqw, 14px);
    line-height: 1.4;
    letter-spacing: .1em;
  }
  .cover.cover-magazine .cover-story {
    grid-area: story;
    position: relative;
    bottom: auto;
    left: auto;
    right: auto;
    margin: 0;
    padding: clamp(12px, 2cqw, 18px);
    min-width: 0;
    max-width: 100%;
    justify-self: start;
    background: var(--cover-story-surface);
    color: var(--cover-story-ink);
  }
  .cover.cover-magazine .cover-label {
    display: inline-block;
    max-width: 100%;
    padding: 6px 10px;
    font-size: clamp(9px, 1.45cqw, 14px);
    line-height: 1.35;
    letter-spacing: .05em;
    transform: none;
    color: var(--on-accent);
    background: var(--lime);
  }
  .cover.cover-magazine .cover-story h2 {
    margin: clamp(10px, 1.8cqw, 18px) 0;
    font-size: clamp(33px, 7.8cqw, 74px);
    line-height: .99;
    letter-spacing: -.035em;
    color: var(--cover-story-ink);
    text-wrap: balance;
    overflow-wrap: anywhere;
    hyphens: auto;
    text-shadow: 0 2px 8px color-mix(in srgb, var(--green) 70%, transparent);
  }
  .cover.cover-magazine .cover-story h2 span,
  .cover.cover-magazine .cover-story h2 em { display: block; }
  .cover.cover-magazine .cover-story h2 em { color: var(--cover-highlight); font-style: normal; }
  .cover.cover-magazine .cover-story p {
    margin: 0;
    max-width: 38em;
    font-size: clamp(14px, 2cqw, 19px);
    line-height: 1.4;
    font-weight: 600;
  }
  .cover.cover-magazine .cover-bottom {
    grid-area: bottom;
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    position: relative;
    bottom: auto;
    left: auto;
    right: auto;
    margin: 10px 0 0;
    padding: 15px 12px 12px;
    gap: clamp(12px, 2cqw, 20px);
    min-width: 0;
    background: var(--green);
    border-top: 1px solid color-mix(in srgb, var(--on-primary, white) 45%, transparent);
  }
  .cover.cover-magazine .cover-bottom button {
    display: flex;
    align-items: start;
    gap: 9px;
    padding: 0;
    min-height: 44px;
    min-width: 0;
    border: 0;
    color: var(--on-primary, white);
    text-align: left;
    background: transparent;
    border-radius: 0;
  }
  .cover.cover-magazine .cover-bottom button + button {
    border-left: 1px solid color-mix(in srgb, var(--on-primary, white) 35%, transparent);
    padding-left: clamp(12px, 2cqw, 20px);
  }
  .cover.cover-magazine .cover-bottom button:hover .cover-feature-copy small { text-decoration: underline; }
  .cover.cover-magazine .cover-bottom button:focus-visible { outline: 2px solid var(--lime); outline-offset: 5px; }
  .cover.cover-magazine .cover-feature-page {
    display: flex;
    flex-direction: column;
    flex: none;
    font: 850 clamp(22px, 3.6cqw, 34px) / 1 var(--display);
    color: var(--lime);
  }
  .cover.cover-magazine .cover-page-prefix { font: 650 10px / 1.2 var(--body); }
  .cover.cover-magazine .cover-feature-copy { min-width: 0; }
  .cover.cover-magazine .cover-bottom b {
    color: var(--lime);
    font-size: clamp(9px, 1.2cqw, 12px);
    line-height: 1.3;
    letter-spacing: .05em;
    margin-bottom: 5px;
    overflow-wrap: anywhere;
  }
  .cover.cover-magazine .cover-bottom small {
    font-size: clamp(14px, 1.8cqw, 17px);
    line-height: 1.3;
    font-weight: 650;
    overflow-wrap: anywhere;
  }
  .cover.cover-magazine .cover-caption,
  .cover.cover-magazine .cover-panel { color: var(--ink); background: var(--paper); }

  @container (max-width: 600px) {
    /* Phones reflow the text below the central picture. Keep the whole portrait
       visible, so characters near either edge are not cropped from the cover. */
    .cover.cover-magazine .cover-photo { object-fit: contain; object-position: center top; }
  }

  @container (max-width: 540px) {
    .cover.cover-magazine .cover-hero {
      aspect-ratio: auto;
      min-height: 720px;
      grid-template-rows: auto auto auto minmax(180px, 1fr) auto auto;
    }
    .cover.cover-magazine .cover-topline { gap: 8px; }
    .cover.cover-magazine .cover-topline > span:first-child { max-width: 55%; }
    .cover.cover-magazine .cover-issue { flex: 0 1 auto; }
    .cover.cover-magazine .cover-bottom { grid-template-columns: 1fr; gap: 0; padding-top: 6px; }
    .cover.cover-magazine .cover-bottom button { align-items: center; padding: 8px 0; }
    .cover.cover-magazine .cover-bottom button + button {
      padding-left: 0;
      border-left: 0;
      border-top: 1px solid color-mix(in srgb, var(--on-primary, white) 30%, transparent);
    }
    .cover.cover-magazine .cover-feature-page { min-width: 32px; }
    .cover.cover-magazine .cover-story h2 { font-size: clamp(30px, 7.8cqw, 42px); }
    .cover.cover-magazine .cover-bottom b { margin-bottom: 2px; }
  }
}
