/* ============================================================
   Ana Mendes — Design System
   Phase 08 · 2026-06-13
   ============================================================ */

/* ── Google Fonts ─────────────────────────────────────────── */
@import url('https://fonts.googleapis.com/css2?family=Cormorant+Garant:ital,wght@0,400;0,600;1,400;1,600&family=Plus+Jakarta+Sans:wght@400;500;600&display=swap');

/* ── Tokens ───────────────────────────────────────────────── */
:root {
  --bg:           #FAF7F2;
  --bg-card:      #FFFEF9;
  --bg-sand:      #E8DFD0;
  --accent:       #C4603A;
  --accent-light: #F0D5C8;
  --accent-dark:  #A84E2E;
  --green:        #4A6741;
  --green-light:  #D4E4D0;
  --text:         #2C1A0E;
  --text-muted:   #8A7A6E;
  --border:       #E0D5C8;

  --font-serif: 'Cormorant Garant', Georgia, serif;
  --font-sans:  'Plus Jakarta Sans', system-ui, sans-serif;

  --space-xs: 0.5rem;
  --space-sm: 1rem;
  --space-md: 2rem;
  --space-lg: 4rem;
  --space-xl: 7rem;

  --radius:       4px;
  --radius-md:    8px;
  --max-width:    1200px;
  --content-width:720px;

  --shadow-sm: 0 2px 8px rgba(44, 26, 14, 0.07);
  --shadow-md: 0 8px 24px rgba(44, 26, 14, 0.10);
  --shadow-lg: 0 16px 48px rgba(44, 26, 14, 0.12);

  --transition: 0.22s cubic-bezier(0.4, 0, 0.2, 1);
  --ease-out-quart: cubic-bezier(0.25, 1, 0.5, 1);
}

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

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

body {
  font-family: var(--font-sans);
  font-size: 1rem;
  line-height: 1.7;
  color: var(--text);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
}

img { display: block; max-width: 100%; height: auto; }
a { color: inherit; text-decoration: none; }
ul, ol { list-style: none; }
button { cursor: pointer; border: none; background: none; font: inherit; }
input, textarea, select { font: inherit; }

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

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

/* ── Typography ───────────────────────────────────────────── */
h1, h2, h3, h4 {
  font-family: var(--font-serif);
  font-weight: 400;
  line-height: 1.2;
  color: var(--text);
}

h1 { font-size: clamp(2.5rem, 5vw, 4rem); }
h2 { font-size: clamp(1.75rem, 3vw, 2.5rem); }
h3 { font-size: 1.5rem; }
h4 { font-size: 1.2rem; font-weight: 600; }

p { max-width: 68ch; }

strong { font-weight: 600; }
em { font-style: italic; }

.text-muted { color: var(--text-muted); }
.text-accent { color: var(--accent); }
.serif { font-family: var(--font-serif); }

/* ── Layout ───────────────────────────────────────────────── */
.container {
  width: 100%;
  max-width: var(--max-width);
  margin-inline: auto;
  padding-inline: 1.5rem;
}

.container--narrow {
  max-width: var(--content-width);
}

section { padding-block: var(--space-lg); }

.grid-2 {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 2rem;
}

.grid-3 {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 2rem;
}

.grid-4 {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1.5rem;
}

/* ── Navigation ───────────────────────────────────────────── */
.nav {
  position: sticky;
  top: 0;
  z-index: 100;
  background: var(--bg);
  border-bottom: 1px solid transparent;
  transition: border-color var(--transition), box-shadow var(--transition);
}

.nav.scrolled {
  border-color: var(--border);
  box-shadow: var(--shadow-sm);
}

.nav__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 4rem;
}

.nav__logo {
  font-family: var(--font-serif);
  font-size: 1.35rem;
  font-weight: 600;
  color: var(--text);
  letter-spacing: -0.01em;
  line-height: 1.1;
}

.nav__logo span {
  display: block;
  font-style: italic;
  font-weight: 400;
  font-size: 0.85em;
  color: var(--text-muted);
}

.nav__links {
  display: flex;
  gap: 2.5rem;
  align-items: center;
}

