/* tuttimangi.com — classic trattoria design system (burgundy / forest / cream) */

:root {
  /* Primary brand (deep wine/burgundy — matches logo wordmark) */
  --terracotta: #7B2424;
  --terracotta-dark: #581616;
  --burgundy: #7B2424;
  --burgundy-dark: #581616;
  --brand-accent: #C2410C;       /* terracotta accent (".com" in logo, link hovers) */
  /* Italian tricolore */
  --olive: #4D7C0F;
  --olive-dark: #365314;
  --tomato: #B91C1C;
  --tomato-light: #FCA5A5;
  --basil: #14532D;
  --basil-light: #4ADE80;
  --lemon: #F0B43A;
  --lemon-pale: #FBEBC8;
  /* Neutrals */
  --cream: #F5EBD8;
  --stucco: #FAF4E6;
  --paper: #FFFDF6;
  --ink: #2D1810;
  --ink-soft: #5C3424;
  --muted: #8A7659;
  --line: #E5D8BC;
  --shadow: 0 4px 16px rgba(45, 24, 16, 0.08);
  --shadow-lg: 0 8px 32px rgba(45, 24, 16, 0.16);
  --radius: 14px;
  --radius-lg: 20px;
  --radius-sm: 10px;
  --display: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --sans: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --serif: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  font-family: var(--sans);
  color: var(--ink);
  background: var(--stucco);
  background-image:
    radial-gradient(at 12% 8%, rgba(20, 83, 45, 0.06), transparent 40%),
    radial-gradient(at 88% 24%, rgba(123, 36, 36, 0.06), transparent 40%),
    radial-gradient(at 50% 92%, rgba(240, 180, 58, 0.08), transparent 50%);
  background-attachment: fixed;
  line-height: 1.55;
  min-height: 100vh;
}

h1, h2, h3, h4 {
  font-family: var(--display);
  font-weight: 600;
  letter-spacing: -0.025em;
  color: var(--ink);
  margin: 0 0 0.5em;
}
h1 { font-size: clamp(2.2rem, 5.5vw, 3.8rem); font-weight: 700; letter-spacing: -0.035em; }
h2 { font-size: clamp(1.6rem, 3vw, 2.3rem); letter-spacing: -0.03em; }
h3 { font-size: 1.25rem; }

a { color: var(--terracotta); text-decoration: none; transition: color 120ms; }
a:hover { color: var(--terracotta-dark); text-decoration: underline; text-decoration-thickness: 2px; }

p { margin: 0 0 1em; }

/* === LAYOUT === */
.container { max-width: 1240px; margin: 0 auto; padding: 24px; }
.narrow { max-width: 760px; margin: 0 auto; padding: 24px; }

/* === NAV === */
.site-nav {
  position: sticky; top: 0; z-index: 50;
  background: rgba(255, 253, 248, 0.92);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--line);
}
.site-nav-inner {
  max-width: 1240px; margin: 0 auto; padding: 14px 24px;
  display: flex; gap: 24px; align-items: center; justify-content: space-between;
}
.brand {
  font-family: var(--serif);
  font-size: 1.6rem; font-weight: 700;
  letter-spacing: -0.02em;
  color: var(--burgundy);
  display: flex; align-items: center; gap: 10px;
  line-height: 1;
}
.brand-logo { width: 40px; height: 40px; display: block; object-fit: contain; }
.brand-word { display: inline-flex; align-items: baseline; }
.brand-tld { font-size: 0.7em; color: var(--brand-accent); font-weight: 600; letter-spacing: 0; }
.brand-mark {
  width: 32px; height: 32px;
  background: var(--burgundy);
  color: var(--cream);
  border-radius: 50%;
  display: inline-flex; align-items: center; justify-content: center;
  font-size: 1.2rem;
}
.nav-links { display: flex; gap: 4px; align-items: center; flex-wrap: wrap; }
.nav-links a {
  padding: 8px 14px; border-radius: 99px;
  color: var(--ink-soft); font-weight: 500; font-size: 0.95rem;
}
.nav-links a:hover { background: var(--lemon-pale); text-decoration: none; color: var(--terracotta-dark); }
.nav-links a.active { background: var(--terracotta); color: var(--cream); }
.nav-links a.active:hover { color: var(--cream); }

