/* Artikel – Präfix ar-
   Gemeinsames Stylesheet für alle Blogartikel und Anwenderberichte (/<artikel>/), nicht für /blog/ selbst.
   Aufbau: Seitenkopf (.page-hero mit Brotkrumen, H1, Einleitung, Thema/Datum/Lesezeit, Artikelbild),
   Text (.ar-prose) mit Inhaltsverzeichnis (.ar-toc), hervorgehobene Kästen (.ar-callout),
   „Weitere Artikel“ (.posts/.post-card aus style.css) und Abschluss-CTA (.final-cta aus style.css).
   Baut auf style.css auf. Mobile first, Breakpoints wie style.css (480/640/768/1024/1200). */

/* ---------- Seitenkopf ---------- */

/* Artikeltitel sind länger als Seitentitel: etwas kleiner als .page-hero__title */
.ar-hero__title { font-size: clamp(2rem, 1.3rem + 2.6vw, 3.125rem); line-height: 1.1; }

/* Thema (Link zum gefilterten Blog), Datum, Lesezeit */
.ar-meta {
  display: flex; flex-wrap: wrap; align-items: center; gap: .6rem 1rem;
  margin-top: 1.5rem; color: var(--muted); font-size: .9375rem; font-weight: 700; line-height: 1.4;
}
.ar-meta__cat {
  display: inline-flex; align-items: center; min-height: 32px; padding: .3rem .85rem;
  border: 1px solid #cfeae6; border-radius: 99px; background: var(--accent-50);
  color: var(--accent-700); font-size: .8125rem; letter-spacing: .08em; text-decoration: none; text-transform: uppercase;
  transition: background-color .2s, border-color .2s;
}
.ar-meta__cat:hover { border-color: var(--accent-700); background: var(--white); }
/* Datum und Lesezeit bleiben zusammen; bricht die Zeile um, rutschen beide unter das Thema */
.ar-meta__info { display: inline-flex; flex-wrap: wrap; align-items: center; gap: .3rem .9rem; }
.ar-meta__info > * + * { display: inline-flex; align-items: center; gap: .9rem; }
.ar-meta__info > * + *::before { content: ""; width: 4px; height: 4px; flex: none; border-radius: 50%; background: var(--lavender); }

/* Artikelbild: Headerbild von www (937 × 400, enthält Text) ganz zeigen, gerahmt wie die übrigen Seitenkopf-Bilder */
.ar-hero-media { position: relative; isolation: isolate; margin: 0; }
.ar-hero-media::before {
  content: ""; position: absolute; z-index: -1; inset: -14% -6%;
  border-radius: 50%;
  background: radial-gradient(closest-side, rgba(38, 166, 154, .2), rgba(0, 73, 148, .07) 62%, transparent);
}
.ar-hero-media__img {
  width: 100%; height: auto;
  border-radius: var(--radius-l); background: var(--tile-2); box-shadow: var(--shadow-l);
}

/* ---------- Text und Inhaltsverzeichnis ---------- */

.ar-body { padding: clamp(.5rem, 2vw, 1.5rem) 0 clamp(4rem, 9vw, 6.5rem); }
.ar-layout { display: grid; gap: 2rem; }

/* Inhaltsverzeichnis: bis 1023 px als Kasten über dem Text, ab 1024 px rechts mitlaufend */
.ar-toc {
  width: 100%; max-width: 42rem; padding: 1.25rem 1.4rem 1.35rem;
  border-radius: var(--radius); background: var(--tile); box-shadow: var(--shadow-s);
}
/* Kopfzeile ist das <summary>: bis 1023 px zum Auf- und Zuklappen (Pfeil), ab 1024 px immer offen (js/artikel.js) */
.ar-toc__title {
  display: flex; align-items: center; gap: .65rem; min-height: 44px; margin: -.5rem 0; padding: .5rem 0;
  color: var(--primary); font-size: .8125rem; font-weight: 900; letter-spacing: .12em; line-height: 1.4; text-transform: uppercase;
  cursor: pointer; list-style: none;
}
.ar-toc__title::-webkit-details-marker { display: none; }
.ar-toc__title::before { content: ""; width: 32px; height: 5px; flex: none; border-radius: 99px; background: var(--gradient); }
.ar-toc__chevron { width: 14px; height: 14px; margin-left: auto; transition: transform .25s var(--ease); }
.ar-toc__details[open] .ar-toc__chevron { transform: rotate(180deg); }
.ar-toc__details[open] .ar-toc__title { margin-bottom: .25rem; }
.ar-toc__list { display: grid; gap: .1rem; }
.ar-toc__list a {
  display: block; padding: .45rem .75rem; border-left: 3px solid var(--line); border-radius: 0 6px 6px 0;
  color: var(--text); font-size: .9375rem; font-weight: 700; line-height: 1.4; text-decoration: none; text-wrap: pretty;
  transition: border-color .2s, background-color .2s, color .2s;
}
.ar-toc__list a:hover { border-left-color: var(--accent); background: var(--bg); color: var(--primary); }

