/* Bahethat redesign, model A v2: "The Imprint Series" (السلسلة) in the new Bahethat identity.
   WordPress port (theme bahethat-2026): prototype-only rules removed, rgba literals of identity colours
   rewritten as color-mix() on the tokens so the Customizer colours reach them, asset paths made theme-relative.
   Font: only "Neo Sans Arabic" (300/400/500/700), loaded by fonts.css (self-hosted woff2).
   Colours: the identity guide's wine, gold, beige, grey and green, with tints/shades along their scales.

   SHARED COMPONENTS (later pages reuse this file read-only; each page sets <body class="page-NAME">):
   - Layout:      .wrap, .section, .section.tight, .band-wine, .band-deep, .band-panel, .kufic-rule (pattern divider)
   - Type:        .st / .st-title / .st-sub (section title with the brand mark), .page-title, .lede, .mark
   - Meta:        .label, .meta, .tags / .tag / .badge-new, .illus (illustrative label), .link-more
   - Controls:    .btn (.ghost, .gold, .on-wine), .icon-btn, .chip, .field (text inputs), .acc (details accordion)
   - Header:      .util, .masthead, .brand, .mainnav, .mega, .nav-soon, .searchbar, .drawer
   - Footer:      .nl-band / .newsletter / .nl-form, .footer, .social.circles, .wordmark
   - Cards:       .vc (volume cover) inside .vol on a .shelf-row, .thumb, .rel-card, .rv-item, .pn-card
   - Page parts:  .crumbs, .pagehead, .tabs, .page-hero (single-page hero) + .author-box, .reader, .prose,
                  .related, .prev-next, .series-box, .toast
*/

:root {
  /* Identity colours (guide p.7) */
  --wine: #51162b;
  --wine-700: #411222;
  --wine-800: #310d1a;
  --wine-900: #200911;
  --wine-300: #977380;      /* ornament only */
  --wine-100: #dcd0d5;
  --wine-50: #eee8ea;
  --gold: #c8b06e;          /* ornament/rules on light grounds; text only on wine */
  --gold-300: #d3c08b;
  --gold-100: #f4efe2;
  --gold-ink: #786a42;      /* gold text on light grounds (4.8:1 on the ground) */
  --gold-ink-2: #50462c;
  --beige: #d4cdba;         /* text on wine 8.8:1 */
  --beige-100: #eeebe3;
  --beige-50: #f6f5f1;
  --grey: #807d7b;          /* large text / decoration only */
  --grey-ink: #5a5856;      /* small grey text 6.4:1 */
  --ink: #2e2a28;           /* reading text 12.8:1 */
  --green: #899778;         /* ornament only */
  --green-ink: #606a54;     /* green text 5.1:1; white on it 5.7:1 */

  --ground: #f7f3ea;
  --panel: #ffffff;
  --rule: #e4ddcc;
  --rule-2: #d4cdba;
  --on-wine: #f7f3ea;
  --on-wine-2: #d4cdba;
  --on-wine-rule: color-mix(in srgb, var(--beige) 28%, transparent);

  --font: "Neo Sans Arabic", sans-serif;
  --fs-display: clamp(1.9rem, 1.45rem + 1.4vw, 2.7rem);
  --fs-h1: clamp(1.9rem, 1.35rem + 1.7vw, 2.9rem);
  --fs-h2: clamp(1.3rem, 1.15rem + .5vw, 1.6rem);
  --fs-small: .875rem;
  --fs-read: clamp(1.0625rem, 1.03rem + .15vw, 1.125rem);

  --gutter: clamp(16px, 3vw, 40px);
  --maxw: 1320px;
  --section: clamp(48px, 2.6rem + 3vw, 96px);
  --radius: 2px;
  --shadow-1: 0 1px 2px color-mix(in srgb, var(--wine-900) 6%, transparent), 0 2px 8px color-mix(in srgb, var(--wine-900) 6%, transparent);
  --shadow-2: 0 2px 4px color-mix(in srgb, var(--wine-900) 8%, transparent), 0 12px 28px color-mix(in srgb, var(--wine-900) 14%, transparent);
  --shadow-book: -1px 0 0 rgba(0, 0, 0, .06), 0 2px 3px color-mix(in srgb, var(--wine-900) 16%, transparent), 0 14px 26px -8px color-mix(in srgb, var(--wine-900) 34%, transparent);
  --ease: cubic-bezier(0.16, 1, 0.3, 1);
  /* Official brand-guide patterns (assets/brand/patterns, extracted from the identity guide, guide pages 11-13).
     They are used as CSS masks painted with --ornament, so the colour can change in one place. */
  --ornament: var(--gold);
  --pat-meander: url("../patterns/meander.svg");          /* kufic meander strip (guide p.13): dividers and edges */
  --pat-dots: url("../patterns/dots.svg");                /* dot grid (guide p.11): empty states */
  --pat-lattice: url("../patterns/lattice-kufic.svg");    /* interlaced kufic lattice (guide p.11): quiet bands */
  --pat-knotwings: url("../patterns/knot-wings.svg");     /* knot with logo wings (guide p.11): grounds on wine */
  --pat-knot: url("../patterns/motif-knot.svg");          /* eight-point knot (guide p.12): corner motif */
}

*, *::before, *::after { box-sizing: border-box; }
html { font-family: "Neo Sans Arabic", sans-serif; -webkit-text-size-adjust: 100%; scroll-behavior: smooth; scroll-padding-top: 110px; }
body {
  margin: 0; background: var(--ground); color: var(--ink);
  font-family: "Neo Sans Arabic", sans-serif; font-weight: 400; font-size: 1rem; line-height: 1.8;
  -webkit-font-smoothing: antialiased; overflow-x: clip;
}
img { display: block; max-width: 100%; height: auto; }
a { color: inherit; text-decoration: none; }
button, input, select, textarea { font: inherit; color: inherit; }
button { background: none; border: 0; padding: 0; cursor: pointer; }
h1, h2, h3, h4 { margin: 0; font-weight: 500; line-height: 1.5; text-wrap: balance; }
p { margin: 0; text-wrap: pretty; }
ul, ol { margin: 0; padding: 0; list-style: none; }
dl, dd, figure { margin: 0; }
::selection { background: var(--wine); color: var(--on-wine); }
:focus-visible { outline: 2px solid var(--wine); outline-offset: 3px; }
.band-wine :focus-visible, .band-deep :focus-visible, .page-hero :focus-visible, .nl-band :focus-visible, .banner :focus-visible { outline-color: var(--gold); }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
.skip { position: absolute; inset-inline-start: 16px; top: -80px; z-index: 100; background: var(--wine); color: var(--on-wine); padding: 12px 18px; }
.skip:focus { top: 12px; }
.wrap { width: 100%; max-width: var(--maxw); margin-inline: auto; padding-inline: var(--gutter); }
.icon { width: 20px; height: 20px; flex: none; stroke: currentColor; fill: none; stroke-width: 1.5; stroke-linecap: round; stroke-linejoin: round; }
.mark { width: .62em; height: .68em; flex: none; color: var(--gold); }

/* ---------- Section titles (guide: mark, light wine title, gold subtitle) ---------- */
.st { display: grid; gap: 4px; }
.st-title { display: flex; align-items: center; gap: .45em; font-weight: 300; font-size: var(--fs-display); line-height: 1.3; color: var(--wine); }
.st-title .mark { color: var(--wine); width: .5em; height: .55em; }
.st-sub { color: var(--gold-ink); font-size: 1.0625rem; max-width: 62ch; }
.st.on-wine .st-title { color: var(--on-wine); }
.st.on-wine .st-title .mark { color: var(--gold); }
.st.on-wine .st-sub { color: var(--gold); }
.page-title { display: flex; align-items: center; gap: .4em; font-weight: 300; font-size: clamp(2.4rem, 1.6rem + 2.6vw, 4rem); color: var(--wine); line-height: 1.2; }
.page-title .mark { color: var(--wine); width: .42em; height: .46em; }
.lede { font-size: 1.1875rem; color: var(--ink); line-height: 1.9; }

