/* ==========================================================================
   EISENHALLE – Basis: Reset, Typografie, Links, Fokus, Körnung, Stützenraster
   ========================================================================== */

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

* {
  margin: 0;
}

html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
  background: var(--hg);
  scroll-padding-top: calc(var(--kopf-hoehe) + var(--abstand-5));
}

body {
  min-height: 100svh;
  display: flex;
  flex-direction: column;
  color: var(--text);
  font-family: var(--schrift-text);
  font-size: var(--text-body);
  line-height: var(--zeile-text);
  font-kerning: normal;
  font-variant-numeric: lining-nums;
  hyphens: auto;
  -webkit-hyphens: auto;
  overflow-wrap: break-word;
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
}

main {
  flex: 1 0 auto;
  overflow-x: clip; /* schräge Bänder und angeschnittene Fotos dürfen nicht seitlich scrollen */
}

main:focus {
  outline: none;
}

/* Stützenraster: feine Hallenstützen im Hintergrund (2 Felder mobil, 4 ab Tablet) */
body::before {
  content: "";
  position: fixed;
  inset: 0 var(--rand);
  z-index: -1;
  max-width: var(--inhalt-max);
  margin-inline: auto;
  border-inline: var(--linie-duenn) solid color-mix(in srgb, var(--linie) 60%, transparent);
  background: linear-gradient(90deg, color-mix(in srgb, var(--linie) 45%, transparent) var(--linie-duenn), transparent var(--linie-duenn)) 0 0 / 50% 100%;
  pointer-events: none;
}

@media (min-width: 48rem) {
  body::before {
    background-size: 25% 100%;
  }
}

/* Körnung: feines Rauschen über allem, nicht klickbar */
body::after {
  content: "";
  position: fixed;
  inset: 0;
  z-index: var(--ebene-koernung);
  background: url("../img/muster/koernung.svg") 0 0 / 180px 180px;
  opacity: 0.07;
  pointer-events: none;
}

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

img {
  height: auto;
}

input,
button,
textarea,
select {
  font: inherit;
  color: inherit;
}

button {
  cursor: pointer;
}

:disabled {
  cursor: not-allowed;
}

/* --- Überschriften ------------------------------------------------------- */
h1,
h2,
h3,
h4 {
  font-weight: 700;
  line-height: var(--zeile-titel);
  hyphens: manual;
  text-wrap: balance;
}

.display {
  font-family: var(--schrift-display);
  font-weight: 900;
  line-height: var(--zeile-display);
  letter-spacing: var(--sperrung-display);
  text-transform: uppercase;
  hyphens: manual;
}

p,
li,
dd {
  text-wrap: pretty;
}

p,
ul,
ol,
dl {
  max-width: var(--text-max);
}

strong,
b {
  font-weight: 700;
}

abbr[title] {
  text-decoration: none;
}

/* --- Links --------------------------------------------------------------- */
a {
  color: inherit;
  text-decoration-line: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 0.22em;
  text-decoration-color: color-mix(in srgb, currentColor 55%, transparent);
  transition: color var(--dauer-kurz) var(--kurve-hart), text-decoration-color var(--dauer-kurz) var(--kurve-hart);
}

a:hover {
  color: var(--akzent);
  text-decoration-color: var(--akzent);
  text-decoration-thickness: 2px;
}

a:active {
  color: var(--akzent-gedrueckt);
}

/* --- Fokus: immer sichtbar, immer Volt ------------------------------------ */
:focus-visible {
  outline: var(--fokus-ring) solid var(--fokus-farbe);
  outline-offset: var(--fokus-abstand);
}

:focus:not(:focus-visible) {
  outline: none;
}

::selection {
  background: var(--akzent);
  color: var(--auf-akzent);
}

/* --- Skip-Link ----------------------------------------------------------- */
.skip-link {
  position: absolute;
  top: var(--abstand-2);
  left: var(--abstand-2);
  z-index: calc(var(--ebene-koernung) + 1);
  padding: var(--abstand-3) var(--abstand-4);
  background: var(--akzent);
  color: var(--auf-akzent);
  font-weight: 700;
  text-decoration: none;
  transform: translateY(-200%);
}

.skip-link:focus {
  transform: none;
  color: var(--auf-akzent);
}

/* --- Hilfsklassen -------------------------------------------------------- */
.visuell-versteckt {
  position: absolute !important;
  width: 1px !important;
  height: 1px !important;
  padding: 0 !important;
  margin: -1px !important;
  overflow: hidden !important;
  clip: rect(0 0 0 0) !important;
  white-space: nowrap !important;
  border: 0 !important;
}

/* hidden gilt immer, auch wenn eine Komponente display setzt */
[hidden] {
  display: none !important;
}

/* Inhalte nur für Browser ohne bzw. mit JavaScript */
.nur-ohne-js {
  display: none !important;
}

@media (scripting: none) {
  .nur-ohne-js {
    display: block !important;
  }

  .nur-mit-js {
    display: none !important;
  }
}

.nowrap {
  white-space: nowrap;
}

/* --- Bewegung reduzieren: alles steht still ------------------------------- */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}
