/* =========================================================================
   Baeckerei Kramer - Konzeptprojekt (R10)
   Eigenes Design-System, bewusst NICHT die Tokens der Hauptseite.
   Regeln: docs/REBRAND/03_REFERENZEN_SPEC.md §8 + 07_DESIGN_QUALITAET.md.
   Kein Laufband (R7), keine Kacheln, keine Fakt-Chips, keine Icons ausser
   Nav und den Mengensteppern, keine Sepia-Historie. Der Backkalender ist
   eine Kreuztabelle, kein Zeitenaushang.
   ========================================================================= */

@font-face {
  font-family: 'Young Serif';
  src: url('assets/fonts/YoungSerif-latin.woff2') format('woff2');
  font-weight: 400; font-style: normal; font-display: swap;
}
@font-face {
  font-family: 'Work Sans';
  src: url('assets/fonts/WorkSans-latin.woff2') format('woff2');
  font-weight: 100 900; font-style: normal; font-display: swap;
}

:root {
  /* Palette (Brief). --wheat und --crust tragen auf Creme keinen Fliesstext
     (1,9:1 bzw. 4,2:1), deshalb --crust-ink fuer Schrift und --muted fuer
     Sekundaertext. */
  --cream:     #f6efe3;
  --paper:     #fbf7ef;
  --rye:       #4a2e1f;
  --wheat:     #d9a441;   /* Marken auf Dunkel, Fortschrittslinie */
  --crust:     #a5622e;   /* Marken auf Creme, Wellenlinie */
  --crust-ink: #8f5326;   /* Text auf Creme, 5,3:1 */
  --ink:       #2b1a12;
  --muted:     #6b5347;   /* Sekundaertext, 6,2:1 auf Creme */
  --line:      #e0d2bd;
  --line-2:    #c9b394;
  --line-dark: #6d4b36;

  --font-display: 'Young Serif', 'Iowan Old Style', Georgia, serif;
  --font-text: 'Work Sans', system-ui, -apple-system, 'Segoe UI', sans-serif;

  --d1:    clamp(2.4rem, 6vw, 5rem);
  --d2:    clamp(1.8rem, 3.6vw, 3rem);
  --d3:    clamp(1.3rem, 2vw, 1.65rem);
  --year:  clamp(2.5rem, 6vw, 4.5rem);
  --lead:  clamp(1.0625rem, 1.3vw, 1.25rem);
  --body:  1.0625rem;
  --small: 0.9375rem;
  --micro: 0.8125rem;

  --gut:  clamp(1.25rem, 5vw, 3.5rem);
  --sec:  clamp(4rem, 9vw, 7.5rem);
  --measure: 62ch;
  --wrap: 1180px;

  --r: 8px;
  --dur: 300ms;
  --slow: 500ms;
  --ease: cubic-bezier(.2, .7, .2, 1);
  --head-h: 70px;

  color-scheme: light;
}

/* --- Basis ---------------------------------------------------------------- */
*, *::before, *::after { box-sizing: border-box; }
html {
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
  scroll-padding-top: calc(var(--head-h) + 20px);
}
body {
  margin: 0;
  background: var(--cream);
  color: var(--ink);
  font-family: var(--font-text);
  font-size: var(--body);
  line-height: 1.62;
  font-variant-numeric: lining-nums;
  -webkit-font-smoothing: antialiased;
}
/* Feine Koernung, 4 % (Brief; R7 liegt bei 5 %). */
body::after {
  content: '';
  position: fixed; inset: 0; z-index: 60; pointer-events: none; opacity: .04;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.8' numOctaves='3'/%3E%3C/filter%3E%3Crect width='160' height='160' filter='url(%23n)'/%3E%3C/svg%3E");
}
img { display: block; max-width: 100%; height: auto; }
h1, h2, h3 { margin: 0; font-weight: 400; }
p { margin: 0; }
ul, ol { margin: 0; padding: 0; list-style: none; }
a { color: inherit; }
table { border-collapse: collapse; width: 100%; }
button { font: inherit; }

:where(a, button, input, select, textarea):focus-visible {
  outline: 2px solid var(--crust-ink);
  outline-offset: 3px;
}
.zeit :focus-visible, .foot :focus-visible, .menu :focus-visible { outline-color: var(--wheat); }

.vh {
  position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}
.skip {
  position: absolute; left: -9999px; top: 0; z-index: 100;
  background: var(--rye); color: var(--cream); padding: 12px 18px; font-weight: 500;
}
.skip:focus { left: 8px; top: 8px; }

