/* Einzelner Beitrag (Prinzip stripe.dev/blog: großer Titel, Metadaten in einer
   Sticky-Spalte links, Text rechts), im Ceeju-Look. Braucht style.css. */

.post {
  max-width: var(--header-max-width);
  margin: 0 auto;
  padding: 48px var(--site-gutter) 6rem;
}

/* ---------- Titel und Beitragsbild ---------- */

.post-title {
  max-width: 14em;
  overflow-wrap: break-word;
  hyphens: auto;
}

/* Teaser als Einleitung unter dem Bild: mobil ca. 19 px, Desktop bis 24 px */
.post-lead {
  max-width: 40rem;
  margin: 0 0 32px;
  font-size: clamp(1.3rem, 0.9rem + 0.8vw, 1.6rem);
  line-height: 1.35;
}

.post-media { margin: 0 0 32px; }
.post-media img {
  display: block;
  width: 100%;
  aspect-ratio: 16 / 9;
  object-fit: cover;
  border-radius: 12px;
  background: var(--gray-light);
}

/* ---------- Spalte mit Metadaten ---------- */

.post-layout { margin-top: 40px; }

.post-aside { font-size: 13px; line-height: 1.5; }
.post-aside__head { display: none; }

.post-meta {
  display: grid;
  grid-template-columns: 7.5rem 1fr;
  margin: 0 0 32px;
  border-top: 1px solid var(--primary);
}
.post-meta dt,
.post-meta dd {
  margin: 0;
  padding: 10px 0;
  border-bottom: 1px solid var(--gray-light);
}
.post-meta dt { color: var(--gray-dark); }
.post-meta a { text-underline-offset: 3px; }
.post-meta a:hover,
.post-meta a:focus { text-decoration: none; }

/* Schlagwörter als kleine Pillen */
.post-tags { display: flex; flex-wrap: wrap; gap: 6px; }
.post-tags a {
  padding: 1px 10px;
  border: 1px solid var(--primary);
  border-radius: 999px;
  text-decoration: none;
}
.post-tags a:hover,
.post-tags a:focus { background: var(--primary); color: var(--secondary); }

.post-toc__label { margin: 0 0 6px; color: var(--gray-dark); }
.post-toc ol { margin: 0 0 32px; padding: 0; list-style: none; }
.post-toc li { padding: 3px 0; }
.post-toc a { text-decoration: none; }
.post-toc a:hover,
.post-toc a:focus { text-decoration: underline; text-underline-offset: 3px; }

/* Mobil: Inhaltsverzeichnis und Zurück-Link sind am Ende genug */
.post-toc,
.post-aside__back { display: none; }

/* Link-Button mit Pfeil nach links davor (Lucide arrow-left), Hover rückt 4 px nach links */
.btn-link--back::after { content: none; }
.btn-link--back::before {
  content: "";
  position: relative;
  top: -1px;
  width: 16px;
  height: 16px;
  background: currentColor;
  mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M19 12H7M11 6l-6 6 6 6'/%3E%3C/svg%3E") center / 16px 16px no-repeat;
  transition: transform 0.2s ease;
}
.btn-link--back:hover::before,
.btn-link--back:focus::before { transform: translateX(-4px); }

/* Ankerlinks weich anfahren (bei reduzierter Bewegung nicht) */
@media (prefers-reduced-motion: no-preference) {
  html { scroll-behavior: smooth; }
}

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

/* ca. 70 Zeichen pro Zeile */
.post-body {
  max-width: 40rem;
  font-size: 17px;
  line-height: 1.65;
}
.post-body > * { margin: 0 0 1.1em; }


.post-body :is(h2, h3, h4) { scroll-margin-top: 110px; }
.post-body h2 { margin-top: 2.2em; }
.post-body :is(h3, h4) { margin-top: 1.8em; margin-bottom: 0.5em; }

.post-body :is(ul, ol) { padding-left: 1.3em; }
.post-body li { margin-bottom: 0.35em; }
.post-body li::marker { color: var(--gray-dark); }

.post-body a { text-underline-offset: 3px; }
.post-body a:hover,
.post-body a:focus { text-decoration: none; }

.post-body blockquote {
  margin: 2em 0;
  padding-left: 1.2em;
  border-left: 2px solid var(--primary);
}
.post-body blockquote p {
  margin: 0 0 0.5em;
  font-size: 1.3em;
  line-height: 1.4;
}
.post-body cite { font-size: 13px; font-style: normal; color: var(--gray-dark); }

.post-body figure { margin: 2em 0; }
.post-body figure :is(img, video) {
  display: block;
  width: 100%;
  height: auto;
  aspect-ratio: 16 / 9;
  object-fit: cover;
  border-radius: 12px;
  background: var(--gray-light);
}
.post-body figcaption { margin-top: 8px; font-size: 13px; color: var(--gray-dark); }

/* ---------- Ende: zurück und weitere Beiträge ---------- */

.post-end {
  margin-top: 4em;
  padding-top: 24px;
  border-top: 1px solid var(--primary);
}
.post-body .post-end__label { margin: 2.5em 0 0.6em; }
.post-body .post-more { margin: 0; padding: 0; list-style: none; }
.post-body .post-more li { margin: 0; border-bottom: 1px solid var(--gray-light); }
.post-more a {
  display: block;
  padding: 12px 0;
  text-decoration: none;
}
.post-more a:hover,
.post-more a:focus { text-decoration: underline; }
.post-more span { display: block; font-size: 13px; color: var(--gray-dark); }

