/* ==========================================================================
   Edition F — Typografie
   ========================================================================== */

/* --- Playfair Display (selbst gehostet, DSGVO-konform) ---
   WOFF2-Dateien unter assets/fonts/ ablegen.
   Download: https://fontsource.org/fonts/playfair-display
   ========================================================================== */

@font-face {
  font-family: 'Playfair Display';
  src: url('../fonts/PlayfairDisplay-Regular.woff2') format('woff2');
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: 'Playfair Display';
  src: url('../fonts/PlayfairDisplay-Italic.woff2') format('woff2');
  font-weight: 400;
  font-style: italic;
  font-display: swap;
}

@font-face {
  font-family: 'Playfair Display';
  src: url('../fonts/PlayfairDisplay-Bold.woff2') format('woff2');
  font-weight: 700;
  font-style: normal;
  font-display: swap;
}

/* --- Basis-Reset --- */

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

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

body {
  font-family: var(--font-sans);
  font-size: var(--text-base);
  line-height: var(--leading-normal);
  color: var(--color-text);
  background-color: var(--color-bg);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

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

h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-serif);
  font-weight: 700;
  line-height: var(--leading-tight);
  color: var(--color-text);
}

h1 { font-size: var(--text-4xl); }
h2 { font-size: var(--text-3xl); }
h3 { font-size: var(--text-2xl); }
h4 { font-size: var(--text-xl); }
h5 { font-size: var(--text-lg); }
h6 { font-size: var(--text-md); }

p {
  margin-bottom: var(--space-4);
  max-width: 72ch;
}

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

a {
  color: inherit;
  text-decoration: underline;
  text-decoration-color: var(--color-link-underline);
  text-underline-offset: 3px;
  transition: text-decoration-color var(--transition-fast);
}

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

/* --- Rubrik-Label (Eyebrow) --- */

.ef-eyebrow {
  display: block;
  font-family: var(--font-sans);
  font-size: var(--text-xs);
  font-weight: 600;
  letter-spacing: var(--tracking-wider);
  text-transform: uppercase;
  color: var(--color-text-muted);
  margin-bottom: var(--space-2);
  text-decoration: none;
}

/* Nur verlinkte Rubrik-Labels reagieren auf Hover – die Dachzeile ist ein <span> */
a.ef-eyebrow:hover {
  color: var(--color-accent);
  text-decoration: none;
}

/* --- Anzeige-Kennzeichnung (ef_get_eyebrow) ---
   Pflichtkennzeichnung fuer Werbung: gut sichtbar, schwarzes Label vor der Dachzeile. */

.ef-eyebrow-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--space-2);
  margin-bottom: var(--space-2);
}
.ef-eyebrow-row .ef-eyebrow { margin-bottom: 0; }

.ef-ad-label {
  display: inline-block;
  font-family: var(--font-sans);
  font-size: 0.625rem;
  font-weight: 700;
  line-height: 1;
  letter-spacing: var(--tracking-wide);
  text-transform: uppercase;
  color: var(--color-white);
  background: var(--color-black);
  border-radius: 999px;
  padding: 0.3em 0.75em;
}
html.ef-dark .ef-ad-label {
  color: var(--color-black);
  background: var(--color-white);
}

/* --- Teaser-Text --- */

.ef-teaser {
  font-size: var(--text-sm);
  line-height: var(--leading-relaxed);
  color: var(--color-text-light);
  margin-bottom: var(--space-4);
}

/* --- Weiterlesen-Button (lila pill wie Live-Seite) --- */

.ef-read-more,
a.button,
.wp-block-button__link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  align-self: flex-start;
  width: fit-content;
  max-width: 100%;
  font-size: var(--text-sm);
  font-weight: 500;
  text-decoration: none;
  color: var(--color-black);
  background-color: var(--color-accent-berry);
  padding: var(--space-2) var(--space-5);
  border-radius: 100px;
  transition: background-color var(--transition-fast), color var(--transition-fast);
}

.ef-read-more:visited,
a.button:visited,
.wp-block-button__link:visited {
  color: var(--color-black);
}

.ef-read-more:hover,
a.button:hover,
.wp-block-button__link:hover,
.ef-read-more:focus-visible,
a.button:focus-visible,
.wp-block-button__link:focus-visible {
  background-color: var(--color-black);
  text-decoration: none;
  color: var(--color-white);
}

