/* ============================================================
   Ofrenda Cantina Y Cocina — "Cantina de Noche"
   Tokens → base → components → sections
   ============================================================ */

/* ---------- Tokens ---------- */
:root {
  /* Color — the room at night */
  --ink: #0F120E;         /* bottle-green black: page ground */
  --ink-soft: #131712;    /* slightly lifted ground */
  --surface: #171C16;     /* raised panels */
  --zellige: #2E4A3B;     /* deep emerald tile */
  --zellige-dim: #22382d; /* borders on dark */
  --brass: #C9A45C;       /* candle gold */
  --brass-dim: #8f7440;   /* rules, quiet brass */
  --cream: #F2EDE3;       /* primary type */
  --cream-dim: #b9b2a4;   /* secondary type (AA on ink) */
  --terracotta: #C97048;  /* hot accent (tuned from #C06A3F for AA-large on ink) */
  --cognac: #A9652F;      /* leather, decorative only */
  --sage: #6B7A5E;        /* skull line-art green, decorative only */

  /* Type */
  --font-display: "Fraunces", "Georgia", serif;
  --font-body: "Archivo", "Helvetica Neue", Arial, sans-serif;
  --font-script: "Pinyon Script", cursive;

  /* Fluid type scale */
  --text-xs: 0.75rem;
  --text-sm: 0.875rem;
  --text-base: clamp(1rem, 0.95rem + 0.2vw, 1.125rem);
  --text-lg: clamp(1.15rem, 1.05rem + 0.5vw, 1.5rem);
  --text-xl: clamp(1.6rem, 1.3rem + 1.2vw, 2.4rem);
  --text-2xl: clamp(2.2rem, 1.6rem + 2.6vw, 3.6rem);
  --text-hero: clamp(2.8rem, 1.8rem + 4.5vw, 5.6rem);

  /* Space */
  --space-1: 0.25rem;
  --space-2: 0.5rem;
  --space-3: 1rem;
  --space-4: 1.5rem;
  --space-5: 2.5rem;
  --space-6: 4rem;
  --space-7: clamp(4rem, 3rem + 6vw, 9rem); /* section rhythm */

  --container: 74rem;
  --arch: 999rem 999rem 0 0; /* the niche */
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
}

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

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

html, body { overflow-x: clip; }

body {
  margin: 0;
  background: var(--ink);
  color: var(--cream);
  font-family: var(--font-body);
  font-size: var(--text-base);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

/* candlelight grain — barely-there texture over the ink */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 1;
  opacity: 0.05;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='2'/%3E%3C/filter%3E%3Crect width='160' height='160' filter='url(%23n)' opacity='0.6'/%3E%3C/svg%3E");
}

img, video { max-width: 100%; height: auto; display: block; }

h1, h2, h3 {
  font-family: var(--font-display);
  font-weight: 480;
  font-variation-settings: "opsz" 100;
  line-height: 1.08;
  letter-spacing: -0.01em;
  margin: 0 0 var(--space-4);
  text-wrap: balance;
}

p { margin: 0 0 var(--space-3); }

a { color: var(--brass); text-decoration-color: var(--brass-dim); text-underline-offset: 0.2em; }
a:hover { color: var(--terracotta); }

:focus-visible {
  outline: 2px solid var(--brass);
  outline-offset: 3px;
  border-radius: 2px;
}

::selection { background: var(--zellige); color: var(--cream); }

.visually-hidden {
  position: absolute; width: 1px; height: 1px;
  margin: -1px; padding: 0; overflow: hidden;
  clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}

.skip-link {
  position: absolute; left: 1rem; top: -4rem; z-index: 100;
  background: var(--brass); color: var(--ink);
  padding: 0.6rem 1rem; border-radius: 3px;
  font-weight: 600; text-decoration: none;
  transition: top 0.2s var(--ease);
}
.skip-link:focus { top: 1rem; color: var(--ink); }

.container { max-width: var(--container); margin-inline: auto; padding-inline: clamp(1.25rem, 4vw, 2.5rem); }

/* ---------- Eyebrow / labels ---------- */
.eyebrow {
  font-family: var(--font-body);
  font-size: var(--text-xs);
  font-weight: 600;
  font-stretch: 125%;               /* Archivo width axis: expanded */
  letter-spacing: 0.32em;
  text-transform: uppercase;
  color: var(--brass);
  display: flex;
  align-items: center;
  gap: var(--space-3);
  margin-bottom: var(--space-4);
}
.eyebrow::after { content: ""; height: 1px; width: 3.5rem; background: var(--brass-dim); }

