/* =============================================================================
   Aeberli Treuhand — News-Stylesheet
   Für /news.php (Übersicht) und /news-template.php (einzelner Beitrag).
   Baut auf den Tokens aus colors_and_type.css auf (--ad-red, --ad-paper usw.).
   Präfix nw- = neues Layout (Nov. 2026). Präfix nb- = Zusatzblöcke der
   Spezial-Layouts (Podcast, Video, Interview usw.), siehe unten.
   ============================================================================= */

.nw { position: relative; background: var(--ad-paper); color: var(--ad-fg); font-family: var(--ad-sans); }
.nw *, .nw *::before, .nw *::after { box-sizing: border-box; }
.nw-wrap { max-width: var(--ad-wrap); margin: 0 auto; padding-inline: var(--ad-wrap-pad); }
.nw a { text-decoration: none; }
.nw :focus-visible { outline: 3px solid var(--ad-red); outline-offset: 3px; }
.nw [hidden] { display: none !important; }
/* Die Hausschrift hat nur Light (300) und Bold (700): «bolder» ergäbe sonst Light */
.nw strong, .nw b { font-weight: 700; }
.nw-sr { position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0; overflow: hidden; clip: rect(0 0 0 0); clip-path: inset(50%); white-space: nowrap; border: 0; }