.nav__links a {
  font-size: 0.9rem;
  font-weight: 500;
  color: var(--text-muted);
  transition: color var(--transition);
  position: relative;
}

.nav__links a::after {
  content: '';
  position: absolute;
  bottom: -2px;
  left: 0;
  width: 0;
  height: 1px;
  background: var(--accent);
  transition: width var(--transition);
}

.nav__links a:hover,
.nav__links a.active {
  color: var(--text);
}

.nav__links a:hover::after,
.nav__links a.active::after {
  width: 100%;
}

/* Hamburger */
.nav__hamburger {
  display: none;
  flex-direction: column;
  gap: 5px;
  padding: 4px;
}

.nav__hamburger span {
  display: block;
  width: 22px;
  height: 1.5px;
  background: var(--text);
  transition: transform var(--transition), opacity var(--transition);
}

.nav__hamburger.open span:nth-child(1) { transform: translateY(6.5px) rotate(45deg); }
.nav__hamburger.open span:nth-child(2) { opacity: 0; }
.nav__hamburger.open span:nth-child(3) { transform: translateY(-6.5px) rotate(-45deg); }

/* Mobile drawer */
.nav__drawer {
  display: none;
  position: fixed;
  inset: 4rem 0 0;
  background: var(--bg);
  padding: 2rem 1.5rem;
  border-top: 1px solid var(--border);
  flex-direction: column;
  gap: 1.5rem;
  z-index: 99;
}

.nav__drawer.open { display: flex; }

.nav__drawer a {
  font-family: var(--font-serif);
  font-size: 1.75rem;
  color: var(--text);
}

/* ── Buttons ──────────────────────────────────────────────── */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.7rem 1.5rem;
  border-radius: var(--radius);
  font-size: 0.9rem;
  font-weight: 500;
  transition: background var(--transition), color var(--transition), transform var(--transition);
  white-space: nowrap;
}

.btn--primary {
  background: var(--accent);
  color: #fff;
}

.btn--primary:hover {
  background: var(--accent-dark);
  transform: translateY(-1px);
}

.btn--outline {
  background: transparent;
  color: var(--accent);
  border: 1px solid var(--accent);
}

.btn--outline:hover {
  background: var(--accent-light);
}

.btn--ghost {
  color: var(--text);
  padding-inline: 0;
}

.btn--ghost:hover { color: var(--accent); }

/* ── Hero ─────────────────────────────────────────────────── */
.hero {
  padding-block: var(--space-xl) var(--space-lg);
  position: relative;
  overflow: hidden;
}

.hero__inner {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 4rem;
  align-items: center;
}

.hero__content { }

.hero__eyebrow {
  display: inline-block;
  font-size: 0.8rem;
  font-weight: 500;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 1.25rem;
}

.hero__title {
  font-size: clamp(2.75rem, 6vw, 4.5rem);
  line-height: 1.1;
  margin-bottom: 1.5rem;
  letter-spacing: -0.02em;
}

.hero__title em {
  color: var(--accent);
  font-style: italic;
}

.hero__lead {
  font-size: 1.1rem;
  color: var(--text-muted);
  margin-bottom: 2rem;
  line-height: 1.7;
  max-width: 46ch;
}

.hero__image {
  position: relative;
}

.hero__image img {
  width: 100%;
  height: 520px;
  object-fit: cover;
  border-radius: var(--radius-md);
}

.hero__image::before {
  content: '';
  position: absolute;
  inset: -1rem -1rem 1rem 1rem;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  z-index: -1;
}

/* ── Section headers ──────────────────────────────────────── */
.section-header {
  margin-bottom: var(--space-md);
}

.section-header h2 {
  margin-bottom: 0.5rem;
}

.section-header p {
  color: var(--text-muted);
  font-size: 1.05rem;
}

.section-header--row {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 1rem;
}

/* ── Recipe Cards ─────────────────────────────────────────── */
.recipe-card {
  background: var(--bg-card);
  border-radius: var(--radius-md);
  overflow: hidden;
  box-shadow: var(--shadow-sm);
  border: 1px solid var(--border);
  transition: transform 0.28s var(--ease-out-quart), box-shadow 0.28s var(--ease-out-quart);
  contain: layout style;
  will-change: transform;
}

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