.script-accent {
  font-family: var(--font-script);
  font-weight: 400;
  color: var(--brass);
  font-size: 1.35em;
  letter-spacing: 0;
  text-transform: none;
  line-height: 1;
}

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.6rem;
  font-family: var(--font-body);
  font-size: var(--text-sm);
  font-weight: 600;
  font-stretch: 110%;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  text-decoration: none;
  padding: 0.95rem 1.8rem;
  border: 1px solid var(--brass);
  border-radius: 2px;
  transition: background 0.25s var(--ease), color 0.25s var(--ease), border-color 0.25s var(--ease);
}
.btn--solid { background: var(--brass); color: var(--ink); }
.btn--solid:hover { background: var(--terracotta); border-color: var(--terracotta); color: var(--ink); }
.btn--ghost { background: transparent; color: var(--brass); }
.btn--ghost:hover { border-color: var(--terracotta); color: var(--terracotta); }

/* ---------- Ticker ---------- */
.ticker {
  overflow: hidden;
  border-bottom: 1px solid var(--zellige-dim);
  background: var(--ink-soft);
  padding-block: 0.55rem;
  position: relative;
  z-index: 3;
}
.ticker__track {
  display: flex;
  gap: 3rem;
  width: max-content;
  animation: ticker 32s linear infinite;
}
.ticker__item {
  font-size: var(--text-xs);
  font-weight: 600;
  font-stretch: 120%;
  letter-spacing: 0.3em;
  text-transform: uppercase;
  color: var(--brass);
  white-space: nowrap;
}
@keyframes ticker { to { transform: translateX(calc(-50% - 1.5rem)); } }

/* ---------- Header ---------- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: color-mix(in srgb, var(--ink) 88%, transparent);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--zellige-dim);
}
.site-header__inner {
  display: flex;
  align-items: center;
  gap: var(--space-4);
  padding-block: 0.8rem;
}
.site-header__brand {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  text-decoration: none;
  color: var(--cream);
  margin-right: auto;
}
.site-header__brand img { height: 76px; width: auto; }
@media (max-width: 860px) { .site-header__brand img { height: 60px; } }
.site-nav { display: flex; align-items: center; gap: clamp(1rem, 2.2vw, 2rem); }
.site-nav a {
  font-size: var(--text-sm);
  font-weight: 500;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--cream-dim);
  text-decoration: none;
}
.site-nav a:hover { color: var(--brass); }
.site-header .btn { padding: 0.65rem 1.2rem; }

.nav-toggle {
  display: none;
  background: none;
  border: 1px solid var(--zellige);
  border-radius: 2px;
  color: var(--cream);
  padding: 0.55rem 0.7rem;
  cursor: pointer;
}
.nav-toggle svg { display: block; }

@media (max-width: 860px) {
  .site-nav {
    display: none;
    position: absolute;
    top: 100%;
    left: 0; right: 0;
    flex-direction: column;
    align-items: flex-start;
    gap: 0;
    background: var(--ink-soft);
    border-bottom: 1px solid var(--zellige-dim);
    padding: var(--space-3) 0;
  }
  .site-nav.is-open { display: flex; }
  .site-nav a {
    font-family: var(--font-display);
    font-size: var(--text-lg);
    text-transform: none;
    letter-spacing: 0;
    padding: 0.7rem clamp(1.25rem, 4vw, 2.5rem);
    width: 100%;
  }
  .nav-toggle { display: block; }
  .site-header .btn span.btn__phone { display: none; } /* mobile: shorter reserve label */
  .site-header__inner { gap: var(--space-2); }
  .site-header .btn { padding: 0.55rem 0.9rem; margin-left: auto; }
  .site-header__brand { margin-right: 0; }
}

/* ---------- The niche (signature) ---------- */
.arch-frame {
  border-radius: var(--arch);
  overflow: hidden;
  border: 1px solid var(--zellige);
  position: relative;
}
.arch-frame > img, .arch-frame > video { width: 100%; height: 100%; object-fit: cover; }

