/* ==========================================================================
   Die Zwei für Autismus – gemeinsames Stylesheet für index.html & impressum.html
   ========================================================================== */

/* ---------- Schriften ---------- */

/* Caveat Brush (SIL Open Font License), selbst gehostet statt Google Fonts */
@font-face {
  font-family: "Caveat Brush";
  src: url("fonts/CaveatBrush-Regular.woff2") format("woff2");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: "Text";
  src: url("fonts/MYRIADPRO-REGULAR.OTF") format("opentype");
  font-weight: normal;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "Text";
  src: url("fonts/MYRIADPRO-BOLD.OTF") format("opentype");
  font-weight: bold;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "Text";
  src: url("fonts/MYRIADPRO-CONDIT.OTF") format("opentype");
  font-weight: normal;
  font-style: italic;
  font-display: swap;
}

/* ---------- Farben & Grundwerte ---------- */

:root {
  --gruen: #2D9E47;
  --rot: #DB3D35;
  --grau: #777;
  --orange: #EB8B2C;
  --gelb: #F3B144;
  --weiss: #fff;
  --schatten: 0 0.25em 0.5em rgba(0, 0, 0, 0.1);
  --hand: "Caveat Brush", cursive;
  --text: "Text", "Myriad Pro", "Helvetica Neue", Arial, sans-serif;
}

html {
  font-size: clamp(18px, 1.5vw, 24px);
}

html,
body {
  margin: 0;
  padding: 0;
  background-color: var(--weiss);
}

body {
  font-family: var(--text);
  line-height: 1.25;
  color: #000;
  overflow-x: hidden;
}

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

a {
  color: var(--gruen);
}

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

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

@media (prefers-reduced-motion: no-preference) {
  html {
    scroll-behavior: smooth;
    scroll-snap-type: y proximity;
  }
  section {
    scroll-snap-align: start;
  }
}

/* ---------- Sektionen ---------- */

section {
  min-height: 100vh;
  padding: 2.5em;
  background: var(--orange);
  scroll-margin-top: 0;
}

section:nth-of-type(even) {
  background: var(--gelb);
}

section > * {
  max-width: 40em;
  margin: 0.5em auto;
}

.white-box {
  position: relative;
  max-width: 42em;
  margin: 2.8em auto 9em auto;
  padding: 1em 2em 2em 2em;
  background-color: var(--weiss);
  border-radius: 0.3em;
  box-shadow: var(--schatten);
}

.white-box.letzte {
  margin-bottom: 3em;
}

/* ---------- Typografie ---------- */

h1,
h2,
h4 {
  font-family: var(--hand);
  font-weight: 400;
}

h1 {
  margin: 0.2em;
  padding: 0.2em;
  font-size: 4em;
  line-height: 3rem;
  text-align: center;
  color: var(--gruen);
}

h2 {
  margin: 0.6em 0.12em 0.2em;
  font-size: 2.5em;
  line-height: 1.5rem;
  color: var(--gruen);
}

h3 {
  margin: 0.12em 0.12em 0;
  padding: 0.12em 0.12em 0;
  font-size: 1.4em;
  line-height: 1;
  font-weight: bold;
  color: var(--rot);
}

h4 {
  margin: 0.15em;
  font-size: 1.6em;
  color: var(--rot);
}

/* Unterzeile unter dem Modultitel */
.unterzeile {
  margin: 0 0.15em 0.15em;
  padding: 0.2em 0.15em 0.6em;
  font-size: 1.25em;
  text-align: left;
}

p {
  margin: 0.15em;
  padding: 0.15em;
  text-align: justify;
}

ul {
  margin: 0.25em 0 0.25em 0.25em;
  padding: 0.2em 0.2em 0.2em 1.2em;
}

li {
  margin: 0;
  padding: 0;
}

.rot   { color: var(--rot); }
.gruen { color: var(--gruen); }
.grau  { color: var(--grau); }

.text-center {
  text-align: center;
}

.abstand-oben {
  margin-top: 0.5em;
}

/* ---------- Bilder & Deko ---------- */

/* Zielscheibe oben rechts in jeder Box */
.top-image {
  position: absolute;
  top: 0.4em;
  right: 0.6em;
  width: 15%;
  z-index: 2;
}

/* Zielscheibe unten rechts auf der Startseite */
.relative-image {
  position: absolute;
  bottom: 2em;
  right: 1.6em;
  width: 18%;
  z-index: 2;
}

.puzzle-box {
  position: relative;
  max-width: 100%;
}

.puzzle-image {
  position: absolute;
  top: 0.3em;
  right: -0.9em;
  width: 15%;
  transform: rotate(7deg);
  z-index: 2;
}

/* „Dauer“-Puzzleteil links neben der Box */
.puzzle-white {
  position: absolute;
  top: 6.5em;
  left: -5.8em;
  width: 16%;
  transform: rotate(14deg);
  z-index: 2;
}

.bordered-box {
  max-width: 92%;
  margin: 1em -0.2em;
  padding: 0.1em 0.2em 0.2em;
  border: 1px solid #333;
  border-radius: 0.2em;
}

