/* ==========================================================================
   GOYER PFINGSTEN — BASE
   Reset, Grundtypografie und generische Elemente. Ausschließlich Werte aus
   tokens.css — keine Farb-/Größen-Literale hier.
   ========================================================================== */

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

html{
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
  scroll-padding-top: var(--header-height);
}
@media (prefers-reduced-motion: reduce){
  html{ scroll-behavior: auto; }
}

body{
  margin: 0;
  background: var(--c-surface-alt);
  color: var(--c-text);
  font-family: var(--font-body);
  font-size: var(--fs-base);
  line-height: var(--lh-body);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

img, svg, video{ display: block; max-width: 100%; height: auto; }

/* Responsivität: lange deutsche Komposita und Adressen dürfen nie den
   Viewport aufspannen. Silbentrennung in Überschriften, Notumbruch im
   Fließtext, Overflow-Netz auf dem Body (clip erzeugt keinen Scrollbalken). */
h1, h2, h3, h4{ overflow-wrap: break-word; }
p, li, a, address, td, th, dt, dd, figcaption, label{ overflow-wrap: break-word; }
/* Silbentrennung nur auf schmalen Viewports als Fallback; auf Tablet und
   Desktop wird ausschließlich an Wortgrenzen umbrochen. */
@media (max-width: 639px){
  h1, h2, h3, h4{ hyphens: auto; }
}
body{ overflow-x: clip; }

h1,h2,h3,h4,h5,h6{
  margin: 0;
  font-family: var(--font-display);
  font-weight: var(--fw-bold);
  line-height: var(--lh-heading);
  letter-spacing: var(--ls-tight);
  color: var(--c-brand-dark);
}
h1{ font-size: var(--fs-4xl); line-height: var(--lh-tight); }
h2{ font-size: var(--fs-3xl); }
h3{ font-size: var(--fs-2xl); }
h4{ font-size: var(--fs-xl); }

p{ margin: 0; }
p + p{ margin-top: var(--space-sm); }

blockquote{ margin: 0; }

a{ color: inherit; text-decoration: none; }

ul, ol{ margin: 0; padding: 0; list-style: none; }

/* Überschrift → Subline: Hero, Section-Intros (eyebrow+h2+section__lede)
   und der Kanzlei-Intro (h2 + Absatz ohne eigene Klasse). Bewusst gescopt
   statt global "h2 + p", damit z.B. Rechtstexte (.legal h2) ihren eigenen,
   engeren Rhythmus behalten. */
.hero__content h1 + p,
.section__head h2 + p,
.grid--kanzlei h2 + p,
.grid--kanzlei h1 + p,
h1 + .section__lede,
h2 + .section__lede{
  margin-top: var(--space-heading-subline);
}

/* Wenn eine Seite keinen eigenen Intro-Block hat, übernimmt die erste
   Section die H1 (Barrierefreiheit/SEO) — optisch soll sie sich dann in
   den H2-Rhythmus der Sektion einfügen, nicht im Hero-Maßstab schreien. */
.grid--kanzlei h1{ font-size: var(--fs-3xl); line-height: var(--lh-heading); }

/* Subline → weiterer Content: das Element direkt nach dem Subline-Absatz
   (Zitat in "Kanzlei", Kontakt-Infoliste in "Kontakt", ...). */
.grid--kanzlei h2 + p + *{
  margin-top: var(--space-subline-content);
}

button{
  font-family: inherit;
  font-size: inherit;
  color: inherit;
  background: none;
  border: none;
  padding: 0;
  cursor: pointer;
}

input, textarea, select{
  font-family: inherit;
  font-size: inherit;
  color: inherit;
}

::selection{
  background: var(--c-accent);
  color: var(--c-on-brand);
}

:focus-visible{
  outline: 2px solid var(--c-accent);
  outline-offset: 3px;
  border-radius: var(--radius-s);
}

/* ---------- Layout-Hilfsklassen ---------- */
.container{
  width: 100%;
  max-width: var(--container-max);
  margin-inline: auto;
  padding-inline: var(--container-gutter);
}
.container--narrow{ max-width: var(--container-max-narrow); }

.u-uppercase{
  text-transform: uppercase;
  letter-spacing: var(--ls-uppercase);
}

.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;
}

/* Body-Scroll-Lock bei geöffnetem Mobilmenü */
body.nav-open{ overflow: hidden; }

/* Eyebrow-Label, konsistent mit dem Styleguide */
.eyebrow{
  display: inline-flex;
  align-items: center;
  gap: var(--space-2xs);
  margin: 0 0 var(--space-sm) 0;
  font-family: var(--font-body);
  font-size: var(--fs-xs);
  font-weight: var(--fw-semibold);
  letter-spacing: var(--ls-uppercase);
  text-transform: uppercase;
  color: var(--c-brand-mid);
}
.eyebrow::before{
  content: "";
  width: 18px;
  height: 2px;
  background: var(--c-accent);
  display: inline-block;
}
.eyebrow--on-dark{ color: var(--color-teal-400); }
.eyebrow--on-dark::before{ background: var(--color-teal-400); }

/* Scroll-Reveal-Animation (Fade-in + kleine Bewegung von unten nach oben),
   siehe main.js. --reveal-delay wird optional pro Element/Kind gesetzt,
   um innerhalb von Grids/Listen einen sanften Kaskaden-Effekt zu erzeugen. */
[data-reveal]{
  opacity: 0;
  transform: translateY(var(--reveal-distance));
  transition: opacity var(--dur-reveal) var(--ease-reveal),
              transform var(--dur-reveal) var(--ease-reveal);
  transition-delay: var(--reveal-delay, 0ms);
  will-change: opacity, transform;
}
[data-reveal].is-visible{
  opacity: 1;
  transform: translateY(0);
}

/* Sanfte Kaskade für Geschwister-Elemente in Grids, Footer-Spalten etc. */
.grid > [data-reveal]:nth-child(2),
.site-footer__grid > [data-reveal]:nth-child(2){ --reveal-delay: 90ms; }
.grid > [data-reveal]:nth-child(3),
.site-footer__grid > [data-reveal]:nth-child(3){ --reveal-delay: 180ms; }
.grid > [data-reveal]:nth-child(4),
.site-footer__grid > [data-reveal]:nth-child(4){ --reveal-delay: 270ms; }

@media (prefers-reduced-motion: reduce){
  [data-reveal]{ opacity: 1; transform: none; transition: none; }
}

/* Schmale Viewports: Headline-Größen deckeln, damit lange deutsche
   Komposita (Datenschutzhinweise, Immobilienbesteuerung) ohne
   Silbentrennung in den Container passen. */
@media (max-width: 480px){
  :root{
    --fs-hero: clamp(2.25rem, 9.6vw, 3rem);
    --fs-4xl:  clamp(1.9rem, 8vw, 2.6rem);
    --fs-3xl:  clamp(1.7rem, 7vw, 2.2rem);
  }
}