/* ---------- Labels, meta, tags ---------- */
.label { display: inline-flex; align-items: center; gap: 8px; font-weight: 500; font-size: .875rem; line-height: 1.4; color: var(--gold-ink); }
.label::before { content: ""; width: 7px; height: 7px; background: var(--gold); transform: rotate(45deg); flex: none; }
/* Meta row: separators are small drawn diamonds, never typed dots next to digits */
.meta { display: flex; flex-wrap: wrap; align-items: center; gap: 2px 0; font-size: var(--fs-small); color: var(--grey-ink); }
.meta > * + *::before { content: ""; display: inline-block; width: 4px; height: 4px; background: var(--gold); transform: rotate(45deg); margin-inline: 9px; vertical-align: middle; position: relative; top: -2px; }
.band-wine .meta, .band-deep .meta { color: var(--on-wine-2); }
.tags { display: inline-flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.tag { display: inline-flex; align-items: center; min-height: 24px; padding: 0 10px; background: var(--gold-100); color: var(--gold-ink); font-size: .8125rem; font-weight: 500; line-height: 1.5; border-radius: var(--radius); }
.badge-new { display: inline-flex; align-items: center; gap: 6px; font-size: .8125rem; font-weight: 500; color: var(--wine); }
.badge-new::before { content: ""; width: 6px; height: 6px; background: var(--wine); transform: rotate(45deg); }
.illus { display: inline-flex; align-items: center; min-height: 26px; font-size: .8125rem; color: var(--grey-ink); border: 1px dashed var(--grey); padding: 1px 12px; border-radius: 999px; align-self: flex-start; font-weight: 400; white-space: nowrap; }
.band-wine .illus, .band-deep .illus, .page-hero .illus { color: var(--on-wine-2); border-color: color-mix(in srgb, var(--beige) 50%, transparent); }

.link-more {
  display: inline-flex; align-items: center; gap: 8px; min-height: 44px; flex: none;
  font-weight: 500; color: var(--wine); font-size: .975rem;
  text-decoration: underline; text-decoration-color: transparent; text-underline-offset: 6px;
  transition: text-decoration-color .2s, gap .3s var(--ease);
}
.link-more:hover { text-decoration-color: currentColor; gap: 12px; }
.link-more .icon { width: 18px; height: 18px; }
.band-wine .link-more, .band-deep .link-more { color: var(--gold); }

/* ---------- Buttons, chips, fields, accordion ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 10px;
  min-height: 48px; padding: 0 22px; border-radius: var(--radius);
  font-weight: 500; font-size: 1rem; line-height: 1.2; text-align: center;
  background: var(--wine); color: var(--on-wine); border: 1px solid var(--wine);
  transition: background .2s, color .2s, border-color .2s, transform .2s var(--ease);
}
.btn:hover { background: var(--wine-700); border-color: var(--wine-700); }
.btn:active { transform: translateY(1px); }
.btn.ghost { background: transparent; color: var(--wine); border-color: var(--rule-2); }
.btn.ghost:hover { border-color: var(--wine); background: var(--panel); }
.btn.gold { background: var(--gold); border-color: var(--gold); color: var(--wine-900); }
.btn.gold:hover { background: var(--gold-300); border-color: var(--gold-300); }
.btn.on-wine { background: transparent; color: var(--on-wine); border-color: color-mix(in srgb, var(--beige) 50%, transparent); }
.btn.on-wine:hover { border-color: var(--on-wine); }
.btn .icon { width: 18px; height: 18px; }
.chip { display: inline-flex; align-items: center; min-height: 44px; padding: 0 16px; border: 1px solid var(--rule-2); background: var(--panel); border-radius: 999px; font-size: .9375rem; color: var(--ink); transition: border-color .2s, color .2s; }
.chip:hover { border-color: var(--wine); color: var(--wine); }
.field { flex: 1; min-width: 0; min-height: 52px; border: 1px solid var(--grey); /* 4.1:1 on white: meets the 3:1 control-boundary rule */ background: var(--panel); padding: 0 18px; font-size: 1rem; border-radius: var(--radius); color: var(--ink); }
.field::placeholder { color: var(--grey-ink); opacity: 1; }
.field:focus { outline: 2px solid var(--wine); outline-offset: 0; border-color: transparent; }
.field.on-wine { background: color-mix(in srgb, var(--on-wine) 8%, transparent); border-color: color-mix(in srgb, var(--beige) 55%, transparent); color: var(--on-wine); }
.field.on-wine::placeholder { color: var(--on-wine-2); }
.field.on-wine:focus { outline-color: var(--gold); }
.acc > summary { list-style: none; cursor: pointer; }
.acc > summary::-webkit-details-marker { display: none; }
.acc > summary .icon { transition: transform .25s; }
.acc[open] > summary .icon { transform: rotate(180deg); }

/* ---------- Header ---------- */
/* Running label with a thin wine hairline under it, as at the top of the guide's pages */
.util { background: var(--ground); color: var(--grey-ink); font-size: .8125rem; }
.util .wrap { display: flex; align-items: center; justify-content: space-between; gap: 16px; border-bottom: 1px solid var(--wine); }
.util-label { color: var(--wine); }
.util nav { display: flex; gap: 4px; }
.util a { display: inline-flex; align-items: center; justify-content: center; min-height: 44px; min-width: 44px; padding-inline: 8px; transition: color .2s; }
.util a:hover { color: var(--wine); text-decoration: underline; text-underline-offset: 5px; }
.util a[aria-current="page"] { color: var(--wine); font-weight: 500; text-decoration: underline; text-decoration-color: var(--gold); text-underline-offset: 5px; }

.masthead { position: sticky; top: 0; z-index: 40; background: color-mix(in srgb, var(--ground) 96%, transparent); backdrop-filter: saturate(1.3) blur(10px); -webkit-backdrop-filter: saturate(1.3) blur(10px); border-bottom: 1px solid var(--rule); transition: box-shadow .3s; }
.masthead.scrolled { box-shadow: 0 6px 24px -12px color-mix(in srgb, var(--wine-900) 22%, transparent); }
.masthead .wrap { display: flex; align-items: center; gap: 12px; min-height: 80px; transition: min-height .3s var(--ease); }
.masthead.scrolled .wrap { min-height: 66px; }
/* Logo safe area (guide p.3): at least a quarter of the logo height clear on every side */
.brand { display: flex; align-items: center; flex: none; padding: 13px; margin-inline-start: -13px; }
.brand img { height: 52px; width: auto; transition: height .3s var(--ease); }
.masthead.scrolled .brand { padding-block: 10px; }
.masthead.scrolled .brand img { height: 42px; }
.mainnav { display: flex; align-items: stretch; gap: 0; }
.mainnav > li { position: relative; display: flex; }
.mainnav > li > a, .mainnav > li > button, .mainnav .nav-soon { display: inline-flex; align-items: center; gap: 6px; padding: 0 12px; min-height: 48px; font-size: 1rem; color: var(--ink); position: relative; transition: color .2s; }
.mainnav > li > a::after, .mainnav > li > button::after { content: ""; position: absolute; inset-inline: 12px; bottom: 6px; height: 2px; background: var(--gold); transform: scaleX(0); transform-origin: right; transition: transform .35s var(--ease); }
.mainnav > li > a:hover::after, .mainnav > li > button:hover::after, .mainnav > li > [aria-current="page"]::after { transform: scaleX(1); }
.mainnav > li > [aria-current="page"] { color: var(--wine); font-weight: 500; }
.mainnav .icon { width: 14px; height: 14px; transition: transform .25s; }
.mainnav li.open > button .icon { transform: rotate(180deg); }
/* Store slot: shown for later, not a link, not focusable */
.nav-soon { color: var(--grey-ink) !important; cursor: default; }
.nav-soon small { font-size: .6875rem; line-height: 1; padding: 3px 6px; border: 1px solid var(--rule-2); border-radius: 999px; color: var(--gold-ink); }
.mega { position: absolute; top: calc(100% + 16px); inset-inline-start: -12px; width: 560px; z-index: 50; background: var(--panel); box-shadow: inset 0 2px 0 var(--wine), var(--shadow-2); padding: 20px; display: grid; grid-template-columns: 1fr 1fr; gap: 4px 20px; opacity: 0; visibility: hidden; transform: translateY(6px); transition: opacity .2s, transform .3s var(--ease), visibility .2s; }
.mainnav li.open .mega { opacity: 1; visibility: visible; transform: none; }
.mega a { display: flex; flex-direction: column; padding: 10px 12px; transition: background .2s; }
.mega a:hover { background: var(--ground); }
.mega strong { font-weight: 500; color: var(--wine); }
.mega span { font-size: .875rem; color: var(--grey-ink); line-height: 1.5; }
.mega .mega-foot { grid-column: 1 / -1; border-top: 1px solid var(--rule); margin-top: 8px; padding-top: 8px; }
.mega .mega-foot a { flex-direction: row; padding: 0 12px; }
.mast-actions { margin-inline-start: auto; display: flex; align-items: center; gap: 8px; }
.icon-btn { width: 44px; height: 44px; display: inline-grid; place-items: center; border-radius: var(--radius); color: var(--ink); transition: background .2s, color .2s, opacity .2s; }
.icon-btn:hover { background: var(--beige-100); color: var(--wine); }
.icon-btn:disabled { opacity: .35; cursor: default; background: none; }
.menu-btn { display: none; }
.nl-top { min-height: 44px; padding: 0 16px; }

.searchbar { border-bottom: 1px solid var(--rule); background: var(--beige-50); display: none; }
.searchbar.open { display: block; }
.searchbar form { display: flex; gap: 12px; align-items: center; padding-block: 14px; }
.searchbar .hint { font-size: var(--fs-small); color: var(--grey-ink); padding-bottom: 12px; display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }

