/* ==========================================================================
   juliusvandelaar.com · basis.css
   1 Schriften  2 Tokens  3 Farbthemen  4 Reset  5 Typo  6 Raster  7 Bausteine
   8 Leiste und Menü  9 Weniger Bewegung
   Sektionen stehen in sektionen.css und nutzen nur die Tokens von hier.
   ========================================================================== */

/* ---------- 1 Schriften (lokal, alle OFL) ---------- */
@font-face {
  font-family: "Newsreader";
  src: url("../fonts/newsreader-400-normal.woff2") format("woff2");
  font-weight: 400; font-style: normal; font-display: swap;
}
@font-face {
  font-family: "Newsreader";
  src: url("../fonts/newsreader-400-kursiv.woff2") format("woff2");
  font-weight: 400; font-style: italic; font-display: swap;
}
@font-face {
  font-family: "Inter Tight";
  src: url("../fonts/inter-tight-400-600.woff2") format("woff2");
  font-weight: 400 600; font-style: normal; font-display: swap;
}

/* ---------- 2 Tokens ---------- */
:root {
  /* Markenfarben */
  --navy: #0E1726;            /* Grundfläche dunkel */
  --navy-flaeche: #16233A;    /* Karten auf Navy */
  --navy-linie: #23324A;
  --navy-linie-stark: #34465F;
  --creme: #F2EEE8;           /* Text auf Navy */
  --koralle: #FF7A5C;         /* Akzent, nur auf Navy oder als Fläche */
  --koralle-tief: #B8432A;    /* Akzent als Text auf Weiß */
  --hellblau: #9CC8E8;        /* Labels auf Navy */
  --weiss: #FFFFFF;
  --sand: #F5F2EC;            /* Flächen auf Weiß */

  /* Schrift */
  --serif: "Newsreader", "Iowan Old Style", Georgia, "Times New Roman", serif;
  --sans: "Inter Tight", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;

  --fs-display: clamp(2.75rem, 1.6rem + 5.2vw, 6rem);      /* H1: 46 px am Handy, 96 px am Desktop */
  --fs-h2: clamp(2rem, 1.5rem + 2.2vw, 3.375rem);          /* 33 bis 54 px */
  --fs-h3: clamp(1.5rem, 1.3rem + 0.9vw, 2.125rem);        /* 24 bis 34 px */
  --fs-zahl: clamp(2rem, 1.6rem + 1.4vw, 2.5rem);          /* große Serif-Angaben wie „2008 · 2012“ */
  --fs-lead: clamp(1.125rem, 1.05rem + 0.35vw, 1.3125rem); /* 18 bis 21 px */
  --fs-text: 1.0625rem;                                    /* 17 px */
  --fs-klein: 0.9375rem;                                   /* 15 px */
  --fs-label: 0.8125rem;                                   /* 13 px */

  /* Abstände */
  --ab-1: 0.5rem;
  --ab-2: 1rem;
  --ab-3: 1.5rem;
  --ab-4: 2.5rem;
  --ab-5: 4rem;
  --ab-sektion: clamp(4.5rem, 3rem + 6vw, 7.5rem);

  /* Raster */
  --breite: 75rem;                                 /* Inhaltsbreite 1200 px */
  --rand: clamp(1.25rem, 0.5rem + 3.2vw, 3rem);    /* Seitenrand */
  --luecke: clamp(1rem, 0.6rem + 1.4vw, 2rem);     /* Spaltenabstand */
  --sp: 4;                                         /* Spalten: 4 am Handy, 12 ab 768 px */
  --kopf: 4rem;                                    /* Höhe der Kopfzeile */

  --rund: 999px;      /* Pill-Buttons */
  --radius: 6px;      /* Bilder und Karten */
  --dauer: 180ms;
}

