/* Maíz & Mole — Mexican gastronomy journal */
:root {
  --mole: #1F1410;
  --mole-soft: #3A241C;
  --adobe: #B84A28;
  --clay: #C96B45;
  --chile: #8C2418;
  --maize: #C9A227;
  --paper: #EBD9C4;
  --paper-deep: #DDC4A8;
  --ink: #1F1410;
  --ink-muted: #5C4034;
  --foam: #F7EFE4;
  --display: "Newsreader", "Times New Roman", serif;
  --sans: "Karla", system-ui, sans-serif;
  --max: 1120px;
  --ease: cubic-bezier(.22, 1, .36, 1);
}

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

html {
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
}

body {
  font-family: var(--sans);
  color: var(--ink);
  background:
    radial-gradient(ellipse 80% 50% at 0% 0%, rgba(184, 74, 40, .14), transparent 55%),
    radial-gradient(ellipse 60% 40% at 100% 20%, rgba(201, 162, 39, .1), transparent 50%),
    linear-gradient(180deg, #F3E4D2 0%, var(--paper) 40%, var(--paper-deep) 100%);
  min-height: 100svh;
  line-height: 1.65;
  font-size: 1.05rem;
}

img { max-width: 100%; display: block; height: auto; }
a { color: var(--adobe); text-decoration-thickness: 1px; text-underline-offset: .18em; }
a:hover { color: var(--chile); }
button { font: inherit; cursor: pointer; border: none; background: none; color: inherit; }
ul { list-style: none; }

.skip {
  position: absolute;
  left: -999px;
  top: .5rem;
  z-index: 100;
  background: var(--maize);
  color: var(--mole);
  padding: .5rem 1rem;
  font-weight: 700;
}
.skip:focus { left: .5rem; }

/* —— Site frame / magazine spine —— */
.site-frame {
  display: grid;
  grid-template-columns: 1fr;
  min-height: 100svh;
}

@media (min-width: 1100px) {
  .site-frame { grid-template-columns: 52px 1fr; }
  .spine {
    position: sticky;
    top: 0;
    height: 100svh;
    background: var(--adobe);
    color: var(--foam);
    display: flex;
    align-items: center;
    justify-content: center;
    writing-mode: vertical-rl;
    transform: rotate(180deg);
    font-family: var(--display);
    font-size: .85rem;
    letter-spacing: .28em;
    text-transform: uppercase;
    border-right: 3px solid var(--maize);
    z-index: 5;
  }
  .spine span { opacity: .55; letter-spacing: .18em; }
}

.spine { display: none; }
@media (min-width: 1100px) { .spine { display: flex; } }

.site-main { min-width: 0; }

/* —— Nav —— */
.site-nav {
  position: sticky;
  top: 0;
  z-index: 40;
  background: rgba(31, 20, 16, .92);
  color: var(--foam);
  backdrop-filter: blur(12px);
  border-bottom: 2px solid var(--adobe);
  transition: background .3s var(--ease);
}
.site-nav.is-scrolled { background: rgba(31, 20, 16, .98); }

.nav-inner {
  width: min(var(--max), 100%);
  margin: 0 auto;
  padding: .9rem 1.25rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.logo {
  font-family: var(--display);
  font-weight: 700;
  font-size: 1.45rem;
  color: var(--foam);
  text-decoration: none;
  letter-spacing: -.01em;
  line-height: 1.1;
}
.logo em {
  font-style: italic;
  color: var(--maize);
  font-weight: 500;
}
.logo-sub {
  display: block;
  font-family: var(--sans);
  font-size: .62rem;
  font-weight: 500;
  letter-spacing: .18em;
  text-transform: uppercase;
  color: rgba(247, 239, 228, .55);
  margin-top: .15rem;
}

.nav-links {
  display: none;
  gap: 1.4rem;
  align-items: center;
}
@media (min-width: 820px) {
  .nav-links { display: flex; }
}
.nav-links a {
  color: rgba(247, 239, 228, .82);
  text-decoration: none;
  font-size: .88rem;
  font-weight: 500;
  letter-spacing: .02em;
  position: relative;
}
.nav-links a::after {
  content: "";
  position: absolute;
  left: 0; right: 100%;
  bottom: -.25rem;
  height: 2px;
  background: var(--maize);
  transition: right .35s var(--ease);
}
.nav-links a:hover,
.nav-links a.active { color: var(--foam); }
.nav-links a:hover::after,
.nav-links a.active::after { right: 0; }

.nav-toggle {
  width: 44px;
  height: 44px;
  display: grid;
  place-items: center;
  gap: 5px;
}
@media (min-width: 820px) { .nav-toggle { display: none; } }
.nav-toggle span {
  display: block;
  width: 22px;
  height: 2px;
  background: var(--foam);
  transition: transform .3s, opacity .3s;
}
.nav-toggle[aria-expanded="true"] span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.nav-toggle[aria-expanded="true"] span:nth-child(2) { opacity: 0; }
.nav-toggle[aria-expanded="true"] span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

.nav-drawer {
  display: none;
  flex-direction: column;
  padding: 0 1.25rem 1.25rem;
  gap: .35rem;
  border-top: 1px solid rgba(247, 239, 228, .12);
}
.nav-drawer.open { display: flex; }
.nav-drawer a {
  color: var(--foam);
  text-decoration: none;
  padding: .7rem 0;
  border-bottom: 1px solid rgba(247, 239, 228, .08);
  font-size: 1.05rem;
}

/* —— Hero (full-bleed) —— */
.hero {
  position: relative;
  min-height: min(92svh, 780px);
  display: grid;
  align-items: end;
  color: var(--foam);
  overflow: hidden;
}
.hero-media {
  position: absolute;
  inset: 0;
  z-index: 0;
}
.hero-media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transform: scale(1.06);
  animation: heroDrift 18s var(--ease) infinite alternate;
}
@keyframes heroDrift {
  from { transform: scale(1.06) translate3d(0, 0, 0); }
  to { transform: scale(1.12) translate3d(-1.5%, -1%, 0); }
}
.hero-shade {
  position: absolute;
  inset: 0;
  background:
    linear-gradient(180deg, rgba(31, 20, 16, .25) 0%, rgba(31, 20, 16, .35) 40%, rgba(31, 20, 16, .88) 100%),
    linear-gradient(90deg, rgba(140, 36, 24, .35) 0%, transparent 55%);
  z-index: 1;
}
.hero-content {
  position: relative;
  z-index: 2;
  width: min(var(--max), 100%);
  margin: 0 auto;
  padding: 5rem 1.25rem 3.25rem;
}
.hero-brand {
  font-family: var(--display);
  font-size: clamp(2.8rem, 8vw, 5.2rem);
  font-weight: 700;
  line-height: .95;
  letter-spacing: -.02em;
  margin-bottom: 1rem;
  max-width: 12ch;
}
.hero-brand em {
  font-style: italic;
  color: var(--maize);
  font-weight: 500;
}
.hero h1 {
  font-family: var(--sans);
  font-weight: 500;
  font-size: clamp(1.05rem, 2.2vw, 1.35rem);
  line-height: 1.45;
  max-width: 34ch;
  color: rgba(247, 239, 228, .92);
  margin-bottom: 1.5rem;
}
.hero-cta {
  display: flex;
  flex-wrap: wrap;
  gap: .75rem 1rem;
  align-items: center;
}
.btn {
  display: inline-flex;
  align-items: center;
  gap: .5rem;
  padding: .85rem 1.35rem;
  background: var(--adobe);
  color: var(--foam);
  text-decoration: none;
  font-weight: 700;
  font-size: .92rem;
  letter-spacing: .04em;
  text-transform: uppercase;
  transition: background .25s, transform .25s var(--ease);
}
.btn:hover { background: var(--chile); color: var(--foam); transform: translateY(-2px); }
.btn-ghost {
  background: transparent;
  border: 1px solid rgba(247, 239, 228, .45);
  color: var(--foam);
}
.btn-ghost:hover { border-color: var(--maize); color: var(--maize); background: transparent; }

/* —— Sections —— */
.section {
  width: min(var(--max), 100%);
  margin: 0 auto;
  padding: 3.5rem 1.25rem;
}
.section-head {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: end;
  gap: 1rem;
  margin-bottom: 2rem;
  padding-bottom: 1rem;
  border-bottom: 2px solid var(--mole);
}
.section-head h2 {
  font-family: var(--display);
  font-size: clamp(1.8rem, 3.5vw, 2.4rem);
  line-height: 1.15;
  color: var(--mole);
}
.section-head p {
  max-width: 36ch;
  color: var(--ink-muted);
  font-size: .95rem;
}

/* —— Featured platter (not a card) —— */
.featured {
  width: min(var(--max), 100%);
  margin: 0 auto;
  padding: 0 1.25rem 1rem;
}
.featured-platter {
  display: grid;
  gap: 0;
  background: var(--mole);
  color: var(--foam);
  overflow: hidden;
}
@media (min-width: 860px) {
  .featured-platter { grid-template-columns: 1.15fr .85fr; min-height: 420px; }
}
.featured-media {
  position: relative;
  min-height: 280px;
  overflow: hidden;
}
.featured-media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform .8s var(--ease);
}
.featured-platter:hover .featured-media img { transform: scale(1.04); }
.featured-body {
  padding: 2rem 1.75rem;
  display: flex;
  flex-direction: column;
  justify-content: center;
  background:
    linear-gradient(160deg, var(--mole-soft) 0%, var(--mole) 100%);
}
.eyebrow {
  font-size: .72rem;
  letter-spacing: .2em;
  text-transform: uppercase;
  color: var(--maize);
  font-weight: 700;
  margin-bottom: .75rem;
}
.featured-body h2 {
  font-family: var(--display);
  font-size: clamp(1.7rem, 3vw, 2.35rem);
  line-height: 1.15;
  margin-bottom: .85rem;
}
.featured-body h2 a {
  color: inherit;
  text-decoration: none;
}
.featured-body h2 a:hover { color: var(--maize); }
.featured-body p {
  color: rgba(247, 239, 228, .78);
  margin-bottom: 1.25rem;
  max-width: 42ch;
}
.read-link {
  color: var(--maize);
  font-weight: 700;
  text-decoration: none;
  letter-spacing: .04em;
  text-transform: uppercase;
  font-size: .82rem;
  display: inline-flex;
  align-items: center;
  gap: .4rem;
}
.read-link::after {
  content: "→";
  transition: transform .25s var(--ease);
}
.read-link:hover { color: var(--foam); }
.read-link:hover::after { transform: translateX(4px); }

