@import url("https://fonts.googleapis.com/css2?family=DM+Sans:wght@400;500;600;700&family=Fraunces:opsz,wght@9..144,500;9..144,600;9..144,700&display=swap");

:root {
  --ink: #1d2b27;
  --muted: #66716c;
  --cream: #f7f0e4;
  --paper: #fffdf8;
  --green: #173f35;
  --green-soft: #dfe9df;
  --red: #b83b2d;
  --red-dark: #8f291f;
  --gold: #d89b3c;
  --line: #ded8cb;
  --shadow: 0 18px 60px rgba(29, 43, 39, 0.12);
  --radius: 18px;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  color: var(--ink);
  background: var(--paper);
  font-family: "DM Sans", system-ui, sans-serif;
  line-height: 1.6;
}

body.dialog-open {
  overflow: hidden;
}

button,
input {
  font: inherit;
}

button,
a {
  -webkit-tap-highlight-color: transparent;
}

button {
  color: inherit;
}

a {
  color: inherit;
  text-decoration: none;
}

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

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

.skip-link {
  position: fixed;
  top: 10px;
  left: 10px;
  z-index: 100;
  padding: 10px 16px;
  color: white;
  background: var(--green);
  transform: translateY(-150%);
  transition: transform 0.2s;
}

.skip-link:focus {
  transform: translateY(0);
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 30;
  color: white;
  background: rgba(23, 63, 53, 0.97);
  border-bottom: 1px solid rgba(255, 255, 255, 0.12);
  backdrop-filter: blur(16px);
}

.header-inner {
  width: min(1180px, calc(100% - 40px));
  height: 76px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 12px;
}

.brand-mark {
  width: 39px;
  height: 39px;
  display: grid;
  place-items: center;
  flex: 0 0 auto;
  color: var(--green);
  background: var(--cream);
  border-radius: 50%;
  font-family: "Fraunces", Georgia, serif;
  font-size: 24px;
  font-weight: 700;
}

.brand strong,
.brand small {
  display: block;
  line-height: 1.15;
}

.brand strong {
  font-family: "Fraunces", Georgia, serif;
  font-size: 18px;
}

.brand small {
  margin-top: 4px;
  color: rgba(255, 255, 255, 0.67);
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 28px;
  font-size: 14px;
  font-weight: 600;
}

.nav-links a,
.nav-favorites {
  opacity: 0.83;
  transition: opacity 0.2s;
}

.nav-links a:hover,
.nav-favorites:hover {
  opacity: 1;
}

.nav-favorites {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 0;
  color: white;
  background: transparent;
  border: 0;
  cursor: pointer;
}

.nav-favorites > span:first-child {
  font-size: 21px;
}

.favorite-count {
  min-width: 23px;
  height: 23px;
  display: inline-grid;
  place-items: center;
  color: var(--green);
  background: var(--cream);
  border-radius: 50%;
  font-size: 11px;
}

.menu-button {
  display: none;
  width: 42px;
  height: 42px;
  padding: 10px;
  background: transparent;
  border: 0;
  cursor: pointer;
}

.menu-button span {
  display: block;
  height: 2px;
  margin: 5px 0;
  background: white;
}

.hero {
  position: relative;
  min-height: 650px;
  display: flex;
  align-items: center;
  overflow: hidden;
  color: white;
  background: var(--green) url("/assets/images/hero-mesa-mexicana.webp") center/cover no-repeat;
}

.hero-overlay {
  position: absolute;
  inset: 0;
  background:
    linear-gradient(90deg, rgba(11, 35, 29, 0.92) 0%, rgba(11, 35, 29, 0.76) 42%, rgba(11, 35, 29, 0.12) 78%),
    linear-gradient(0deg, rgba(11, 35, 29, 0.28), transparent 45%);
}

.hero-content {
  position: relative;
  z-index: 1;
  width: min(1180px, calc(100% - 40px));
  margin: 0 auto;
  padding: 78px 0 118px;
}

.hero-content > * {
  max-width: 610px;
}