/* --- Artikel-Body --- */

.ef-content {
  font-size: var(--text-md);
  line-height: var(--leading-relaxed);
  max-width: var(--max-width-content);
}

.ef-single__body.ef-content { max-width: var(--max-width-reading); }

.ef-content p { margin-bottom: var(--space-6); max-width: unset; }

.ef-content h2 { font-size: var(--text-2xl); margin-top: var(--space-12); margin-bottom: var(--space-4); }
.ef-content h3 { font-size: var(--text-xl);  line-height: var(--leading-snug); margin-top: var(--space-8);  margin-bottom: var(--space-3); }

/* Zitate: EINE Optik fuer alle Varianten -- Gutenberg-Zitat (inkl. Stil
   "Gross"/"Schlicht" und Textausrichtung), Pullquote, klassisches
   <blockquote> aus dem Alt-WP und Pimcore-Zitate mit <cite>. Die Core-
   Block-Styles (zentriert, Rahmen oben/unten, rechter Balken ...) werden
   dafuer bewusst ueberschrieben. Social-Embeds (TikTok/X/Instagram) kommen
   ebenfalls als <blockquote> und bleiben aussen vor. */
.ef-content blockquote:not(.tiktok-embed, .twitter-tweet, .instagram-media),
.ef-content .wp-block-quote.wp-block-quote {
  font-family: var(--font-serif);
  font-style: italic;
  font-size: var(--text-xl);
  line-height: var(--leading-snug);
  text-align: left;
  border: none;
  border-left: 3px solid var(--color-accent);
  padding: 0 0 0 var(--space-6);
  margin: var(--space-10) 0;
  color: var(--color-text);
}

.ef-content blockquote:not(.tiktok-embed, .twitter-tweet, .instagram-media) p,
.ef-content .wp-block-quote.wp-block-quote p,
.ef-content .wp-block-pullquote.wp-block-pullquote p {
  font-size: inherit;
  font-style: inherit;
  line-height: inherit;
  margin: 0;
}

/* Abstand nur ZWISCHEN echten Absaetzen -- so sitzt der rote Balken
   buendig mit der letzten Textzeile, auch wenn leere <p> folgen. */
.ef-content blockquote:not(.tiktok-embed, .twitter-tweet, .instagram-media) p:not(:empty) ~ p:not(:empty),
.ef-content .wp-block-quote.wp-block-quote p:not(:empty) ~ p:not(:empty) { margin-top: var(--space-4); }

/* Pullquote: <figure class="wp-block-pullquote"><blockquote>...</blockquote></figure>
   Die figure wird zur neutralen Huelle, die Optik traegt das blockquote. */
.ef-content .wp-block-pullquote {
  text-align: left;
  border: none;
  padding: 0;
  margin: var(--space-10) 0;
  background: none;
  color: var(--color-text);
  max-width: none;
  float: none;
}

.ef-content .wp-block-pullquote blockquote { margin: 0; max-width: none; }

/* Autor:in: abgesetzt als kleine Eyebrow-Zeile (wie die Kategorie-Labels)
   mit rotem Strich davor -- ruhig, damit das Zitat selbst die Buehne hat. */
.ef-content blockquote cite,
.ef-content blockquote footer,
.ef-content .wp-block-quote.wp-block-quote cite,
.ef-content .wp-block-quote.wp-block-quote footer,
.ef-content .wp-block-pullquote.wp-block-pullquote cite,
.ef-content .wp-block-pullquote__citation {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  margin-top: var(--space-4);
  font-family: var(--font-sans);
  font-style: normal;
  font-size: var(--text-xs);
  font-weight: 600;
  line-height: var(--leading-normal);
  letter-spacing: var(--tracking-wider);
  text-transform: uppercase;
  text-align: left;
  color: var(--color-text-light);
}

.ef-content blockquote cite::before,
.ef-content blockquote footer::before,
.ef-content .wp-block-pullquote cite::before,
.ef-content .wp-block-pullquote__citation::before {
  content: "";
  flex: 0 0 var(--space-8);
  height: 1px;
  background-color: var(--color-accent);
}

/* Klassischer Inhalt (ohne Bloecke): wpautop() packt die <cite> in ein
   eigenes <p> -- dessen Abstand reicht, sonst verdoppelt er sich. */
