/* ═══════════════════════════════════════════════════════════════════
   YAYIN · מגזין יין ישראלי
   Design System v1.0 · 2026
   Aesthetic: Le Monde Sépharde — Classic · Literary · Restrained
   Colors: Black, Charcoal, Cream, Subtle Burgundy
   ═══════════════════════════════════════════════════════════════════ */

@import url('https://fonts.googleapis.com/css2?family=Frank+Ruhl+Libre:wght@300;400;500;700;900&family=EB+Garamond:ital,wght@0,400;0,500;1,400;1,500&family=Cormorant+Garamond:ital,wght@0,300;0,400;0,600;1,300;1,400;1,600&display=swap');

/* ── Design Tokens ─────────────────────────────────────────────────── */
:root {
  /* Neutrals */
  --ink:          #18181A;
  --charcoal:     #2D2D2B;
  --gray-dark:    #4A4A47;
  --gray:         #6B6B68;
  --gray-light:   #A5A5A2;
  --rule:         #C0BCB4;
  --pale:         #DDDAD4;
  --cream:        #F5F1EB;
  --cream-light:  #FAF8F3;
  --page-white:   #FEFCF9;

  /* Accent — very restrained burgundy */
  --wine:         #5E1220;
  --wine-mid:     #8B2030;
  --wine-pale:    #C4909A;
  --wine-tint:    #F4ECED;

  /* Cover */
  --cover-dark:   #0C0C0A;
  --cover-text:   #F2EEE6;

  /* Typography */
  --f-display:    'Frank Ruhl Libre', 'Times New Roman', serif;
  --f-serif:      'EB Garamond', 'Cormorant Garamond', Georgia, serif;
  --f-italic:     'Cormorant Garamond', 'EB Garamond', Georgia, serif;

  /* Dimensions */
  --page-w:    490px;
  --page-h:    694px;
  --margin:    34px;
  --col-gap:   18px;
  --nav-h:     50px;
}

/* ── Reset ──────────────────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { font-size: 15px; scroll-behavior: smooth; }
body {
  font-family: var(--f-display);
  background: #1A1A18;
  background-size: 100% 24px;
  color: var(--ink);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow: hidden;
  height: 100vh;
}

/* ── Navigation ─────────────────────────────────────────────────────── */
#mag-nav {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 9000;
  height: 50px;
  background: #111110;
  border-bottom: 1px solid #3A3A38;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 24px;
  gap: 16px;
  user-select: none;
}
.nav-brand {
  font-family: var(--f-display);
  font-weight: 400;
  font-size: 14px;
  letter-spacing: 4px;
  color: var(--cream);
  white-space: nowrap;
  text-transform: uppercase;
}
.nav-brand span { color: var(--wine-pale); margin: 0 6px; font-weight: 300; }
.nav-controls {
  display: flex;
  align-items: center;
  gap: 12px;
}
.nav-btn {
  background: transparent;
  border: 1px solid #555552;
  color: #C0BCB4;
  font-family: var(--f-display);
  font-size: 12px;
  letter-spacing: 2px;
  padding: 5px 16px;
  cursor: pointer;
  transition: all 0.2s;
  white-space: nowrap;
}
.nav-btn:hover:not(:disabled) {
  border-color: var(--cream);
  color: var(--cream);
}
.nav-btn:disabled { opacity: 0.25; cursor: default; }
.nav-btn.accent {
  border-color: #888;
  color: #AAA;
}
.nav-page-info {
  font-family: var(--f-display);
  font-size: 12px;
  color: #777774;
  letter-spacing: 1px;
  min-width: 120px;
  text-align: center;
  white-space: nowrap;
}
.nav-actions {
  display: flex;
  gap: 8px;
}

/* ── Stage ──────────────────────────────────────────────────────────── */
#stage {
  position: fixed;
  top: var(--nav-h);
  left: 0; right: 0; bottom: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: radial-gradient(
    ellipse 90% 80% at 50% 35%,
    #221608 0%,
    #18100A 40%,
    #0E0A04 100%
  );
  overflow: auto;
}

