/* ==========================================================================
   Ingenieurbüro Heidan – style.css
   Statisches Layout ohne JavaScript und ohne externe Ressourcen.
   Farben und Abstände sind als Variablen definiert; Dark Mode folgt der
   Systemeinstellung (prefers-color-scheme).
   ========================================================================== */

:root {
  --akzent: #960000;          /* Dunkelrot aus dem Logo */
  --akzent-hell: #b3321f;
  --akzent-dunkel: #6e0000;
  --akzent-flaeche: #faf3f2;  /* sehr helles Weinrot für Flächen */
  --fuss-text: #f1e4e4;
  --text: #1f1f1f;
  --text-leise: #5f5f5f;
  --hintergrund: #ffffff;
  --flaeche: #f6f4f0;         /* leicht warmes Grau für Kästen */
  --linie: #d9d5cd;
  --logo-flaeche: transparent;
  --breite: 60rem;
  --schrift: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

@media (prefers-color-scheme: dark) {
  :root {
    --akzent: #e07a6a;
    --akzent-hell: #f0978a;
    --akzent-dunkel: #3a0a0a;
    --akzent-flaeche: #241a1a;
    --fuss-text: #d9c7c7;
    --text: #e8e6e1;
    --text-leise: #a9a6a0;
    --hintergrund: #161616;
    --flaeche: #202020;
    --linie: #3a3a3a;
    --logo-flaeche: #f4f1ec;  /* Logo-PNG hat dunkle Schrift, braucht helle Fläche */
  }
}

/* ---------- Grundlagen ---------- */

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

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  font-family: var(--schrift);
  font-size: 1.0625rem;
  line-height: 1.6;
  color: var(--text);
  background: transparent;     /* Hintergrund liegt auf html */
  min-height: 100vh;           /* Fußzeile schließt unten ab */
  display: flex;
  flex-direction: column;
}

main { flex: 1 0 auto; width: 100%; }

a {
  color: var(--akzent);
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 0.15em;
}

a:hover,
a:focus-visible { color: var(--akzent-hell); }

a:focus-visible,
button:focus-visible {
  outline: 2px solid var(--akzent);
  outline-offset: 3px;
}

h1, h2, h3 {
  font-weight: 600;
  line-height: 1.25;
  letter-spacing: -0.01em;
  margin: 0 0 0.6em;
}

h1 {
  font-size: clamp(1.7rem, 1.2rem + 2vw, 2.4rem);
  padding-bottom: 0.4em;
  margin-bottom: 0.8em;
  border-bottom: 3px solid var(--akzent);
  display: inline-block;
}
h2 { font-size: 1.3rem; margin-top: 2.2rem; color: var(--akzent); }
h3 { font-size: 1.05rem; margin-top: 1.6rem; color: var(--text-leise); }

p { margin: 0 0 1em; }

ul { padding-left: 1.2em; margin: 0 0 1em; }
li { margin: 0.25em 0; }

img { max-width: 100%; height: auto; }

/* ---------- Hintergrund: Quelltext-Spirale der alten Seite ---------- */
/* Die Deckkraft steckt in den PNG-Dateien (16 % hell, 14 % dunkel); Motivhöhe = Fensterhöhe. */

html {
  background: var(--hintergrund) url(bilder/sourcen-spirale.png) repeat-x center top / auto 100vh fixed;
}

@media (prefers-color-scheme: dark) {
  html { background-image: url(bilder/sourcen-spirale-dunkel.png); }
}

@media print {
  html { background-image: none; }
}

/* ---------- Seitenrahmen ---------- */

.rahmen {
  max-width: var(--breite);
  margin: 0 auto;
  padding: 0 1rem;             /* 16 px Seitenrand auf dem Smartphone */
}

/* ---------- Kopf und Navigation ---------- */

.kopf {
  border-top: 6px solid #960000;     /* Weinrot bleibt auch im Dark Mode satt */
  border-bottom: 1px solid var(--linie);
}

.kopf .rahmen {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 1rem 2rem;
  padding-top: 1.25rem;
  padding-bottom: 1.25rem;
}

.logo {
  display: inline-block;
  max-width: 22rem;
  padding: 0.35rem 0.6rem;
  margin-left: -0.6rem;
  border-radius: 4px;
  background: var(--logo-flaeche);
  line-height: 0;
}

.logo img {
  width: 100%;
  height: auto;
}

.navigation ul {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 0.25rem 1.5rem;
}