.ef-content blockquote p > cite { margin-top: 0; }

/* Leerer Absatz zwischen Zitat und <cite> (Pimcore-Import haengt oft ein
   <p></p> an) soll keinen Extra-Abstand erzeugen. */
.ef-content blockquote p:empty { display: none; }

/* Verschachtelte Zitate (z. B. durch fehlerhaft importiertes/eingefuegtes
   HTML mit blockquote-in-blockquote) sollen die Rahmen/Abstands-Optik
   nicht mit jeder Ebene erneut addieren -- sonst bleibt kaum noch Breite
   fuer den Text (mehrere schmale Balken statt lesbarem Zitat). */
.ef-content blockquote blockquote:not(.tiktok-embed, .twitter-tweet, .instagram-media) {
  border-left: none;
  padding-left: 0;
  margin: 0;
}

/* Link-Karte (ef_link_card: Instagram, interne Embeds, Tidal): WP bettet Instagram
   nicht mehr ein, statt grauer Platzhalter oder nackter URL ein ruhiger
   Kasten im Stil der Zitate, Eyebrow-Label + roter Pfeil-Link. */
.ef-content .ef-link-card { margin: var(--space-8) 0; max-width: 540px; }

.ef-content .ef-link-card a {
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
  padding: var(--space-5) var(--space-6);
  border: var(--border-thin);
  border-left: 3px solid var(--color-accent);
  border-radius: var(--radius-sm);
  background: var(--color-bg-alt);
  color: var(--color-text);
  font-family: var(--font-sans);
  text-decoration: none;
  transition: border-color var(--transition-fast);
}

.ef-content .ef-link-card a:hover,
.ef-content .ef-link-card a:focus-visible { border-color: var(--color-accent); }

.ef-link-card__label {
  font-size: var(--text-xs);
  font-weight: 600;
  letter-spacing: var(--tracking-wider);
  text-transform: uppercase;
  color: var(--color-text-light);
}

.ef-link-card__account { font-weight: 600; font-size: var(--text-base); }

.ef-link-card__caption {
  font-size: var(--text-sm);
  line-height: var(--leading-normal);
  color: var(--color-text-muted);
}

.ef-link-card__cta {
  font-size: var(--text-sm);
  font-weight: 600;
  color: var(--color-accent);
}

.ef-link-card__cta::after { content: " →"; }

.ef-content ul,
.ef-content ol { padding-left: var(--space-6); margin-bottom: var(--space-6); }

.ef-content li { margin-bottom: var(--space-2); line-height: var(--leading-relaxed); }

.ef-content img { width: 100%; height: auto; display: block; margin: var(--space-8) 0; }

.ef-content figure { margin: var(--space-8) 0; }

/* Bild selbst braucht innerhalb der figure keinen eigenen Abstand mehr --
   sonst addiert er sich zur figure-Margin und die Caption rutscht zu weit
   vom Bild weg (nur noch figcaption margin-top bestimmt den Abstand). */
.ef-content figure img { margin: 0; }

/* <h5> ist im Alt-WP fast immer Bildunterschrift/Quelle ("Foto: …",
   "Kommentar einer Leserin"), echte h5-Zwischenüberschriften gibt es nicht.
   Daher wie figcaption, direkt unter dem Bild. */
.ef-content h5 {
  font-family: var(--font-sans);
  font-size: var(--text-xs);
  font-weight: 400;
  line-height: var(--leading-normal);
  color: var(--color-text-muted);
  margin: var(--space-2) 0 var(--space-6);
}

/* direkt unter einem Bild: an das Bild heranrücken (Bild hat unten --space-8) */
.ef-content p:has(> img, > a > img) + h5,
.ef-content img + h5 { margin-top: calc(var(--space-6) * -1); }

.ef-content figcaption {
  font-size: var(--text-xs);
  color: var(--color-text-muted);
  margin-top: var(--space-2);
  font-style: italic;
}

/* --- Screenreader-Hilfsklasse --- */

.ef-sr-only {
  position: absolute;
  width: 1px; height: 1px;
  padding: 0; margin: -1px;
  overflow: hidden;
  clip: rect(0,0,0,0);
  white-space: nowrap;
  border: 0;
}