/* ── Zoom controls ──────────────────────────────────────────────────── */
.nav-zoom {
  display: flex;
  align-items: center;
  gap: 5px;
}
.nav-zoom-btn {
  background: transparent;
  border: 1px solid #555552;
  color: #C0BCB4;
  font-family: var(--f-display);
  font-size: 14px;
  line-height: 1;
  width: 24px;
  height: 24px;
  border-radius: 2px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: border-color 0.2s, color 0.2s;
}
.nav-zoom-btn:hover { border-color: var(--cream); color: var(--cream); }
#zoom-val {
  font-family: var(--f-display);
  font-size: 11px;
  color: #777774;
  min-width: 38px;
  text-align: center;
  cursor: pointer;
  letter-spacing: 0.5px;
}

/* ── Book Container ─────────────────────────────────────────────────── */
#book {
  position: relative;
  width: var(--page-w);
  height: var(--page-h);
  overflow: hidden;
  box-shadow:
    0  1px  4px  rgba(0,0,0,0.40),
    0  4px 16px  rgba(114,47,55,0.10),
    0 16px 48px  rgba(0,0,0,0.60),
    0 32px 80px  rgba(0,0,0,0.40),
    0 48px 100px rgba(0,0,0,0.25);
  transform-origin: center center;
  transition: transform 0.3s ease;
  perspective: 1500px;
}

/* Scale for different viewports */
@media (max-width: 1120px) { #book { transform: scale(0.86); } }
@media (max-width: 950px)  { #book { transform: scale(0.72); } }
@media (max-width: 750px)  { #book { transform: scale(0.55); } }
@media (max-width: 560px)  { #book { transform: scale(0.40); } }

/* ── Spread (two pages side by side) ───────────────────────────────── */
.spread {
  position: absolute;
  inset: 0 0 0 auto;
  width: calc(var(--page-w) * 2);
  display: grid;
  grid-template-columns: 1fr 1fr;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.01s;
}
.spread.active {
  opacity: 1;
  pointer-events: auto;
}
/* PoC: shift spread left so second child (left column) fills the visible area */
.spread.show-left {
  inset: 0 auto 0 0;
}

/* ── Individual Page ─────────────────────────────────────────────────── */
.page {
  position: relative;
  width: var(--page-w);
  height: var(--page-h);
  background: var(--page-white);
  overflow: hidden;
  flex-shrink: 0;
}
.page.page-left {
  border-right: 1px solid #E8E4DC;
}
.page.page-right {
  border-left: 1px solid #E8E4DC;
}
.page.empty {
  background: #1A1A18;
  border: none;
}

/* Center spine shadow — hidden in single-page layout */
#book::before {
  display: none;
  content: '';
  position: absolute;
  top: 0; bottom: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 16px;
  background: linear-gradient(to right,
    rgba(0,0,0,0.25) 0%,
    rgba(0,0,0,0.08) 30%,
    rgba(255,255,255,0.04) 50%,
    rgba(0,0,0,0.08) 70%,
    rgba(0,0,0,0.22) 100%
  );
  z-index: 50;
  pointer-events: none;
}

/* ── Flip Animation Overlay ─────────────────────────────────────────── */
#flipper {
  position: absolute;
  top: 0;
  height: 100%;
  width: var(--page-w);
  transform-style: preserve-3d;
  z-index: 200;
  display: none;
}
#flipper.right {
  right: 0;
  transform-origin: left center;
}
#flipper.left {
  left: 0;
  transform-origin: right center;
}
#flipper.flip-fwd {
  transform-origin: right center;
  animation: doFlipFwd 0.55s cubic-bezier(0.4, 0.01, 0.165, 0.99) forwards;
}
#flipper.flip-bwd {
  transform-origin: right center;
  animation: doFlipBwd 0.55s cubic-bezier(0.4, 0.01, 0.165, 0.99) forwards;
}
@keyframes doFlipFwd {
  0%   { transform: rotateY(0deg); }
  100% { transform: rotateY(-180deg); }
}
@keyframes doFlipBwd {
  0%   { transform: rotateY(0deg); }
  100% { transform: rotateY(180deg); }
}
.flip-face {
  position: absolute;
  inset: 0;
  backface-visibility: hidden;
  overflow: hidden;
  width: var(--page-w);
  height: var(--page-h);
  background: var(--page-white);
}
.flip-back {
  transform: rotateY(180deg);
  right: 0;
  left: auto;
}
/* Live fold shadow during animation */
#flipper.flip-fwd .flip-front::after,
#flipper.flip-bwd .flip-front::after {
  content: '';
  position: absolute;
  top: 0; right: 0; bottom: 0;
  width: 40px;
  background: linear-gradient(to left, rgba(0,0,0,0.2), transparent);
  pointer-events: none;
}

