/* Gemeinsame Grundlage für alle Bereiche. Farben und Schriften kommen aus den Bereichs-Stylesheets
   (grill.css, deko.css, entry.css, admin.css) über die Variablen --bg, --fg, --accent … */

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; scroll-padding-top: 7rem; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--fg);
  font-family: var(--font-body);
  font-size: 1.0625rem;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
img, svg { max-width: 100%; height: auto; display: block; }
a { color: inherit; text-underline-offset: .18em; text-decoration-thickness: 1px; }
h1, h2, h3, h4 { font-family: var(--font-display); font-weight: 400; line-height: 1.12; margin: 0; text-wrap: balance; }
p, ul, ol, figure, blockquote { margin: 0; }
ul[class], ol[class] { list-style: none; padding: 0; }
button { font: inherit; color: inherit; }
[hidden] { display: none !important; }

.sr { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.skip { position: absolute; left: -999px; top: 0; z-index: 200; background: var(--fg); color: var(--bg); padding: .6rem 1rem; }
.skip:focus { left: 1rem; top: 1rem; }
/* Nur für Screenreader und Suchmaschinen (z. B. Zwischenüberschrift über der Produktliste) */
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
:focus-visible { outline: 2px solid var(--focus); outline-offset: 3px; border-radius: 4px; }

.wrap {
  width: 100%;
  max-width: 1200px;
  margin-inline: auto;
  padding-left: max(20px, env(safe-area-inset-left, 0px));
  padding-right: max(20px, env(safe-area-inset-right, 0px));
}
.wrap-narrow { max-width: 760px; }
.stack > * + * { margin-top: 1rem; }
.prose > * + * { margin-top: 1em; }
.prose { max-width: 66ch; }

/* Formatierter Text aus dem Editor im Admin (app/rich.php) */
ul.rt-list { list-style: disc; padding-left: 1.3em; }
ol.rt-list--num { list-style: decimal; }
.rt-list > li + li { margin-top: .3em; }
.rt-list > li::marker { color: var(--accent); }
h3.rt-h { font-size: 1.3em; margin-top: 1.5em; }
h3.rt-h:first-child { margin-top: 0; }
/* Formate aus der Formatleiste im Admin (app/rich.php): Ausrichtung, Schriftart, Größe; Farben stehen direkt am Text */
.rt-a-center { text-align: center; }
.rt-a-right { text-align: right; }
.rt-a-justify { text-align: justify; hyphens: auto; }
.rt-list > li.rt-a-center, .rt-list > li.rt-a-right { list-style-position: inside; }
.rt-f-display { font-family: var(--font-display); }
.rt-f-elegant { font-family: "Marcellus", Georgia, serif; }
.rt-f-script { font-family: "Cormorant Garamond", Georgia, serif; font-style: italic; font-weight: 500; font-size-adjust: .46; }
.rt-s-s { font-size: .85em; }
.rt-s-l { font-size: 1.2em; }
.rt-s-xl { font-size: 1.45em; line-height: 1.3; }
.rt-s-xxl { font-size: 1.8em; line-height: 1.2; }

/* Buttons */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: .55em;
  font: 500 .92rem/1.1 var(--font-body); letter-spacing: .06em; text-transform: uppercase;
  padding: 1em 1.6em; border-radius: 999px; border: 1.5px solid transparent;
  text-decoration: none; cursor: pointer; white-space: nowrap;
  transition: background-color .2s, color .2s, border-color .2s, transform .15s;
}
.btn:active { transform: translateY(1px); }
.btn-primary { background: var(--accent); color: var(--accent-fg); }
.btn-primary:hover { background: var(--accent-hover); }
.btn-ghost { background: transparent; border-color: currentColor; color: var(--fg); }
.btn-ghost:hover { background: var(--fg); color: var(--bg); border-color: var(--fg); }
.btn-block { width: 100%; }
.btn[disabled] { opacity: .5; cursor: not-allowed; }
.btn-row { display: flex; flex-wrap: wrap; gap: .75rem; }

