/* La Casita Pupuseria — spec demo
   Plain CSS, no framework. Fonts: Anton (display) + Manrope (body),
   per the El Pueblo replication playbook. Cloned from the Changarro
   demo architecture (striking pack included) with La Casita content.
   Layout intent checked at two viewports:
     390x844  phone  — single column, sticky contact bar, hero 4/3
     1440x900 desktop — 1240px container, hero 16/9, 3-col gallery,
                        2-col menu, 3-col visit grid
   Mobile-first: base rules are the phone layout; min-width queries
   layer the desktop layout on top. */

:root {
  --ink: #221a14;
  --ink-soft: #57493c;
  --paper: #faf5ec;
  --paper-warm: #f3e9d7;
  --accent: #b3401e;        /* terracotta red */
  --accent-dark: #8c2f13;
  --sign-red: #C1272D;      /* from the restaurant's own signage */
  --sign-yellow: #F2B705;   /* yellow of the Pupuseria banner */
  --gold: #F2B705;
  --line: #e0d3bc;
  --slot-bg: #efe6d3;
  --max: 1240px;
  --radius: 14px;
}

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

html { scroll-behavior: smooth; }

body {
  font-family: "Manrope", system-ui, sans-serif;
  background: var(--paper);
  color: var(--ink);
  line-height: 1.55;
  padding-bottom: 76px; /* room for the mobile call bar */
}

a { color: var(--accent-dark); }

/* ---------- Preview marker ---------- */

.preview-bar {
  display: flex;
  align-items: center;
  gap: 10px;
  background: var(--ink);
  color: var(--paper);
  padding: 8px 16px;
  font-size: 0.82rem;
}

.preview-tag {
  font-family: "Anton", sans-serif;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  background: var(--gold);
  color: var(--ink);
  padding: 2px 10px;
  border-radius: 999px;
  font-size: 0.78rem;
}

.preview-text { opacity: 0.92; }

/* ---------- Header ---------- */

.site-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  max-width: var(--max);
  margin: 0 auto;
  padding: 16px 20px;
}

.wordmark {
  font-family: "Anton", sans-serif;
  font-size: 1.25rem;
  letter-spacing: 0.02em;
  color: var(--ink);
  text-decoration: none;
  text-transform: uppercase;
}

.wordmark .amp { color: var(--sign-red); }

.site-nav { display: none; } /* phone: nav hidden, call button carries the header */

.site-nav a {
  color: var(--ink);
  text-decoration: none;
  font-weight: 700;
  font-size: 0.95rem;
  margin-left: 26px;
}

.site-nav a:hover { color: var(--sign-red); }

/* ---------- Buttons ---------- */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-family: "Manrope", sans-serif;
  font-weight: 800;
  font-size: 1rem;
  text-decoration: none;
  border: 2px solid transparent;
  border-radius: 999px;
  padding: 12px 24px;
  cursor: pointer;
  transition: background 0.15s ease, color 0.15s ease;
}