/* ── Running Head (header on inner pages) ───────────────────────────── */
.page-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px var(--margin) 0;
  border-bottom: 0.5px solid var(--rule);
  padding-bottom: 8px;
  margin-bottom: 0;
}
.page-folio {
  font-family: var(--f-display);
  font-size: 10px;
  font-weight: 400;
  color: var(--gray);
  letter-spacing: 2px;
}
.page-section {
  font-family: var(--f-display);
  font-size: 8.5px;
  font-weight: 400;
  color: var(--gray);
  letter-spacing: 3px;
  text-transform: uppercase;
}
.page-mag {
  font-family: var(--f-display);
  font-size: 10px;
  font-weight: 700;
  color: var(--wine);
  letter-spacing: 3px;
}

/* ── Inner Page Wrapper ─────────────────────────────────────────────── */
.page-body {
  padding: 0 var(--margin) var(--margin);
  height: calc(var(--page-h) - 36px);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  line-height: 1.72;
}
.page-body p {
  hanging-punctuation: first;
}

/* ── COVER PAGE ─────────────────────────────────────────────────────── */
.cover-page {
  background: var(--cover-dark);
  color: var(--cover-text);
  position: relative;
  overflow: hidden;
}
.cover-bg-img {
  position: absolute;
  inset: 0;
  background-size: cover;
  background-position: center;
}
.cover-veil {
  position: absolute;
  inset: 0;
  background: linear-gradient(
    to bottom,
    rgba(0,0,0,0.05)  0%,
    rgba(0,0,0,0.22) 45%,
    rgba(0,0,0,0.57) 100%
  );
}
.cover-content {
  position: relative;
  z-index: 2;
  height: 100%;
  display: flex;
  flex-direction: column;
  padding: 22px 28px 47px;
  text-shadow: 0 1px 3px rgba(0,0,0,0.35);
}
.cover-top-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-bottom: 14px;
  border-bottom: 0.5px solid rgba(240,234,220,0.25);
  margin-top: 15px;
  margin-bottom: 20px;
}
.cover-issue-tag {
  font-family: var(--f-display);
  font-size: 8px;
  letter-spacing: 4px;
  color: #F2F2F2;
  text-transform: uppercase;
}
.cover-price {
  font-family: var(--f-display);
  font-size: 9px;
  letter-spacing: 2px;
  color: #F2F2F2;
}
.cover-masthead {
  text-align: center;
  margin-bottom: 18px;
}
.cover-brand-line {
  font-family: var(--f-display);
  font-size: 8px;
  letter-spacing: 6px;
  color: #F4F4F4;
  text-shadow: 0 1px 4px rgba(0,0,0,0.45);
  text-transform: uppercase;
  margin-bottom: 10px;
}
.cover-title {
  font-family: var(--f-display);
  font-weight: 900;
  font-size: 88px;
  line-height: 0.88;
  letter-spacing: 12px;
  color: #F2EEE5;
  text-align: center;
  margin-bottom: 6px;
}
.cover-title-he {
  font-family: var(--f-display);
  font-weight: 300;
  font-size: 14px;
  letter-spacing: 5px;
  color: #F2F2F2;
  text-align: center;
  text-transform: uppercase;
}
.cover-rule {
  width: 48px;
  height: 0.5px;
  background: rgba(200,190,160,0.4);
  margin: 16px auto;
}
.cover-spacer { flex: 1; }
.cover-hero-box {
  border-top: 0.5px solid rgba(220,210,190,0.3);
  padding-top: 16px;
  margin-bottom: 18px;
}
.cover-hero-kicker {
  font-family: var(--f-display);
  font-size: 8px;
  letter-spacing: 4px;
  color: #F2F2F2;
  text-transform: uppercase;
  margin-bottom: 8px;
}
.cover-hero-title {
  font-family: var(--f-display);
  font-weight: 700;
  font-size: 26px;
  line-height: 1.2;
  color: #F2F2F2;
  margin-bottom: 8px;
}
.cover-hero-sub {
  font-family: var(--f-serif);
  font-style: italic;
  font-size: 13px;
  line-height: 1.55;
  color: #F2F2F2;
}
.cover-teasers {
  border-top: 0.5px solid rgba(220,210,190,0.25);
  padding-top: 14px;
}
.cover-teaser {
  font-family: var(--f-display);
  font-size: 10px;
  line-height: 1.9;
  color: #F2F2F2;
  letter-spacing: 0.3px;
}
.cover-teaser::before {
  content: '—';
  margin-left: 6px;
  color: var(--wine-pale);
  opacity: 0.7;
}
.cover-bottom-bar {
  border-top: 0.5px solid rgba(220,210,190,0.2);
  padding-top: 12px;
  margin-top: 16px;
  text-align: center;
}
.cover-contact {
  font-family: var(--f-display);
  font-size: 8px;
  letter-spacing: 2.5px;
  color: #F2F2F2;
}

