/* ============================================================
   Café Turka — shared stylesheet
   "Tile & ember": cream ground, tile-navy ink, iznik-blue CTA,
   ember highlight. Alegreya headings + Mulish body.
   ============================================================ */

/* ---------- Tokens (light = default) ---------- */
:root {
  --ground: #FBF6EC;
  --surface: #FFFFFF;
  --ink: #14213D;
  --muted: #4F5A73;
  --brand: #1D5BA8;
  --brand-text: #1D5BA8;   /* accent text on NORMAL (swappable) surfaces */
  --accent-dark: #FFB74D;  /* accent text on ALWAYS-DARK bands — fixed */
  --ember: #E8663A;
  --ink-fixed: #14213D;    /* dark text on ember/gold — fixed */
  --on-brand: #FFFFFF;     /* text on brand fills — fixed */
  --cream: #F6EFE0;        /* text on always-dark bands — fixed */
  --band: #14213D;         /* always-dark header/hero/footer/CTA/panel */

  --border: #E4DBC8;
  --border-dark-surface: #2C375A;
  --shadow: 0 2px 10px rgba(20, 33, 61, 0.06);

  --radius: 12px;
  --maxw: 1100px;

  --font-head: "Alegreya", Georgia, serif;
  --font-body: "Mulish", system-ui, sans-serif;
}

html[data-theme="dark"] {
  --ground: #0E1424;
  --surface: #18203A;
  --ink: #F6EFE0;
  --muted: #C3CAD9;
  --brand: #1D5BA8;
  --brand-text: #8DB8F0;
  --accent-dark: #FFB74D;
  --ember: #E8663A;
  --ink-fixed: #14213D;
  --on-brand: #FFFFFF;
  --cream: #F6EFE0;
  --band: #070B16;

  --border: #2C375A;
  --border-dark-surface: #39456B;
  --shadow: 0 2px 10px rgba(0, 0, 0, 0.35);
}

/* ---------- Base ---------- */
*, *::before, *::after { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  font-family: var(--font-body);
  font-weight: 400;
  line-height: 1.6;
  color: var(--ink);
  background: var(--ground);
  -webkit-font-smoothing: antialiased;
  overflow-wrap: anywhere;
}

h1, h2, h3, h4 {
  font-family: var(--font-head);
  font-weight: 700;
  line-height: 1.2;
  color: var(--ink);
  margin: 0 0 0.5em;
}

h1 { font-size: clamp(1.9rem, 5vw, 3rem); }
h2 { font-size: clamp(1.5rem, 3.5vw, 2.1rem); }
h3 { font-size: 1.25rem; }

p { margin: 0 0 1rem; }

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

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

.container {
  width: 100%;
  max-width: var(--maxw);
  margin-inline: auto;
  padding-inline: 1.25rem;
}

/* A section wrapper that owns vertical padding — NOT also .container (bug 4) */
.section { padding-block: clamp(2.5rem, 6vw, 4.5rem); }
.section--tight { padding-block: clamp(1.75rem, 4vw, 2.75rem); }

.eyebrow {
  display: block;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  font-size: 0.8rem;
  color: var(--brand-text);
  margin-bottom: 0.5rem;
}

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

.skip-link {
  position: absolute;
  left: -9999px;
  top: 0;
  background: var(--brand);
  color: var(--on-brand);
  padding: 0.6rem 1rem;
  z-index: 100;
  border-radius: 0 0 var(--radius) 0;
}
.skip-link:focus { left: 0; }

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

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  font-family: var(--font-body);
  font-weight: 700;
  font-size: 1rem;
  line-height: 1.2;
  padding: 0.8rem 1.4rem;
  border-radius: 999px;
  border: 2px solid transparent;
  cursor: pointer;
  text-decoration: none;
  transition: transform 0.08s ease, background 0.15s ease, color 0.15s ease;
}
.btn:active { transform: translateY(1px); }