/* —— TOC rows (magazine index, not cards) —— */
.toc { display: grid; gap: 0; }
.toc-row {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 1rem 1.25rem;
  padding: 1.5rem 0;
  border-bottom: 1px solid rgba(31, 20, 16, .15);
  text-decoration: none;
  color: inherit;
  align-items: start;
  transition: background .25s, padding-left .35s var(--ease);
}
@media (min-width: 720px) {
  .toc-row {
    grid-template-columns: 4.5rem minmax(140px, 220px) 1fr;
    align-items: center;
  }
}
.toc-row:hover {
  background: rgba(184, 74, 40, .06);
  padding-left: .5rem;
}
.toc-num {
  font-family: var(--display);
  font-size: 2rem;
  font-weight: 700;
  color: var(--adobe);
  line-height: 1;
}
.toc-thumb {
  display: none;
  aspect-ratio: 4/3;
  overflow: hidden;
}
@media (min-width: 720px) { .toc-thumb { display: block; } }
.toc-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform .5s var(--ease);
}
.toc-row:hover .toc-thumb img { transform: scale(1.06); }
.toc-copy h3 {
  font-family: var(--display);
  font-size: 1.35rem;
  line-height: 1.2;
  margin-bottom: .35rem;
  color: var(--mole);
}
.toc-copy p {
  color: var(--ink-muted);
  font-size: .95rem;
  max-width: 48ch;
}
.toc-meta {
  display: block;
  font-size: .72rem;
  letter-spacing: .12em;
  text-transform: uppercase;
  color: var(--clay);
  font-weight: 700;
  margin-bottom: .35rem;
}