/* Autorin bzw. Autor unter dem Text (Andrea Tissen, 2026-10-15): Name, Foto und Bereich wie auf /ueber-uns/ */
.ar-prose .ar-author {
  display: flex; align-items: center; gap: 1.1rem;
  margin-top: clamp(2.5rem, 6vw, 3.25rem); padding: 1.25rem 1.4rem;
  border-radius: var(--radius); background: var(--tile); box-shadow: var(--shadow-s);
}
.ar-author__img { width: 88px; height: 88px; flex: none; border-radius: 50%; object-fit: cover; }
.ar-author__body { min-width: 0; line-height: 1.45; }
.ar-prose .ar-author__body > * + * { margin-top: .15rem; }
.ar-author__label { color: var(--muted); font-size: .8125rem; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; }
.ar-author__name { color: var(--ink); font-size: 1.1875rem; font-weight: 900; }
.ar-author__role { color: var(--muted); font-size: .9375rem; }
.ar-prose .ar-author__link { margin-top: .5rem; font-size: .9375rem; text-decoration: none; }

/* Fließtext: angenehme Zeilenlänge (max. ~75 Zeichen) und Zeilenhöhe */
.ar-prose { min-width: 0; max-width: 42rem; line-height: 1.75; overflow-wrap: break-word; }
.ar-prose > * + * { margin-top: 1.25rem; }
/* Buttons im Text (von www übernommen) haben teils lange Beschriftungen: umbrechen statt über den Rand laufen */
.ar-prose .btn { max-width: 100%; white-space: normal; text-align: center; text-decoration: none; }
.ar-prose .btn--cta { color: var(--white); }
.ar-prose h2 {
  margin-top: clamp(2.75rem, 6vw, 3.5rem);
  font-size: clamp(1.5rem, 1.2rem + 1.2vw, 2rem); line-height: 1.2;
}
.ar-prose h2::before { content: ""; display: block; width: 48px; height: 5px; margin-bottom: 1rem; border-radius: 99px; background: var(--gradient); }
.ar-prose h3 { margin-top: 2.25rem; font-size: clamp(1.1875rem, 1.1rem + .4vw, 1.375rem); line-height: 1.3; }
.ar-prose h2 + *, .ar-prose h3 + * { margin-top: .9rem; }
.ar-prose a { color: var(--primary); font-weight: 700; text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: 3px; }
.ar-prose a:hover { text-decoration-thickness: 2px; }
.ar-prose em { font-style: italic; }

/* Listen: Punkte laut CD (türkiser Kreis, weißer Haken), nummerierte Listen mit Zahl im Kreis */
.ar-prose ul, .ar-prose ol { display: grid; gap: .6rem; }
.ar-prose ul > li, .ar-prose ol > li { position: relative; padding-left: 2.1rem; text-wrap: pretty; }
.ar-prose ul > li::before {
  content: ""; position: absolute; left: 0; top: .25em; width: 1.35rem; height: 1.35rem; border-radius: 50%;
  background: var(--accent) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 448 512'%3E%3Cpath fill='%23fff' d='M438.6 105.4c12.5 12.5 12.5 32.8 0 45.3l-256 256c-12.5 12.5-32.8 12.5-45.3 0l-128-128c-12.5-12.5-12.5-32.8 0-45.3s32.8-12.5 45.3 0L160 338.7 393.4 105.4c12.5-12.5 32.8-12.5 45.3 0z'/%3E%3C/svg%3E") center / .7rem no-repeat;
}
.ar-prose ol { counter-reset: ar-ol; }
.ar-prose ol > li { counter-increment: ar-ol; }
.ar-prose ol > li::before {
  content: counter(ar-ol); position: absolute; left: 0; top: .2em;
  display: grid; place-items: center; width: 1.45rem; height: 1.45rem; border-radius: 50%;
  background: var(--tile-2); color: var(--primary); font-size: .8125rem; font-weight: 900; line-height: 1;
}

