/* ============================================================
   DoughLab — Pizza Dough Calculator
   Design system: warm, clean, professional
   ============================================================ */

:root {
  --bg: #faf7f2;
  --bg-soft: #f3ede4;
  --card: #ffffff;
  --ink: #201a15;
  --ink-soft: #5c5347;
  --ink-faint: #8a7f70;
  --line: #e9e1d5;
  --accent: #c8401f;
  --accent-dark: #a83418;
  --accent-soft: #fbeae4;
  --green: #2e6b45;
  --green-soft: #e8f2ea;
  --gold: #b98a2f;
  --radius: 16px;
  --radius-sm: 10px;
  --shadow: 0 1px 2px rgba(32, 26, 21, .05), 0 8px 28px rgba(32, 26, 21, .07);
  --shadow-sm: 0 1px 2px rgba(32, 26, 21, .06);
  --font-head: "Fraunces", Georgia, serif;
  --font-body: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* { margin: 0; padding: 0; box-sizing: border-box; }

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

body {
  font-family: var(--font-body);
  background: var(--bg);
  color: var(--ink);
  line-height: 1.65;
  font-size: 16px;
  -webkit-font-smoothing: antialiased;
}

img { max-width: 100%; height: auto; }

a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }

h1, h2, h3, h4 { font-family: var(--font-head); font-weight: 600; line-height: 1.2; color: var(--ink); }

.wrap { max-width: 1120px; margin: 0 auto; padding: 0 20px; }

/* ---------- Header ---------- */
.site-header {
  position: sticky; top: 0; z-index: 50;
  background: rgba(250, 247, 242, .92);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--line);
}
.header-inner {
  display: flex; align-items: center; justify-content: space-between;
  height: 64px;
}
.logo {
  display: flex; align-items: center; gap: 10px;
  font-family: var(--font-head); font-size: 22px; font-weight: 700;
  color: var(--ink); text-decoration: none;
}
.logo:hover { text-decoration: none; }
.logo-mark {
  width: 36px; height: 36px; border-radius: 10px;
  background: var(--accent); color: #fff;
  display: flex; align-items: center; justify-content: center;
  font-size: 19px;
}
.nav { display: flex; gap: 26px; align-items: center; }
.nav a { color: var(--ink-soft); font-size: 14.5px; font-weight: 500; }
.nav a:hover { color: var(--accent); text-decoration: none; }
.nav a.nav-cta {
  background: var(--ink); color: #fff; padding: 9px 18px;
  border-radius: 999px; font-weight: 600;
}
.nav a.nav-cta:hover { background: var(--accent); }

/* ---------- Hero ---------- */
.hero { padding: 56px 0 34px; text-align: center; }
.hero-eyebrow {
  display: inline-flex; align-items: center; gap: 8px;
  background: var(--accent-soft); color: var(--accent-dark);
  font-size: 13px; font-weight: 600; letter-spacing: .4px;
  padding: 6px 14px; border-radius: 999px; margin-bottom: 18px;
  text-transform: uppercase;
}
.hero h1 { font-size: clamp(34px, 5.4vw, 56px); letter-spacing: -0.5px; margin-bottom: 16px; }
.hero h1 em { font-style: italic; color: var(--accent); }
.hero p.lede {
  max-width: 640px; margin: 0 auto 22px;
  font-size: 18px; color: var(--ink-soft);
}
.hero-badges {
  display: flex; flex-wrap: wrap; gap: 10px; justify-content: center;
}
.hero-badges span {
  background: var(--card); border: 1px solid var(--line);
  font-size: 13px; font-weight: 500; color: var(--ink-soft);
  padding: 7px 14px; border-radius: 999px; box-shadow: var(--shadow-sm);
}

/* ---------- Calculator ---------- */
.calc-section { padding: 26px 0 60px; }
.calc-grid {
  display: grid; grid-template-columns: 1.05fr .95fr; gap: 26px;
  align-items: start;
}
.card {
  background: var(--card); border: 1px solid var(--line);
  border-radius: var(--radius); box-shadow: var(--shadow);
}
.card-pad { padding: 28px; }
.card h2.card-title {
  font-size: 21px; margin-bottom: 4px; display: flex; align-items: center; gap: 10px;
}
.card .card-sub { font-size: 14px; color: var(--ink-faint); margin-bottom: 22px; }

