/* ════════════════════════════════════════════════════════════════════════
   MEZCAL MACHETAZO — Ficha Técnica / Technical Sheet
   Screen-elegant, print-ready. One sheet = one PDF page (US Letter).
   ════════════════════════════════════════════════════════════════════════ */

*, *::before, *::after { -webkit-hyphens: none !important; hyphens: none !important; box-sizing: border-box; }

/* ────────── Fonts (relative to fichas/ so they resolve in both contexts) ────────── */
@font-face {
  font-family: "Caudex";
  src: url("../assets/fonts/Caudex/Caudex-Regular.ttf") format("truetype");
  font-weight: 400; font-style: normal; font-display: swap;
}
@font-face {
  font-family: "Caudex";
  src: url("../assets/fonts/Caudex/Caudex-Italic.ttf") format("truetype");
  font-weight: 400; font-style: italic; font-display: swap;
}
@font-face {
  font-family: "Caudex";
  src: url("../assets/fonts/Caudex/Caudex-Bold.ttf") format("truetype");
  font-weight: 700; font-style: normal; font-display: swap;
}
@font-face {
  font-family: "DIN Neuzeit";
  src: url("../assets/fonts/din-neuzeit-bold-cond.otf") format("opentype");
  font-weight: 700; font-style: normal; font-display: swap;
}

/* ────────── Tokens ────────── */
:root {
  --paper:        #f1f1f0;   /* light cool neutral — distinct from Tres Ese cream */
  --paper-soft:   #e7e7e6;
  --paper-warm:   #f9f9f8;
  --ink:          #1b1b1c;   /* neutral near-black */
  --ink-soft:     #46474b;
  --muted:        #8d8e92;
  --line:         #d7d7d8;

  --c-guerrero:   #c8392c;
  --c-oaxaca:     #c8923a;
  --c-slp:        #4a7a3d;
  --accent:       var(--c-guerrero);  /* default — overridden per region body class */

  --serif: "Caudex", "Cormorant Garamond", Georgia, serif;
  --sans:  "DIN Neuzeit", "Oswald", "Bebas Neue", sans-serif;
}

.region--guerrero { --accent: var(--c-guerrero); }
.region--oaxaca   { --accent: var(--c-oaxaca); }
.region--slp      { --accent: var(--c-slp); }

/* ────────── Page surroundings (screen) ────────── */
body {
  margin: 0;
  background: #1a1a1b;
  color: var(--ink);
  font-family: var(--serif);
  font-size: 11pt;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  padding: 2rem 1rem 4rem;
  display: flex;
  justify-content: center;
}

/* ────────── Print toolbar (screen only) ────────── */
.sheet-toolbar {
  position: fixed;
  top: 1.25rem; right: 1.25rem;
  display: flex; gap: .5rem;
  z-index: 10;
}
.sheet-toolbar a,
.sheet-toolbar button {
  background: var(--paper);
  color: var(--ink);
  border: 0;
  padding: .8rem 1.2rem;
  font-family: var(--sans);
  font-size: .72rem;
  letter-spacing: .22em;
  text-transform: uppercase;
  text-decoration: none;
  cursor: pointer;
  border-radius: 1px;
  transition: background .25s ease, color .25s ease;
}
.sheet-toolbar a:hover,
.sheet-toolbar button:hover { background: var(--accent); color: var(--paper); }

/* ────────── The sheet — US Letter (8.5 × 11 in) ────────── */
.sheet {
  width: 100%;
  max-width: 8.5in;
  height: 11in;             /* lock to US Letter so the absolutely-positioned bottle lands at the same y on every ficha (screen + print) */
  background: var(--paper);
  color: var(--ink);
  padding: 10mm 14mm 8mm;
  box-shadow: 0 40px 80px -20px rgba(0,0,0,.55);
  display: flex;
  flex-direction: column;
  position: relative;
  overflow: hidden;
  background-image:
    url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='240' height='240'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='2' stitchTiles='stitch'/><feColorMatrix values='0 0 0 0 .1  0 0 0 0 .1  0 0 0 0 .1  0 0 0 .05 0'/></filter><rect width='100%25' height='100%25' filter='url(%23n)'/></svg>");
  background-size: 240px 240px;
}
/* Decorative hairline border */
.sheet::before {
  content: "";
  position: absolute;
  top: 7mm; left: 7mm; right: 7mm; bottom: 5mm;
  border: 1px solid var(--line);
  pointer-events: none;
}
/* Accent corner mark — top-right */
.sheet::after {
  content: "";
  position: absolute;
  top: 7mm; right: 7mm;
  width: 18mm; height: 1px;
  background: var(--accent);
}