.recipe-card__image {
  width: 100%;
  aspect-ratio: 4/3;
  object-fit: cover;
  transition: transform 0.4s ease;
}

.recipe-card:hover .recipe-card__image {
  transform: scale(1.03);
}

.recipe-card__img-wrap {
  overflow: hidden;
}

.recipe-card__body {
  padding: 1.25rem;
}

.recipe-card__tag {
  display: inline-block;
  background: var(--green-light);
  color: var(--green);
  font-size: 0.72rem;
  font-weight: 500;
  letter-spacing: 0.07em;
  text-transform: uppercase;
  padding: 0.2rem 0.6rem;
  border-radius: 20px;
  margin-bottom: 0.65rem;
}

.recipe-card__title {
  font-family: var(--font-serif);
  font-size: 1.3rem;
  font-weight: 400;
  line-height: 1.25;
  margin-bottom: 0.5rem;
  color: var(--text);
  transition: color var(--transition);
}

.recipe-card:hover .recipe-card__title {
  color: var(--accent);
}

.recipe-card__meta {
  display: flex;
  gap: 1rem;
  font-size: 0.82rem;
  color: var(--text-muted);
  margin-top: 0.75rem;
  padding-top: 0.75rem;
  border-top: 1px solid var(--border);
}

.recipe-card__meta span {
  display: flex;
  align-items: center;
  gap: 0.3rem;
}

/* ── Category Cards ───────────────────────────────────────── */
.cat-card {
  position: relative;
  border-radius: var(--radius-md);
  overflow: hidden;
  aspect-ratio: 3/2;
  display: block;
  transition: transform 0.28s var(--ease-out-quart);
  will-change: transform;
}

.cat-card:hover { transform: translateY(-3px); }

.cat-card img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.4s ease;
}

.cat-card:hover img { transform: scale(1.05); }

.cat-card__overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(to top, rgba(44,26,14,0.65) 0%, transparent 55%);
  display: flex;
  align-items: flex-end;
  padding: 1.25rem;
}

.cat-card__label {
  font-family: var(--font-serif);
  font-size: 1.3rem;
  color: #fff;
  font-weight: 400;
}

/* ── About strip ──────────────────────────────────────────── */
.about-strip {
  background: var(--bg-sand);
  border-radius: var(--radius-md);
  padding: var(--space-lg);
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 3rem;
  align-items: center;
}

.about-strip__avatar {
  width: 120px;
  height: 120px;
  border-radius: 50%;
  overflow: hidden;
  flex-shrink: 0;
  background: var(--accent);
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-serif);
  font-size: 2.5rem;
  color: #fff;
  font-weight: 400;
}

.about-strip__avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.about-strip__text h3 {
  margin-bottom: 0.75rem;
}

.about-strip__text p {
  color: var(--text-muted);
  margin-bottom: 1.25rem;
}

/* ── Filters ──────────────────────────────────────────────── */
.filters {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
  margin-bottom: var(--space-md);
}

.filter-btn {
  padding: 0.45rem 1.1rem;
  border-radius: 20px;
  font-size: 0.85rem;
  font-weight: 500;
  border: 1px solid var(--border);
  color: var(--text-muted);
  background: var(--bg-card);
  transition: all var(--transition);
}

.filter-btn:hover {
  border-color: var(--accent);
  color: var(--accent);
}

.filter-btn.active {
  background: var(--accent);
  color: #fff;
  border-color: var(--accent);
}

/* ── Recipe page ──────────────────────────────────────────── */
.recipe-hero {
  padding-top: var(--space-md);
}

.recipe-hero img {
  width: 100%;
  max-height: 500px;
  object-fit: cover;
  border-radius: var(--radius-md);
  margin-bottom: var(--space-md);
}

.recipe-meta-bar {
  display: flex;
  gap: 2rem;
  flex-wrap: wrap;
  background: var(--bg-sand);
  border-radius: var(--radius-md);
  padding: 1.25rem 1.5rem;
  margin-bottom: var(--space-md);
}

.recipe-meta-bar__item {
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
}