.field { margin-bottom: 20px; }
.field-label {
  display: flex; justify-content: space-between; align-items: baseline;
  font-size: 14px; font-weight: 600; margin-bottom: 8px; color: var(--ink);
}
.field-label .val { color: var(--accent); font-variant-numeric: tabular-nums; }
.field .hint { font-size: 12.5px; color: var(--ink-faint); margin-top: 6px; }

input[type="number"], select {
  width: 100%; padding: 12px 14px; font-size: 16px; font-family: var(--font-body);
  border: 1.5px solid var(--line); border-radius: var(--radius-sm);
  background: #fff; color: var(--ink); appearance: none;
  transition: border-color .15s, box-shadow .15s;
}
select {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1l5 5 5-5' stroke='%235c5347' stroke-width='2' fill='none' stroke-linecap='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 14px center;
  padding-right: 38px;
}
input[type="number"]:focus, select:focus {
  outline: none; border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(200, 64, 31, .12);
}

input[type="range"] {
  width: 100%; height: 6px; appearance: none; -webkit-appearance: none;
  background: linear-gradient(to right, var(--accent) var(--fill, 50%), var(--bg-soft) var(--fill, 50%));
  border-radius: 999px; outline: none; cursor: pointer;
}
input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none; width: 22px; height: 22px; border-radius: 50%;
  background: #fff; border: 3px solid var(--accent);
  box-shadow: var(--shadow-sm); cursor: grab;
}
input[type="range"]::-moz-range-thumb {
  width: 16px; height: 16px; border-radius: 50%;
  background: #fff; border: 3px solid var(--accent); cursor: grab;
}

.field-row { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }

.presets { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 20px; }
.preset-btn {
  border: 1.5px solid var(--line); background: #fff; color: var(--ink-soft);
  font-family: var(--font-body); font-size: 13.5px; font-weight: 600;
  padding: 8px 15px; border-radius: 999px; cursor: pointer;
  transition: all .15s;
}
.preset-btn:hover { border-color: var(--accent); color: var(--accent); }
.preset-btn.active {
  background: var(--ink); border-color: var(--ink); color: #fff;
}

