/* =========================================================================
   Local-business starter – base stylesheet
   The LOOK lives in the tokens (:root). Theme presets in themes/*.css
   override only tokens + a few signature rules. See vault note
   "Design Styles Library".
   ========================================================================= */

@layer reset, tokens, base, layout, components, utilities;

/* ---------- reset ---------- */
@layer reset {
  *, *::before, *::after { box-sizing: border-box; }
  html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }
  body { margin: 0; min-height: 100dvh; }
  h1, h2, h3, h4, p, figure, blockquote, ul, ol, dl { margin: 0; }
  ul[class], ol[class] { list-style: none; padding: 0; }
  img, picture, svg, video { display: block; max-width: 100%; height: auto; }
  input, button, textarea, select { font: inherit; color: inherit; }
  table { border-collapse: collapse; }
}

/* ---------- tokens (default = neutral clean; themes override) ---------- */
@layer tokens {
  :root {
    --color-bg: #fbfaf8;
    --color-surface: #ffffff;
    --color-tint: #f2efe9;
    --color-text: #1c1a17;
    --color-muted: #5f5a53;
    --color-primary: #1f5f8b;
    --color-primary-contrast: #ffffff;
    --color-accent: #e0a23b;
    --color-border: #e4ded4;
    --color-dark: #1c1a17;
    --color-dark-contrast: #faf8f5;
    --color-success: #1f7a4d;

    --font-heading: ui-serif, Georgia, "Times New Roman", serif;
    --font-body: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
    --heading-weight: 700;
    --heading-tracking: -0.015em;
    --heading-transform: none;

    --step--1: clamp(0.83rem, 0.8rem + 0.15vw, 0.94rem);
    --step-0: clamp(1rem, 0.96rem + 0.2vw, 1.125rem);
    --step-1: clamp(1.2rem, 1.1rem + 0.5vw, 1.45rem);
    --step-2: clamp(1.5rem, 1.3rem + 0.9vw, 2rem);
    --step-3: clamp(1.9rem, 1.55rem + 1.7vw, 2.85rem);
    --step-4: clamp(2.3rem, 1.75rem + 2.8vw, 3.9rem);

    --space-2xs: 0.25rem;
    --space-xs: clamp(0.5rem, 0.45rem + 0.25vw, 0.75rem);
    --space-s: clamp(0.75rem, 0.7rem + 0.4vw, 1rem);
    --space-m: clamp(1.25rem, 1.1rem + 0.75vw, 1.75rem);
    --space-l: clamp(2rem, 1.7rem + 1.5vw, 3rem);
    --space-xl: clamp(3rem, 2.4rem + 3vw, 5rem);
    --space-section: clamp(3.5rem, 2.5rem + 5vw, 7.5rem);

    --radius: 0.5rem;
    --radius-lg: 1rem;
    --radius-btn: 0.5rem;
    --shadow: 0 1px 2px rgb(0 0 0 / 0.05), 0 8px 24px rgb(0 0 0 / 0.07);
    --container: 72rem;
    --container-narrow: 46rem;
    --header-h: 4rem;
    --action-bar-h: 4rem;
    --ease: cubic-bezier(0.2, 0.7, 0.2, 1);
  }
}

/* ---------- base ---------- */
@layer base {
  html { scroll-padding-top: calc(var(--header-h) + 1rem); }
  @media (prefers-reduced-motion: no-preference) { html { scroll-behavior: smooth; } }

  body {
    background: var(--color-bg);
    color: var(--color-text);
    font-family: var(--font-body);
    font-size: var(--step-0);
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
  }

  h1, h2, h3, h4 {
    font-family: var(--font-heading);
    font-weight: var(--heading-weight);
    letter-spacing: var(--heading-tracking);
    text-transform: var(--heading-transform);
    line-height: 1.12;
    text-wrap: balance;
    hyphens: auto;          /* long German compound words on small screens */
    overflow-wrap: break-word;
  }
  h1 { font-size: var(--step-4); }
  h2 { font-size: var(--step-3); }
  h3 { font-size: var(--step-1); }

  p { text-wrap: pretty; }
  a { color: var(--color-primary); text-underline-offset: 0.18em; }
  a:hover { text-decoration-thickness: 2px; }

  :focus-visible { outline: 3px solid var(--color-accent); outline-offset: 3px; border-radius: 2px; }
  ::selection { background: var(--color-accent); color: var(--color-text); }

  address { font-style: normal; }
}