/* Formulare */
.form { display: grid; gap: 1.1rem; }
.form-grid { display: grid; gap: 1.1rem; grid-template-columns: repeat(auto-fit, minmax(min(100%, 14rem), 1fr)); }
.field { display: grid; gap: .4rem; min-width: 0; }
.field > label, .label-text { font-size: .86rem; font-weight: 500; letter-spacing: .02em; }
.hint { font-size: .82rem; color: var(--muted); }
input[type=text], input[type=email], input[type=tel], input[type=password], input[type=number], input[type=date], input[type=url], input[type=search], select, textarea {
  font: inherit; font-size: 1rem; color: var(--fg); background: var(--field-bg);
  border: 1px solid var(--line); border-radius: 10px; padding: .72rem .9rem; width: 100%; min-width: 0;
  transition: border-color .15s, box-shadow .15s;
}
textarea { min-height: 8rem; resize: vertical; line-height: 1.55; }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--focus); box-shadow: 0 0 0 3px color-mix(in srgb, var(--focus) 25%, transparent); }
.check { display: flex; gap: .7rem; align-items: flex-start; font-size: .92rem; line-height: 1.5; }
.check input { width: 1.15rem; height: 1.15rem; margin-top: .2rem; accent-color: var(--accent); flex: none; }
.req { color: var(--accent); }
.hp { position: absolute; left: -5000px; }

/* Hinweise */
.flash { padding: .9rem 1.1rem; border-radius: 10px; margin-block: 1rem; font-size: .95rem; border: 1px solid; }
.flash-ok { background: var(--ok-bg); border-color: var(--ok-line); color: var(--ok-fg); }
.flash-err { background: var(--err-bg); border-color: var(--err-line); color: var(--err-fg); }
.flash-info { background: var(--info-bg); border-color: var(--line); color: var(--fg); }

/* Toast nach „In den Warenkorb“ */
.toast {
  position: fixed; z-index: 150; left: 50%; bottom: calc(1.2rem + env(safe-area-inset-bottom, 0px));
  transform: translate(-50%, 1rem); opacity: 0; pointer-events: none;
  background: var(--fg); color: var(--bg); padding: .85rem 1.2rem; border-radius: 999px;
  font-size: .92rem; display: flex; gap: 1rem; align-items: center; box-shadow: 0 10px 30px rgba(0,0,0,.18);
  transition: opacity .25s, transform .25s; max-width: calc(100vw - 32px);
}
.toast.is-on { opacity: 1; transform: translate(-50%, 0); pointer-events: auto; }
.toast a { color: inherit; font-weight: 600; }

/* Burger-Icon */
.burger, .burger::before, .burger::after { display: block; width: 22px; height: 1.5px; background: currentColor; transition: transform .2s, opacity .2s; }
.burger { position: relative; }
.burger::before, .burger::after { content: ""; position: absolute; left: 0; }
.burger::before { top: -7px; }
.burger::after { top: 7px; }
[aria-expanded=true] .burger { background: transparent; }
[aria-expanded=true] .burger::before { transform: translateY(7px) rotate(45deg); }
[aria-expanded=true] .burger::after { transform: translateY(-7px) rotate(-45deg); }