/* ────────── Header ────────── */
.sheet-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin: 0 0 5mm;
  padding: 2.5mm 0 2.5mm;    /* symmetric so the logo centers in the header band */
  border-bottom: 1px solid var(--line);
}
.brand-block {
  display: flex;
  align-items: center;
  gap: 4mm;
  line-height: 1;
}
.brand-block .brand-logo {
  height: 17mm;
  width: auto;
  display: block;
}
.brand-block .brand-text {
  border-left: 1px solid var(--line);
  padding-left: 4mm;
  display: flex;
  flex-direction: column;
  gap: 0.5mm;
}
.brand-block .brand-word {
  font-family: var(--sans);
  font-size: 10pt;
  letter-spacing: .32em;
  text-transform: uppercase;
  color: var(--ink);
  line-height: 1;
}
.brand-block .brand-tagline {
  font-family: var(--serif);
  font-style: italic;
  font-size: 9pt;
  letter-spacing: .04em;
  color: var(--ink-soft);
  line-height: 1;
}
.sheet-meta {
  text-align: right;
  line-height: 1.3;
}
.sheet-meta .doc-type {
  font-family: var(--sans);
  font-size: 7pt;
  letter-spacing: .32em;
  text-transform: uppercase;
  color: var(--accent);
  display: block;
}
.sheet-meta .doc-region {
  font-family: var(--serif);
  font-style: italic;
  font-size: 14pt;
  color: var(--ink);
  display: block;
  margin-top: 1.5mm;
}
.sheet-meta .doc-edition {
  font-family: var(--sans);
  font-size: 7pt;
  letter-spacing: .18em;
  text-transform: uppercase;
  color: var(--muted);
  margin-top: 2mm;
  display: block;
}

/* ────────── Body — content only; bottle is a full-height bleed band ────────── */
.sheet-body {
  flex: 0 0 auto;
  margin: 0;
  padding-left: 58mm;        /* clear the bottle band — tightened gutter (~10mm to bottle) */
  min-height: 0;
}

/* Bottle bleeds as a tall band down the left side of the whole sheet.
   _Light PNGs are shot for light backgrounds so the glass reads clear. */
.sheet-bottle {
  position: absolute;
  left: 8mm;                 /* nudged ~1% left total */
  bottom: 42mm;              /* visible base sits a bit closer to the motto top hairline — ~9 mm on salmiana-es, ~14 mm on the others */
  width: 64mm;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  z-index: 1;
}
:lang(en) .sheet-bottle { bottom: 50mm; }  /* EN only — small lift, baby step */
.sheet-bottle img {
  position: relative;
  z-index: 1;                /* above the shadow */
  width: auto;
  height: auto;
  max-height: 164mm;         /* shrunk 1%; base stays put (bottom-anchored) */
  max-width: 100%;
  object-fit: contain;
  display: block;
}
/* Soft contact shadow — sits just below the visible glass base, wider than the
   bottle so it reads as a grounded pool (the trimmed PNG leaves ~3mm clear). */
.sheet-bottle::after {
  content: "";
  position: absolute;
  left: 50%;
  bottom: 1.5mm;             /* just below the visible base so it peeks out, not hidden behind the glass */
  transform: translateX(-50%);
  width: 52mm;               /* wider than the bottle so the pool shows around the base */
  height: 4mm;
  background: radial-gradient(ellipse 50% 100% at 50% 50%,
    rgba(0,0,0,.22) 0%,
    rgba(0,0,0,.10) 50%,
    transparent 78%);
  filter: blur(4pt);
  z-index: 0;                /* behind the bottle, above the paper */
}
/* Header spans full width (brand top-left, meta top-right) — the shorter bottle
   no longer reaches up into the header zone. Motto stays in the right column
   beside the bottle's upper body. */
.sheet-motto { margin-left: 58mm; }