/* ── BACK COVER ─────────────────────────────────────────────────────── */
.back-cover {
  background: var(--cover-dark);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 40px 30px;
}
.back-cover-logo {
  font-family: var(--f-display);
  font-weight: 900;
  font-size: 48px;
  letter-spacing: 10px;
  color: rgba(242,238,229,0.12);
  margin-bottom: 24px;
}
.back-cover-rule {
  width: 32px;
  height: 0.5px;
  background: rgba(200,190,170,0.25);
  margin: 0 auto 20px;
}
.back-cover-text {
  font-family: var(--f-display);
  font-size: 9px;
  letter-spacing: 3px;
  color: rgba(200,190,170,0.3);
  text-transform: uppercase;
  line-height: 2;
}

/* ── FULL-PAGE ADVERTISEMENT ────────────────────────────────────────── */
.ad-page {
  background: var(--cream-light);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 40px 30px;
  border: none;
}
.ad-page.dark-ad {
  background: #111110;
  color: var(--cream);
}
.ad-tag {
  position: absolute;
  top: 12px;
  left: var(--margin);
  font-family: var(--f-display);
  font-size: 7px;
  letter-spacing: 3px;
  color: var(--pale);
  text-transform: uppercase;
}
.ad-img-box {
  width: 100%;
  height: 240px;
  background: var(--pale);
  margin-bottom: 28px;
  display: flex;
  align-items: center;
  justify-content: center;
}
.ad-img-label {
  font-family: var(--f-display);
  font-size: 9px;
  letter-spacing: 3px;
  color: var(--gray-light);
  text-transform: uppercase;
}
.ad-brand {
  font-family: var(--f-display);
  font-weight: 700;
  font-size: 28px;
  letter-spacing: 6px;
  color: var(--ink);
  margin-bottom: 12px;
}
.ad-slogan {
  font-family: var(--f-serif);
  font-style: italic;
  font-size: 16px;
  color: var(--gray-dark);
  margin-bottom: 20px;
  line-height: 1.5;
}
.ad-rule { width: 32px; height: 0.5px; background: var(--rule); margin: 0 auto 18px; }
.ad-detail {
  font-family: var(--f-display);
  font-size: 9px;
  letter-spacing: 2.5px;
  color: var(--gray);
  line-height: 2.2;
}