/* —— Band —— */
.band {
  background: var(--mole);
  color: var(--foam);
  margin: 1rem 0 0;
}
.band-inner {
  width: min(var(--max), 100%);
  margin: 0 auto;
  padding: 3rem 1.25rem;
  display: grid;
  gap: 1.25rem;
}
@media (min-width: 760px) {
  .band-inner { grid-template-columns: 1fr 1.4fr; align-items: center; }
}
.band h2 {
  font-family: var(--display);
  font-size: clamp(1.6rem, 3vw, 2.2rem);
  line-height: 1.15;
}
.band h2 em { color: var(--maize); font-style: italic; }
.band p { color: rgba(247, 239, 228, .78); max-width: 50ch; }

/* —— Footer —— */
.site-foot {
  background: #160E0B;
  color: rgba(247, 239, 228, .65);
  padding: 2.75rem 1.25rem 2rem;
  font-size: .88rem;
}
.foot-inner {
  width: min(var(--max), 100%);
  margin: 0 auto;
  display: grid;
  gap: 1.75rem;
}
@media (min-width: 720px) {
  .foot-inner { grid-template-columns: 1.4fr 1fr 1fr; }
}
.foot-brand {
  font-family: var(--display);
  font-size: 1.4rem;
  color: var(--foam);
  margin-bottom: .5rem;
}
.foot-brand em { color: var(--maize); font-style: italic; }
.site-foot a {
  color: rgba(247, 239, 228, .8);
  text-decoration: none;
}
.site-foot a:hover { color: var(--maize); }
.foot-col h3 {
  font-size: .72rem;
  letter-spacing: .16em;
  text-transform: uppercase;
  color: var(--maize);
  margin-bottom: .75rem;
}
.foot-col ul { display: grid; gap: .4rem; }
.foot-note {
  width: min(var(--max), 100%);
  margin: 2rem auto 0;
  padding-top: 1.25rem;
  border-top: 1px solid rgba(247, 239, 228, .12);
  font-size: .8rem;
  line-height: 1.55;
}