.sheet-content {
  display: flex;
  flex-direction: column;
  gap: 4mm;
  min-height: 0;
}

/* ────────── Headline ────────── */
.sheet-region {
  font-family: var(--sans);
  font-size: 7.5pt;
  letter-spacing: .32em;
  text-transform: uppercase;
  color: var(--accent);
  margin: 0 0 1.5mm;
  display: flex;
  align-items: center;
  gap: 3mm;
}
.sheet-region::before {
  content: "";
  width: 4mm;
  height: 1px;
  background: var(--accent);
}
.sheet-h1 {
  font-family: var(--serif);
  font-weight: 400;
  font-size: 22pt;
  line-height: 1;
  margin: 0;                /* agave name aligns flush with the paragraph below */
  color: var(--ink);
}
.sheet-h1 em {
  font-style: italic;
  color: var(--ink-soft);
  display: block;
  padding-left: 7mm;        /* only the italic varietal stays indented */
  font-size: .9em;
  margin-top: 1mm;
}

.sheet-lede {
  font-family: var(--serif);
  font-style: italic;
  font-size: 10pt;
  color: var(--ink-soft);
  line-height: 1.4;
  margin: 0;
  text-align: justify;
  text-wrap: pretty;
}

/* ────────── Section titles ────────── */
.sheet-section-title {
  font-family: var(--sans);
  font-size: 7pt;
  letter-spacing: .28em;
  text-transform: uppercase;
  color: var(--accent);
  margin: 0 0 2mm;
  padding-bottom: 1.2mm;
  border-bottom: 1px solid var(--line);
}

/* ────────── Tasting notes ────────── */
.sheet-tasting {
  margin: 0;
  font-family: var(--serif);
  font-style: italic;
  font-size: 10pt;
  color: var(--ink-soft);
  line-height: 1.4;
}

/* ────────── Spec grid — 2 columns × N rows ────────── */
.sheet-specs {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.5mm;
  margin: 0;
  padding: 0;
  list-style: none;
}
.sheet-specs li {
  display: flex;
  flex-direction: column;
  gap: .3mm;
  padding: 1.5mm 2.5mm;
  border: 1px solid var(--line);
  background: var(--paper-warm);
}
.sheet-specs li.spec-full { grid-column: 1 / -1; }
.sheet-specs li.spec-full strong { color: var(--accent); font-style: italic; }

.sheet-specs span {
  font-family: var(--sans);
  font-size: 6pt;
  letter-spacing: .22em;
  text-transform: uppercase;
  color: var(--muted);
}
.sheet-specs strong {
  font-family: var(--serif);
  font-weight: 400;
  font-size: 9.5pt;
  color: var(--ink);
}

/* ────────── Origin block ────────── */
.sheet-origin {
  margin-top: 0;
  padding: 3mm 4mm;
  background: var(--paper-soft);
  border-left: 3px solid var(--accent);
}
.sheet-origin p {
  margin: 0;
  font-family: var(--serif);
  font-size: 9pt;
  color: var(--ink-soft);
  line-height: 1.45;
  text-align: justify;
  text-wrap: pretty;
}
.sheet-origin strong { color: var(--ink); font-weight: 400; }
.sheet-origin em     { color: var(--accent); font-style: italic; }

/* ────────── Motto (closing quote) ──────────
   Lives directly after .sheet-body, so its top border is a single full-width
   line spanning the whole sheet — the bottle's base rests on it. */
.sheet-motto {
  font-family: var(--serif);
  font-style: italic;
  font-size: 11pt;
  text-align: center;
  color: var(--ink-soft);
  margin: 0;
  padding: 7mm 0 7mm;        /* balanced top/bottom so the quote centers in the space */
  border-top: 1px solid var(--line);
  position: relative;
}
.sheet-motto::before {
  content: "❝";
  display: block;
  color: var(--accent);
  font-style: normal;
  font-size: 13pt;
  line-height: 1;
  margin-bottom: -0.5mm;     /* very slight gap between glyph and quote text */
}