.niche-glow { position: relative; }
.niche-glow::before {
  content: "";
  position: absolute;
  inset: -12% -18%;
  background: radial-gradient(50% 42% at 50% 55%, color-mix(in srgb, var(--brass) 26%, transparent), transparent 70%);
  filter: blur(6px);
  pointer-events: none;
}

/* ---------- Sections ---------- */
.section { padding-block: var(--space-7); position: relative; z-index: 2; }
.section--surface { background: var(--surface); border-block: 1px solid var(--zellige-dim); }

/* ---------- Reveal ---------- */
.reveal {
  opacity: 0;
  transform: translateY(1.4rem);
  transition: opacity 0.8s var(--ease), transform 0.8s var(--ease);
  transition-delay: var(--reveal-delay, 0s);
}
.reveal.is-visible { opacity: 1; transform: none; }
@media (prefers-reduced-motion: reduce) {
  .ticker__track { animation: none; }
  .reveal { opacity: 1; transform: none; transition: none; }
}
.no-js .reveal { opacity: 1; transform: none; }

/* ---------- Hero ---------- */
.hero { padding-block: var(--space-6) var(--space-7); overflow: hidden; }
.hero__grid {
  display: grid;
  grid-template-columns: 1.15fr 0.85fr;
  gap: clamp(2rem, 5vw, 5rem);
  align-items: center;
}
.hero__title {
  font-size: var(--text-hero);
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.02em;
  margin-bottom: var(--space-3);
}
.hero__title .script-accent { display: block; font-size: 0.52em; margin-top: 0.1em; }
.hero__lede { color: var(--cream-dim); font-size: var(--text-lg); max-width: 34ch; }
.hero__status {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  font-size: var(--text-sm);
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--brass);
  margin-block: var(--space-4);
}
.hero__status::before {
  content: "";
  width: 8px; height: 8px;
  border-radius: 50%;
  background: var(--brass);
  box-shadow: 0 0 10px 1px color-mix(in srgb, var(--brass) 65%, transparent);
}
.hero__ctas { display: flex; flex-wrap: wrap; gap: var(--space-3); }
.hero__media { max-width: 380px; margin-inline: auto; width: 100%; }
.hero__media .arch-frame { aspect-ratio: 9 / 15.2; }

@media (max-width: 860px) {
  .hero__grid { grid-template-columns: 1fr; }
  .hero__media { max-width: 320px; }
}

/* ---------- Story ---------- */
.story__grid {
  display: grid;
  grid-template-columns: 0.9fr 1.1fr;
  gap: clamp(2rem, 5vw, 5rem);
  align-items: center;
}
.story__media { max-width: 420px; }
.story__media .arch-frame { aspect-ratio: 3 / 4; }
.story__statement { font-size: var(--text-2xl); }
.story__body { color: var(--cream-dim); max-width: 56ch; }
.story__meta {
  margin-top: var(--space-4);
  font-size: var(--text-sm);
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--brass);
}
@media (max-width: 860px) {
  .story__grid { grid-template-columns: 1fr; }
  .story__media { order: 2; }
}

/* ---------- Gallery mosaic ---------- */
.gallery-mosaic {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  grid-auto-rows: 130px;
  grid-auto-flow: dense;
  gap: clamp(0.6rem, 1.2vw, 1rem);
}
.gallery-mosaic figure { margin: 0; overflow: hidden; border: 1px solid var(--zellige-dim); position: relative; }
.gallery-mosaic img { width: 100%; height: 100%; object-fit: cover; transition: transform 0.9s var(--ease); }
.gallery-mosaic figure:hover img { transform: scale(1.04); }
.gallery-mosaic .tile--arch { border-radius: var(--arch); }
/* spans set per-tile via utility classes */
.span-2x2 { grid-column: span 2; grid-row: span 2; }
.span-2x3 { grid-column: span 2; grid-row: span 3; }
.span-3x2 { grid-column: span 3; grid-row: span 2; }
.span-2x1 { grid-column: span 2; grid-row: span 1; }
.span-3x3 { grid-column: span 3; grid-row: span 3; }
@media (max-width: 860px) {
  .gallery-mosaic { grid-template-columns: repeat(2, 1fr); grid-auto-rows: 34vw; }
  .gallery-mosaic .span-2x3, .gallery-mosaic .span-3x2, .gallery-mosaic .span-2x2,
  .gallery-mosaic .span-3x3, .gallery-mosaic .span-2x1 { grid-column: span 1; grid-row: span 1; }
  .gallery-mosaic figure:nth-child(3n+1) { grid-column: span 2; grid-row: span 2; }
}