/* ── TABLE OF CONTENTS ──────────────────────────────────────────────── */
.toc-title {
  font-family: var(--f-display);
  font-weight: 900;
  font-size: 42px;
  line-height: 0.9;
  color: var(--ink);
  margin: 16px 0 4px;
}
.toc-subtitle {
  font-family: var(--f-display);
  font-size: 9px;
  letter-spacing: 5px;
  color: var(--gray);
  text-transform: uppercase;
  margin-bottom: 20px;
}
.toc-rule { width: 100%; height: 1px; background: var(--ink); margin-bottom: 4px; }
.toc-rule-thin { width: 100%; height: 0.5px; background: var(--pale); margin-bottom: 16px; }
.toc-section-label {
  font-family: var(--f-display);
  font-size: 7.5px;
  letter-spacing: 4px;
  color: var(--wine);
  text-transform: uppercase;
  margin-top: 16px;
  margin-bottom: 10px;
  padding-bottom: 6px;
  border-bottom: 0.5px solid var(--pale);
}
.toc-item {
  display: flex;
  align-items: baseline;
  gap: 0;
  margin-bottom: 10px;
}
.toc-num {
  font-family: var(--f-display);
  font-weight: 300;
  font-size: 22px;
  color: var(--pale);
  line-height: 1;
  min-width: 38px;
  flex-shrink: 0;
}
.toc-item-info { flex: 1; }
.toc-item-title {
  font-family: var(--f-display);
  font-weight: 700;
  font-size: 12px;
  color: var(--ink);
  line-height: 1.3;
  margin-bottom: 1px;
}
.toc-item-sub {
  font-family: var(--f-serif);
  font-style: italic;
  font-size: 11px;
  color: var(--gray);
}
.toc-dot {
  flex: 1;
  height: 0.5px;
  background: var(--pale);
  margin: 0 6px;
  align-self: center;
}
.toc-page-num {
  font-family: var(--f-display);
  font-size: 11px;
  color: var(--gray);
  min-width: 20px;
  text-align: left;
}

/* ── ARTICLE TYPOGRAPHY ─────────────────────────────────────────────── */
.article-kicker {
  font-family: var(--f-display);
  font-size: 8px;
  letter-spacing: 4px;
  color: var(--wine);
  text-transform: uppercase;
  margin-bottom: 8px;
  margin-top: 18px;
}
.article-title {
  font-family: var(--f-display);
  font-weight: 900;
  font-size: 32px;
  line-height: 1.05;
  color: var(--ink);
  margin-bottom: 10px;
}
.article-title.xl {
  font-size: 44px;
  line-height: 0.96;
}
.article-title.md {
  font-size: 26px;
  line-height: 1.08;
}
.article-deck {
  font-family: var(--f-serif);
  font-style: italic;
  font-size: 15px;
  line-height: 1.6;
  color: var(--charcoal);
  margin-bottom: 14px;
  border-bottom: 0.5px solid var(--rule);
  padding-bottom: 14px;
}
.article-byline {
  font-family: var(--f-display);
  font-size: 9px;
  letter-spacing: 2px;
  color: var(--gray);
  text-transform: uppercase;
  margin-bottom: 16px;
}
.article-lead {
  font-family: var(--f-serif);
  font-size: 14.5px;
  line-height: 1.72;
  color: var(--charcoal);
  font-weight: 500;
  margin-bottom: 10px;
}
.article-body {
  font-family: var(--f-serif);
  font-size: 13px;
  line-height: 1.78;
  color: var(--charcoal);
}
.article-body p { margin-bottom: 8px; }
.article-subhead {
  font-family: var(--f-display);
  font-weight: 700;
  font-size: 13px;
  color: var(--ink);
  margin: 16px 0 6px;
  letter-spacing: 0.3px;
}
.article-subhead-italic {
  font-family: var(--f-serif);
  font-style: italic;
  font-size: 15px;
  color: var(--wine);
  margin: 14px 0 8px;
}

/* ── TWO-COLUMN LAYOUT ──────────────────────────────────────────────── */
.two-col {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--col-gap);
  flex: 1;
  min-height: 0;
}
.col { overflow: hidden; }
.col-break {
  column-count: 2;
  column-gap: var(--col-gap);
  column-rule: 0.5px solid var(--pale);
}

/* ── PULL QUOTE ─────────────────────────────────────────────────────── */
.pull-quote {
  border-top: 1.5px solid var(--ink);
  border-bottom: 0.5px solid var(--rule);
  padding: 16px 0;
  margin: 16px 0;
}
.pull-quote q {
  font-family: var(--f-italic);
  font-style: italic;
  font-size: 18px;
  line-height: 1.45;
  color: var(--wine);
  display: block;
  margin-bottom: 8px;
  quotes: none;
}
.pull-quote cite {
  font-family: var(--f-display);
  font-size: 8.5px;
  letter-spacing: 2.5px;
  color: var(--gray);
  text-transform: uppercase;
  font-style: normal;
}