.navigation a {
  display: inline-block;
  padding: 0.3rem 0;
  color: var(--text);
  text-decoration: none;
  border-bottom: 2px solid transparent;
  font-size: 0.95rem;
  letter-spacing: 0.02em;
}

.navigation a:hover,
.navigation a:focus-visible { border-bottom-color: var(--linie); color: var(--text); }

.navigation a[aria-current="page"] {
  border-bottom-color: var(--akzent);
  color: var(--akzent);
}

/* ---------- Inhalt ---------- */

main.rahmen {
  padding-top: 2.5rem;
  padding-bottom: 4rem;
}

.inhalt { max-width: 42rem; }

.einleitung {
  font-size: 1.15rem;
  color: var(--text-leise);
  max-width: 36rem;
}

.teaser {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(16rem, 1fr));
  gap: 1rem;
  margin-top: 2.5rem;
}

.teaser article {
  border: 1px solid var(--linie);
  border-left: 4px solid var(--akzent);
  border-radius: 6px;
  padding: 1.2rem 1.4rem;
  background: var(--akzent-flaeche);
}

.teaser h2 { margin-top: 0; font-size: 1.1rem; }
.teaser h2 a { text-decoration: none; }
.teaser h2 a:hover { text-decoration: underline; }
.teaser p  { margin-bottom: 0.6em; color: var(--text-leise); font-size: 0.97rem; }

.hinweis {
  font-size: 0.9rem;
  color: var(--text-leise);
}

/* Werdegang: Foto neben dem Text */

.mit-foto {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 1.5rem 3rem;
  align-items: start;
}

@media (min-width: 46rem) {
  .mit-foto { grid-template-columns: minmax(0, 1fr) 15rem; }
}

.foto {
  margin: 0;
  order: -1;
}

@media (min-width: 46rem) {
  .foto { order: 0; position: sticky; top: 1.5rem; }
}

.foto img {
  display: block;
  width: 11rem;
  max-width: 100%;
  border-radius: 4px;
  border: 1px solid var(--linie);
  border-bottom: 4px solid var(--akzent);
}

@media (min-width: 46rem) {
  .foto img { width: 15rem; }
}

.foto figcaption {
  margin-top: 0.5rem;
  font-size: 0.85rem;
  color: var(--text-leise);
}

/* Listen mit Zeitangabe (Werdegang) */

dl.stationen { margin: 0 0 1.5em; }
dl.stationen div { display: grid; grid-template-columns: 6.5rem 1fr; gap: 0 1rem; padding: 0.35rem 0; border-top: 1px solid var(--linie); }
dl.stationen div:last-child { border-bottom: 1px solid var(--linie); }
dl.stationen dt { color: var(--akzent); font-weight: 500; font-variant-numeric: tabular-nums; }
dl.stationen dd { margin: 0; }

/* Zweispaltige Stichwortlisten (Kompetenzen) */

.spalten {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(14rem, 1fr));
  gap: 0 2rem;
}

/* Kontakt-Tabelle */

.kontakt { border-collapse: collapse; margin-bottom: 1.5rem; }
.kontakt th { text-align: left; font-weight: 500; color: var(--akzent); padding: 0.4rem 1.5rem 0.4rem 0; vertical-align: top; white-space: nowrap; }
.kontakt td { padding: 0.4rem 0; vertical-align: top; }

/* Rechtstexte (Impressum, Datenschutz) */

.rechtstext h2 { font-size: 1.15rem; }
.rechtstext h3 { font-size: 1rem; color: var(--text); }
.rechtstext ul.ohne { list-style: none; padding-left: 0; }
.rechtstext ul.ohne > li { margin: 0 0 1.2em; }

/* ---------- Fuß ---------- */

.fuss {
  background: var(--akzent-dunkel);
  font-size: 0.88rem;
  color: var(--fuss-text);
}

.fuss .rahmen {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 0.5rem 2rem;
  padding-top: 1.25rem;
  padding-bottom: 1.5rem;
}

.fuss ul { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 0 1.25rem; }
.fuss a { color: var(--fuss-text); }
.fuss a:hover, .fuss a:focus-visible { color: #ffffff; }
.fuss a:focus-visible { outline-color: #ffffff; }

/* ---------- Druck ---------- */

@media print {
  .navigation, .fuss ul { display: none; }
  body { font-size: 11pt; color: #000; background: #fff; }
  a { color: #000; text-decoration: none; }
}