/* —— Article page —— */
.article-hero {
  background: var(--mole);
  color: var(--foam);
  padding: 3.5rem 1.25rem 0;
}
.article-hero-inner {
  width: min(720px, 100%);
  margin: 0 auto;
  padding-bottom: 2rem;
}
.article-hero .eyebrow { margin-bottom: 1rem; }
.article-hero h1 {
  font-family: var(--display);
  font-size: clamp(2rem, 4.5vw, 3.1rem);
  line-height: 1.12;
  margin-bottom: 1rem;
}
.article-lede {
  font-size: 1.15rem;
  color: rgba(247, 239, 228, .8);
  max-width: 48ch;
  margin-bottom: 1.25rem;
}
.article-meta {
  font-size: .8rem;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: rgba(247, 239, 228, .5);
}
.article-cover {
  width: min(var(--max), 100%);
  margin: 0 auto;
  padding: 0 1.25rem;
  transform: translateY(2rem);
}
.article-cover img {
  width: 100%;
  aspect-ratio: 16/9;
  object-fit: cover;
  max-height: 480px;
}
.article-body {
  width: min(680px, 100%);
  margin: 0 auto;
  padding: 4rem 1.25rem 3.5rem;
}
.article-body p { margin-bottom: 1.15rem; }
.article-body h2 {
  font-family: var(--display);
  font-size: 1.55rem;
  margin: 2.25rem 0 .9rem;
  color: var(--mole);
  line-height: 1.2;
}
.article-body blockquote {
  margin: 1.75rem 0;
  padding: 1rem 0 1rem 1.25rem;
  border-left: 3px solid var(--adobe);
  font-family: var(--display);
  font-style: italic;
  font-size: 1.35rem;
  line-height: 1.35;
  color: var(--chile);
}
.article-body figure {
  margin: 2rem 0;
}
.article-body figcaption {
  font-size: .8rem;
  color: var(--ink-muted);
  margin-top: .5rem;
}
.article-end {
  margin-top: 2.5rem;
  padding-top: 1.5rem;
  border-top: 1px solid rgba(31, 20, 16, .15);
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  justify-content: space-between;
  align-items: center;
}