.btn--primary { background: var(--brand); color: var(--on-brand); border-color: var(--brand); }
.btn--primary:hover { background: #17488a; border-color: #17488a; color: var(--on-brand); }

.btn--ember { background: var(--ember); color: var(--ink-fixed); border-color: var(--ember); }
.btn--ember:hover { background: #F27A4E; border-color: #F27A4E; color: var(--ink-fixed); }

.btn--ghost {
  background: transparent;
  color: var(--ink);
  border-color: var(--border);
}
.btn--ghost:hover { background: var(--ink); color: var(--ground); }

.btn--block { width: 100%; }

/* ---------- Chips ---------- */
.chip {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  font-size: 0.82rem;
  font-weight: 700;
  padding: 0.3rem 0.7rem;
  border-radius: 999px;
  background: rgba(29, 91, 168, 0.1);
  color: var(--brand-text);
  border: 1px solid rgba(29, 91, 168, 0.25);
}
.chip--note {
  background: rgba(226, 85, 46, 0.12);
  color: #A33211;
  border-color: rgba(226, 85, 46, 0.3);
}
html[data-theme="dark"] .chip--note { color: #f0875f; }

/* ---------- Cards (light mode relies on visible border — bug 16) ---------- */
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  overflow: hidden;
}
html[data-theme="dark"] .card { border-color: var(--border-dark-surface); }

.card__body { padding: 1.25rem; }
.card__media { aspect-ratio: 4 / 3; overflow: hidden; background: var(--ground); }
.card__media img { width: 100%; height: 100%; object-fit: cover; }

.img-note {
  font-size: 0.75rem;
  color: var(--muted);
  padding: 0.5rem 1.25rem 1rem;
  margin: 0;
}

/* ---------- Grids ---------- */
.grid { display: grid; gap: 1.25rem; }
.grid--cards { grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); }
.grid > * { min-width: 0; }

/* ---------- Header (ALWAYS DARK band) ---------- */
.site-header {
  background: var(--band);
  color: var(--cream);
  border-bottom: 1px solid rgba(246, 239, 224, 0.12);
}
.header-inner {
  display: flex;
  align-items: center;
  gap: 1rem;
  flex-wrap: wrap;
  padding-block: 0.9rem;
}
.brand {
  display: inline-flex;
  align-items: baseline;
  gap: 0.5rem;
  text-decoration: none;
  color: var(--cream);
  font-family: var(--font-head);
  font-weight: 700;
  font-size: 1.4rem;
  margin-right: auto;
  overflow-wrap: anywhere;
}
.brand .brand__mark { color: var(--accent-dark); }

.site-nav ul {
  list-style: none;
  display: flex;
  flex-wrap: wrap;
  gap: 0.25rem 1rem;
  margin: 0;
  padding: 0;
}
.site-nav a {
  color: var(--cream);
  text-decoration: none;
  font-weight: 700;
  padding: 0.4rem 0.3rem;
  border-bottom: 2px solid transparent;
}
.site-nav a:hover,
.site-nav a[aria-current="page"] {
  color: var(--accent-dark);
  border-bottom-color: var(--accent-dark);
}

.header-cta { display: inline-flex; gap: 0.5rem; }

/* ---------- Always-dark bands: light-on-dark overrides (bug 1) ---------- */
.hero,
.band,
.site-header,
.site-footer,
.order-panel {
  color: var(--cream);
}
.hero h1, .hero h2, .hero h3, .hero h4, .hero p, .hero li,
.band h1, .band h2, .band h3, .band h4, .band p, .band li,
.site-footer h1, .site-footer h2, .site-footer h3, .site-footer h4, .site-footer p, .site-footer li,
.order-panel h1, .order-panel h2, .order-panel h3, .order-panel h4, .order-panel p, .order-panel li {
  color: var(--cream);
}
.hero .muted, .band .muted, .site-footer .muted, .order-panel .muted { color: #B9C2D6; }
.hero .eyebrow, .band .eyebrow, .site-footer .eyebrow, .order-panel .eyebrow { color: var(--accent-dark); }

/* links on dark bands */
.hero a:not(.btn), .band a:not(.btn), .site-footer a:not(.btn), .order-panel a:not(.btn) {
  color: var(--accent-dark);
}

/* dl.nap on dark bands (bug 1) */
.hero dl.nap dt, .hero dl.nap dd,
.band dl.nap dt, .band dl.nap dd,
.site-footer dl.nap dt, .site-footer dl.nap dd {
  color: var(--cream);
}
.hero dl.nap dt, .band dl.nap dt, .site-footer dl.nap dt { color: var(--accent-dark); }

/* chips on dark bands */
.hero .chip, .band .chip, .site-footer .chip, .order-panel .chip {
  background: rgba(246, 239, 224, 0.1);
  color: var(--cream);
  border-color: rgba(246, 239, 224, 0.25);
}
.hero .chip--note, .band .chip--note, .site-footer .chip--note, .order-panel .chip--note {
  background: rgba(255, 183, 77, 0.14);
  color: var(--accent-dark);
  border-color: rgba(255, 183, 77, 0.35);
}

/* notes + img-note + stat/proof text on dark bands */
.hero .img-note, .band .img-note, .site-footer .img-note, .order-panel .img-note { color: #B9C2D6; }
.hero .stat, .band .stat, .site-footer .stat { color: var(--cream); }
.hero .stat strong, .band .stat strong, .site-footer .stat strong { color: var(--accent-dark); }

/* ghost buttons on dark bands — both a and button, incl hover (bug 1, 6) */
.hero a.btn--ghost, .hero button.btn--ghost,
.band a.btn--ghost, .band button.btn--ghost,
.site-header a.btn--ghost, .site-header button.btn--ghost,
.site-footer a.btn--ghost, .site-footer button.btn--ghost,
.order-panel a.btn--ghost, .order-panel button.btn--ghost {
  color: var(--cream);
  border-color: rgba(246, 239, 224, 0.5);
  background: transparent;
}
.hero a.btn--ghost:hover, .hero button.btn--ghost:hover,
.band a.btn--ghost:hover, .band button.btn--ghost:hover,
.site-header a.btn--ghost:hover, .site-header button.btn--ghost:hover,
.site-footer a.btn--ghost:hover, .site-footer button.btn--ghost:hover,
.order-panel a.btn--ghost:hover, .order-panel button.btn--ghost:hover {
  background: var(--cream);
  color: var(--band);
  border-color: var(--cream);
}

/* button text must not be overridden by dark-band link rules (bug 6) */
.hero a.btn--primary, .band a.btn--primary, .site-footer a.btn--primary, .site-header a.btn--primary,
.order-panel a.btn--primary { color: var(--on-brand); }
.hero a.btn--ember, .band a.btn--ember, .site-footer a.btn--ember, .site-header a.btn--ember,
.order-panel a.btn--ember { color: var(--ink-fixed); }

/* ---------- Theme toggle ---------- */
.theme-toggle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 42px;
  height: 42px;
  border-radius: 999px;
  border: 2px solid rgba(246, 239, 224, 0.4);
  background: transparent;
  color: var(--cream);
  cursor: pointer;
  flex: none;
}
.theme-toggle:hover { background: rgba(246, 239, 224, 0.12); }
.theme-toggle svg { width: 20px; height: 20px; }
.theme-toggle .icon-sun { display: none; }
.theme-toggle .icon-moon { display: block; }
html[data-theme="dark"] .theme-toggle .icon-sun { display: block; }
html[data-theme="dark"] .theme-toggle .icon-moon { display: none; }

/* ---------- Hero ---------- */
.hero {
  background: var(--band);
  position: relative;
}
.hero-grid {
  display: grid;
  grid-template-columns: 1.1fr 0.9fr;
  gap: 2rem;
  align-items: center;
  padding-block: clamp(2.5rem, 6vw, 4.5rem);
}
.hero-media {
  border-radius: var(--radius);
  overflow: hidden;
  border: 1px solid rgba(246, 239, 224, 0.15);
}
.hero-media img { width: 100%; aspect-ratio: 4 / 3; object-fit: cover; }
.hero-actions { display: flex; flex-wrap: wrap; gap: 0.75rem; margin-top: 1.25rem; }

/* ---------- Proof strip ---------- */
.proof {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem 1.5rem;
  list-style: none;
  margin: 1.25rem 0 0;
  padding: 0;
}
.proof li {
  display: inline-flex;
  flex-direction: column;
}
.stat strong { font-size: 1.15rem; color: var(--accent-dark); }

/* ---------- Band / CTA ---------- */
.band { background: var(--band); }
.band--ember { background: var(--ember); }
.band--ember h2, .band--ember p, .band--ember .eyebrow { color: var(--ink-fixed); }
.band--ember .chip { background: rgba(20,33,61,0.1); color: var(--ink-fixed); border-color: rgba(20,33,61,0.25); }
.band-inner { display: grid; gap: 1.25rem; }
.band-actions { display: flex; flex-wrap: wrap; gap: 0.75rem; }

/* ---------- Find-us / NAP ---------- */
.findus {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.5rem;
  align-items: start;
}
.findus > * { min-width: 0; }
dl.nap { margin: 0; }
dl.nap dt {
  font-weight: 700;
  color: var(--brand-text);
  margin-top: 0.75rem;
  font-size: 0.85rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}
dl.nap dd { margin: 0.1rem 0 0; min-width: 0; overflow-wrap: anywhere; }

/* ---------- Section head ---------- */
.section-head { max-width: 60ch; margin-bottom: 1.75rem; }

/* ============================================================
   Döner builder (signature feature)
   ============================================================ */
.builder-layout {
  display: grid;
  grid-template-columns: 1.4fr 1fr;
  gap: 1.75rem;
  align-items: start;
}
.builder-form { min-width: 0; }
.builder-aside { min-width: 0; position: sticky; top: 1rem; }

fieldset {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.1rem 1.25rem 1.25rem;
  margin: 0 0 1.25rem;
  background: var(--surface);
}
html[data-theme="dark"] fieldset { border-color: var(--border-dark-surface); }
legend {
  font-family: var(--font-head);
  font-weight: 700;
  font-size: 1.15rem;
  padding: 0 0.4rem;
  color: var(--ink);
}

/* quantity rows: stepper buttons are separate buttons (bug 10) */
.qty-row {
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: center;
  gap: 0.75rem;
  padding: 0.6rem 0;
  border-bottom: 1px solid var(--border);
}
html[data-theme="dark"] .qty-row { border-bottom-color: var(--border-dark-surface); }
.qty-row:last-child { border-bottom: none; }
.qty-row__label { font-weight: 700; }
.qty-control {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
}
.qty-btn {
  width: 40px;
  height: 40px;
  border-radius: 999px;
  border: 2px solid var(--brand);
  background: transparent;
  color: var(--brand-text);
  font-size: 1.3rem;
  font-weight: 700;
  line-height: 1;
  cursor: pointer;
}
.qty-btn:hover { background: var(--brand); color: var(--on-brand); }
.qty-btn:disabled { opacity: 0.4; cursor: not-allowed; }
.qty-value {
  min-width: 2ch;
  text-align: center;
  font-weight: 700;
  font-size: 1.1rem;
}

/* radio option tiles — visible without colour alone (bug 13) */
.option-set {
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem;
  margin-top: 0.5rem;
}
.option {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.55rem 0.9rem;
  border: 2px solid var(--border);
  border-radius: 999px;
  cursor: pointer;
  font-weight: 700;
  background: var(--surface);
}
html[data-theme="dark"] .option { border-color: var(--border-dark-surface); }
.option input { position: absolute; opacity: 0; width: 0; height: 0; }
.option .tick { display: none; font-weight: 700; }
.option:has(input:checked) {
  border-color: var(--brand);
  outline: 2px solid var(--brand);
  outline-offset: 1px;
}
.option:has(input:checked) .tick { display: inline; color: var(--brand-text); }
.option:focus-within { outline: 2px solid var(--brand); outline-offset: 1px; }

.dependent { margin-top: 1rem; }
.dependent[hidden] { display: none; }

.field { margin-top: 1rem; }
.field label { display: block; font-weight: 700; margin-bottom: 0.35rem; }
input[type="date"], textarea {
  width: 100%;
  font-family: var(--font-body);
  font-size: 1rem;
  padding: 0.6rem 0.75rem;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--ground);
  color: var(--ink);
}
html[data-theme="dark"] input[type="date"], html[data-theme="dark"] textarea {
  border-color: var(--border-dark-surface);
}
textarea { resize: vertical; min-height: 80px; }
.char-count { font-size: 0.78rem; color: var(--muted); margin-top: 0.25rem; }

/* Order panel — ALWAYS DARK in both themes (bug 1, 2) */
.order-panel {
  background: var(--band);
  color: var(--cream);
  border-radius: var(--radius);
  padding: 1.25rem;
  border: 1px solid rgba(246, 239, 224, 0.12);
}
.order-panel h2, .order-panel h3 { color: var(--cream); }
.order-panel .order-eyebrow { color: var(--accent-dark); }
.order-lines { list-style: none; margin: 0 0 1rem; padding: 0; }
.order-lines li {
  padding: 0.4rem 0;
  border-bottom: 1px dashed rgba(246, 239, 224, 0.18);
  color: var(--cream);
}
.order-lines li:last-child { border-bottom: none; }
.order-confirm { color: var(--accent-dark); font-weight: 700; margin-top: 0.5rem; }
.order-empty { color: #B9C2D6; }
.order-message {
  background: rgba(246, 239, 224, 0.08);
  border: 1px solid rgba(246, 239, 224, 0.18);
  border-radius: 8px;
  padding: 0.75rem;
  font-size: 0.9rem;
  color: var(--cream);
  margin: 1rem 0;
  white-space: pre-wrap;
}
.order-actions { display: grid; gap: 0.6rem; }
.copy-status { font-size: 0.82rem; color: var(--accent-dark); min-height: 1.2em; }

/* ---------- Footer (ALWAYS DARK) ---------- */
.site-footer {
  background: var(--band);
  color: var(--cream);
  padding-block: 2.5rem 1.5rem;
  margin-top: 3rem;
}
.footer-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 1.5rem 2rem;
}
.footer-grid > * { min-width: 0; }
.site-footer a { color: var(--accent-dark); }
.footer-brand { font-family: var(--font-head); font-weight: 700; font-size: 1.3rem; color: var(--cream); }
.footer-bottom {
  margin-top: 2rem;
  padding-top: 1.25rem;
  border-top: 1px solid rgba(246, 239, 224, 0.15);
  font-size: 0.85rem;
  color: #B9C2D6;
}
.footer-bottom a { color: var(--accent-dark); }
.demo-note {
  background: #070B16;
  color: var(--cream);
  border: 1px solid rgba(246, 239, 224, 0.15);
  border-radius: 8px;
  padding: 0.75rem 1rem;
  margin-top: 1rem;
  font-size: 0.85rem;
}
.demo-note strong { color: var(--accent-dark); }

/* ---------- Lede ---------- */
.lede { font-size: 1.15rem; color: var(--muted); max-width: 60ch; }

/* ---------- Responsive (bug 3) ---------- */
@media (max-width: 860px) {
  .hero-grid { grid-template-columns: 1fr; }
  .builder-layout { grid-template-columns: 1fr; }
  .builder-aside { position: static; }
  .findus { grid-template-columns: 1fr; }
}

@media (max-width: 700px) {
  /* nav on its own row */
  .header-inner { flex-wrap: wrap; }
  .site-nav { order: 3; width: 100%; }
  .site-nav ul { justify-content: flex-start; }
}

@media (max-width: 480px) {
  /* hide header CTA button(s) on very small screens */
  .header-cta { display: none; }
  .brand { font-size: 1.25rem; }
}

@media (max-width: 360px) {
  .container { padding-inline: 1rem; }
  .qty-row { grid-template-columns: 1fr; align-items: start; }
  .option-set { gap: 0.45rem; }
}

/* ember band: ghost buttons use dark text (cream on ember is only ~3:1) */
.band--ember a.btn--ghost, .band--ember button.btn--ghost { color: var(--ink-fixed); border-color: var(--ink-fixed); background: transparent; }
.band--ember a.btn--ghost:hover, .band--ember button.btn--ghost:hover { background: var(--ink-fixed); color: var(--cream); border-color: var(--ink-fixed); }
