/* ============================================================
   Casa Cacao - Direccion B «De grano a taza»
   Editorial print-on-paper: Fraunces + Work Sans, one accent.
   Light theme locked. No JS. Sharp corners everywhere.
   ============================================================ */

:root {
  --paper: #F6EFE4;
  --paper-deep: #EFE5D2;
  --ink: #2A1B12;
  --brown: #6E5544;
  --accent: #9C4A1A;
  --accent-dark: #7F3A12;
  --hairline: rgba(42, 27, 18, 0.18);
  --star-empty: #D8C9B2;
  --serif: "Fraunces", Georgia, "Times New Roman", serif;
  --sans: "Work Sans", "Helvetica Neue", Arial, sans-serif;
  --content-w: 1180px;
  --gutter: clamp(20px, 4vw, 48px);
}

/* ---------- Base ---------- */

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

html {
  scroll-behavior: smooth;
}

html,
body {
  overflow-x: clip;
}

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

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

a {
  color: inherit;
}

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

::selection {
  background: var(--accent);
  color: var(--paper);
}

.wrap {
  width: min(var(--content-w), 100%);
  margin-inline: auto;
  padding-inline: var(--gutter);
}

section {
  scroll-margin-top: 24px;
}

h1,
h2,
h3 {
  font-family: var(--serif);
  font-weight: 600;
  line-height: 1.1;
  margin: 0;
}

h2 {
  font-size: clamp(1.9rem, 4.5vw, 2.6rem);
  letter-spacing: -0.01em;
}

.section-lede {
  margin: 10px 0 0;
  color: var(--brown);
  max-width: 52ch;
  font-size: 1rem;
}

.section-head {
  margin-bottom: clamp(24px, 4vw, 40px);
}

/* ---------- Skip link ---------- */

.skip-link {
  position: absolute;
  left: -9999px;
  top: 12px;
  background: var(--ink);
  color: var(--paper);
  padding: 10px 18px;
  font-size: 0.85rem;
  text-decoration: none;
  z-index: 20;
}

.skip-link:focus {
  left: 12px;
}

/* ---------- Masthead (slim, non-sticky) ---------- */

.masthead {
  width: min(var(--content-w), 100%);
  margin-inline: auto;
  padding: 16px var(--gutter);
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: 6px 24px;
  border-bottom: 1px solid var(--hairline);
}

.wordmark {
  font-family: var(--serif);
  font-weight: 600;
  font-size: 1.3rem;
  letter-spacing: 0.005em;
  text-decoration: none;
  color: var(--ink);
}