.wrap { max-width: var(--wrap); margin: 0 auto; }
.sec { padding: var(--sec) var(--gut); }
.h2 {
  font-family: var(--font-display); font-size: var(--d2); font-weight: 400;
  line-height: 1.06; letter-spacing: -0.01em; max-width: 18ch;
}
.h2--light { color: var(--cream); }
.lead { margin-top: 1rem; color: var(--muted); max-width: var(--measure); font-size: var(--lead); }

/* Handgezeichnete Wellenlinie als Trenner (Brief). */
.wave {
  height: 14px;
  background-repeat: repeat-x;
  background-size: 76px 14px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='76' height='14' viewBox='0 0 76 14'%3E%3Cpath d='M0 9c6-7 13-7 19 0s13 7 19 0 13-7 19 0 13 7 19 0' fill='none' stroke='%23a5622e' stroke-width='1.4' stroke-linecap='round'/%3E%3C/svg%3E");
  opacity: .7;
}

/* --- Buttons -------------------------------------------------------------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center;
  min-height: 50px; padding: .8rem 1.6rem;
  background: var(--rye); color: var(--cream);
  border: 1px solid var(--rye); border-radius: var(--r);
  font-weight: 500; font-size: var(--small);
  text-decoration: none; cursor: pointer;
  transition: background var(--dur) var(--ease), border-color var(--dur) var(--ease);
}
.btn:hover { background: var(--ink); border-color: var(--ink); }
.btn--light { background: var(--rye); color: var(--cream); }

/* --- Kopf ----------------------------------------------------------------- */
.head {
  position: sticky; top: 0; z-index: 40;
  display: flex; align-items: center; gap: 1.25rem;
  height: var(--head-h); padding: 0 var(--gut);
  background: var(--cream);
  border-bottom: 1px solid transparent;
  transition: border-color var(--dur) var(--ease);
}
.head.is-stuck { border-bottom-color: var(--line); }
.head__mark {
  margin-right: auto; display: flex; align-items: baseline; gap: .5rem;
  padding-block: .4rem; text-decoration: none;
}
.head__name { font-family: var(--font-display); font-size: 1.5rem; letter-spacing: -0.01em; }
.head__seit { font-size: var(--micro); color: var(--crust-ink); white-space: nowrap; }
.head__nav { display: none; }
.head__nav ul { display: flex; gap: 1.5rem; }
.head__nav a {
  display: inline-flex; align-items: center; min-height: 44px;
  font-size: var(--small); color: var(--muted); text-decoration: none;
  border-bottom: 1px solid transparent;
  transition: color var(--dur) var(--ease), border-color var(--dur) var(--ease);
}
.head__nav a:hover { color: var(--ink); border-bottom-color: var(--crust); }
.head__cta {
  display: none; align-items: center; min-height: 44px; padding: .5rem 1.2rem;
  background: var(--rye); color: var(--cream); border-radius: var(--r);
  font-size: var(--small); font-weight: 500; text-decoration: none;
  transition: background var(--dur) var(--ease);
}
.head__cta:hover { background: var(--ink); }

.burger {
  width: 44px; height: 44px; margin-right: -10px;
  display: grid; place-items: center;
  background: none; border: 0; cursor: pointer; color: var(--ink);
}
.burger__box { display: block; width: 22px; }
.burger__box i { display: block; height: 1.5px; background: currentColor; margin: 6px 0; }

.menu {
  position: absolute; top: var(--head-h); left: 0; right: 0; z-index: 39;
  background: var(--cream); border-bottom: 1px solid var(--line);
  padding: .5rem var(--gut) 1.5rem;
}
.menu[hidden] { display: none; }
.menu a {
  display: block; padding: .7rem 0; text-decoration: none;
  border-bottom: 1px solid var(--line);
  font-family: var(--font-display); font-size: 1.35rem;
}
.menu li:last-child a { border-bottom: 0; }

