/* wi-article.css -- BUILD: 2026-12-05-K
   The article page's styling (web page view and book view), shared by every published article, news story, topic and
   issue page: each page links to this one file, so a change here shows on every page at the next deploy, with no page
   rebuilt. Until 2026-12-05-K every page carried its own copy inside it (article_render.php). */
  /* This block intentionally comes LAST in <head>. */
  :root {
    --font-display: "Fraunces", Georgia, serif;
    --font-body: "Inter", system-ui, -apple-system, sans-serif;

    /* Content still caps out (so lines of text don't get absurdly wide
       on ultra-wide monitors), but noticeably wider than before so a
       1920px+ screen doesn't show huge empty gutters on either side. */
    --page-max-width: 1600px;

    --accent: #0f4a44;
    --accent-strong: #0a332f;
    --accent-soft: #e4efed;

    --bg: #faf9f6;
    --bg-raised: #ffffff;
    --text: #17191c;
    --text-muted: #565c60;
    --border: #e3e1da;
    --shadow: 0 8px 24px rgba(20, 20, 20, 0.08);
    --carousel-bg: #14161a; /* matte letterbox color behind object-fit: contain images -- deliberately the same in light/dark mode */
  }

  [data-theme="dark"] {
    --accent: #57bfae;
    --accent-strong: #7ad4c4;
    --accent-soft: #12302c;

    --bg: #121314;
    --bg-raised: #1a1c1e;
    --text: #ecece9;
    --text-muted: #a4a9ac;
    --border: #2d2f31;
    --shadow: 0 8px 24px rgba(0, 0, 0, 0.4);
  }

  @media (prefers-color-scheme: dark) {
    :root:not([data-theme="light"]) {
      --accent: #57bfae;
      --accent-strong: #7ad4c4;
      --accent-soft: #12302c;

      --bg: #121314;
      --bg-raised: #1a1c1e;
      --text: #ecece9;
      --text-muted: #a4a9ac;
      --border: #2d2f31;
      --shadow: 0 8px 24px rgba(0, 0, 0, 0.4);
    }
  }

  *, *::before, *::after { box-sizing: border-box; }

  html { color-scheme: light dark; }

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

  a { color: var(--accent-strong); }
  a:focus-visible, button:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; }

  img { max-width: 100%; }

  /* ---------- Header ---------- */
  .site-header {
    position: sticky;
    top: 0;
    z-index: 40;
    background: var(--bg-raised);
    border-bottom: 1px solid var(--border);
  }

  .site-header-inner {
    display: flex;
    align-items: center;
    gap: .5rem;
    max-width: var(--page-max-width);
    margin: 0 auto;
    padding: 0 .5rem;
  }

  .menu-slot {
    flex: 1 1 auto;
    min-width: 0;
  }

  .theme-toggle {
    flex: 0 0 auto;
    display: inline-flex;
    align-items: center;
    gap: .4rem;
    border: 1px solid var(--border);
    background: var(--bg-raised);
    color: var(--text);
    border-radius: 999px;
    padding: .4rem .7rem;
    cursor: pointer;
    font-size: .85rem;
    font-family: var(--font-body);
  }

  /* ---------- Carousel (reusable: masthead + inline both use this) ---------- */
  .masthead-carousel {
    max-width: var(--page-max-width);
    margin: 0 auto;
    aspect-ratio: 16 / 7;
  }
  @media (max-width: 599px) {
    .masthead-carousel { aspect-ratio: 4 / 3; }
  }

  /* Small "stamp" ad dropped between paragraphs -- not a full-width
     strip, a compact block sized more like a display ad unit. The
     background/border card keeps a dark ad creative visible instead
     of disappearing into the page background (worse in dark mode). */
  .inline-carousel-wrap {
    margin: 1.5rem 0;
    display: inline-flex;
    width: fit-content;
    max-width: 100%;
    flex-direction: column;
    align-items: flex-start;
    background: var(--bg-raised);
    border: 1px solid var(--border);
    border-radius: 10px;
    padding: .6rem;
  }
  /* every other carousel between paragraphs sits on the right */
  .inline-carousel-wrap.align-right {
    display: flex;
    margin-left: auto;
  }
  .inline-carousel-label {
    font-size: .72rem;
    text-transform: uppercase;
    letter-spacing: .04em;
    color: var(--text-muted);
    margin: 0 0 .4rem;
  }
  .inline-carousel {
    width: 220px;
    max-width: 100%;
    aspect-ratio: 4 / 3;
    border-radius: 8px;
    overflow: hidden;
  }
  /* Scale the shared nav/dots down to suit this much smaller size */
  .inline-carousel .carousel-nav {
    width: 24px;
    height: 24px;
    font-size: .85rem;
  }
  .inline-carousel .carousel-dots {
    bottom: .35rem;
    gap: .25rem;
  }
  .inline-carousel .carousel-dot {
    width: 6px;
    height: 6px;
  }

  .carousel {
    position: relative;
    width: 100%;
    height: 100%;
    overflow: hidden;
    background: var(--carousel-bg);
  }

  .carousel-track {
    display: flex;
    height: 100%;
    transition: transform .5s ease;
  }

  .carousel-slide {
    flex: 0 0 100%;
    height: 100%;
    position: relative;
    background: var(--carousel-bg);
  }

  .carousel-slide img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    display: block;
  }

  .carousel-slide a.carousel-link {
    position: absolute;
    inset: 0;
    display: block;
  }

  .carousel-nav {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 36px;
    height: 36px;
    border-radius: 50%;
    border: none;
    background: rgba(0, 0, 0, .45);
    color: #fff;
    font-size: 1.1rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
  }
  .carousel-nav.prev { left: .75rem; }
  .carousel-nav.next { right: .75rem; }

  .carousel-dots {
    position: absolute;
    bottom: .75rem;
    left: 0;
    right: 0;
    display: flex;
    justify-content: center;
    gap: .4rem;
  }

  .carousel-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: rgba(255, 255, 255, .55);
    border: none;
    padding: 0;
    cursor: pointer;
  }
  .carousel-dot[aria-current="true"] { background: #fff; }

  /* ---------- Per-paragraph images ---------- */
  .para-with-image {
    display: flex;
    flex-direction: row;
    align-items: center; /* image column centers against the text column, not top-pinned */
    gap: 1.5rem;
    margin: 1.5rem 0;
  }
  .para-with-image-text { flex: 1 1 60%; min-width: 0; }
  .para-with-image-text p { margin: 0; }
  .article-video { margin: 0 0 1.5rem; }
  .article-video video { display: block; width: 100%; height: auto; border-radius: 10px; background: #000; }
  .para-with-image-text > h1, .para-with-image-text > h2, .para-with-image-text > h3,
  .para-with-image-text > h4, .para-with-image-text > h5, .para-with-image-text > h6 { margin: 0 0 .4em; }   /* a heading over its paragraph */
  .para-with-image-figure {
    flex: 0 0 35%;
    margin: 0;
  }
  /* a carousel in the picture's column (a story without pictures): it fills the column */
  .para-with-image-figure.is-carousel { flex-basis: 30%; }
  .para-with-image-figure.is-carousel .inline-carousel-wrap { display: flex; width: 100%; margin: .2rem 0 0; box-sizing: border-box; }
  /* a paragraph with several slides: one below the other in the picture column */
  .pstack { display: flex; flex-direction: column; gap: .6rem; }
  .pstack > a { display: block; }
  .para-with-image-figure img {
    width: 100%;
    height: auto;
    border-radius: 10px;
    display: block;
  }
  .para-with-image-figure figcaption {
    font-size: .78rem;
    color: var(--text-muted);
    margin-top: .4rem;
    text-align: center;
  }
  /* Inline carousel nested directly under the image it belongs to,
     rather than as an unrelated block elsewhere in the flow */
  .para-with-image-figure .inline-carousel-wrap {
    margin: .75rem 0 0;
    display: flex;
    width: 100%;
    align-items: stretch;
  }
  .para-with-image-figure .inline-carousel {
    width: 100%;
  }

  /* Product page sections -- tagline, feature list, price/buy box,
     contributor bios. See renderProductHtml() in
     inc_render_article_to_string.php for how this body is built. */
  .product-tagline {
    font-family: var(--font-display);
    font-size: 1.15rem;
    font-style: italic;
    color: var(--text-muted);
    border-left: 3px solid var(--accent);
    padding: .3rem 0 .3rem 1rem;
    margin: 1.5rem 0;
  }
  .product-features {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 1rem;
    margin: 1.5rem 0;
  }
  .product-feature {
    background: var(--bg-raised);
    border: 1px solid var(--border);
    border-radius: 10px;
    padding: 1rem 1.1rem;
    font-size: .92rem;
  }
  .product-buy-box {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 1rem;
    background: var(--bg-raised);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 1.25rem 1.5rem;
    margin: 2rem 0;
  }
  .product-price {
    font-family: var(--font-display);
    font-size: 1.6rem;
    font-weight: 700;
    color: var(--accent);
  }
  .add-to-basket-btn {
    background: var(--accent);
    color: #fff;
    border: none;
    border-radius: 999px;
    padding: .75rem 1.6rem;
    font-size: 1rem;
    font-weight: 600;
    font-family: var(--font-body);
    cursor: pointer;
  }
  .add-to-basket-btn:hover { background: var(--accent-strong); }
  .add-to-basket-status { font-size: .85rem; color: var(--text-muted); }
  .product-contributors {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 1.5rem;
    margin: 2rem 0;
  }
  .product-contributor h3 {
    font-family: var(--font-display);
    font-size: 1.05rem;
    margin: 0 0 .4rem;
  }
  .product-contributor p {
    font-size: .92rem;
    color: var(--text-muted);
  }

  /* Product catalog page -- see renderProductCatalogHtml() */
  .product-catalog-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 1.25rem;
    margin: 1.5rem 0;
  }
  .product-catalog-empty {
    grid-column: 1 / -1;
    color: var(--text-muted);
    font-style: italic;
  }
  .product-catalog-card {
    display: flex;
    flex-direction: column;
    background: var(--bg-raised);
    border: 1px solid var(--border);
    border-radius: 12px;
    overflow: hidden;
    text-decoration: none;
    color: inherit;
    transition: transform .15s ease, box-shadow .15s ease;
  }
  .product-catalog-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 6px 16px rgba(0,0,0,.12);
  }
  .product-catalog-card img {
    width: 100%;
    aspect-ratio: 4 / 3;
    object-fit: cover;
  }
  .product-catalog-card-body {
    padding: .9rem 1rem 1.1rem;
  }
  .product-catalog-card-body h3 {
    font-family: var(--font-display);
    font-size: 1rem;
    margin: 0 0 .3rem;
    color: var(--text);
  }
  .product-catalog-card-tagline {
    font-size: .85rem;
    color: var(--text-muted);
    margin: 0 0 .5rem;
  }
  .product-catalog-card-price {
    font-family: var(--font-display);
    font-weight: 700;
    color: var(--accent);
  }

  /* Desktop: alternate sides via 'order', not by swapping markup */
  .para-with-image:not(.reverse) .para-with-image-text   { order: 1; }
  .para-with-image:not(.reverse) .para-with-image-figure { order: 2; }
  .para-with-image.reverse       .para-with-image-text   { order: 2; }
  .para-with-image.reverse       .para-with-image-figure { order: 1; }

  /* Mobile: always stack, text before image, regardless of side above */
  @media (max-width: 699px) {
    .para-with-image { flex-direction: column; align-items: stretch; }
    .para-with-image .para-with-image-text,
    .para-with-image.reverse .para-with-image-text { order: 1; }
    .para-with-image .para-with-image-figure,
    .para-with-image.reverse .para-with-image-figure { order: 2; }
    .para-with-image-figure { flex: 0 0 auto; }
  }

  /* ---------- Main 80/20 grid ---------- */
  main.content-grid {
    max-width: var(--page-max-width);
    margin: 0 auto;
    padding: 1.25rem 1rem 2.5rem;
    display: grid;
    grid-template-columns: 1fr;
    grid-template-areas: "tabs" "article" "sidebar";
    gap: 2rem;
  }

  @media (min-width: 900px) {
    main.content-grid {
      grid-template-columns: 4fr 1fr; /* 80% / 20% */
      grid-template-rows: auto 1fr;
      grid-template-areas:
        "article tabs"
        "article sidebar";
      align-items: start;
    }
  }

  .article-column { grid-area: article; }
  .sidebar-column { grid-area: sidebar; }

  .article-column article header.article-head { margin-bottom: 1.25rem; }

  .article-eyebrow {
    text-transform: uppercase;
    letter-spacing: .08em;
    font-size: .75rem;
    font-weight: 600;
    color: var(--accent-strong);
  }

  h1.article-title {
    font-family: var(--font-display);
    font-size: clamp(1.7rem, 4vw, 2.6rem);
    line-height: 1.15;
    margin: .4rem 0 .6rem;
  }

  .article-byline {
    color: var(--text-muted);
    font-size: .9rem;
  }

  /* small and quiet, but readable: search engines read the keywords from the head (meta keywords and the
     Article data); text made too small to read, for search engines only, counts as hidden text (spam) */
  /* ================= Coffee-table book view (built by the book script; the web page underneath is unchanged) ================= */
  .cbook { --cb-paper:#f6f1e7; --cb-ink:#24211c; --cb-muted:#6d665b; --cb-accent:#8a5a2b; --cb-rule:#e2d9c8; --cb-frame:#fff; --cb-chip:rgba(246,241,231,.92);
    position: fixed; inset: 0; z-index: 2000; background: var(--cb-paper); color: var(--cb-ink); font-family: "Noto Serif", Georgia, "Times New Roman", serif; }
  @media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .cbook { --cb-paper:#1b1916; --cb-ink:#ece6da; --cb-muted:#a59d8f; --cb-accent:#d49a5e; --cb-rule:#3a352d; --cb-frame:#2a2622; --cb-chip:rgba(27,25,22,.9); } }
  :root[data-theme="dark"] .cbook { --cb-paper:#1b1916; --cb-ink:#ece6da; --cb-muted:#a59d8f; --cb-accent:#d49a5e; --cb-rule:#3a352d; --cb-frame:#2a2622; --cb-chip:rgba(27,25,22,.9); }
  html.cbook-open, html.cbook-open body { overflow: hidden; }
  /* the site's menu stays in view above the book: fixed at the top, the book starting just below it (its phone menu opens over the book) */
  html.cbook-open .site-header { position: fixed; top: 0; left: 0; right: 0; z-index: 2100; }
  .cbook { top: var(--cb-site-head, 0px); }
  .cb-view { position: absolute; inset: 0; display: flex; overflow-x: auto; overflow-y: hidden; scroll-snap-type: x mandatory; scrollbar-width: none; }
  .cb-view::-webkit-scrollbar { display: none; }
  .cb-pg { flex: 0 0 100vw; height: 100%; scroll-snap-align: start; position: relative; overflow: hidden; }
  .cb-top { position: absolute; top: 0; left: 0; right: 0; z-index: 5; display: flex; align-items: center; gap: 10px; padding: 10px 14px; font: 13px/1.2 system-ui, sans-serif; color: var(--cb-muted); }
  .cb-line { flex: 1; height: 2px; background: var(--cb-rule); } .cb-line span { display: block; height: 100%; width: 0; background: var(--cb-accent); transition: width .25s; }
  .cb-top button, .cb-cols { border: 1px solid var(--cb-rule); background: var(--cb-chip); color: var(--cb-ink); border-radius: 999px; padding: 5px 12px; font: inherit; cursor: pointer; }
  .cb-watch { font-weight: 600; }
  .cb-vplayer { position: fixed; inset: 0; z-index: 2147483000; background: #0b0b0d; display: none; align-items: center; justify-content: center; }
  .cb-vplayer.on { display: flex; }
  .cb-vplayer video { width: min(96vw, calc(92vh * 16 / 9)); max-height: 92vh; background: #000; border-radius: 6px; }
  .cb-vclose { position: absolute; top: 14px; right: 18px; width: 44px; height: 44px; border-radius: 50%; border: 1px solid rgba(255,255,255,.55); background: transparent; color: #fff; font-size: 26px; cursor: pointer; }
  html.cb-vopen, html.cb-vopen body { overflow: hidden; }
  .cb-cols { display: inline-flex; align-items: center; gap: 2px; padding: 3px 4px 3px 10px; overflow: hidden; }
  .cb-cols-cap { font-size: 11px; letter-spacing: .08em; text-transform: uppercase; color: var(--cb-muted); margin-right: 4px; }
  .cb-cols button { display: grid; place-items: center; width: 30px; height: 26px; border: 0; border-radius: 999px; background: transparent; padding: 0; color: var(--cb-muted); }
  .cb-cols button svg { fill: currentColor; }
  .cb-cols button:hover { color: var(--cb-ink); }
  .cb-cols button[aria-pressed="true"] { background: var(--cb-ink); color: var(--cb-paper); }
  .cb-lang { display: inline-flex; align-items: center; gap: 4px; border: 1px solid var(--cb-rule); background: var(--cb-chip); border-radius: 999px; padding: 2px 6px 2px 10px; }
  .cb-lang select { border: 0; background: transparent; color: var(--cb-ink); font: inherit; padding: 3px 2px; cursor: pointer; max-width: 9.5rem; }
  .cb-lang select option { color: #222; }
  .cb-arrow { position: absolute; top: 50%; transform: translateY(-50%); z-index: 5; width: 54px; height: 54px; border-radius: 50%; display: grid; place-items: center; padding: 0 0 4px;
    background: rgba(20,18,14,.78); color: #fff; border: 2px solid rgba(255,255,255,.9); box-shadow: 0 6px 18px rgba(0,0,0,.35); font-size: 30px; line-height: 1; cursor: pointer; }
  .cb-arrow:hover { background: rgba(20,18,14,.92); } .cb-arrow:disabled { opacity: .3; cursor: default; }
  .cb-arrow.cb-prev { left: 14px; } .cb-arrow.cb-next { right: 14px; }
  .cb-pager { position: absolute; left: 50%; bottom: 14px; transform: translateX(-50%); z-index: 6; display: flex; align-items: center; gap: 10px; padding: 6px 8px; border-radius: 999px;
    background: var(--cb-chip); border: 1px solid var(--cb-rule); box-shadow: 0 6px 20px rgba(0,0,0,.18); font: 13px/1 system-ui, sans-serif; color: var(--cb-ink); }
  .cb-pager .cb-p, .cb-pager .cb-n { width: 34px; height: 34px; border-radius: 50%; border: 0; background: var(--cb-ink); color: var(--cb-paper); font-size: 20px; line-height: 1; cursor: pointer; padding: 0 0 3px; }
  .cb-pager .cb-p:disabled, .cb-pager .cb-n:disabled { opacity: .3; cursor: default; }
  .cb-dots { display: flex; gap: 7px; align-items: center; }
  .cb-dots button { flex: 0 0 auto; width: 9px; height: 9px; padding: 0; border-radius: 50%; background: var(--cb-rule); border: 1px solid var(--cb-muted); cursor: pointer; }
  .cb-dots button[aria-current="true"] { width: 22px; border-radius: 5px; background: var(--cb-accent); border-color: var(--cb-accent); }
  .cb-scrub { display: none; width: min(40vw, 240px); accent-color: var(--cb-accent); }
  .cb-pager.cb-many .cb-dots { display: none; } .cb-pager.cb-many .cb-scrub { display: block; }
  .cb-pager { transition: opacity .35s ease, transform .35s ease; }
  .cbook.cb-idle .cb-pager { opacity: 0; transform: translate(-50%, 14px); pointer-events: none; }
  @media (prefers-reduced-motion: reduce) { .cb-pager { transition: none; } }
  .cb-where { min-width: 3.6rem; text-align: center; font-variant-numeric: tabular-nums; }
  /* cover */
  .cb-cover { background: #14110d; }
  .cb-cover > .cb-cover-bg { position: absolute; inset: -6%; width: 112%; height: 112%; object-fit: cover; filter: blur(28px) brightness(.55) saturate(1.1); }
  .cb-cover > .cb-cover-img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: contain; }   /* the whole picture, never cropped */
  .cb-cover::after { content: ""; position: absolute; inset: 0; background: linear-gradient(to top, rgba(10,8,5,.82) 0%, rgba(10,8,5,.35) 38%, rgba(10,8,5,0) 62%); }
  .cb-cover-text { position: absolute; left: 0; right: 0; bottom: 0; z-index: 2; padding: 0 7vw 12vh; color: #fff; }
  .cb-kicker { font: 600 12px/1.2 system-ui, sans-serif; letter-spacing: .18em; text-transform: uppercase; opacity: .85; margin: 0 0 .6rem; }
  .cb-cover h1 { font-size: clamp(2.2rem, 6.5vw, 4.6rem); line-height: 1.04; margin: 0 0 .7rem; font-weight: 700; color: #fff; }
  .cb-byline { font: 14px/1.3 system-ui, sans-serif; opacity: .88; margin: 0; }
  /* frames */
  .cb-frame { margin: 0; background: var(--cb-frame); padding: 8px; border-radius: 4px; box-shadow: 0 10px 30px rgba(60,40,10,.18), 0 1px 3px rgba(60,40,10,.15); cursor: zoom-in; }
  .cb-frame img, .cb-frame video { display: block; width: 100%; height: 100%; object-fit: cover; border-radius: 2px; }
  .cb-label { font: 600 11px/1.2 system-ui, sans-serif; letter-spacing: .16em; text-transform: uppercase; color: var(--cb-accent); margin: 1.6rem 0 .6rem; }
  /* summary page */
  .cb-intro-in { height: 100%; display: flex; flex-direction: column; align-items: center; justify-content: center; padding: 64px 8vw 84px; max-width: 920px; margin: 0 auto; box-sizing: border-box; }
  .cb-intro .cb-frame:not(.cb-video) { width: auto; max-width: min(640px, 100%); padding: 8px; }
  .cb-intro .cb-frame:not(.cb-video) img { width: auto; max-width: 100%; height: auto; max-height: 44svh; object-fit: contain; }   /* its own shape */
  .cb-intro .cb-frame.cb-video { width: min(640px, 100%); }
  .cb-intro .cb-frame.cb-video { cursor: default; aspect-ratio: 16/9; }
  .cb-summary { font-size: clamp(1.12rem, 2.3vw, 1.45rem); line-height: 1.55; font-style: italic; text-align: center; margin: 0; max-width: 42ch; }
  /* text pages: the picture across the top, the text centred below it in columns */
  .cb-leaf-in { height: 100%; box-sizing: border-box; display: flex; flex-direction: column; align-items: center; gap: 2.2vh; padding: 58px 6vw 84px; max-width: 1240px; margin: 0 auto; overflow-y: auto; }
  .cb-leaf .cb-frame { flex: 0 0 auto; width: min(100%, calc((100svh - 300px) * 1.5)); aspect-ratio: 3/2; }
  .cb-copy-wrap { flex: 1 0 auto; display: flex; flex-direction: column; width: 100%; align-items: center; }
  .cb-copy { margin: auto 0; width: 100%; }
  .cb-copy p { text-align: justify; hyphens: auto; -webkit-hyphens: auto; margin: 0 0 .8em; font-size: clamp(1rem, 1.1vw, 1.1rem); line-height: 1.68; }
  .cb-copy h1, .cb-copy h2, .cb-copy h3, .cb-copy h4 { margin: 0 0 .5em; font-size: 1.25em; }   /* never column-span: WebKit/Safari mishandles it */
  .cb-copy > p:first-of-type::first-letter, .cb-body > p:first-of-type::first-letter { float: left; font-size: 3.3em; line-height: .9; padding: .06em .1em 0 0; color: var(--cb-accent); font-weight: 700; }
  /* the reader's column choice, for text-only pages (picture pages are laid out by the script, column box by column box) */
  .cbook[data-cols="1"] .cb-textonly .cb-copy { max-width: 68ch; }
  .cbook[data-cols="1"] .cb-copy p { font-size: clamp(1.02rem, 1.2vw, 1.15rem); line-height: 1.75; }
  .cbook[data-cols="2"] .cb-textonly .cb-body { columns: 2; column-gap: 2.6rem; column-rule: 1px solid var(--cb-rule); }
  .cbook[data-cols="3"] .cb-textonly .cb-body { columns: 3 15rem; column-gap: 2.2rem; column-rule: 1px solid var(--cb-rule); }
  .cb-textonly .cb-copy p { font-size: clamp(1.08rem, 1.4vw, 1.25rem); }
  /* columns: never one line of a paragraph alone at the foot or head of a column; a heading stays with what follows */
  .cbook .cb-copy p, .cbook .cb-body p { orphans: 2; widows: 2; }
  /* no large first letter on a paragraph of a line or two (the next paragraph would wrap around it) */
  .cbook p.cb-nocap::first-letter, .cbook p.has-table-note::first-letter, .cbook table ~ p::first-letter { float: none !important; font-size: inherit !important; line-height: inherit !important; padding: 0 !important; color: inherit !important; font-weight: inherit !important; }
  .cbook .cb-copy h1, .cbook .cb-copy h2, .cbook .cb-copy h3, .cbook .cb-copy h4, .cbook .cb-body h2, .cbook .cb-body h3, .cbook .cb-body h4 { break-after: avoid; break-inside: avoid; }
  /* text pages with a picture: the picture keeps its own shape (never cropped); the script picks the arrangement */
  .cb-pic .cb-leaf-in { justify-content: flex-start; }
  .cb-pic .cb-grid { margin-block: auto; }              /* centred when it fits; a taller page starts at the top and scrolls */
  .cb-hl:empty { display: none; } .cb-hl h1, .cb-hl h2, .cb-hl h3, .cb-hl h4 { margin: 0; }
  .cb-grid { width: 100%; display: grid; gap: 1.4rem 2.2rem; align-items: start; }
  .cb-fig { margin: 0; cursor: zoom-in; }
  .cb-fig.cb-multi { display: flex; flex-direction: column; gap: .5rem; }
  .cb-fig.cb-multi img { max-height: max(18svh, calc(74svh / var(--cb-pics, 1) - .5rem)) !important; }
  .cb-fig img { display: block; max-width: 100%; max-height: 54svh; width: auto; height: auto; margin: 0 auto; background: var(--cb-frame); padding: 8px; border-radius: 4px;
    box-shadow: 0 10px 30px rgba(60,40,10,.18), 0 1px 3px rgba(60,40,10,.15); box-sizing: border-box; }
  .cb-grid .cb-copy:empty, .cb-grid .cb-hl:empty { display: none; }
  .cb-grid .cb-copy { margin: 0; }
  /* stack: the picture across, one column below */
  .cb-m-stack .cb-grid { grid-template-columns: 1fr; justify-items: center; }
  .cb-m-stack .cb-c1 { max-width: 68ch; }
  /* wide: the picture across the top, balanced columns below */
  .cb-m-wide .cb-grid { grid-template-columns: 1fr; }
  .cb-m-wide .cb-c1 { columns: var(--cb-n, 2); column-gap: 2.4rem; column-rule: 1px solid var(--cb-rule); }
  /* Double, long text: two columns; the picture spans one; the text flows around it in reading order */
  .cb-m-dflowL .cb-grid, .cb-m-dflowR .cb-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .cb-m-dflowL .cb-fig { grid-column: 1; grid-row: 1; } .cb-m-dflowL .cb-c1 { grid-column: 1; grid-row: 2; } .cb-m-dflowL .cb-c2 { grid-column: 2; grid-row: 1 / 3; }
  .cb-m-dflowR .cb-fig { grid-column: 2; grid-row: 1; } .cb-m-dflowR .cb-c1 { grid-column: 1; grid-row: 1 / 3; } .cb-m-dflowR .cb-c2 { grid-column: 2; grid-row: 2; }
  .cb-m-dflowL .cb-fig img { margin: 0 auto 0 0; } .cb-m-dflowR .cb-fig img { margin: 0 0 0 auto; }
  .cb-m-dflowL .cb-c2, .cb-m-dflowR .cb-c2 { border-left: 1px solid var(--cb-rule); padding-left: 1.2rem; margin-left: -1.2rem; }
  .cb-m-dflowL .cb-fig img, .cb-m-dflowR .cb-fig img { max-height: 58svh; }
  /* Double, short text: a large picture, about 60% of the width, flush left or right; the text beside it */
  .cb-m-dbl .cb-grid { grid-template-columns: minmax(0, 3fr) minmax(0, 2fr); }
  .cb-m-dbl.cb-right .cb-grid { grid-template-columns: minmax(0, 2fr) minmax(0, 3fr); }
  .cb-m-dbl.cb-left .cb-fig { grid-column: 1; grid-row: 1; } .cb-m-dbl.cb-left .cb-c1 { grid-column: 2; grid-row: 1; }
  .cb-m-dbl.cb-right .cb-fig { grid-column: 2; grid-row: 1; } .cb-m-dbl.cb-right .cb-c1 { grid-column: 1; grid-row: 1; }
  .cb-m-dbl.cb-left .cb-fig img { margin: 0 auto 0 0; } .cb-m-dbl.cb-right .cb-fig img { margin: 0 0 0 auto; }
  .cb-m-dbl .cb-c2 { display: none; }
  /* the picture's size depends only on the layout, never on the length of the text */
  .cb-m-dbl .cb-fig img, .cb-m-side .cb-fig img, .cb-m-flowL .cb-fig img, .cb-m-flowR .cb-fig img { max-height: 58svh; }
  .cb-m-wide .cb-fig img, .cb-m-stack .cb-fig img { max-height: 50svh; }
  /* side and flow: a three-column grid; the picture spans two */
  .cb-m-side .cb-grid, .cb-m-flowL .cb-grid, .cb-m-flowR .cb-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .cb-m-side.cb-left .cb-fig, .cb-m-flowL .cb-fig { grid-column: 1 / 3; grid-row: 1; }
  .cb-m-side.cb-right .cb-fig, .cb-m-flowR .cb-fig { grid-column: 2 / 4; grid-row: 1; }
  .cb-m-side.cb-left .cb-fig img, .cb-m-flowL .cb-fig img { margin: 0 auto 0 0; }
  .cb-m-side.cb-right .cb-fig img, .cb-m-flowR .cb-fig img { margin: 0 0 0 auto; }
  .cb-m-side.cb-left .cb-c3 { grid-column: 3; grid-row: 1; }
  .cb-m-side.cb-right .cb-c1 { grid-column: 1; grid-row: 1; }
  .cb-m-flowL .cb-c1 { grid-column: 1; grid-row: 2; } .cb-m-flowL .cb-c2 { grid-column: 2; grid-row: 2; } .cb-m-flowL .cb-c3 { grid-column: 3; grid-row: 1 / 3; }
  .cb-m-flowR .cb-c1 { grid-column: 1; grid-row: 1 / 3; } .cb-m-flowR .cb-c2 { grid-column: 2; grid-row: 2; } .cb-m-flowR .cb-c3 { grid-column: 3; grid-row: 2; }
  .cb-m-flowL .cb-c2, .cb-m-flowL .cb-c3, .cb-m-flowR .cb-c2, .cb-m-flowR .cb-c3 { border-left: 1px solid var(--cb-rule); padding-left: 1.1rem; margin-left: -1.1rem; }
  /* only the first column of the text keeps the decorative first letter */
  .cb-c2 > p:first-of-type::first-letter, .cb-c3 > p:first-of-type::first-letter, .cb-m-flowL .cb-c3 > p:first-of-type::first-letter { float: none; font-size: inherit; color: inherit; padding: 0; font-weight: inherit; }
  .cb-m-side.cb-left .cb-c3 > p:first-of-type::first-letter { float: left; font-size: 3.3em; line-height: .9; padding: .06em .1em 0 0; color: var(--cb-accent); font-weight: 700; }
  .cb-copy p.cb-cont::first-letter { float: none !important; font-size: inherit !important; color: inherit !important; padding: 0 !important; font-weight: inherit !important; }
  /* room for the side arrows (54px at 14px from the edge): content never runs underneath them */
  @media (min-width: 701px) {
    .cb-leaf-in, .cb-intro-in, .cb-ad-in, .cb-end-in { padding-left: max(6vw, 84px) !important; padding-right: max(6vw, 84px) !important; }
  }
  @media (orientation: portrait) and (min-width: 700px) { .cb-copy p { font-size: 1.16rem; line-height: 1.7; } }
  /* advertisement pages */
  .cb-ad-in { height: 100%; display: flex; flex-direction: column; align-items: center; justify-content: center; padding: 64px 8vw 84px; box-sizing: border-box; }
  .cb-ad-in a { display: block; width: min(520px, 100%); } .cb-ad-in img { width: 100%; height: auto; border-radius: 8px; box-shadow: 0 10px 30px rgba(0,0,0,.18); }
  /* the back cover: topics, buttons, and the site footer at the foot of the page */
  .cb-end { display: flex; flex-direction: column; }
  .cb-end-in { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: .6rem; padding: 64px 8vw 24px; text-align: center; box-sizing: border-box; }
  .cb-end-kicker { color: var(--cb-muted); }
  .cb-end .cb-label { margin: 1rem 0 .2rem; }
  .cb-points { list-style: none; margin: 0 0 1.4rem; padding: 0; max-width: 46ch; width: 100%; text-align: start; }
  .cb-points li { position: relative; padding: .5rem 0 .5rem 1.6rem; border-bottom: 1px solid var(--cb-rule); font-size: 1.06rem; line-height: 1.45; color: var(--cb-ink); }
  .cb-points li:last-child { border-bottom: 0; }
  .cb-points li::before { content: ""; position: absolute; left: .2rem; top: 1.05rem; width: .55rem; height: .55rem; border-radius: 50%; background: var(--cb-accent); }
  .cbook[dir="rtl"] .cb-points li { padding: .5rem 1.6rem .5rem 0; } .cbook[dir="rtl"] .cb-points li::before { left: auto; right: .2rem; }
  .cb-tags { list-style: none; display: flex; flex-wrap: wrap; justify-content: center; gap: .45rem; margin: 0; padding: 0; max-width: 60ch; }
  .cb-tags li { font: 13px/1.2 system-ui, sans-serif; padding: .35rem .75rem; border-radius: 999px; border: 1px solid var(--cb-rule); background: var(--cb-chip); color: var(--cb-ink); }
  .cb-end-buttons { margin: 1.2rem 0 0; }
  .cb-footer { border-top: 1px solid var(--cb-rule); padding: 1.1rem max(6vw, 84px) 76px; font: 13px/1.5 system-ui, sans-serif; color: var(--cb-muted); }
  .cb-footer a { color: var(--cb-accent); }
  .cb-footer p { margin: .2rem 0; }
  .cb-end button { border: 1px solid var(--cb-rule); background: var(--cb-chip); color: var(--cb-ink); border-radius: 999px; padding: 8px 18px; font: 14px/1.2 system-ui, sans-serif; cursor: pointer; margin: 0 .3rem; }
  /* full-screen picture */
  .cb-zoom { position: absolute; inset: 0; z-index: 9; background: rgba(15,12,8,.94); display: none; align-items: center; justify-content: center; padding: 16px; cursor: zoom-out; }
  .cb-zoom.on { display: flex; } .cb-zoom img { max-width: 100%; max-height: 100%; object-fit: contain; }
  /* phones: a single column, no side arrows, no column choice */
  @media (max-width: 700px) {
    .cb-leaf-in { padding: 56px 16px 76px; gap: 16px; } .cb-leaf .cb-frame { width: 100%; padding: 5px; }
    .cbook .cb-copy, .cbook .cb-body, .cbook .cb-c1 { columns: 1 !important; column-rule: none !important; max-width: none !important; }   /* .cb-body too: the column choice sits on it (until 2026-12-05-J phones still got 2 or 3 columns there) */
    .cb-arrow, .cb-cols { display: none !important; }
    .cbook table { display: block; overflow-x: auto; -webkit-overflow-scrolling: touch; font-size: .8em; }   /* a wide table scrolls inside its own box */
    .cbook th, .cbook td { padding: .3rem .4rem; }
    .cb-top { gap: 6px; padding: 8px 10px; } .cb-lang select { max-width: 6.5rem; }
    .cb-pager { gap: 7px; padding: 5px 6px; } .cb-pager .cb-p, .cb-pager .cb-n { width: 30px; height: 30px; } .cb-dots { gap: 6px; }
  }
  @media (prefers-reduced-motion: reduce) { .cb-view { scroll-behavior: auto; } }
  @media print { .cbook { display: none !important; } html.cbook-open, html.cbook-open body { overflow: visible; } }
  /* the web page's floating "Book view" button: always in view in web-page mode */
  .cb-fab { position: fixed; right: max(16px, env(safe-area-inset-right)); bottom: max(16px, env(safe-area-inset-bottom)); z-index: 1500;
    padding: .7rem 1.1rem; border-radius: 999px; border: 0; background: var(--accent, #0f4a44); color: #fff; font: 600 .95rem/1.2 system-ui, sans-serif;
    box-shadow: 0 8px 24px rgba(0,0,0,.28); cursor: pointer; }
  .cb-fab:hover { filter: brightness(1.1); } .cb-fab[hidden], .cb-head[hidden] { display: none; }
  .cb-head { margin-left: .5rem; padding: .3rem .8rem; border-radius: 999px; border: 1px solid var(--accent, #0f4a44); background: transparent; color: var(--accent, #0f4a44);
    font: 600 .82rem/1.2 system-ui, sans-serif; cursor: pointer; vertical-align: middle; }
  @media print { .cb-fab { display: none !important; } }
  /* the web page's "Read as a book" button */
  .cb-open { display: inline-flex; align-items: center; gap: .4rem; margin: .6rem 0 0; padding: .4rem .9rem; border-radius: 999px; border: 1px solid var(--accent, #0f4a44);
    background: transparent; color: var(--accent, #0f4a44); font: 600 .85rem/1.2 system-ui, sans-serif; cursor: pointer; }
  .article-tags { margin-top: 2.2rem; padding-top: .7rem; border-top: 1px solid var(--border, rgba(127, 127, 127, .25)); }
  .article-keywords {
    color: var(--text-muted);
    font-size: .72rem;
    line-height: 1.45;
    letter-spacing: .01em;
    margin: 0;
  }
  .article-tags-label { font-weight: 600; }

  .article-hero {
    margin: 1.25rem auto;
    max-width: 700px;
    border-radius: 10px;
    overflow: hidden;
  }
  .article-hero img {
    width: 100%;
    display: block;
  }
  .article-video-label {
    text-align: center;
    font-size: .85rem;
    font-weight: 600;
    color: var(--accent-strong);
    margin: 1.25rem 0 .5rem;
  }
  .article-hero.has-video {
    max-width: 420px; /* smaller -- reads as a video thumbnail, not a full hero banner */
    margin-top: 0;
  }
  .article-hero.has-video a {
    position: relative;
    display: block;
  }
  .article-hero-play {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 56px;
    height: 56px;
    border-radius: 50%;
    background: rgba(0, 0, 0, .55);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.3rem;
    padding-left: 4px; /* optical centering for the triangle glyph */
  }

  .article-body { font-size: 1.05rem; }
  .article-body h2 {
    font-family: var(--font-display);
    font-size: 1.4rem;
    margin-top: 2rem;
  }
  .article-body p { margin: 0 0 1.1rem; }
  /* a single line break between two full paragraphs: a gap, so they do not read as one crowded block */
  .p-gap { display: block; height: .85rem; }
  /* ---------- Tables in the text ---------- */
  .article-body table, .cbook table {
    width: 100%; border-collapse: collapse; margin: 1.4rem 0 1.6rem; font-size: .95em; line-height: 1.4;
    font-variant-numeric: tabular-nums;
  }
  .article-body caption, .cbook caption { caption-side: top; text-align: left; font-weight: 600; padding: 0 0 .5rem; }
  .article-body th, .article-body td, .cbook th, .cbook td { padding: .5rem .75rem; text-align: left; vertical-align: top; border-bottom: 1px solid var(--border); }
  .article-body th, .cbook th { font-weight: 600; }
  .article-body thead th, .article-body tr:first-child > th, .cbook thead th, .cbook tr:first-child > th { border-bottom: 2px solid var(--text-muted); vertical-align: bottom; }
  .article-body tr > :first-child, .cbook tr > :first-child { padding-left: .25rem; }
  .article-body tbody tr:hover > * { background: var(--accent-soft); }
  /* the table's note ("Sources: ..."), straight under it: small, close to the table, clear of the text that follows */
  .article-body table + .has-table-note, .cbook table + .has-table-note { margin-top: -1rem; }
  .table-tail { margin: 0 0 1.1rem; }
  .table-note { display: block; font-size: .85em; line-height: 1.45; color: var(--text-muted); margin-bottom: .9rem; }
  .para-with-image-text > table:first-child { margin-top: 0; }
  .para-with-image-text > * + p, .para-with-image-text > p + table { margin-top: 1.1rem; }
  @media (max-width: 700px) {                 /* a wide table scrolls sideways inside its own box; the page does not */
    .article-body table { display: block; overflow-x: auto; -webkit-overflow-scrolling: touch; font-size: .88em; }
    .article-body th, .article-body td { padding: .45rem .55rem; }
  }
  .cbook table { break-inside: avoid; font-size: .82em; margin: .8rem 0 1rem; }
  /* a page with a table: one column whatever the reader chose (a table cut across columns loses its top and its sides),
     and the page never slides sideways */
  .cbook .cb-hastable .cb-body, .cbook .cb-hastable .cb-c1 { columns: 1 !important; column-rule: none !important; }
  .cbook .cb-hastable.cb-textonly .cb-copy { max-width: 60rem; }
  .cb-leaf-in { overflow-x: hidden; }
  .cbook th, .cbook td { padding: .3rem .5rem; }

  /* ---------- Mobile-collapsible sections ---------- */
  /* Uses CSS Grid's 0fr/1fr trick to animate to/from "auto" height
     without JS measuring anything -- native <details>/<summary> can't
     be smoothly transitioned (the browser's open/close is an instant
     snap), which is why this isn't built on <details> like the sidebar
     is. Defaults to fully expanded (no .is-collapsed class) so a
     no-JS visitor, or a desktop visitor where the toggle is hidden
     entirely, always sees the complete article. */
  .mobile-section-toggle {
    display: flex;
    align-items: center;
    gap: .4rem;
    width: 100%;
    margin: 1.25rem 0 .5rem;
    padding: .6rem .9rem;
    border: 1px solid var(--border);
    border-radius: 8px;
    background: var(--bg-raised);
    color: var(--accent-strong);
    font: inherit;
    font-weight: 600;
    font-size: .9rem;
    cursor: pointer;
  }
  /* Hidden by default (fully-expanded safe fallback) -- shown only
     when JS adds .is-collapsed, as a faded taste of what's hidden so
     the reader knows there's more rather than the section just
     vanishing behind an unlabeled button. */
  .mobile-section-preview {
    display: none;
    position: relative;
    max-height: 2.8em;
    overflow: hidden;
    margin: 1.25rem 0 0;
    color: var(--text-muted);
    font-size: .95rem;
    line-height: 1.4;
  }
  .mobile-section-preview::after {
    content: "";
    position: absolute;
    left: 0; right: 0; bottom: 0;
    height: 1.4em;
    background: linear-gradient(to bottom, transparent, var(--bg));
  }
  .mobile-section.is-collapsed .mobile-section-preview { display: block; }
  .mobile-section.is-collapsed .mobile-section-toggle { margin-top: .25rem; }
  .mobile-section-chevron {
    margin-left: auto;
    transition: transform .2s ease;
  }
  .mobile-section.is-collapsed .mobile-section-chevron { transform: rotate(-90deg); }

  .mobile-section-panel {
    display: grid;
    grid-template-rows: 1fr;
    transition: grid-template-rows .3s ease;
  }
  .mobile-section-panel-inner { overflow: hidden; min-height: 0; }
  .mobile-section.is-collapsed .mobile-section-panel { grid-template-rows: 0fr; }

  @media (min-width: 700px) {
    /* Desktop never collapses -- hide the toggle and force expanded
       regardless of any .is-collapsed class a narrower viewport left set. */
    .mobile-section-toggle { display: none; }
    .mobile-section-panel { grid-template-rows: 1fr !important; }
  }


  /* ---------- Sidebar: tabs (desktop) + accordion (mobile) ---------- */
  aside.sidebar-column {
    display: flex;
    flex-direction: column;
    gap: 1rem;
  }

  .sidebar-tabs {
    grid-area: tabs;
    display: flex;
    flex-wrap: wrap;
    gap: .4rem;
    margin-bottom: .25rem;
  }
  .tab-btn {
    flex: 1 1 auto;
    border: 1px solid var(--border);
    background: var(--bg-raised);
    color: var(--text-muted);
    border-radius: 8px;
    padding: .5rem .6rem;
    font-size: .75rem;
    font-weight: 600;
    line-height: 1.2;
    cursor: pointer;
    text-align: center;
    font-family: var(--font-body);
  }
  .tab-btn[aria-selected="true"] {
    background: var(--accent-soft);
    color: var(--accent-strong);
    border-color: var(--accent-soft);
  }

  .sidebar-group {
    background: var(--bg-raised);
    border: 1px solid var(--border);
    border-radius: 10px;
    padding: 1rem;
  }

  /* A <button>, not <details>/<summary> -- native details can't be
     smoothly animated (the browser's open/close is an instant snap),
     so this is JS-driven with a CSS Grid 0fr/1fr transition instead.
     Defaults to fully expanded (no .is-collapsed anywhere) so a no-JS
     visitor sees everything rather than losing access to groups
     they'd have no way to open. */
  .sidebar-heading {
    display: flex;
    align-items: center;
    width: 100%;
    font-family: var(--font-display);
    font-size: 1.05rem;
    cursor: pointer;
    border: none;
    background: none;
    color: var(--text);
    text-align: left;
    padding: 0 0 .5rem;
    border-bottom: 2px solid var(--accent-soft);
    margin-bottom: .75rem;
  }
  .sidebar-heading::before {
    content: "\25B8";
    display: inline-block;
    width: 1em;
    margin-right: .3rem;
    color: var(--accent);
    transition: transform .15s ease;
    transform: rotate(90deg); /* default expanded state points down */
  }
  .sidebar-group.is-collapsed > .sidebar-heading::before { transform: none; }

  @media (min-width: 900px) {
    .sidebar-heading::before { display: none; }
  }

  .sidebar-panel {
    display: grid;
    grid-template-rows: 1fr;
    transition: grid-template-rows .25s ease;
  }
  .sidebar-panel-inner { overflow: hidden; min-height: 0; }
  .sidebar-group.is-collapsed .sidebar-panel { grid-template-rows: 0fr; }

  ul.item-list {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: .9rem;
  }

  .item-title {
    font-weight: 600;
    text-decoration: none;
    display: block;
    margin-bottom: .2rem;
  }
  .item-title:hover { text-decoration: underline; }
  .item-meta { font-size: .78rem; color: var(--text-muted); margin: 0 0 .2rem; }

  .item-summary {
    font-size: .88rem;
    color: var(--text-muted);
    margin: 0;
    position: relative;
  }
  .item-summary.is-truncated {
    cursor: pointer;
    padding-right: .5rem;
  }
  .item-summary.is-truncated::after {
    content: "";
    position: absolute;
    right: 0;
    bottom: 0;
    width: 2.5rem;
    height: 1.3em;
    background: linear-gradient(to right, transparent, var(--bg-raised));
    pointer-events: none;
  }

  /* ---------- Footer ---------- */
  footer.site-footer {
    border-top: 1px solid var(--border);
    background: var(--bg-raised);
    padding: 1.75rem 1rem;
  }

  .footer-grid {
    max-width: var(--page-max-width);
    margin: 0 auto;
    display: flex;
    flex-direction: column;
    gap: .9rem;
  }

  @media (min-width: 700px) {
    .footer-grid {
      flex-direction: row;
      align-items: center;
      justify-content: space-between;
    }
  }

  .footer-logo { font-family: var(--font-display); font-weight: 700; margin: 0; }
  .footer-tagline { margin: .1rem 0 0; color: var(--text-muted); font-size: .85rem; }
  .footer-links { display: flex; flex-wrap: wrap; gap: .9rem; font-size: .85rem; }
  .footer-links a { text-decoration: none; }
  .footer-links a:hover { text-decoration: underline; }
  .footer-copy { font-size: .8rem; color: var(--text-muted); margin: 0; }

  @media (prefers-reduced-motion: reduce) {
    .carousel-track { transition: none; }
  }
/* ---------- ads always stay inside their frame ----------
   Each carousel is pinned to its frame, and each ad image to its slide, instead of being sized with
   "height: 100%". Inside a flexible box, Safari can treat that percentage as unknown, and an image
   then took its OWN size (large banners) and spilled out. Pinned, every size comes from the frame
   (which has its own shape, via aspect-ratio), and object-fit: contain fits the whole ad inside. */
.carousel .carousel-slide img {      /* specific enough to win over picture rules around it, e.g. .para-with-image-figure img */
  position: absolute; inset: 0; width: 100%; height: 100%; max-width: none;
  object-fit: contain; border-radius: 0; margin: 0;
}
.masthead-carousel, .inline-carousel { position: relative; }
.masthead-carousel > .carousel, .inline-carousel > .carousel { position: absolute; inset: 0; height: auto; }

/* ---------- the same, written for every Safari ----------
   Long-hand top/right/bottom/left (Safari before 14.1 ignores the "inset" shorthand, and then an
   ad showed at its own size); Safari is made to clip the sliding strip inside rounded frames; and
   where "aspect-ratio" isn't known (Safari before 15) the frames get their shape from padding. */
.carousel .carousel-slide img { top: 0; right: 0; bottom: 0; left: 0; }
.carousel-slide a.carousel-link { top: 0; right: 0; bottom: 0; left: 0; }
.carousel { -webkit-transform: translateZ(0); transform: translateZ(0); }
.masthead-carousel > .carousel, .inline-carousel > .carousel { top: 0; right: 0; bottom: 0; left: 0; }
.inline-carousel { -webkit-mask-image: -webkit-radial-gradient(white, black); }
@supports not (aspect-ratio: 1 / 1) {
  .masthead-carousel { height: 0; padding-top: 43.75%; }                 /* 16:7 */
  @media (max-width: 599px) { .masthead-carousel { padding-top: 75%; } }   /* 4:3 on phones */
  .inline-carousel { height: 0; padding-top: 75%; }                       /* 4:3, from the box's width */
}
  /* ---------- Language button: below the menu bar, at the end of the line ---------- */
  .lang-bar { display: flex; justify-content: flex-end; padding: .5rem 1rem 0; max-width: 1200px; margin: 0 auto; }
  .lang-switch { position: relative; }
  .lang-button { display: inline-flex; align-items: center; gap: .45rem; min-height: 40px; padding: 0 .9rem; border: 1px solid var(--border);
    border-radius: 999px; background: var(--bg-raised); color: inherit; font: inherit; font-size: .95rem; font-weight: 600; cursor: pointer; }
  /* a link to one of this site's pages that is not in this page's language yet (siteLocalizeLinks) */
  a[data-en-link]::after { content: "EN"; display: inline-block; margin-left: .25em; padding: 0 .28em; font: 600 .6em/1.5 system-ui, sans-serif; letter-spacing: .04em; border: 1px solid currentColor; border-radius: 3px; vertical-align: .2em; opacity: .65; }
  .lang-button:focus-visible, .lang-menu a:focus-visible { outline: 2px solid currentColor; outline-offset: 2px; }
  .lang-menu { position: absolute; inset-inline-end: 0; top: calc(100% + 6px); z-index: 60; min-width: 250px; max-height: 70vh; overflow: auto;
    margin: 0; padding: .35rem; list-style: none; background: var(--bg-raised); border: 1px solid var(--border); border-radius: 12px;
    box-shadow: 0 12px 32px rgba(0,0,0,.18); }
  .lang-menu[hidden] { display: none; }
  .lang-menu a { display: flex; align-items: baseline; justify-content: space-between; gap: 1rem; padding: .55rem .75rem; border-radius: 8px;
    color: inherit; text-decoration: none; }
  .lang-menu a:hover, .lang-menu a:focus { background: var(--border); }
  .lang-menu a[aria-current="page"] { font-weight: 700; }
  .lang-menu .lang-english { color: var(--text-muted); font-size: .82rem; font-weight: 400; white-space: nowrap; }
  .lang-menu .lang-tick { margin-inline-start: .35rem; }