/* ------------------------------------------------------------------
   Psychoanalyse – eine Einführung
   Ein einziges Stylesheet, keine Abhängigkeiten, keine externen Fonts.
   ------------------------------------------------------------------ */

:root {
  --papier:        #f6f3ec;
  --papier-tief:   #efeade;
  --tinte:         #23201b;
  --tinte-matt:    #635c50;
  --linie:         #d7cfbe;
  --linie-fein:    #e5ded0;
  --akzent:        #7a6a4f;

  --schrift: "Iowan Old Style", "Palatino Linotype", Palatino, "Book Antiqua",
             "URW Palladio L", Georgia, "Times New Roman", serif;

  --spalte: 36rem;     /* Lesebreite: rund 70 Zeichen */
  --rand: clamp(1.25rem, 5vw, 3rem);
}

@media (prefers-color-scheme: dark) {
  :root {
    --papier:      #14130f;
    --papier-tief: #1b1914;
    --tinte:       #e8e2d5;
    --tinte-matt:  #a49c8c;
    --linie:       #3a352b;
    --linie-fein:  #2b2720;
    --akzent:      #c3b192;
  }
}

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

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

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
}

body {
  margin: 0;
  background: var(--papier);
  color: var(--tinte);
  font-family: var(--schrift);
  font-size: clamp(1.0625rem, 0.98rem + 0.4vw, 1.1875rem);
  line-height: 1.7;
  text-rendering: optimizeLegibility;
}

/* --- Sprungmarke für Tastatur und Screenreader --------------------- */

.sprungmarke {
  position: absolute;
  left: -9999px;
  top: 0;
  background: var(--papier);
  color: var(--tinte);
  padding: 0.75rem 1.25rem;
  z-index: 20;
}
.sprungmarke:focus {
  left: 0;
  outline: 1px solid var(--akzent);
}

/* --- Kontaktleiste über dem Kopf ----------------------------------- */

.kontaktleiste {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.35rem 2.5rem;
  padding: 0.6rem var(--rand);
  background: #1a1713;
  border-bottom: 1px solid #3a352b;
  font-style: normal;
  font-size: 0.9rem;
  letter-spacing: 0.04em;
  line-height: 1.5;
}

.kontaktleiste a {
  color: #e3d9c4;
  text-decoration: none;
  white-space: nowrap;
}

.kontaktleiste a:hover,
.kontaktleiste a:focus-visible {
  color: #fff;
  text-decoration: underline;
  text-underline-offset: 0.2em;
}

.kontakt-art {
  margin-right: 0.45em;
  font-size: 0.72rem;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: #a49c8c;
}

/* --- Kopf ---------------------------------------------------------- */

.kopf {
  position: relative;
  background: #1a1713;
  overflow: hidden;
}

.kopf-bild {
  display: block;
  width: 100%;
  height: clamp(20rem, 62vh, 34rem);
  object-fit: cover;
  object-position: center 55%;
  filter: saturate(0.78) brightness(0.72);
}

/* Zweites Kopfbild, das per CSS-Animation über das erste geblendet wird:
   je 7 s stehen, 2 s Überblendung, Zyklus 18 s. */
.kopf-wechsel {
  position: absolute;
  inset: 0;
  opacity: 0;
  animation: kopf-ueberblenden 18s ease-in-out infinite;
}

@keyframes kopf-ueberblenden {
  0%, 38.9%   { opacity: 0; }
  50%, 88.9%  { opacity: 1; }
  100%        { opacity: 0; }
}

@media (prefers-reduced-motion: reduce) {
  .kopf-wechsel { animation: none; }
}

.kopf-text {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: clamp(1rem, 2.4vw, 1.9rem);
  padding: var(--rand);
  text-align: center;
  color: #f4efe4;
  text-shadow: 0 1px 14px rgba(0, 0, 0, 0.55);
}

.kopf-vorzeile,
.kopf-unterzeile {
  margin: 0;
  font-size: clamp(0.75rem, 0.66rem + 0.4vw, 0.95rem);
  letter-spacing: 0.32em;
  text-transform: uppercase;
  color: #e3d9c4;
}

.kopf-beruf {
  margin: 0 0 2.25rem;
  font-size: clamp(1.5rem, 1.2rem + 1.1vw, 2.1rem);
  letter-spacing: 0.04em;
  line-height: 1.3;
  hyphens: manual;
  text-wrap: balance;
}

.kopf-unterzeile {
  letter-spacing: 0.16em;
  max-width: 28em;
  line-height: 1.8;
}

.kopf h1 {
  margin: 0;
  font-size: clamp(2.5rem, 1.4rem + 5.4vw, 5.5rem);
  font-weight: 400;
  letter-spacing: 0.1em;
  line-height: 1.05;
  text-indent: 0.1em;   /* gleicht die Sperrung nach rechts aus */
}

/* --- Navigation ---------------------------------------------------- */

.navigation {
  border-bottom: 1px solid var(--linie);
  background: var(--papier);
}

.navigation ul {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.15rem 0;
  margin: 0 auto;
  padding: 0.35rem var(--rand);
  max-width: 62rem;
  list-style: none;
}