.recipe-meta-bar__label {
  font-size: 0.72rem;
  font-weight: 500;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-muted);
}

.recipe-meta-bar__value {
  font-family: var(--font-serif);
  font-size: 1.1rem;
  color: var(--text);
}

.recipe-body h2 {
  font-size: 1.6rem;
  margin-top: var(--space-md);
  margin-bottom: 1rem;
  padding-bottom: 0.5rem;
  border-bottom: 1px solid var(--border);
}

.recipe-body ul,
.recipe-body ol {
  padding-left: 1.25rem;
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
}

.recipe-body ul { list-style: disc; }
.recipe-body ol { list-style: decimal; }

.recipe-body li { max-width: 62ch; }

.recipe-note {
  background: var(--accent-light);
  border-left: 3px solid var(--accent);
  border-radius: 0 var(--radius) var(--radius) 0;
  padding: 1rem 1.25rem;
  margin-top: var(--space-md);
  font-size: 0.95rem;
  color: var(--text);
}

.recipe-note strong {
  color: var(--accent);
  display: block;
  margin-bottom: 0.25rem;
  font-size: 0.8rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

/* ── Breadcrumb ───────────────────────────────────────────── */
.breadcrumb {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.82rem;
  color: var(--text-muted);
  padding-block: 1rem;
  flex-wrap: wrap;
}

.breadcrumb a { color: var(--text-muted); }
.breadcrumb a:hover { color: var(--accent); }
.breadcrumb__sep { color: var(--border); }
.breadcrumb__current { color: var(--text); }

/* ── Page hero (non-homepage) ─────────────────────────────── */
.page-hero {
  padding-block: var(--space-lg) var(--space-md);
  border-bottom: 1px solid var(--border);
  margin-bottom: var(--space-lg);
}

.page-hero h1 { margin-bottom: 0.75rem; }
.page-hero p { color: var(--text-muted); font-size: 1.1rem; }

/* ── Contact form ─────────────────────────────────────────── */
.form-group {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
  margin-bottom: 1.25rem;
}

.form-group label {
  font-size: 0.85rem;
  font-weight: 500;
  color: var(--text);
}

.form-group input,
.form-group textarea,
.form-group select {
  padding: 0.7rem 1rem;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--bg-card);
  color: var(--text);
  font-size: 0.95rem;
  transition: border-color var(--transition);
}

.form-group input:focus,
.form-group textarea:focus,
.form-group select:focus {
  outline: none;
  border-color: var(--accent);
}

.form-group textarea { resize: vertical; min-height: 140px; }

/* ── Legal pages ──────────────────────────────────────────── */
.legal-body {
  max-width: var(--content-width);
}

.legal-body h2 {
  font-size: 1.4rem;
  margin-top: var(--space-md);
  margin-bottom: 0.75rem;
}

.legal-body p { margin-bottom: 1rem; }

.legal-body ul {
  list-style: disc;
  padding-left: 1.5rem;
  margin-bottom: 1rem;
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}

.legal-body a {
  color: var(--accent);
  text-decoration: underline;
  text-underline-offset: 2px;
}

/* ── Footer ───────────────────────────────────────────────── */
.footer {
  background: var(--text);
  color: rgba(255,255,255,0.7);
  padding-block: var(--space-lg);
  margin-top: var(--space-xl);
}

.footer__inner {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 3rem;
  align-items: start;
}

.footer__brand .nav__logo {
  color: #fff;
  margin-bottom: 0.75rem;
}

.footer__brand p {
  font-size: 0.85rem;
  max-width: 36ch;
  line-height: 1.6;
}

.footer__links {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  align-items: flex-end;
}

.footer__links a {
  font-size: 0.82rem;
  color: rgba(255,255,255,0.55);
  transition: color var(--transition);
}

.footer__links a:hover { color: rgba(255,255,255,0.9); }

.footer__bottom {
  margin-top: var(--space-md);
  padding-top: 1.5rem;
  border-top: 1px solid rgba(255,255,255,0.1);
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
  flex-wrap: wrap;
  font-size: 0.8rem;
  color: rgba(255,255,255,0.4);
}