/* Feines Raster im Seitenkopf, wie auf der Startseite */
.nw-gridbg { position: relative; }
.nw-gridbg::before { content: ""; position: absolute; inset: 0; pointer-events: none; background-image: linear-gradient(rgba(0,0,0,.024) 1px, transparent 1px), linear-gradient(90deg, rgba(0,0,0,.024) 1px, transparent 1px); background-size: 72px 72px; -webkit-mask-image: radial-gradient(ellipse 70% 90% at 75% 20%, #000 20%, transparent 78%); mask-image: radial-gradient(ellipse 70% 90% at 75% 20%, #000 20%, transparent 78%); }
.nw-gridbg > * { position: relative; }

.nw-eyebrow { display: inline-flex; align-items: center; gap: .65rem; margin: 0 0 1.25rem; font-size: .72rem; font-weight: 500; letter-spacing: .14em; text-transform: uppercase; color: var(--ad-red); }
.nw-eyebrow::before { content: ""; width: 28px; height: 2px; background: var(--ad-red); }

/* ── Bildrahmen ───────────────────────────────────────────────────────────────
   cover   = Bild füllt den Rahmen (wird zugeschnitten)
   contain = ganzes Bild, dahinter eine weichgezeichnete Kopie (für Banner mit Text) */
.nw-media { position: relative; display: block; overflow: hidden; background: var(--ad-paper-2); }
.nw-media img { position: absolute; inset: 0; width: 100%; height: 100%; display: block; object-fit: cover; transition: transform .9s var(--ad-ease); }
.nw-media--contain img { z-index: 1; object-fit: contain; }
.nw-media__blur { position: absolute; inset: -12%; background-size: cover; background-position: center; filter: blur(26px) saturate(1.1); opacity: .55; }
.nw-media--contain::after { content: ""; position: absolute; inset: 0; background: rgba(245,243,238,.28); pointer-events: none; }

.nw-cat { font-size: .72rem; font-weight: 700; letter-spacing: .14em; text-transform: uppercase; color: var(--ad-red); }
.nw-cat + time::before { content: ""; display: inline-block; width: 3px; height: 3px; margin: 0 .65rem .22em 0; border-radius: 50%; background: var(--ad-border-strong); }
.nw-pdftag { display: inline-flex; align-items: center; padding: .12rem .42rem; border: 1px solid var(--ad-border-strong); border-radius: 3px; font-size: .64rem; font-weight: 700; letter-spacing: .08em; color: var(--ad-fg-2); line-height: 1.3; }

.nw-pill { display: inline-flex; align-items: center; gap: .5rem; align-self: flex-start; padding: .9rem 1.75rem; border-radius: 100px; background: var(--ad-fg); color: #fff; font-size: .95rem; font-weight: 700; transition: background .2s, color .2s, gap .25s; }
a.nw-pill:hover { background: var(--ad-red); color: #fff; gap: .8rem; }
.nw-textlink { display: inline-flex; align-items: baseline; gap: .4rem; font-family: var(--ad-serif-italic); font-style: italic; font-size: 1.08rem; color: var(--ad-red); transition: gap .25s; }
.nw-textlink:hover { gap: .75rem; color: var(--ad-red); }

/* =============================================================================
   ÜBERSICHT
   ============================================================================= */

/* ── Seitenkopf ───────────────────────────────────────────────────────────── */
.nw-mast { padding: clamp(3rem, 6vw, 5rem) 0 clamp(2rem, 4vw, 3rem); }
.nw-mast__grid { display: grid; grid-template-columns: 1.2fr 1fr; gap: 3rem; align-items: end; }
.nw-mast h1 { margin: 0; font-size: clamp(2.5rem, 5.4vw, 4.4rem); font-weight: 700; letter-spacing: -.035em; line-height: .98; }
.nw-mast h1 em { font-family: var(--ad-serif-italic); font-style: italic; font-weight: 400; color: var(--ad-red); letter-spacing: -.01em; }
.nw-mast__lede { margin: 0; max-width: 44ch; font-size: 1.05rem; line-height: 1.7; color: var(--ad-fg-2); }
.nw-mast__count { display: flex; align-items: center; gap: .75rem; margin: 1.25rem 0 0; font-size: .82rem; color: var(--ad-muted); }
.nw-mast__count b { font-family: var(--ad-serif-italic); font-style: italic; font-weight: 400; font-size: 1.9rem; line-height: 1; color: var(--ad-red); }

/* ── Aufmacher: neuester Beitrag ──────────────────────────────────────────── */
.nw-feat { position: relative; display: grid; grid-template-columns: minmax(0, 1.22fr) minmax(0, 1fr); background: #fff; border: 1px solid var(--ad-border); overflow: hidden; transition: box-shadow .35s, border-color .35s, transform .35s var(--ad-ease); }
.nw-feat--noimg { grid-template-columns: minmax(0, 1fr); }
.nw-feat::before { content: ""; position: absolute; z-index: 3; top: 0; left: 0; right: 0; height: 4px; background: var(--ad-red); }
.nw-feat:hover, .nw-feat:focus-within { box-shadow: 0 22px 48px rgba(0,0,0,.09); border-color: transparent; transform: translateY(-3px); }
.nw-feat:hover .nw-media img { transform: scale(1.04); }
.nw-feat__mediawrap { position: relative; min-height: clamp(300px, 28vw, 400px); }
.nw-feat__media { position: absolute; inset: 0; }
.nw-feat__body { display: flex; flex-direction: column; justify-content: center; padding: clamp(1.75rem, 3.4vw, 3.25rem); }
.nw-feat__flag { display: flex; flex-wrap: wrap; align-items: center; gap: .6rem 1rem; margin: 0 0 1.25rem; font-size: .8rem; color: var(--ad-muted); }
.nw-feat__flag b { display: inline-flex; padding: .28rem .7rem; border-radius: 100px; background: var(--ad-red); color: #fff; font-size: .7rem; font-weight: 700; letter-spacing: .1em; text-transform: uppercase; }
.nw-feat__flag .nw-cat + time::before { content: none; }
.nw-feat h2 { margin: 0 0 1rem; font-size: clamp(1.7rem, 2.9vw, 2.55rem); font-weight: 700; letter-spacing: -.03em; line-height: 1.06; text-wrap: balance; }
.nw-feat h2 a { color: inherit; }
.nw-feat h2 a::after { content: ""; position: absolute; inset: 0; z-index: 1; }
.nw-feat h2 a:focus-visible { outline: none; }
.nw-feat:focus-within { outline: 3px solid var(--ad-red); outline-offset: 3px; }
.nw-feat__text { margin: 0 0 1.75rem; max-width: 46ch; font-size: 1.05rem; line-height: 1.7; color: var(--ad-fg-2); display: -webkit-box; -webkit-line-clamp: 4; -webkit-box-orient: vertical; overflow: hidden; }
.nw-feat:hover .nw-pill { background: var(--ad-red); gap: .8rem; }

/* ── Filter + Suche ───────────────────────────────────────────────────────── */
.nw-tools { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 1rem 2rem; margin: clamp(2.5rem, 4.5vw, 3.75rem) 0 1.5rem; padding-bottom: 1.25rem; border-bottom: 1px solid var(--ad-border); }
.nw-tools[hidden] + .nw-grid { margin-top: clamp(2rem, 3.5vw, 2.75rem); }
.nw-filters { display: flex; flex-wrap: wrap; gap: .5rem; }
.nw-filter { display: inline-flex; align-items: center; gap: .5rem; min-height: 40px; padding: .55rem 1.05rem; border: 1px solid var(--ad-border-strong); border-radius: 100px; background: transparent; color: var(--ad-fg); font: inherit; font-size: .9rem; line-height: 1.2; cursor: pointer; transition: background .2s, color .2s, border-color .2s; }
.nw-filter i { font-style: normal; font-size: .74rem; color: var(--ad-muted); transition: color .2s; }
.nw-filter:hover { border-color: var(--ad-fg); }
.nw-filter[aria-pressed="true"] { background: var(--ad-fg); border-color: var(--ad-fg); color: #fff; font-weight: 700; }
.nw-filter[aria-pressed="true"] i { color: rgba(255,255,255,.7); }
.nw-search { position: relative; display: block; flex: 0 1 280px; }
.nw-search svg { position: absolute; left: .95rem; top: 50%; transform: translateY(-50%); color: var(--ad-muted); pointer-events: none; }
.nw-search input { width: 100%; min-height: 40px; padding: .65rem 1rem .65rem 2.6rem; border: 1px solid var(--ad-border-strong); border-radius: 100px; background: #fff; font: inherit; font-size: .9rem; color: var(--ad-fg); }
.nw-search input::placeholder { color: var(--ad-muted); opacity: 1; }
.nw-search input:focus { outline: none; border-color: var(--ad-fg); box-shadow: 0 0 0 3px rgba(218,41,28,.18); }
.nw-none { margin: 2.5rem 0; padding: 2.5rem 1.5rem; border: 1px dashed var(--ad-border-strong); text-align: center; color: var(--ad-fg-2); }
.nw-none strong { font-size: 1.3rem; color: var(--ad-fg); }

/* ── Kartenraster ─────────────────────────────────────────────────────────── */
.nw-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 1.5rem; }
.nw-card { --px: 1.5rem; position: relative; display: flex; flex-direction: column; background: #fff; border: 1px solid var(--ad-border); overflow: hidden; transition: transform .35s var(--ad-ease), box-shadow .35s, border-color .35s; }
.nw-card::before { content: ""; position: absolute; z-index: 3; top: 0; left: 0; right: 0; height: 4px; background: var(--ad-red); transform: scaleX(0); transform-origin: left; transition: transform .45s var(--ad-ease); }
.nw-card:hover, .nw-card:focus-within { transform: translateY(-4px); box-shadow: 0 22px 48px rgba(0,0,0,.09); border-color: transparent; }
.nw-card:hover::before, .nw-card:focus-within::before { transform: scaleX(1); }
.nw-card:hover .nw-media img { transform: scale(1.05); }
.nw-card__mediawrap { position: relative; }
/* Beitrag ohne Bild: ruhige Fläche mit Signet statt leerer Lücke */
.nw-card__mediawrap:empty { aspect-ratio: 16 / 9; background: var(--ad-paper-2) url(assets/Aeberli_Logo_kurzform_RGB_pos.svg) center / 56px no-repeat; }
.nw-card__media { aspect-ratio: 16 / 9; }
.nw-card__meta { display: flex; flex-wrap: wrap; align-items: center; gap: .3rem .65rem; margin: 0; padding: 1.35rem var(--px) 0; font-size: .8rem; letter-spacing: .02em; color: var(--ad-muted); }
.nw-card__title { margin: 0; padding: .6rem var(--px) 0; font-size: clamp(1.15rem, 1.5vw, 1.32rem); font-weight: 700; letter-spacing: -.02em; line-height: 1.2; text-wrap: balance; }
.nw-card__link { color: inherit; }
.nw-card__link:hover { color: inherit; }
.nw-card__link::after { content: ""; position: absolute; inset: 0; z-index: 1; }
.nw-card__link:focus-visible { outline: none; }
.nw-card:focus-within { outline: 3px solid var(--ad-red); outline-offset: 3px; }
.nw-card__excerpt { margin: 0 0 1.35rem; padding: .6rem var(--px) 0; font-size: .95rem; line-height: 1.62; color: var(--ad-fg-2); display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.nw-card__more { margin: auto var(--px) 1.25rem; padding-top: 1rem; border-top: 1px solid var(--ad-border); }
.nw-card__more span { display: inline-flex; align-items: baseline; gap: .45rem; font-family: var(--ad-serif-italic); font-style: italic; font-size: 1.1rem; line-height: 1; color: var(--ad-red); transition: gap .25s; }
.nw-card__more i { font-style: normal; }
.nw-card:hover .nw-card__more span { gap: .8rem; }
/* Subgrid: Bild, Meta, Titel, Text und Fusszeile aller Karten einer Reihe auf gleicher Höhe */
@supports (grid-template-rows: subgrid) {
  .nw-grid { row-gap: 0; }
  .nw-card { display: grid; grid-row: span 5; grid-template-rows: subgrid; row-gap: 0; margin-bottom: 1.5rem; }
  .nw-card__more { align-self: end; }
}

/* ── Kontaktband am Seitenende ────────────────────────────────────────────── */
.nw-end { padding: clamp(3.5rem, 7vw, 6rem) 0 clamp(4rem, 8vw, 7rem); }
.nw-cta { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 1.5rem 3rem; align-items: center; padding: clamp(1.75rem, 3.5vw, 3rem); background: var(--ad-anthrazit-deep); color: #fff; }
.nw-cta h2 { margin: 0 0 .5rem; font-size: clamp(1.5rem, 2.6vw, 2.1rem); letter-spacing: -.025em; line-height: 1.1; color: #fff; }
.nw-cta h2 em { font-family: var(--ad-serif-italic); font-style: italic; font-weight: 400; color: var(--ad-red); }
.nw-cta p { margin: 0; max-width: 52ch; color: rgba(255,255,255,.78); line-height: 1.65; }
.nw-cta__btns { display: flex; flex-wrap: wrap; gap: .75rem; }
.nw-cta .nw-pill { background: var(--ad-red); align-self: center; }
.nw-cta a.nw-pill:hover { background: #fff; color: var(--ad-fg); }
.nw-cta .nw-pill--ghost { background: transparent; border: 1.5px solid rgba(255,255,255,.45); font-weight: 300; }
.nw-cta :focus-visible { outline-color: #fff; }

/* =============================================================================
   BEITRAG
   ============================================================================= */

.nw-progress { position: fixed; z-index: 120; top: 0; left: 0; height: 3px; width: 100%; background: var(--ad-red); transform: scaleX(0); transform-origin: left; pointer-events: none; }

.nw-crumbs { display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: .6rem; margin: 0 0 clamp(1.75rem, 3vw, 2.5rem); font-size: .85rem; color: var(--ad-muted); }
.nw-crumbs a { display: inline-flex; align-items: center; gap: .45rem; color: var(--ad-fg-2); transition: color .2s, gap .25s; }
.nw-crumbs a:hover { color: var(--ad-red); gap: .7rem; }
.nw-crumbs > span[aria-hidden] { color: var(--ad-border-strong); }

/* ── Kopf ─────────────────────────────────────────────────────────────────── */
.nw-phead { --nw-overlap: clamp(3rem, 7vw, 6rem); padding: clamp(2rem, 4vw, 3.25rem) 0 0; text-align: center; }
.nw-phead--nofig { padding-bottom: clamp(2.5rem, 5vw, 4rem); }
.nw-ptitle { max-width: 22ch; margin: 0 auto 1.25rem; font-size: clamp(2.1rem, 4.2vw, 3.5rem); font-weight: 700; letter-spacing: -.035em; line-height: 1.03; text-wrap: balance; overflow-wrap: break-word; hyphens: auto; }
.nw-ptitle--long { max-width: 28ch; font-size: clamp(1.75rem, 2.9vw, 2.6rem); letter-spacing: -.03em; line-height: 1.08; }
.nw-plede { max-width: 56ch; margin: 0 auto 1.75rem; font-size: clamp(1.1rem, 1.5vw, 1.28rem); line-height: 1.55; color: var(--ad-fg-2); }
.nw-pmeta { display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: .5rem 1.1rem; margin: 0; font-size: .88rem; color: var(--ad-muted); }
.nw-pmeta__by { display: inline-flex; align-items: center; gap: .65rem; color: var(--ad-fg); font-weight: 700; }
.nw-pmeta__by img { width: 34px; height: 34px; padding: 6px; border-radius: 50%; background: #fff; border: 1px solid var(--ad-border); }
.nw-pmeta i { width: 3px; height: 3px; border-radius: 50%; background: var(--ad-border-strong); }
.nw-phead__fig { position: relative; z-index: 1; max-width: 980px; margin: clamp(2rem, 4vw, 3rem) auto calc(-1 * var(--nw-overlap)); }
.nw-phead__fig .nw-media { box-shadow: 0 28px 60px rgba(0,0,0,.16); }

/* ── Lesefläche ───────────────────────────────────────────────────────────── */
.nw-sheet { --nw-overlap: clamp(3rem, 7vw, 6rem); background: #fff; border-top: 1px solid var(--ad-border); border-bottom: 1px solid var(--ad-border); padding: calc(var(--nw-overlap) + clamp(2.5rem, 5vw, 4rem)) 0 clamp(2.5rem, 6vw, 5rem); }
.nw-sheet--nofig { padding-top: clamp(2.5rem, 6vw, 5rem); }
.nw-read { display: grid; grid-template-columns: minmax(0, 720px) 320px; gap: clamp(2rem, 5vw, 5rem); justify-content: center; align-items: start; }
.nw-main { min-width: 0; }

.nw-prose { font-size: 1.125rem; line-height: 1.78; color: var(--ad-fg-2); overflow-wrap: break-word; }
.nw-prose > :first-child { margin-top: 0; }
.nw-prose > :last-child { margin-bottom: 0; }
.nw-prose p { margin: 0 0 1.35em; }
.nw-prose > p:first-child { font-size: 1.3rem; line-height: 1.6; color: var(--ad-fg); }
.nw-prose h2 { margin: 2.4em 0 .7em; font-size: 1.75rem; letter-spacing: -.025em; line-height: 1.15; }
.nw-prose h3 { margin: 2em 0 .6em; font-size: 1.3rem; letter-spacing: -.015em; line-height: 1.2; }
.nw-prose strong { font-weight: 700; color: var(--ad-fg); }
.nw-prose em { font-style: italic; }
.nw-prose a { color: var(--ad-red); text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: 4px; }
.nw-prose a:hover { text-decoration-thickness: 2px; }
.nw-prose ul, .nw-prose ol { margin: 0 0 1.5em; padding: 0; list-style: none; counter-reset: nw; }
.nw-prose li { position: relative; margin: 0; padding: .7rem 0 .7rem 2.1rem; border-bottom: 1px solid var(--ad-border); color: var(--ad-fg); }
.nw-prose li:first-child { border-top: 1px solid var(--ad-border); }
.nw-prose ul > li::before { content: ""; position: absolute; left: .15rem; top: 1.62rem; width: 16px; height: 2px; background: var(--ad-red); }
.nw-prose ol > li { counter-increment: nw; }
.nw-prose ol > li::before { content: counter(nw); position: absolute; left: .15rem; top: .7rem; font-family: var(--ad-serif-italic); font-style: italic; color: var(--ad-red); }
.nw-prose li > ul, .nw-prose li > ol { margin: .6rem 0 0; }
.nw-prose li > ul > li:last-child, .nw-prose li > ol > li:last-child { border-bottom: 0; padding-bottom: 0; }
.nw-prose blockquote { margin: 2em 0; padding: .2em 0 .2em 1.5rem; border-left: 3px solid var(--ad-red); font-family: var(--ad-serif-italic); font-style: italic; font-size: 1.5rem; line-height: 1.4; color: var(--ad-fg); }
.nw-prose blockquote p:last-child { margin-bottom: 0; }
.nw-prose img { display: block; max-width: 100%; height: auto; margin: 2em 0; }
/* Bild im Text (News-Editor, Knopf «Bild»): <figure class="nw-fig"><img><figcaption> */
.nw-prose figure { margin: 2.25em 0; }
.nw-prose figure img { margin: 0; }
.nw-prose figcaption { margin-top: .75rem; padding-left: .85rem; border-left: 2px solid var(--ad-red); font-size: .875rem; line-height: 1.5; color: var(--ad-muted); }
/* Galerie im Text (News-Editor, Knopf «Galerie»): <div class="nw-gallery" data-cols="2|3|4"><figure><img><figcaption> */
.nw-gallery { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: .75rem; margin: 2.25em 0; }
.nw-gallery[data-cols="2"] { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.nw-gallery[data-cols="4"] { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.nw-prose .nw-gallery figure { margin: 0; min-width: 0; }
.nw-prose .nw-gallery img { width: 100%; aspect-ratio: 4 / 3; object-fit: cover; margin: 0; background: var(--ad-paper); }
.nw-prose .nw-gallery figcaption { margin-top: .5rem; padding-left: 0; border-left: 0; font-size: .8rem; line-height: 1.45; }
.nw-gallery__open { display: block; width: 100%; margin: 0; padding: 0; border: 0; border-radius: 0; background: var(--ad-paper); overflow: hidden; cursor: zoom-in; font: inherit; color: inherit; }
.nw-gallery__open img { transition: transform .5s var(--ad-ease); }
.nw-gallery__open:focus-visible { outline: 3px solid var(--ad-red); outline-offset: 3px; }
@media (hover: hover) { .nw-gallery__open:hover img { transform: scale(1.04); } }
@media (max-width: 640px) {
  .nw-gallery, .nw-gallery[data-cols="3"], .nw-gallery[data-cols="4"] { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .5rem; }
}
/* Grossansicht der Galerie */
.nw-lb { position: fixed; inset: 0; width: 100vw; height: 100vh; height: 100dvh; max-width: none; max-height: none; margin: 0; padding: 0; border: 0; background: rgba(15, 18, 22, .95); color: #fff; font-family: var(--ad-sans); font-weight: 300; overflow: hidden; }
.nw-lb::backdrop { background: rgba(15, 18, 22, .95); }
.nw-lb[open] { display: flex; align-items: center; justify-content: center; }
.nw-lb__stage { display: flex; flex-direction: column; align-items: center; gap: .9rem; max-width: min(92vw, 1400px); margin: 0; }
.nw-lb__stage img { display: block; max-width: 100%; max-height: calc(100vh - 10rem); max-height: calc(100dvh - 10rem); width: auto; height: auto; object-fit: contain; }
.nw-lb__cap { margin: 0; max-width: 70ch; padding: 0 1rem; text-align: center; font-size: .92rem; line-height: 1.5; color: rgba(255, 255, 255, .88); }
.nw-lb__count { position: absolute; top: 1.5rem; left: 50%; transform: translateX(-50%); margin: 0; font-size: .78rem; font-weight: 700; letter-spacing: .14em; color: rgba(255, 255, 255, .75); }
.nw-lb button { position: absolute; display: flex; align-items: center; justify-content: center; width: 48px; height: 48px; padding: 0; border: 1px solid rgba(255, 255, 255, .4); border-radius: 50%; background: rgba(15, 18, 22, .5); color: #fff; cursor: pointer; transition: background .2s, color .2s, border-color .2s; }
.nw-lb button:hover { background: #fff; border-color: #fff; color: #1f262c; }
.nw-lb button:focus-visible { outline: 2px solid #fff; outline-offset: 3px; }
.nw-lb button[hidden] { display: none; }
.nw-lb__close { top: 1rem; right: 1rem; }
.nw-lb__prev { left: 1rem; top: 50%; transform: translateY(-50%); }
.nw-lb__next { right: 1rem; top: 50%; transform: translateY(-50%); }
@media (max-width: 640px) {
  .nw-lb__prev, .nw-lb__next { top: auto; bottom: 1rem; transform: none; }
  .nw-lb__stage img { max-height: calc(100vh - 12rem); max-height: calc(100dvh - 12rem); }
}
@media (prefers-reduced-motion: reduce) { .nw-gallery__open img { transition: none; } }

/* PDF-Karte: ersetzt einen Absatz, der nur aus einem PDF-Link besteht */
.nw-pdf { position: relative; display: grid; grid-template-columns: auto minmax(0, 1fr) auto; gap: 1.15rem; align-items: center; margin: 2.25rem 0; padding: 1.2rem 1.35rem; background: var(--ad-paper); border: 1px solid var(--ad-border); border-left: 3px solid var(--ad-red); font-size: 1rem; line-height: 1.4; transition: background .25s, box-shadow .25s, transform .25s var(--ad-ease); }
.nw-pdf:hover, .nw-pdf:focus-within { background: #fff; box-shadow: 0 16px 36px rgba(0,0,0,.08); transform: translateY(-2px); }
.nw-pdf:focus-within { outline: 3px solid var(--ad-red); outline-offset: 3px; }
.nw-pdf__icon { display: flex; align-items: center; justify-content: center; width: 52px; height: 52px; background: #fff; border: 1px solid var(--ad-border); color: var(--ad-red); }
.nw-pdf__text { min-width: 0; }
.nw-prose a.nw-pdf__link { display: block; font-size: 1.1rem; font-weight: 700; line-height: 1.25; color: var(--ad-fg); text-decoration: none; }
/* Ganze Karte klickbar. Hohe Spezifität nötig: site.css schaltet ::after bei
   a[target="_blank"].no-ext-icon ab (dort sitzt sonst das ↗-Symbol). */
.nw-prose .nw-pdf a.nw-pdf__link::after, .nw-prose .nw-pdf a.nw-pdf__link:hover::after { content: ""; display: block; position: absolute; inset: 0; z-index: 1; margin: 0; transform: none; }
.nw-pdf__link:focus-visible { outline: none; }
.nw-pdf__meta { display: block; margin-top: .2rem; font-size: .84rem; color: var(--ad-muted); }
.nw-pdf__go { display: inline-flex; align-items: center; gap: .45rem; padding: .7rem 1.25rem; border-radius: 100px; background: var(--ad-red); color: #fff; font-size: .9rem; font-weight: 700; line-height: 1; white-space: nowrap; transition: gap .25s, background .2s; }
.nw-pdf:hover .nw-pdf__go { gap: .7rem; background: var(--ad-red-deep); }

.nw-tags { display: flex; flex-wrap: wrap; align-items: center; gap: .5rem; margin: 2.75rem 0 0; padding-top: 1.5rem; border-top: 1px solid var(--ad-border); }
.nw-tags b { margin-right: .5rem; font-size: .72rem; letter-spacing: .14em; text-transform: uppercase; color: var(--ad-muted); }
.nw-tag { padding: .35rem .8rem; border: 1px solid var(--ad-border-strong); border-radius: 100px; font-size: .82rem; line-height: 1.2; color: var(--ad-fg-2); }
.nw-tag--cat { border-color: var(--ad-red); color: var(--ad-red); font-weight: 700; }

/* ── Seitenleiste ─────────────────────────────────────────────────────────── */
.nw-aside { position: sticky; top: 9.5rem; display: flex; flex-direction: column; gap: 1.25rem; min-width: 0; }
/* Niedrige Fenster: Seitenleiste wäre höher als der Platz unter dem Seitenkopf, darum nicht mitlaufen */
@media (min-width: 1101px) and (max-height: 780px) { .nw-aside { position: static; } }
.nw-facts { margin: 0; padding: 1.5rem; background: var(--ad-paper); border: 1px solid var(--ad-border); border-top: 3px solid var(--ad-red); }
.nw-facts h2 { margin: 0 0 1rem; font-size: .72rem; font-weight: 700; letter-spacing: .14em; line-height: 1.3; text-transform: uppercase; }
.nw-facts dl { margin: 0; }
.nw-facts dl > div { display: flex; justify-content: space-between; gap: 1rem; padding: .6rem 0; border-top: 1px solid var(--ad-border); font-size: .92rem; }
.nw-facts dt { color: var(--ad-muted); }
.nw-facts dd { margin: 0; font-weight: 700; text-align: right; color: var(--ad-fg); }
.nw-facts .nw-pdf__go { width: 100%; justify-content: center; margin-top: 1rem; padding: .85rem 1rem; white-space: normal; text-align: center; line-height: 1.25; }
.nw-facts a.nw-pdf__go:hover { background: var(--ad-red-deep); color: #fff; gap: .7rem; }
.nw-facts__share { margin-top: 1.25rem; padding-top: 1.1rem; border-top: 1px solid var(--ad-border); }
.nw-facts__share p { margin: 0 0 .7rem; font-size: .72rem; font-weight: 700; letter-spacing: .14em; text-transform: uppercase; color: var(--ad-muted); }
.nw-share { display: flex; flex-wrap: wrap; gap: .6rem; }
.nw-share a, .nw-share button { display: inline-flex; align-items: center; justify-content: center; width: 44px; height: 44px; padding: 0; border: 1px solid var(--ad-border-strong); border-radius: 50%; background: #fff; color: var(--ad-fg-2); cursor: pointer; transition: background .2s, color .2s, border-color .2s, transform .2s; }
.nw-share a:hover, .nw-share button:hover { background: var(--ad-red); border-color: var(--ad-red); color: #fff; transform: translateY(-2px); }
.nw-share button.is-done { background: var(--ad-fg); border-color: var(--ad-fg); color: #fff; }
.nw-share button .nw-share__ok { display: none; }
.nw-share button.is-done svg:not(.nw-share__ok) { display: none; }
.nw-share button.is-done .nw-share__ok { display: block; }
.nw-contact { padding: 1.5rem; background: var(--ad-anthrazit-deep); color: #fff; }
.nw-contact strong { display: block; margin-bottom: .4rem; font-size: 1.1rem; line-height: 1.25; }
.nw-contact p { margin: 0 0 1rem; font-size: .92rem; line-height: 1.55; color: rgba(255,255,255,.78); }
.nw-contact .nw-textlink, .nw-contact .nw-textlink:hover { color: var(--ad-red); }
.nw-contact :focus-visible { outline-color: #fff; }

/* ── Blättern + weitere Beiträge ──────────────────────────────────────────── */
.nw-pager { display: grid; grid-template-columns: 1fr 1fr; gap: 1.5rem; padding: clamp(2.5rem, 5vw, 4rem) 0 0; }
.nw-pager a { display: flex; flex-direction: column; gap: .5rem; padding: 1.5rem 1.75rem; background: #fff; border: 1px solid var(--ad-border); color: var(--ad-fg); transition: box-shadow .3s, border-color .3s, transform .3s var(--ad-ease); }
.nw-pager a:hover { box-shadow: 0 18px 40px rgba(0,0,0,.08); border-color: transparent; transform: translateY(-3px); color: var(--ad-fg); }
.nw-pager small { font-family: var(--ad-serif-italic); font-style: italic; font-size: 1.02rem; color: var(--ad-red); }
.nw-pager strong { font-size: 1.15rem; letter-spacing: -.015em; line-height: 1.25; text-wrap: balance; }
.nw-pager a.is-next { grid-column: 2; text-align: right; align-items: flex-end; }

.nw-more { padding: clamp(3rem, 6vw, 5rem) 0 0; }
.nw-more__head { display: flex; align-items: end; justify-content: space-between; gap: 1.5rem; margin-bottom: 1.75rem; }
.nw-more__head h2 { margin: 0; font-size: clamp(1.7rem, 3vw, 2.4rem); letter-spacing: -.03em; line-height: 1.05; }
.nw-more__head .nw-textlink, .nw-more__head .nw-textlink:hover { color: var(--ad-red); }
.nw-more__head h2 em { font-family: var(--ad-serif-italic); font-style: italic; font-weight: 400; color: var(--ad-red); }

/* ── Responsive ───────────────────────────────────────────────────────────── */
@media (max-width: 1100px) {
  .nw-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .nw-read { grid-template-columns: minmax(0, 760px); }
  /* Aufmacher untereinander: nebeneinander würde das Bild hier zu schmal und zu stark beschnitten */
  .nw-feat { grid-template-columns: minmax(0, 1fr); }
  .nw-feat__mediawrap { min-height: 0; }
  .nw-feat__media { position: relative; inset: auto; aspect-ratio: 16 / 9; }
  .nw-aside { position: static; display: grid; grid-template-columns: 1fr 1fr; align-items: start; }
}
@media (max-width: 900px) {
  .nw-mast__grid { grid-template-columns: 1fr; gap: 1.25rem; }
  .nw-cta { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 680px) {
  .nw-grid { grid-template-columns: minmax(0, 1fr); gap: 1rem; }
  .nw-card { --px: 1.25rem; }
  .nw-search { flex-basis: 100%; }
  .nw-search input { font-size: 1rem; }
  .nw-pager { grid-template-columns: minmax(0, 1fr); gap: 1rem; }
  .nw-pager a.is-next { grid-column: auto; }
  .nw-pdf { grid-template-columns: auto minmax(0, 1fr); }
  .nw-pdf__go { grid-column: 1 / -1; justify-content: center; }
  .nw-aside { grid-template-columns: minmax(0, 1fr); }
  .nw-prose { font-size: 1.06rem; }
  .nw-prose > p:first-child { font-size: 1.18rem; }
  .nw-prose blockquote { font-size: 1.3rem; }
  .nw-more__head { flex-direction: column; align-items: flex-start; }
  @supports (grid-template-rows: subgrid) { .nw-card { margin-bottom: 1rem; } .nw-grid { gap: 0; } }
}
@media (prefers-reduced-motion: reduce) {
  .nw *, .nw *::before, .nw *::after { transition: none !important; }
  .nw-card:hover, .nw-card:focus-within, .nw-feat:hover, .nw-feat:focus-within, .nw-pager a:hover, .nw-pdf:hover, .nw-pdf:focus-within, .nw-share a:hover, .nw-share button:hover { transform: none; }
  .nw-card:hover .nw-media img, .nw-feat:hover .nw-media img { transform: none; }
}
@media print {
  .nw-progress, .nw-aside, .nw-pager, .nw-more, .nw-end, .nw-tools { display: none !important; }
  .nw-read { display: block; }
}

/* =============================================================================
   SPEZIAL-LAYOUTS — Anpassungen je article.layout (Klasse nb-layout-* auf <main>)
   ============================================================================= */
.nb-layout-press .nw-ptitle { font-size: clamp(1.8rem, 3.5vw, 2.6rem); }
.nb-layout-tutorial .nw-prose h2, .nb-layout-interview .nw-prose h2 { font-size: 1.35rem; color: var(--ad-red); }
.nw-main > .nb-pod, .nw-main > .nb-vid, .nw-main > .nb-case__kpis, .nw-main > .nb-tut__meta { margin-bottom: 2rem; }
.nw-prose + .nb-interview__who, .nw-prose + .nb-qa, .nw-prose + .nb-steps, .nw-prose + .nb-gallery, .nw-prose + .nb-case__quote { margin-top: 2rem; }

/* =============================================================================
   STRUCTURED LAYOUT BLOCKS — rendered when article.layoutData is set
   ============================================================================= */

/* ── Podcast ──────────────────────────────────────────────────────────────── */
.nb-pod { margin-bottom: 2rem; }
.nb-pod__player {
  width: 100%; display: block;
  margin-bottom: 1.25rem;
  border-radius: var(--ad-radius-1);
  background: var(--ad-paper-2);
}
.nb-pod__embed {
  position: relative;
  aspect-ratio: 16 / 5;
  border-radius: var(--ad-radius-1);
  overflow: hidden;
  margin-bottom: 1.25rem;
  background: var(--ad-paper-2);
}
.nb-pod__embed iframe {
  position: absolute; inset: 0;
  width: 100%; height: 100%; border: 0;
}
.nb-pod__meta,
.nb-vid__meta,
.nb-tut__meta {
  display: flex; flex-wrap: wrap; gap: 1.5rem;
  margin: 0 0 1.25rem;
  padding: 1rem 1.25rem;
  background: var(--ad-paper-2);
  border-radius: var(--ad-radius-1);
  border-left: 3px solid var(--ad-red);
}
.nb-pod__meta div,
.nb-vid__meta div,
.nb-tut__meta div { min-width: 0; }
.nb-pod__meta dt,
.nb-vid__meta dt,
.nb-tut__meta dt {
  font-size: .65rem; font-weight: 600;
  letter-spacing: var(--ad-track-eyebrow); text-transform: uppercase;
  color: var(--ad-muted);
  margin: 0 0 .15rem;
}
.nb-pod__meta dd,
.nb-vid__meta dd,
.nb-tut__meta dd {
  font-size: 1rem; font-weight: 600;
  color: var(--ad-fg);
  margin: 0;
}
.nb-pod__meta dd span,
.nb-vid__meta dd span {
  font-weight: 400; color: var(--ad-muted);
}
.nb-pod__bio {
  margin: 0;
  font-size: .95rem; color: var(--ad-fg-2);
  line-height: 1.6;
  font-style: italic;
}

/* ── Video / Talk ─────────────────────────────────────────────────────────── */
.nb-vid { margin-bottom: 2rem; }
.nb-vid__embed {
  position: relative;
  aspect-ratio: 16 / 9;
  border-radius: var(--ad-radius-1);
  overflow: hidden;
  margin-bottom: 1.25rem;
  background: #000;
}
.nb-vid__embed iframe {
  position: absolute; inset: 0;
  width: 100%; height: 100%; border: 0;
}

/* ── Case study ───────────────────────────────────────────────────────────── */
.nb-case__client {
  margin: 0 auto 1.5rem;
  max-width: 70ch;
  font-size: .95rem; color: var(--ad-fg-2);
}
.nb-case__kpis {
  display: grid; grid-template-columns: repeat(3, 1fr);
  gap: 1rem;
  margin: 0 auto 2.5rem;
  max-width: 70ch;
}
@media (max-width: 720px) {
  .nb-case__kpis { grid-template-columns: 1fr; }
}
.nb-case__kpi {
  background: #fff;
  border: 1px solid var(--ad-border);
  border-radius: var(--ad-radius-1);
  padding: 1.25rem 1.1rem;
  text-align: center;
}
.nb-case__kpi-value {
  font-size: clamp(1.6rem, 3vw, 2.2rem);
  font-weight: 700;
  color: var(--ad-red);
  letter-spacing: -.02em;
  margin-bottom: .25rem;
  font-feature-settings: "tnum";
}
.nb-case__kpi-label {
  font-size: .82rem;
  color: var(--ad-muted);
  line-height: 1.4;
}
.nb-case__quote {
  margin: 2.5rem auto 1.5rem !important;
  max-width: 70ch;
  padding: 1.5rem 1.75rem !important;
  background: var(--ad-paper-2) !important;
  border-left: 3px solid var(--ad-red);
  font-family: var(--ad-serif-italic) !important;
  font-style: italic !important;
  font-size: 1.2rem !important;
  line-height: 1.55 !important;
  color: var(--ad-fg) !important;
  border-radius: 0 var(--ad-radius-1) var(--ad-radius-1) 0;
  position: relative;
}
.nb-case__quote cite {
  display: block;
  margin-top: .85rem;
  font-family: var(--ad-sans);
  font-style: normal;
  font-size: .85rem;
  font-weight: 600;
  color: var(--ad-muted);
}

/* ── Interview Q&A ────────────────────────────────────────────────────────── */
.nb-interview__who {
  margin: 1.5rem 0 .5rem !important;
  font-size: .95rem;
  color: var(--ad-muted);
}
.nb-interview__who strong { color: var(--ad-fg); }
.nb-qa { margin: 1.5rem 0 2rem; }
.nb-qa__pair {
  margin-bottom: 1.5rem;
  padding-bottom: 1.5rem;
  border-bottom: 1px solid var(--ad-border);
}
.nb-qa__pair:last-child {
  border-bottom: 0; padding-bottom: 0;
}
.nb-qa__q {
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--ad-red);
  margin: 0 0 .65rem !important;
  line-height: 1.4;
}
.nb-qa__q::before {
  content: "F: ";
  font-family: var(--ad-serif-italic);
  font-style: italic;
  font-weight: 400;
}
.nb-qa__a {
  font-size: 1rem;
  color: var(--ad-fg-2);
  line-height: 1.7;
  margin: 0 !important;
}
.nb-qa__a::before {
  content: "A: ";
  font-family: var(--ad-serif-italic);
  font-style: italic;
  font-weight: 400;
  color: var(--ad-red);
}

/* ── Tutorial steps ───────────────────────────────────────────────────────── */
.nb-tut__meta {
  max-width: 75ch;
  margin: 0 auto 1.5rem !important;
}
.nb-steps {
  list-style: none;
  counter-reset: step;
  padding: 0;
  margin: 1.5rem 0 0;
}
.nb-steps__item {
  counter-increment: step;
  position: relative;
  padding: 1.25rem 1.25rem 1.25rem 4rem;
  background: #fff;
  border: 1px solid var(--ad-border);
  border-radius: var(--ad-radius-1);
  margin-bottom: 1rem;
}
.nb-steps__item::before {
  content: counter(step);
  position: absolute;
  top: 1.25rem; left: 1rem;
  width: 32px; height: 32px;
  border-radius: 50%;
  background: var(--ad-red);
  color: #fff;
  font-size: 1rem; font-weight: 700;
  display: flex; align-items: center; justify-content: center;
  font-feature-settings: "tnum";
}
.nb-steps__title {
  margin: 0 0 .35rem !important;
  font-size: 1.15rem;
  color: var(--ad-fg);
  line-height: 1.35;
  letter-spacing: -.005em;
}
.nb-steps__body {
  margin: 0 !important;
  color: var(--ad-fg-2);
  line-height: 1.6;
  font-size: .95rem;
}

/* ── Photo-essay gallery ──────────────────────────────────────────────────── */
.nb-gallery {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 1rem;
  margin: 2rem 0;
}
.nb-gallery__item {
  margin: 0;
  background: var(--ad-paper-2);
  border-radius: var(--ad-radius-1);
  overflow: hidden;
}
.nb-gallery__item img {
  width: 100%; height: auto; display: block;
  border-radius: 0 !important;
  margin: 0 !important;
}
.nb-gallery__item figcaption {
  padding: .75rem 1rem;
  font-size: .82rem;
  color: var(--ad-muted);
  font-style: italic;
  line-height: 1.4;
}

/* ── Announcement highlight ───────────────────────────────────────────────── */
.nb-announce__hl {
  font-size: 3rem;
  line-height: 1;
  margin-bottom: 1rem;
  text-align: inherit;
}
.nb-layout-announcement .nb-announce__hl {
  text-align: center;
}