/* --- Hero: Bildband oben, Aussage und Tagesaushang darunter ---------------- */
.hero__img {
  width: 100%; height: clamp(200px, 32vw, 430px);
  object-fit: cover; object-position: center 55%;
}
.hero__body { padding: clamp(2rem, 5vw, 3.5rem) var(--gut) clamp(2.5rem, 5vw, 4rem); }
.hero__grid { max-width: var(--wrap); margin: 0 auto; display: grid; gap: clamp(1.75rem, 4vw, 3.5rem); }
.hero__h1 {
  font-family: var(--font-display); font-size: var(--d1); font-weight: 400;
  line-height: 1; letter-spacing: -0.02em; max-width: 13ch;
}
.hero__lead {
  max-width: var(--wrap); margin: clamp(1.75rem, 3vw, 2.5rem) auto 0;
  padding-top: 1.25rem; border-top: 1px solid var(--line-2);
  color: var(--muted); font-size: var(--small);
}
/* Der Tagesaushang: stehende, datierte Angabe statt Laufband. */
.aushang {
  background: var(--rye); color: var(--cream);
  border-radius: var(--r); padding: 1.25rem 1.4rem;
  align-self: start;
}
.aushang__tag { font-family: var(--font-display); font-size: 1.25rem; color: var(--wheat); }
.aushang__txt { margin-top: .5rem; font-size: var(--small); }
.aushang__st {
  margin-top: .8rem; padding-top: .7rem; border-top: 1px solid var(--line-dark);
  font-size: var(--micro);
}
.aushang__st:empty { display: none; }

/* --- Backkalender: Kreuztabelle Gebaeck x Backtag -------------------------- */
.kal__scroll { display: none; }
.kal__t { margin-top: clamp(2rem, 4vw, 3rem); font-size: var(--small); }
.kal__t abbr { text-decoration: none; }
.kal__t thead th {
  font-weight: 500; font-size: var(--micro); color: var(--muted);
  padding: 0 .35rem .6rem; text-align: center; vertical-align: bottom;
  border-bottom: 1px solid var(--ink);
}
.kal__t thead th:first-child { text-align: left; padding-left: 0; }
.kal__t tbody tr { border-bottom: 1px solid var(--line); }
.kal__t tbody th {
  text-align: left; padding: .9rem 1rem .9rem 0; vertical-align: middle; font-weight: 400;
}
.kal__n { display: block; font-family: var(--font-display); font-size: 1.15rem; }
.kal__s { display: block; font-size: var(--micro); color: var(--muted); }
.kal__c { text-align: center; padding: .9rem .35rem; }
.kal__mark {
  display: inline-block; width: 13px; height: 13px;
  background: var(--crust); border-radius: 3px;
}
.kal__c[data-off]::after {
  content: ''; display: inline-block; width: 13px; height: 1px; background: var(--line-2);
  vertical-align: middle;
}
.kal__d.is-today, .kal__c.is-today { background: rgba(217, 164, 65, .22); }
.kal__d.is-today { border-bottom-color: var(--crust-ink); }
.kal__heute {
  display: block; margin-top: .2rem; font-size: 10px; color: var(--crust-ink);
}
.kal__heute[hidden] { display: none; }
.kal__p { text-align: right; padding: .9rem 0 .9rem .5rem; white-space: nowrap; }
.kal__preis { display: block; font-weight: 500; }
.kal__einheit { display: block; font-size: var(--micro); color: var(--muted); font-weight: 400; }

.kal__list { margin-top: clamp(1.75rem, 4vw, 2.5rem); }
.kal__li { padding: 1rem 0; border-bottom: 1px solid var(--line); }
.kal__li.is-today-item { border-left: 0; }
.kal__lit { display: flex; flex-wrap: wrap; gap: .25rem 1rem; justify-content: space-between; margin-top: .35rem; }
.kal__tage { font-size: var(--small); color: var(--crust-ink); }
.kal__fuss { margin-top: 1.75rem; font-size: var(--small); color: var(--muted); max-width: 62ch; }

/* --- Backstube ------------------------------------------------------------- */
.stube__grid { display: grid; gap: clamp(2rem, 4vw, 3.5rem); align-items: start; }
.stube__grid p { margin-top: 1rem; color: var(--muted); max-width: 48ch; }
.stube__fakt {
  margin-top: 1.5rem !important; padding-top: 1rem;
  border-top: 1px solid var(--line-2); color: var(--ink) !important;
}
.stube__fig { margin: 0; }
.stube__fig img { width: 100%; border-radius: var(--r); }
.stube__fig figcaption { margin-top: .7rem; font-size: var(--micro); color: var(--muted); }