/* Liste mit Emojis statt Punkten (wie im Original) */
.ar-prose .ar-emoji-list > li { padding-left: 2.25rem; }
.ar-prose .ar-emoji-list > li::before { content: none; }
.ar-emoji-list__icon { position: absolute; left: 0; top: 0; font-size: 1.15em; line-height: inherit; }

/* Einzelner Kernsatz (im Original ein eigener fetter Absatz) */
.ar-key { padding: .2rem 0 .2rem 1.1rem; border-left: 4px solid var(--accent); font-size: 1.0625em; line-height: 1.55; }

/* Zitate (für Anwenderberichte und weitere Artikel) */
.ar-prose blockquote {
  margin-inline: 0; padding: 1.25rem 1.4rem; border-left: 4px solid var(--primary); border-radius: 0 var(--radius) var(--radius) 0;
  background: var(--tile); box-shadow: var(--shadow-s); color: var(--ink); font-size: 1.0625em; line-height: 1.6;
}
.ar-prose blockquote > * + * { margin-top: .75rem; }
.ar-prose blockquote cite { display: block; color: var(--muted); font-size: .875rem; font-style: normal; font-weight: 700; }
/* Kundenzitat aus Anwenderberichten (www: Testimonial) mit rundem Porträt */
.ar-prose .ar-quote { display: grid; grid-template-columns: auto minmax(0, 1fr); column-gap: 1.1rem; align-items: start; }
.ar-prose .ar-quote > :not(.ar-quote__img) { grid-column: 2; }
.ar-prose .ar-quote > .ar-quote__img + * { margin-top: 0; }
.ar-quote__img { grid-row: span 3; width: 64px; height: 64px; border-radius: 50%; object-fit: cover; }
.ar-prose .ar-quote:not(:has(.ar-quote__img)) { display: block; }

/* Bilder im Text (für weitere Artikel) */
.ar-prose figure { margin-inline: 0; }
.ar-prose figure img, .ar-prose > img { width: 100%; border-radius: var(--radius); box-shadow: var(--shadow-s); }
.ar-prose figcaption { margin-top: .6rem; color: var(--muted); font-size: .875rem; line-height: 1.5; }

/* Video zum Thema (YouTube, lädt erst nach Einwilligung; .video aus style.css). Meist Videos anderer Kanäle:
   Platzhalter als Verlaufsfläche statt des Standbilds unseres eigenen Videos */
.ar-prose .ar-video { max-width: none; margin-inline: 0; }
.ar-prose .ar-video .lpc-platzhalter { padding: 1.5rem; background: var(--gradient-diag); }
@media (min-width: 640px) {
  .ar-prose .ar-video .lpc-platzhalter { align-content: center; padding: clamp(1.5rem, 3vw, 2.25rem); background: var(--gradient-diag); }
}

/* Artikel ohne Titelbild: Verlaufsfläche statt Bild */
.ar-hero-media--leer { aspect-ratio: 937 / 400; border-radius: var(--radius-l); background: var(--gradient); box-shadow: var(--shadow-l); }

/* Tabellen (für weitere Artikel): im Wrapper .ar-table seitlich scrollbar statt gequetscht */
.ar-table { overflow-x: auto; border-radius: var(--radius); background: var(--tile); box-shadow: var(--shadow-s); }
.ar-table table { width: 100%; border-collapse: collapse; font-size: .9375rem; line-height: 1.5; }
.ar-table th, .ar-table td { padding: .7rem 1rem; border-bottom: 1px solid var(--line); text-align: left; vertical-align: top; }
.ar-table th { background: var(--tile-2); color: var(--ink); font-weight: 900; }