.eyebrow {
  margin: 0 0 18px;
  color: #f4ce89;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.19em;
  text-transform: uppercase;
}

.eyebrow-dark {
  color: var(--red);
}

h1,
h2,
h3,
p {
  margin-top: 0;
}

h1,
h2,
h3 {
  font-family: "Fraunces", Georgia, serif;
  line-height: 1.08;
}

h1 {
  margin-bottom: 24px;
  font-size: clamp(48px, 6vw, 76px);
  font-weight: 600;
  letter-spacing: -0.045em;
}

.hero-copy {
  margin-bottom: 34px;
  color: rgba(255, 255, 255, 0.78);
  font-size: 18px;
  line-height: 1.7;
}

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

.button {
  min-height: 50px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  padding: 0 22px;
  border: 1px solid transparent;
  border-radius: 3px;
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
  transition: transform 0.2s, background 0.2s, color 0.2s;
}

.button:hover {
  transform: translateY(-2px);
}

.button-primary {
  color: white;
  background: var(--red);
}

.button-primary:hover {
  background: var(--red-dark);
}

.button-ghost {
  color: white;
  background: rgba(255, 255, 255, 0.08);
  border-color: rgba(255, 255, 255, 0.46);
}

.button-ghost:hover {
  background: rgba(255, 255, 255, 0.16);
}

.button-dark {
  color: white;
  background: var(--green);
}

.hero-note {
  position: absolute;
  right: max(24px, calc((100% - 1180px) / 2));
  bottom: 34px;
  z-index: 1;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 15px;
  color: var(--ink);
  background: rgba(255, 253, 248, 0.92);
  border-radius: 4px;
  box-shadow: var(--shadow);
  backdrop-filter: blur(12px);
}

.hero-note-icon {
  color: var(--red);
  font-size: 22px;
}

.hero-note small,
.hero-note strong {
  display: block;
  line-height: 1.25;
}

.hero-note small {
  color: var(--muted);
  font-size: 10px;
  text-transform: uppercase;
}

.hero-note strong {
  font-family: "Fraunces", Georgia, serif;
}

.intro,
.catalog,
.newsletter,
.site-footer {
  width: min(1180px, calc(100% - 40px));
  margin-right: auto;
  margin-left: auto;
}

.intro {
  padding: 84px 0 60px;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 80px;
  align-items: end;
  border-bottom: 1px solid var(--line);
}

.intro h2,
.catalog h2,
.newsletter h2 {
  margin-bottom: 0;
  font-size: clamp(34px, 4vw, 52px);
  letter-spacing: -0.035em;
}

.intro > p {
  max-width: 510px;
  margin-bottom: 4px;
  color: var(--muted);
  font-size: 16px;
}

.catalog {
  padding: 68px 0 110px;
}

.catalog-heading {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 24px;
  margin-bottom: 30px;
}

.results-label {
  margin-bottom: 8px;
  color: var(--muted);
  font-size: 13px;
}

.catalog-tools {
  display: flex;
  align-items: center;
  gap: 18px;
  margin-bottom: 38px;
}

.search-box {
  min-width: 320px;
  height: 48px;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 0 14px;
  background: white;
  border: 1px solid var(--line);
}

.search-box > span:first-child {
  color: var(--muted);
  font-size: 24px;
  line-height: 1;
}

.search-box input {
  min-width: 0;
  flex: 1;
  outline: 0;
  background: transparent;
  border: 0;
}

.search-box:focus-within {
  border-color: var(--green);
  box-shadow: 0 0 0 3px rgba(23, 63, 53, 0.1);
}

.search-box kbd {
  padding: 2px 6px;
  color: #8b938f;
  background: #f4f1eb;
  border: 1px solid #e4ded3;
  border-radius: 3px;
  font-family: inherit;
  font-size: 10px;
}

.filters {
  display: flex;
  align-items: center;
  gap: 8px;
  overflow-x: auto;
  scrollbar-width: none;
}

.filter-chip {
  min-height: 38px;
  padding: 0 15px;
  white-space: nowrap;
  background: transparent;
  border: 1px solid var(--line);
  border-radius: 999px;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
}