/* ---------- Desktop: zwei Spalten, links sticky ---------- */

@media (min-width: 1024px) {
  /* Bild und Text rechts, Metadaten links über die ganze Höhe */
  .post-layout {
    display: grid;
    grid-template-columns: minmax(240px, 1fr) minmax(0, 2fr);
    column-gap: 4rem;
    align-items: start;
  }
  .post-lead,
  .post-media,
  .post-body { grid-column: 2; }
  .post-lead { margin-bottom: 48px; }

  .post-aside {
    grid-column: 1;
    grid-row: 1 / span 3;
    position: sticky;
    top: 110px; /* unter Header und schwarzer Leiste */
    max-height: calc(100vh - 130px);
    overflow-y: auto;
    /* overflow-y: auto schneidet auch seitlich ab: Platz links, damit der Pfeil von „Zurück zum Blog“ beim Hover
       (4 px nach links) und der Fokusrahmen nicht angeschnitten werden; Inhalt bleibt an derselben Stelle
       (Karte „Abnahme – Hallo Welt“, Runde „Pfeil beim Hover nicht anschneiden“, Alex/MacBook, 18.11.2026) */
    margin-left: -6px;
    padding-left: 6px;
  }
  .post-aside__back { display: inline-flex; margin: 0 0 32px; } /* unter den Metadaten */

  /* Kleiner Titel: zu (0fr), bis der große weg ist; dann klappt er auf und schiebt
     die Metadaten weich nach unten, der Titel gleitet 10 px von oben herein. */
  .post-aside__head {
    display: grid;
    grid-template-rows: 0fr;
    transition: grid-template-rows 0.2s ease;
  }
  .post-aside__head > div { min-height: 0; overflow: hidden; }
  .post-aside__title {
    margin: 0 0 20px;
    opacity: 0;
    transform: translateY(-10px);
    transition: opacity 0.15s ease, transform 0.15s ease;
  }
  .title-out .post-aside__head {
    grid-template-rows: 1fr;
    transition: grid-template-rows 0.45s cubic-bezier(0.22, 1, 0.36, 1);
  }
  .title-out .post-aside__title {
    opacity: 1;
    transform: none;
    transition: opacity 0.25s ease 0.15s, transform 0.3s ease-out;
  }

  /* Am Desktop steht „Zurück zum Blog“ nur in der Spalte unter den Metadaten */
  .post-end__back { display: none; }
  .post-body .post-end__label { margin-top: 0; }

  .post-toc:not([hidden]) { display: block; }
}

/* ---------- Laufbreite wie Insights (alle Beiträge) ----------
   Karte „Blog – Insights-Template“, 16.11.2026 (Alex/iMac). Ruben: „… ist das schon überall auf allen anderen
   Blogbeiträgen so umgesetzt, auch von der Textbreite unten, wenn nein, dann bitte mal anwenden“.
   Projekt-, Event- und Insights-Beiträge haben jetzt dieselbe Laufbreite (vorher nur Insights, insights-beitrag.css
   Abschnitt 5 und 6). Ab 1024 px: Fließtext (Absätze, Listen) und das Ende des Beitrags (post-end, z. B.
   „Weitere Events“) höchstens 720 px bei 18 px; Zwischenüberschriften, Bilder, Videos, Tabellen und übrige Blöcke
   über die ganze rechte Spalte; Vorspann und Zitate höchstens 900 px; Hochformat-Bilder 600 px.
   Unter 1024 px gilt weiter das obige (600 px bei 17 px). */
@media (min-width: 1024px) {
  .post-body { max-width: none; font-size: 18px; }
  .post-body > :is(p, ul, ol, dl, .post-end) { max-width: 48rem; }
  .post-lead,
  .post-body blockquote { max-width: 60rem; }
  .post-body figure.bild-hoch { max-width: 40rem; }
}

/* Tabellen im Text: schlichte Form, Kopfzeile mit dunkler Linie, Zeilen mit heller Linie, 15 px (aus insights-beitrag.css). */
.post-body table { width: 100%; margin: 2em 0; border-collapse: collapse; font-size: 15px; line-height: 1.45; }
.post-body :is(th, td) { padding: 10px 24px 10px 0; text-align: left; vertical-align: top; border-bottom: 1px solid var(--gray-light); }
.post-body th { font-weight: 500; border-bottom-color: var(--primary); }
.post-body :is(th, td):last-child { padding-right: 0; }

/* Plan Nr. 1 height auto */
/* Plan Website-Varianten Nr. 1 (18.11.2026, Alex/MacBook): Ohne height: auto nimmt der Browser die Hoehe aus dem
   height-Attribut, dann greift aspect-ratio nicht und das Bild wird verzerrt hoch. */
.post-media img { height: auto; }

/* Anreißer 1b (Rubens Wahl „teaser: 1b“, 19.11.2026, Alex/MacBook): auf allen Beitrags- und Projektseiten höchstens ca. 62 Zeichen je Zeile
   (max-width in ch folgt der Schriftgröße). Überschreibt die Breiten aus projekt-v1.css (48rem) und insights-beitrag.css (60rem). */
main.post.post:not(.ev) .post-lead { max-width: 62ch; }
