/* KADO MEXA public site. Warm izakaya at night: dark wood, lantern glow, cream paper, torii red. */
:root {
  --night: #14100d;
  --night-2: #1d1612;
  --wood: #2a1c14;
  --lantern: #f2a53b;
  --red: #c9231f;
  --red-dark: #9d1815;
  --red-bright: #e8463f; /* red text on the dark background */
  --paper: #f6ecd9;
  --paper-2: #efe1c7;
  --ink: #2a1f17;
  --ink-soft: #6d5c4b;
  --line: #d9c7a6;
  --on-night: #f3e8d6;
  --on-night-soft: #c9b79e;
  --ok: #3f7a45;
  --warn: #b8731c;
  --radius: 14px;
  --serif: "Iowan Old Style", "Palatino Linotype", Palatino, "Book Antiqua", Georgia, serif;
  --sans: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --header-h: 64px;
  --tabbar-h: 62px;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--night);
  color: var(--on-night);
  font: 16px/1.5 var(--sans);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}
main { flex: 1; }
a { color: inherit; }
img { max-width: 100%; display: block; }
h1, h2, h3 { font-family: var(--serif); margin: 0; font-weight: 700; line-height: 1.15; }
:focus-visible { outline: 3px solid var(--lantern); outline-offset: 2px; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* ---------- Header ---------- */
.site-header {
  position: sticky; top: 0; z-index: 30;
  background: rgba(20, 16, 13, .94);
  backdrop-filter: blur(6px);
  border-bottom: 1px solid rgba(242, 165, 59, .18);
}
.header-inner {
  max-width: 1200px; margin: 0 auto; padding: 0 20px;
  height: var(--header-h);
  display: flex; align-items: center; gap: 28px;
}
.brand { display: inline-flex; align-items: center; gap: 10px; text-decoration: none; color: var(--on-night); }
.brand-mark { width: 56px; height: 56px; flex: none; object-fit: contain; mix-blend-mode: lighten; }
.brand-text { display: flex; flex-direction: column; line-height: 1.1; }
.brand-text strong { font-family: var(--sans); letter-spacing: .08em; font-size: .95rem; }
.brand-text small { font-size: .62rem; letter-spacing: .3em; color: var(--on-night-soft); }
.main-nav { display: flex; gap: 22px; }
.main-nav a { text-decoration: none; font-size: .9rem; color: var(--on-night-soft); padding: 6px 0; border-bottom: 2px solid transparent; }
.main-nav a:hover { color: var(--on-night); }
.main-nav a[aria-current="page"] { color: #ff5a4f; border-bottom-color: var(--red); }
.search { margin-left: auto; }
.search input {
  width: 220px; padding: 9px 14px; border-radius: 999px; border: 1px solid rgba(243, 232, 214, .25);
  background: rgba(243, 232, 214, .94); color: var(--ink); font: inherit; font-size: .85rem;
}
.search input::placeholder { color: var(--ink-soft); }
.icon-btn {
  display: none; width: 44px; height: 44px; align-items: center; justify-content: center;
  color: var(--on-night); border-radius: 50%; cursor: pointer; text-decoration: none;
}
.icon-btn svg { width: 24px; height: 24px; }

/* ---------- Mobile drawer (no JavaScript: a hidden checkbox drives it) ---------- */
.menu-toggle { position: absolute; opacity: 0; pointer-events: none; }
.drawer-backdrop, .drawer { display: none; }

/* ---------- Hero ---------- */
.hero {
  position: relative; overflow: hidden;
  background:
    radial-gradient(520px 340px at 12% 8%, rgba(242, 165, 59, .35), transparent 70%),
    radial-gradient(420px 300px at 88% 14%, rgba(242, 165, 59, .28), transparent 70%),
    radial-gradient(700px 420px at 70% 100%, rgba(201, 35, 31, .22), transparent 70%),
    linear-gradient(180deg, #2a1a10 0%, #17100b 100%);
}
.hero::before { /* wooden beams */
  content: ""; position: absolute; inset: 0; opacity: .18; pointer-events: none;
  background: repeating-linear-gradient(90deg, transparent 0 118px, rgba(0, 0, 0, .55) 118px 120px);
}
.hero-inner {
  position: relative; max-width: 1200px; margin: 0 auto; padding: 72px 20px 150px;
  display: grid; grid-template-columns: 1.05fr 1fr; align-items: center; gap: 24px; min-height: 420px;
}
.hero-copy h1 {
  font-size: clamp(2.2rem, 5vw, 3.6rem); font-style: italic; font-weight: 600; letter-spacing: -.01em;
  text-shadow: 0 2px 18px rgba(0, 0, 0, .55);
}
.hero-copy p { margin: 16px 0 26px; font-size: 1.05rem; color: var(--on-night); max-width: 34ch; text-shadow: 0 1px 8px rgba(0, 0, 0, .6); }
.hero-actions { display: flex; gap: 12px; flex-wrap: wrap; }
.hero-art { width: 100%; max-height: 520px; object-fit: contain; object-position: right bottom; justify-self: end; }
.hero.has-image .hero-inner { padding-bottom: 120px; }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 46px; padding: 0 24px; border-radius: 8px; font-weight: 600; font-size: .95rem;
  text-decoration: none; border: 1px solid transparent; cursor: pointer;
}
.btn-primary { background: var(--red); color: #fff; box-shadow: 0 6px 18px rgba(201, 35, 31, .4); }
.btn-primary:hover { background: var(--red-dark); }

/* ---------- Paper panel (featured recipes) ---------- */
.paper {
  position: relative; z-index: 1;
  max-width: 1200px; margin: -112px auto 48px; width: calc(100% - 40px);
  background:
    radial-gradient(900px 260px at 0 0, rgba(255, 255, 255, .55), transparent 70%),
    linear-gradient(180deg, var(--paper), var(--paper-2));
  color: var(--ink);
  border-radius: 18px; border: 1px solid var(--line);
  box-shadow: 0 24px 60px rgba(0, 0, 0, .55);
  padding: 28px 28px 32px;
}
.section-head { display: flex; justify-content: space-between; align-items: flex-end; gap: 12px; margin-bottom: 18px; }
.section-head h2 { font-size: 1.6rem; }
.muted { margin: 4px 0 0; color: var(--ink-soft); font-size: .9rem; }
.see-all { color: var(--red-dark); font-weight: 600; font-size: .85rem; text-decoration: none; white-space: nowrap; }
.see-all:hover { text-decoration: underline; }

.card-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; }
.recipe-card { position: relative; display: block; color: var(--ink); }
/* The title is the card's one link, stretched over the whole card; the save button sits above it. */
.card-link { color: inherit; text-decoration: none; }
.card-link::after { content: ""; position: absolute; inset: 0; z-index: 1; border-radius: inherit; }
.card-link:focus-visible { outline: none; }
.card-link:focus-visible::after { outline: 3px solid var(--lantern); outline-offset: 2px; }
.save-btn {
  position: absolute; top: 0; left: 0; z-index: 2; width: 44px; height: 44px; padding: 0; border: 0;
  display: grid; place-items: center; background: none; color: #fff; cursor: pointer;
}
.save-btn[hidden] { display: none; }
.save-ring { width: 32px; height: 32px; border-radius: 50%; display: grid; place-items: center; background: rgba(20, 16, 13, .62); box-shadow: 0 2px 8px rgba(0, 0, 0, .35); }
.save-ring .icon { width: 18px; height: 18px; }
.save-btn[aria-pressed="true"] .save-ring { background: var(--red); }
.save-btn[aria-pressed="true"] .icon { fill: currentColor; }
.save-btn:focus-visible { outline: 3px solid var(--lantern); outline-offset: -3px; border-radius: 50%; }
.card-status { margin: 8px 0 0; }
.status { display: inline-flex; align-items: center; gap: 5px; padding: 2px 9px; border-radius: 999px; font-size: .7rem; font-weight: 600; border: 1px solid currentColor; }
.status .icon { width: 13px; height: 13px; }
.status-tested { color: var(--ok); }
.status-proposal { color: var(--ink-soft); border-style: dashed; }
.thumb {
  position: relative; aspect-ratio: 4 / 3; border-radius: 12px; overflow: hidden;
  background: radial-gradient(circle at 30% 20%, #5a3a24, #24160e);
  box-shadow: 0 6px 16px rgba(60, 35, 15, .35);
}
.thumb img { width: 100%; height: 100%; object-fit: cover; transition: transform .35s ease; }
.recipe-card:hover .thumb img { transform: scale(1.04); }
.thumb-empty { position: absolute; inset: 0; display: grid; place-items: center; font-size: 2.6rem; color: rgba(242, 165, 59, .55); }
.tag {
  position: absolute; left: 0; bottom: 10px; padding: 3px 12px 3px 9px; font-size: .72rem; font-weight: 600;
  color: #fff; background: var(--red); border-radius: 0 6px 6px 0;
}
.recipe-card h3 { font-family: var(--sans); font-size: .95rem; font-weight: 600; margin: 10px 0 6px; line-height: 1.3; }
.recipe-card:hover h3 { text-decoration: underline; }
.meta { margin: 0; display: flex; gap: 8px; flex-wrap: wrap; align-items: center; font-size: .76rem; color: var(--ink-soft); }
.time { display: inline-flex; align-items: center; gap: 4px; }
.time svg { width: 14px; height: 14px; }
.level { padding: 2px 8px; border-radius: 999px; border: 1px solid currentColor; font-weight: 600; }
.level-facil { color: var(--ok); }
.level-intermedia { color: var(--warn); }
.level-dificil { color: var(--red-dark); }
.empty { padding: 28px 8px; text-align: center; color: var(--ink-soft); font-family: var(--serif); font-size: 1.1rem; }
.chev { display: none; } /* only the phone catalog shows the arrow */

/* Rich card (home featured): white panel, category badge, plain difficulty and the summary. */
.recipe-card-rich {
  display: flex; flex-direction: column; overflow: hidden;
  background: #fffaf0; border: 1px solid var(--line); border-radius: 12px; box-shadow: 0 6px 18px rgba(80, 50, 20, .14);
}
.recipe-card-rich .thumb { aspect-ratio: 16 / 9; border-radius: 0; box-shadow: none; }
.card-badge {
  position: absolute; top: 10px; right: 10px; width: 38px; height: 38px; border-radius: 50%;
  display: grid; place-items: center; color: var(--red); background: #fffaf0; box-shadow: 0 2px 8px rgba(0, 0, 0, .3);
}
.card-badge .icon { width: 20px; height: 20px; vertical-align: 0; }
.recipe-card-rich h3 { margin: 16px 18px 10px; font-family: var(--serif); font-size: 1.08rem; }
.recipe-card-rich .meta { margin: 0 18px; gap: 18px; font-size: .8rem; }
.recipe-card-rich .card-status { margin: 10px 18px 0; }
.level-plain { display: inline-flex; align-items: center; gap: 5px; }
.level-plain .icon { width: 15px; height: 15px; }
.card-summary { margin: 12px 18px 18px; font-size: .84rem; line-height: 1.45; color: var(--ink-soft); }

.btn-outline { background: transparent; color: var(--red-dark); border-color: var(--red); }
.btn-outline:hover { background: rgba(201, 35, 31, .08); }

/* ---------- Footer ---------- */
.site-footer { padding: 28px 20px 36px; text-align: center; color: var(--on-night-soft); font-size: .85rem; border-top: 1px solid rgba(242, 165, 59, .12); }
.site-footer p { margin: 0; }
.footer-brand { display: flex; align-items: center; justify-content: center; gap: 6px; }
.footer-brand .brand-mark { width: 38px; height: 38px; }

/* ---------- Bottom tab bar (phones) ---------- */
.tabbar { display: none; }

/* ---------- Tablet ---------- */
@media (max-width: 1020px) {
  .card-grid { grid-template-columns: repeat(2, 1fr); }
}

/* ---------- Phone ---------- */
@media (max-width: 760px) {
  body { padding-bottom: var(--tabbar-h); }
  .header-inner { padding: 0 8px; gap: 4px; justify-content: space-between; }
  .main-nav, .search { display: none; }
  .icon-btn { display: inline-flex; }
  .brand-text small { display: none; }

  .hero-inner { grid-template-columns: 1fr; padding: 36px 20px 120px; min-height: 0; }
  .hero-copy h1 { font-size: 2rem; }
  .hero-copy p { font-size: .95rem; margin: 12px 0 20px; }
  .hero-actions .btn { width: 100%; }
  .hero-art { max-height: 260px; justify-self: center; order: -1; }

  .paper { margin-top: -88px; width: calc(100% - 24px); padding: 20px 16px 24px; border-radius: 14px; }
  .section-head h2 { font-size: 1.25rem; }
  .card-grid { grid-template-columns: 1fr; gap: 14px; }
  .recipe-card { display: grid; grid-template-columns: 112px 1fr; gap: 0 12px; align-items: start; }
  .recipe-card .thumb { grid-row: span 3; aspect-ratio: 1; }
  .recipe-card h3 { margin: 2px 0 6px; }
  .recipe-card .card-status { grid-column: 2; margin-top: 2px; }
  .tag { bottom: 6px; font-size: .64rem; padding: 2px 8px 2px 6px; }
  .recipe-card-rich { display: grid; grid-template-columns: 104px 1fr; align-items: start; gap: 0 12px; padding: 8px; }
  .recipe-card-rich .thumb { grid-row: span 4; aspect-ratio: 1; border-radius: 10px; }
  .recipe-card-rich .card-status { grid-column: 2; margin: 6px 0 0; }
  .recipe-card-rich h3 { margin: 4px 0 6px; font-size: 1rem; }
  .recipe-card-rich .meta { margin: 0; gap: 12px; font-size: .76rem; }
  .card-summary {
    margin: 6px 0 0; font-size: .8rem;
    display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
  }
  .card-badge { top: 6px; right: 6px; width: 28px; height: 28px; }
  .card-badge .icon { width: 16px; height: 16px; }

  .site-footer { padding-bottom: 20px; }
  .tabbar {
    display: flex; position: fixed; left: 0; right: 0; bottom: 0; z-index: 30; height: var(--tabbar-h);
    background: rgba(246, 236, 217, .98); border-top: 1px solid var(--line);
  }
  .tabbar a {
    flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px;
    text-decoration: none; color: var(--ink-soft); font-size: .7rem; font-weight: 600;
  }
  .tabbar a svg { width: 22px; height: 22px; }
  .tabbar a[aria-current="page"] { color: var(--red); }

  .drawer-backdrop {
    display: block; position: fixed; inset: 0; z-index: 40; background: rgba(0, 0, 0, .6);
    opacity: 0; pointer-events: none; transition: opacity .2s;
  }
  .drawer {
    display: flex; flex-direction: column; gap: 4px; position: fixed; top: 0; bottom: 0; left: 0; z-index: 50;
    width: min(78vw, 300px); padding: 24px 20px; background: var(--night-2);
    border-right: 1px solid rgba(242, 165, 59, .2);
    transform: translateX(-100%); transition: transform .22s ease;
  }
  .drawer .brand { margin-bottom: 18px; }
  .drawer > a:not(.brand) { padding: 12px 8px; text-decoration: none; font-size: 1.05rem; border-radius: 8px; color: var(--on-night); }
  .drawer > a[aria-current="page"] { background: rgba(201, 35, 31, .22); color: #ff8a80; }
  .menu-toggle:checked ~ .drawer { transform: none; }
  .menu-toggle:checked ~ .drawer-backdrop { opacity: 1; pointer-events: auto; }
  .menu-toggle:focus-visible ~ .site-header .menu-btn { outline: 3px solid var(--lantern); }
}

@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; }
}

/* Fade the hero into the page so the paper panel does not sit on a hard edge. */
.hero::after {
  content: ""; position: absolute; left: 0; right: 0; bottom: 0; height: 160px; pointer-events: none;
  background: linear-gradient(180deg, transparent, var(--night));
}
.hero-inner { z-index: 1; }

/* ---------- Icons inside buttons and links, footer navigation ---------- */
.btn .icon { width: 18px; height: 18px; }
.see-all { display: inline-flex; align-items: center; gap: 6px; }
.see-all .icon { width: 16px; height: 16px; }
.footer-nav { display: flex; justify-content: center; flex-wrap: wrap; gap: 8px 22px; margin-bottom: 12px; }
.footer-nav a { display: inline-flex; align-items: center; gap: 6px; min-height: 36px; text-decoration: none; color: var(--on-night); font-weight: 600; }
.footer-nav a:hover { color: #ff8a80; }
.btn-ghost-night { background: transparent; color: var(--on-night); border-color: rgba(243, 232, 214, .45); }
.btn-ghost-night:hover { background: rgba(243, 232, 214, .12); }

/* ---------- 404 ---------- */
.not-found {
  position: relative; overflow: hidden; display: grid; place-items: center; min-height: 62vh; padding: 56px 20px 72px;
  background:
    radial-gradient(520px 340px at 50% 0, rgba(242, 165, 59, .28), transparent 70%),
    linear-gradient(180deg, #2a1a10, #17100b);
}
.not-found-inner { position: relative; z-index: 1; text-align: center; max-width: 520px; }
.not-found-icon {
  display: inline-grid; place-items: center; width: 84px; height: 84px; border-radius: 50%; margin-bottom: 8px;
  color: var(--lantern); border: 1.5px solid rgba(242, 165, 59, .6); background: rgba(242, 165, 59, .08);
}
.not-found-icon .icon, .not-found-icon svg { width: 40px; height: 40px; }
.not-found-code { margin: 6px 0 0; font-family: var(--serif); font-size: 1rem; letter-spacing: .4em; color: var(--lantern); }
.not-found h1 { font-size: clamp(2rem, 5vw, 3rem); font-style: italic; font-weight: 600; margin-top: 6px; }
.not-found p { color: var(--on-night-soft); }
.not-found-actions { display: flex; flex-wrap: wrap; justify-content: center; gap: 12px; margin-top: 26px; }

/* ---------- Tablet and phone refinements ---------- */
@media (min-width: 761px) and (max-width: 1020px) {
  .card-grid .thumb { aspect-ratio: 3 / 2; }
  .paper { margin-bottom: 40px; }
}
@media (max-width: 760px) {
  .see-all { min-height: 44px; }
  .paper { margin-bottom: 24px; }
  .footer-nav { display: none; } /* the bottom tab bar already navigates */
  .not-found { min-height: 70vh; }
  .not-found-actions .btn { width: 100%; }
}

/* ---------- Photo hero and story bands (home and catalog) ---------- */
.hero-photo {
  position: absolute; inset: 0; width: 100%; height: 100%; max-width: none;
  object-fit: cover; object-position: 72% 58%;
}
.hero-shade { /* keeps the headline readable over the photo */
  position: absolute; inset: 0; pointer-events: none;
  background:
    linear-gradient(90deg, rgba(20, 16, 13, .92) 0%, rgba(20, 16, 13, .7) 32%, rgba(20, 16, 13, .1) 62%, transparent 80%),
    linear-gradient(180deg, rgba(20, 16, 13, .45), transparent 30%);
}
.hero.has-photo .lantern { opacity: .55; }

.story {
  position: relative; overflow: hidden; isolation: isolate;
  display: flex; align-items: center; min-height: clamp(460px, 44vw, 620px);
  scroll-margin-top: var(--header-h);
}
.story + .story { border-top: 1px solid rgba(242, 165, 59, .14); }
.story-media { position: absolute; inset: 0; z-index: -1; overflow: hidden; }
.story-media::after { /* dark on the text side, the art shows on the right */
  content: ""; position: absolute; inset: 0;
  background:
    linear-gradient(90deg, var(--night) 0%, rgba(20, 16, 13, .82) 30%, rgba(20, 16, 13, .15) 60%, transparent 78%),
    linear-gradient(180deg, var(--night), transparent 18%, transparent 82%, var(--night));
}
.story-photo { width: 100%; height: 100%; max-width: none; object-fit: cover; object-position: 70% 50%; }
.story > .petals { z-index: 0; }
.story-inner {
  position: relative; z-index: 1; width: 100%; max-width: 1200px; margin: 0 auto; padding: 72px 20px;
}
.story-inner > * { max-width: 30rem; }
.eyebrow {
  display: inline-flex; align-items: center; gap: 8px; margin: 0 0 12px;
  font-size: .78rem; font-weight: 700; letter-spacing: .22em; text-transform: uppercase; color: var(--lantern);
}
.eyebrow .icon { width: 18px; height: 18px; }
.hero-copy .eyebrow { margin: 0 0 12px; max-width: none; font-size: .78rem; color: var(--lantern); text-shadow: none; }
.story h2 {
  font-size: clamp(2rem, 4.2vw, 3rem); font-style: italic; font-weight: 600;
  text-shadow: 0 2px 18px rgba(0, 0, 0, .6);
}
.story-lead { margin: 14px 0 22px; font-size: 1.05rem; color: var(--on-night); text-shadow: 0 1px 8px rgba(0, 0, 0, .7); }

@media (min-width: 761px) and (max-width: 1020px) {
  .story-inner > * { max-width: 25rem; }
  .story-media::after {
    background:
      linear-gradient(90deg, var(--night) 0%, rgba(20, 16, 13, .86) 38%, rgba(20, 16, 13, .25) 70%, transparent 90%),
      linear-gradient(180deg, var(--night), transparent 18%, transparent 82%, var(--night));
  }
}

/* Phone: the art sits on top, the text below it. */
@media (max-width: 760px) {
  .hero-shade {
    background: linear-gradient(180deg, rgba(20, 16, 13, .9) 0%, rgba(20, 16, 13, .72) 40%, rgba(20, 16, 13, .12) 66%, transparent 100%);
  }
  .story { display: block; min-height: 0; }
  .story-media { position: relative; z-index: 0; aspect-ratio: 4 / 3; }
  .story-media::after { background: linear-gradient(180deg, var(--night), transparent 20%, transparent 55%, var(--night)); }
  .story-photo { object-position: 78% 50%; }
  .story-inner { margin-top: -56px; padding: 0 20px 48px; }
  .story-inner > * { max-width: none; }
  .story-lead { font-size: 1rem; }
  .story .btn { width: 100%; }
}

/* ---------- Quick filters: "¿Qué se te antoja hoy?" (home and catalog) ---------- */
.quick { display: flex; flex-wrap: wrap; gap: 10px; }
.quick a {
  display: inline-flex; align-items: center; gap: 8px; min-height: 44px; padding: 8px 20px;
  border-radius: 999px; border: 1px solid var(--line); background: rgba(255, 255, 255, .7);
  color: var(--ink); text-decoration: none; font-size: .9rem; font-weight: 600; white-space: nowrap;
}
.quick a .icon { width: 18px; height: 18px; color: var(--red); }
.quick a:hover { background: #fff; }
.quick a[aria-current="true"] { background: var(--red); border-color: var(--red); color: #fff; box-shadow: 0 6px 16px rgba(201, 35, 31, .3); }
.quick a[aria-current="true"] .icon { color: #fff; }
.quick a:focus-visible { outline: 3px solid var(--lantern); outline-offset: 2px; }
@media (max-width: 760px) {
  .quick { flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; padding-bottom: 4px; }
}

/* A class that sets `display` must not defeat the `hidden` attribute. */
[hidden] { display: none !important; }

.site-footer .footer-privacy { max-width: 40rem; margin: 10px auto 0; padding: 0 16px; text-align: center; color: var(--on-night-soft); font-size: .78rem; line-height: 1.5; }