.navigation a {
  display: block;
  padding: 0.55rem 0.85rem;
  color: var(--tinte-matt);
  font-size: 0.78rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  text-decoration: none;
}

.nav-knopf {
  display: block;
  margin: 0;
  padding: 0.55rem 0.85rem;
  border: 0;
  background: none;
  color: var(--tinte-matt);
  font: inherit;
  font-size: 0.78rem;
  line-height: inherit;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  cursor: pointer;
}

.navigation a:hover,
.navigation a:focus-visible,
.nav-knopf:hover,
.nav-knopf:focus-visible {
  color: var(--tinte);
}

/* --- Kontaktfenster (HTML-Popover, ohne Skript) --------------------- */

.kontakt-fenster {
  width: min(24rem, calc(100% - 2 * var(--rand)));
  padding: 2.25rem clamp(1rem, 4vw, 2rem) 1.75rem;
  border: 1px solid var(--linie);
  background: var(--papier);
  color: var(--tinte);
  box-shadow: 0 1.25rem 3rem rgba(0, 0, 0, 0.35);
  text-align: center;
}

.kontakt-fenster::backdrop {
  background: rgba(20, 18, 14, 0.6);
}

.kontakt-fenster h2 {
  margin: 0 0 1.5rem;
}

.kontakt-fenster address {
  margin: 0 0 1.25rem;
  font-style: normal;
  line-height: 1.75;
}

.kontakt-fenster a {
  color: var(--tinte);
  text-underline-offset: 0.2em;
  white-space: nowrap;
}

.kontakt-fenster .kontakt-art {
  display: block;
  margin: 0.6rem 0 0;
  color: var(--tinte-matt);
}

.fenster-schliessen {
  margin-top: 0.5rem;
  padding: 0.5rem 1.25rem;
  border: 1px solid var(--linie);
  background: none;
  color: var(--tinte-matt);
  font: inherit;
  font-size: 0.75rem;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  cursor: pointer;
}

.fenster-schliessen:hover,
.fenster-schliessen:focus-visible {
  color: var(--tinte);
  border-color: var(--tinte-matt);
}

@media (min-width: 45rem) {
  .navigation {
    position: sticky;
    top: 0;
    z-index: 10;
  }
}

/* --- Grundraster --------------------------------------------------- */

main {
  padding: 0 var(--rand);
}

main > section,
.fuss-inhalt > section {
  max-width: var(--spalte);
  margin: 0 auto;
}

main > section {
  padding: clamp(3rem, 8vw, 5.5rem) 0;
}

main > section + section {
  border-top: 1px solid var(--linie-fein);
}

main > section,
.fuss-inhalt > section {
  scroll-margin-top: 4rem;
}

/* --- Überschriften ------------------------------------------------- */

/* Römische Zählung der Hauptabschnitte, im Sinne einer klassischen Gliederung. */
main { counter-reset: abschnitt; }

main > section:not(.vorspann) { counter-increment: abschnitt; }

main > section:not(.vorspann) > h2 {
  text-align: center;
}

main > section:not(.vorspann) > h2::before {
  content: counter(abschnitt, upper-roman);
  display: block;
  margin-bottom: 0.9rem;
  color: var(--akzent);
  font-size: 0.8rem;
  letter-spacing: 0.3em;
  text-indent: 0.3em;
}

h2 {
  margin: 0 0 2.25rem;
  font-size: clamp(1.5rem, 1.2rem + 1.1vw, 2.1rem);
  font-weight: 400;
  letter-spacing: 0.04em;
  line-height: 1.3;
  text-wrap: balance;
}

h3 {
  margin: 2.75rem 0 0.6rem;
  font-size: 0.95rem;
  font-weight: 400;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--akzent);
}

h2 + h3 { margin-top: 0; }

/* --- Fließtext ----------------------------------------------------- */

p {
  margin: 0 0 1.35rem;
  hyphens: auto;
  overflow-wrap: break-word;
  text-wrap: pretty;
}

p:last-child { margin-bottom: 0; }

em { font-style: italic; }
strong { font-weight: 600; }

a {
  color: var(--tinte);
  text-decoration-color: var(--linie);
  text-underline-offset: 0.18em;
}

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

:focus-visible {
  outline: 1px solid var(--akzent);
  outline-offset: 3px;
}

/* --- Vorspann ------------------------------------------------------ */

.vorspann {
  padding: clamp(3rem, 9vw, 6rem) 0 clamp(2.5rem, 7vw, 4rem);
}

.lead {
  margin: 0;
  font-size: 1.12em;
  line-height: 1.75;
  text-align: center;
  text-wrap: balance;
  color: var(--tinte-matt);
}

/* --- Listen -------------------------------------------------------- */

.liste,
.literatur {
  margin: 0 0 1.35rem;
  padding: 0;
  list-style: none;
}

.liste li,
.literatur li {
  position: relative;
  margin-bottom: 0.55rem;
  padding-left: 1.4rem;
}

.liste li::before,
.literatur li::before {
  content: "—";
  position: absolute;
  left: 0;
  color: var(--akzent);
}

.literatur li { margin-bottom: 0.9rem; }