/* Hervorgehobener Kasten (auf www blaue Box mit Aufforderung): Verlauf wie Newsletter-Kasten */
.ar-prose .ar-callout {
  position: relative; isolation: isolate; overflow: hidden;
  margin-block: 2.25rem; padding: clamp(1.5rem, 4vw, 2.25rem);
  border-radius: var(--radius-l); background: var(--gradient); color: rgba(255, 255, 255, .92); box-shadow: var(--shadow-l);
  line-height: 1.6;
}
.ar-callout::after {
  content: ""; position: absolute; z-index: -1; right: 0; bottom: 0; width: 100%; height: 100%;
  background: url("../assets/img/deco-netz-weiss.webp") right bottom / contain no-repeat; opacity: .12;
}
.ar-callout > * + * { margin-top: 1rem; }
.ar-prose .ar-callout h3 { margin-top: 0; color: var(--white); font-size: clamp(1.25rem, 1.1rem + .6vw, 1.5rem); line-height: 1.3; }
.ar-callout strong { color: var(--white); }
.ar-callout :focus-visible { outline-color: var(--white); }
.ar-prose .ar-callout__actions { display: flex; flex-wrap: wrap; gap: .75rem; margin-top: 1.5rem; }
.ar-prose .ar-callout a { text-decoration: none; }
.ar-prose .ar-callout .btn--glass { color: var(--white); }
.ar-callout__btn { background: var(--white); color: var(--primary); }
.ar-callout__btn:hover { background: #eef3fb; transform: translateY(-1px); }
.ar-callout .btn--glass .icon { width: 1em; height: 1em; }
.ar-callout .btn--glass:hover .icon { transform: none; }

/* ---------- Weitere Artikel (.posts/.post-card aus style.css) ---------- */

.ar-more__grid .post-card h3 { overflow-wrap: break-word; }
/* Einblenden (main.js) setzt transform: none mit hoher Spezifität; Anheben beim Hover wiederherstellen */
.js .ar-more__grid .post-card.is-visible { transition: opacity .7s var(--ease), transform .3s var(--ease), box-shadow .3s var(--ease); }
.js .ar-more__grid .post-card.is-visible:hover { transform: translateY(-4px); }

/* ---------- Breakpoints ---------- */

@media (max-width: 479px) {
  /* lange Beschriftungen brechen hier um; Innenabstand, damit mehrzeilige Buttons nicht an den Rand stoßen */
  .ar-prose .ar-callout__actions .btn { flex: 1 1 100%; padding-block: .75em; }
}
/* 640–1023 px: zwei Spalten; die übrige dritte Kachel quer über die volle Breite (Bild links), kein Loch im Raster */
@media (min-width: 640px) and (max-width: 1023.98px) {
  .ar-more__grid .post-card:last-child:nth-child(odd) { grid-column: 1 / -1; display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
  .ar-more__grid .post-card:last-child:nth-child(odd) .post-card__media { aspect-ratio: auto; min-height: 100%; }
}
@media (min-width: 1024px) {
  .ar-layout {
    grid-template-columns: minmax(0, 42rem) minmax(14rem, 17.5rem);
    grid-template-areas: "prose toc";
    justify-content: space-between; align-items: start; gap: 4rem;
  }
  .ar-prose { grid-area: prose; }
  .ar-toc {
    grid-area: toc; position: sticky; top: calc(var(--header-h) + var(--header-gap) * 2 + 1.5rem);
    max-height: calc(100vh - var(--header-h) - var(--header-gap) * 2 - 3rem); overflow-y: auto;
  }
  .ar-toc__title { cursor: default; }
  .ar-toc__chevron { display: none; }
  .ar-more__grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  /* Kacheln einer Reihe teilen sich die Zeilenhöhen, „Artikel lesen“ steht auf einer Linie */
  @supports (grid-template-rows: subgrid) {
    .ar-more__grid .post-card { display: grid; grid-row: span 4; grid-template-rows: subgrid; row-gap: 0; }
    .ar-more__grid .post-card__body { display: grid; grid-row: span 3; grid-template-rows: subgrid; row-gap: 0; }
    .ar-more__grid .post-card .card-more { align-self: end; }
    .ar-more__grid .post-card__meta { align-self: end; }
  }
}