.filter-chip:hover,
.filter-chip.active {
  color: white;
  background: var(--green);
  border-color: var(--green);
}

.recipe-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 32px 24px;
}

.recipe-card {
  position: relative;
  background: white;
  border: 1px solid var(--line);
  transition: transform 0.25s, box-shadow 0.25s;
}

.recipe-card:hover {
  transform: translateY(-6px);
  box-shadow: var(--shadow);
}

.card-image-wrap {
  position: relative;
  aspect-ratio: 4 / 3;
  overflow: hidden;
  background: var(--green-soft);
}

.card-image {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.5s;
}

.recipe-card:hover .card-image {
  transform: scale(1.035);
}

.card-region {
  position: absolute;
  left: 14px;
  bottom: 14px;
  padding: 6px 10px;
  color: var(--ink);
  background: rgba(255, 253, 248, 0.91);
  border-radius: 2px;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  backdrop-filter: blur(8px);
}

.like-button {
  position: absolute;
  top: 14px;
  right: 14px;
  z-index: 2;
  width: 42px;
  height: 42px;
  display: grid;
  place-items: center;
  padding: 0;
  color: var(--green);
  background: rgba(255, 253, 248, 0.94);
  border: 0;
  border-radius: 50%;
  box-shadow: 0 6px 18px rgba(29, 43, 39, 0.15);
  font-size: 24px;
  line-height: 1;
  cursor: pointer;
  transition: color 0.2s, transform 0.2s;
}

.like-button:hover {
  transform: scale(1.08);
}

.like-button.liked {
  color: var(--red);
}

.card-body {
  padding: 22px 22px 20px;
}