/* ── DROP CAP ───────────────────────────────────────────────────────── */
.drop-cap::first-letter {
  font-family: var(--f-display);
  font-weight: 900;
  font-size: 64px;
  line-height: 0.75;
  float: right;
  margin-left: 6px;
  margin-bottom: -4px;
  color: var(--ink);
}

/* ── IMAGE PLACEHOLDER ──────────────────────────────────────────────── */
.img-ph {
  background: var(--cream);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  position: relative;
  overflow: hidden;
}
.img-ph::before {
  content: '';
  position: absolute;
  inset: 0;
  background:
    linear-gradient(135deg, var(--cream) 25%, transparent 25%) -10px 0,
    linear-gradient(225deg, var(--cream) 25%, transparent 25%) -10px 0,
    linear-gradient(315deg, var(--cream) 25%, transparent 25%),
    linear-gradient(45deg,  var(--cream) 25%, transparent 25%);
  background-color: #EDE9E1;
  background-size: 20px 20px;
  opacity: 0.5;
}
.img-ph-label {
  position: relative;
  z-index: 1;
  font-family: var(--f-display);
  font-size: 8.5px;
  letter-spacing: 3px;
  color: var(--gray-light);
  text-transform: uppercase;
  text-align: center;
  padding: 8px 16px;
}
.img-ph.full { width: 100%; height: 100%; }
.img-ph.h-sm  { height: 110px; margin-bottom: 12px; }
.img-ph.h-md  { height: 160px; margin-bottom: 12px; }
.img-ph.h-lg  { height: 220px; margin-bottom: 12px; }
.img-ph.h-xl  { height: 300px; margin-bottom: 12px; }
.img-ph.real  { background: none; }
.img-ph.real::before { display: none; }
.img-ph.real img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.caption {
  font-family: var(--f-display);
  font-size: 9px;
  line-height: 1.6;
  color: var(--gray);
  letter-spacing: 0.2px;
  border-top: 0.5px solid var(--pale);
  padding-top: 5px;
  margin-bottom: 12px;
}

/* ── MASTHEAD / CREDITS ─────────────────────────────────────────────── */
.credits-block {
  margin-bottom: 16px;
}
.credits-label {
  font-family: var(--f-display);
  font-size: 7.5px;
  letter-spacing: 4px;
  color: var(--gray-light);
  text-transform: uppercase;
  margin-bottom: 5px;
}
.credits-name {
  font-family: var(--f-display);
  font-size: 12px;
  color: var(--ink);
  line-height: 1.7;
}
.credits-divider {
  width: 100%;
  height: 0.5px;
  background: var(--pale);
  margin: 12px 0;
}

/* ── EDITOR'S LETTER ────────────────────────────────────────────────── */
.editor-letter {
  font-family: var(--f-serif);
  font-size: 13px;
  line-height: 1.82;
  color: var(--charcoal);
}
.editor-letter p { margin-bottom: 10px; }
.editor-sig {
  font-family: var(--f-italic);
  font-style: italic;
  font-size: 16px;
  color: var(--wine);
  margin-top: 16px;
}

/* ── WINE REVIEW CARD ───────────────────────────────────────────────── */
.wine-review {
  border-top: 0.5px solid var(--rule);
  padding: 12px 0;
}
.wine-review:last-child { border-bottom: 0.5px solid var(--rule); }
.wine-name {
  font-family: var(--f-display);
  font-weight: 700;
  font-size: 13px;
  color: var(--ink);
  margin-bottom: 2px;
}
.wine-info {
  font-family: var(--f-display);
  font-size: 9px;
  letter-spacing: 1.5px;
  color: var(--gray);
  text-transform: uppercase;
  margin-bottom: 6px;
}
.wine-score {
  font-family: var(--f-display);
  font-weight: 900;
  font-size: 28px;
  color: var(--wine);
  float: left;
  line-height: 1;
  margin-right: 10px;
}
.wine-note {
  font-family: var(--f-serif);
  font-style: italic;
  font-size: 12px;
  line-height: 1.65;
  color: var(--gray-dark);
}