/* Mobile drawer */
.drawer { position: fixed; inset: 0; z-index: 80; display: none; }
.drawer.open { display: block; }
.drawer .scrim { position: absolute; inset: 0; background: color-mix(in srgb, var(--wine-900) 50%, transparent); animation: fade .25s ease-out; }
.drawer .panel { position: absolute; inset-block: 0; inset-inline-start: 0; width: min(86vw, 380px); background: var(--ground); display: flex; flex-direction: column; animation: slide-in .35s var(--ease); overflow-y: auto; }
.drawer .panel-head { display: flex; align-items: center; justify-content: space-between; padding: 6px 6px 6px 16px; border-bottom: 1px solid var(--wine); }
.drawer .panel-head img { height: 40px; width: auto; margin: 10px; }
.drawer nav { padding: 8px 16px 24px; display: grid; }
.drawer details { border-bottom: 1px solid var(--rule); }
.drawer summary, .drawer .drawer-link { display: flex; align-items: center; justify-content: space-between; min-height: 56px; font-weight: 500; font-size: 1.05rem; border-bottom: 1px solid var(--rule); }
.drawer summary { border-bottom: 0; }
.drawer .nav-soon { justify-content: flex-start; gap: 10px; }
.drawer details ul { padding-bottom: 12px; }
.drawer details li a { display: flex; align-items: center; min-height: 44px; padding-inline-start: 16px; color: var(--ink); gap: 10px; }
.drawer details li a::before { content: ""; width: 6px; height: 6px; background: var(--gold); transform: rotate(45deg); }
.drawer .drawer-nl { margin-top: 20px; }
.drawer .panel-foot { margin-top: auto; padding: 16px; background: var(--beige-100); font-size: var(--fs-small); color: var(--grey-ink); }
@keyframes fade { from { opacity: 0; } }
@keyframes slide-in { from { transform: translateX(100%); } }

/* ---------- Program banner: compact strip, two slides, fixed art column ---------- */
.programs { padding-top: 16px; }
.banner { position: relative; display: grid; background: var(--wine-800); color: var(--on-wine); overflow: hidden; }
.slide { grid-area: 1 / 1; display: grid; grid-template-columns: 248px minmax(0, 1fr); align-items: stretch; opacity: 0; visibility: hidden; transition: opacity .7s ease, visibility .7s; }
.slide.is-active { opacity: 1; visibility: visible; }
/* Fixed art column: the slide text never jumps between slides */
.slide .art { display: block; width: 248px; height: 140px; background: var(--wine-900); overflow: hidden; }
.slide .art img { width: 100%; height: 100%; object-fit: contain; }
.slide .copy { padding: 12px 28px 12px 200px; display: flex; flex-direction: column; justify-content: center; gap: 2px; border-inline-start: 1px solid color-mix(in srgb, var(--gold) 35%, transparent); }
.slide h2 { font-weight: 400; font-size: 1.3rem; line-height: 1.5; }
.slide p { color: var(--on-wine-2); font-size: .975rem; line-height: 1.7; max-width: 60ch; }
.slide .slide-cta { display: inline-flex; align-items: center; gap: 8px; font-weight: 500; color: var(--gold); min-height: 44px; align-self: flex-start; }
.slide .slide-cta:hover { text-decoration: underline; text-underline-offset: 6px; }
.slide .slide-cta .icon { width: 16px; height: 16px; }
.banner-ctrl { position: absolute; inset-inline-end: 16px; top: 50%; transform: translateY(-50%); display: flex; align-items: center; z-index: 2; background: var(--wine-900); border-radius: 999px; padding: 2px; }
.banner-ctrl button { width: 44px; height: 44px; display: grid; place-items: center; border-radius: 50%; color: var(--on-wine); }
.banner-ctrl button:hover { background: color-mix(in srgb, var(--on-wine) 14%, transparent); }
.banner-ctrl .dot span { width: 20px; height: 3px; background: color-mix(in srgb, var(--beige) 45%, transparent); position: relative; overflow: hidden; display: block; }
.banner-ctrl .dot span i { position: absolute; inset: 0; background: var(--gold); transform: scaleX(0); transform-origin: right; }
.banner-ctrl .dot[aria-current="true"] span i { animation: progress 7s linear forwards; }
.banner.paused .banner-ctrl .dot[aria-current="true"] span i { animation-play-state: paused; }
.banner.static .banner-ctrl .dot[aria-current="true"] span i { animation: none; transform: scaleX(1); }
.banner-ctrl .icon { width: 18px; height: 18px; }
@keyframes progress { to { transform: scaleX(1); } }