cite { font-style: italic; }

/* --- Definitionslisten --------------------------------------------- */

dl { margin: 0; }

dl + p { margin-top: 1.9rem; }

dt {
  margin-top: 1.9rem;
  font-size: 0.9rem;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: var(--akzent);
}

dt:first-of-type { margin-top: 0; }

dd {
  margin: 0.4rem 0 0;
  hyphens: auto;
}

/* --- Zitat --------------------------------------------------------- */

blockquote {
  margin: 3rem 0 0;
  padding: 2rem 0;
  border-top: 1px solid var(--linie-fein);
  border-bottom: 1px solid var(--linie-fein);
  text-align: center;
}

blockquote p {
  margin: 0 0 0.9rem;
  font-size: 1.12em;
  font-style: italic;
  text-align: center;
  line-height: 1.6;
}

blockquote footer {
  font-size: 0.8rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--tinte-matt);
}

blockquote footer cite { font-style: normal; }

/* --- Bilder -------------------------------------------------------- */

.bild {
  margin: 3rem 0 0;
}

.bild img {
  display: block;
  width: 100%;
  height: auto;
  filter: saturate(0.85);
}

figcaption {
  margin-top: 0.85rem;
  font-size: 0.85rem;
  line-height: 1.6;
  text-align: center;
  color: var(--tinte-matt);
}

/* --- Hinweiskasten ------------------------------------------------- */

.hinweis {
  margin-top: 3rem;
  padding: 1.75rem var(--rand);
  background: var(--papier-tief);
  border-top: 1px solid var(--linie);
  border-bottom: 1px solid var(--linie);
}

.hinweis h3 { margin-top: 0; }

.hinweis p { text-align: left; }

.hinweis ul {
  margin: 0;
  padding-left: 1.2rem;
}

.hinweis li { margin-bottom: 0.45rem; }

.hinweis li:last-child { margin-bottom: 0; }

/* --- Ausklappbare Fragen ------------------------------------------- */

details {
  border-bottom: 1px solid var(--linie-fein);
}

details:first-of-type { border-top: 1px solid var(--linie-fein); }

summary {
  position: relative;
  padding: 1.05rem 2rem 1.05rem 0;
  cursor: pointer;
  list-style: none;
}

summary::-webkit-details-marker { display: none; }

summary::after {
  content: "+";
  position: absolute;
  right: 0.2rem;
  top: 50%;
  transform: translateY(-50%);
  color: var(--akzent);
  font-size: 1.1rem;
  line-height: 1;
}

details[open] summary::after { content: "–"; }

details[open] summary { color: var(--akzent); }

details > p {
  margin: 0 0 1.3rem;
  color: var(--tinte-matt);
}

/* --- Unterseite mit rechtlichen Informationen ---------------------- */

.seiten-titel {
  margin: 0;
  text-align: center;
  font-size: clamp(1.9rem, 1.4rem + 2vw, 2.8rem);
  font-weight: 400;
  letter-spacing: 0.06em;
  line-height: 1.2;
  text-wrap: balance;
}

main.rechtliches > section:not(.vorspann) > h2::before { content: none; }

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

.fuss {
  margin-top: clamp(3rem, 8vw, 5rem);
  padding: clamp(3rem, 8vw, 4.5rem) var(--rand) 3rem;
  background: var(--papier-tief);
  border-top: 1px solid var(--linie);
  font-size: 0.9rem;
  line-height: 1.7;
  color: var(--tinte-matt);
}

.fuss-inhalt > section + section {
  margin-top: 3rem;
  padding-top: 3rem;
  border-top: 1px solid var(--linie-fein);
}

.fuss h2 {
  margin-bottom: 1.1rem;
  font-size: 0.85rem;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--akzent);
}

.fuss p { margin-bottom: 1rem; }

.fuss-links {
  max-width: var(--spalte);
  margin: 0 auto;
  text-align: center;
}

.fuss-links a {
  display: inline-block;
  margin: 0 0.7rem;
  padding: 0.3rem 0;
  font-size: 0.78rem;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  text-decoration: none;
  color: var(--tinte-matt);
}

.fuss-links a:hover { color: var(--tinte); }

.fuss-links + .fuss-schluss { margin-top: 2rem; }

.fuss-schluss {
  max-width: var(--spalte);
  margin: 3.5rem auto 0;
  text-align: center;
}

.fuss-schluss a {
  font-size: 0.78rem;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  text-decoration: none;
  color: var(--tinte-matt);
}

.fuss-schluss a:hover { color: var(--tinte); }

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

@media print {
  .navigation, .kopf-bild, .sprungmarke, .fuss-schluss, .kontakt-fenster { display: none; }
  body { background: #fff; color: #000; font-size: 11pt; }
  .kopf-text { position: static; color: #000; text-shadow: none; }
  .kopf { background: none; }
  .kontaktleiste { background: none; border: 0; }
  .kontaktleiste a, .kontakt-art { color: #000; }
  main > section { padding: 1.5rem 0; break-inside: avoid; }
  details[open] summary::after, summary::after { content: ""; }
  details > p { display: block; }
  a { text-decoration: none; }
}