/* ---------- 3 Farbthemen: data-thema an jeder Sektion ---------- */
:root,
[data-thema="dunkel"] {
  --bg: var(--navy);
  --fg: var(--creme);
  --fg-leise: #C9D2DD;
  --fg-stumm: #8796AA;
  --label: var(--hellblau);
  --akzent: var(--koralle);
  --linie: var(--navy-linie);
  --linie-stark: var(--navy-linie-stark);
  --flaeche: var(--navy-flaeche);
  --knopf-rand: #4A5B72;
  --fokus: var(--hellblau);
}
[data-thema="hell"] {
  --bg: var(--weiss);
  --fg: var(--navy);
  --fg-leise: #3B4758;
  --fg-stumm: #677283;
  --label: #5B6779;
  --akzent: var(--koralle-tief);
  --linie: #E4DFD6;
  --linie-stark: #C9C2B6;
  --flaeche: var(--sand);
  --knopf-rand: #A9B1BD;
  --fokus: var(--navy);
}
[data-thema="koralle"] {
  --bg: var(--koralle);
  --fg: var(--navy);
  --fg-leise: #3A231C;
  --fg-stumm: #5A3328;
  --label: var(--navy);
  --akzent: var(--navy);
  --linie: rgba(14, 23, 38, 0.22);
  --linie-stark: rgba(14, 23, 38, 0.4);
  --flaeche: #FF8D73;
  --knopf-rand: rgba(14, 23, 38, 0.5);
  --fokus: var(--navy);
}
[data-thema] { background: var(--bg); color: var(--fg); }

/* ---------- 4 Reset ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; scroll-padding-top: calc(var(--kopf) + 1rem); }
body, h1, h2, h3, h4, p, ul, ol, dl, dd, figure, blockquote { margin: 0; }
:where(ul[class], ol[class]) { padding: 0; list-style: none; }
img, svg, picture { display: block; max-width: 100%; }
img { height: auto; }
a { color: inherit; }
button { font: inherit; color: inherit; }
summary { cursor: pointer; }

/* ---------- 5 Typo ---------- */
body {
  font-family: var(--sans);
  font-size: var(--fs-text);
  line-height: 1.55;
  color: var(--fg);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-wrap: break-word;
}
h1, h2, h3, .h1, .h2, .h3, .serif {
  font-family: var(--serif);
  font-weight: 400;
  font-optical-sizing: auto;
  letter-spacing: -0.015em;
  text-wrap: balance;
}
h1, .h1 { font-size: var(--fs-display); line-height: 1; letter-spacing: -0.022em; }
h2, .h2 { font-size: var(--fs-h2); line-height: 1.08; }
h3, .h3 { font-size: var(--fs-h3); line-height: 1.15; }
h2, h3, .h2, .h3 { hyphens: auto; hyphenate-limit-chars: 12 5 5; }
/* Das kursive Akzentwort in Headlines: <em> */
:is(h1, h2, h3, .h1, .h2, .h3) em { font-style: italic; color: var(--akzent); }
p { max-width: 65ch; text-wrap: pretty; }
strong { font-weight: 600; }
.lead { font-size: var(--fs-lead); line-height: 1.5; color: var(--fg-leise); }
.klein { font-size: var(--fs-klein); line-height: 1.5; }
.leise { color: var(--fg-leise); }
.stumm { color: var(--fg-stumm); }
.nb { white-space: nowrap; }
.label {
  font-family: var(--sans);
  font-size: var(--fs-label);
  font-weight: 500;
  line-height: 1.35;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--label);
  max-width: none;
}
.nur-sr {
  position: absolute; width: 1px; height: 1px; overflow: hidden;
  clip-path: inset(50%); white-space: nowrap;
}

/* ---------- 6 Raster ----------
   Jede Sektion ist ein Raster über die volle Breite:
   [voll] Rand | [inhalt] 4 bzw. 12 Spalten | Rand [voll]
   - Kinder stehen automatisch im Inhalt.
   - Spalten gezielt belegen:  grid-column: sp 1 / span 5;   (ab Spalte 1, 5 Spalten breit)
   - Anschnitt bis zum Bildschirmrand:  grid-column: sp 7 / voll-end; */
