/* =========================================================================
   Pizzadeeg calculator — jentjens.eu
   1. Kleuren en lettertypes
   2. Basis
   3. Site-header en -footer (verplaats naar een gedeelde CSS als je die hebt)
   4. Calculator
   ========================================================================= */

@import url("https://fonts.googleapis.com/css2?family=Young+Serif&family=Figtree:wght@400;500;600;700&family=IBM+Plex+Mono:wght@400;500&display=swap");

/* ---- 1. Kleuren en lettertypes ---------------------------------------- */
:root {
  --bg: #f3f4f1;
  --surface: #ffffff;
  --fg: #1d221f;
  --muted: #5f6a63;
  --line: #dde2dc;
  --accent: #2f6b45;
  --accent-ink: #ffffff;
  --accent-soft: #e3efe6;
  --crust: #a5652a;

  --display: "Young Serif", Georgia, serif;
  --body: "Figtree", system-ui, sans-serif;
  --mono: "IBM Plex Mono", ui-monospace, monospace;

  --content-width: 560px;
  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #141815;
    --surface: #1c211e;
    --fg: #e9ede9;
    --muted: #9aa59e;
    --line: #2d3530;
    --accent: #6fbf8a;
    --accent-ink: #0e1a12;
    --accent-soft: #213328;
    --crust: #d99a5c;
    color-scheme: dark;
  }
}

/* ---- 2. Basis ---------------------------------------------------------- */
*, *::before, *::after { box-sizing: border-box; }

html, body { min-height: 100%; }

body {
  margin: 0;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  background: var(--bg);
  color: var(--fg);
  font-family: var(--body);
  font-size: 16px;
  line-height: 1.5;
}

[hidden] { display: none !important; }

a:focus-visible,
button:focus-visible,
input:focus-visible,
summary:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

/* ---- 3. Site-header en -footer ---------------------------------------- */
.site-header,
.site-footer {
  background: var(--surface);
}

.site-header { border-bottom: 1px solid var(--line); }
.site-footer { border-top: 1px solid var(--line); margin-top: auto; }

.site-header .inner,
.site-footer .inner {
  max-width: var(--content-width);
  margin: 0 auto;
  padding: 12px 16px;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 20px;
}

.site-name {
  font-family: var(--display);
  font-size: 1.1rem;
  color: var(--fg);
  text-decoration: none;
  margin-right: auto;
}

.site-nav {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 20px;
}

.site-nav a {
  color: var(--fg);
  text-decoration: none;
  font-weight: 500;
}

.site-nav a:hover,
.site-nav a[aria-current="page"] { color: var(--accent); }

.site-footer { color: var(--muted); font-size: .85rem; }

/* ---- 4. Calculator ----------------------------------------------------- */
.pizza {
  width: 100%;
  max-width: var(--content-width);
  margin: 0 auto;
  padding: 24px 16px 48px;
}

.pizza-form {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.pizza-title h1 {
  font-family: var(--display);
  font-weight: 400;
  font-size: 2rem;
  line-height: 1.1;
  margin: 0;
}

.pizza-title p {
  margin: 4px 0 0;
  color: var(--muted);
  font-size: .9rem;
}

.label {
  font-size: .72rem;
  font-weight: 600;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--muted);
}

.num {
  font-family: var(--mono);
  font-variant-numeric: tabular-nums;
}

/* Aantal */
.count {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

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

.stepper button {
  width: 52px;
  height: 52px;
  border-radius: 50%;
  border: 1.5px solid var(--line);
  background: var(--surface);
  color: var(--fg);
  font-size: 1.5rem;
  cursor: pointer;
}

.stepper button:hover { border-color: var(--accent); }

.stepper input {
  width: 96px;
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--fg);
  text-align: center;
  font-family: var(--display);
  font-size: 2.6rem;
}

.stepper .unit { color: var(--muted); }

.chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.chips button {
  border: 1px solid var(--line);
  background: var(--surface);
  color: var(--fg);
  border-radius: 999px;
  padding: 6px 14px;
  font: 500 .9rem var(--body);
  cursor: pointer;
}

.chips button[aria-pressed="true"] {
  background: var(--accent);
  border-color: var(--accent);
  color: var(--accent-ink);
}

/* Receptkaart */
.card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.summary {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  flex-wrap: wrap;
  gap: 12px;
  padding-bottom: 14px;
  border-bottom: 1px dashed var(--line);
}

.summary .big {
  font-family: var(--display);
  font-size: 2.4rem;
  line-height: 1;
}

.summary .side { text-align: right; }

.summary .side .num {
  font-size: 1.25rem;
  color: var(--crust);
}

.ingredients {
  width: 100%;
  border-collapse: collapse;
}

.ingredients td {
  padding: 9px 0;
  border-bottom: 1px solid var(--line);
  vertical-align: baseline;
}

.ingredients tr:last-child td { border-bottom: 0; }

.ingredients .amt {
  text-align: right;
  font-family: var(--mono);
  font-variant-numeric: tabular-nums;
  font-size: 1.1rem;
  white-space: nowrap;
}

.ingredients .pct {
  display: block;
  font-size: .8rem;
  color: var(--muted);
}

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

.btn {
  border: 1px solid var(--line);
  background: transparent;
  color: var(--fg);
  border-radius: 8px;
  padding: 8px 14px;
  font: 500 .9rem var(--body);
  cursor: pointer;
  text-decoration: none;
}

.btn.primary {
  background: var(--accent);
  border-color: var(--accent);
  color: var(--accent-ink);
}

.status {
  min-height: 1.2em;
  font-size: .85rem;
  color: var(--accent);
}

/* Instellingen */
.settings-panel {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 14px;
}

.settings-panel summary {
  padding: 16px 20px;
  cursor: pointer;
  font-weight: 600;
  list-style: none;
  display: flex;
  justify-content: space-between;
}

.settings-panel summary::-webkit-details-marker { display: none; }
.settings-panel summary::after { content: "+"; color: var(--muted); }
.settings-panel[open] summary::after { content: "−"; }

.settings {
  padding: 0 20px 20px;
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.row {
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: center;
  gap: 4px 12px;
}

.row > label { font-weight: 500; }

.row output {
  font-family: var(--mono);
  color: var(--accent);
  text-align: right;
}

.row input[type="range"],
.row small,
.row .full {
  grid-column: 1 / -1;
}

.row input[type="range"] {
  width: 100%;
  accent-color: var(--accent);
}

.row small {
  color: var(--muted);
  font-size: .8rem;
}

.seg {
  display: flex;
  border: 1px solid var(--line);
  border-radius: 8px;
  overflow: hidden;
}

.seg label {
  flex: 1;
  padding: 8px 6px;
  text-align: center;
  font: 500 .85rem var(--body);
  cursor: pointer;
}

.seg input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.seg label:has(input:checked) {
  background: var(--accent-soft);
  color: var(--accent);
  font-weight: 600;
}

.seg label:has(input:focus-visible) {
  outline: 2px solid var(--accent);
  outline-offset: -2px;
}