.index {
  display: flex;
  flex-wrap: wrap;
  gap: 4px clamp(12px, 2.5vw, 26px);
  font-size: 0.78rem;
  font-weight: 500;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.index a {
  text-decoration: none;
  color: var(--brown);
  padding-bottom: 2px;
  border-bottom: 1px solid transparent;
  transition: color 0.2s ease, border-color 0.2s ease;
}

.index a:hover {
  color: var(--ink);
  border-bottom-color: var(--accent);
}

/* ---------- Hero ---------- */

.hero-grid {
  display: grid;
  gap: 26px;
  padding-top: 26px;
}

.hero-media {
  order: -1;
  margin: 0;
}

.hero-media img {
  width: 100%;
  height: 45vh;
  height: 45svh;
  object-fit: cover;
}

.hero-copy {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 18px;
  padding-bottom: 8px;
}

.hero-copy h1 {
  font-size: clamp(3rem, 9vw, 4.6rem);
  line-height: 1.02;
  letter-spacing: -0.015em;
}

.hero-lede {
  margin: 0;
  font-family: var(--serif);
  font-style: italic;
  font-weight: 400;
  font-size: clamp(1.25rem, 3.4vw, 1.55rem);
  line-height: 1.35;
  padding-bottom: 0.08em;
  max-width: 32ch;
  color: var(--ink);
}

.hero-rating {
  margin: 0;
  display: flex;
  align-items: center;
  gap: 12px;
  color: var(--brown);
  font-size: 0.9rem;
  font-weight: 500;
}

.hero-rating-text {
  white-space: nowrap;
}

/* Star rows (shared) */

.stars {
  display: block;
  width: 110px;
  height: auto;
  flex: none;
}

.stars-base {
  fill: var(--star-empty);
}

.stars-fill {
  fill: var(--accent);
}

/* CTA */

.cta {
  display: inline-block;
  background: var(--accent);
  color: var(--paper);
  text-decoration: none;
  font-weight: 600;
  font-size: 0.95rem;
  letter-spacing: 0.02em;
  padding: 14px 30px;
  transition: background-color 0.2s ease, transform 0.15s ease;
}

.cta:hover {
  background: var(--accent-dark);
}

.cta:active {
  transform: translateY(1px);
}

/* ---------- El grano: story rail ---------- */

.rail {
  margin-top: clamp(56px, 9vw, 108px);
}

.rail-track {
  list-style: none;
  margin: 0;
  padding: 6px var(--gutter) 24px;
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: min(76%, 300px);
  gap: 20px;
  overflow-x: auto;
  overscroll-behavior-x: contain;
  scroll-snap-type: x mandatory;
  scrollbar-width: none;
}

.rail-track::-webkit-scrollbar {
  display: none;
}

.chapter {
  scroll-snap-align: start;
  margin: 0;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 12px;
  border-top: 1px solid var(--hairline);
  padding-top: 16px;
}

.chapter-num {
  font-family: var(--serif);
  font-weight: 500;
  font-size: 1.9rem;
  line-height: 1;
  color: var(--accent);
}

.chapter-media {
  margin: 4px 0 0;
  width: 100%;
}

.chapter-media img {
  width: 100%;
  aspect-ratio: 4 / 3;
  object-fit: cover;
}

.chapter-icon {
  display: block;
  margin: 10px 0 14px;
  color: var(--ink);
}

.chapter-icon svg {
  display: block;
  width: 46px;
  height: 46px;
}

.chapter h3 {
  font-size: 1.4rem;
}

.chapter p {
  margin: 0;
  color: var(--brown);
  font-size: 0.95rem;
  max-width: 30ch;
}

/* ---------- La mesa: broadsheet menu ---------- */

.menu {
  margin-top: clamp(56px, 9vw, 108px);
}

.menu-head {
  display: grid;
  gap: 26px;
  align-items: start;
}

.menu-photo {
  margin: 0;
  max-width: 420px;
}

.menu-photo img {
  width: 100%;
  aspect-ratio: 3 / 2;
  object-fit: cover;
}

.menu-photo figcaption {
  margin-top: 8px;
  font-size: 0.78rem;
  color: var(--brown);
}

.dishes {
  list-style: none;
  margin: clamp(24px, 4vw, 40px) 0 0;
  padding: 0;
  columns: 1;
}

.dishes li {
  break-inside: avoid;
  padding: 14px 0;
  border-bottom: 1px solid var(--hairline);
}

.dishes li:last-child {
  border-bottom: 0;
}

.dishes h3 {
  font-size: 1.28rem;
}

.dishes p {
  margin: 4px 0 0;
  color: var(--brown);
  font-size: 0.95rem;
}

.menu-note {
  margin: 18px 0 0;
  padding-top: 14px;
  border-top: 1px solid var(--hairline);
  font-family: var(--serif);
  font-style: italic;
  font-size: 0.92rem;
  color: var(--brown);
}

/* ---------- La prueba: reputation band ---------- */

.prueba {
  margin-top: clamp(56px, 9vw, 108px);
  background: var(--paper-deep);
  border-top: 1px solid var(--hairline);
  border-bottom: 1px solid var(--hairline);
  padding-top: clamp(40px, 7vw, 72px);
  padding-bottom: clamp(40px, 7vw, 72px);
}

.scores {
  margin: 0;
  display: grid;
}

.score {
  padding: 20px 0;
}

.score + .score {
  border-top: 1px solid var(--hairline);
}

.score dt {
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--brown);
}

.score dd {
  margin: 10px 0 0;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 8px;
}

.score-num {
  font-family: var(--serif);
  font-weight: 500;
  font-size: clamp(2.6rem, 6vw, 3.5rem);
  line-height: 1;
  color: var(--accent);
}

.score-sub {
  color: var(--brown);
  font-size: 0.95rem;
}

.presence {
  margin-top: clamp(28px, 5vw, 44px);
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px 20px;
}

.presence-label {
  font-family: var(--sans);
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--brown);
}