.raster {
  display: grid;
  column-gap: var(--luecke);
  grid-template-columns:
    [voll-start] minmax(calc(var(--rand) - var(--luecke)), 1fr)
    [inhalt-start] repeat(var(--sp), [sp] minmax(0, calc((min(var(--breite), 100% - 2 * var(--rand)) - (var(--sp) - 1) * var(--luecke)) / var(--sp))))
    [inhalt-end] minmax(calc(var(--rand) - var(--luecke)), 1fr) [voll-end];
}
.raster > * { grid-column: inhalt; min-width: 0; }
.raster > .voll { grid-column: voll; }
.sektion { padding-block: var(--ab-sektion); }

@media (min-width: 768px) {
  :root { --sp: 12; }
}

/* ---------- 7 Bausteine ---------- */

/* Sprunglink für Tastatur */
.sprung {
  position: absolute; left: var(--ab-2); top: var(--ab-2); z-index: 100;
  padding: 0.75rem 1rem; border-radius: var(--radius);
  background: var(--creme); color: var(--navy);
  transform: translateY(-300%);
}
.sprung:focus { transform: none; }

:focus-visible { outline: 2px solid var(--fokus); outline-offset: 3px; }

/* Pfeil als Maske: <span class="pfeil" aria-hidden="true"></span> */
.pfeil {
  flex: none;
  display: inline-block;
  width: 1.125em; height: 1.125em;
  background: currentColor;
  -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='1.6'%3E%3Cpath d='M4 12h15M13 6l6 6-6 6'/%3E%3C/svg%3E") center / contain no-repeat;
  mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='1.6'%3E%3Cpath d='M4 12h15M13 6l6 6-6 6'/%3E%3C/svg%3E") center / contain no-repeat;
  transition: transform var(--dauer) ease;
}

/* Buttons (Pill) */
.knopf {
  display: inline-flex; align-items: center; justify-content: center; gap: 0.625rem;
  min-height: 3.25rem;                  /* 52 px Tap-Fläche */
  padding: 0.875rem 1.75rem;
  font-family: var(--sans); font-size: 1rem; font-weight: 600; line-height: 1.2;
  text-decoration: none; white-space: nowrap;
  border: 0; border-radius: var(--rund);
  cursor: pointer;
  transition: background-color var(--dauer) ease, color var(--dauer) ease, box-shadow var(--dauer) ease;
}
.knopf--haupt { background: var(--koralle); color: var(--navy); }
.knopf--zweit { background: transparent; color: var(--fg); box-shadow: inset 0 0 0 1px var(--knopf-rand); }
.knopf--klein { min-height: 2.75rem; padding: 0.625rem 1.25rem; font-size: var(--fs-klein); }
[data-thema="koralle"] .knopf--haupt { background: var(--navy); color: var(--creme); }
@media (hover: hover) {
  .knopf--haupt:hover { background: var(--fg); color: var(--bg); }
  .knopf--zweit:hover { box-shadow: inset 0 0 0 1px var(--fg); }
  .knopf:hover .pfeil { transform: translateX(4px); }
}

/* Textlink mit Akzent-Unterstreichung */
.textlink {
  color: inherit;
  text-decoration: underline;
  text-decoration-color: var(--akzent);
  text-decoration-thickness: 1.5px;
  text-underline-offset: 0.24em;
  transition: text-underline-offset var(--dauer) ease;
}
@media (hover: hover) { .textlink:hover { text-underline-offset: 0.4em; } }

/* Pfeillink: „Alle Auftritte →“ */
.pfeillink {
  display: inline-flex; align-items: center; gap: 0.5rem;
  min-height: 2.75rem;
  font-weight: 500; color: var(--akzent); text-decoration: none;
}
@media (hover: hover) { .pfeillink:hover .pfeil { transform: translateX(4px); } }

/* Bild mit festem Seitenverhältnis: <figure class="foto" style="--verh: 4/5"> */
.foto { position: relative; overflow: hidden; border-radius: var(--radius); background: var(--flaeche); aspect-ratio: var(--verh, 3 / 2); }
.foto picture, .foto img { width: 100%; height: 100%; }
.foto img { object-fit: cover; object-position: var(--pos, center); }
.bildnachweis { margin-top: 0.625rem; font-size: 0.8125rem; color: var(--fg-stumm); }