/* --- Zeitstrahl mit Scroll-Fortschritt (Signature) ------------------------- */
.zeit { background: var(--rye); color: var(--cream); padding-bottom: var(--sec); }
.zeit__img {
  width: 100%; height: clamp(180px, 24vw, 340px);
  object-fit: cover; object-position: 28% center;
}
.zeit .wrap { padding: var(--sec) var(--gut) 0; }
.tl { position: relative; margin-top: clamp(2.5rem, 5vw, 4rem); padding-left: 2.5rem; }
.tl__rail {
  position: absolute; left: 0; top: .5rem; bottom: .5rem; width: 2px;
  background: rgba(246, 239, 227, .22);
}
.tl__rail span {
  display: block; width: 100%; height: 0; background: var(--wheat);
  transition: height 120ms linear;
}
.tl__i { position: relative; padding-bottom: clamp(2rem, 4vw, 3rem); }
.tl__i::before {
  content: ''; position: absolute; left: -2.5rem; top: .9rem;
  width: 10px; height: 10px; margin-left: -4px; border-radius: 50%;
  background: var(--rye); border: 2px solid rgba(246, 239, 227, .35);
  transition: background var(--dur) var(--ease), border-color var(--dur) var(--ease);
}
.tl__i.is-passed::before { background: var(--wheat); border-color: var(--wheat); }
.tl__y {
  font-family: var(--font-display); font-size: var(--year); line-height: 1;
  color: var(--wheat);
}
.tl__t { margin-top: .6rem; max-width: 52ch; }