.chips {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.chips a,
.chip {
  display: inline-block;
  padding: 8px 16px;
  border: 1px solid var(--hairline);
  background: var(--paper);
  font-size: 0.85rem;
  font-weight: 500;
  color: var(--ink);
  text-decoration: none;
  transition: border-color 0.2s ease, color 0.2s ease;
}

.chips a:hover {
  border-color: var(--accent);
  color: var(--accent);
}

/* ---------- La propuesta ---------- */

.propuesta {
  margin-top: clamp(56px, 9vw, 108px);
}

.propuesta-inner {
  max-width: 640px;
  border-top: 3px double rgba(42, 27, 18, 0.45);
  padding-top: clamp(24px, 4vw, 36px);
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 16px;
}

.propuesta-inner p {
  margin: 0;
  max-width: 56ch;
}

.hook {
  font-family: var(--serif);
  font-style: italic;
  font-size: 1.2rem;
  line-height: 1.45;
  padding-bottom: 0.1em;
}

.propuesta-link {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  margin-top: 6px;
  color: var(--accent);
  font-weight: 600;
  font-size: 1rem;
  text-decoration: none;
  border-bottom: 2px solid var(--accent);
  padding-bottom: 4px;
  transition: color 0.2s ease, border-color 0.2s ease;
}

.propuesta-link:hover {
  color: var(--accent-dark);
  border-color: var(--accent-dark);
}

.propuesta-link svg {
  width: 18px;
  height: 18px;
  flex: none;
}

/* ---------- Colophon ---------- */

.colophon {
  margin-top: clamp(64px, 10vw, 120px);
  border-top: 1px solid var(--hairline);
  padding-top: 30px;
  padding-bottom: 44px;
}

.colophon p {
  margin: 0 0 10px;
  font-size: 0.82rem;
  line-height: 1.65;
  color: var(--brown);
  max-width: 78ch;
}

.colophon a {
  color: var(--brown);
  text-decoration: underline;
  text-underline-offset: 2px;
}

.colophon a:hover {
  color: var(--ink);
}

.colophon-brand {
  font-family: var(--serif);
  font-weight: 600;
  font-size: 1.05rem;
  color: var(--ink);
}

.colophon-note {
  font-weight: 500;
}

/* ---------- Breakpoints ---------- */

@media (min-width: 640px) {
  .dishes {
    columns: 2;
    column-gap: clamp(40px, 6vw, 80px);
    column-rule: 1px solid var(--hairline);
  }

  .scores {
    grid-template-columns: repeat(3, 1fr);
  }

  .score {
    padding: 8px 28px;
  }

  .score + .score {
    border-top: 0;
    border-left: 1px solid var(--hairline);
  }

  .score:first-child {
    padding-left: 0;
  }
}

@media (min-width: 820px) {
  .menu-photo img {
    aspect-ratio: 4 / 5;
  }
}

/* review t_94895e8d: two-up peek cramps step copy beside the neighbor's photo at 390px — stack one step per row */
@media (max-width: 479px) {
  .rail-track {
    grid-auto-flow: row;
    grid-auto-columns: unset;
    overflow-x: visible;
    scroll-snap-type: none;
    gap: 26px;
  }

  .chapter {
    scroll-snap-align: none;
  }
}

@media (min-width: 960px) {
  .hero-grid {
    grid-template-columns: minmax(0, 5fr) minmax(0, 7fr);
    gap: clamp(32px, 5vw, 72px);
    align-items: stretch;
    padding-top: clamp(40px, 6vh, 72px);
  }

  .hero-media {
    order: 0;
    height: 100%;
  }

  .hero-media img {
    height: 100%;
    min-height: 480px;
  }

  .hero-copy {
    padding-top: clamp(8px, 4vh, 56px);
    gap: 20px;
  }

  .rail-track {
    grid-auto-flow: row;
    grid-auto-columns: unset;
    grid-template-columns: repeat(4, 1fr);
    gap: clamp(24px, 3vw, 40px);
    overflow: visible;
    padding-left: 0;
    padding-right: 0;
  }

  /* keep rail aligned with the wrap gutter */
  .rail .wrap {
    padding-inline: var(--gutter);
  }

  .rail-track {
    padding-inline: 0;
  }

  .menu-head {
    grid-template-columns: minmax(0, 1fr) 260px;
    gap: clamp(32px, 5vw, 72px);
  }

  .menu-photo {
    max-width: none;
  }
}

/* ---------- Reduced motion ---------- */

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

  *,
  *::before,
  *::after {
    transition: none !important;
  }
}