/* ────────── Footer ────────── */
.sheet-foot {
  margin-top: auto;
  padding-top: 4mm;
  border-top: 1px solid var(--line);  /* full-width line across the foot of the sheet */
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 4mm;
  font-family: var(--sans);
  font-size: 6.5pt;
  letter-spacing: .22em;
  text-transform: uppercase;
  color: var(--muted);
  flex-shrink: 0;
}
.sheet-foot .foot-brand {
  font-family: var(--serif);
  font-style: italic;
  font-size: 9pt;
  letter-spacing: .04em;
  text-transform: none;
  color: var(--ink-soft);
}
.sheet-foot a { color: var(--accent); text-decoration: none; }
.foot-text {
  display: flex;
  flex-direction: column;
  gap: 1.5mm;
}
.foot-qr {
  display: flex;
  align-items: center;
  gap: 3mm;
  color: var(--ink-soft) !important;
}
.foot-qr img {
  width: 15mm;
  height: 15mm;
  display: block;
  border: 1px solid var(--line);
  background: #fff;
  padding: 0.8mm;
}
.foot-qr span {
  font-family: var(--sans);
  font-size: 6pt;
  letter-spacing: .14em;
  text-transform: uppercase;
  line-height: 1.5;
  color: var(--muted);
}

/* ────────── PRINT — US Letter 8.5 × 11 ────────── */
@page { size: letter portrait; margin: 0; }
@media print {
  html, body {
    background: #ffffff !important;
    padding: 0 !important;
    margin: 0 !important;
  }
  body { display: block; }
  .sheet-toolbar { display: none !important; }
  .sheet {
    width: 8.5in;
    height: 11in;
    max-width: none;
    box-shadow: none !important;
    page-break-after: always;
    -webkit-print-color-adjust: exact;
    print-color-adjust: exact;
  }
}

/* ────────── Mobile ────────── */
@media (max-width: 640px) {
  body { padding: .5rem .5rem 3rem; font-size: 9pt; }
  .sheet { padding: 4.5mm 4.5mm 3.5mm; }
  .sheet::before { top: 2mm; left: 2mm; right: 2mm; bottom: 2mm; }
  .sheet-head { padding-bottom: 2mm; margin-bottom: 2.5mm; }
  .brand-block { gap: 2mm; }
  .brand-block .brand-logo { height: 10mm; }
  .brand-block .brand-word { font-size: 6pt; padding-left: 2mm; letter-spacing: .22em; }
  .sheet-meta .doc-type { font-size: 4.5pt; }
  .sheet-meta .doc-region { font-size: 8pt; margin-top: .8mm; }
  .sheet-meta .doc-edition { font-size: 4.5pt; margin-top: 1mm; }
  .sheet-body { grid-template-columns: 36mm 1fr; gap: 3mm; margin-bottom: 2.5mm; }
  .sheet-bottle { padding: 3mm 2mm; min-height: 88mm; border-left-width: 1.5px; }
  .sheet-bottle img { height: 100%; max-height: 82mm; width: auto; }
  .sheet-h1 { font-size: 13pt; }
  .sheet-region { font-size: 4.5pt; letter-spacing: .22em; }
  .sheet-region::before { width: 4mm; }
  .sheet-lede { font-size: 7pt; line-height: 1.35; }
  .sheet-content { gap: 2.5mm; }
  .sheet-section-title { font-size: 4.5pt; letter-spacing: .22em; margin-bottom: 1mm; padding-bottom: .8mm; }
  .sheet-tasting { font-size: 6.5pt; line-height: 1.3; }
  .sheet-specs { grid-template-columns: 1fr 1fr; gap: 1.2mm; }
  .sheet-specs li { padding: 1.4mm 1.6mm; gap: .2mm; }
  .sheet-specs span { font-size: 4pt; letter-spacing: .14em; }
  .sheet-specs strong { font-size: 6pt; }
  .sheet-origin { padding: 1.5mm 2mm; }
  .sheet-origin p { font-size: 5.8pt; line-height: 1.3; }
  .sheet-motto { font-size: 7.5pt; padding-top: 2mm; }
  .sheet-motto::before { font-size: 9pt; }
  .sheet-foot { flex-direction: row; gap: 1.5mm; padding-top: 1.8mm; font-size: 4pt; letter-spacing: .14em; }
  .sheet-foot .foot-brand { font-size: 5.5pt; }
  .sheet-toolbar { top: .5rem; right: .5rem; }
  .sheet-toolbar a, .sheet-toolbar button { padding: .45rem .7rem; font-size: .58rem; }
}
