/* ===== Reset & Base ===== */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
:root {
  --green: #4CAF50;
  --green-dark: #388E3C;
  --green-light: #e8f5e9;
  --orange: #FF9800;
  --orange-dark: #F57C00;
  --orange-light: #fff3e0;
  --bg: #faf8f5;
  --surface: #ffffff;
  --text: #1a1a1a;
  --text-secondary: #555;
  --text-muted: #888;
  --border: #e0dcd5;
  --radius: 12px;
  --radius-sm: 8px;
  --shadow: 0 2px 12px rgba(0,0,0,.08);
  --shadow-lg: 0 8px 32px rgba(0,0,0,.12);
  --max-width: 1200px;
  --font: system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
}
html { scroll-behavior: smooth; font-size: 16px; }
body { font-family: var(--font); color: var(--text); background: var(--bg); line-height: 1.6; }
img { max-width: 100%; height: auto; }
a { color: var(--green-dark); text-decoration: none; }
a:hover, a:focus { text-decoration: underline; }
.skip-link { position: absolute; top: -100%; left: 16px; background: var(--green); color: #fff; padding: 8px 16px; border-radius: var(--radius-sm); z-index: 9999; font-weight: 600; }
.skip-link:focus { top: 16px; }
.container { max-width: var(--max-width); margin: 0 auto; padding: 0 20px; }

/* ===== Buttons ===== */
.btn { display: inline-flex; align-items: center; gap: 6px; border: 2px solid transparent; border-radius: var(--radius-sm); padding: 10px 20px; font-family: var(--font); font-size: .95rem; font-weight: 600; cursor: pointer; transition: all .2s; text-decoration: none; line-height: 1.3; }
.btn:hover { text-decoration: none; }
.btn:focus-visible { outline: 3px solid var(--orange); outline-offset: 2px; }
.btn-primary { background: var(--green); color: #fff; border-color: var(--green-dark); }
.btn-primary:hover { background: var(--green-dark); }
.btn-ghost { background: transparent; color: var(--text-secondary); border-color: var(--border); }
.btn-ghost:hover { background: var(--green-light); color: var(--green-dark); border-color: var(--green); }
.btn-sm { padding: 6px 14px; font-size: .85rem; }
.btn-lg { padding: 14px 28px; font-size: 1.05rem; }
.btn:disabled { opacity: .5; cursor: not-allowed; }

/* ===== Header ===== */
.site-header { background: var(--surface); border-bottom: 1px solid var(--border); position: sticky; top: 0; z-index: 100; }
.site-header .container { display: flex; align-items: center; justify-content: space-between; height: 60px; }
.logo { display: flex; align-items: center; gap: 10px; font-weight: 700; font-size: 1.2rem; color: var(--text); }
.logo:hover { text-decoration: none; }
.site-nav ul { display: flex; list-style: none; gap: 4px; }
.site-nav a { display: block; padding: 8px 14px; border-radius: var(--radius-sm); color: var(--text-secondary); font-weight: 500; font-size: .9rem; }
.site-nav a:hover, .site-nav a.active { background: var(--green-light); color: var(--green-dark); text-decoration: none; }

/* ===== Hero ===== */
.hero { background: linear-gradient(135deg, var(--green) 0%, #2E7D32 60%, #1B5E20 100%); color: #fff; padding: 80px 0 60px; text-align: center; }
.hero h1 { font-size: clamp(1.8rem, 4vw, 2.8rem); font-weight: 800; margin-bottom: 16px; line-height: 1.2; }
.hero-sub { font-size: 1.15rem; opacity: .92; max-width: 560px; margin: 0 auto 32px; }
.hero .btn-primary { background: #fff; color: var(--green-dark); border-color: #fff; }
.hero .btn-primary:hover { background: var(--green-light); }

/* ===== Generator Section ===== */
.generator-section { padding: 48px 0; }
.gen-layout { display: grid; grid-template-columns: 1fr 1fr; gap: 32px; align-items: start; }
.ingredient-panel { background: var(--surface); border-radius: var(--radius); padding: 28px; box-shadow: var(--shadow); position: sticky; top: 80px; }
.ingredient-panel h2 { font-size: 1.3rem; margin-bottom: 4px; }
.panel-desc { color: var(--text-secondary); font-size: .9rem; margin-bottom: 20px; }
.ing-group { border: 1px solid var(--border); border-radius: var(--radius-sm); padding: 16px; margin-bottom: 16px; }
.ing-group legend { font-weight: 700; font-size: .95rem; padding: 0 8px; display: flex; align-items: center; gap: 8px; }
.group-icon { font-size: 1.2rem; }
.checkbox-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-top: 12px; }
.cb-label { display: flex; align-items: center; gap: 8px; font-size: .9rem; cursor: pointer; padding: 6px 8px; border-radius: 6px; transition: background .15s; }
.cb-label:hover { background: var(--green-light); }
.cb-label input[type="checkbox"] { accent-color: var(--green); width: 18px; height: 18px; flex-shrink: 0; }
.cb-label.checked { background: var(--green-light); font-weight: 600; }
.flavor-filters { margin: 20px 0; padding-top: 16px; border-top: 1px solid var(--border); }
.filter-label { font-weight: 600; font-size: .9rem; margin-bottom: 10px; }
.filter-btns { display: flex; flex-wrap: wrap; gap: 8px; }
.filter-btn { padding: 6px 16px; border-radius: 20px; border: 2px solid var(--border); background: var(--surface); font-family: var(--font); font-size: .85rem; font-weight: 600; cursor: pointer; color: var(--text-secondary); transition: all .15s; }
.filter-btn:hover { border-color: var(--green); color: var(--green-dark); }
.filter-btn.active { background: var(--green); color: #fff; border-color: var(--green-dark); }
.gen-actions { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 20px; }

/* ===== Results Panel ===== */
.results-panel { background: var(--surface); border-radius: var(--radius); padding: 28px; box-shadow: var(--shadow); min-height: 400px; }
.results-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 20px; flex-wrap: wrap; gap: 10px; }
.results-header h2 { font-size: 1.3rem; }
.results-actions { display: flex; gap: 8px; }
.results-area { display: flex; flex-direction: column; gap: 16px; }
.empty-state { text-align: center; padding: 40px 20px; color: var(--text-muted); }
.empty-state svg { margin-bottom: 16px; }
.empty-hint { font-size: .85rem; margin-top: 8px; }

/* ===== Recipe Cards ===== */
.recipe-card { border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; transition: box-shadow .2s; }
.recipe-card:hover { box-shadow: var(--shadow); }
.recipe-card-header { padding: 16px 20px; cursor: pointer; display: flex; align-items: center; justify-content: space-between; gap: 12px; background: var(--orange-light); }
.recipe-card-header:hover { background: #ffe8cc; }
.recipe-name { font-weight: 700; font-size: 1.05rem; }
.recipe-meta { display: flex; gap: 8px; flex-shrink: 0; align-items: center; }
.recipe-tags { display: flex; gap: 6px; flex-wrap: wrap; }
.tag { display: inline-block; padding: 3px 10px; border-radius: 12px; font-size: .75rem; font-weight: 600; }
.tag-sweet { background: #fce4ec; color: #c62828; }
.tag-tart { background: #fff9c4; color: #f57f17; }
.tag-fizzy { background: #e3f2fd; color: #1565c0; }
.tag-strong { background: #f3e5f5; color: #6a1b9a; }
.tag-creamy { background: #fff8e1; color: #e65100; }
.difficulty { font-size: .8rem; color: var(--text-muted); }
.difficulty-easy::before { content: "●○○ "; color: var(--green); }
.difficulty-medium::before { content: "●●○ "; color: var(--orange); }
.difficulty-hard::before { content: "●●● "; color: #d32f2f; }
.recipe-card-body { padding: 0 20px; max-height: 0; overflow: hidden; transition: max-height .3s ease, padding .3s ease; }
.recipe-card.expanded .recipe-card-body { padding: 20px; max-height: 600px; }
.recipe-section-title { font-weight: 700; font-size: .85rem; text-transform: uppercase; letter-spacing: .5px; color: var(--text-muted); margin-bottom: 8px; }
.recipe-ing-list { list-style: none; display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 16px; }
.recipe-ing-list li { background: var(--green-light); padding: 4px 12px; border-radius: 16px; font-size: .85rem; }
.recipe-steps { list-style: none; counter-reset: step; margin-bottom: 16px; }
.recipe-steps li { counter-increment: step; padding: 6px 0 6px 32px; position: relative; font-size: .92rem; }
.recipe-steps li::before { content: counter(step); position: absolute; left: 0; top: 6px; width: 22px; height: 22px; background: var(--green); color: #fff; border-radius: 50%; font-size: .75rem; font-weight: 700; display: flex; align-items: center; justify-content: center; }
.recipe-notes { background: var(--orange-light); border-radius: var(--radius-sm); padding: 12px 16px; font-size: .88rem; margin-bottom: 16px; }
.recipe-notes strong { color: var(--orange-dark); }
.recipe-nonalc { background: #e8eaf6; border-radius: var(--radius-sm); padding: 12px 16px; font-size: .88rem; margin-bottom: 16px; }
.recipe-nonalc strong { color: #283593; }
.recipe-scaling { font-size: .85rem; color: var(--text-secondary); margin-bottom: 16px; border-top: 1px solid var(--border); padding-top: 12px; }
.recipe-card-print { display: none; }

/* ===== Guide Section ===== */
.guide-section { padding: 48px 0; background: var(--surface); }
.guide-section h2 { font-size: 1.5rem; margin-bottom: 24px; text-align: center; }
.guide-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 24px; }
.guide-card { background: var(--bg); border-radius: var(--radius); padding: 24px; border: 1px solid var(--border); }
.guide-card h3 { font-size: 1rem; margin-bottom: 10px; color: var(--green-dark); }
.guide-card p { font-size: .9rem; color: var(--text-secondary); line-height: 1.7; }

/* ===== Mistakes Section ===== */
.mistakes-section { padding: 48px 0; }
.mistakes-section h2 { font-size: 1.5rem; margin-bottom: 24px; text-align: center; }
.mistakes-list { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; max-width: 800px; margin: 0 auto; }
.mistake-item { background: var(--surface); border-radius: var(--radius); padding: 20px; border-left: 4px solid var(--orange); box-shadow: var(--shadow); }
.mistake-item h3 { font-size: .95rem; margin-bottom: 8px; }
.mistake-item p { font-size: .88rem; color: var(--text-secondary); line-height: 1.7; }

/* ===== FAQ Section ===== */
.faq-section { padding: 48px 0; background: var(--surface); }
.faq-section h2 { font-size: 1.5rem; margin-bottom: 24px; text-align: center; }
.faq-list { max-width: 760px; margin: 0 auto; }
.faq-item { border-bottom: 1px solid var(--border); }
.faq-q { width: 100%; text-align: left; background: none; border: none; font-family: var(--font); font-size: .95rem; font-weight: 600; padding: 16px 0; cursor: pointer; display: flex; align-items: center; justify-content: space-between; gap: 12px; color: var(--text); }
.faq-q:hover { color: var(--green-dark); }
.faq-q::after { content: "+"; font-size: 1.3rem; font-weight: 400; flex-shrink: 0; transition: transform .2s; }
.faq-q[aria-expanded="true"]::after { content: "\2212"; }
.faq-a { font-size: .9rem; color: var(--text-secondary); line-height: 1.7; padding-bottom: 16px; }

/* ===== Footer ===== */
.site-footer { background: #1a1a1a; color: #ccc; padding: 32px 0; font-size: .85rem; text-align: center; }
.site-footer a { color: var(--green); }
.footer-brand { font-weight: 700; font-size: 1.1rem; margin-bottom: 8px; }
.footer-links { margin-bottom: 12px; }
.footer-hub { margin-bottom: 12px; }
.footer-legal { margin-bottom: 8px; opacity: .7; font-size: .8rem; }
.footer-version { opacity: .5; font-size: .78rem; }

/* ===== Print Styles ===== */
@media print {
  .site-header, .hero, .ingredient-panel, .results-actions, .guide-section, .mistakes-section, .faq-section, .site-footer, .btn { display: none !important; }
  .generator-section { padding: 0; }
  .gen-layout { display: block; }
  .results-panel { box-shadow: none; padding: 0; }
  .recipe-card { break-inside: avoid; border: 1px solid #ccc; margin-bottom: 16px; }
  .recipe-card-body { max-height: none !important; padding: 16px 20px !important; }
  .recipe-card-header { background: #f5f5f5 !important; }
}

/* ===== Responsive ===== */
@media (max-width: 900px) {
  .gen-layout { grid-template-columns: 1fr; }
  .ingredient-panel { position: static; }
  .guide-grid { grid-template-columns: 1fr 1fr; }
  .checkbox-grid { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 600px) {
  .hero { padding: 48px 0 36px; }
  .hero h1 { font-size: 1.5rem; }
  .hero-sub { font-size: 1rem; }
  .site-header .container { flex-direction: column; height: auto; padding: 10px 20px; gap: 8px; }
  .site-nav ul { gap: 2px; }
  .site-nav a { padding: 6px 10px; font-size: .82rem; }
  .checkbox-grid { grid-template-columns: 1fr; }
  .guide-grid { grid-template-columns: 1fr; }
  .mistakes-list { grid-template-columns: 1fr; }
  .ingredient-panel, .results-panel { padding: 20px; }
  .gen-actions { flex-direction: column; }
  .results-header { flex-direction: column; align-items: flex-start; }
}


/* Factory-injected deployment helpers. The AI owns the site design above this block. */
.ad-unit {
  width: min(100%, 720px);
  min-height: 120px;
  margin: 24px auto;
  display: block;
}

.legal-page {
  width: min(900px, calc(100% - 32px));
  margin: 40px auto;
}

.factory-fallback-nav {
  width: min(900px, calc(100% - 32px));
  margin: 24px auto 0;
  display: flex;
  flex-wrap: wrap;
  gap: 10px 16px;
  align-items: center;
  font-size: 0.95rem;
}

.factory-fallback-nav a {
  color: inherit;
  text-decoration: none;
  border-bottom: 1px solid currentColor;
}