/* === BUTTONS === */
.btn {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 12px 22px;
  background: var(--terracotta);
  color: var(--cream);
  border: none; border-radius: var(--radius-sm);
  font-family: var(--sans);
  font-size: 0.95rem; font-weight: 600;
  cursor: pointer;
  transition: transform 100ms, background 120ms, box-shadow 120ms;
  text-decoration: none;
  box-shadow: var(--shadow);
}
.btn:hover { background: var(--terracotta-dark); transform: translateY(-1px); text-decoration: none; color: var(--cream); }
.btn:active { transform: translateY(0); }
.btn.btn-secondary { background: var(--olive); }
.btn.btn-secondary:hover { background: var(--olive-dark); }
.btn.btn-ghost { background: transparent; color: var(--terracotta); border: 1.5px solid var(--terracotta); box-shadow: none; }
.btn.btn-ghost:hover { background: var(--terracotta); color: var(--cream); }
.btn.btn-small { padding: 7px 14px; font-size: 0.85rem; }

/* === CARDS === */
.card {
  background: var(--paper);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow);
  overflow: hidden;
  border: 1px solid var(--line);
  transition: transform 180ms, box-shadow 180ms;
}
.card:hover { transform: translateY(-3px); box-shadow: var(--shadow-lg); }

/* === HERO === */
.hero {
  padding: 48px 0 32px;
  text-align: center;
  position: relative;
}
.hero h1 {
  color: var(--burgundy);
  margin-bottom: 0.2em;
}
.hero .subtitle {
  font-family: var(--sans);
  color: var(--ink-soft);
  font-size: 1.15rem;
  font-weight: 400;
  max-width: 640px;
  margin: 0 auto;
}
.hero-home { padding-top: 24px; }
.hero-logo {
  display: block;
  width: clamp(140px, 22vw, 200px);
  height: auto;
  margin: 0 auto 8px;
}
.hero-title {
  font-family: var(--serif);
  font-size: clamp(2.8rem, 7vw, 4.5rem);
  letter-spacing: -0.02em;
  color: var(--burgundy);
  margin: 0 0 4px;
}
.hero-title .brand-tld { font-size: 0.5em; color: var(--brand-accent); font-weight: 500; }
.hero-tagline {
  font-family: var(--serif);
  font-style: italic;
  color: var(--olive-dark);
  font-size: clamp(1rem, 2.2vw, 1.3rem);
  letter-spacing: 0.05em;
  margin: 0 0 18px;
  text-transform: lowercase;
}

/* === FILTERS === */
.filter-bar {
  display: flex; flex-wrap: wrap; gap: 8px;
  padding: 16px;
  background: var(--paper);
  border-radius: var(--radius);
  border: 1px solid var(--line);
  margin-bottom: 24px;
}
.filter-bar select, .filter-bar input {
  font-family: var(--sans);
  font-size: 0.9rem;
  padding: 8px 12px;
  background: var(--stucco);
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  color: var(--ink);
  outline: none;
  transition: border-color 120ms;
}
.filter-bar select:focus, .filter-bar input:focus { border-color: var(--terracotta); }
.filter-chip {
  display: inline-flex; align-items: center; gap: 4px;
  padding: 4px 10px; border-radius: 99px;
  background: var(--lemon-pale); color: var(--basil); font-size: 0.8rem;
}