.smallBox {
  max-width: 80%;
}

/* ---------- Termine ---------- */

.termine li + li {
  margin-top: 0.3em;
}

.termine .hinweis {
  list-style: none;
  margin-left: -1.2em;
  color: var(--grau);
}

/* ---------- Referenzen ---------- */

.referenz {
  margin: 0.8em 0.15em 1.2em;
  padding: 0 0 0 0.9em;
  border-left: 3px solid var(--gruen);
}

.referenz blockquote {
  margin: 0;
}

.referenz blockquote p {
  margin: 0;
  padding: 0;
}

.referenz figcaption {
  margin-top: 0.3em;
  font-style: italic;
  color: var(--grau);
}

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

.fusszeile {
  max-width: 18em;
  margin: 0 auto 2em;
  padding: 0.15em;
  text-align: center;
  background-color: var(--weiss);
  border-radius: 0.3em;
  box-shadow: var(--schatten);
}

.fusszeile p {
  text-align: center;
}

/* ---------- Navigation (Desktop) ---------- */

.hauptnavigation {
  position: fixed;
  top: 0;
  left: 50%;
  transform: translateX(-50%);
  z-index: 99;
  width: 47em;
  max-width: calc(100% - 2em);
  padding: 0.2em;
  background-color: var(--weiss);
  border-bottom-left-radius: 0.3em;
  border-bottom-right-radius: 0.3em;
  box-shadow: var(--schatten);
}

.hauptnavigation ul {
  display: flex;
  justify-content: center;
  margin: 0;
  padding: 0;
  list-style: none;
}

.hauptnavigation li {
  margin: 0.4em 0 0.3em;
  padding: 0 0.5em;
  border-right: 1px solid #000;
  font-family: var(--hand);
  font-size: 1.3em;
  line-height: 1.15;
  text-align: center;
}

.hauptnavigation li:last-child {
  border-right: none;
}

.hauptnavigation a {
  color: var(--gruen);
  text-decoration: none;
  white-space: nowrap;
  transition: color 0.2s;
}

.hauptnavigation a:hover,
.hauptnavigation a:focus-visible,
.hauptnavigation a.scrolled {
  color: var(--rot);
}

.menu-toggle {
  display: none;
}

/* Impressum: einfache Zurück-Leiste im selben Stil */
.hauptnavigation.einfach li {
  border-right: none;
}

/* ---------- Tablet / schmale Fenster: Menü-Knopf ---------- */

@media (max-width: 900px) {
  .hauptnavigation {
    box-sizing: border-box;
    left: 0;
    transform: none;
    width: 100%;
    max-width: none;
    padding: 0.3em 0.6em;
    border-radius: 0;
  }

  .menu-toggle {
    display: block;
    padding: 0.2em 0.3em;
    font-family: var(--hand);
    font-size: 1.3em;
    color: var(--gruen);
    background: none;
    border: none;
    cursor: pointer;
  }

  .hauptnavigation:not(.einfach) ul {
    display: none;
    position: absolute;
    top: 100%;
    left: 5px;
    flex-direction: column;
    width: 200px;
    background-color: var(--weiss);
    box-shadow: var(--schatten);
  }

  .hauptnavigation.offen ul {
    display: flex;
  }

  .hauptnavigation:not(.einfach) li {
    margin: 0;
    padding: 0;
    border: 1px solid #000;
    border-top: none;
  }

  .hauptnavigation:not(.einfach) li:first-child {
    border-top: 1px solid #000;
  }

  .hauptnavigation:not(.einfach) li:last-child {
    border-right: 1px solid #000;
  }

  .hauptnavigation:not(.einfach) a {
    display: block;
    padding: 12px 0;
  }

  .hauptnavigation.einfach ul {
    justify-content: flex-start;
  }

  /* Zielscheibe auf der Startseite würde sonst den Namen überdecken */
  .relative-image {
    display: none;
  }
}

/* ---------- Handy ---------- */

@media (max-width: 600px) {
  section,
  .white-box,
  .bordered-box {
    box-sizing: border-box;
  }

  body {
    font-size: max(14px, 3.5vw);
  }

  section {
    padding: 0.8em 0.4em 0.4em;
  }

  section > * {
    max-width: 100%;
  }

  .white-box {
    max-width: 100%;
    padding: 0.35em 0.6em 1.2em;
  }

  h1 {
    font-size: 3em;
    line-height: 0.8em;
  }

  h3 {
    margin-top: 0.8em;
    margin-bottom: 0.2em;
    line-height: 0.95em;
  }

  .unterzeile {
    margin-top: 0;
    padding-top: 0;
    line-height: 0.95em;
  }

  p {
    text-align: left;
  }

  .relative-image,
  .puzzle-image {
    display: none;
  }

  .top-image {
    width: 14%;
    top: 0.25em;
    right: 0.35em;
  }

  .smallBox,
  .bordered-box {
    max-width: 100%;
  }

  .puzzle-white {
    top: auto;
    bottom: -2.4em;
    left: auto;
    right: 1.5em;
    width: 16%;
  }
}
