/* ==========================================================================
   Base: Reset, Typografie, Layout, Flächen
   ========================================================================== */

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

html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
  scroll-behavior: smooth;
  scroll-padding-top: calc(var(--header-h) + 1rem);
  background: var(--night);
  color-scheme: dark;
  hanging-punctuation: first;
}

body {
  margin: 0;
  min-height: 100dvh;
  font-family: var(--font-body);
  font-size: var(--fs-body);
  line-height: var(--lh-body);
  color: var(--mist);
  background: var(--night);
  font-kerning: normal;
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: clip;
}

img, picture, video, svg { display: block; max-width: 100%; }
img, video { height: auto; }
picture { display: block; }
input, button, textarea, select { font: inherit; color: inherit; }
button { cursor: pointer; }
a, button, input, label, select, textarea, summary { touch-action: manipulation; -webkit-tap-highlight-color: transparent; }
p, h1, h2, h3, h4, figure, blockquote, dl, dd { margin: 0; }
:where(ul[role="list"], ol[role="list"]) { list-style: none; margin: 0; padding: 0; }
address { font-style: normal; }
[hidden] { display: none !important; }
:target { scroll-margin-top: calc(var(--header-h) + 1rem); }

/* --- Browser-Oberflächen ------------------------------------------------- */
::selection { background: var(--signal); color: var(--on-signal); }
:focus { outline: none; }
:focus-visible {
  outline: 2px solid var(--signal-glow);
  outline-offset: 3px;
  border-radius: var(--r-s);
}
html { scrollbar-color: var(--graphite) var(--night); scrollbar-width: thin; }
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-track { background: var(--night); }
::-webkit-scrollbar-thumb { background: var(--graphite); border-radius: 10px; border: 2px solid var(--night); }
::-webkit-scrollbar-thumb:hover { background: #3a414b; }
input, textarea { caret-color: var(--signal-ink); }

/* --- Typografie ---------------------------------------------------------- */
.display, h1, h2, h3, .h1, .h2, .h3 {
  font-family: var(--font-display);
  font-weight: 700;
  text-transform: uppercase;
  line-height: var(--lh-tight);
  letter-spacing: -.005em;
  color: var(--white);
  text-wrap: balance;
  font-synthesis: none;
}
.display { font-size: var(--fs-display); line-height: .9; letter-spacing: -.012em; }
h1, .h1 { font-size: var(--fs-h1); }
h2, .h2 { font-size: var(--fs-h2); }
h3, .h3 { font-size: var(--fs-h3); line-height: 1; letter-spacing: 0; }
h4, .h4 {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: var(--fs-h4);
  line-height: var(--lh-snug);
  letter-spacing: .01em;
  color: var(--white);
  text-transform: uppercase;
}

p { text-wrap: pretty; }
.lead { font-size: var(--fs-lead); line-height: 1.5; color: var(--mist); max-width: 52ch; }
.small { font-size: var(--fs-small); }
.muted { color: var(--fog); }
.prose { max-width: var(--measure); }
.prose > * + * { margin-top: 1em; }
.prose h2 { margin-top: 1.6em; font-size: var(--fs-h3); }
.prose h3 { margin-top: 1.4em; font-size: var(--fs-h4); }
.prose ul { padding-left: 1.2em; }
.prose li + li { margin-top: .35em; }
.prose li::marker { color: var(--signal-glow); }
.num { font-variant-numeric: tabular-nums lining-nums; }
strong { font-weight: 600; color: inherit; }

a { color: inherit; text-decoration-thickness: 1px; text-underline-offset: .22em; }
.prose a, .link {
  color: var(--white);
  text-decoration: underline;
  text-decoration-color: var(--signal-glow);
  transition: color var(--dur-fast) var(--ease-out), text-decoration-color var(--dur-fast);
}
.prose a:hover, .link:hover { color: var(--signal-glow); }

/* --- Layout -------------------------------------------------------------- */
.container {
  width: 100%;
  max-width: calc(var(--container) + var(--gutter) * 2);
  margin-inline: auto;
  padding-inline: var(--gutter);
}
.container--narrow { max-width: calc(880px + var(--gutter) * 2); }

.section { position: relative; padding-block: var(--section); }
.section--tight { padding-block: var(--space-2xl); }
.section + .section--continue { padding-top: 0; }
.stack > * + * { margin-top: var(--stack, var(--space-m)); }

/* --- Flächen (Rhythmus dunkel → hell → bildlastig dunkel → hell → Rot (CTA) → dunkel) */
.surface-night { background: var(--night); color: var(--mist); }
.surface-anthracite { background: var(--anthracite); color: var(--mist); }
.surface-paper, .surface-deep {
  color-scheme: light;
  color: var(--ink-soft);
  --white: var(--ink);
  --mist: var(--ink-soft);
  --fog: var(--ink-soft);
  --graphite: var(--rule);
}
.surface-paper { background: var(--paper); }
.surface-deep { background: var(--paper-deep); }
.surface-paper :focus-visible, .surface-deep :focus-visible { outline-color: var(--ink); }
.surface-signal :focus-visible { outline-color: var(--on-signal); }
.surface-paper ::selection, .surface-deep ::selection { background: var(--ink); color: var(--paper); }
.surface-paper .prose a, .surface-deep .prose a, .surface-paper .link, .surface-deep .link { text-decoration-color: var(--signal-ink); }
.surface-paper .prose a:hover, .surface-deep .prose a:hover, .surface-paper .link:hover, .surface-deep .link:hover { color: var(--signal-ink); }
.surface-paper .prose li::marker, .surface-deep .prose li::marker { color: var(--signal-ink); }
.surface-signal {
  color-scheme: light;
  background: var(--signal);
  color: var(--on-signal);
  --white: var(--on-signal);
  --mist: var(--on-signal);
  --fog: var(--on-signal);
}

/* --- Hilfsklassen -------------------------------------------------------- */
.visually-hidden {
  position: absolute !important;
  width: 1px; height: 1px;
  margin: -1px; padding: 0;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}
.skip-link {
  position: fixed;
  top: .75rem; left: .75rem;
  z-index: var(--z-skip);
  padding: .8rem 1.1rem;
  background: var(--signal);
  color: var(--on-signal);
  font-weight: 600;
  text-decoration: none;
  border-radius: var(--r-m);
  transform: translateY(-160%);
  transition: transform var(--dur) var(--ease-out);
}
.skip-link:focus-visible { transform: none; outline-color: var(--white); }

/* Platzhalter sichtbar markieren (SHOW_PLACEHOLDERS in includes/config.php) */
.ph {
  display: inline-block;
  padding: 0 .35em;
  border: 1px dashed currentColor;
  border-radius: var(--r-s);
  font-family: var(--font-body);
  font-size: .82em;
  font-weight: 500;
  letter-spacing: 0;
  text-transform: none;
  line-height: 1.5;
  opacity: .85;
  overflow-wrap: anywhere;
}
.img-missing {
  display: grid;
  place-items: center;
  min-height: 12rem;
  padding: 1rem;
  background: repeating-linear-gradient(45deg, var(--anthracite) 0 12px, var(--graphite-soft) 12px 24px);
  color: var(--fog);
  font-size: var(--fs-xs);
  text-align: center;
}

.icon { width: 1.25em; height: 1.25em; flex: none; stroke-width: 1.75; }
.icon--sm { width: 1.05em; height: 1.05em; }
.icon--lg { width: 1.75rem; height: 1.75rem; stroke-width: 1.5; }

/* Einheitlicher Grade für alle Fotos */
.photo img, img.photo { filter: var(--grade); }

/* Bilder in Boxen mit fester Höhe/aspect-ratio: <picture> muss die Höhe weitergeben */
.photo > picture { width: 100%; height: 100%; }
.masonry .photo > picture { height: auto; }

/* Lange deutsche Komposita in Headlines sauber trennen */
h1, h2, h3, h4, .display { hyphens: auto; -webkit-hyphens: auto; hyphenate-limit-chars: 10 4 4; }
.hero__title, .cta__title, .brand__name { hyphens: manual; }
.nocase { text-transform: none; }