/* ---------- layout ---------- */
@layer layout {
  .container { width: min(100% - 2rem, var(--container)); margin-inline: auto; }
  .narrow { --container: var(--container-narrow); }
  .section { padding-block: var(--space-section); }
  .section-tinted { background: var(--color-tint); }

  .stack > * + * { margin-block-start: var(--space-s); }
  .cluster { display: flex; flex-wrap: wrap; gap: var(--space-s); align-items: center; }
  .center-cluster { justify-content: center; }

  .card-grid {
    display: grid;
    gap: var(--space-m);
    grid-template-columns: repeat(auto-fit, minmax(min(17rem, 100%), 1fr));
  }

  .split {
    display: grid;
    gap: var(--space-l);
    align-items: center;
  }
  @media (min-width: 48rem) { .split { grid-template-columns: 5fr 6fr; } }

  .contact-grid { display: grid; gap: var(--space-l); }
  @media (min-width: 56rem) { .contact-grid { grid-template-columns: 1fr 1fr; align-items: start; } }

  .footer-grid { display: grid; gap: var(--space-m); grid-template-columns: repeat(auto-fit, minmax(min(14rem, 100%), 1fr)); }
}

/* ---------- components ---------- */
@layer components {
  /* skip link */
  .skip-link {
    position: absolute; left: 1rem; top: -100px; z-index: 100;
    background: var(--color-surface); padding: 0.5rem 1rem; border-radius: var(--radius);
  }
  .skip-link:focus { top: 1rem; }

  /* preview banner: every page of a demo/preview (removed at launch; check-site.ps1 enforces both) */
.preview-banner { position: relative; z-index: 60; background: #fff4c2; color: #3d3000; text-align: center; font: 600 0.8125rem/1.35 system-ui, sans-serif; padding: 0.45rem 1rem; border-bottom: 1px solid #e8d48a; }

/* draft legal texts (contract § 4 Abs. 2: the client supplies the final text) */
.legal-draft-note { padding: 0.75rem 1rem; border-left: 4px solid #c99a3b; background: #fff8e6; color: #4a3b10; font-size: var(--step--1); margin-block: var(--space-s); }

/* announcement */
  .announcement { background: var(--color-dark); color: var(--color-dark-contrast); text-align: center; font-size: var(--step--1); padding: 0.5rem 1rem; }
  .announcement a { color: inherit; }

  /* header & nav */
  .site-header {
    position: sticky; top: 0; z-index: 50;
    background: color-mix(in srgb, var(--color-bg) 88%, transparent);
    backdrop-filter: blur(10px);
    border-bottom: 1px solid var(--color-border);
  }
  .header-inner { display: flex; align-items: center; justify-content: space-between; gap: var(--space-s); min-height: var(--header-h); }
  .logo { font-family: var(--font-heading); font-weight: var(--heading-weight); font-size: var(--step-1); color: var(--color-text); text-decoration: none; text-transform: var(--heading-transform); }

  .site-nav ul { display: flex; flex-wrap: wrap; gap: var(--space-xs) var(--space-m); list-style: none; margin: 0; padding: 0; }
  .site-nav a:not(.btn) { color: var(--color-text); text-decoration: none; font-weight: 500; padding-block: 0.5rem; display: inline-block; }
  .site-nav a:not(.btn):hover { color: var(--color-primary); }

  .nav-toggle { display: none; }

  @media (max-width: 47.99rem) {
    .js .nav-toggle {
      display: inline-grid; place-items: center;
      width: 2.75rem; height: 2.75rem; border: 0; background: transparent; cursor: pointer; border-radius: var(--radius);
    }
    .nav-toggle-bars, .nav-toggle-bars::before, .nav-toggle-bars::after {
      display: block; width: 1.4rem; height: 2px; background: currentColor; position: relative; transition: transform .2s var(--ease), opacity .2s;
    }
    .nav-toggle-bars::before, .nav-toggle-bars::after { content: ""; position: absolute; left: 0; }
    .nav-toggle-bars::before { top: -7px; }
    .nav-toggle-bars::after { top: 7px; }
    .nav-toggle[aria-expanded="true"] .nav-toggle-bars { background: transparent; }
    .nav-toggle[aria-expanded="true"] .nav-toggle-bars::before { transform: translateY(7px) rotate(45deg); }
    .nav-toggle[aria-expanded="true"] .nav-toggle-bars::after { transform: translateY(-7px) rotate(-45deg); }

    .header-inner { flex-wrap: wrap; }
    .site-nav { flex-basis: 100%; padding-block-end: var(--space-s); }
    .site-nav ul { flex-direction: column; gap: 0; }
    .site-nav .btn { margin-block-start: var(--space-xs); }
    .js .site-nav:not([data-open="true"]) { display: none; }
  }
  @media (min-width: 48rem) {
    .site-nav { display: flex; align-items: center; gap: var(--space-m); }
  }

  /* buttons — min 44px tap target */
  .btn {
    display: inline-flex; align-items: center; justify-content: center; gap: 0.5em;
    min-height: 2.75rem; padding: 0.75rem 1.4rem;
    border: 2px solid transparent; border-radius: var(--radius-btn);
    font-weight: 600; line-height: 1.2; text-decoration: none; cursor: pointer;
    transition: background-color .18s var(--ease), color .18s, border-color .18s, transform .18s var(--ease);
  }
  .btn:hover { transform: translateY(-1px); text-decoration: none; }
  .btn:active { transform: translateY(0); }
  .btn-sm { min-height: 2.5rem; padding: 0.5rem 1rem; }
  .btn-primary { background: var(--color-primary); color: var(--color-primary-contrast); }
  .btn-primary:hover { background: color-mix(in srgb, var(--color-primary), black 14%); }
  .btn-secondary { border-color: currentColor; color: var(--color-text); background: transparent; }
  .btn-secondary:hover { background: var(--color-text); color: var(--color-bg); }
  .btn-light { background: var(--color-dark-contrast); color: var(--color-dark); }
  .btn-outline-light { border-color: var(--color-dark-contrast); color: var(--color-dark-contrast); }

  /* hero */
  .hero { padding-block: var(--space-l) var(--space-section); }
  .hero-inner { display: grid; gap: var(--space-l); align-items: center; }
  @media (min-width: 56rem) { .hero-inner { grid-template-columns: 1.05fr 1fr; } }
  .hero-text > * + * { margin-block-start: var(--space-m); }
  .lead { font-size: var(--step-1); color: var(--color-muted); max-width: 38ch; line-height: 1.5; }
  .hero-media img { width: 100%; aspect-ratio: 4 / 3; object-fit: cover; border-radius: var(--radius-lg); box-shadow: var(--shadow); }
  .trust-line { font-size: var(--step--1); color: var(--color-muted); }
  .trust-line span { color: var(--color-accent); letter-spacing: 0.1em; }

  .eyebrow { font-size: var(--step--1); font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase; color: var(--color-primary); }

  /* open-now badge */
  .open-status { display: inline-flex; align-items: center; gap: 0.5em; text-transform: none; letter-spacing: 0; color: var(--color-text); font-weight: 600; }
  .open-status[data-state]::before { content: ""; width: 0.6em; height: 0.6em; border-radius: 50%; background: var(--color-muted); }
  .open-status[data-state="open"]::before { background: var(--color-success); box-shadow: 0 0 0 0.25em color-mix(in srgb, var(--color-success) 25%, transparent); }

  /* info strip */
  .info-strip { background: var(--color-surface); border-block: 1px solid var(--color-border); padding-block: var(--space-m); }
  .info-grid { display: grid; gap: var(--space-m); grid-template-columns: repeat(auto-fit, minmax(min(11rem, 100%), 1fr)); }
  .info-label { font-family: var(--font-body); font-size: var(--step--1); text-transform: uppercase; letter-spacing: 0.08em; color: var(--color-muted); font-weight: 600; }

  /* section heads */
  .section-head { max-width: 40rem; margin-block-end: var(--space-l); }
  .section-head > * + * { margin-block-start: var(--space-xs); }
  .section-head p:not(.eyebrow) { color: var(--color-muted); }

  /* cards */
  .card { background: var(--color-surface); border: 1px solid var(--color-border); border-radius: var(--radius-lg); overflow: hidden; display: flex; flex-direction: column; }
  .card img { width: 100%; aspect-ratio: 4 / 3; object-fit: cover; }
  .card-body { padding: var(--space-m); }
  .card-body > * + * { margin-block-start: var(--space-xs); }
  .card-body p { color: var(--color-muted); }

  /* quotes */
  .quote { background: var(--color-surface); border: 1px solid var(--color-border); border-radius: var(--radius-lg); padding: var(--space-m); display: flex; flex-direction: column; justify-content: space-between; gap: var(--space-s); }
  .quote blockquote { font-family: var(--font-heading); font-size: var(--step-1); line-height: 1.35; }
  .quote figcaption { font-size: var(--step--1); color: var(--color-muted); }

  /* menu / price list */
  .menu-group + .menu-group { margin-block-start: var(--space-l); }
  .menu-group h3 { padding-block-end: var(--space-xs); border-bottom: 2px solid var(--color-text); margin-block-end: var(--space-s); }
  .menu-list li { padding-block: var(--space-s); border-bottom: 1px dashed var(--color-border); }
  .menu-item-head { display: flex; align-items: baseline; gap: var(--space-s); }
  .menu-item-name { font-weight: 600; }
  .menu-item-head::after { content: ""; order: 1; flex: 1; border-bottom: 1px dotted var(--color-muted); opacity: .5; transform: translateY(-0.3em); }
  .menu-item-price { order: 2; font-variant-numeric: tabular-nums; font-weight: 600; white-space: nowrap; }
  .menu-item-desc { color: var(--color-muted); font-size: var(--step--1); margin-block-start: 0.2rem; }
  .tag { display: inline-block; font-size: 0.75rem; font-weight: 600; padding: 0.1rem 0.5rem; border-radius: 999px; background: color-mix(in srgb, var(--color-success) 14%, transparent); color: var(--color-success); margin-inline-start: 0.25rem; }

  /* FAQ */
  .faq details { border-bottom: 1px solid var(--color-border); }
  .faq summary { cursor: pointer; padding-block: var(--space-s); font-weight: 600; list-style: none; display: flex; justify-content: space-between; gap: 1rem; }
  .faq summary::-webkit-details-marker { display: none; }
  .faq summary::after { content: "+"; font-size: 1.4em; line-height: 1; transition: transform .2s var(--ease); }
  .faq details[open] summary::after { transform: rotate(45deg); }
  .faq details p { padding-block-end: var(--space-s); color: var(--color-muted); }

  /* hours table */
  .hours { width: 100%; max-width: 26rem; }
  .hours th, .hours td { text-align: start; padding: 0.4rem 0; border-bottom: 1px solid var(--color-border); font-variant-numeric: tabular-nums; }
  .hours th { font-weight: 500; }
  .hours td { text-align: end; }
  .hours tr.is-today { font-weight: 700; color: var(--color-primary); }
  .hours tr.is-today th { font-weight: 700; }

  /* map facade */
  .map-facade {
    min-height: 22rem; border-radius: var(--radius-lg); overflow: hidden; border: 1px solid var(--color-border);
    background:
      repeating-linear-gradient(45deg, transparent 0 22px, color-mix(in srgb, var(--color-border) 60%, transparent) 22px 23px),
      var(--color-surface);
    display: grid; place-items: center; text-align: center;
  }
  .map-facade-inner { display: grid; gap: var(--space-xs); justify-items: center; padding: var(--space-m); max-width: 24rem; background: var(--color-surface); border-radius: var(--radius); }
  .map-facade iframe { width: 100%; height: 100%; min-height: 22rem; border: 0; }

  /* CTA band */
  .cta-band { background: var(--color-dark); color: var(--color-dark-contrast); padding-block: var(--space-xl); }
  .cta-band h2 { color: inherit; }

  /* footer */
  .site-footer { background: var(--color-tint); padding-block: var(--space-l); border-top: 1px solid var(--color-border); }
  .site-footer > p { margin-block-start: var(--space-m); }
  .footer-links { list-style: none; padding: 0; display: grid; gap: 0.25rem; }
  .footer-links a { color: var(--color-text); }

  /* mobile action bar */
  .action-bar { display: none; }
  @media (max-width: 47.99rem) {
    body { padding-bottom: calc(var(--action-bar-h) + env(safe-area-inset-bottom)); }
    .action-bar {
      display: grid; grid-auto-flow: column; grid-auto-columns: 1fr;
      position: fixed; inset-inline: 0; bottom: 0; z-index: 60;
      height: calc(var(--action-bar-h) + env(safe-area-inset-bottom));
      padding-bottom: env(safe-area-inset-bottom);
      background: var(--color-surface); border-top: 1px solid var(--color-border);
      box-shadow: 0 -4px 16px rgb(0 0 0 / .06);
    }
    .action-bar a {
      display: grid; place-items: center; align-content: center; gap: 0.15rem;
      color: var(--color-text); text-decoration: none; font-size: 0.75rem; font-weight: 600;
    }
    .action-bar a:first-child { background: var(--color-primary); color: var(--color-primary-contrast); }
    .action-bar svg { width: 1.35rem; height: 1.35rem; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
  }

  /* reveal on scroll — only hidden when JS runs and motion is OK */
  @media (prefers-reduced-motion: no-preference) {
    .js .reveal { opacity: 0; transform: translateY(16px); transition: opacity .6s var(--ease), transform .6s var(--ease); }
    .js .reveal.is-visible { opacity: 1; transform: none; }
  }

  /* legal pages */
  .legal { padding-block: var(--space-xl); }
  .legal h1 { font-size: var(--step-3); margin-block-end: var(--space-m); }
  .legal h2 { font-size: var(--step-1); margin-block: var(--space-l) var(--space-xs); }
  .legal p, .legal li { max-width: 70ch; }
}

/* ---------- utilities ---------- */
@layer utilities {
  .visually-hidden { position: absolute !important; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
  .center { text-align: center; margin-inline: auto; }
  .center.stack, .cta-band .stack { justify-items: center; }
  p.center { margin-block-start: var(--space-l); }
  .small { font-size: var(--step--1); }
  .muted { color: var(--color-muted); }
  .rounded { border-radius: var(--radius-lg); }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.01ms !important; animation-iteration-count: 1 !important; transition-duration: 0.01ms !important; }
}
