/* ==========================================================================
   SELF-HOSTED TYPOGRAPHY (Bricolage Grotesque + Source Sans 3, Latin + Polish)
   ========================================================================== */

@font-face {
  font-family: "Bricolage Grotesque";
  font-style: normal;
  font-weight: 500 700;
  font-stretch: 100%;
  font-display: swap;
  src: url("assets/fonts/bricolage-grotesque-latin-ext.woff2") format("woff2");
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF,
    U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020,
    U+20A0-20AB, U+20AD-20C4, U+2113, U+2C60-2C7F, U+A720-A7FF;
}

@font-face {
  font-family: "Bricolage Grotesque";
  font-style: normal;
  font-weight: 500 700;
  font-stretch: 100%;
  font-display: swap;
  src: url("assets/fonts/bricolage-grotesque-latin.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA,
    U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193,
    U+2212, U+2215, U+FEFF, U+FFFD;
}

@font-face {
  font-family: "Source Sans 3";
  font-style: normal;
  font-weight: 400 700;
  font-display: swap;
  src: url("assets/fonts/source-sans-3-latin-ext.woff2") format("woff2");
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF,
    U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020,
    U+20A0-20AB, U+20AD-20C4, U+2113, U+2C60-2C7F, U+A720-A7FF;
}

@font-face {
  font-family: "Source Sans 3";
  font-style: normal;
  font-weight: 400 700;
  font-display: swap;
  src: url("assets/fonts/source-sans-3-latin.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA,
    U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193,
    U+2212, U+2215, U+FEFF, U+FFFD;
}

/* ==========================================================================
   DESIGN TOKENS & EDITION PALETTES
   ========================================================================== */

:root {
  --font-display: "Bricolage Grotesque", "Segoe UI", system-ui, sans-serif;
  --font-body: "Source Sans 3", "Segoe UI", system-ui, sans-serif;

  /* Default: Seria 02 • 2026 "Ciepła Zima" (Midnight Winter Navy + Honey Ochre) */
  --cloth-bg: #0f2133;
  --cloth-deep: #0a1724;
  --cloth-plate: #142a40;
  --cloth-ink: #f4ede0;
  --cloth-ink-muted: #c6d2dc;
  --cloth-rule: rgba(244, 237, 224, 0.16);
  --cloth-rule-strong: rgba(228, 178, 99, 0.42);
  --cloth-accent: #e4b263;
  --cloth-accent-hover: #ecc078;
  --cloth-accent-ink: #0f2133;

  /* Warm Archival Ledger Paper */
  --paper-bg: #f3ece1;
  --paper-surface: #ece3d4;
  --paper-row-hover: #eae0cf;
  --paper-ink: #132435;
  --paper-ink-muted: #46586a;
  --paper-accent: #8f3e24;
  --paper-accent-soft: rgba(143, 62, 36, 0.12);
  --paper-rule: rgba(19, 36, 53, 0.14);
  --paper-rule-strong: rgba(19, 36, 53, 0.28);

  --focus-ring-light: #e4b263;
  --focus-ring-dark: #8f3e24;

  --ease-out-expo: cubic-bezier(0.22, 1, 0.36, 1);
  --duration-theme: 360ms;
  --duration-stamp: 320ms;

  --radius-xs: 3px;
  --radius-sm: 6px;
  --container-max: 1120px;
  --gutter: clamp(1.125rem, 4vw, 2.5rem);
}

html[data-theme="meadow-pine"] {
  /* Seria 01 • 2025 "Przyjaciel Psiego Pola" (Deep Meadow Pine + Terracotta Clover) */
  --cloth-bg: #233326;
  --cloth-deep: #1a271c;
  --cloth-plate: #2b3e2e;
  --cloth-ink: #f4ede0;
  --cloth-ink-muted: #c9d5c6;
  --cloth-rule: rgba(244, 237, 224, 0.16);
  --cloth-rule-strong: rgba(227, 148, 107, 0.44);
  --cloth-accent: #e3946b;
  --cloth-accent-hover: #eba47e;
  --cloth-accent-ink: #1b281d;

  --paper-ink: #1e2d20;
  --paper-ink-muted: #485b4a;
  --paper-accent: #914726;
  --paper-accent-soft: rgba(145, 71, 38, 0.12);
  --paper-rule: rgba(30, 45, 32, 0.14);
  --paper-rule-strong: rgba(30, 45, 32, 0.28);

  --focus-ring-light: #e3946b;
  --focus-ring-dark: #914726;
}

/* ==========================================================================
   BASE & BROWSER SURFACES
   ========================================================================== */

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

html {
  background-color: var(--cloth-deep);
  color: var(--paper-ink);
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  scroll-behavior: smooth;
  scrollbar-color: var(--paper-ink-muted) var(--paper-surface);
  scrollbar-width: thin;
}

body {
  margin: 0;
  min-height: 100vh;
  background-color: var(--cloth-deep);
  color: var(--paper-ink);
  overflow-x: clip;
}

::selection {
  background-color: var(--cloth-accent);
  color: var(--cloth-accent-ink);
}

::-webkit-scrollbar {
  width: 10px;
}

::-webkit-scrollbar-track {
  background: var(--paper-surface);
}

::-webkit-scrollbar-thumb {
  background-color: var(--paper-ink-muted);
  border: 2px solid var(--paper-surface);
  border-radius: 999px;
}

a {
  color: inherit;
  text-underline-offset: 0.22em;
  text-decoration-thickness: 1.5px;
}

button {
  font: inherit;
  color: inherit;
}

img {
  display: block;
  max-width: 100%;
}

.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-link {
  position: absolute;
  left: 1rem;
  top: -100px;
  z-index: 100;
  padding: 0.75rem 1.15rem;
  background: var(--cloth-ink);
  color: var(--cloth-bg);
  font-weight: 600;
  text-decoration: none;
  border-radius: var(--radius-xs);
  transition: top 160ms var(--ease-out-expo);
}

.skip-link:focus {
  top: 1rem;
  outline: 2px solid var(--focus-ring-light);
  outline-offset: 2px;
}

.container {
  width: min(100%, var(--container-max));
  margin-inline: auto;
  padding-inline: var(--gutter);
}

/* ==========================================================================
   STOCKBOOK HEADER (EDITION-REACTIVE BOOKCLOTH BOARD + STAMPS)
   ========================================================================== */

.stockbook {
  position: relative;
  background-color: var(--cloth-bg);
  background-image:
    radial-gradient(
      110% 85% at 72% 28%,
      rgba(255, 248, 232, 0.065) 0%,
      rgba(255, 248, 232, 0) 64%
    ),
    repeating-linear-gradient(
      0deg,
      rgba(255, 255, 255, 0.015) 0px,
      rgba(255, 255, 255, 0.015) 1px,
      transparent 1px,
      transparent 4px
    ),
    repeating-linear-gradient(
      90deg,
      rgba(0, 0, 0, 0.03) 0px,
      rgba(0, 0, 0, 0.03) 1px,
      transparent 1px,
      transparent 5px
    );
  color: var(--cloth-ink);
  border-top: 3px solid var(--cloth-accent);
  border-bottom: 3px solid var(--cloth-accent);
  transition:
    background-color var(--duration-theme) var(--ease-out-expo),
    border-color var(--duration-theme) var(--ease-out-expo);
}

/* Top masthead bar */
.masthead {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding-block: 1.05rem;
  border-bottom: 1px solid var(--cloth-rule);
}

.masthead-brand {
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
  color: var(--cloth-ink);
  font-size: 0.9375rem;
  font-weight: 600;
  letter-spacing: 0.01em;
  white-space: nowrap;
}

.masthead-mark {
  color: var(--cloth-accent);
  flex-shrink: 0;
  transition: color var(--duration-theme) var(--ease-out-expo);
}

.masthead-link {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.55rem 0.65rem;
  margin-right: -0.65rem;
  font-size: 0.9375rem;
  font-weight: 500;
  color: var(--cloth-ink-muted);
  text-decoration: none;
  border-bottom: 1px solid transparent;
  white-space: nowrap;
  flex-shrink: 0;
  transition:
    color 180ms ease,
    border-color 180ms ease;
}

.masthead-link:hover {
  color: var(--cloth-ink);
  border-bottom-color: var(--cloth-accent);
}

.masthead-link:focus-visible {
  outline: 2px solid var(--focus-ring-light);
  outline-offset: 4px;
  border-radius: 2px;
}

.masthead-link .icon-arrow {
  transition: transform 200ms var(--ease-out-expo);
}

.masthead-link:hover .icon-arrow {
  transform: translate(2px, -2px);
}

/* Stockbook main spread: mobile stacks intro above side-by-side stamps; desktop sits as one balanced spread */
.stockbook-spread {
  display: grid;
  grid-template-columns: 1fr;
  gap: clamp(1.75rem, 4vw, 2.75rem);
  padding-top: clamp(1.75rem, 4vw, 3rem);
  padding-bottom: clamp(2rem, 4vw, 3.1rem);
  align-items: center;
}

.stockbook-intro {
  max-width: 34rem;
}

.page-title {
  margin: 0;
  font-family: var(--font-display);
  font-size: clamp(2.1rem, 4.4vw, 3.05rem);
  font-weight: 700;
  line-height: 1.06;
  letter-spacing: -0.025em;
  text-wrap: balance;
  color: var(--cloth-ink);
}

.intro-lead {
  margin: 1.05rem 0 0;
  font-size: clamp(1.03rem, 1.5vw, 1.15rem);
  line-height: 1.58;
  color: var(--cloth-ink);
  opacity: 0.94;
}

.intro-note {
  margin: 0.85rem 0 0;
  font-size: 0.96rem;
  line-height: 1.52;
  color: var(--cloth-ink-muted);
}

/* Philatelic Album Plate holding the stamps */
.album-plate {
  position: relative;
  padding: clamp(1.35rem, 2.8vw, 2rem) clamp(1.1rem, 2.6vw, 1.85rem)
    clamp(1.25rem, 2.5vw, 1.65rem);
  background-color: var(--cloth-plate);
  background-image: linear-gradient(
    180deg,
    rgba(255, 252, 244, 0.04) 0%,
    rgba(0, 0, 0, 0.14) 100%
  );
  border: 1px solid var(--cloth-rule);
  border-radius: var(--radius-xs);
  box-shadow: inset 0 1px 0 rgba(244, 237, 224, 0.08);
  transition:
    background-color var(--duration-theme) var(--ease-out-expo),
    border-color var(--duration-theme) var(--ease-out-expo);
}

/* Subtle archival inner frame inside the stockbook plate */
.album-corners {
  pointer-events: none;
  position: absolute;
  inset: 6px;
  border: 1px solid rgba(244, 237, 224, 0.08);
  border-radius: 1px;
}

/* Stamp Tablist: side-by-side on mobile & desktop, cleanly supports 2, 3, or 4+ editions */
.stamp-tablist {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: clamp(0.75rem, 2.4vw, 1.75rem);
  align-items: end;
}

.stamp-tablist[data-count="3"] {
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: clamp(0.4rem, 1.6vw, 1.15rem);
}

.stamp-tablist[data-count="3"] .stamp-tab {
  padding: 0.6rem 0.55rem 0.55rem;
}

.stamp-tablist[data-count="3"] .stamp-meta {
  font-size: clamp(0.75rem, 1.75vw, 0.96rem);
  white-space: nowrap;
}

.stamp-tablist[data-count="3"] .stamp-status {
  font-size: clamp(0.68rem, 1.45vw, 0.84rem);
  white-space: nowrap;
}

.stamp-tablist[data-multi="true"] {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: clamp(0.75rem, 2vw, 1.35rem);
}

/* Individual Stamp Tab Button */
.stamp-tab {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  width: 100%;
  padding: 0.6rem 0.5rem 0.5rem;
  background: transparent;
  border: 0;
  border-radius: var(--radius-xs);
  cursor: pointer;
  text-align: center;
  -webkit-tap-highlight-color: transparent;
  transition: transform var(--duration-stamp) var(--ease-out-expo);
}

.stamp-tab:focus-visible {
  outline: 2px solid var(--focus-ring-light);
  outline-offset: 6px;
}

/* Stamp artwork frame — NO rectangular crop or box-shadow; pure alpha drop-shadow hugs every perforation tooth */
.stamp-visual {
  position: relative;
  display: flex;
  justify-content: center;
  width: 100%;
  max-width: 242px;
  padding-bottom: 0.85rem;
  transition:
    transform var(--duration-stamp) var(--ease-out-expo),
    opacity var(--duration-stamp) var(--ease-out-expo),
    filter var(--duration-stamp) var(--ease-out-expo);
}

.stamp-img {
  width: 100%;
  height: auto;
  object-fit: contain;
  user-select: none;
  -webkit-user-drag: none;
  will-change: transform, filter;
  transition:
    transform var(--duration-stamp) var(--ease-out-expo),
    filter var(--duration-stamp) var(--ease-out-expo);
}

/* ACTIVE STAMP: lifted off the stockbook cloth, razor-crisp perforations, warm deep shadow */
.stamp-tab[aria-selected="true"] .stamp-visual {
  opacity: 1;
  transform: translateY(-6px) scale(1.03) rotate(0deg);
}

.stamp-tab[aria-selected="true"] .stamp-img {
  filter:
    drop-shadow(0 18px 22px rgba(0, 0, 0, 0.54))
    drop-shadow(0 4px 8px rgba(0, 0, 0, 0.34));
}

/* INACTIVE STAMP: softly nestled into the album pocket, slight organic angle, clearly inviting a tap */
.stamp-tab[aria-selected="false"] .stamp-visual {
  opacity: 0.78;
  transform: translateY(5px) scale(0.91) rotate(-1.75deg);
}

.stamp-tab[aria-selected="false"]:nth-child(odd) .stamp-visual {
  transform: translateY(5px) scale(0.91) rotate(1.75deg);
}

.stamp-tab[aria-selected="false"] .stamp-img {
  filter:
    saturate(0.86)
    brightness(0.95)
    drop-shadow(0 6px 10px rgba(0, 0, 0, 0.36));
}

/* Hover / focus feedback on inactive stamp */
.stamp-tab[aria-selected="false"]:hover .stamp-visual,
.stamp-tab[aria-selected="false"]:focus-visible .stamp-visual {
  opacity: 1;
  transform: translateY(-3px) scale(0.97) rotate(0deg);
}

.stamp-tab[aria-selected="false"]:hover .stamp-img,
.stamp-tab[aria-selected="false"]:focus-visible .stamp-img {
  filter:
    saturate(1)
    brightness(1.02)
    drop-shadow(0 14px 18px rgba(0, 0, 0, 0.46));
}

.stamp-tab:active .stamp-visual {
  transform: translateY(-1px) scale(0.98) rotate(0deg);
}

/* UPCOMING / GREYED-OUT RESERVED STAMP SLOT (e.g. Seria 03 • 2027) */
.stamp-tab--upcoming {
  cursor: default;
}

.stamp-tab--upcoming .stamp-visual {
  opacity: 0.68;
  transform: translateY(6px) scale(0.9) rotate(1.35deg);
}

.stamp-tab--upcoming:hover .stamp-visual,
.stamp-tab--upcoming:active .stamp-visual {
  opacity: 0.68;
  transform: translateY(6px) scale(0.9) rotate(1.35deg);
}

.stamp-tab--upcoming .stamp-img {
  filter: drop-shadow(0 4px 8px rgba(0, 0, 0, 0.22));
}

.stamp-tab--upcoming:hover .stamp-img {
  filter: drop-shadow(0 4px 8px rgba(0, 0, 0, 0.22));
}

.stamp-placeholder-svg {
  display: block;
}

.placeholder-paper {
  fill: rgba(214, 219, 222, 0.14);
}

.placeholder-frame {
  stroke: rgba(226, 230, 232, 0.34);
  stroke-width: 2;
  stroke-dasharray: 7 5;
}

.placeholder-frame-inner {
  stroke: rgba(226, 230, 232, 0.2);
  stroke-width: 1.5;
}

.placeholder-year {
  font-family: var(--font-display);
  font-size: 26px;
  font-weight: 700;
  fill: rgba(235, 238, 240, 0.58);
  letter-spacing: 0.04em;
}

.placeholder-seal {
  stroke: rgba(226, 230, 232, 0.34);
  stroke-width: 2;
  stroke-dasharray: 5 4;
}

.placeholder-seal-inner {
  stroke: rgba(226, 230, 232, 0.22);
  stroke-width: 1.5;
}

.placeholder-emblem {
  fill: rgba(235, 238, 240, 0.32);
}

.placeholder-seal-text {
  font-family: var(--font-body);
  font-size: 13px;
  font-weight: 600;
  fill: rgba(235, 238, 240, 0.52);
  letter-spacing: 0.16em;
}

.placeholder-title {
  font-family: var(--font-display);
  font-size: 27px;
  font-weight: 700;
  fill: rgba(238, 240, 242, 0.8);
  letter-spacing: 0.14em;
}

.placeholder-hint {
  font-family: var(--font-body);
  font-size: 14px;
  font-weight: 600;
  fill: rgba(232, 236, 238, 0.72);
  letter-spacing: 0.1em;
}

.placeholder-series {
  font-family: var(--font-body);
  font-size: 11px;
  font-weight: 600;
  fill: rgba(226, 230, 232, 0.54);
  letter-spacing: 0.1em;
}

.stamp-tab--upcoming .stamp-caption {
  border-top-style: dashed;
  border-top-color: rgba(244, 237, 224, 0.14);
}

.stamp-tab--upcoming:hover .stamp-caption {
  border-top-color: rgba(244, 237, 224, 0.14);
}

.stamp-tab--upcoming .stamp-meta,
.stamp-tab--upcoming:hover .stamp-meta {
  color: rgba(210, 218, 224, 0.68);
}

.stamp-tab--upcoming .stamp-status,
.stamp-tab--upcoming:hover .stamp-status {
  color: rgba(210, 218, 224, 0.62);
  font-weight: 500;
}

.stamp-tab--upcoming:hover .stamp-status svg {
  transform: none;
}

/* Stamp caption plaque directly beneath each stamp */
.stamp-caption {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.22rem;
  width: 100%;
  padding-top: 0.6rem;
  border-top: 2px solid transparent;
  transition:
    border-color var(--duration-stamp) var(--ease-out-expo),
    color 200ms ease;
}

.stamp-tab[aria-selected="true"] .stamp-caption {
  border-top-color: var(--cloth-accent);
}

.stamp-tab[aria-selected="false"] .stamp-caption {
  border-top-color: var(--cloth-rule);
}

.stamp-tab[aria-selected="false"]:hover .stamp-caption {
  border-top-color: var(--cloth-rule-strong);
}

.stamp-meta {
  font-family: var(--font-display);
  font-size: clamp(0.88rem, 2.3vw, 1.02rem);
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  line-height: 1.2;
  color: var(--cloth-ink);
}

.stamp-tab[aria-selected="false"] .stamp-meta {
  color: var(--cloth-ink-muted);
}

.stamp-tab[aria-selected="false"]:hover .stamp-meta {
  color: var(--cloth-ink);
}

.stamp-status {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  font-size: clamp(0.8rem, 2vw, 0.875rem);
  font-weight: 600;
  line-height: 1.25;
  letter-spacing: 0.01em;
}

.stamp-tab[aria-selected="true"] .stamp-status {
  color: var(--cloth-accent);
}

.stamp-tab[aria-selected="false"] .stamp-status {
  color: var(--cloth-ink-muted);
  font-weight: 500;
}

.stamp-tab[aria-selected="false"]:hover .stamp-status {
  color: var(--cloth-accent);
}

.stamp-status svg {
  flex-shrink: 0;
  transition: transform 200ms var(--ease-out-expo);
}

.stamp-tab[aria-selected="false"]:hover .stamp-status svg {
  transform: translateX(3px);
}

/* ==========================================================================
   ARCHIVAL DONOR LEDGER (WARM PAPER SURFACE)
   ========================================================================== */

.ledger-section {
  background-color: var(--paper-bg);
  color: var(--paper-ink);
  padding-top: clamp(1.9rem, 4vw, 3.1rem);
  padding-bottom: clamp(3rem, 6vw, 4.75rem);
}

.ledger-section:focus {
  outline: none;
}

.ledger-panel {
  outline: none;
  transition:
    opacity 220ms var(--ease-out-expo),
    transform 260ms var(--ease-out-expo);
}

.ledger-panel:focus-visible {
  outline: 2px solid var(--focus-ring-dark);
  outline-offset: 10px;
  border-radius: var(--radius-xs);
}

.ledger-panel.is-switching {
  opacity: 0;
  transform: translateY(8px);
}

/* Ledger header: Edition identity + archival donor count + optional compact vertical Short */
.ledger-header {
  display: grid;
  grid-template-columns: 1fr;
  align-items: start;
  gap: 1.4rem 2.25rem;
  padding-bottom: clamp(1.5rem, 3vw, 2.1rem);
  border-bottom: 2px solid var(--paper-ink);
}

.ledger-identity {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  max-width: 42rem;
}

.ledger-identity-meta {
  margin-top: 1.25rem;
}

.edition-title {
  margin: 0;
  font-family: var(--font-display);
  font-size: clamp(1.85rem, 4vw, 2.75rem);
  font-weight: 700;
  line-height: 1.08;
  letter-spacing: -0.02em;
  text-wrap: balance;
  color: var(--paper-ink);
}

.edition-meta {
  margin: 0.45rem 0 0;
  font-size: 0.96rem;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  color: var(--paper-accent);
  letter-spacing: 0.015em;
}

.edition-summary {
  margin: 0.85rem 0 0;
  max-width: 60ch;
  font-size: clamp(1rem, 1.35vw, 1.08rem);
  line-height: 1.6;
  color: var(--paper-ink-muted);
}

/* Compact edition YouTube Short sitting right beside the edition title */
.edition-media {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.45rem;
  justify-self: center;
}

.edition-media[hidden] {
  display: none;
}

.video-frame {
  position: relative;
  width: 192px;
  aspect-ratio: 9 / 16;
  background-color: var(--cloth-bg);
  border: 1px solid var(--paper-rule-strong);
  border-radius: var(--radius-xs);
  overflow: hidden;
  box-shadow: 0 10px 22px rgba(0, 0, 0, 0.16);
}

.video-embed {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  border: 0;
  display: block;
}

.media-caption-link {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  padding: 0.55rem 0.75rem;
  font-size: 0.84rem;
  font-weight: 600;
  color: var(--paper-ink-muted);
  text-decoration: none;
  border-radius: var(--radius-xs);
  transition: color 160ms ease;
}

.media-caption-link:hover {
  color: var(--paper-ink);
}

.media-caption-link:focus-visible {
  outline: 2px solid var(--focus-ring-dark);
  outline-offset: 2px;
}

.media-caption-link .icon-arrow {
  flex-shrink: 0;
  transition: transform 180ms var(--ease-out-expo);
}

.media-caption-link:hover .icon-arrow {
  transform: translate(2px, -2px);
}

/* Archival postmark-style donor count plaque */
.donor-counter {
  display: inline-flex;
  align-items: baseline;
  gap: 0.55rem;
  padding: 0.9rem 1.35rem;
  background-color: var(--paper-surface);
  border: 1px solid var(--paper-rule-strong);
  outline: 1px solid var(--paper-rule);
  outline-offset: -4px;
  border-radius: var(--radius-xs);
  flex-shrink: 0;
}

.donor-counter-num {
  font-family: var(--font-display);
  font-size: clamp(1.8rem, 3vw, 2.25rem);
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  line-height: 1;
  color: var(--paper-ink);
}

.donor-counter-label {
  font-size: 0.96rem;
  font-weight: 600;
  color: var(--paper-ink-muted);
}

/* Returning donor subtle legend */
.ledger-legend {
  padding-block: 0.9rem;
  border-bottom: 1px solid var(--paper-rule);
}

.legend-item {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  font-size: 0.9rem;
  color: var(--paper-ink-muted);
}

.icon-star {
  color: var(--paper-accent);
  flex-shrink: 0;
}

/* Donor Roll — Commemorative typographic ledger (no SaaS card boxes!) */
.donor-roll {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  grid-template-columns: 1fr;
  column-gap: clamp(1.75rem, 4vw, 3.5rem);
}

.donor-item {
  display: grid;
  grid-template-columns: 2rem minmax(0, 1fr) auto;
  align-items: baseline;
  gap: 0.3rem 0.75rem;
  padding-block: 0.95rem;
  padding-inline: 0.75rem;
  border-bottom: 1px solid var(--paper-rule);
  transition: background-color 160ms ease;
}

.donor-item:hover {
  background-color: var(--paper-row-hover);
}

.donor-index {
  font-size: 0.875rem;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  color: var(--paper-ink-muted);
}

.donor-body {
  display: flex;
  flex-direction: column;
  gap: 0.14rem;
  min-width: 0;
}

.donor-name {
  font-size: 1.05rem;
  font-weight: 600;
  line-height: 1.32;
  color: var(--paper-ink);
  overflow-wrap: break-word;
}

.donor-detail {
  font-size: 0.92rem;
  line-height: 1.35;
  color: var(--paper-ink-muted);
}

.donor-streak {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  align-self: center;
  font-size: 0.8125rem;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  color: var(--paper-accent);
  white-space: nowrap;
}

/* Ledger footer: quick switch to other edition + Seria 03 collector teaser */
.ledger-footer {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 1rem 2rem;
  margin-top: clamp(1.5rem, 3vw, 2.25rem);
  padding-top: 1.35rem;
  border-top: 1px solid var(--paper-rule-strong);
}

.edition-bridge {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem 0.85rem;
}

.bridge-label {
  font-size: 0.94rem;
  color: var(--paper-ink-muted);
}

.bridge-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  padding: 0.65rem 1.15rem;
  background-color: transparent;
  border: 1.5px solid var(--paper-ink);
  border-radius: var(--radius-xs);
  font-size: 0.94rem;
  font-weight: 600;
  color: var(--paper-ink);
  cursor: pointer;
  transition:
    background-color 180ms ease,
    color 180ms ease,
    transform 180ms var(--ease-out-expo);
}

.bridge-btn:hover {
  background-color: var(--paper-ink);
  color: var(--paper-bg);
}

.bridge-btn:focus-visible {
  outline: 2px solid var(--focus-ring-dark);
  outline-offset: 3px;
}

.bridge-btn svg {
  transition: transform 180ms var(--ease-out-expo);
}

.bridge-btn:hover svg {
  transform: translateX(3px);
}

.next-edition-note {
  margin: 0;
  font-size: 0.94rem;
  color: var(--paper-ink-muted);
}

.next-edition-note strong {
  color: var(--paper-ink);
  font-weight: 600;
}

.noscript-notice {
  padding: 1.5rem;
  background: var(--paper-surface);
  border: 1px solid var(--paper-rule-strong);
  border-radius: var(--radius-xs);
}

/* ==========================================================================
   SHELTER DEDICATION BAND & EXTERNAL CTA
   ========================================================================== */

.shelter-band {
  background-color: var(--cloth-bg);
  background-image:
    repeating-linear-gradient(
      0deg,
      rgba(255, 255, 255, 0.014) 0px,
      rgba(255, 255, 255, 0.014) 1px,
      transparent 1px,
      transparent 4px
    );
  color: var(--cloth-ink);
  border-top: 1px solid var(--cloth-rule-strong);
  padding-block: clamp(2.5rem, 5.5vw, 4rem);
  transition: background-color var(--duration-theme) var(--ease-out-expo);
}

.shelter-plaque {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1.75rem 2.75rem;
  align-items: center;
  padding: clamp(1.5rem, 3.5vw, 2.5rem);
  background-color: var(--cloth-plate);
  border: 1px solid var(--cloth-rule);
  border-radius: var(--radius-xs);
  transition: background-color var(--duration-theme) var(--ease-out-expo);
}

.shelter-heading {
  margin: 0;
  font-family: var(--font-display);
  font-size: clamp(1.5rem, 3vw, 2.05rem);
  font-weight: 700;
  line-height: 1.15;
  letter-spacing: -0.015em;
  text-wrap: balance;
  color: var(--cloth-ink);
}

.shelter-text {
  margin: 0.75rem 0 0;
  max-width: 60ch;
  font-size: 1.02rem;
  line-height: 1.6;
  color: var(--cloth-ink-muted);
}

.shelter-text strong {
  color: var(--cloth-ink);
  font-weight: 600;
}

.shelter-action {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 0.55rem;
}

.shelter-cta {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.55rem;
  min-height: 52px;
  padding: 0.85rem 1.55rem;
  background-color: var(--cloth-ink);
  color: var(--cloth-bg);
  font-family: var(--font-display);
  font-size: 1.02rem;
  font-weight: 600;
  text-decoration: none;
  border-radius: var(--radius-xs);
  box-shadow: 0 10px 24px rgba(0, 0, 0, 0.28);
  transition:
    background-color 180ms ease,
    color 180ms ease,
    transform 200ms var(--ease-out-expo),
    box-shadow 200ms var(--ease-out-expo);
}

.shelter-cta:hover {
  background-color: var(--cloth-accent);
  color: var(--cloth-accent-ink);
  transform: translateY(-2px);
  box-shadow: 0 14px 28px rgba(0, 0, 0, 0.36);
}

.shelter-cta:active {
  transform: translateY(0);
}

.shelter-cta:focus-visible {
  outline: 2px solid var(--focus-ring-light);
  outline-offset: 4px;
}

.shelter-cta .icon-arrow {
  transition: transform 200ms var(--ease-out-expo);
}

.shelter-cta:hover .icon-arrow {
  transform: translate(2px, -2px);
}

.shelter-action-note {
  margin: 0;
  font-size: 0.85rem;
  color: var(--cloth-ink-muted);
}

/* ==========================================================================
   COLOPHON FOOTER
   ========================================================================== */

.site-footer {
  background-color: var(--cloth-deep);
  color: var(--cloth-ink-muted);
  border-top: 1px solid var(--cloth-rule);
  padding-block: 1.45rem;
  transition: background-color var(--duration-theme) var(--ease-out-expo);
}

.footer-inner {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 0.5rem 1.5rem;
  font-size: 0.9rem;
  text-align: center;
}

.footer-thanks {
  margin: 0;
  color: var(--cloth-ink);
  font-weight: 500;
}

/* ==========================================================================
   RESPONSIVE BREAKPOINTS
   ========================================================================== */

@media (max-width: 520px) {
  .masthead {
    padding-block: 0.85rem;
    gap: 0.5rem;
  }

  .masthead-brand {
    gap: 0.4rem;
    font-size: 0.8125rem;
  }

  .masthead-mark {
    width: 18px;
    height: 18px;
  }

  .masthead-link {
    font-size: 0.8125rem;
    gap: 0.25rem;
  }

  .stockbook-spread {
    gap: 1.35rem;
    padding-top: 1.35rem;
    padding-bottom: 1.65rem;
  }

  .intro-lead {
    margin-top: 0.75rem;
    font-size: 0.98rem;
  }

  .intro-note {
    margin-top: 0.6rem;
    font-size: 0.9rem;
  }

  .album-plate {
    padding: 1.1rem 0.9rem 1rem;
  }

  .stamp-visual {
    padding-bottom: 0.65rem;
  }

  .donor-counter {
    padding: 0.85rem 1.3rem;
  }

  .donor-item {
    grid-template-columns: 1.75rem minmax(0, 1fr);
    padding-inline: 0.75rem;
  }

  .donor-streak {
    grid-column: 2;
    justify-self: start;
    margin-top: 0.2rem;
  }

  .shelter-cta {
    width: 100%;
    padding: 0.82rem 1rem;
    font-size: 0.94rem;
    white-space: nowrap;
  }
}

@media (min-width: 760px) {
  .ledger-header.has-media {
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: center;
  }

  .ledger-header.has-media .edition-media {
    justify-self: end;
  }

  .ledger-header.has-media .video-frame {
    width: 176px;
  }

  .donor-roll {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .shelter-plaque {
    grid-template-columns: minmax(0, 1fr) auto;
  }

  .shelter-action {
    align-items: flex-end;
  }
}

@media (min-width: 960px) {
  .stockbook-spread {
    grid-template-columns: minmax(0, 0.8fr) minmax(0, 1.2fr);
    gap: clamp(2rem, 3.6vw, 3rem);
    padding-top: 2.35rem;
    padding-bottom: 2.5rem;
  }

  .stamp-visual {
    max-width: 224px;
  }
}

/* ==========================================================================
   VIEW TRANSITIONS & REDUCED MOTION
   ========================================================================== */

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  *,
  *::before,
  *::after {
    transition-duration: 0.01ms !important;
    animation-duration: 0.01ms !important;
  }

  .stamp-tab[aria-selected="false"] .stamp-visual {
    transform: translateY(2px) scale(0.93) rotate(0deg);
  }
}