/* Großansicht der Impressionen (assets/js/site.js → openViewer) */
html.gal-open { overflow: hidden; }
html.gal-open body { padding-right: var(--sbw, 0px); }
.gal {
  --fade: 1;
  position: fixed; inset: 0; z-index: 200; display: grid; grid-template-rows: auto minmax(0, 1fr) auto auto;
  background: rgba(16, 13, 11, calc(.97 * var(--fade))); color: #f4ebe1; -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px);
  padding: env(safe-area-inset-top, 0px) env(safe-area-inset-right, 0px) env(safe-area-inset-bottom, 0px) env(safe-area-inset-left, 0px);
  opacity: 0; transition: opacity .22s ease; font-family: var(--font-body, "Jost", system-ui, sans-serif);
}
.gal.is-in { opacity: 1; }
.gal__top { display: flex; align-items: center; justify-content: space-between; gap: 1rem; padding: .6rem clamp(.6rem, 2vw, 1.2rem); }
.gal__count { font-size: .9rem; letter-spacing: .12em; color: #c2b3a3; font-variant-numeric: tabular-nums; padding-left: .4rem; }
.gal__tools { display: flex; gap: .4rem; }
.gal__btn, .gal__nav {
  display: grid; place-items: center; width: 46px; height: 46px; border-radius: 50%; border: 0; cursor: pointer;
  background: rgba(244,235,225,.1); color: #f4ebe1; transition: background-color .15s, transform .15s;
}
.gal__btn:hover, .gal__nav:hover { background: rgba(244,235,225,.22); }
.gal__btn[aria-pressed=true] { background: var(--accent, #c8703e); color: #1d1916; }
.gal button:focus-visible { outline: 2px solid var(--focus, #e0a070); outline-offset: 2px; }
.gal__stage { position: relative; min-height: 0; padding-inline: clamp(0px, 6vw, 5.5rem); touch-action: none; user-select: none; -webkit-user-select: none; }
.gal__viewport { height: 100%; overflow: hidden; }
.gal__track { display: flex; height: 100%; transition: transform .45s cubic-bezier(.2,.75,.2,1); will-change: transform; }
.gal__track.is-fade { animation: gal-fade .35s ease; }
@keyframes gal-fade { from { opacity: .15; } }
.gal__slide { flex: 0 0 100%; min-width: 0; height: 100%; margin: 0; display: grid; place-items: center; padding: .2rem clamp(.4rem, 1.5vw, 1rem); container-type: size; }
.gal__slide img { display: block; max-width: 100%; max-height: 100%; width: auto; height: auto; border-radius: 4px; box-shadow: 0 30px 80px -30px rgba(0,0,0,.8); background: rgba(244,235,225,.04); }
@supports (width: 1cqh) {
  /* Platz fürs Bild schon vor dem Laden reservieren */
  .gal__slide img { width: min(100cqw, 100cqh * var(--r, 1.333)); aspect-ratio: var(--r, 1.333); height: auto; max-height: 100cqh; }
}
.gal__nav { position: absolute; top: 50%; translate: 0 -50%; width: 52px; height: 52px; }
.gal__nav--prev { left: clamp(.4rem, 1.5vw, 1.4rem); }
.gal__nav--next { right: clamp(.4rem, 1.5vw, 1.4rem); }
.gal__nav:active { transform: scale(.94); }
.gal__cap { min-height: 1.6em; margin: .7rem auto 0; max-width: 60ch; padding-inline: 1rem; text-align: center; font-size: 1rem; line-height: 1.5; color: #f4ebe1; }
.gal__cap:empty { visibility: hidden; }
.gal__thumbs {
  display: flex; gap: 6px; overflow-x: auto; overscroll-behavior: contain; scrollbar-width: thin; scrollbar-color: rgba(244,235,225,.25) transparent;
  justify-content: safe center; padding: .8rem clamp(.6rem, 2vw, 1.2rem) 1rem;
}
.gal__thumb { flex: none; width: 72px; height: 54px; padding: 0; border: 0; border-radius: 4px; overflow: hidden; cursor: pointer; background: #2e2825; opacity: .5; outline-offset: 2px; transition: opacity .2s; }
.gal__thumb img { width: 100%; height: 100%; object-fit: cover; }
.gal__thumb:hover { opacity: .85; }
.gal__thumb[aria-current=true] { opacity: 1; outline: 2px solid var(--accent, #c8703e); }
@media (max-width: 700px) {
  .gal__stage { padding-inline: 0; }
  .gal__nav { width: 42px; height: 42px; background: rgba(16,13,11,.55); }
  .gal__thumb { width: 56px; height: 44px; }
}
@media (pointer: coarse) and (max-width: 700px) { .gal__nav { display: none; } }

/* Impressionen (app/gallery.php) auf Grill- und Deko-Seiten: Aufbau hier, Farben und Schrift je Bereich über die --gal-*-Werte
   in grill.css und deko.css.
   Bilderseite: Reihen gleicher Höhe, jedes Foto in seinem Seitenverhältnis (kein Zuschnitt). Breite je Bild als Anteil
   seiner Reihe aus app/gallery.php (--dw Computer, --mw Handy; --dn/--mn = Lücken in der Reihe), Umbruch per .g-br. */
.g-rows { --gap: clamp(.5rem, 1vw, .8rem); display: flex; flex-wrap: wrap; align-items: flex-start; column-gap: var(--gap); }
.g-br { flex-basis: 100%; height: 0; }
.g-br--m:not(.g-br--d) { display: none; }
.g-tile {
  position: relative; display: block; width: calc((100% - var(--dn, 0) * var(--gap)) * var(--dw, .25) * .999); aspect-ratio: var(--r, 1.333);
  margin-bottom: var(--gap); color: var(--fg); text-decoration: none; cursor: zoom-in; transition: filter .35s;
}
@media (max-width: 640px) {
  .g-tile { width: calc((100% - var(--mn, 0) * var(--gap)) * var(--mw, .5) * .999); }
  .g-br--d:not(.g-br--m) { display: none; }
  .g-br.g-br--m { display: block; }
}
/* Bild und Beschriftung liegen in .g-tile__in: Das wächst beim Drüberfahren, die Kachel selbst (Trefferfläche) bleibt,
   so lässt sich direkt zum Nachbarbild weiterfahren. Faktor und Ursprung je Bild aus app/gallery.php (--z, --ox, --oy). */
.g-tile__in {
  position: absolute; inset: 0; overflow: hidden; border-radius: var(--gal-radius); background: var(--gal-tile-bg); pointer-events: none;
  transform-origin: var(--ox, 50%) var(--oy, 50%); transition: transform .4s cubic-bezier(.2,.7,.2,1), box-shadow .4s;
}
.g-tile img { width: 100%; height: 100%; object-fit: cover; }
.g-tile__cap {
  position: absolute; inset: auto 0 0; padding: 2.6rem 1rem .85rem; background: var(--gal-cap-bg);
  font-family: var(--font-display); font-weight: 500; font-size: clamp(.95rem, 1.3vw, 1.15rem); line-height: calc(1.2 * var(--gal-lh, 1)); letter-spacing: var(--gal-ls, 0em);
  opacity: 0; transform: translateY(.6rem); transition: opacity .3s, transform .3s;
}
.g-tile__zoom { position: absolute; top: .7rem; right: .7rem; display: grid; place-items: center; width: 36px; height: 36px; border-radius: 50%; background: var(--gal-zoom-bg); color: var(--fg); opacity: 0; transform-origin: 100% 0; transition: opacity .25s; }
.g-tile:focus-visible { outline: 2px solid var(--focus); outline-offset: 3px; }
.g-tile:focus-visible .g-tile__cap { opacity: 1; transform: none; }
@media (hover: hover) and (min-width: 641px) {
  /* Doppelte Größe beim Drüberfahren; Beschriftung und Lupe bleiben dabei normal groß */
  .g-tile:hover { z-index: 5; }
  .g-tile:hover .g-tile__in { transform: scale(var(--z, 2)); transition-delay: .08s; box-shadow: var(--gal-lift); }
  .g-tile:hover .g-tile__cap { opacity: 1; transform: none; font-size: calc(1.15rem / var(--z, 2)); padding: calc(2.4rem / var(--z, 2)) calc(1rem / var(--z, 2)) calc(.8rem / var(--z, 2)); }
  .g-tile:hover .g-tile__zoom { opacity: 1; transform: scale(calc(1 / var(--z, 2))); }
  /* Scheinwerfer: die anderen Bilder treten zurück */
  .g-rows:has(.g-tile:hover) .g-tile:not(:hover) { filter: var(--gal-dim); }
}

/* Grill- und Deko-Seite: Fotoabzüge, leicht gekippt und überlappend, auf hellem Papier mit Rand; Bildunterschrift auf dem Rand.
   Breite (--dw/--mw) und Lage aus app/gallery.php; die Überlappung kommt über den negativen linken Rand. */
.g-prints { display: flex; flex-wrap: wrap; justify-content: center; align-items: center; padding-block: 1.2rem 1.6rem; }
.g-print {
  position: relative; display: block; width: calc(var(--dw, .25) * 100% * .999); margin-left: calc(var(--dl, 1) * -3.5%);
  color: var(--gal-ink); text-decoration: none; cursor: zoom-in;
}
.g-print__paper {
  display: block; padding: 3.5% 3.5% 0; background: var(--gal-paper); border-radius: 2px;
  box-shadow: var(--gal-print-shadow);
  transform: translateY(var(--dy, 0)) rotate(var(--rot, 0deg)); transform-origin: var(--ox, 50%) 35%;
  transition: transform .45s cubic-bezier(.2,.7,.2,1), box-shadow .45s;
}
.g-print__img { display: block; aspect-ratio: var(--r, 1.333); overflow: hidden; background: var(--gal-img-bg); }
.g-print__img img { width: 100%; height: 100%; object-fit: cover; }
.g-print__cap {
  display: block; min-height: 2.6em; padding: .7em .2em .75em; font-family: var(--gal-print-font); font-style: var(--gal-print-style); font-size: var(--gal-print-size); line-height: 1.25; text-align: center;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis; letter-spacing: .01em;
}
.g-print:focus-visible { outline: none; }
.g-print:focus-visible .g-print__paper { outline: 2px solid var(--focus); outline-offset: 4px; }
.g-prints__more { display: flex; justify-content: center; margin-top: clamp(1.2rem, 3vw, 2rem); }
@media (hover: hover) and (min-width: 641px) {
  /* Drüberfahren: der Abzug richtet sich auf, kommt nach vorne und wird knapp doppelt so groß (nicht breiter als der Bereich) */
  .g-print:hover { z-index: 5; }
  .g-print:hover .g-print__paper { transform: translateY(0) rotate(0deg) scale(var(--z, 2)); transition-delay: .06s; box-shadow: var(--gal-print-lift); }
  .g-prints:has(.g-print:hover) .g-print:not(:hover) .g-print__paper { filter: var(--gal-print-dim); }
}
.g-print__paper { transition: transform .45s cubic-bezier(.2,.7,.2,1), box-shadow .45s, filter .35s; }
@media (max-width: 640px) {
  .g-prints { padding-block: .6rem 1rem; }
  .g-print { width: calc(var(--mw, .5) * 100% * .999); margin-left: calc(var(--ml, 1) * -5%); margin-top: var(--mt, 0); }
  .g-print__paper { padding: 4% 4% 0; }
  .g-print__cap { min-height: 2.3em; padding-block: .55em .6em; font-size: var(--gal-print-size-m); }
}
@media (prefers-reduced-motion: reduce) { .g-print__paper { transition: none; } }

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

/* Häufige Fragen (app/faq.php): aufklappbar mit <details>, Farben aus dem jeweiligen Bereich */
.faq-list { border-top: 1px solid var(--line); }
.faq { border-bottom: 1px solid var(--line); }
.faq > summary { list-style: none; display: flex; align-items: center; justify-content: space-between; gap: 1.2rem; padding: 1.15rem 0; cursor: pointer; }
.faq > summary::-webkit-details-marker { display: none; }
.faq > summary:focus-visible { outline-offset: 2px; }
.faq__q { font-family: var(--font-body); font-size: 1.08rem; font-weight: 500; line-height: 1.4; letter-spacing: 0; text-wrap: pretty; transition: color .15s; }
.faq__icon { flex: none; position: relative; width: 2rem; height: 2rem; border-radius: 50%; border: 1px solid var(--line); transition: background .2s, border-color .2s, color .2s; }
.faq__icon::before, .faq__icon::after { content: ""; position: absolute; left: 50%; top: 50%; width: .72rem; height: 1.5px; border-radius: 1px; background: currentColor; transform: translate(-50%, -50%); }
.faq__icon::after { transform: translate(-50%, -50%) rotate(90deg); transition: transform .25s; }
.faq[open] .faq__icon::after { transform: translate(-50%, -50%) rotate(0deg); }
.faq__a { display: grid; gap: .7rem; max-width: 68ch; padding: 0 3.2rem 1.4rem 0; color: var(--muted); }
@media (max-width: 600px) { .faq__a { padding-right: 0; } .faq__q { font-size: 1.02rem; } }