.seg {
  display: inline-flex; background: var(--bg-soft); border-radius: 999px; padding: 4px;
}
.seg button {
  border: none; background: transparent; font-family: var(--font-body);
  font-size: 13.5px; font-weight: 600; color: var(--ink-soft);
  padding: 7px 16px; border-radius: 999px; cursor: pointer;
}
.seg button.active { background: #fff; color: var(--ink); box-shadow: var(--shadow-sm); }

.toggle-row {
  display: flex; align-items: center; justify-content: space-between;
  padding: 12px 0; border-top: 1px dashed var(--line);
}
.toggle-row:first-of-type { border-top: none; }
.toggle-row .t-label { font-size: 14.5px; font-weight: 600; }
.toggle-row .t-hint { font-size: 12.5px; color: var(--ink-faint); }
.switch { position: relative; width: 46px; height: 26px; flex-shrink: 0; }
.switch input { opacity: 0; width: 0; height: 0; }
.switch .track {
  position: absolute; inset: 0; border-radius: 999px;
  background: var(--line); transition: background .2s; cursor: pointer;
}
.switch .track::after {
  content: ""; position: absolute; top: 3px; left: 3px;
  width: 20px; height: 20px; border-radius: 50%; background: #fff;
  box-shadow: var(--shadow-sm); transition: transform .2s;
}
.switch input:checked + .track { background: var(--green); }
.switch input:checked + .track::after { transform: translateX(20px); }

/* ---------- Results ---------- */
.results-card { position: sticky; top: 84px; }
.results-head {
  display: flex; justify-content: space-between; align-items: center;
  padding: 22px 28px 0;
}
.results-head h2 { font-size: 21px; }
.results-meta {
  display: flex; gap: 10px; padding: 6px 28px 18px; flex-wrap: wrap;
}
.meta-chip {
  background: var(--bg-soft); border-radius: 8px; padding: 8px 12px;
  font-size: 12.5px; color: var(--ink-soft);
}
.meta-chip b { display: block; font-size: 15px; color: var(--ink); font-variant-numeric: tabular-nums; }

.ing-table { width: 100%; border-collapse: collapse; }
.ing-table th, .ing-table td {
  text-align: left; padding: 12px 28px; font-size: 15px;
  border-top: 1px solid var(--line);
}
.ing-table th {
  font-size: 11.5px; text-transform: uppercase; letter-spacing: .6px;
  color: var(--ink-faint); border-top: 1px solid var(--line);
  background: #fdfbf8; padding-top: 10px; padding-bottom: 10px;
}
.ing-table td.num { text-align: right; font-variant-numeric: tabular-nums; font-weight: 600; }
.ing-table th.num { text-align: right; }
.ing-table td.pct { color: var(--ink-faint); font-size: 13px; }
.ing-table tr.total td {
  background: var(--green-soft); font-weight: 700; color: var(--green);
  border-top: 2px solid var(--green);
}
.results-actions {
  display: flex; gap: 10px; padding: 20px 28px 26px; flex-wrap: wrap;
}
.btn {
  border: none; font-family: var(--font-body); font-size: 14px; font-weight: 600;
  padding: 11px 20px; border-radius: 999px; cursor: pointer; transition: all .15s;
}
.btn-primary { background: var(--accent); color: #fff; }
.btn-primary:hover { background: var(--accent-dark); }
.btn-ghost { background: transparent; border: 1.5px solid var(--line); color: var(--ink-soft); }
.btn-ghost:hover { border-color: var(--ink); color: var(--ink); }

.note-box {
  margin: 0 28px 4px; background: var(--accent-soft); border-radius: var(--radius-sm);
  padding: 14px 16px; font-size: 13.5px; color: var(--accent-dark); line-height: 1.55;
}
.note-box b { color: var(--accent-dark); }

/* ---------- Content sections ---------- */
.content-section { padding: 54px 0; }
.content-section.alt { background: var(--bg-soft); }
.section-head { max-width: 680px; margin-bottom: 34px; }
.section-head .kicker {
  font-size: 12.5px; font-weight: 700; letter-spacing: 1px; text-transform: uppercase;
  color: var(--accent); margin-bottom: 10px;
}
.section-head h2 { font-size: clamp(26px, 3.6vw, 36px); letter-spacing: -0.3px; margin-bottom: 12px; }
.section-head p { color: var(--ink-soft); font-size: 16.5px; }

.prose { max-width: 760px; }
.prose h3 { font-size: 21px; margin: 30px 0 10px; }
.prose p { margin-bottom: 14px; color: var(--ink-soft); }
.prose ul, .prose ol { margin: 0 0 16px 22px; color: var(--ink-soft); }
.prose li { margin-bottom: 8px; }
.prose strong { color: var(--ink); }

.guide-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 18px; }
.guide-card {
  background: var(--card); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 24px; box-shadow: var(--shadow-sm);
}
.guide-card .g-icon {
  width: 42px; height: 42px; border-radius: 12px; background: var(--accent-soft);
  display: flex; align-items: center; justify-content: center; font-size: 20px;
  margin-bottom: 14px;
}
.guide-card h3 { font-size: 18px; margin-bottom: 8px; }
.guide-card p { font-size: 14.5px; color: var(--ink-soft); }

.data-table { width: 100%; border-collapse: collapse; background: var(--card); border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow-sm); border: 1px solid var(--line); }
.data-table th, .data-table td { padding: 13px 18px; text-align: left; font-size: 14.5px; border-bottom: 1px solid var(--line); }
.data-table th { background: var(--ink); color: #fff; font-size: 12.5px; text-transform: uppercase; letter-spacing: .5px; }
.data-table tr:last-child td { border-bottom: none; }
.data-table td:first-child { font-weight: 600; }
.table-scroll { overflow-x: auto; -webkit-overflow-scrolling: touch; }

/* ---------- FAQ ---------- */
.faq-list { max-width: 800px; }
.faq-item {
  background: var(--card); border: 1px solid var(--line); border-radius: var(--radius-sm);
  margin-bottom: 12px; overflow: hidden; box-shadow: var(--shadow-sm);
}
.faq-q {
  width: 100%; text-align: left; background: none; border: none; cursor: pointer;
  font-family: var(--font-body); font-size: 16px; font-weight: 600; color: var(--ink);
  padding: 18px 22px; display: flex; justify-content: space-between; align-items: center; gap: 16px;
}
.faq-q .chev { transition: transform .25s; color: var(--ink-faint); flex-shrink: 0; }
.faq-item.open .faq-q .chev { transform: rotate(180deg); }
.faq-a {
  max-height: 0; overflow: hidden; transition: max-height .3s ease;
}
.faq-a-inner { padding: 0 22px 20px; color: var(--ink-soft); font-size: 15px; }
.faq-a-inner p { margin-bottom: 10px; }
.faq-a-inner ul { margin: 0 0 10px 20px; }

/* ---------- Ad slots (placeholders) ---------- */
.ad-slot {
  margin: 34px auto; max-width: 728px; min-height: 90px;
  border: 1.5px dashed var(--line); border-radius: var(--radius-sm);
  display: flex; align-items: center; justify-content: center;
  color: var(--ink-faint); font-size: 12.5px; letter-spacing: .5px;
  background: #fdfbf8;
}

/* ---------- CTA band ---------- */
.cta-band {
  background: var(--ink); color: #fff; border-radius: var(--radius);
  padding: 44px 40px; text-align: center; margin: 20px 0 0;
}
.cta-band h2 { color: #fff; font-size: clamp(24px, 3.4vw, 32px); margin-bottom: 10px; }
.cta-band p { color: #cfc6ba; max-width: 520px; margin: 0 auto 22px; }
.cta-band .btn-primary { font-size: 15px; padding: 13px 28px; }

/* ---------- Footer ---------- */
.site-footer { background: var(--ink); color: #b8afa2; margin-top: 70px; }
.footer-grid {
  display: grid; grid-template-columns: 1.4fr 1fr 1fr 1fr; gap: 34px;
  padding: 54px 0 40px;
}
.site-footer h4 { color: #fff; font-family: var(--font-body); font-size: 13px; text-transform: uppercase; letter-spacing: .8px; margin-bottom: 14px; }
.site-footer a { color: #b8afa2; font-size: 14px; display: block; margin-bottom: 9px; }
.site-footer a:hover { color: #fff; text-decoration: none; }
.footer-brand p { font-size: 14px; max-width: 300px; margin-top: 12px; }
.footer-bottom {
  border-top: 1px solid #3a332b; padding: 20px 0 26px;
  display: flex; justify-content: space-between; gap: 14px; flex-wrap: wrap;
  font-size: 13px;
}

/* ---------- Legal / static pages ---------- */
.page-hero { padding: 48px 0 10px; }
.page-hero h1 { font-size: clamp(30px, 4.4vw, 42px); margin-bottom: 10px; }
.page-hero .updated { font-size: 13.5px; color: var(--ink-faint); }
.legal-body { padding: 30px 0 60px; }

/* ---------- Responsive ---------- */
@media (max-width: 900px) {
  .calc-grid { grid-template-columns: 1fr; }
  .results-card { position: static; }
  .guide-grid { grid-template-columns: 1fr 1fr; }
  .footer-grid { grid-template-columns: 1fr 1fr; }
  .nav { gap: 16px; }
  .nav a:not(.nav-cta) { display: none; }
}
@media (max-width: 560px) {
  .hero { padding: 40px 0 26px; }
  .card-pad { padding: 20px; }
  .results-head, .results-meta { padding-left: 20px; padding-right: 20px; }
  .ing-table th, .ing-table td { padding-left: 20px; padding-right: 20px; }
  .results-actions { padding: 16px 20px 22px; }
  .note-box { margin: 0 20px 4px; }
  .field-row { grid-template-columns: 1fr; }
  .guide-grid { grid-template-columns: 1fr; }
  .footer-grid { grid-template-columns: 1fr; gap: 26px; }
  .cta-band { padding: 34px 22px; }
}

/* ---------- Print ---------- */
@media print {
  .site-header, .site-footer, .hero-badges, .results-actions, .ad-slot, .cta-band, .nav { display: none !important; }
  body { background: #fff; }
  .card { box-shadow: none; border: 1px solid #ccc; }
  .calc-grid { grid-template-columns: 1fr; }
}