.btn-call { background: var(--accent); color: #fff; }
.btn-call:hover { background: var(--sign-red); }

.btn-ghost {
  background: transparent;
  color: #fff;
  border-color: rgba(255, 255, 255, 0.75);
}
.btn-ghost:hover { border-color: #fff; }

.btn-order {
  background: var(--paper-warm);
  color: var(--ink-soft);
  border-color: var(--line);
  border-style: dashed;
}

.btn-wide { width: 100%; }

.header-call { padding: 9px 18px; font-size: 0.92rem; }

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

.hero-media {
  position: relative;
  max-width: var(--max);
  margin: 0 auto;
  aspect-ratio: 4 / 3;             /* phone intent at 390 wide */
  max-height: 82vh;
  border-radius: 0;
  overflow: hidden;
  background: var(--ink);
}

/* Both layers fill the wrapper, so swapping the placeholder for the
   film later changes nothing about the layout. */
.hero-video,
.hero-placeholder {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
}

.hero-video { object-fit: cover; }

.hero-placeholder {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
  text-align: center;
  padding: 24px;
  background:
    repeating-linear-gradient(45deg, rgba(255,255,255,0.04) 0 14px, transparent 14px 28px),
    linear-gradient(160deg, #3a2c1e, #221a14);
  color: var(--paper-warm);
}

.slot-label {
  font-family: "Anton", sans-serif;
  text-transform: uppercase;
  letter-spacing: 0.14em;
  font-size: 0.95rem;
  border: 2px dashed var(--gold);
  border-radius: 999px;
  padding: 8px 18px;
}

.slot-note { font-size: 0.85rem; opacity: 0.8; max-width: 34ch; }

.hero-shade {
  position: absolute;
  inset: 0;
  background:
    linear-gradient(180deg, rgba(20, 13, 8, 0.05) 28%, rgba(20, 13, 8, 0.42) 58%, rgba(20, 13, 8, 0.84) 100%),
    linear-gradient(90deg, rgba(20, 13, 8, 0.38) 0%, rgba(20, 13, 8, 0) 68%);
  pointer-events: none;
}

.hero-content {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  padding: 24px 20px 28px;
  color: #fff;
}

.hero-title {
  font-family: "Anton", sans-serif;
  font-size: clamp(3rem, 14vw, 4.4rem);
  line-height: 0.95;
  text-transform: uppercase;
  letter-spacing: 0.01em;
  text-shadow: 0 2px 22px rgba(20, 13, 8, 0.45);
}

.hero-sub {
  margin-top: 10px;
  font-size: 1.02rem;
  font-weight: 600;
  max-width: 40ch;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 18px;
}

.motion-toggle {
  position: absolute;
  top: 14px;
  right: 14px;
  z-index: 3;
  background: rgba(20, 13, 8, 0.72);
  color: #fff;
  border: 1px solid rgba(255, 255, 255, 0.4);
  border-radius: 999px;
  padding: 7px 14px;
  font-family: "Manrope", sans-serif;
  font-weight: 700;
  font-size: 0.82rem;
  cursor: pointer;
}

.hero-facts {
  max-width: var(--max);
  margin: 0 auto;
  padding: 14px 20px 4px;
  display: flex;
  flex-wrap: wrap;
  gap: 6px 10px;
  align-items: center;
  font-weight: 700;
  color: var(--ink-soft);
  font-size: 0.95rem;
}

.hero-facts a { color: var(--accent-dark); text-decoration: none; }
.hero-facts .dot { color: var(--gold); }

/* Live open-now badge: hidden in markup until js/main.js computes the
   status from the verified hours, so a script failure shows nothing. */
.open-badge {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 3px 12px 3px 9px;
  font-size: 0.88rem;
  color: var(--ink);
}

.open-badge[hidden] { display: none; }

.open-dot {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: #1e8e3e;
  box-shadow: 0 0 0 3px rgba(30, 142, 62, 0.18);
  flex: none;
}

.open-badge.is-closed .open-dot {
  background: var(--sign-red);
  box-shadow: 0 0 0 3px rgba(193, 39, 45, 0.15);
}

/* ---------- Marquee ribbon ---------- */

.marquee {
  background: var(--sign-yellow);
  overflow: hidden;
  margin-top: 16px;
  padding: 10px 0;
}

.marquee-track {
  display: flex;
  width: max-content;
  animation: marquee-scroll 30s linear infinite;
}

.marquee-seq {
  font-family: "Anton", sans-serif;
  color: var(--ink);
  text-transform: uppercase;
  letter-spacing: 0.09em;
  font-size: 1.05rem;
  white-space: nowrap;
  padding-right: 18px;
}

@keyframes marquee-scroll {
  to { transform: translateX(-50%); }
}

/* ---------- Sections ---------- */

.section {
  max-width: var(--max);
  margin: 0 auto;
  padding: 52px 20px 8px;
}

.section-head h2 {
  font-family: "Anton", sans-serif;
  font-size: 2rem;
  text-transform: uppercase;
  letter-spacing: 0.02em;
}

.section-head h2::after {
  content: "";
  display: block;
  width: 56px;
  height: 4px;
  border-radius: 2px;
  background: var(--sign-red);
  margin-top: 10px;
}

.section-head p {
  margin-top: 8px;
  color: var(--ink-soft);
  max-width: 56ch;
}

/* ---------- Gallery slots ---------- */

/* Oversized outlined word behind the gallery. Stroke-only Anton at
   low opacity; content layers sit above it via z-index. */
.gallery {
  position: relative;
  overflow: clip;
}

.gallery-word {
  position: absolute;
  top: 6px;
  left: 50%;
  transform: translateX(-50%);
  font-family: "Anton", sans-serif;
  font-size: clamp(5rem, 17vw, 13rem);
  line-height: 1;
  text-transform: uppercase;
  letter-spacing: 0.02em;
  white-space: nowrap;
  color: rgba(34, 26, 20, 0.05); /* fallback where text-stroke is unsupported */
  -webkit-text-stroke: 2px rgba(193, 39, 45, 0.30);
  -webkit-text-fill-color: transparent;
  opacity: 0.55;
  pointer-events: none;
  user-select: none;
  z-index: 0;
}

.gallery .section-head,
.gallery .gallery-grid {
  position: relative;
  z-index: 1;
}

.gallery-grid {
  display: grid;
  grid-template-columns: 1fr;      /* phone: one slot per row */
  gap: 20px;
  margin-top: 26px;
}

.slot { display: block; }

.slot-box {
  aspect-ratio: 4 / 3;
  background:
    repeating-linear-gradient(45deg, rgba(34, 26, 20, 0.045) 0 12px, transparent 12px 24px),
    var(--slot-bg);
  border: 2px dashed var(--line);
  border-radius: var(--radius);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
  text-align: center;
}

.slot-box .slot-label {
  color: var(--ink-soft);
  border-color: var(--ink-soft);
  font-size: 0.8rem;
}

.slot figcaption {
  margin-top: 10px;
  font-weight: 700;
  font-size: 0.92rem;
  color: var(--ink-soft);
}

/* Captured photos replace .slot-box with an img.slot-img of the
   same aspect ratio, so the grid never moves. */
.slot-img {
  width: 100%;
  aspect-ratio: 4 / 3;
  object-fit: cover;
  border-radius: var(--radius);
  display: block;
}

/* Portrait captures in 4/3 slots: shift the cover crop window so
   signage in the upper part of the frame stays readable. */
.slot-img.obj-top { object-position: center 18%; }
.slot-img.obj-upper { object-position: center 36%; }

/* Film slot: fills the slot box exactly like the photo slots. */
.slot-video {
  width: 100%;
  aspect-ratio: 4 / 3;
  object-fit: cover;
  border-radius: var(--radius);
  display: block;
  background: var(--ink);
}

/* ---------- Menu preview ---------- */

.menu { padding-bottom: 16px; }

.menu-list {
  list-style: none;
  margin-top: 26px;
  display: grid;
  grid-template-columns: 1fr;
  gap: 0 48px;
}

.menu-item {
  display: flex;
  align-items: baseline;
  gap: 12px;
  padding: 16px 2px;
  border-bottom: 1px solid var(--line);
}

.menu-item .dish {
  font-family: "Anton", sans-serif;
  font-size: 1.3rem;
  letter-spacing: 0.02em;
  text-transform: uppercase;
}

.menu-item .dish-alt {
  color: var(--ink-soft);
  font-weight: 600;
  font-size: 0.95rem;
}

/* La Casita carries the full printed menu, so prices are real here:
   transcribed from the menu photographed on site, 2026-11-17. The
   item markup is a .dish-line (name left, price right) over a
   .dish-desc line, grouped under .menu-group heads. */
.menu-group { margin-top: 44px; }

.menu-group-head {
  font-family: "Anton", sans-serif;
  font-size: 1.55rem;
  letter-spacing: 0.02em;
  text-transform: uppercase;
}

.menu-group-head::after {
  content: "";
  display: block;
  width: 44px;
  height: 3px;
  border-radius: 2px;
  background: var(--sign-yellow);
  margin-top: 8px;
}

.menu-subhead { font-size: 1.2rem; margin-top: 30px; }

.menu-group-note {
  margin-top: 8px;
  color: var(--ink-soft);
  font-size: 0.95rem;
  max-width: 62ch;
}

.menu-group .menu-list { margin-top: 8px; }

.menu-group .menu-item {
  display: block;
  padding: 13px 2px;
}

.dish-line {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 14px;
}

.price {
  font-weight: 800;
  font-size: 1.02rem;
  color: var(--ink);
  white-space: nowrap;
  text-align: right;
}

.dish-desc {
  color: var(--ink-soft);
  font-size: 0.95rem;
  margin-top: 2px;
  max-width: 58ch;
}

.flavor-line {
  margin-top: 12px;
  font-weight: 700;
  font-size: 1.02rem;
  max-width: 62ch;
}

/* Café board photo: full-width figure inside the café section. */
.cafe-photo { margin-top: 26px; }

.cafe-img {
  width: 100%;
  aspect-ratio: 16 / 10;
  object-fit: cover;
  object-position: center 30%;
  border-radius: var(--radius);
  display: block;
}

.cafe-photo figcaption {
  margin-top: 10px;
  font-weight: 700;
  font-size: 0.92rem;
  color: var(--ink-soft);
}

/* Story band reuses the visit grid; soften its paragraph text. */
.story .visit-block p { color: var(--ink-soft); }

/* Dish gallery: staged photos in cards, stacked on phone,
   2x2 from the tablet breakpoint up. */
.menu-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 22px;
  margin-top: 26px;
}

.dish-card {
  background: #fffbf3;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
  position: relative;
  transition: transform 0.25s ease, box-shadow 0.25s ease;
}

.dish-card:hover,
.dish-card:focus-within {
  transform: translateY(-4px);
  box-shadow: 0 14px 30px rgba(34, 26, 20, 0.14);
}

/* Sheen sweep across the card on hover or focus. */
.dish-card::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(115deg, transparent 30%, rgba(255, 255, 255, 0.35) 48%, transparent 62%);
  transform: translateX(-120%);
  transition: transform 0.6s ease;
  pointer-events: none;
}

.dish-card:hover::after,
.dish-card:focus-within::after {
  transform: translateX(120%);
}

.dish-img {
  width: 100%;
  aspect-ratio: 3 / 2;
  object-fit: cover;
  display: block;
}

.dish-info {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 14px 16px 16px;
}

.dish-name {
  font-family: "Anton", sans-serif;
  font-size: 1.3rem;
  letter-spacing: 0.02em;
  text-transform: uppercase;
}

.dish-name .dish-alt {
  font-family: "Manrope", sans-serif;
  color: var(--ink-soft);
  font-weight: 600;
  font-size: 0.95rem;
  letter-spacing: 0;
  text-transform: none;
}

.dish-caption {
  color: var(--accent-dark);
  font-size: 0.82rem;
  font-weight: 700;
}

.menu-note {
  margin-top: 18px;
  color: var(--ink-soft);
  font-size: 0.92rem;
}

/* ---------- Visit ---------- */

.visit-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 28px;
  margin-top: 26px;
}