/* Hinweis nur im Entwurf: markiert offene Punkte. Verschwindet mit ENTWURF = false in teile/helfer.php. */
.entwurf {
  display: inline-block; padding: 0.125rem 0.5rem; vertical-align: middle;
  border: 1px dashed currentColor; border-radius: 3px;
  font-family: var(--sans); font-size: 0.6875rem; font-weight: 600; font-style: normal;
  line-height: 1.5; letter-spacing: 0.06em; text-transform: uppercase;
  color: var(--akzent);
}

/* Vorschau-Liste (vorschau.php) */
.vorschau-liste { display: grid; gap: var(--ab-3); }
.vorschau-liste ul { display: grid; gap: 0.5rem; padding-left: 1.25rem; }

/* ---------- 8 Leiste und Menü ----------
   Handy und Tablet (unter 1100 px): Kopfzeile bleibt oben stehen, mit „Anfragen“ und Menü-Knopf.
   Desktop: Kopfzeile scrollt mit weg, dafür erscheint „Vortrag anfragen“ hochkant am rechten Rand.
   Jede Seite beginnt mit einer dunklen Sektion, die unter die Kopfzeile rutscht (siehe .unter-kopf). */
html.menue-offen { overflow: hidden; }

.leiste {
  position: sticky; top: 0; z-index: 50;
  height: var(--kopf);
  border-bottom: 1px solid var(--linie);
  transition: background-color var(--dauer) ease, border-color var(--dauer) ease;
}
/* Ganz oben: durchsichtig über dem Hero (nur mit JavaScript, sonst bleibt sie Navy) */
.js.ist-oben:not(.menue-offen) .leiste { background: transparent; border-color: transparent; }
.unter-kopf { margin-top: calc(var(--kopf) * -1); }

.leiste__innen {
  display: flex; align-items: center; gap: 0.5rem;
  height: 100%; max-width: calc(var(--breite) + 2 * var(--rand));
  margin-inline: auto; padding-inline: var(--rand);
}
.leiste__logo { display: flex; align-items: center; min-height: 2.75rem; margin-right: auto; text-decoration: none; }
.leiste__wortmarke { width: auto; height: 1.1875rem; }
.leiste__nav, .leiste__sprache { display: none; }

.leiste__anfrage { min-height: 2.5rem; padding-inline: 1.125rem; }
.leiste__anfrage-lang { display: none; }
.menue-offen .leiste__anfrage { visibility: hidden; }

