/* Darstellung der redaktionellen Inhaltsblöcke */

/* Lesespalte für freistehenden Text; in Beiträgen nutzt der Text die volle
   Beitragsspalte (siehe unten). */
.prose {
  max-width: 40rem;
}

.prose > * + * {
  margin-top: 1.35rem;
}

.prose p {
  color: var(--color-ink-700);
  line-height: 1.7;
}

.prose strong {
  color: var(--color-ink-900);
  font-weight: 650;
}

/* Kapitelüberschriften: eine Stufe unter den Sektionstiteln der Seite, damit
   die Hierarchie h1 > Sektionstitel > Kapitel > Unterkapitel lesbar bleibt. */
.prose h2 {
  font-size: clamp(1.75rem, 1.5rem + 1.05vw, 2.25rem);
  line-height: 1.2;
  margin-top: 3.25rem;
  margin-bottom: 0.5rem;
  text-wrap: balance;
}

.prose h3 {
  font-size: clamp(1.375rem, 1.25rem + 0.55vw, 1.625rem);
  line-height: 1.3;
  margin-top: 2.5rem;
  margin-bottom: 0.25rem;
}

.prose h4 {
  font-size: var(--text-fluid-base);
  line-height: 1.4;
  margin-top: 2rem;
  color: var(--color-primary-800);
}

.prose h2:first-child,
.prose h3:first-child,
.prose h4:first-child {
  margin-top: 0;
}

.prose ul,
.prose ol {
  padding-left: 0;
  list-style: none;
  display: grid;
  gap: 0.7rem;
}

/* Sehr lange Komposita und durch geschützte Leerzeichen verbundene Wortgruppen
   brechen auf schmalen Displays um, statt die Seite seitlich hinauszuschieben. */
.prose {
  overflow-wrap: break-word;
}

.prose ul > li,
.prose ol > li {
  min-width: 0;
}

.prose ul > li {
  position: relative;
  padding-left: 2rem;
  color: var(--color-ink-700);
  line-height: 1.65;
}

.prose ul > li::before {
  content: "";
  position: absolute;
  left: 0.15rem;
  top: 0.66em;
  width: 0.5rem;
  height: 0.5rem;
  border-radius: 2px;
  background: var(--color-accent-700);
  transform: rotate(45deg);
}

.prose ol {
  counter-reset: prose-ol;
}

.prose ol > li {
  position: relative;
  padding-left: 2.6rem;
  counter-increment: prose-ol;
  color: var(--color-ink-700);
  line-height: 1.65;
}

.prose ol > li::before {
  content: counter(prose-ol, decimal-leading-zero);
  position: absolute;
  left: 0;
  top: 0.05em;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 0.85em;
  color: var(--color-primary-500);
}

.prose a {
  color: var(--color-primary-600);
  text-decoration: underline;
  text-underline-offset: 3px;
}

.prose a:hover {
  color: var(--color-primary-800);
}

/* Blöcke, die die Textbreite verlassen dürfen */
.content-flow {
  display: grid;
  gap: 0;
}

/* Grid-Kinder dürfen standardmäßig nicht unter ihre Mindestbreite schrumpfen.
   Auf schmalen Displays hätten breite Blöcke (Bilder, Tabellen) die Seite sonst
   seitlich hinausgeschoben, statt sich anzupassen. */
.content-flow > * {
  min-width: 0;
}

.content-block + .content-block {
  margin-top: 1.6rem;
}

.content-block--gap {
  margin-top: 3.25rem;
}

.content-figure {
  margin-top: 2.5rem;
  margin-bottom: 2.5rem;
}

.content-figure img {
  height: auto;
  display: block;
  border-radius: var(--radius-card);
  background: var(--color-primary-50);
}

.content-figure:not(.content-figure--compact) img {
  width: 100%;
}

.content-figure figcaption {
  margin-top: 0.9rem;
  font-size: var(--text-fluid-xs);
  color: var(--color-ink-500);
}

.content-figure--plain img {
  border-radius: var(--radius-card);
  border: 1px solid var(--color-ink-200);
  background: #fff;
  object-fit: contain;
}

/* Kartenraster im Lesetext: zwei Spalten, damit Karten in der ruhigen
   Textbreite nicht zu schmalen Streifen zusammenfallen. */
.content-cards {
  display: grid;
  gap: 1.75rem;
  margin-block: 3.25rem;
}

