/* ==========================================================================
   DOMINIC CHEN · MEDIEVAL ILLUMINATED SCRIPTORIUM (dominichen.lol)
   ========================================================================== */

:root {
  --bg-oak-deep: #110c09;
  --bg-oak-mid: #1b130e;
  --bg-oak-warm: #261b13;
  --vellum-top: #f6ecd5;
  --vellum-mid: #f0e2c3;
  --vellum-bot: #e8d5ad;
  --vellum-card: #f8efd9;
  --vellum-inset: #e5d2a7;
  --ink-primary: #231710;
  --ink-secondary: #4e3929;
  --ink-muted: #745b46;
  --rubric: #8d1b1b;
  --rubric-bright: #b02626;
  --lapis: #1b385c;
  --gold-bright: #ebd082;
  --gold-leaf: #c49337;
  --gold-deep: #7a5617;
  --border-vellum: #c7a974;
  --shadow-folio: 0 28px 70px rgba(0, 0, 0, 0.72), 0 0 0 1px rgba(201, 151, 56, 0.35);

  --font-display: 'Cinzel Decorative', 'Cinzel', 'Noto Serif SC', 'Songti SC', Georgia, serif;
  --font-heading: 'Cinzel', 'Noto Serif SC', 'Songti SC', Georgia, serif;
  --font-body: 'EB Garamond', 'Noto Serif SC', 'Songti SC', 'Source Han Serif SC', Georgia, serif;
  --font-mono: 'JetBrains Mono', ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
}

body.candle-mode {
  --vellum-top: #211812;
  --vellum-mid: #1c140f;
  --vellum-bot: #17100c;
  --vellum-card: #261c15;
  --vellum-inset: #150f0b;
  --ink-primary: #eadcc4;
  --ink-secondary: #cbb899;
  --ink-muted: #9b8668;
  --rubric: #d65545;
  --rubric-bright: #e86b5b;
  --lapis: #7fa7d8;
  --border-vellum: #6b5028;
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; font-size: 17px; }