/* ── OPENER SPREAD ──────────────────────────────────────────────────── */
.opener-page {
  background: var(--ink);
  position: relative;
  overflow: hidden;
}
.opener-page .opener-img {
  position: absolute;
  inset: 0;
  background-size: cover;
  background-position: center;
  opacity: 0.55;
}
.opener-page .opener-caption-area {
  position: absolute;
  bottom: 0;
  right: 0; left: 0;
  padding: 20px var(--margin);
  background: linear-gradient(to top, rgba(10,10,8,0.9) 0%, transparent 100%);
}
.opener-folio {
  font-family: var(--f-display);
  font-size: 8px;
  letter-spacing: 4px;
  color: rgba(240,230,210,0.4);
  text-transform: uppercase;
  margin-bottom: 6px;
}
.opener-title-big {
  font-family: var(--f-display);
  font-weight: 900;
  font-size: 52px;
  line-height: 0.92;
  color: rgba(242,238,230,0.92);
}
.opener-sub-text {
  font-family: var(--f-serif);
  font-style: italic;
  font-size: 14px;
  color: rgba(230,218,200,0.65);
  margin-top: 10px;
  line-height: 1.5;
}

/* ── UTILITY ────────────────────────────────────────────────────────── */
.rule-h { width: 100%; height: 0.5px; background: var(--rule); margin: 12px 0; }
.rule-bold { width: 100%; height: 1px; background: var(--ink); margin: 10px 0 2px; }
.rule-thin-bottom { width: 100%; height: 0.5px; background: var(--pale); margin: 4px 0 12px; }
.spacer-sm { height: 10px; }
.spacer-md { height: 20px; }
.spacer-lg { height: 36px; }
.text-center { text-align: center; }
.text-wine { color: var(--wine); }
.italic { font-style: italic; }
.bold { font-weight: 700; }
.small-caps {
  font-family: var(--f-display);
  font-size: 9px;
  letter-spacing: 3px;
  text-transform: uppercase;
  color: var(--gray);
}

/* ── FULLSCREEN ─────────────────────────────────────────────────────── */
body.fullscreen #mag-nav { display: none; }
body.fullscreen #stage {
  top: 0;
  background: radial-gradient(ellipse 80% 70% at 50% 40%, #1A100A 0%, #0E0804 100%);
}

/* ── PRINT ──────────────────────────────────────────────────────────── */
@media print {
  body { background: white; overflow: auto; height: auto; }
  #mag-nav { display: none; }
  #stage { position: static; height: auto; display: block; }
  #book { transform: none; width: auto; height: auto; box-shadow: none; }
  .spread { position: static; opacity: 1 !important; pointer-events: auto !important; display: block; }
  .page { page-break-after: always; width: 100%; height: auto; min-height: 27cm; }
  #flipper { display: none !important; }
}

/* ── MOBILE SINGLE PAGE ─────────────────────────────────────────────── */
@media (max-width: 480px) {
  /* Nav: two-row layout — row 1: brand + actions / row 2: nav controls */
  :root { --nav-h: 80px; }

  #mag-nav {
    height: auto;
    flex-wrap: wrap;
    padding: 0 14px;
    gap: 0;
    row-gap: 0;
    align-items: stretch;
  }
  .nav-brand {
    order: 1;
    flex: 1 0 auto;
    display: flex;
    align-items: center;
  }
  .nav-actions {
    order: 2;
    display: flex;
    align-items: center;
  }
  .nav-controls {
    order: 3;
    width: 100%;
    justify-content: center;
    gap: 10px;
    padding: 8px 0;
    border-top: 1px solid #1C1C1A;
  }
  .nav-zoom    { gap: 8px; }
  .nav-actions { justify-content: center; gap: 12px; }
  .nav-page-info { order: unset; min-width: 80px; }
  .nav-btn { padding: 4px 12px; }
  .nav-controls .nav-btn { padding: 5px 22px; letter-spacing: 1px; }

  /* Hide ±10 buttons */
  .nav-controls > button:first-child,
  .nav-controls > button:last-child { display: none; }

  /* Scale the entire book to viewport width via zoom (affects layout, not just
     visual rendering). Page keeps its designed 490×694 dimensions so all
     content renders at full fidelity — no text or image clipping at the bottom. */
  #stage  { overflow: hidden; padding: 0; }
  #book   {
    box-shadow: none;
    transform: none !important;
    zoom: calc(100vw / var(--page-w));
  }

  .spread:not(.active) { display: none; }
}