@media (min-width: 700px) {
  .content-cards {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

.content-cards .card__title {
  font-size: var(--text-fluid-base);
}

@media (min-width: 700px) {
  .content-cards--odd > .card:last-child {
    grid-column: 1 / -1;
    flex-direction: row;
  }

  .content-cards--odd > .card:last-child .card__media {
    flex: 0 0 38%;
    aspect-ratio: auto;
  }

  .content-cards--odd > .card:last-child .card__body {
    justify-content: center;
  }
}

/* Kapitel: Die Kapitelmarke vor der Überschrift trennt sie voneinander,
   deshalb genügt ein knapper Abstand ohne Trennlinie. */
.content-section {
  padding-block: clamp(1.125rem, 0.85rem + 0.8vw, 1.75rem);
}

/* Innerhalb eines Kapitels: Grundabstand zwischen Lesetext und den breiten
   Bausteinen (Tafeln, Tabellen, Abbildungen). Eigene Außenabstände der
   Bausteine setzen sich durch; am Kapitelanfang und -ende trägt allein der
   Kapitelabstand. */
:where(.content-section) > * + * {
  margin-top: 1.75rem;
}

.content-section > :first-child {
  margin-top: 0;
}

.content-section > :last-child {
  margin-bottom: 0;
}

/* Themenseiten: Lesetext, Abbildungen, Bildbänder, Videos und Karten stehen
   in derselben Breite wie Verzeichnis, Tafeln, Tabellen und Rechner. */
.article-layout__main .prose {
  max-width: none;
}

/* Motive, die schon im Original schmaler als die Spalte sind, bleiben in
   ihrer eigenen Größe mittig; die Bildunterschrift folgt ihrer Breite. */
.content-section > .content-figure--compact {
  width: fit-content;
  max-width: 100%;
  margin-inline: auto;
}

.content-figure--compact img {
  max-width: 100%;
}

.content-section > .content-figure--compact figcaption {
  contain: inline-size;
}

.content-section > .partner-map {
  margin-block: 2.5rem;
}

/* Aufeinanderfolgende Bilder stehen nebeneinander statt untereinander. */
.figure-row {
  display: grid;
  gap: 1.25rem;
  margin-block: 2.5rem;
}

.figure-row > .content-figure {
  margin: 0;
}

.figure-row .content-figure img {
  aspect-ratio: 3 / 2;
  object-fit: cover;
}

@media (min-width: 640px) {
  .figure-row--2 {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .figure-row--3 {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

/* Kapitelmarke (siehe toc_mark_chapters()): eine Linie, die kräftig anläuft
   und zur Spalte hin ausklingt; am Beginn eines Teils davor dessen
   Bezeichnung. */
.chapter-mark {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin-bottom: clamp(0.9rem, 0.75rem + 0.5vw, 1.2rem);
  font-family: var(--font-display);
  line-height: 1;
}

.chapter-mark::after {
  content: "";
  flex: 1;
  min-width: 2rem;
  height: 2px;
  border-radius: 1px;
  background: linear-gradient(
    90deg,
    var(--color-primary-600) 0,
    var(--color-primary-400) 4rem,
    var(--color-primary-200) 100%
  );
}

.chapter-mark__part {
  flex: none;
  padding: 0.55rem 0.85rem;
  border: 1px solid var(--color-primary-200);
  border-radius: 999px;
  background: var(--color-primary-50);
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--color-primary-700);
}

.content-section--wide .prose {
  max-width: none;
}

/* Infokasten: hebt Hinweise und Tipps aus dem Lesetext heraus, ohne die
   Überschriften-Hierarchie zu belasten – die Kastenüberschrift ist ein
   Absatz, keine Headline. Zwei Ausprägungen: Hinweis (Navy) und Tipp (Olive). */
.prose .infobox {
  margin-block: 2.5rem;
  padding: clamp(1.35rem, 1.05rem + 0.8vw, 1.85rem)
    clamp(1.25rem, 0.95rem + 1vw, 1.95rem);
  border: 1px solid color-mix(in oklch, var(--color-primary-600) 14%, transparent);
  border-left: 3px solid var(--color-primary-600);
  border-radius: 0 var(--radius-card) var(--radius-card) 0;
  background-color: var(--color-primary-50);
  background-image: linear-gradient(
    155deg,
    var(--color-primary-50) 0%,
    var(--color-surface-50) 100%
  );
}

.prose .infobox__title {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  margin: 0 0 0.85rem;
  font-family: var(--font-display);
  font-size: var(--text-fluid-sm);
  font-weight: 700;
  line-height: 1.3;
  letter-spacing: -0.01em;
  color: var(--color-primary-900);
}

.prose .infobox__title svg {
  flex: none;
  color: var(--color-primary-600);
}

.prose .infobox__body > * + * {
  margin-top: 1.15rem;
}

.prose .infobox__body p {
  font-size: var(--text-fluid-sm);
  line-height: 1.75;
}

.prose .infobox--tip {
  border-color: color-mix(in oklch, var(--color-accent-700) 30%, transparent);
  border-left-color: var(--color-accent-700);
  background-color: var(--color-accent-200);
  background-image: linear-gradient(
    155deg,
    var(--color-accent-200) 0%,
    var(--color-surface-50) 100%
  );
}

.prose .infobox--tip .infobox__title svg {
  color: var(--color-accent-700);
}

/* Im aufgeklappten Akkordeon sitzt der Kasten enger am umgebenden Text. */
.accordion__panel .infobox {
  margin-block: 1.75rem;
}

/* Beitragsende: Hinweis „Bevorzugte Quelle bei Google“ */
.preferred-source {
  margin-top: clamp(1.25rem, 1rem + 0.8vw, 2rem);
  font-size: var(--text-fluid-sm);
  font-style: italic;
  line-height: 1.7;
  color: var(--color-ink-600);
}

.preferred-source p {
  margin: 0;
}

.preferred-source a {
  font-weight: 700;
  color: var(--color-primary-600);
  text-decoration: underline;
  text-decoration-color: color-mix(in oklch, var(--color-primary-600) 35%, transparent);
  text-underline-offset: 3px;
}

.preferred-source a:hover {
  color: var(--color-primary-800);
  text-decoration-color: currentColor;
}

.preferred-source a svg {
  display: inline-block;
  margin-left: 0.3rem;
  vertical-align: -0.2em;
  transition: transform 0.18s ease;
}

.preferred-source a:hover svg {
  transform: translateX(3px);
}

@media (prefers-reduced-motion: reduce) {
  .preferred-source a svg {
    transition: none;
  }
}