.visit-block h3 {
  font-family: "Anton", sans-serif;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  font-size: 1.05rem;
  margin-bottom: 10px;
}

.visit-block address {
  font-style: normal;
  font-size: 1.05rem;
  line-height: 1.6;
}

.hours-line { color: var(--ink-soft); font-weight: 600; }
.hours-line.hours-gap { margin-top: 12px; }
.hours-time { font-size: 1.3rem; font-weight: 800; }
.hours-note { color: var(--ink-soft); font-size: 0.92rem; }

.visit-actions .btn { margin-bottom: 10px; }

.order-note {
  color: var(--ink-soft);
  font-size: 0.92rem;
  margin-top: 4px;
}

/* ---------- Footer ---------- */

.site-footer {
  max-width: var(--max);
  margin: 56px auto 0;
  padding: 28px 20px 12px;
  border-top: 1px solid var(--line);
  color: var(--ink-soft);
  font-size: 0.92rem;
}

.footer-name { font-weight: 700; color: var(--ink); }
.footer-demo { margin-top: 6px; }

/* ---------- Mobile sticky call bar ---------- */

.mobile-callbar {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 10;
  padding: 10px 14px calc(10px + env(safe-area-inset-bottom));
  background: rgba(250, 245, 236, 0.96);
  border-top: 1px solid var(--line);
}