/* ---------- Sections, bands, dividers ---------- */
.section { padding-block: var(--section); }
.section.tight { padding-block: calc(var(--section) * .7); }
.sec-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px 24px; margin-bottom: clamp(16px, 2vw, 28px); padding-bottom: 14px; border-bottom: 1px solid var(--rule); }
.band-wine .sec-head, .band-deep .sec-head { border-color: var(--on-wine-rule); }
.sec-side { display: flex; align-items: center; gap: 12px; flex: none; }
.sec-head.compact { align-items: flex-end; margin-bottom: 8px; padding-bottom: 12px; }
.band-wine { background: var(--wine); color: var(--on-wine); }
.band-deep { background: var(--wine-800); color: var(--on-wine); }
.band-panel { background: var(--panel); border-block: 1px solid var(--rule); }
/* Pattern divider from the guide's kufic line motif (ornament only, never behind text) */
.kufic-rule { height: 20px; max-width: var(--maxw); margin-inline: auto; background: color-mix(in srgb, var(--ornament) 80%, transparent); -webkit-mask: var(--pat-meander) center / 12.13px 20px repeat-x, linear-gradient(to left, transparent, #000 18%, #000 82%, transparent); -webkit-mask-composite: source-in; mask: var(--pat-meander) center / 12.13px 20px repeat-x, linear-gradient(to left, transparent, #000 18%, #000 82%, transparent); mask-composite: intersect; }

/* =====================================================================
   The volume cover: ONE card template for every piece on the site.
   Category band (label + volume number), a plate, the title.
   ===================================================================== */
.shelf-row {
  --gap: clamp(16px, 1.9vw, 28px);
  --cw: clamp(148px, calc((min(100vw, 1320px) - 2 * var(--gutter) - 5 * var(--gap)) / 6), 200px);
  --ch: calc(var(--cw) * 5 / 3);
  --plank: var(--beige); --plank-top: var(--gold);
  display: flex; gap: var(--gap); overflow-x: auto; overflow-y: hidden; scroll-snap-type: x mandatory;
  padding: 14px 0 6px; scrollbar-width: none; overscroll-behavior-x: contain;
}
.shelf-row::-webkit-scrollbar { display: none; }
.band-wine .shelf-row, .band-deep .shelf-row { --plank: var(--wine-900); --plank-top: var(--gold); }
.shelf-row > li { flex: 0 0 var(--cw); width: var(--cw); position: relative; scroll-snap-align: start; }
.shelf-row > li::after { content: ""; position: absolute; top: var(--ch); inset-inline: calc(var(--gap) / -2); height: 10px; background: linear-gradient(var(--plank-top) 0 2px, var(--plank) 2px); box-shadow: 0 8px 10px -8px color-mix(in srgb, var(--wine-900) 45%, transparent); }
.shelf-row > li:first-child::after { inset-inline-start: 0; }
.shelf-row > li:last-child::after { inset-inline-end: 0; }

.vc {
  --band: var(--wine); --band-fg: var(--on-wine); --orn: var(--gold);
  position: relative; display: flex; flex-direction: column; width: 100%; height: var(--ch, auto);
  background: var(--panel); color: var(--ink); overflow: hidden; box-shadow: var(--shadow-book);
  transition: transform .45s var(--ease), box-shadow .45s var(--ease);
}
.vc::before { /* binding on the right edge: Arabic books open from the right */
  content: ""; position: absolute; inset-block: 0; inset-inline-start: 0; width: 8px; z-index: 2; pointer-events: none;
  background: linear-gradient(to left, rgba(0, 0, 0, .2), rgba(255, 255, 255, .1) 60%, rgba(0, 0, 0, 0));
}
a.vc:hover, a.vc:focus-visible { transform: translateY(-8px); box-shadow: -1px 0 0 rgba(0, 0, 0, .06), 0 8px 12px color-mix(in srgb, var(--wine-900) 16%, transparent), 0 26px 36px -12px color-mix(in srgb, var(--wine-900) 42%, transparent); }
a.vc:focus-visible { outline-offset: 4px; }
.vc-band { display: flex; align-items: center; gap: 6px; min-height: 46px; padding: 6px 14px 6px 10px; background: var(--band); color: var(--band-fg); flex: none; }
.vc-cat { display: inline-flex; align-items: center; gap: 6px; font-weight: 500; font-size: .8125rem; line-height: 1.3; }
.vc-cat::before { content: ""; width: 6px; height: 6px; background: var(--orn); transform: rotate(45deg); flex: none; }
.vc-pin { display: inline-flex; color: var(--orn); }
.vc-pin .icon { width: 15px; height: 15px; }
.vc-no { margin-inline-start: auto; font-weight: 300; font-size: 1.6rem; line-height: 1; }
/* Pin order badge (editor's manual order) */
.vc-order { margin-inline-start: auto; min-width: 32px; height: 32px; padding: 0 6px; display: grid; place-items: center; border-radius: 999px; background: var(--gold); color: var(--wine-900); font-weight: 700; font-size: 1.0625rem; line-height: 1; box-shadow: 0 0 0 2px var(--band); }
.t-sum .vc-order { background: var(--wine); color: var(--on-wine); }
/* Plate: 10:9 keeps the centre of a 9:16 story image (about 25%-75% of its height), so the
   embedded label strip at 47-53% is never cut. Book and magazine covers are contained whole. */
.vc-plate { display: block; aspect-ratio: 10 / 9; flex: none; overflow: hidden; background: var(--wine-800); position: relative; }
.vc-plate img { width: 100%; height: 100%; object-fit: cover; object-position: 50% 50%; transition: transform .9s var(--ease); }
a.vc:hover .vc-plate img { transform: scale(1.04); }
.vc-plate.contain { background: var(--beige-100); padding: 10px 16px; }
.vc-plate.contain img { object-fit: contain; filter: drop-shadow(0 4px 6px color-mix(in srgb, var(--wine-900) 28%, transparent)); }
a.vc:hover .vc-plate.contain img { transform: none; }
.vc-plate.typo { display: grid; place-items: center; align-content: center; gap: 10px; background: var(--wine-800); color: var(--gold); isolation: isolate; }
.vc-plate.typo::before { content: ""; position: absolute; inset: 0; z-index: -1; background: color-mix(in srgb, var(--ornament) 22%, transparent); -webkit-mask: var(--pat-knotwings) center / 55px 45.5px repeat; mask: var(--pat-knotwings) center / 55px 45.5px repeat; }
.vc-plate.typo .mark { width: 34px; height: 37px; }
.vc-plate.typo .imprint { font-weight: 300; font-size: 1.125rem; color: var(--on-wine); }
.vc-title { flex: 1; padding: 10px 14px 0; font-weight: 500; font-size: .9375rem; line-height: 1.6; border-top: 3px solid var(--band); display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; margin-bottom: 12px; }
/* Category bands in the identity colours */
.t-art { --band: var(--wine); --band-fg: var(--on-wine); --orn: var(--gold); }
.t-sum { --band: var(--gold); --band-fg: var(--wine-900); --orn: var(--wine); }
.t-rev { --band: var(--green-ink); --band-fg: #fff; --orn: var(--gold-300); }
.t-file { --band: var(--grey-ink); --band-fg: #fff; --orn: var(--gold-300); }
.vol .cap { margin-top: 22px; }
.vol .cap .meta { display: block; line-height: 1.55; }
.vol .cap .meta > span { display: block; }
.vol .cap .meta > span:first-child { color: var(--ink); font-weight: 500; }
.vol .cap .meta > * + *::before { display: none; }
.band-wine .vol .cap .meta > span:first-child, .band-deep .vol .cap .meta > span:first-child { color: var(--on-wine); }
/* Series state on review covers: a gold bookmark ribbon where the reader stopped */
.vol.here::before { content: ""; position: absolute; top: calc(var(--ch) - 30px); inset-inline-end: 18px; width: 16px; height: 74px; z-index: 3; background: var(--gold); clip-path: polygon(0 0, 100% 0, 100% 100%, 50% 82%, 0 100%); box-shadow: 0 2px 4px rgba(0, 0, 0, .3); }
.vol.read .cap .meta > span:first-child::after { content: ""; display: inline-block; width: 7px; height: 7px; background: var(--gold); transform: rotate(45deg); margin-inline-start: 8px; }

.shelf-sec { padding-block: clamp(40px, 4.5vw, 76px); }
.shelf-ctrl { display: flex; gap: 4px; }
.shelf-ctrl[hidden] { display: none; }
.shelf-ctrl .icon-btn { border: 1px solid var(--rule-2); }
.band-wine .shelf-ctrl .icon-btn, .band-deep .shelf-ctrl .icon-btn { color: var(--on-wine); border-color: color-mix(in srgb, var(--beige) 40%, transparent); }
.band-wine .shelf-ctrl .icon-btn:hover, .band-deep .shelf-ctrl .icon-btn:hover { background: color-mix(in srgb, var(--on-wine) 10%, transparent); }
.series-line { display: flex; align-items: center; flex-wrap: wrap; gap: 10px 16px; margin-top: 16px; }
.series-line .sl-k { display: inline-flex; align-items: center; gap: 6px; color: var(--gold); font-size: .9375rem; }
.series-line .sl-k .icon { width: 18px; height: 18px; }
.series-line b { font-weight: 400; font-size: clamp(1.1rem, 1rem + .4vw, 1.35rem); }

/* Pinned: the editors' six, in their manual order */
.pinned { padding-block: 26px 36px; margin-top: 16px; }
.pinned .shelf-row { padding-top: 18px; }

/* ---------- Category spines ---------- */
.spines-wrap { display: grid; grid-template-columns: minmax(0, 4fr) minmax(0, 8fr); gap: clamp(24px, 4vw, 64px); align-items: end; }
.shelfbox { min-width: 0; }
.spines { display: flex; align-items: flex-end; gap: 6px; padding: 28px 4px 0; border-bottom: 6px solid var(--beige); box-shadow: inset 0 -2px 0 var(--gold); overflow-x: auto; scrollbar-width: none; }
.spine {
  --h: 260px; --hh: var(--h); --bg: var(--wine); --fg: var(--on-wine); --orn: var(--gold);
  flex: 0 0 auto; width: clamp(54px, 4.4vw, 66px); height: var(--hh); background: var(--bg); color: var(--fg);
  display: flex; flex-direction: column; align-items: center; justify-content: space-between; padding: 14px 0 12px;
  position: relative; transform-origin: bottom center; transition: transform .45s var(--ease), box-shadow .45s var(--ease);
  box-shadow: inset -3px 0 0 rgba(0, 0, 0, .14), inset 3px 0 0 rgba(255, 255, 255, .07);
}
.spine:hover, .spine.pulled { transform: translateY(-18px); box-shadow: inset -3px 0 0 rgba(0, 0, 0, .14), 0 20px 24px -12px color-mix(in srgb, var(--wine-900) 45%, transparent); }
.spine .s-band { width: 100%; height: 7px; border-block: 1px solid var(--orn); opacity: .85; }
.spine .s-dot { width: 10px; height: 10px; background: var(--orn); transform: rotate(45deg); }
/* Vertical title: a horizontal text block rotated as a whole, so Arabic letters stay joined */
.spine .s-name { position: absolute; top: 50%; left: 50%; width: calc(var(--hh) - 76px); transform: translate(-50%, -50%) rotate(-90deg); text-align: center; }
.spine .s-name span { display: block; font-weight: 400; font-size: 1.0625rem; line-height: 1.3; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.spine.deep { --bg: var(--wine-800); }
.spine.green { --bg: var(--green-ink); --fg: #fff; --orn: var(--gold-300); }
.spine.gold { --bg: var(--gold); --fg: var(--wine-900); --orn: var(--wine); }
.spine.light { --bg: var(--beige-100); --fg: var(--wine); --orn: var(--gold-ink); }
.spine.grey { --bg: var(--grey-ink); --fg: #fff; }
.spine.hollow { --bg: transparent; --fg: var(--grey-ink); --orn: var(--grey); border: 1.5px dashed var(--grey); border-bottom: 0; box-shadow: none; isolation: isolate; }
.spine.hollow::before { content: ""; position: absolute; inset: 0; z-index: -1; background: color-mix(in srgb, var(--ornament) 55%, transparent); -webkit-mask: var(--pat-dots) center / 16.5px 16px repeat; mask: var(--pat-dots) center / 16.5px 16px repeat; }
.spine-legend { display: flex; flex-wrap: wrap; gap: 4px 6px; margin-top: 16px; }
.spine-legend a { display: inline-flex; align-items: center; gap: 8px; min-height: 44px; padding: 0 14px; border: 1px solid var(--rule-2); background: var(--panel); border-radius: 999px; font-weight: 500; font-size: .9375rem; transition: border-color .2s, color .2s; }
.spine-legend a::before { content: ""; width: 6px; height: 6px; background: var(--gold); transform: rotate(45deg); }
.spine-legend a:hover, .spine-legend a:focus-visible { border-color: var(--wine); color: var(--wine); }
.spine-legend a.empty { font-weight: 400; color: var(--grey-ink); border-style: dashed; border-color: var(--grey); background: transparent; }
.spine-legend a.empty::before { background: transparent; outline: 1px solid var(--grey); }
.spine-legend small { font-size: .8125rem; color: var(--grey-ink); font-weight: 400; }

/* ---------- News ---------- */
.news { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: clamp(20px, 2.4vw, 32px); }
.news a { display: grid; grid-template-columns: 88px minmax(0, 1fr); gap: 14px; align-items: start; padding-top: 16px; border-top: 1px solid var(--rule); }
.news img { width: 88px; aspect-ratio: 1; object-fit: cover; background: var(--beige-100); }
.news strong { font-weight: 500; line-height: 1.65; font-size: .975rem; }
.news a:hover strong { color: var(--wine); }

/* ---------- Newsletter band + footer ---------- */
.nl-band { position: relative; background: var(--wine); color: var(--on-wine); overflow: hidden; isolation: isolate; scroll-margin-top: 80px; }
/* Eight-point knot motif in the far corner only, never behind the copy or the form */
.nl-band::after { content: ""; position: absolute; z-index: -1; inset-inline-end: -60px; bottom: -60px; width: 240px; height: 240px; background: color-mix(in srgb, var(--ornament) 35%, transparent); -webkit-mask: var(--pat-knot) center / contain no-repeat; mask: var(--pat-knot) center / contain no-repeat; }
.newsletter { display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 6fr); gap: clamp(24px, 4vw, 64px); align-items: center; padding-block: clamp(40px, 4vw, 64px); padding-inline-end: max(var(--gutter), 140px); }
.nl-label { display: block; font-size: .9375rem; color: var(--on-wine-2); margin-bottom: 8px; }
.nl-form { display: flex; gap: 10px; }
.nl-note { font-size: .875rem; color: var(--on-wine-2); margin-top: 10px; }
.nl-status { font-size: .9375rem; color: var(--on-wine); margin-top: 6px; min-height: 1.6em; }
.nl-band.flash .nl-form { animation: flash 1.2s var(--ease); }
@keyframes flash { 30% { box-shadow: 0 0 0 4px color-mix(in srgb, var(--gold) 55%, transparent); } }

.footer { background: var(--ground); font-size: .975rem; }
/* Quiet lattice band at the top of the footer ground (no text over it) */
.footer::before { content: ""; display: block; height: 45px; background: linear-gradient(var(--wine), var(--wine)) bottom / 100% 1px no-repeat, color-mix(in srgb, var(--ornament) 55%, transparent); -webkit-mask: var(--pat-lattice) center / 68.4px 44px repeat-x, linear-gradient(#000, #000) bottom / 100% 1px no-repeat; mask: var(--pat-lattice) center / 68.4px 44px repeat-x, linear-gradient(#000, #000) bottom / 100% 1px no-repeat; }
.footer > .wrap { padding-top: clamp(32px, 4vw, 56px); }
.footer .cols { display: grid; grid-template-columns: minmax(0, 4fr) repeat(3, minmax(0, 2.6fr)); gap: clamp(24px, 3vw, 48px); padding-bottom: 32px; }
.footer .about img { height: 64px; width: auto; margin-bottom: 16px; } /* clear space >= 25% of logo height around it */
.footer .about p { color: var(--grey-ink); max-width: 36ch; }
.footer h2 { font-size: 1.0625rem; font-weight: 500; color: var(--wine); margin-bottom: 6px; }
.footer li a { display: inline-flex; min-height: 44px; min-width: 44px; align-items: center; color: var(--ink); }
.footer li a:hover { color: var(--wine); text-decoration: underline; text-underline-offset: 5px; }
.footer address { font-style: normal; color: var(--grey-ink); line-height: 2; }
.footer address a { color: var(--ink); font-weight: 500; display: inline-flex; min-height: 44px; align-items: center; }
.footer .colophon { border-top: 1px solid var(--rule); padding-block: 12px; display: flex; justify-content: space-between; align-items: center; gap: 12px 16px; flex-wrap: wrap; color: var(--grey-ink); font-size: .875rem; }
.social-row { display: flex; align-items: center; gap: 8px 18px; flex-wrap: wrap; }
/* Social icons in thin outlined circles, next to the spaced Latin wordmark (guide p.10) */
.social.circles { display: flex; gap: 2px; }
.social.circles a { width: 44px; height: 44px; display: grid; place-items: center; color: var(--wine); border-radius: 50%; transition: color .2s, background .2s; }
.social.circles a:hover { background: var(--wine); color: var(--on-wine); }
.social.circles .icon { width: 34px; height: 34px; stroke-width: 1.1; }
.wordmark { font-size: 1rem; letter-spacing: .6em; color: var(--wine); font-weight: 400; padding-inline-start: 8px; border-inline-start: 1px solid var(--wine); line-height: 2.2; }

/* The newsletter confirmation page does not repeat the subscribe band */
.page-subscribed .nl-band { display: none; }

/* ---------- Inner page heads ---------- */
.crumbs { display: flex; flex-wrap: wrap; gap: 0 4px; align-items: center; font-size: .875rem; color: var(--grey-ink); padding-top: 16px; }
.crumbs a { color: var(--ink); min-height: 44px; min-width: 44px; display: inline-flex; align-items: center; justify-content: center; }
.crumbs a:hover { color: var(--wine); text-decoration: underline; text-underline-offset: 5px; }
.crumbs .icon { width: 14px; height: 14px; color: var(--gold-ink); }
.crumbs.on-wine { color: var(--on-wine-2); padding-top: 0; }
.crumbs.on-wine a { color: var(--on-wine); }
.crumbs.on-wine .icon { color: var(--gold); }
.crumbs [aria-current="page"] { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 36ch; }

.pagehead { display: grid; grid-template-columns: minmax(0, 7fr) minmax(0, 5fr); gap: 24px 48px; align-items: end; padding-block: 8px clamp(24px, 3vw, 40px); }
.pagehead.single { grid-template-columns: minmax(0, 1fr); }
.pagehead .lede { margin-top: 12px; color: var(--grey-ink); max-width: 60ch; font-size: 1.125rem; }
.hub-search { display: flex; gap: 10px; }

.tabs { position: sticky; top: 66px; z-index: 30; background: color-mix(in srgb, var(--ground) 96%, transparent); backdrop-filter: blur(8px); border-block: 1px solid var(--rule); }
.tabs ul { display: flex; gap: 2px; overflow-x: auto; scrollbar-width: none; }
.tabs ul::-webkit-scrollbar { display: none; }
.tabs a { display: inline-flex; align-items: center; min-height: 52px; padding: 0 12px; white-space: nowrap; color: var(--grey-ink); position: relative; }
.tabs a::after { content: ""; position: absolute; inset-inline: 12px; bottom: -1px; height: 2px; background: var(--wine); transform: scaleX(0); transition: transform .3s var(--ease); transform-origin: right; }
.tabs a.active { color: var(--wine); font-weight: 500; }
.tabs a.active::after { transform: scaleX(1); }

/* Knowledge hub */
.wall > .shelf-sec + .shelf-sec { border-top: 1px solid var(--rule); }
.mini-wall { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 380px), 1fr)); gap: 40px 32px; }
.mini-shelf { scroll-margin-top: 140px; }
.mini-shelf h3 { font-size: 1.1875rem; font-weight: 400; color: var(--wine); padding-bottom: 6px; border-bottom: 1px solid var(--rule); }
.mini-shelf .shelf-row { --cw: 116px; --gap: 16px; }
.mini-shelf .vc-band { min-height: 36px; padding-inline: 8px; }
.mini-shelf .vc-no { font-size: 1.2rem; }
.mini-shelf .vc-title { font-size: .8125rem; padding-inline: 8px; -webkit-line-clamp: 2; }
.mini-shelf .vc-plate.contain { padding: 6px 8px; }
/* Empty state: a dotted pattern ground in dashed slots */
.shelf-row.slots > .slot { height: var(--ch); border: 1.5px dashed var(--grey); position: relative; isolation: isolate; }
.shelf-row.slots > .slot::before { content: ""; position: absolute; inset: 0; z-index: -1; background: color-mix(in srgb, var(--ornament) 55%, transparent); -webkit-mask: var(--pat-dots) center / 16.5px 16px repeat; mask: var(--pat-dots) center / 16.5px 16px repeat; }
.empty .shelf-row { --plank: var(--beige-100); --plank-top: var(--grey); }
.empty-note { margin-top: 18px; color: var(--ink); font-weight: 500; display: grid; }
.empty-note span { font-weight: 400; color: var(--grey-ink); font-size: .9375rem; }
.mini-shelf:target h3 { color: var(--gold-ink); }

/* ---------- Thumbnails (portrait, never cropped through the label strip) ---------- */
.thumb { --tw: 64px; display: block; width: var(--tw); aspect-ratio: 9 / 16; flex: none; overflow: hidden; background: var(--wine-800); box-shadow: var(--shadow-1); }
.thumb img { width: 100%; height: 100%; object-fit: cover; }
.thumb.contain { background: var(--beige-100); padding: 4px; }
.thumb.contain img { object-fit: contain; }
.thumb.book { aspect-ratio: 3 / 4; }
.thumb.typo { display: grid; place-items: center; color: var(--gold); background: var(--wine-800); position: relative; isolation: isolate; }
.thumb.typo::before { content: ""; position: absolute; inset: 0; z-index: -1; background: color-mix(in srgb, var(--ornament) 22%, transparent); -webkit-mask: var(--pat-knotwings) center / 36px 29.8px repeat; mask: var(--pat-knotwings) center / 36px 29.8px repeat; }
.thumb.typo .mark { width: 22px; height: 24px; }
.thumb.sm { --tw: 48px; }

/* ---------- Review list items (section listing, knowledge hub) ---------- */
.rv-list { display: grid; }
.rv-item { position: relative; display: grid; grid-template-columns: 104px minmax(0, 1fr); gap: clamp(16px, 2vw, 28px); align-items: start; padding-block: 24px; border-bottom: 1px solid var(--rule); }
.rv-item:first-child { padding-top: 8px; }
.rv-item .thumb { --tw: 104px; aspect-ratio: 3 / 4; padding: 8px; }
.rv-body { display: grid; gap: 8px; justify-items: start; }
.rv-item h3 { font-weight: 400; font-size: clamp(1.15rem, 1rem + .45vw, 1.4rem); line-height: 1.55; color: var(--wine); }
.rv-item h3 a::after { content: ""; position: absolute; inset: 0; }
.rv-item:hover h3 { text-decoration: underline; text-decoration-color: var(--gold); text-underline-offset: 6px; }
.bookmeta { display: flex; flex-wrap: wrap; gap: 4px 28px; font-size: .9375rem; }
.bookmeta dt { color: var(--grey-ink); font-size: .8125rem; }
.bookmeta dd { font-weight: 500; }
.series-chip { position: relative; z-index: 1; display: inline-flex; align-items: center; gap: 8px; font-size: .8125rem; color: var(--green-ink); background: var(--beige-50); border: 1px solid var(--rule); padding: 2px 10px; border-radius: 999px; }
.series-chip .icon { width: 16px; height: 16px; }
.rv-list.grid { grid-template-columns: repeat(2, minmax(0, 1fr)); column-gap: clamp(24px, 3vw, 48px); }
.rv-item.compact { grid-template-columns: 72px minmax(0, 1fr); padding-block: 18px; }
.rv-item.compact:first-child, .rv-list.grid .rv-item:nth-child(2) { padding-top: 8px; }
.rv-item.compact .thumb { --tw: 72px; padding: 5px; }
.rv-item.compact h3 { font-size: 1.0625rem; }

/* Section listing page: list + aside */
.listing { display: grid; grid-template-columns: minmax(0, 1fr) 360px; gap: clamp(32px, 5vw, 80px); align-items: start; padding-bottom: var(--section); }
.list-head { display: flex; align-items: baseline; justify-content: space-between; gap: 16px; border-bottom: 1px solid var(--wine); padding-bottom: 8px; margin-bottom: 8px; }
.list-title { font-weight: 400; font-size: 1.25rem; color: var(--wine); }
.list-count { color: var(--grey-ink); font-size: .9375rem; }
.listing-aside { position: sticky; top: 100px; scroll-margin-top: 100px; }

/* ---------- Series box (optional: only on items linked to a series) ---------- */
.body > .series-box { margin-bottom: 32px; }
.series-box { display: grid; gap: 14px; background: var(--panel); border: 1px solid var(--rule); border-top: 3px solid var(--green-ink); padding: clamp(18px, 2vw, 24px); }
.sb-head { display: grid; gap: 4px; }
.sb-kicker { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; color: var(--green-ink); font-size: .875rem; font-weight: 500; }
.sb-kicker .icon { width: 18px; height: 18px; }
.series-box h2 { font-weight: 400; font-size: 1.3rem; line-height: 1.5; color: var(--wine); }
.series-box h2 a { display: inline-flex; align-items: center; min-height: 44px; }
.series-box h2 a:hover { text-decoration: underline; text-underline-offset: 5px; }
.sb-where { font-size: .9375rem; color: var(--grey-ink); }
.sb-desc { color: var(--grey-ink); font-size: .9375rem; }
.sb-parts { border-top: 1px solid var(--rule); }
.sb-parts a { display: grid; grid-template-columns: 34px minmax(0, 1fr) auto; gap: 10px; align-items: center; min-height: 48px; padding-block: 6px; border-bottom: 1px solid var(--rule); font-size: .9375rem; line-height: 1.5; }
.sb-parts .n { width: 30px; height: 30px; display: grid; place-items: center; position: relative; z-index: 0; font-weight: 500; color: var(--wine); font-size: .875rem; }
.sb-parts .n::before { content: ""; position: absolute; inset: 5px; border: 1.5px solid var(--gold); background: var(--panel); transform: rotate(45deg); z-index: -1; }
.sb-parts li.read .n::before { background: var(--gold); }
.sb-parts a:hover .t { color: var(--wine); }
.sb-parts a[aria-current="page"] { color: var(--wine); font-weight: 500; }
.sb-parts a[aria-current="page"] .n { color: var(--on-wine); }
.sb-parts a[aria-current="page"] .n::before { background: var(--wine); border-color: var(--wine); }
.sb-parts .st8 { font-size: .8125rem; color: var(--grey-ink); white-space: nowrap; }
.sb-parts li.here .st8 { color: var(--gold-ink); font-weight: 500; }
.series-box .btn { justify-self: start; }
.progress-line { display: grid; gap: 6px; }
.progress-line .bar { height: 5px; background: var(--beige-100); position: relative; overflow: hidden; }
.progress-line .bar i { position: absolute; inset: 0; background: var(--gold); transform: scaleX(var(--pf, 0)); transform-origin: right; transition: transform .6s var(--ease); }
.progress-line .txt { font-size: .875rem; color: var(--grey-ink); }
.series-steps { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-top: 32px; }
.series-steps a { display: grid; gap: 2px; padding: 14px 16px; border: 1px solid var(--rule); background: var(--beige-50); }
.series-steps a + a { text-align: left; }
.series-steps a:hover { border-color: var(--green-ink); }
.series-steps small { display: flex; align-items: center; gap: 6px; color: var(--green-ink); font-size: .8125rem; }
.series-steps a + a small { justify-content: flex-end; }
.series-steps small .icon { width: 16px; height: 16px; }
.series-steps b { font-weight: 500; }

/* =====================================================================
   Single pages (article, review, summary): model C's layout in v2's identity.
   Wine hero: cover | text | hairline | author box. Then body (start) + related (end).
   ===================================================================== */
.readbar { position: fixed; top: 0; inset-inline: 0; height: 3px; z-index: 70; pointer-events: none; }
.readbar i { display: block; height: 100%; width: 100%; background: var(--gold); transform: scaleX(var(--r, 0)); transform-origin: right; }

.page-hero { position: relative; background: var(--wine); color: var(--on-wine); overflow: hidden; isolation: isolate; }
/* The item's own cover, blurred and tinted wine: the guide's blurred photo ground */
.page-hero .hero-bg { position: absolute; z-index: -2; inset: -60px; width: calc(100% + 120px); height: calc(100% + 120px); max-width: none; object-fit: cover; filter: blur(40px) saturate(.8); opacity: .55; }
.page-hero::before { content: ""; position: absolute; inset: 0; z-index: -1; background: linear-gradient(to left, color-mix(in srgb, var(--wine) 72%, transparent), color-mix(in srgb, var(--wine-700) 94%, transparent) 55%); }
.hero-grid { display: grid; grid-template-columns: auto minmax(0, 1fr) 300px; gap: 48px; align-items: center; padding-block: 44px 56px; }
.hero-cover img { height: 400px; width: auto; box-shadow: 0 22px 44px rgba(0, 0, 0, .45); }
.hero-cover.book img { height: 340px; background: var(--beige-100); }
.hero-text { display: grid; gap: 14px; justify-items: start; min-width: 0; }
.page-hero h1 { font-weight: 400; font-size: var(--fs-h1); line-height: 1.4; color: #fff; }
.page-hero .tag { background: var(--gold); color: var(--wine-900); }
.page-hero .badge-new { color: var(--on-wine-2); }
.page-hero .badge-new::before { background: var(--gold); }
.hero-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 0; color: var(--on-wine-2); font-size: .9375rem; }
.hero-meta > span { display: inline-flex; align-items: center; gap: 6px; }
.hero-meta > * + *::before { content: ""; width: 4px; height: 4px; background: var(--gold); transform: rotate(45deg); margin-inline: 10px 4px; }
.hero-meta .icon { width: 16px; height: 16px; color: var(--gold); }
.hero-meta .by { color: #fff; font-weight: 500; }
.page-hero .tools { display: flex; gap: 6px; }
.page-hero .tools .icon-btn { color: var(--on-wine); border: 1px solid color-mix(in srgb, var(--beige) 40%, transparent); }
.page-hero .tools .icon-btn:hover { background: color-mix(in srgb, var(--on-wine) 10%, transparent); }
.page-hero .tools .icon-btn[aria-pressed="true"] { background: var(--gold); color: var(--wine-900); border-color: var(--gold); }
/* Author box at the end side, after a thin vertical hairline */
.author-box { align-self: stretch; display: flex; flex-direction: column; justify-content: center; gap: 6px; border-inline-start: 1px solid color-mix(in srgb, var(--beige) 35%, transparent); padding-inline-start: 32px; }
.ab-label { font-size: .8125rem; color: var(--gold); }
.ab-name { font-weight: 500; font-size: 1.125rem; color: #fff; }
.ab-bio { color: var(--on-wine-2); font-size: .9375rem; line-height: 1.85; }
.ab-more { display: inline-flex; align-items: center; gap: 6px; min-height: 44px; color: var(--gold); font-size: .9375rem; align-self: flex-start; }
.ab-more:hover { text-decoration: underline; text-underline-offset: 5px; }
.ab-more .icon { width: 16px; height: 16px; }
.bookdata { display: grid; gap: 8px; }
.bookdata div { border-bottom: 1px solid var(--on-wine-rule); padding-bottom: 6px; }
.bookdata dt { font-size: .8125rem; color: var(--on-wine-2); }
.bookdata dd { font-weight: 500; line-height: 1.5; color: #fff; }
.hero-rule { position: absolute; inset-inline: 0; bottom: 12px; height: 20px; background: color-mix(in srgb, var(--ornament) 45%, transparent); -webkit-mask: var(--pat-meander) center / 12.13px 20px repeat-x; mask: var(--pat-meander) center / 12.13px 20px repeat-x; }

/* Reader: body column at the start side, related rail at the end side */
.reader { display: grid; grid-template-columns: minmax(0, 1fr) 300px; gap: clamp(40px, 5vw, 80px); align-items: start; padding-block: 40px var(--section); }
.reader > .body { min-width: 0; max-width: 44rem; }
.reader.notes-side { grid-template-columns: minmax(0, 1fr); padding-bottom: 32px; }
.reader.notes-side > .body { max-width: none; }
.editor-note { display: flex; align-items: center; flex-wrap: wrap; gap: 4px 12px; padding: 8px 14px; margin-bottom: 20px; background: var(--beige-50); border: 1px dashed var(--grey); font-size: .9375rem; color: var(--grey-ink); max-width: 44rem; }
.editor-note .icon { width: 18px; height: 18px; color: var(--gold-ink); }
.editor-note b { color: var(--ink); font-weight: 500; }
.editor-note a { color: var(--wine); font-weight: 500; text-decoration: underline; text-underline-offset: 5px; min-height: 44px; display: inline-flex; align-items: center; }
.toc-inline { display: flex; flex-wrap: wrap; align-items: center; gap: 0 4px; margin-bottom: 24px; padding-bottom: 12px; border-bottom: 1px solid var(--rule); font-size: .9375rem; color: var(--grey-ink); max-width: 44rem; }
.toc-inline a { display: inline-flex; align-items: center; min-height: 44px; padding-inline: 10px; color: var(--wine); }
.toc-inline a:hover { text-decoration: underline; text-underline-offset: 5px; }

/* Prose. With sidenotes it is a two-column grid: text and a margin that only holds notes.
   Each note follows its paragraph in the DOM and is auto-placed on the same row, so notes
   flow with the text and can never overlap each other or anything else. */
.prose { font-size: var(--fs-read); line-height: 2; color: var(--ink); }
.prose > * { margin: 0 0 1.1em; }
.prose.with-notes { --note-w: 240px; display: grid; grid-template-columns: minmax(0, 42rem) var(--note-w); column-gap: 48px; align-items: start; }
.prose.with-notes > * { grid-column: 1; }
.prose.with-notes > .sn { grid-column: 2; grid-row: span 2; margin: .4em 0 1em; }
/* A long note spans more text rows, so the next paragraphs flow beside it instead of below it */
.prose.with-notes > .sn.long { grid-row: span 4; }
.prose .lede { font-size: 1.15em; line-height: 1.95; color: var(--wine); font-weight: 400; }
.prose h2 { font-weight: 400; font-size: var(--fs-h2); line-height: 1.5; margin-top: 1.5em; margin-bottom: .5em; color: var(--wine); display: flex; align-items: flex-start; gap: 12px; }
.prose h2::before { content: ""; width: 9px; height: 9px; margin-top: .62em; border: 1.5px solid var(--gold); transform: rotate(45deg); flex: none; }
.prose h3 { font-weight: 500; font-size: 1.125rem; line-height: 1.6; margin-top: 1.3em; margin-bottom: .4em; color: var(--wine); }
.prose strong { font-weight: 500; color: var(--wine); }
.prose ul, .prose ol.principles { padding-inline-start: 1.3em; }
.prose ul li, .prose ol.principles li { position: relative; padding-inline-start: .4em; }
.prose ul li + li, .prose ol li + li { margin-top: .6em; }
.prose ul li::before { content: ""; position: absolute; inset-inline-start: -.9em; top: .85em; width: 7px; height: 7px; background: var(--gold); transform: rotate(45deg); }
.prose ol.principles { counter-reset: p; }
.prose ol.principles li { counter-increment: p; }
.prose ol.principles li::before { content: counter(p); position: absolute; inset-inline-start: -1.2em; font-weight: 500; color: var(--gold-ink); }
.prose blockquote { margin-inline: 0; padding-inline-start: 22px; border-inline-start: 3px solid var(--gold); font-size: 1.03em; line-height: 1.95; color: var(--wine); }
.prose blockquote footer { font-size: .8em; color: var(--grey-ink); margin-top: 6px; }
.prose .thesis { font-weight: 500; color: var(--wine); }
.prose .cut-note, .src-note, .pn-note { font-size: .875rem; color: var(--grey-ink); border: 1px dashed var(--grey); padding: 8px 14px; justify-self: start; }
.src-note, .pn-note { margin-top: 12px; }
/* In-body figure (example of an inner image): full column width frame, image whole */
.inbody-fig { margin: 1.6em 0 !important; }
.fig-frame { position: relative; display: block; aspect-ratio: 16 / 10; background: var(--beige-100); }
.fig-frame img { position: absolute; inset: 20px; width: calc(100% - 40px); height: calc(100% - 40px); object-fit: contain; filter: drop-shadow(0 6px 10px color-mix(in srgb, var(--wine-900) 25%, transparent)); }
.inbody-fig figcaption { display: flex; flex-wrap: wrap; gap: 6px 12px; align-items: center; margin-top: 10px; font-size: .875rem; line-height: 1.7; color: var(--grey-ink); }

/* Note markers, sidenotes, footnotes */
.fn a { display: inline-grid; place-items: center; min-width: 1.6em; height: 1.6em; padding: 0 4px; margin-inline-start: 2px; font-size: .7em; font-weight: 500; color: var(--wine); background: var(--gold-100); border-bottom: 1.5px solid var(--gold); position: relative; line-height: 1; }
/* 44x44 hit area centred on the marker whatever the glyph box; site.js narrows it (.fn-tight) when two markers
   sit closer than 44px on a line, so one marker's area never covers its neighbour */
.fn a::after { content: ""; position: absolute; left: 50%; top: 50%; width: 44px; height: 44px; transform: translate(-50%, -50%); }
.fn a.fn-tight::after { width: calc(100% + 4px); }
.fn a:hover, .fn a[aria-expanded="true"] { background: var(--wine); color: var(--on-wine); }
.sn { font-size: .875rem; line-height: 1.8; color: var(--grey-ink); border-top: 2px solid var(--gold); padding-top: 8px; display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 8px; transition: background .3s; }
.sn.flash { background: var(--gold-100); }
.sn-n { font-weight: 500; color: var(--wine); }
.sn-body.ltr { text-align: left; unicode-bidi: isolate; }
.sn-body cite { font-style: italic; }
.endnotes { border-top: 1px solid var(--wine); margin-top: 1.4em; font-size: .9375rem; line-height: 1.85; color: var(--grey-ink); scroll-margin-top: 100px; }
.endnotes > summary { display: flex; align-items: center; gap: 12px; min-height: 52px; }
.endnotes > summary h2 { font-weight: 500; font-size: 1.125rem; color: var(--wine); }
.endnotes > summary .en-count { color: var(--grey-ink); font-size: .875rem; }
.endnotes > summary .icon { margin-inline-start: auto; width: 18px; height: 18px; }
.endnotes ol { display: grid; }
.endnotes li { display: grid; grid-template-columns: 24px minmax(0, 1fr) 44px; gap: 8px; align-items: start; padding-block: 8px; border-bottom: 1px solid var(--rule); scroll-margin-top: 110px; }
.endnotes li:target { background: var(--gold-100); }
.endnotes .back { width: 44px; height: 44px; display: grid; place-items: center; color: var(--wine); margin-top: -8px; }
.endnotes .back .icon { width: 16px; height: 16px; transform: rotate(-90deg); }
.en-src { font-size: .8125rem; margin-top: 10px; }
.fn-pop { margin: -.4em 0 1.2em; padding: 10px 14px; background: var(--gold-100); border-inline-start: 3px solid var(--gold); font-size: .9rem; line-height: 1.8; color: var(--ink); display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 4px 10px; }
.fn-pop a { grid-column: 2; color: var(--wine); font-weight: 500; min-height: 44px; display: inline-flex; align-items: center; }

/* Related rail (small cards) */
.related { position: sticky; top: 96px; display: grid; gap: 10px; }
.rel-title { display: flex; align-items: center; gap: 10px; font-weight: 400; font-size: 1.25rem; color: var(--wine); padding-bottom: 10px; border-bottom: 1px solid var(--wine); }
.rel-title .mark { color: var(--wine); width: 12px; height: 13px; }
.rel-list { display: grid; }
.rel-card { position: relative; display: grid; grid-template-columns: 64px minmax(0, 1fr); gap: 14px; align-items: start; padding-block: 14px; border-bottom: 1px solid var(--rule); }
.rel-card > div { display: grid; gap: 4px; justify-items: start; }
.rel-card h3 { font-weight: 500; font-size: .975rem; line-height: 1.6; }
.rel-card:hover h3 { color: var(--wine); }
.rel-card .meta { font-size: .8125rem; }
.stretch::after { content: ""; position: absolute; inset: 0; }
/* On sidenote articles the related cards sit BELOW the body, as a row */
.related.below { position: static; padding-block: 8px var(--section); }
.related.below .rel-list { grid-template-columns: repeat(4, minmax(0, 1fr)); column-gap: clamp(20px, 2.4vw, 32px); }
.related.below .rel-card { border-bottom: 0; border-top: 1px solid var(--rule); }

/* Prev/next by the section's published order, at the end of the body */
.prev-next { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; margin-top: 32px; padding-top: 24px; border-top: 1px solid var(--wine); max-width: 44rem; }
.pn-card { display: grid; grid-template-columns: 48px minmax(0, 1fr); gap: 14px; align-items: center; padding: 12px; border: 1px solid var(--rule); background: var(--panel); min-height: 110px; transition: border-color .2s; }
.pn-card:hover { border-color: var(--wine); }
.pn-card.next { grid-column: 2; grid-template-columns: minmax(0, 1fr) 48px; text-align: left; }
.pn-card.next .thumb { order: 2; }
.pn-text { display: grid; gap: 2px; }
.pn-text small { display: flex; align-items: center; gap: 6px; font-size: .8125rem; font-weight: 500; color: var(--gold-ink); }
.pn-card.next small { justify-content: flex-end; }
.pn-text small .icon { width: 16px; height: 16px; }
.pn-text b { font-weight: 500; line-height: 1.55; font-size: .975rem; }

/* ---------- Responsive ---------- */
@media (max-width: 1240px) {
  .mainnav > li > a, .mainnav > li > button, .mainnav .nav-soon { padding: 0 8px; }
  .slide .copy { padding-inline-end: 180px; }
  .hero-grid { grid-template-columns: auto minmax(0, 1fr) 260px; gap: 36px; }
  .hero-cover img { height: 360px; }
  .related.below .rel-list { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 1100px) {
  .nl-top span { display: none; }
  .nl-top { width: 44px; padding: 0; }
}
@media (max-width: 1000px) {
  .mainnav-wrap, .util nav { display: none; }
  .menu-btn { display: inline-grid; }
  .masthead .wrap { min-height: 64px; gap: 4px; }
  .brand { padding: 10px; margin-inline-start: 0; }
  .brand img, .masthead.scrolled .brand img { height: 40px; }
  .masthead.scrolled .wrap { min-height: 60px; }
  .spines-wrap, .newsletter, .pagehead { grid-template-columns: minmax(0, 1fr); }
  .newsletter { padding-inline-end: var(--gutter); }
  .footer .cols { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .footer .about { grid-column: 1 / -1; }
  .tabs { top: 60px; }
  .news { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .listing { grid-template-columns: minmax(0, 1fr); }
  .listing-aside { position: static; }
  .hero-grid { grid-template-columns: auto minmax(0, 1fr); }
  .author-box { grid-column: 1 / -1; border-inline-start: 0; padding-inline-start: 0; border-top: 1px solid color-mix(in srgb, var(--beige) 35%, transparent); padding-top: 16px; }
  .reader { grid-template-columns: minmax(0, 1fr); }
  .related { position: static; }
  .reader > .related .rel-list { grid-template-columns: repeat(2, minmax(0, 1fr)); column-gap: 24px; }
}
/* Below this width the sidenote margin goes: notes become collapsible inline notes at the marker */
@media (max-width: 940px) {
  .prose.with-notes { display: block; }
  .prose.with-notes > .sn { display: none; margin: -.4em 0 1.2em; padding: 10px 12px; background: var(--gold-100); }
  .prose.with-notes > .sn.open { display: grid; }
}
@media (max-width: 760px) {
  :root { --section: 48px; }
  .util { display: none; }
  .programs { padding-top: 12px; }
  .slide { grid-template-columns: 112px minmax(0, 1fr); align-items: center; }
  .slide .art { height: auto; width: 112px; align-self: center; aspect-ratio: 16 / 9; }
  .slide .copy { padding: 10px 14px 56px 14px; }
  .slide h2 { font-size: 1.0625rem; }
  .slide p { display: none; }
  .banner-ctrl { top: auto; transform: none; bottom: 6px; inset-inline-end: 8px; }
  .sec-head { flex-direction: column; align-items: flex-start; gap: 4px; }
  .sec-side { width: 100%; justify-content: flex-end; }
  .shelf-ctrl { display: none; }
  .shelf-row { --cw: 148px; --gap: 14px; margin-inline: calc(-1 * var(--gutter)); padding-inline: var(--gutter); scroll-padding-inline: var(--gutter); }
  .shelf-row > li:first-child::after { inset-inline-start: calc(-1 * var(--gutter)); }
  .vc-band { min-height: 40px; padding: 4px 10px 4px 8px; }
  .vc-no { font-size: 1.3rem; }
  .vc-title { font-size: .875rem; padding-inline: 10px; }
  .mini-shelf .shelf-row { --cw: 104px; margin-inline: 0; padding-inline: 0; }
  .mini-shelf .vc-title { font-size: .75rem; padding-inline: 12px 6px; }
  .mini-shelf .shelf-row > li:first-child::after { inset-inline-start: 0; }
  .spines { margin-inline: calc(-1 * var(--gutter)); padding-inline: var(--gutter); }
  .spine { --hh: 190px !important; width: 50px; }
  .spine .s-name span { font-size: .9375rem; }
  .news { grid-template-columns: minmax(0, 1fr); gap: 0; }
  .news a { grid-template-columns: 72px minmax(0, 1fr); padding-block: 14px; }
  .news img { width: 72px; }
  .nl-form { flex-direction: column; }
  .nl-band::after { display: none; }
  .footer .cols { gap: 24px 20px; }
  .footer .cols > :last-child { grid-column: 1 / -1; }
  .wordmark { letter-spacing: .45em; }
  .page-title { font-size: 2.4rem; }
  .pagehead .lede { font-size: 1.0625rem; }
  .hub-search .btn { padding: 0 16px; }
  .rv-list.grid { grid-template-columns: minmax(0, 1fr); }
  .rv-list.grid .rv-item:nth-child(2) { padding-top: 18px; }
  .rv-item { grid-template-columns: 80px minmax(0, 1fr); gap: 14px; padding-block: 18px; }
  .rv-item .thumb { --tw: 80px; padding: 6px; }
  .rv-item h3 { font-size: 1.0625rem; }
  .series-chip .sc-name { display: none; }
  .bookmeta { display: grid; gap: 0; font-size: .875rem; }
  .bookmeta div { display: flex; gap: 6px; }
  .series-steps { grid-template-columns: minmax(0, 1fr); }
  .series-steps a + a { text-align: right; }
  .series-steps a + a small { justify-content: flex-start; }
  /* Hero stacks: cover, then title/meta, then the author box */
  .hero-grid { grid-template-columns: minmax(0, 1fr); gap: 18px; padding-block: 24px 44px; }
  .hero-cover { justify-self: center; }
  .hero-cover img { height: 300px; }
  .hero-cover.book img { height: 260px; }
  .page-hero h1 { font-size: 1.65rem; }
  .crumbs [aria-current="page"] { max-width: 16ch; }
  .reader { padding-top: 28px; gap: 32px; }
  .reader > .related .rel-list, .related.below .rel-list { grid-template-columns: minmax(0, 1fr); }
  .related.below .rel-card { border-top: 0; border-bottom: 1px solid var(--rule); }
  .prev-next { grid-template-columns: minmax(0, 1fr); }
  .pn-card.next { grid-column: 1; }
  .prose { line-height: 1.95; }
  .fig-frame { padding: 12px; }
}

/* Toast: short non-blocking status messages (copy link, share fallback) */
.toast { position: fixed; left: 50%; transform: translateX(-50%); bottom: 84px; z-index: 90; background: var(--ink); color: var(--on-wine); padding: 12px 18px; border-radius: var(--radius); box-shadow: var(--shadow-2); font-size: .9375rem; max-width: min(92vw, 520px); animation: toast-in .35s var(--ease); border-inline-start: 3px solid var(--gold); }
.toast[hidden] { display: none; }
@keyframes toast-in { from { opacity: 0; transform: translate(-50%, 10px); } }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { transition-duration: 0.01ms !important; animation-duration: 0.01ms !important; animation-iteration-count: 1 !important; }
}