/* === RECIPE GRID === */
.recipe-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 20px;
}
.recipe-card {
  background: var(--paper);
  border-radius: var(--radius-lg);
  border: 1px solid var(--line);
  overflow: hidden;
  cursor: pointer;
  transition: transform 180ms, box-shadow 180ms;
  display: flex; flex-direction: column;
}
.recipe-card:hover { transform: translateY(-3px); box-shadow: var(--shadow-lg); }
.recipe-img {
  width: 100%; aspect-ratio: 4/3; object-fit: cover;
  background: linear-gradient(135deg, var(--cream), var(--lemon-pale));
  display: flex; align-items: center; justify-content: center;
  font-size: 3rem;
}
.recipe-body { padding: 16px; flex: 1; display: flex; flex-direction: column; }
.recipe-body h3 {
  font-family: var(--serif); font-size: 1.15rem; margin: 0 0 6px;
  color: var(--ink);
}
.recipe-meta {
  display: flex; flex-wrap: wrap; gap: 6px; margin: 6px 0 12px;
  font-size: 0.8rem; color: var(--muted);
}
.region-badge {
  display: inline-flex; align-items: center; gap: 4px;
  padding: 2px 8px; border-radius: 99px;
  background: var(--lemon-pale); color: var(--basil);
  font-weight: 600; font-size: 0.75rem;
}
.recipe-tags { display: flex; flex-wrap: wrap; gap: 4px; margin-top: auto; }
.recipe-tag {
  font-size: 0.7rem; padding: 2px 8px; border-radius: 99px;
  background: var(--stucco); color: var(--muted);
}
.star-btn {
  background: transparent; border: none; cursor: pointer; padding: 0;
  font-size: 1.2rem; line-height: 1; color: var(--muted);
  transition: color 120ms, transform 100ms;
}
.star-btn.starred { color: var(--lemon); }
.star-btn:hover { transform: scale(1.15); }
.star-btn.starred:hover { color: var(--terracotta); }