/* --- Laeden ---------------------------------------------------------------- */
.filiale { margin-top: clamp(2rem, 4vw, 3rem); border-top: 1px solid var(--line-2); }
.filiale__i {
  display: grid; gap: .25rem 2rem; padding: 1.5rem 0; border-bottom: 1px solid var(--line);
}
.filiale__n { font-family: var(--font-display); font-size: var(--d3); }
.filiale__z { font-size: var(--small); color: var(--muted); max-width: 46ch; }
.filiale__s { font-size: var(--small); font-weight: 500; color: var(--crust-ink); }
.filiale__s.is-open { color: #2d6b3f; }
.laeden__fig { margin: clamp(2.5rem, 5vw, 4rem) 0 0; }
.laeden__fig img { width: 100%; border-radius: var(--r); }
.laeden__fig figcaption { margin-top: .7rem; font-size: var(--micro); color: var(--muted); }

/* --- Vorbestellung ---------------------------------------------------------- */
.best { background: var(--paper); border-block: 1px solid var(--line); padding: var(--sec) var(--gut); }
.best__lead { margin-top: 1rem; color: var(--muted); max-width: var(--measure); }
.form { margin-top: clamp(2rem, 4vw, 2.75rem); max-width: 44rem; }
.row { display: grid; gap: 1.25rem; }
.field { margin-bottom: 1.25rem; }
.field label { display: block; font-size: var(--small); font-weight: 500; margin-bottom: .4rem; }
.field input, .field select {
  width: 100%; min-height: 50px; padding: .7rem .9rem;
  font: inherit; font-size: 1rem; color: var(--ink); background: #fff;
  border: 1px solid var(--line-2); border-radius: var(--r);
}
.field input:hover, .field select:hover { border-color: var(--crust); }
.field.is-bad input { border-color: #8a2c17; background: #fdefe9; }
.err { margin-top: .4rem; font-size: var(--micro); font-weight: 500; color: #8a2c17; }

.korb { border: 0; margin: 0 0 1.5rem; padding: 0; min-width: 0; }
.korb__h {
  font-family: var(--font-display); font-size: var(--d3); padding: 0;
  margin-bottom: 1rem;
}
.pos {
  display: flex; align-items: center; justify-content: space-between; gap: 1rem;
  padding: .7rem 0; border-bottom: 1px solid var(--line);
}
.pos__txt { min-width: 0; }
.pos__n { display: block; font-size: 1rem; font-weight: 500; }
.pos__p { display: block; font-size: var(--micro); color: var(--muted); }
.pos__ctrl { display: flex; align-items: center; gap: .35rem; flex: none; }
.step {
  position: relative; width: 44px; height: 44px; flex: none;
  background: transparent; border: 1px solid var(--line-2); border-radius: var(--r);
  cursor: pointer; transition: border-color var(--dur) var(--ease), background var(--dur) var(--ease);
}
.step:hover { border-color: var(--crust); background: #fff; }
.step::before, .step::after {
  content: ''; position: absolute; left: 50%; top: 50%; background: var(--ink);
  transform: translate(-50%, -50%);
}
.step::before { width: 13px; height: 1.6px; }
.step--plus::after { width: 1.6px; height: 13px; }
.pos__in {
  width: 48px; height: 44px; text-align: center;
  font: inherit; font-variant-numeric: lining-nums tabular-nums;
  color: var(--ink); background: #fff;
  border: 1px solid var(--line-2); border-radius: var(--r);
}
.pos__in.has-menge { border-color: var(--crust); font-weight: 500; }
.korb__summe {
  margin-top: 1rem; font-family: var(--font-display); font-size: 1.25rem;
}
.form__note { margin-top: 1rem; font-size: var(--small); color: var(--muted); }

/* --- Jobs -------------------------------------------------------------------- */
.job { margin-top: clamp(2rem, 4vw, 3rem); border-top: 1px solid var(--line-2); }
.job__i { padding: 1.25rem 0; border-bottom: 1px solid var(--line); }
.job__t { font-family: var(--font-display); font-size: var(--d3); }
.job__d { margin-top: .3rem; color: var(--muted); max-width: 56ch; font-size: var(--small); }
.job__mail { margin-top: 1.75rem; font-size: var(--small); }

/* --- Fuss --------------------------------------------------------------------- */
.foot { background: var(--ink); color: var(--cream); padding: clamp(3rem, 6vw, 4.5rem) var(--gut) 2rem; }
.foot__grid { display: grid; gap: 2rem; font-size: var(--small); }
.foot__mark { font-family: var(--font-display); font-size: 1.7rem; margin-bottom: .3rem; }
.foot__h { font-size: var(--micro); font-weight: 500; color: var(--wheat); margin-bottom: .5rem; font-family: var(--font-text); }
.foot__nav a { display: inline-flex; align-items: center; min-height: 44px; text-decoration: none; }
.foot__note {
  margin-top: clamp(2.5rem, 5vw, 3.5rem); padding-top: 1.25rem;
  border-top: 1px solid var(--line-dark);
  display: flex; flex-wrap: wrap; gap: .75rem 1.5rem; align-items: center; justify-content: space-between;
  font-size: var(--micro);
}
.foot__more {
  background: none; border: 0; padding: .6rem 0; min-height: 44px; cursor: pointer;
  color: var(--wheat); font-size: var(--micro); border-bottom: 1px solid var(--wheat);
}
.about { margin-top: 1.25rem; font-size: var(--micro); max-width: 72ch; }
.about[hidden] { display: none; }
.about p + p { margin-top: .6rem; }

/* --- Toast --------------------------------------------------------------------- */
.toast {
  position: fixed; left: 50%; bottom: 20px; transform: translateX(-50%);
  z-index: 80; max-width: min(92vw, 34rem);
  padding: .9rem 1.2rem; border-radius: var(--r);
  background: var(--ink); color: var(--cream); font-size: var(--small);
  box-shadow: 0 12px 34px rgba(43, 26, 18, .25);
}

/* --- Reveal ---------------------------------------------------------------------- */
[data-reveal] > * {
  opacity: 0; transform: translateY(8px);
  transition: opacity var(--slow) var(--ease), transform var(--slow) var(--ease);
}
[data-reveal] > * + * { transition-delay: 80ms; }
[data-reveal].is-visible > * { opacity: 1; transform: none; }
html:not(.js) [data-reveal] > * { opacity: 1; transform: none; }

/* --- Breakpoints -------------------------------------------------------------------- */
@media (min-width: 620px) {
  .row { grid-template-columns: 1fr 1fr; }
  .filiale__i { grid-template-columns: minmax(0, 1fr) 14rem; align-items: baseline; }
  .filiale__n { grid-column: 1; }
  .filiale__z { grid-column: 1; }
  .filiale__s { grid-column: 2; grid-row: 1 / span 2; text-align: right; }
}

@media (min-width: 780px) {
  /* Ab hier passt die Kreuztabelle; darunter zeigt die Liste dieselben Daten. */
  .kal__scroll { display: block; }
  .kal__list { display: none; }
  .stube__grid { grid-template-columns: 1fr 1fr; }
  .hero__grid { grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr); align-items: end; }
  .foot__grid { grid-template-columns: 1.5fr 1fr 1fr 1fr; }
}

@media (min-width: 1000px) {
  :root { --head-h: 78px; }
  .head__nav { display: block; }
  .head__cta { display: inline-flex; }
  .burger, .menu { display: none; }
  .tl { padding-left: 4rem; }
  .tl__i::before { left: -4rem; }
}

/* --- Bewegung aus ---------------------------------------------------------------------- */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after {
    animation-duration: .001ms !important; transition-duration: .001ms !important;
  }
  [data-reveal] > * { opacity: 1 !important; transform: none !important; }
}
html.reduce [data-reveal] > * { opacity: 1; transform: none; }