.leiste__menue {
  display: inline-flex; align-items: center; justify-content: center; gap: 0.5rem;
  min-width: 2.75rem; height: 2.75rem; margin-right: -0.625rem; padding: 0 0.625rem;
  background: none; border: 0; cursor: pointer;
  font-size: var(--fs-klein); font-weight: 500; line-height: 1;
}
.leiste__striche { position: relative; flex: none; width: 1.375rem; height: 0.5rem; }
.leiste__striche::before,
.leiste__striche::after {
  content: ""; position: absolute; left: 0; right: 0; height: 1.5px;
  background: currentColor;
  transition: transform var(--dauer) ease, top var(--dauer) ease, bottom var(--dauer) ease;
}
.leiste__striche::before { top: 0; }
.leiste__striche::after { bottom: 0; }
[aria-expanded="true"] > .leiste__striche::before { top: calc(50% - 0.75px); transform: rotate(45deg); }
[aria-expanded="true"] > .leiste__striche::after { bottom: calc(50% - 0.75px); transform: rotate(-45deg); }
@media (max-width: 479px) {            /* am Handy nur das Zeichen, das Wort bleibt für Screenreader */
  .leiste__menue-text { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
}
@media (min-width: 600px) {
  .leiste__anfrage-lang { display: inline; }
  .leiste__anfrage-kurz { display: none; }
}

/* Großes Menü über die ganze Fläche */
.menue {
  position: fixed; inset: 0; z-index: 40;
  padding-top: var(--kopf);
  overflow-y: auto; overscroll-behavior: contain;
  visibility: hidden; opacity: 0;
  transition: opacity var(--dauer) ease, visibility 0s linear var(--dauer);
}
.menue.ist-offen { visibility: visible; opacity: 1; transition-delay: 0s; }
.menue__innen { row-gap: var(--ab-4); padding-block: var(--ab-3) var(--ab-5); }
.menue__liste { border-top: 1px solid var(--linie-stark); }
.menue__link {
  display: grid; grid-template-columns: 2rem minmax(0, 1fr) auto; align-items: baseline; column-gap: 0.75rem;
  padding-block: 1.125rem;
  border-bottom: 1px solid var(--linie-stark);
  text-decoration: none;
}
.menue__nr { font-size: var(--fs-label); font-weight: 500; letter-spacing: 0.14em; color: var(--label); }
.menue__titel { font-family: var(--serif); font-size: var(--fs-h2); line-height: 1.08; letter-spacing: -0.015em; }
.menue__unter {
  display: block; margin-top: 0.375rem;
  font-family: var(--sans); font-size: var(--fs-klein); line-height: 1.45; letter-spacing: 0;
  color: var(--fg-stumm);
}
.menue__link .pfeil { align-self: center; color: var(--akzent); }
.menue__link[aria-current] .menue__titel { font-style: italic; color: var(--akzent); }
.menue__kontakt { display: grid; justify-items: start; gap: var(--ab-3); }
.menue__kontakt .textlink { display: inline-block; padding-block: 0.375rem; }
@media (min-width: 768px) {
  .menue__liste { grid-column: sp 1 / span 8; }
  .menue__kontakt { grid-column: sp 1 / span 8; }
}

/* Anfrage-Button hochkant am Rand: erst ab 1200 px */
.rand-cta { display: none; }

@media (min-width: 1100px) {
  :root { --kopf: 5.5rem; }
  .leiste { position: relative; background: transparent; border-color: transparent; }
  .leiste__innen { gap: 1.75rem; }
  .leiste__wortmarke { height: 1.3125rem; }
  .leiste__nav { display: flex; gap: 1.75rem; font-size: var(--fs-klein); }
  .leiste__nav a { padding-block: 0.75rem; text-decoration: none; transition: color var(--dauer) ease; }
  .leiste__nav a[aria-current] { color: var(--akzent); }
  .leiste__sprache { display: block; font-size: var(--fs-klein); color: var(--fg-stumm); white-space: nowrap; }
  .leiste__sprache [aria-current] { color: var(--fg-leise); }
  .leiste__anfrage { min-height: 2.75rem; padding-inline: 1.25rem; }
  .leiste__menue, .menue { display: none; }
}
@media (min-width: 1100px) and (hover: hover) {
  .leiste__nav a:hover { color: var(--akzent); }
}
@media (min-width: 1200px) {
  .rand-cta {
    position: fixed; right: 0; top: 50%; z-index: 30;
    display: inline-flex; align-items: center; gap: 0.625rem;
    writing-mode: vertical-rl;
    padding: 1.25rem 0.75rem;
    background: var(--koralle); color: var(--navy);
    font-size: 0.875rem; font-weight: 600; line-height: 1; letter-spacing: 0.02em; text-decoration: none;
    border-radius: 0 10px 10px 0;                       /* nach der Drehung liegen die runden Ecken links */
    transform: translate(100%, -50%) rotate(180deg);    /* liest sich von unten nach oben */
    visibility: hidden;
    transition: transform 260ms ease, visibility 0s linear 260ms, background-color var(--dauer) ease, color var(--dauer) ease;
  }
  .rand-cta .pfeil { transform: rotate(90deg); }
  .ist-gescrollt .rand-cta,
  html:not(.js) .rand-cta { transform: translate(0, -50%) rotate(180deg); visibility: visible; transition-delay: 0s; }
}
@media (min-width: 1200px) and (hover: hover) {
  .rand-cta:hover { background: var(--creme); }
}

/* ---------- 9 Weniger Bewegung, wenn im System gewünscht ---------- */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    transition-duration: 0.01ms !important;
    animation-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}