/* ── Cookie Banner ────────────────────────────────────────── */
.cookie-banner {
  position: fixed;
  bottom: 1.5rem;
  left: 1.5rem;
  right: 1.5rem;
  max-width: 520px;
  background: var(--text);
  color: #fff;
  border-radius: var(--radius-md);
  padding: 1.25rem 1.5rem;
  box-shadow: var(--shadow-lg);
  z-index: 999;
  display: none;
}

.cookie-banner.visible { display: block; }

.cookie-banner p {
  font-size: 0.88rem;
  color: rgba(255,255,255,0.8);
  margin-bottom: 1rem;
  line-height: 1.6;
  max-width: none;
}

.cookie-banner p a {
  color: var(--accent-light);
  text-decoration: underline;
  text-underline-offset: 2px;
}

.cookie-banner__actions {
  display: flex;
  gap: 0.75rem;
  flex-wrap: wrap;
}

.cookie-banner__actions .btn--primary {
  font-size: 0.85rem;
  padding: 0.55rem 1.25rem;
}

.cookie-banner__actions .btn--ghost {
  font-size: 0.85rem;
  color: rgba(255,255,255,0.55);
}

.cookie-banner__actions .btn--ghost:hover {
  color: #fff;
}

/* ── Animations ───────────────────────────────────────────── */
.fade-up {
  opacity: 0;
  transform: translateY(24px);
  transition: opacity 0.6s var(--ease-out-quart), transform 0.6s var(--ease-out-quart);
}

.fade-up.visible {
  opacity: 1;
  transform: translateY(0);
}

.grid-3 .fade-up:nth-child(2) { transition-delay: 0.1s; }
.grid-3 .fade-up:nth-child(3) { transition-delay: 0.2s; }
.grid-4 .fade-up:nth-child(2) { transition-delay: 0.08s; }
.grid-4 .fade-up:nth-child(3) { transition-delay: 0.16s; }
.grid-4 .fade-up:nth-child(4) { transition-delay: 0.24s; }

@media (prefers-reduced-motion: reduce) {
  .fade-up { opacity: 1; transform: none; transition: none; }
}

/* ── Divider ──────────────────────────────────────────────── */
.divider {
  border: none;
  border-top: 1px solid var(--border);
  margin-block: var(--space-lg);
}

/* ── Tag list ─────────────────────────────────────────────── */
.tag-list {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
  margin-top: var(--space-md);
}

.tag {
  font-size: 0.78rem;
  font-weight: 500;
  color: var(--text-muted);
  border: 1px solid var(--border);
  border-radius: 20px;
  padding: 0.25rem 0.75rem;
}

/* ── Empty state ──────────────────────────────────────────── */
.empty-state {
  text-align: center;
  padding: var(--space-lg);
  color: var(--text-muted);
  font-family: var(--font-serif);
  font-size: 1.25rem;
  font-style: italic;
}

/* ── Responsive ───────────────────────────────────────────── */
@media (max-width: 900px) {
  .hero__inner { grid-template-columns: 1fr; }
  .hero__image { display: none; }
  .grid-3 { grid-template-columns: repeat(2, 1fr); }
  .grid-4 { grid-template-columns: repeat(2, 1fr); }
  .about-strip { grid-template-columns: 1fr; text-align: center; }
  .about-strip__avatar { margin-inline: auto; }
  .footer__inner { grid-template-columns: 1fr; }
  .footer__links { align-items: flex-start; }

  /* Sobre + Contacto two-column → single */
  .page-two-col { grid-template-columns: 1fr !important; gap: 2.5rem !important; }
}

@media (max-width: 640px) {
  :root {
    --space-lg: 3rem;
    --space-xl: 4rem;
  }

  .nav__links { display: none; }
  .nav__hamburger { display: flex; }

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

  .section-header--row {
    flex-direction: column;
    align-items: flex-start;
  }

  .recipe-meta-bar { gap: 1rem; }
  .cookie-banner { left: 1rem; right: 1rem; bottom: 1rem; }

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

/* ── Scrollbar (Firefox) ──────────────────────────────────── */
* { scrollbar-width: thin; scrollbar-color: var(--border) transparent; }