/* ---------- Programming (posters) ---------- */
.poster-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 380px));
  justify-content: center;
  gap: clamp(2rem, 5vw, 4.5rem);
}
.poster-card { margin: 0; }
.poster-card img {
  border: 1px solid var(--zellige);
  outline: 8px solid var(--ink-soft);
  outline-offset: -9px; /* inner mat line, like a framed print */
  box-shadow: 0 30px 60px -30px rgba(0, 0, 0, 0.8);
}
.poster-card figcaption {
  margin-top: var(--space-3);
  text-align: center;
  color: var(--cream-dim);
  font-size: var(--text-sm);
  letter-spacing: 0.1em;
  text-transform: uppercase;
}
@media (max-width: 700px) { .poster-grid { grid-template-columns: minmax(0, 380px); } }

.weekly-rows { max-width: 46rem; margin: var(--space-6) auto 0; }
.weekly-row {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: var(--space-3);
  padding-block: var(--space-3);
  border-top: 1px solid var(--zellige-dim);
}
.weekly-row:last-child { border-bottom: 1px solid var(--zellige-dim); }
.weekly-row__name { font-family: var(--font-display); font-size: var(--text-lg); }
.weekly-row__detail { color: var(--cream-dim); font-size: var(--text-sm); letter-spacing: 0.08em; text-transform: uppercase; text-align: right; }

/* ---------- Menu index ---------- */
.menu-index { list-style: none; margin: 0; padding: 0; }
.menu-index__row { border-top: 1px solid var(--zellige-dim); }
.menu-index__row:last-child { border-bottom: 1px solid var(--zellige-dim); }
.menu-index__link {
  display: grid;
  grid-template-columns: 1fr auto auto;
  align-items: center;
  gap: var(--space-4);
  padding-block: clamp(1.2rem, 2.5vw, 2rem);
  text-decoration: none;
  color: var(--cream);
}
.menu-index__name {
  font-family: var(--font-display);
  font-size: var(--text-xl);
  font-weight: 480;
  transition: color 0.3s var(--ease), transform 0.4s var(--ease);
}
.menu-index__sub { color: var(--cream-dim); font-size: var(--text-sm); letter-spacing: 0.06em; }
.menu-index__thumb {
  width: 86px; height: 112px;
  object-fit: cover;
  border-radius: var(--arch);
  border: 1px solid var(--zellige);
  opacity: 0;
  transform: translateY(6px);
  transition: opacity 0.35s var(--ease), transform 0.35s var(--ease);
}
.menu-index__arrow { color: var(--brass); transition: transform 0.35s var(--ease); }
.menu-index__link:hover .menu-index__name,
.menu-index__link:focus-visible .menu-index__name { color: var(--terracotta); transform: translateX(6px); }
.menu-index__link:hover .menu-index__thumb,
.menu-index__link:focus-visible .menu-index__thumb { opacity: 1; transform: none; }
.menu-index__link:hover .menu-index__arrow { transform: translateX(4px); }
@media (max-width: 640px) { .menu-index__thumb { display: none; } }

/* ---------- Visit ---------- */
.visit__grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: clamp(2rem, 5vw, 5rem);
  align-items: start;
}
.hours-table { width: 100%; border-collapse: collapse; }
.hours-table th, .hours-table td {
  text-align: left;
  padding-block: 0.7rem;
  border-bottom: 1px solid var(--zellige-dim);
  font-weight: 400;
  vertical-align: top;
}
.hours-table th { color: var(--cream); padding-right: var(--space-4); white-space: nowrap; }
.hours-table td { color: var(--cream-dim); }
.visit__contact p { margin-bottom: var(--space-2); }
.visit__contact .tel {
  font-family: var(--font-display);
  font-size: var(--text-xl);
  text-decoration: none;
}
.map-frame {
  border: 1px solid var(--zellige);
  border-radius: var(--arch);
  overflow: hidden;
  aspect-ratio: 4 / 4.6;
  filter: grayscale(0.35) sepia(0.12);
}
.map-frame iframe { width: 100%; height: 100%; border: 0; display: block; }
@media (max-width: 860px) { .visit__grid { grid-template-columns: 1fr; } }