.card-kicker {
  margin-bottom: 8px;
  color: var(--red);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.card-title {
  margin-bottom: 10px;
  font-size: 25px;
  letter-spacing: -0.025em;
}

.card-description {
  min-height: 50px;
  margin-bottom: 18px;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.55;
}

.card-meta {
  display: flex;
  align-items: center;
  gap: 16px;
  padding-top: 15px;
  color: var(--muted);
  border-top: 1px solid #ebe6dd;
  font-size: 12px;
}

.card-meta span {
  display: inline-flex;
  align-items: center;
  gap: 5px;
}

.card-open {
  margin-left: auto;
  padding: 0;
  color: var(--green);
  background: transparent;
  border: 0;
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
}

.card-open:hover {
  color: var(--red);
}

.empty-state {
  padding: 80px 20px;
  text-align: center;
  background: var(--cream);
  border: 1px solid var(--line);
}

.empty-state > span {
  display: block;
  margin-bottom: 10px;
  color: var(--red);
  font-size: 50px;
}

.empty-state h3 {
  margin-bottom: 8px;
  font-size: 28px;
}

.empty-state p {
  color: var(--muted);
}

.quote-band {
  padding: 90px 20px;
  color: white;
  background: var(--green);
  text-align: center;
}

.quote-band > span {
  display: block;
  height: 42px;
  color: var(--gold);
  font-family: "Fraunces", Georgia, serif;
  font-size: 64px;
  line-height: 1;
}

.quote-band blockquote {
  margin: 10px 0 20px;
  font-family: "Fraunces", Georgia, serif;
  font-size: clamp(29px, 4vw, 46px);
  line-height: 1.25;
}

.quote-band p {
  margin-bottom: 0;
  color: rgba(255, 255, 255, 0.58);
  font-size: 12px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.newsletter {
  padding: 88px 0;
  display: grid;
  grid-template-columns: 1fr 0.9fr;
  gap: 90px;
  align-items: center;
}

.newsletter h2 {
  margin-bottom: 16px;
}

.newsletter p:not(.eyebrow) {
  max-width: 520px;
  margin-bottom: 0;
  color: var(--muted);
}

.newsletter-form {
  display: flex;
  border-bottom: 2px solid var(--ink);
}

.newsletter-form input {
  min-width: 0;
  flex: 1;
  padding: 16px 5px;
  outline: 0;
  background: transparent;
  border: 0;
}

.newsletter-form button {
  padding: 0 4px 0 18px;
  color: var(--red);
  background: transparent;
  border: 0;
  font-weight: 700;
  cursor: pointer;
}

.site-footer {
  padding: 34px 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  color: var(--muted);
  border-top: 1px solid var(--line);
  font-size: 12px;
}

.footer-brand .brand-mark {
  color: white;
  background: var(--green);
}

.footer-brand strong {
  color: var(--ink);
}

.footer-brand small {
  color: var(--muted);
  letter-spacing: 0;
  text-transform: none;
}

.site-footer p {
  margin: 0;
}

.recipe-dialog {
  width: min(1000px, calc(100% - 32px));
  max-height: min(880px, calc(100vh - 32px));
  padding: 0;
  overflow: hidden;
  color: var(--ink);
  background: var(--paper);
  border: 0;
  box-shadow: 0 30px 100px rgba(0, 0, 0, 0.35);
}

.recipe-dialog::backdrop {
  background: rgba(10, 24, 20, 0.73);
  backdrop-filter: blur(5px);
}

.dialog-shell {
  position: relative;
  max-height: inherit;
  overflow-y: auto;
}

.dialog-close {
  position: fixed;
  z-index: 5;
  width: 44px;
  height: 44px;
  margin: 14px 0 0 min(930px, calc(100vw - 94px));
  display: grid;
  place-items: center;
  padding: 0 0 3px;
  color: white;
  background: rgba(17, 42, 35, 0.8);
  border: 1px solid rgba(255, 255, 255, 0.35);
  border-radius: 50%;
  font-size: 29px;
  line-height: 1;
  cursor: pointer;
  backdrop-filter: blur(8px);
}

.dialog-hero {
  position: relative;
  min-height: 380px;
  display: flex;
  align-items: end;
  padding: 45px;
  color: white;
  background-position: center;
  background-size: cover;
}

.dialog-hero::before {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(0deg, rgba(11, 30, 25, 0.88), transparent 78%);
}

.dialog-hero-content {
  position: relative;
  z-index: 1;
  max-width: 660px;
}

.dialog-hero .eyebrow {
  margin-bottom: 10px;
}

.dialog-hero h2 {
  margin-bottom: 12px;
  font-size: clamp(38px, 6vw, 60px);
  letter-spacing: -0.04em;
}

.dialog-hero p {
  margin-bottom: 0;
  color: rgba(255, 255, 255, 0.76);
}

.dialog-body {
  padding: 38px 45px 52px;
}

.dialog-toolbar {
  display: flex;
  align-items: center;
  gap: 12px;
  padding-bottom: 28px;
  border-bottom: 1px solid var(--line);
}

.dialog-stats {
  display: flex;
  gap: 20px;
  margin-right: auto;
  color: var(--muted);
  font-size: 13px;
}

.tool-button {
  min-height: 40px;
  padding: 0 14px;
  background: transparent;
  border: 1px solid var(--line);
  cursor: pointer;
}

.tool-button:hover {
  border-color: var(--green);
}

.tool-button.liked {
  color: var(--red);
}

.servings-control {
  margin: 34px 0;
  display: flex;
  align-items: center;
  gap: 14px;
}

.servings-control strong {
  margin-right: 4px;
}

.servings-control button {
  width: 32px;
  height: 32px;
  padding: 0;
  background: white;
  border: 1px solid var(--line);
  border-radius: 50%;
  cursor: pointer;
}

.recipe-columns {
  display: grid;
  grid-template-columns: 0.82fr 1.18fr;
  gap: 54px;
}

.recipe-columns h3 {
  margin-bottom: 22px;
  font-size: 27px;
}

.ingredient-list,
.steps-list {
  padding: 0;
  margin: 0;
  list-style: none;
}

.ingredient-list li {
  border-bottom: 1px solid #ebe6dd;
}

.ingredient-list label {
  display: flex;
  gap: 10px;
  padding: 11px 0;
  color: #4f5a55;
  font-size: 14px;
  cursor: pointer;
}

.ingredient-list input {
  accent-color: var(--green);
}

.ingredient-list label:has(input:checked) span {
  color: #9aa09d;
  text-decoration: line-through;
}

.steps-list {
  counter-reset: step;
}

.steps-list li {
  position: relative;
  padding: 0 0 26px 48px;
  color: #4f5a55;
  font-size: 14px;
}

.steps-list li::before {
  counter-increment: step;
  content: counter(step);
  position: absolute;
  top: -2px;
  left: 0;
  width: 30px;
  height: 30px;
  display: grid;
  place-items: center;
  color: white;
  background: var(--red);
  border-radius: 50%;
  font-size: 12px;
  font-weight: 700;
}

.toast {
  position: fixed;
  right: 22px;
  bottom: 22px;
  z-index: 80;
  max-width: 340px;
  padding: 13px 18px;
  color: white;
  background: var(--ink);
  box-shadow: var(--shadow);
  opacity: 0;
  transform: translateY(18px);
  pointer-events: none;
  transition: opacity 0.25s, transform 0.25s;
}

.toast.show {
  opacity: 1;
  transform: translateY(0);
}

@media (max-width: 900px) {
  .recipe-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .catalog-tools {
    align-items: stretch;
    flex-direction: column;
  }

  .search-box {
    min-width: 0;
  }

  .newsletter {
    grid-template-columns: 1fr;
    gap: 34px;
  }

  .recipe-columns {
    gap: 32px;
  }
}

@media (max-width: 680px) {
  .header-inner {
    height: 66px;
  }

  .menu-button {
    display: block;
  }

  .nav-links {
    position: absolute;
    top: 66px;
    right: 0;
    left: 0;
    display: none;
    padding: 22px;
    align-items: stretch;
    flex-direction: column;
    gap: 18px;
    background: var(--green);
    border-top: 1px solid rgba(255, 255, 255, 0.12);
  }

  .nav-links.open {
    display: flex;
  }

  .hero {
    min-height: 620px;
    background-position: 61% center;
  }

  .hero-overlay {
    background: linear-gradient(90deg, rgba(11, 35, 29, 0.92), rgba(11, 35, 29, 0.48));
  }

  .hero-content {
    padding: 72px 0 136px;
  }

  h1 {
    font-size: 47px;
  }

  .hero-copy {
    font-size: 16px;
  }

  .hero-note {
    right: 20px;
    bottom: 24px;
    left: 20px;
  }

  .intro {
    padding-top: 64px;
    grid-template-columns: 1fr;
    gap: 18px;
  }

  .catalog-heading {
    align-items: start;
    flex-direction: column;
  }

  .recipe-grid {
    grid-template-columns: 1fr;
  }

  .card-description {
    min-height: auto;
  }

  .quote-band br {
    display: none;
  }

  .site-footer {
    align-items: flex-start;
    flex-direction: column;
  }

  .recipe-dialog {
    width: 100%;
    max-height: 100dvh;
    margin: 0;
  }

  .dialog-close {
    right: 14px;
    margin-left: 0;
  }

  .dialog-hero {
    min-height: 350px;
    padding: 32px 24px;
  }

  .dialog-body {
    padding: 28px 24px 42px;
  }

  .dialog-toolbar {
    align-items: stretch;
    flex-wrap: wrap;
  }

  .dialog-stats {
    width: 100%;
  }

  .recipe-columns {
    grid-template-columns: 1fr;
  }
}

@media print {
  body > *:not(.recipe-dialog),
  .dialog-close,
  .dialog-toolbar,
  .servings-control button {
    display: none !important;
  }

  .recipe-dialog {
    position: static;
    width: 100%;
    max-height: none;
    display: block;
    box-shadow: none;
  }

  .dialog-shell {
    max-height: none;
    overflow: visible;
  }

  .dialog-hero {
    min-height: 220px;
    color: black;
    background-image: none !important;
    border-bottom: 2px solid black;
  }

  .dialog-hero::before {
    display: none;
  }

  .dialog-hero p {
    color: #333;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    transition-duration: 0.01ms !important;
  }
}