/* === RECIPE DETAIL === */
.recipe-hero {
  display: grid; grid-template-columns: 1.2fr 1fr; gap: 32px;
  margin-bottom: 32px;
}
@media (max-width: 800px) {
  .recipe-hero { grid-template-columns: 1fr; }
}
.recipe-hero img {
  width: 100%; aspect-ratio: 4/3; object-fit: cover;
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
}
.recipe-title { font-family: var(--serif); margin: 0; }
.recipe-italian { color: var(--muted); margin: 4px 0 16px; font-weight: 400; font-family: var(--display); letter-spacing: -0.01em; }
.recipe-stats {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(80px, 1fr)); gap: 8px;
  padding: 16px; background: var(--lemon-pale);
  border-radius: var(--radius); margin: 16px 0;
}
.stat { text-align: center; }
.stat-label { font-size: 0.75rem; text-transform: uppercase; color: var(--muted); letter-spacing: 0.05em; }
.stat-value { font-family: var(--serif); font-size: 1.3rem; color: var(--terracotta); font-weight: 600; }
.section-h {
  font-family: var(--serif);
  font-size: 1.6rem; color: var(--olive-dark);
  margin: 32px 0 16px;
  padding-bottom: 8px;
  border-bottom: 2px solid var(--lemon);
}
.ingredient-list { list-style: none; padding: 0; margin: 0; }
.ingredient-list li {
  padding: 10px 0; border-bottom: 1px dashed var(--line);
  display: flex; gap: 12px; align-items: baseline;
}
.ingredient-list li:last-child { border-bottom: none; }
.ing-qty { font-family: var(--serif); color: var(--terracotta); font-weight: 600; min-width: 100px; }
.ing-name { flex: 1; }
.ing-note { font-size: 0.85rem; color: var(--muted); font-style: italic; }
.step-list { list-style: none; padding: 0; counter-reset: step; }
.step-list li {
  counter-increment: step;
  padding: 16px 0 16px 60px; position: relative;
  border-bottom: 1px solid var(--line);
}
.step-list li:before {
  content: counter(step);
  position: absolute; left: 0; top: 14px;
  width: 44px; height: 44px;
  background: var(--terracotta); color: var(--cream);
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-family: var(--serif); font-weight: 700; font-size: 1.2rem;
}
.wine-card, .chef-card, .story-card {
  padding: 18px 22px; border-radius: var(--radius);
  margin: 20px 0;
}
.wine-card { background: linear-gradient(135deg, #FCE7F3, var(--paper)); border-left: 4px solid var(--tomato); }
.chef-card { background: linear-gradient(135deg, var(--lemon-pale), var(--paper)); border-left: 4px solid var(--lemon); }
.story-card { background: linear-gradient(135deg, #DCFCE7, var(--paper)); border-left: 4px solid var(--olive); }
.wine-card strong, .chef-card strong, .story-card strong { display: block; margin-bottom: 6px; }

/* === SCALER === */
.scaler {
  display: inline-flex; align-items: center; gap: 8px;
  background: var(--paper); border: 1px solid var(--line);
  border-radius: 99px; padding: 4px;
}
.scaler button {
  width: 32px; height: 32px; border: none; background: var(--cream); color: var(--terracotta);
  border-radius: 50%; cursor: pointer; font-weight: 700; font-size: 1.1rem;
  display: flex; align-items: center; justify-content: center;
}
.scaler button:hover { background: var(--terracotta); color: var(--cream); }
.scaler-value { padding: 0 10px; font-family: var(--serif); font-weight: 600; }

/* === UNIT TOGGLE === */
.unit-toggle {
  display: inline-flex; background: var(--paper); border: 1px solid var(--line);
  border-radius: 99px; padding: 3px;
}
.unit-toggle button {
  padding: 6px 14px; border: none; background: transparent; cursor: pointer;
  border-radius: 99px; font-size: 0.85rem; font-weight: 600; color: var(--muted);
}
.unit-toggle button.active { background: var(--olive); color: var(--cream); }

/* === FOOTER === */
.page-footer {
  padding: 40px 24px 28px;
  text-align: center;
  font-family: var(--sans);
  color: var(--muted);
  font-size: 0.9rem;
  border-top: 1px solid var(--line);
  margin-top: 64px;
  background: var(--paper);
}
.page-footer .footer-tagline { margin-bottom: 8px; }
.page-footer .footer-copy { font-size: 0.78rem; opacity: 0.8; }
.page-footer .footer-copy a { color: var(--brand-accent); }

/* === TOAST === */
.toast-container {
  position: fixed; bottom: 24px; right: 24px; z-index: 1000;
  display: flex; flex-direction: column; gap: 8px;
}
.toast {
  background: var(--ink); color: var(--cream);
  padding: 12px 18px; border-radius: var(--radius-sm);
  box-shadow: var(--shadow-lg);
  font-size: 0.9rem;
  max-width: 320px;
  animation: slideIn 240ms ease, fadeOut 240ms ease 4s forwards;
}
.toast.success { background: var(--olive); }
.toast.error { background: var(--tomato); }
@keyframes slideIn { from { transform: translateX(100%); opacity: 0; } to { transform: translateX(0); opacity: 1; } }
@keyframes fadeOut { to { opacity: 0; transform: translateY(12px); } }

/* === MASTERCLASS PAGES === */
.masterclass {
  font-size: 1.05rem; line-height: 1.7;
}
.masterclass h2 {
  margin-top: 56px; color: var(--terracotta);
}
.masterclass h3 { color: var(--olive-dark); margin-top: 32px; }
.masterclass blockquote {
  margin: 24px 0; padding: 16px 24px;
  background: var(--lemon-pale); border-left: 4px solid var(--lemon);
  font-family: var(--display); font-weight: 500; font-size: 1.15rem; letter-spacing: -0.015em;
  border-radius: var(--radius-sm);
}
.masterclass figure {
  margin: 24px 0; padding: 16px; background: var(--paper);
  border-radius: var(--radius); border: 1px solid var(--line);
}
.masterclass figcaption { font-size: 0.85rem; color: var(--muted); margin-top: 8px; }
.tip-box {
  background: linear-gradient(135deg, #ECFCCB, var(--paper));
  border-left: 4px solid var(--olive);
  padding: 16px 20px; border-radius: var(--radius-sm);
  margin: 20px 0;
}
.tip-box strong { color: var(--olive-dark); }

/* === FORM === */
.form-row { margin-bottom: 16px; }
.form-row label { display: block; font-size: 0.9rem; color: var(--ink-soft); margin-bottom: 6px; font-weight: 600; }
.form-row input[type=text],
.form-row input[type=email],
.form-row input[type=password],
.form-row input[type=number],
.form-row textarea,
.form-row select {
  width: 100%;
  padding: 10px 14px;
  background: var(--paper); border: 1px solid var(--line); border-radius: var(--radius-sm);
  font-family: var(--sans); font-size: 1rem; color: var(--ink);
}
.form-row textarea { min-height: 100px; resize: vertical; }
.form-row input:focus, .form-row textarea:focus, .form-row select:focus {
  outline: none; border-color: var(--terracotta);
}
.checkbox-row {
  display: flex; flex-wrap: wrap; gap: 6px;
}
.chk-btn {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 7px 14px; border-radius: 99px;
  background: var(--paper); border: 1.5px solid var(--line);
  color: var(--ink-soft); cursor: pointer; font-size: 0.88rem;
  transition: all 120ms;
}
.chk-btn.active { background: var(--terracotta); color: var(--cream); border-color: var(--terracotta); }
.chk-btn:hover:not(.active) { border-color: var(--terracotta); }

/* === REGION GRID === */
.region-grid {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr));
  gap: 12px; margin: 16px 0 32px;
}
.region-tile {
  background: var(--paper); border: 1px solid var(--line);
  border-radius: var(--radius); padding: 16px;
  cursor: pointer; transition: all 180ms;
  display: flex; flex-direction: column; gap: 4px;
  text-align: left; font-family: inherit;
}
.region-tile:hover { transform: translateY(-3px); box-shadow: var(--shadow); }
.region-tile.active { background: var(--cream); border-color: var(--terracotta); }
.region-icon { font-size: 1.6rem; }
.region-name { font-family: var(--serif); font-weight: 600; font-size: 1.05rem; }
.region-tile small { color: var(--muted); font-size: 0.78rem; }

/* === EMPTY === */
.empty-state {
  text-align: center; padding: 60px 24px;
  color: var(--muted);
}
.empty-state h3 { font-family: var(--serif); color: var(--ink-soft); }

@media print {
  .site-nav, .page-footer, .no-print, .toast-container { display: none !important; }
  body { background: white; }
  .container { padding: 0; max-width: 100%; }
}

/* ===================================================================
 * Responsive — phone (<640px), tablet (640-1024px), desktop (>1024px)
 * =================================================================== */

/* Mobile nav drawer — hidden on desktop */
.nav-toggle {
  display: none;
  background: transparent; border: none;
  font-size: 1.6rem; color: var(--ink);
  cursor: pointer; padding: 4px 8px;
  line-height: 1;
}

/* Tablet & below — collapse two-column shopping layout */
@media (max-width: 1024px) {
  .shopping-grid { grid-template-columns: 1fr !important; }
  .container { padding: 20px 16px; }
  .site-nav-inner { padding: 12px 16px; }
}

/* Phone — drawer nav + denser layout + stacked filter bar */
@media (max-width: 640px) {
  body { line-height: 1.5; }
  h1 { font-size: 2rem; letter-spacing: -0.03em; }
  h2 { font-size: 1.45rem; }
  .container { padding: 14px 14px 24px; }
  .narrow { padding: 14px; }

  .hero { padding: 20px 0 12px; }
  .hero .subtitle { font-size: 1rem; }

  /* Drawer nav */
  .nav-toggle { display: inline-flex; align-items: center; justify-content: center; }
  .site-nav-inner { flex-wrap: wrap; gap: 8px; padding: 10px 14px; }
  .brand { font-size: 1.2rem; }
  .brand-mark { width: 28px; height: 28px; font-size: 1rem; }
  .nav-links {
    display: none;
    width: 100%;
    flex-direction: column;
    align-items: stretch;
    gap: 2px;
    padding: 8px 0 4px;
    border-top: 1px solid var(--line);
    margin-top: 8px;
  }
  .nav-links.open { display: flex; }
  .nav-links a {
    padding: 12px 14px;
    border-radius: var(--radius-sm);
    font-size: 0.95rem;
  }

  /* Filter bar — stack into a vertical column */
  .filter-bar { padding: 12px; gap: 8px; flex-direction: column; align-items: stretch; }
  .filter-bar > * { width: 100%; }
  .filter-bar select, .filter-bar input { font-size: 0.95rem; padding: 10px 12px; }
  .filter-bar label { padding: 4px 0; }
  #filter-sort { margin-left: 0 !important; }

  /* Region tiles — denser */
  .region-grid { grid-template-columns: repeat(2, 1fr); gap: 8px; }
  .region-tile { padding: 12px; }
  .region-icon { font-size: 1.4rem; }
  .region-name { font-size: 0.95rem; }
  .region-tile small { font-size: 0.7rem; }

  /* Recipe grid — single column for phones, tighter cards */
  .recipe-grid { grid-template-columns: 1fr; gap: 14px; }
  .recipe-card { border-radius: var(--radius); }
  .recipe-card .recipe-img { aspect-ratio: 16/10; }
  .recipe-body { padding: 14px; }
  .recipe-body h3 { font-size: 1.05rem; }

  /* Recipe detail page */
  .recipe-hero { gap: 16px; margin-bottom: 18px; }
  .recipe-title { font-size: 1.8rem; }
  .recipe-stats { padding: 10px; gap: 4px; }
  .stat-value { font-size: 1.05rem; }
  .stat-label { font-size: 0.65rem; }

  /* Action buttons row — make wrappable & full-tap */
  .recipe-actions { gap: 8px !important; }
  .recipe-actions .btn { flex: 1 1 calc(50% - 4px); justify-content: center; padding: 10px 12px; }
  .recipe-actions .scaler, .recipe-actions .unit-toggle { flex: 1 1 100%; justify-content: center; }

  /* Ingredient/step lists */
  .ing-qty { min-width: 80px; font-size: 0.95rem; }
  .step-list li { padding: 12px 0 12px 50px; font-size: 0.95rem; }
  .step-list li:before { width: 36px; height: 36px; font-size: 1rem; top: 12px; }

  /* Masterclass body */
  .masterclass { font-size: 1rem; }
  .masterclass h2 { margin-top: 36px; }
  .masterclass blockquote { padding: 12px 16px; font-size: 1.02rem; }

  /* Form rows */
  .form-row textarea { min-height: 90px; }
  .checkbox-row { gap: 4px; }
  .chk-btn { font-size: 0.82rem; padding: 6px 10px; }

  /* Toast — centre on small screens */
  .toast-container { left: 16px; right: 16px; bottom: 16px; align-items: center; }
  .toast { max-width: 100%; width: 100%; }

  /* Shopping picker modal */
  #picker-modal .card { max-height: 90vh; }
}

/* Tablet — 2 columns for recipes, 3 for regions */
@media (min-width: 641px) and (max-width: 1024px) {
  .recipe-grid { grid-template-columns: repeat(2, 1fr); }
  .region-grid { grid-template-columns: repeat(3, 1fr); }
  .recipe-hero { grid-template-columns: 1fr; }
}

/* Very small phones */
@media (max-width: 380px) {
  .region-grid { grid-template-columns: 1fr; }
  .recipe-stats { grid-template-columns: repeat(2, 1fr); }
  .recipe-title { font-size: 1.5rem; }
}