/* ---------- Desktop layout: 1440x900 intent ---------- */

@media (min-width: 760px) {
  .gallery-grid { grid-template-columns: repeat(2, 1fr); }
  .menu-list { grid-template-columns: repeat(2, 1fr); }
  .menu-grid { grid-template-columns: repeat(2, 1fr); }
  .visit-grid { grid-template-columns: repeat(3, 1fr); }
}

@media (min-width: 1024px) {
  body { padding-bottom: 0; }
  .mobile-callbar { display: none; }
  .site-nav { display: block; }
  .site-header { padding: 20px 24px; }
  .wordmark { font-size: 1.45rem; }

  .hero-media {
    aspect-ratio: 16 / 9;          /* desktop intent at 1440 wide */
    border-radius: var(--radius);
  }

  .hero-content { padding: 40px 44px 44px; }
  .hero-title { font-size: clamp(4.6rem, 7.2vw, 7rem); }

  .section { padding: 72px 24px 8px; }
  .section-head h2 { font-size: 2.6rem; }
  .gallery-grid { grid-template-columns: repeat(3, 1fr); gap: 26px; }
}

/* ---------- Pointer trail and scroll parallax ---------- */

/* Trail frames are spawned by js/main.js on fine-pointer devices
   only. They never intercept clicks and remove themselves. */