body {
  margin: 0;
  min-height: 100vh;
  color: var(--ink-primary);
  font-family: var(--font-body);
  line-height: 1.84;
  background-color: var(--bg-oak-deep);
  background-image:
    radial-gradient(ellipse 90% 55% at 50% 0%, rgba(196, 147, 55, 0.14), transparent 68%),
    radial-gradient(circle at 12% 28%, rgba(141, 27, 27, 0.12), transparent 40%),
    radial-gradient(circle at 88% 36%, rgba(27, 56, 92, 0.14), transparent 42%),
    repeating-linear-gradient(90deg, rgba(255, 224, 170, 0.015) 0px, rgba(255, 224, 170, 0.015) 1px, transparent 1px, transparent 48px),
    linear-gradient(180deg, #120d09 0%, #19110c 45%, #100b08 100%);
  -webkit-font-smoothing: antialiased;
}

a {
  color: var(--lapis);
  text-decoration-color: rgba(196, 147, 55, 0.55);
  text-underline-offset: 3px;
  transition: color 0.18s ease, text-decoration-color 0.18s ease;
}
a:hover { color: var(--rubric); text-decoration-color: var(--rubric); }

/* ==========================================================================
   TOP ROYAL RIBBON BAR (STRICTLY 4 ITEMS)
   ========================================================================== */

.top-ribbon {
  position: sticky;
  top: 0;
  z-index: 40;
  background: linear-gradient(180deg, rgba(16, 11, 8, 0.96), rgba(24, 17, 12, 0.94));
  border-bottom: 1px solid rgba(196, 147, 55, 0.42);
  box-shadow: 0 8px 28px rgba(0, 0, 0, 0.55);
  backdrop-filter: blur(8px);
}

.top-ribbon-inner {
  max-width: 1580px;
  margin: 0 auto;
  padding: 0.68rem 1.5rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
}

.brand-crest {
  display: inline-flex;
  align-items: center;
  gap: 0.72rem;
  text-decoration: none;
  color: #f3dfb3;
}
.brand-crest:hover { color: var(--gold-bright); }

.brand-seal-mini {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: radial-gradient(circle at 32% 30%, #b52b2b, #651010 72%, #3a0606);
  border: 1.5px solid var(--gold-leaf);
  display: grid;
  place-items: center;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 0.9rem;
  color: #f4dca0;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.5), inset 0 1px 3px rgba(255, 225, 160, 0.35);
}

.brand-text-wrap { display: flex; flex-direction: column; line-height: 1.15; }
.brand-title { font-family: var(--font-display); font-size: 1rem; font-weight: 700; letter-spacing: 0.14em; color: #f2dfb3; }
.brand-domain { font-family: var(--font-heading); font-size: 0.7rem; letter-spacing: 0.14em; color: var(--gold-leaf); }

.ribbon-nav { display: flex; align-items: center; gap: 0.5rem; flex-wrap: wrap; }
.ribbon-nav a {
  color: #e4d1aa;
  text-decoration: none;
  font-family: var(--font-heading);
  font-size: 0.84rem;
  font-weight: 600;
  letter-spacing: 0.1em;
  padding: 0.42rem 0.9rem;
  border: 1px solid transparent;
  border-radius: 2px;
  transition: all 0.2s ease;
}
.ribbon-nav a:hover,
.ribbon-nav a.active {
  color: var(--gold-bright);
  border-color: rgba(196, 147, 55, 0.52);
  background: rgba(196, 147, 55, 0.12);
}

/* ==========================================================================
   THREE-COLUMN STAGE (LEFT HERALDRY + CENTRAL FOLIO + RIGHT PAINTINGS)
   ========================================================================== */

.stage-shell {
  max-width: 1580px;
  margin: 0 auto;
  padding: 2rem 1.25rem 3.5rem;
  display: grid;
  grid-template-columns: minmax(215px, 275px) minmax(0, 860px) minmax(215px, 275px);
  justify-content: center;
  align-items: start;
  gap: 1.85rem;
}

.stage-shell.no-wings { grid-template-columns: minmax(0, 860px); }
.stage-shell.no-left-wing { grid-template-columns: minmax(0, 860px) minmax(215px, 275px); }
.stage-shell.no-right-wing { grid-template-columns: minmax(215px, 275px) minmax(0, 860px); }

.margin-wing {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1.35rem;
  padding-top: 0.25rem;
}

.wing-section-head {
  width: 100%;
  text-align: center;
  padding: 0.55rem 0.6rem;
  border: 1px solid rgba(196, 147, 55, 0.35);
  background: rgba(24, 17, 12, 0.82);
}
.wing-section-kicker {
  display: block;
  font-family: var(--font-heading);
  font-size: 0.7rem;
  letter-spacing: 0.12em;
  color: var(--gold-bright);
}
.wing-section-sub {
  display: block;
  font-size: 0.75rem;
  color: rgba(235, 216, 176, 0.7);
}

.wing-card {
  width: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
}
.wing-item.is-hidden-sync {
  display: none !important;
}

.wing-ornament-svg {
  width: 100%;
  max-width: 170px;
  margin-top: 0.75rem;
  opacity: 0.85;
}

.wing-folio-label {
  font-family: var(--font-heading);
  font-size: 0.68rem;
  letter-spacing: 0.16em;
  color: rgba(235, 208, 130, 0.78);
  margin-bottom: 0.45rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}
.wing-folio-label::before,
.wing-folio-label::after {
  content: "";
  width: 16px;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(196, 147, 55, 0.65));
}
.wing-folio-label::after { background: linear-gradient(90deg, rgba(196, 147, 55, 0.65), transparent); }

/* Left Wing Heraldic Crest Frame */
.heraldic-frame,
.museum-frame {
  width: 100%;
  margin: 0;
  background: linear-gradient(145deg, #2c1e12, #170f09);
  border: 2px solid #8a6421;
  padding: 9px;
  border-radius: 3px;
  box-shadow: 0 16px 34px rgba(0, 0, 0, 0.74), inset 0 0 0 1px rgba(242, 210, 122, 0.32);
  cursor: pointer;
  transition: transform 0.25s ease, box-shadow 0.25s ease, border-color 0.25s ease;
}

.heraldic-frame:hover,
.museum-frame:hover {
  transform: translateY(-3px);
  border-color: var(--gold-bright);
  box-shadow: 0 22px 44px rgba(0, 0, 0, 0.85), 0 0 22px rgba(201, 151, 56, 0.22);
}

.heraldic-velvet {
  border: 2.5px solid #c99738;
  padding: 12px;
  background: radial-gradient(circle at 50% 42%, #3a1a17 0%, #1d100c 78%, #120a07 100%);
  display: grid;
  place-items: center;
}

.heraldic-velvet img {
  display: block;
  width: 100%;
  height: 180px;
  object-fit: contain;
  filter: drop-shadow(0 6px 14px rgba(0, 0, 0, 0.65));
}

/* Right Wing Oil Painting Frame */
.museum-mat {
  border: 3px solid #c99738;
  padding: 5px;
  background: #140d08;
  box-shadow: inset 0 0 0 1px #4f3511;
}

.museum-mat img {
  display: block;
  width: 100%;
  height: 205px;
  object-fit: cover;
  object-position: center 20%;
  filter: sepia(6%) contrast(1.03);
  transition: filter 0.28s ease;
}

.museum-frame:hover .museum-mat img {
  filter: sepia(0%) contrast(1.06) brightness(1.04);
}

.museum-plaque {
  margin-top: 8px;
  padding: 5px 8px;
  background: linear-gradient(180deg, #b88c3a, #7b5719);
  border: 1px solid #e7c873;
  border-radius: 2px;
  text-align: center;
  color: #191008;
  box-shadow: inset 0 1px 0 rgba(255, 240, 195, 0.45);
}

.museum-plaque-title {
  display: block;
  font-family: var(--font-heading);
  font-size: 0.74rem;
  font-weight: 700;
  line-height: 1.28;
}

.museum-plaque-meta {
  display: block;
  font-size: 0.71rem;
  color: #2b1b0c;
  opacity: 0.92;
}

.wing-more-plaque {
  width: 100%;
  text-align: center;
  text-decoration: none;
  padding: 0.65rem 0.8rem;
  border: 1px solid rgba(196, 147, 55, 0.55);
  background: rgba(27, 19, 14, 0.88);
  color: var(--gold-bright);
  font-family: var(--font-heading);
  font-size: 0.74rem;
  letter-spacing: 0.08em;
  transition: all 0.2s ease;
}
.wing-more-plaque:hover {
  background: rgba(141, 27, 27, 0.78);
  border-color: var(--gold-bright);
  color: #fff3d1;
}

/* ==========================================================================
   CENTRAL ILLUMINATED VELLUM FOLIO
   ========================================================================== */

.vellum-folio {
  position: relative;
  background:
    radial-gradient(circle at 18% 12%, rgba(255, 252, 240, 0.35), transparent 45%),
    radial-gradient(circle at 82% 85%, rgba(168, 128, 66, 0.12), transparent 50%),
    linear-gradient(180deg, var(--vellum-top) 0%, var(--vellum-mid) 52%, var(--vellum-bot) 100%);
  border: 1px solid var(--gold-leaf);
  border-radius: 3px;
  box-shadow: var(--shadow-folio);
  padding: 2.6rem 3rem 3.2rem;
  overflow: hidden;
}

.vellum-folio::before {
  content: "";
  position: absolute;
  inset: 11px;
  border: 1.5px solid rgba(196, 147, 55, 0.58);
  pointer-events: none;
}

.vellum-folio::after {
  content: "";
  position: absolute;
  inset: 16px;
  border: 1px solid rgba(141, 27, 27, 0.24);
  pointer-events: none;
}

.folio-corner { position: absolute; width: 34px; height: 34px; pointer-events: none; color: var(--gold-leaf); opacity: 0.9; }
.folio-corner.tl { top: 8px; left: 8px; }
.folio-corner.tr { top: 8px; right: 8px; transform: scaleX(-1); }
.folio-corner.bl { bottom: 8px; left: 8px; transform: scaleY(-1); }
.folio-corner.br { bottom: 8px; right: 8px; transform: scale(-1); }

.folio-masthead {
  text-align: center;
  padding-bottom: 1.6rem;
  margin-bottom: 1.85rem;
  border-bottom: 1px solid rgba(196, 147, 55, 0.48);
}
.folio-kicker {
  font-family: var(--font-heading);
  font-size: 0.72rem;
  letter-spacing: 0.24em;
  color: var(--rubric);
  margin-bottom: 0.45rem;
}
.folio-masthead h1 {
  margin: 0;
  font-family: var(--font-display);
  font-size: clamp(1.7rem, 3.1vw, 2.45rem);
  font-weight: 700;
  letter-spacing: 0.08em;
  color: var(--ink-primary);
  line-height: 1.24;
}
.folio-subtitle {
  margin: 0.55rem auto 0;
  max-width: 56ch;
  font-size: 1.03rem;
  color: var(--ink-secondary);
}

.folio-ornament-rule {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.9rem;
  margin-top: 1.05rem;
  color: var(--rubric);
}
.folio-ornament-rule::before,
.folio-ornament-rule::after {
  content: "";
  height: 1px;
  width: 90px;
  background: linear-gradient(90deg, transparent, var(--gold-leaf));
}
.folio-ornament-rule::after { background: linear-gradient(90deg, var(--gold-leaf), transparent); }

.hero-notice-scroll {
  padding: 0.75rem 1.1rem;
  margin-bottom: 1.4rem;
  background: rgba(141, 27, 27, 0.08);
  border: 1px solid rgba(196, 147, 55, 0.6);
  border-left: 4px solid var(--rubric);
  font-size: 0.95rem;
}

.chronicle-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
  margin-bottom: 1.8rem;
  padding-bottom: 1.1rem;
  border-bottom: 1px dashed rgba(122, 86, 23, 0.32);
}

.category-tabs { display: flex; flex-wrap: wrap; gap: 0.45rem; }
.cat-tab {
  font-family: var(--font-heading);
  font-size: 0.76rem;
  letter-spacing: 0.06em;
  text-decoration: none;
  padding: 0.36rem 0.78rem;
  border: 1px solid var(--border-vellum);
  color: var(--ink-secondary);
  background: rgba(255, 250, 238, 0.38);
  border-radius: 2px;
  transition: all 0.2s ease;
}
body.candle-mode .cat-tab { background: rgba(255, 235, 195, 0.05); }
.cat-tab:hover, .cat-tab.active { background: var(--rubric); color: #f9eed4; border-color: var(--rubric); }

.search-scroll {
  display: flex;
  align-items: center;
  border: 1px solid var(--border-vellum);
  background: rgba(255, 250, 238, 0.45);
  border-radius: 2px;
  overflow: hidden;
}
body.candle-mode .search-scroll { background: rgba(0, 0, 0, 0.25); }
.search-scroll input { border: 0; background: transparent; padding: 0.38rem 0.68rem; font-family: var(--font-body); font-size: 0.9rem; color: var(--ink-primary); width: 175px; outline: none; }
.search-scroll button { border: 0; border-left: 1px solid var(--border-vellum); background: rgba(196, 147, 55, 0.16); color: var(--ink-primary); font-family: var(--font-heading); font-size: 0.74rem; padding: 0.42rem 0.75rem; cursor: pointer; }

.chronicle-list { display: flex; flex-direction: column; gap: 1.6rem; }
.chronicle-card {
  position: relative;
  padding: 1.45rem 1.65rem;
  background: var(--vellum-card);
  border: 1px solid rgba(196, 147, 55, 0.55);
  box-shadow: 0 6px 20px rgba(42, 26, 12, 0.08);
  transition: transform 0.22s ease, box-shadow 0.22s ease, border-color 0.22s ease;
}
.chronicle-card:hover { transform: translateY(-2px); border-color: var(--rubric); box-shadow: 0 12px 26px rgba(42, 26, 12, 0.15); }
.chronicle-card.featured {
  border-left: 4px solid var(--rubric);
  background: linear-gradient(135deg, rgba(196, 147, 55, 0.12), transparent 45%), var(--vellum-card);
}

.card-meta-line {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.55rem 1rem;
  font-family: var(--font-heading);
  font-size: 0.73rem;
  letter-spacing: 0.05em;
  color: var(--ink-muted);
  margin-bottom: 0.45rem;
}
.card-badge-rubric { color: var(--rubric); font-weight: 700; }
.card-title { margin: 0 0 0.4rem; font-family: var(--font-heading); font-size: 1.36rem; font-weight: 700; line-height: 1.35; }
.card-title a { color: var(--ink-primary); text-decoration: none; }
.card-title a:hover { color: var(--rubric); }
.card-subtitle { font-style: italic; color: var(--ink-secondary); margin: 0 0 0.7rem; font-size: 0.98rem; }
.card-excerpt { margin: 0 0 1rem; color: var(--ink-secondary); font-size: 0.98rem; }

.card-footer-line {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 0.65rem;
  padding-top: 0.75rem;
  border-top: 1px dotted rgba(122, 86, 23, 0.35);
}
.tag-row { display: flex; flex-wrap: wrap; gap: 0.4rem; }
.tag-pill {
  font-family: var(--font-heading);
  font-size: 0.68rem;
  padding: 0.14rem 0.5rem;
  border: 1px solid rgba(196, 147, 55, 0.52);
  color: var(--ink-secondary);
  background: rgba(196, 147, 55, 0.09);
  border-radius: 2px;
}
.read-folio-link { font-family: var(--font-heading); font-size: 0.78rem; font-weight: 700; color: var(--rubric); text-decoration: none; }

.pagination-scroll {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 1rem;
  margin-top: 2rem;
}
.page-indicator { font-family: var(--font-heading); font-size: 0.82rem; color: var(--ink-secondary); }

/* ==========================================================================
   ARTICLE VIEW, MEDIA EMBEDS (IMAGE / VIDEO / EXTERNAL LINKS)
   ========================================================================== */

.article-header { text-align: center; padding-bottom: 1.5rem; margin-bottom: 1.8rem; border-bottom: 1px solid rgba(196, 147, 55, 0.48); }
.article-header h1 { margin: 0.45rem 0 0.6rem; font-family: var(--font-heading); font-size: clamp(1.55rem, 2.8vw, 2.2rem); line-height: 1.3; color: var(--ink-primary); }

.toc-scroll { margin: 0 0 2rem; padding: 1rem 1.3rem; background: rgba(196, 147, 55, 0.09); border: 1px solid rgba(196, 147, 55, 0.5); border-left: 3px solid var(--gold-leaf); }
.toc-title { font-family: var(--font-heading); font-size: 0.78rem; letter-spacing: 0.14em; color: var(--rubric); margin: 0 0 0.5rem; }
.toc-list { margin: 0; padding-left: 1.15rem; font-size: 0.94rem; }
.toc-list li.lvl-3 { margin-left: 1rem; font-size: 0.88rem; }

.folio-prose { max-width: 68ch; margin: 0 auto; font-size: 1.05rem; }
.folio-prose > p:first-of-type::first-letter {
  float: left;
  font-family: var(--font-display);
  font-size: 3.1rem;
  line-height: 0.88;
  padding: 0.35rem 0.58rem 0.25rem;
  margin: 0.12rem 0.65rem 0.1rem 0;
  color: #f9eed4;
  background: linear-gradient(145deg, #9c2222, #631010);
  border: 2px solid var(--gold-leaf);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.25);
}

.folio-prose h2, .folio-prose h3, .folio-prose h4 { font-family: var(--font-heading); color: var(--ink-primary); margin-top: 2.1rem; margin-bottom: 0.75rem; line-height: 1.35; }
.folio-prose h2 { font-size: 1.4rem; padding-bottom: 0.35rem; border-bottom: 1px solid rgba(196, 147, 55, 0.42); }
.folio-prose h2::before { content: "§ "; color: var(--rubric); }
.folio-prose h3 { font-size: 1.16rem; color: var(--rubric); }
.folio-prose p { margin: 0 0 1.2rem; }
.folio-prose code { font-family: var(--font-mono); font-size: 0.84em; padding: 0.12em 0.38em; background: rgba(122, 86, 23, 0.13); border: 1px solid rgba(122, 86, 23, 0.25); border-radius: 2px; color: var(--rubric); }

.code-scroll { margin: 1.45rem 0; border: 1px solid #6b4e22; background: #1a130e; border-radius: 3px; overflow: hidden; box-shadow: 0 10px 24px rgba(0, 0, 0, 0.25); }
.code-scroll-bar { display: flex; align-items: center; justify-content: space-between; padding: 0.35rem 0.85rem; background: #271c14; border-bottom: 1px solid #59401a; font-family: var(--font-heading); font-size: 0.7rem; color: var(--gold-bright); }
.copy-btn { appearance: none; background: rgba(196, 147, 55, 0.14); border: 1px solid rgba(196, 147, 55, 0.45); color: #f2dfb3; font-family: var(--font-heading); font-size: 0.68rem; padding: 0.16rem 0.55rem; cursor: pointer; }
.code-scroll pre { margin: 0; padding: 1rem 1.15rem; overflow-x: auto; }
.code-scroll pre code { background: transparent; border: 0; padding: 0; color: #ecdcb9; font-size: 0.84rem; line-height: 1.62; }

.illuminated-quote { margin: 1.6rem 0; padding: 1rem 1.35rem; background: rgba(141, 27, 27, 0.06); border-left: 4px solid var(--rubric); border-top: 1px solid rgba(196, 147, 55, 0.35); border-bottom: 1px solid rgba(196, 147, 55, 0.35); font-style: italic; color: var(--ink-secondary); }
.illuminated-quote p:last-child { margin-bottom: 0; }
.folio-list { margin: 0 0 1.25rem; padding-left: 1.5rem; }
.folio-list li { margin-bottom: 0.4rem; }

.table-wrap { overflow-x: auto; margin: 1.4rem 0; }
.vellum-table { width: 100%; border-collapse: collapse; font-size: 0.93rem; }
.vellum-table th, .vellum-table td { padding: 0.62rem 0.85rem; border: 1px solid var(--border-vellum); text-align: left; }
.vellum-table th { font-family: var(--font-heading); font-size: 0.78rem; background: rgba(196, 147, 55, 0.18); color: var(--ink-primary); }

.folio-divider { text-align: center; margin: 2rem 0; color: var(--rubric); font-size: 1.1rem; display: flex; align-items: center; gap: 1rem; }
.folio-divider::before, .folio-divider::after { content: ""; flex: 1; height: 1px; background: linear-gradient(90deg, transparent, var(--gold-leaf), transparent); }

.folio-figure { margin: 1.55rem 0; text-align: center; }
.folio-figure img,
.folio-figure video { max-width: 100%; border: 2px solid var(--gold-leaf); padding: 4px; background: #1b130e; border-radius: 2px; }
.folio-figure figcaption { font-size: 0.86rem; font-style: italic; color: var(--ink-muted); margin-top: 0.45rem; }
.video-aspect { position: relative; padding-bottom: 56.25%; height: 0; overflow: hidden; border: 2px solid var(--gold-leaf); background: #000; }
.video-aspect iframe { position: absolute; inset: 0; width: 100%; height: 100%; }

.seal-action-box { margin: 2.2rem auto 0; max-width: 68ch; padding: 1.2rem 1.4rem; border-top: 1px solid rgba(196, 147, 55, 0.45); border-bottom: 1px solid rgba(196, 147, 55, 0.45); display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 1rem; }
.seal-btn { appearance: none; display: inline-flex; align-items: center; gap: 0.55rem; background: linear-gradient(145deg, #9c2222, #641010); color: #f7e3b2; border: 1.5px solid var(--gold-leaf); font-family: var(--font-heading); font-size: 0.78rem; padding: 0.55rem 1.1rem; border-radius: 2px; cursor: pointer; }
.post-nav-grid { max-width: 68ch; margin: 1.8rem auto 0; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1rem; }
.post-nav-card { padding: 0.85rem 1rem; border: 1px solid rgba(196, 147, 55, 0.48); background: var(--vellum-card); text-decoration: none; color: var(--ink-primary); }
.post-nav-card small { display: block; font-family: var(--font-heading); font-size: 0.7rem; color: var(--rubric); }

/* ==========================================================================
   GALLERY (HERALDRY + PAINTINGS FULL CATALOG)
   ========================================================================== */

.gallery-jump-bar { display: flex; flex-wrap: wrap; gap: 0.65rem; justify-content: center; margin-bottom: 1.8rem; }
.gallery-sec-heading { font-family: var(--font-heading); font-size: 1.38rem; color: var(--ink-primary); border-bottom: 1px solid rgba(196, 147, 55, 0.5); padding-bottom: 0.4rem; margin: 0 0 0.6rem; }
.gallery-sec-intro { color: var(--ink-secondary); margin: 0 0 1.3rem; font-size: 0.96rem; }

.gallery-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1.45rem; }
.gallery-item { background: #1a120d; border: 2px solid var(--gold-leaf); padding: 12px; color: #ebd9b4; cursor: pointer; transition: transform 0.22s ease, border-color 0.22s ease; }
.gallery-item:hover { transform: translateY(-3px); border-color: var(--gold-bright); }
.gallery-rank-pill { font-family: var(--font-heading); font-size: 0.7rem; color: var(--gold-bright); margin-bottom: 0.45rem; letter-spacing: 0.06em; }
.gallery-item img { width: 100%; height: 245px; object-fit: cover; object-position: center 20%; display: block; border: 2px solid #8a6421; }
.gallery-heraldry-stage { background: radial-gradient(circle at 50% 42%, #3a1a17, #130b08); border: 2px solid #8a6421; padding: 14px; display: grid; place-items: center; }
.gallery-heraldry-stage img { border: 0; height: 205px; object-fit: contain; }
.gallery-item-body { padding: 0.8rem 0.2rem 0.2rem; }
.gallery-item-body h3 { margin: 0 0 0.2rem; font-family: var(--font-heading); font-size: 1.02rem; color: var(--gold-bright); }
.gallery-item-meta { font-size: 0.82rem; color: #c8b288; margin-bottom: 0.35rem; }
.gallery-blazon-line { font-size: 0.8rem; color: #e2c789; margin-bottom: 0.4rem; }
.gallery-item-note { font-size: 0.87rem; color: #dfd0b1; margin: 0; line-height: 1.56; }

/* ==========================================================================
   ADMIN / SCRIPTORIUM WORKBENCH
   ========================================================================== */

.admin-nav-bar { display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 0.75rem; margin-bottom: 1.5rem; padding-bottom: 1rem; border-bottom: 1px solid rgba(196, 147, 55, 0.4); }
.admin-nav-links { display: flex; flex-wrap: wrap; gap: 0.5rem; }
.admin-box { display: flex; flex-direction: column; gap: 1rem; }
.admin-subhead { font-family: var(--font-heading); font-size: 1.08rem; color: var(--rubric); border-bottom: 1px dashed rgba(196, 147, 55, 0.5); padding-bottom: 0.3rem; margin: 0.8rem 0 0.5rem; }
.admin-subpanel { padding: 1.1rem; border: 1px solid var(--border-vellum); background: rgba(196, 147, 55, 0.08); margin-bottom: 1rem; }
.admin-grid-2 { display: grid; grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); gap: 0.85rem; }
.admin-grid-3 { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 0.85rem; }
.admin-checks { display: flex; flex-direction: column; gap: 0.45rem; padding: 0.75rem 1rem; border: 1px solid rgba(196, 147, 55, 0.4); background: rgba(255, 250, 238, 0.32); }
body.candle-mode .admin-checks { background: rgba(0, 0, 0, 0.2); }
.admin-checks label { display: flex; align-items: center; gap: 0.5rem; font-size: 0.94rem; cursor: pointer; }

.form-field { display: flex; flex-direction: column; gap: 0.3rem; margin-bottom: 0.75rem; }
.form-field label { font-family: var(--font-heading); font-size: 0.76rem; color: var(--ink-secondary); }
.form-field input, .form-field select, .form-field textarea { font-family: var(--font-body); font-size: 0.98rem; padding: 0.52rem 0.7rem; border: 1px solid var(--border-vellum); background: rgba(255, 252, 245, 0.78); color: var(--ink-primary); border-radius: 2px; }
body.candle-mode .form-field input, body.candle-mode .form-field select, body.candle-mode .form-field textarea { background: rgba(18, 12, 8, 0.78); color: #f1e3c7; }
.form-field textarea.md-editor { font-family: var(--font-mono); font-size: 0.85rem; min-height: 340px; line-height: 1.56; }

.editor-toolbar { display: flex; flex-wrap: wrap; align-items: center; gap: 0.4rem; padding: 0.55rem 0.65rem; border: 1px solid var(--border-vellum); background: rgba(196, 147, 55, 0.14); }
.tool-btn { appearance: none; border: 1px solid var(--border-vellum); background: var(--vellum-card); color: var(--ink-primary); font-family: var(--font-heading); font-size: 0.72rem; padding: 0.32rem 0.65rem; cursor: pointer; border-radius: 2px; }
.tool-btn.tool-accent { background: #7f1b1b; color: #f8e9c6; border-color: var(--gold-leaf); }
.tool-btn:hover { opacity: 0.9; }
.upload-status-msg { font-size: 0.82rem; color: var(--rubric); margin-left: 0.4rem; }

.btn-royal { appearance: none; background: linear-gradient(145deg, #9c2222, #631010); color: #f9eed4; border: 1px solid var(--gold-leaf); font-family: var(--font-heading); font-size: 0.78rem; padding: 0.52rem 1.15rem; cursor: pointer; text-decoration: none; display: inline-block; }
.btn-secondary { appearance: none; background: rgba(196, 147, 55, 0.16); color: var(--ink-primary); border: 1px solid var(--border-vellum); font-family: var(--font-heading); font-size: 0.76rem; padding: 0.48rem 0.92rem; cursor: pointer; text-decoration: none; display: inline-block; }
.btn-secondary.active-btn { background: var(--rubric); color: #f9eed4; border-color: var(--rubric); }
.flash-banner { padding: 0.75rem 1rem; border: 1px solid var(--gold-leaf); background: rgba(196, 147, 55, 0.2); margin-bottom: 1.2rem; font-weight: 600; }

/* ==========================================================================
   LIGHTBOX & FOOTER & RESPONSIVE
   ========================================================================== */

.curator-lightbox { position: fixed; inset: 0; z-index: 90; background: rgba(10, 7, 5, 0.92); backdrop-filter: blur(6px); display: none; align-items: center; justify-content: center; padding: 1.5rem; }
.curator-lightbox.open { display: flex; }
.lightbox-dialog { max-width: 820px; width: 100%; background: #1a120d; border: 2px solid var(--gold-leaf); padding: 1.2rem; box-shadow: 0 30px 90px rgba(0, 0, 0, 0.9); color: #efe2c3; position: relative; }
.lightbox-close { position: absolute; top: 0.7rem; right: 0.85rem; background: rgba(141, 27, 27, 0.85); color: #f8e9c6; border: 1px solid var(--gold-leaf); font-family: var(--font-heading); padding: 0.25rem 0.6rem; cursor: pointer; }
.lightbox-dialog img { display: block; width: 100%; max-height: 62vh; object-fit: contain; background: #0d0805; border: 2px solid #8a6421; }
.lightbox-caption { padding-top: 0.9rem; }
.lightbox-caption h3 { margin: 0 0 0.25rem; font-family: var(--font-heading); color: var(--gold-bright); }
.lightbox-caption .lb-meta { color: #cbb68f; margin-bottom: 0.45rem; font-size: 0.9rem; }

.folio-colophon { margin-top: 2.5rem; padding-top: 1.35rem; border-top: 1px solid rgba(196, 147, 55, 0.45); text-align: center; font-size: 0.86rem; color: var(--ink-muted); }
.folio-colophon strong { font-family: var(--font-heading); color: var(--ink-secondary); }

.mobile-heraldry-strip { display: none; }

@media (max-width: 1180px) {
  .stage-shell, .stage-shell.no-left-wing, .stage-shell.no-right-wing {
    grid-template-columns: minmax(0, 840px);
    padding: 1.25rem 0.85rem 2.5rem;
  }
  .margin-wing { display: none; }
  .mobile-heraldry-strip { display: flex; gap: 0.9rem; overflow-x: auto; padding: 0.25rem 0 1.2rem; margin-bottom: 1rem; }
  .mobile-heraldry-strip .museum-frame,
  .mobile-heraldry-strip .heraldic-frame { min-width: 180px; max-width: 180px; }
  .mobile-heraldry-strip .museum-mat img,
  .mobile-heraldry-strip .heraldic-velvet img { height: 115px; }
}

@media (max-width: 680px) {
  .vellum-folio { padding: 1.7rem 1.2rem 2.2rem; }
  .gallery-grid, .post-nav-grid { grid-template-columns: 1fr; }
  .top-ribbon-inner { padding: 0.55rem 0.9rem; }
}
