/* FindPizza – forsiden (search-first). Kun index.html; resten af siden bruger style.css. */
:root[data-theme="dark"] {
  --color-bg: #17120f;
  --color-header: #1c1612;
  --color-text: #f7f4f1;
  --color-muted: #c9beb5;
  --color-accent: #e86f58;
  --color-accent-hover: #f08069;
  --color-accent-ink: #1b100c;   /* mørk tekst på coral: kontrast ca. 6:1 (hvid ville kun give 3:1) */
  --color-input: #f7f5f3;
  --color-input-text: #302b28;
  --color-border: #3b302b;
  --radius-pill: 999px;
  --radius-input-mobile: 18px;
  --radius-button-mobile: 16px;
  --container-width: 1120px;
  --search-width: 800px;
  --header-height: 76px;
  --header-height-mobile: 64px;
  --shadow-search: 0 12px 35px rgba(0, 0, 0, .22);
  --focus-ring: 0 0 0 3px rgba(232, 111, 88, .45);

  /* De fælles tokens i style.css, så de øvrige faner følger samme varme mørke tema */
  --bg: var(--color-bg); --card: #211a16; --ink: var(--color-text); --muted: var(--color-muted);
  --line: var(--color-border); --accent: var(--color-accent); --accent-soft: #3d2119; --bar: var(--color-accent); --bar-bg: #2b221d;
}
body {
  background: var(--color-bg);
  color: var(--color-text);
  font-family: Inter, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
}
.sr-only { position: absolute !important; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
:focus-visible { outline: none; box-shadow: var(--focus-ring); border-radius: 8px; }

/* ---------- Header ---------- */
.site-header { background: var(--color-header); position: sticky; top: 0; z-index: 30; border-bottom: 1px solid rgba(59, 48, 43, .6); }
.hdr { height: var(--header-height); display: flex; align-items: center; gap: 24px; }
.brand { display: flex; align-items: center; gap: 10px; color: var(--color-text); text-decoration: none; font-size: 24px; font-weight: 700; letter-spacing: -.01em; flex-shrink: 0; }
.brand .logo { font-size: 28px; line-height: 1; }
.site-nav { margin-left: auto; display: flex; align-items: center; gap: 6px; }
.site-nav .tabs { background: none; padding: 0; gap: 2px; overflow: visible; }
.site-nav .tabs button, .site-nav .nav-link {
  min-height: 44px; padding: 0 16px; border-radius: var(--radius-pill); border: 0; background: none;
  color: var(--color-muted); font: inherit; font-size: 14px; font-weight: 500; cursor: pointer;
  display: inline-flex; align-items: center; text-decoration: none; white-space: nowrap;
}
.site-nav .tabs button:hover, .site-nav .nav-link:hover { color: var(--color-text); }
.site-nav .tabs button[aria-selected="true"] { color: var(--color-accent); background: rgba(232, 111, 88, .1); box-shadow: none; }
.site-nav .switchers { margin-left: 10px; display: flex; gap: 6px; }
.site-nav .switch select {
  min-height: 36px; background: transparent; color: var(--color-muted); border: 1px solid var(--color-border);
  border-radius: 10px; font-size: 13px; padding: 4px 8px;
}
.site-nav .switch select option { background: var(--color-header); color: var(--color-text); }
.menu-btn { display: none; }

/* "Mere"-faner (statistik osv.) */
.more-tabs { display: flex; flex-wrap: wrap; gap: 4px; margin: 20px 0 4px; background: none; padding: 0; }
.more-tabs[hidden] { display: none; }
.more-tabs button { border: 1px solid var(--color-border); background: none; color: var(--color-muted); border-radius: var(--radius-pill); padding: 8px 14px; font: inherit; font-size: 14px; cursor: pointer; min-height: 40px; }
.more-tabs button[aria-selected="true"] { color: var(--color-accent); border-color: var(--color-accent); background: none; box-shadow: none; }
#loading { margin-top: 24px; }
.about-card p { margin: 0 0 8px; }

/* ---------- Hero ---------- */
main.wrap { max-width: var(--container-width); }
.home { position: relative; }
.home::before { /* svag varm glød bag pizzaen */
  content: ""; position: absolute; inset: 120px 0 auto; height: 760px; z-index: -1; pointer-events: none;
  background: radial-gradient(ellipse 50% 45% at 50% 60%, rgba(150, 70, 30, .22), transparent 70%);
}
.hero { text-align: center; padding: 112px 0 0; }
.hero h1 {
  font-size: 64px; line-height: 1.1; letter-spacing: -.035em; font-weight: 780;
  max-width: 1000px; margin: 0 auto 16px; color: var(--color-text);
}
.hero-sub { font-size: 19px; color: var(--color-muted); max-width: 760px; margin: 0 auto 48px; line-height: 1.5; }

/* ---------- Søgefeltet ---------- */
.pizza-search { width: min(var(--search-width), 100%); margin: 0 auto; }
.search-field {
  display: flex; align-items: center; gap: 12px; height: 72px; padding: 0 8px 0 28px;
  background: var(--color-input); color: var(--color-input-text); border-radius: var(--radius-pill);
  box-shadow: var(--shadow-search); transition: box-shadow 160ms ease;
}
.search-field:focus-within { box-shadow: var(--shadow-search), var(--focus-ring); }
.search-ico { flex-shrink: 0; color: #6d625b; }
.search-field .ac-wrap { position: relative; flex: 1; min-width: 0; height: 100%; }
.search-field input, .search-field #find-input {
  width: 100%; height: 100%; border: 0; outline: 0; background: transparent; padding: 0;
  font: inherit; font-size: 17px; color: var(--color-input-text);
}
.search-field input::placeholder { color: #776c65; opacity: 1; }
.search-field input::-webkit-search-cancel-button { cursor: pointer; }
.search-field input:focus-visible { box-shadow: none; }
.search-button {
  flex-shrink: 0; height: 56px; padding: 0 28px; border: 0; border-radius: var(--radius-pill);
  background: var(--color-accent); color: var(--color-accent-ink); font: inherit; font-size: 16px; font-weight: 650;
  cursor: pointer; transition: background-color 160ms ease, transform 160ms ease;
}
.search-button:hover { background: var(--color-accent-hover); transform: translateY(-1px); }
.search-button:active { transform: translateY(0); }
.search-button:disabled { cursor: progress; opacity: .85; transform: none; }
.search-button:focus-visible { box-shadow: var(--focus-ring); }

/* Forslag mens man skriver */
.search-field .ac {
  top: calc(100% + 10px); left: -46px; right: -150px; text-align: left; background: #fffdfb; color: var(--color-input-text);
  border: 0; border-radius: 16px; box-shadow: 0 16px 40px rgba(0, 0, 0, .35); padding: 6px; z-index: 40;
}
.search-field .ac li { min-height: 44px; align-items: center; }
.search-field .ac li[aria-selected="true"], .search-field .ac li:hover { background: #f3ebe4; }
.search-field .ac small { color: #7a6d64; }

.find-err { max-width: var(--search-width); margin: 14px auto 0; color: var(--color-muted); font-size: 15px; }

/* ---------- Pizzabilledet ---------- */
.hero-visual { margin: 8px auto 0; width: min(100%, 900px); pointer-events: none; }
.hero-pizza {
  display: block; width: 100%; height: auto; aspect-ratio: 16 / 9; margin-inline: auto;
  /* Billedet har mørk (ikke gennemsigtig) baggrund: tones helt ud før kanterne, så der aldrig ses et rektangel */
  -webkit-mask-image: radial-gradient(ellipse 50% 50% at 50% 50%, #000 70%, transparent 100%);
  mask-image: radial-gradient(ellipse 50% 50% at 50% 50%, #000 70%, transparent 100%);
}
.has-results .hero-visual, .has-results .home::before { display: none; }

/* ---------- Resultater ---------- */
.home-results { max-width: var(--search-width); margin: 0 auto; text-align: left; scroll-margin-top: calc(var(--header-height) + 16px); }
.has-results .home-results { padding: 40px 0 24px; }
.home-results .card { background: #211a16; border: 1px solid var(--color-border); box-shadow: none; }
.home-results .order-guide h3 { color: var(--color-text); }
.home-results .og-more a, .home-results a { color: var(--color-accent); }
.near-card { margin-top: 16px; }
.near-form { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.near-label { flex: 1 0 100%; font-weight: 650; font-size: 17px; margin-bottom: 4px; }
.near-form input {
  flex: 0 1 180px; min-height: 48px; padding: 0 16px; font: inherit; font-size: 16px;
  background: var(--color-input); color: var(--color-input-text); border: 0; border-radius: 14px;
}
.near-form .btn { min-height: 48px; border-radius: 14px; }
.home-results .btn { background: var(--color-accent); color: var(--color-accent-ink); border-color: var(--color-accent); }
.home-results .btn:hover { background: var(--color-accent-hover); }
.home-results .btn.ghost { background: transparent; color: var(--color-text); border: 1px solid var(--color-border); }
.home-results .near-item { background: #211a16; border-color: var(--color-border); }
.home-results .near-head a { color: var(--color-text); }

/* ---------- Footer ---------- */
.site-footer { margin-top: 96px; border-top: 1px solid rgba(59, 48, 43, .6); }
.has-results .site-footer, body:not([data-tab="start"]) .site-footer { margin-top: 64px; }
.ftr { display: flex; justify-content: space-between; align-items: center; gap: 16px; flex-wrap: wrap; padding-top: 24px; padding-bottom: 32px; font-size: 12px; color: var(--color-muted); }
.ftr-links { display: flex; gap: 20px; flex-wrap: wrap; }
.ftr-links a { color: var(--color-muted); text-decoration: none; min-height: 44px; display: inline-flex; align-items: center; }
.ftr-links a:hover { color: var(--color-text); text-decoration: underline; }

/* ---------- Tablet (640–1023px) ---------- */
@media (max-width: 1023px) {
  .hero { padding-top: 88px; }
  .hero h1 { font-size: 52px; }
  .pizza-search { width: min(700px, 100%); }
  .site-nav .tabs button, .site-nav .nav-link { padding: 0 10px; }
  .site-nav .switchers { margin-left: 4px; }
}

/* ---------- Mobil (under 640px) ---------- */
@media (max-width: 639px) {
  .hdr { height: var(--header-height-mobile); }
  .brand { font-size: 21px; }
  .brand .logo { font-size: 24px; }
  .menu-btn {
    display: inline-grid; place-items: center; margin-left: auto; width: 44px; height: 44px;
    background: none; border: 0; border-radius: 12px; color: var(--color-text); cursor: pointer;
  }
  .menu-ico, .menu-ico::before, .menu-ico::after { display: block; width: 22px; height: 2px; background: currentColor; border-radius: 2px; position: relative; transition: transform 160ms ease; }
  .menu-ico::before, .menu-ico::after { content: ""; position: absolute; left: 0; }
  .menu-ico::before { top: -7px; }
  .menu-ico::after { top: 7px; }
  .menu-open .menu-ico { background: transparent; }
  .menu-open .menu-ico::before { transform: translateY(7px) rotate(45deg); }
  .menu-open .menu-ico::after { transform: translateY(-7px) rotate(-45deg); }
  .site-nav {
    display: none; position: absolute; top: 100%; left: 0; right: 0; margin: 0;
    flex-direction: column; align-items: stretch; gap: 4px; padding: 12px 16px 20px;
    background: var(--color-header); border-bottom: 1px solid var(--color-border);
  }
  .menu-open .site-nav { display: flex; }
  .site-nav .tabs { flex-direction: column; align-items: stretch; }
  .site-nav .tabs button, .site-nav .nav-link { font-size: 15px; padding: 0 12px; min-height: 48px; border-radius: 12px; }
  .site-nav .switchers { margin: 8px 0 0; padding-top: 12px; border-top: 1px solid var(--color-border); }
  .site-nav .switch, .site-nav .switch select { flex: 1; width: 100%; min-height: 44px; }

  .hero { padding-top: 72px; }
  .hero h1 { font-size: 38px; }
  .hero-sub { font-size: 16px; margin-bottom: 32px; }
  .search-field { flex-wrap: wrap; height: auto; padding: 0; background: none; box-shadow: none; gap: 12px; }
  .search-field:focus-within { box-shadow: none; }
  .search-ico { position: absolute; left: 18px; top: 19px; z-index: 1; pointer-events: none; }
  .search-field .ac-wrap { flex: 1 0 100%; height: 60px; }
  .search-field input, .search-field #find-input {
    height: 60px; padding: 0 16px 0 52px; background: var(--color-input); border-radius: var(--radius-input-mobile);
    box-shadow: var(--shadow-search);
  }
  .search-field input:focus-visible { box-shadow: var(--shadow-search), var(--focus-ring); }
  .search-field .ac { left: 0; right: 0; top: calc(100% + 6px); }
  .search-button { width: 100%; height: 54px; border-radius: var(--radius-button-mobile); }
  .pizza-search { position: relative; }
  .hero-visual { margin-top: 24px; }
  .near-form input { flex: 1 1 100%; }
  .near-form .btn { flex: 1 1 auto; }
  .site-footer { margin-top: 48px; }
  .ftr { flex-direction: column; align-items: flex-start; gap: 4px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition: none !important; animation: none !important; scroll-behavior: auto !important; }
}

/* Logo i headeren */
.brand .brand-logo { height: 32px; width: auto; display: block; }
@media (max-width: 639px) { .brand .brand-logo { height: 28px; } }