.trail-frame {
  position: fixed;
  z-index: 60;
  width: 96px;
  aspect-ratio: 4 / 3;
  object-fit: cover;
  border: 2px solid #fff;
  border-radius: 10px;
  box-shadow: 0 10px 24px rgba(20, 13, 8, 0.28);
  pointer-events: none;
  animation: trail-life 0.95s ease-out forwards;
}

@keyframes trail-life {
  0%   { opacity: 0; transform: translate(-50%, -50%) rotate(var(--tilt, 0deg)) scale(0.7); }
  18%  { opacity: 1; }
  100% { opacity: 0; transform: translate(-50%, -60%) rotate(var(--tilt, 0deg)) scale(1); }
}

/* Parallax frames are wrapped around gallery and dish images by
   js/main.js on touch devices. Without the script, no wrapper exists
   and the base .slot-img / .dish-img rules apply untouched. */
.px-frame {
  display: block;
  overflow: hidden;
}

.slot .px-frame {
  aspect-ratio: 4 / 3;
  border-radius: var(--radius);
}

.dish-card .px-frame { aspect-ratio: 3 / 2; }

.cafe-photo .px-frame {
  aspect-ratio: 16 / 10;
  border-radius: var(--radius);
}

.px-frame .cafe-img {
  aspect-ratio: auto;
  height: 100%;
}

.px-frame .slot-img,
.px-frame .dish-img {
  aspect-ratio: auto;
  height: 100%;
}

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

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .btn { transition: none; }
  .marquee-track { animation: none; }
  .dish-card, .dish-card::after { transition: none; }
  .trail-frame { display: none; }
}