/* —— About / legal —— */
.page-hero {
  background: var(--mole);
  color: var(--foam);
  padding: 3.5rem 1.25rem 2.75rem;
}
.page-hero-inner {
  width: min(720px, 100%);
  margin: 0 auto;
}
.page-hero h1 {
  font-family: var(--display);
  font-size: clamp(2.2rem, 4vw, 3rem);
  line-height: 1.1;
  margin-bottom: .75rem;
}
.page-hero p {
  color: rgba(247, 239, 228, .75);
  max-width: 46ch;
  font-size: 1.1rem;
}
.prose {
  width: min(720px, 100%);
  margin: 0 auto;
  padding: 3rem 1.25rem 4rem;
}
.prose h2 {
  font-family: var(--display);
  font-size: 1.45rem;
  margin: 2rem 0 .75rem;
  color: var(--mole);
}
.prose h3 {
  font-size: 1.05rem;
  margin: 1.5rem 0 .5rem;
  color: var(--adobe);
}
.prose p, .prose li { margin-bottom: .9rem; color: var(--ink); }
.prose ul { list-style: disc; padding-left: 1.25rem; margin-bottom: 1rem; }
.prose .legal-meta {
  font-size: .85rem;
  color: var(--ink-muted);
  margin-bottom: 1.5rem;
}
.legal-box {
  background: rgba(184, 74, 40, .08);
  border-left: 3px solid var(--adobe);
  padding: 1rem 1.15rem;
  margin: 1.25rem 0;
}

/* —— Articles index —— */
.articles-grid {
  display: grid;
  gap: 2rem;
}
@media (min-width: 800px) {
  .articles-grid {
    grid-template-columns: 1.2fr 1fr;
    gap: 2.5rem 2rem;
  }
  .articles-grid .story:first-child { grid-column: 1 / -1; }
}
.story {
  display: grid;
  gap: 1rem;
  text-decoration: none;
  color: inherit;
}
@media (min-width: 700px) {
  .articles-grid .story:first-child {
    grid-template-columns: 1.2fr 1fr;
    align-items: center;
    gap: 2rem;
  }
}
.story-media {
  overflow: hidden;
  aspect-ratio: 16/10;
  background: var(--mole-soft);
}
.story-media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform .6s var(--ease);
}
.story:hover .story-media img { transform: scale(1.05); }
.story h2, .story h3 {
  font-family: var(--display);
  line-height: 1.15;
  color: var(--mole);
}
.story h2 { font-size: clamp(1.7rem, 3vw, 2.4rem); }
.story h3 { font-size: 1.35rem; margin-top: .25rem; }
.story p { color: var(--ink-muted); font-size: .95rem; margin-top: .4rem; }

/* —— Cookie banner —— */
.cookie-banner {
  position: fixed;
  left: 1rem;
  right: 1rem;
  bottom: 1rem;
  z-index: 80;
  background: var(--mole);
  color: var(--foam);
  padding: 1.15rem 1.25rem;
  display: none;
  gap: 1rem;
  align-items: center;
  flex-wrap: wrap;
  box-shadow: 0 16px 48px rgba(0, 0, 0, .35);
  border-top: 3px solid var(--maize);
  max-width: 720px;
  margin: 0 auto;
  animation: cookieUp .45s var(--ease);
}
.cookie-banner.visible { display: flex; }
@keyframes cookieUp {
  from { opacity: 0; transform: translateY(20px); }
  to { opacity: 1; transform: translateY(0); }
}
.cookie-banner p {
  flex: 1 1 260px;
  font-size: .88rem;
  color: rgba(247, 239, 228, .85);
  line-height: 1.5;
}
.cookie-banner a { color: var(--maize); }
.cookie-actions {
  display: flex;
  flex-wrap: wrap;
  gap: .5rem;
}
.cookie-actions .btn { padding: .65rem 1rem; font-size: .78rem; }
.cookie-actions .btn-ghost {
  border-color: rgba(247, 239, 228, .35);
}

/* —— Reveal motion —— */
.reveal {
  opacity: 0;
  transform: translateY(18px);
  transition: opacity .7s var(--ease), transform .7s var(--ease);
}
.reveal.is-in { opacity: 1; transform: none; }

@media (prefers-reduced-motion: reduce) {
  .hero-media img { animation: none; transform: none; }
  .reveal { opacity: 1; transform: none; transition: none; }
  .cookie-banner { animation: none; }
}