/* ---------- Footer ---------- */
.site-footer {
  border-top: 1px solid var(--zellige-dim);
  background: var(--ink-soft);
  padding-block: var(--space-6) var(--space-5);
  text-align: center;
  position: relative;
  z-index: 2;
}
.site-footer__logo { display: block; width: min(230px, 60vw); height: auto; margin: 0 auto var(--space-4); }
.site-footer__nav { display: flex; justify-content: center; flex-wrap: wrap; gap: var(--space-4); margin-bottom: var(--space-4); }
.site-footer__nav a {
  color: var(--cream-dim);
  text-decoration: none;
  font-size: var(--text-sm);
  letter-spacing: 0.1em;
  text-transform: uppercase;
}
.site-footer__nav a:hover { color: var(--brass); }
.site-footer__fine { color: var(--cream-dim); font-size: var(--text-sm); max-width: 44rem; margin-inline: auto; }

/* ---------- Menus page ---------- */
.menus-hero { padding-block: var(--space-6) var(--space-5); text-align: center; }
.menus-hero h1 { font-size: var(--text-2xl); text-transform: uppercase; letter-spacing: 0.03em; }

.menu-tabs {
  display: flex;
  justify-content: center;
  gap: 0.5rem;
  flex-wrap: wrap;
  position: sticky;
  top: 102px;
  z-index: 40;
  background: color-mix(in srgb, var(--ink) 90%, transparent);
  backdrop-filter: blur(10px);
  padding-block: var(--space-3);
  border-bottom: 1px solid var(--zellige-dim);
}
.menu-tab {
  font-family: var(--font-body);
  font-size: var(--text-sm);
  font-weight: 600;
  font-stretch: 115%;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--cream-dim);
  background: none;
  border: 1px solid transparent;
  border-radius: 2px;
  padding: 0.6rem 1.3rem;
  cursor: pointer;
  transition: color 0.25s var(--ease), border-color 0.25s var(--ease);
}
.menu-tab:hover { color: var(--brass); }
.menu-tab[aria-selected="true"] { color: var(--brass); border-color: var(--brass); }

@media (max-width: 860px) { .menu-tabs { top: 86px; } }

.menu-panel { padding-block: var(--space-6); }
.menu-panel[hidden] { display: none; }

.menu-note {
  text-align: center;
  color: var(--brass);
  font-size: var(--text-sm);
  letter-spacing: 0.14em;
  text-transform: uppercase;
  margin-bottom: var(--space-5);
}

.menu-cols { columns: 2; column-gap: clamp(2.5rem, 5vw, 5rem); }
@media (max-width: 800px) { .menu-cols { columns: 1; } }

.menu-section { break-inside: avoid; margin-bottom: var(--space-6); }
.menu-section h3 {
  font-family: var(--font-body);
  font-size: var(--text-sm);
  font-weight: 600;
  font-stretch: 125%;
  letter-spacing: 0.3em;
  text-transform: uppercase;
  color: var(--brass);
  display: flex;
  align-items: center;
  gap: var(--space-3);
}
.menu-section h3::after { content: ""; height: 1px; flex: 1; background: var(--zellige-dim); }
.menu-section__note { color: var(--cream-dim); font-size: var(--text-sm); font-style: italic; margin-top: -0.4rem; margin-bottom: var(--space-3); }

.menu-item { margin-bottom: var(--space-3); }
.menu-item__line {
  display: flex;
  align-items: baseline;
  gap: 0.75rem;
}
.menu-item__name { font-family: var(--font-display); font-size: var(--text-lg); font-weight: 480; }
.menu-item__line::after { content: ""; flex: 1; border-bottom: 1px dotted var(--brass-dim); transform: translateY(-0.25em); order: 2; min-width: 1.5rem; }
.menu-item__name { order: 1; }
.menu-item__price { order: 3; color: var(--brass); font-size: var(--text-sm); font-weight: 600; letter-spacing: 0.04em; white-space: nowrap; }
.menu-item__desc { color: var(--cream-dim); font-size: var(--text-sm); max-width: 52ch; margin-top: 0.25rem; }

.fine-print {
  border-top: 1px solid var(--zellige-dim);
  margin-top: var(--space-5);
  padding-top: var(--space-4);
  color: var(--cream-dim);
  font-size: var(--text-xs);
  letter-spacing: 0.04em;
  max-width: 56rem;
}
.fine-print p { margin-bottom: var(--space-2); }
