/* Cem — Komponenten. Werte nur über Tokens (tokens.css). Keine Rundungen, keine Schatten, Linien 1px in --rule. */

*, *::before, *::after { box-sizing: border-box; border-radius: 0; }
body { background: var(--bg); color: var(--ink); font-family: var(--font-sans); font-size: 17px; line-height: 28px; margin: 0; -webkit-font-smoothing: antialiased; }
:where(a) { color: var(--ink); text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: 3px; }
:where(a:hover) { text-decoration-thickness: 2px; }
:where(button, a, input, select, summary, [tabindex]):focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
:where(input[type="checkbox"], input[type="radio"]) { accent-color: var(--ink); width: var(--size-check); height: var(--size-check); margin: 0; }
.c-meta { font-family: var(--font-mono); font-size: 13px; line-height: 20px; color: var(--ink-muted); }
.c-label { font: 500 13px/16px var(--font-sans); letter-spacing: .02em; text-transform: uppercase; color: var(--ink-muted); }
.u-sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* Button */
.c-btn { display: inline-flex; align-items: center; justify-content: center; gap: var(--space-2); min-height: var(--size-control); padding: 0 var(--space-6); border: var(--size-rule) solid var(--rule); background: var(--bg); color: var(--ink); font: 600 15px/20px var(--font-sans); letter-spacing: .01em; text-transform: uppercase; text-decoration: none; cursor: pointer; transition: background var(--duration-fast); }
.c-btn:hover { background: var(--hover); }
.c-btn--primary { background: var(--ink); color: var(--on-ink); }
.c-btn--primary:hover { background: var(--ink); color: var(--on-ink); text-decoration: underline; text-underline-offset: 3px; }
.c-btn--text { border-color: transparent; background: transparent; padding: 0; min-height: 0; text-transform: none; font: 500 16px/22px var(--font-sans); letter-spacing: 0; text-decoration: underline; text-underline-offset: 3px; }
.c-btn--text:hover { background: transparent; text-decoration-thickness: 2px; }
.c-btn[disabled] { opacity: .4; pointer-events: none; }

/* Tag */
.c-tag { display: inline-flex; align-items: center; height: 24px; padding: 0 var(--space-2); background: var(--tag-bg); color: var(--ink); font: 500 13px/16px var(--font-sans); letter-spacing: .02em; text-transform: uppercase; text-decoration: none; white-space: nowrap; }
.c-tag--accent { background: var(--accent); color: var(--on-accent); }
.c-tag--ink { background: var(--ink); color: var(--on-ink); }
.c-tag--outline { background: transparent; box-shadow: inset 0 0 0 var(--size-rule) var(--rule); }
a.c-tag:hover { text-decoration: underline; text-underline-offset: 3px; }
.c-tags { display: flex; flex-wrap: wrap; gap: var(--space-1); }

/* Zellen-Raster: Zeile aus Spalten mit durchgehenden Linien (Header, FilterBar, Footer) */
.c-cells { display: grid; grid-auto-flow: column; border-top: var(--size-rule) solid var(--rule); border-bottom: var(--size-rule) solid var(--rule); }
.c-cell { padding: var(--space-3) var(--space-4); border-left: var(--size-rule) solid var(--rule); min-width: 0; }
.c-cell:first-child { border-left: 0; }

/* SiteHeader */
.c-header { position: sticky; top: 0; z-index: 10; background: var(--bg); grid-template-columns: auto 1fr auto auto; border-top: 0; }
.c-header .c-cell { display: flex; align-items: center; min-height: 56px; gap: var(--space-6); }
.c-header__brand { font: 800 22px/1 var(--font-sans); letter-spacing: -.02em; color: var(--ink); text-decoration: none; }
.c-header__nav a { font: 500 16px/22px var(--font-sans); text-decoration: none; }
.c-header__nav a:hover, .c-header__nav a[aria-current="page"] { text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: 4px; }
.c-switch { display: flex; gap: var(--space-3); font: 500 16px/22px var(--font-sans); }
.c-switch button, .c-switch a { padding: 0; border: 0; background: none; color: var(--ink-muted); font: inherit; cursor: pointer; text-decoration: none; }
.c-switch button:hover, .c-switch a:hover { color: var(--ink); }
.c-switch [aria-pressed="true"], .c-switch [aria-current="true"] { color: var(--ink); text-decoration: underline; text-underline-offset: 4px; }
.c-header .c-header__menu { display: none; }
@media (max-width: 759px) {
  .c-header { grid-template-columns: 1fr auto auto; }
  .c-header__nav { display: none !important; }
  .c-header__menu { display: flex !important; }
  .c-header .c-cell { padding: var(--space-3); gap: var(--space-3); }
}

/* SectionHeader */
.c-section-head { display: flex; justify-content: space-between; align-items: flex-end; gap: var(--space-6); padding: var(--space-12) var(--space-4) var(--space-8); }
.c-section-head h2 { margin: 0; font: 800 40px/1 var(--font-sans); letter-spacing: -.02em; text-transform: uppercase; }
.c-section-head--display h1 { margin: 0; font: 800 72px/.95 var(--font-sans); letter-spacing: -.03em; text-transform: uppercase; }
@media (max-width: 639px) { .c-section-head h2 { font-size: 28px; } .c-section-head--display h1 { font-size: 44px; } .c-section-head { flex-direction: column; align-items: flex-start; } }

/* FilterBar */
.c-filter { grid-auto-flow: row; grid-template-columns: auto auto 1fr auto auto; }
.c-filter .c-filter__spacer { border-left: 0; }
.c-filter .c-cell { display: flex; flex-direction: column; gap: var(--space-2); }
.c-filter__opts { display: flex; flex-wrap: wrap; gap: var(--space-1) var(--space-4); }
.c-filter__opts label { display: inline-flex; align-items: center; gap: var(--space-2); font: 500 16px/22px var(--font-sans); cursor: pointer; white-space: nowrap; }
.c-filter__opts .c-meta { font-size: 12px; }
.c-filter select { appearance: none; border: 0; background: transparent; color: var(--ink); font: 500 16px/22px var(--font-sans); padding: 0 20px 0 0; cursor: pointer; text-decoration: underline; text-underline-offset: 4px; background-image: linear-gradient(45deg, transparent 50%, currentColor 50%), linear-gradient(135deg, currentColor 50%, transparent 50%); background-position: right 6px top 10px, right 1px top 10px; background-size: 5px 5px; background-repeat: no-repeat; }
.c-filter select option { background: var(--bg); color: var(--ink); }
.c-filter .c-filter__status { grid-column: 1 / -1; flex-direction: row; flex-wrap: wrap; gap: var(--space-2) var(--space-4); display: flex; justify-content: space-between; align-items: center; border-left: 0; border-top: var(--size-rule) solid var(--rule); }
@media (max-width: 959px) {
  .c-filter { grid-template-columns: 1fr 1fr; }
  .c-filter .c-cell { border-left: 0; border-top: var(--size-rule) solid var(--rule); }
  .c-filter .c-cell:first-child { border-top: 0; }
  .c-filter .c-cell:first-child, .c-filter .c-filter__topics, .c-filter .c-filter__status { grid-column: 1 / -1; }
  .c-filter .c-filter__spacer { display: none; }
  .c-filter .c-filter__view { border-left: var(--size-rule) solid var(--rule); }
}

/* PostCard */
.c-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: var(--space-12) var(--space-8); padding: 0 var(--space-4); }
@media (max-width: 1199px) { .c-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
@media (max-width: 899px) { .c-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--space-8) var(--space-4); } }
@media (max-width: 539px) { .c-grid { grid-template-columns: 1fr; } }
.c-card { display: flex; flex-direction: column; color: var(--ink); text-decoration: none; }
.c-card__frame { position: relative; aspect-ratio: 4 / 5; border: var(--size-rule) solid var(--rule); background: var(--bg); overflow: hidden; transition: background var(--duration-fast); }
.c-card__frame img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; display: block; }
.c-card__frame .c-tags { position: absolute; top: var(--space-3); left: var(--space-3); right: var(--space-3); z-index: 1; }
.c-card__frame .c-meta--corner { position: absolute; right: var(--space-3); bottom: var(--space-3); z-index: 1; padding: 0 var(--space-1); background: var(--bg); color: var(--ink); }
.c-card__excerpt { position: absolute; inset: auto var(--space-3) var(--space-3); margin: 0; font: 400 15px/24px var(--font-sans); color: var(--ink-muted); display: -webkit-box; -webkit-line-clamp: 8; -webkit-box-orient: vertical; overflow: hidden; }
.c-card__body { padding: var(--space-3) var(--space-3) 0; display: flex; flex-direction: column; gap: 2px; }
.c-card__title { margin: 0; font: 500 16px/22px var(--font-sans); }
.c-card:hover .c-card__title { text-decoration: underline; text-underline-offset: 3px; }
.c-card:hover .c-card__frame { background: var(--hover); }
@media (max-width: 539px) { .c-card__frame { aspect-ratio: 4 / 3; } }

/* PostRow (Listenansicht als Tabelle) */
.c-table { width: 100%; border-collapse: collapse; font: 500 16px/22px var(--font-sans); }
.c-table th { text-align: left; font: 500 13px/16px var(--font-sans); letter-spacing: .02em; text-transform: uppercase; color: var(--ink-muted); padding: var(--space-3) var(--space-4); border-bottom: var(--size-rule) solid var(--rule); border-top: var(--size-rule) solid var(--rule); }
.c-table td { padding: var(--space-3) var(--space-4); border-bottom: var(--size-rule) solid var(--rule-soft); vertical-align: middle; }
.c-table tr:last-child td { border-bottom-color: var(--rule); }
.c-table tbody tr:hover { background: var(--hover); }
.c-table a { text-decoration: none; }
.c-table tr:hover a { text-decoration: underline; text-underline-offset: 3px; }
.c-table .c-meta { white-space: nowrap; }
.c-table__thumb { width: 56px; padding-right: 0 !important; }
.c-table__thumb span { display: block; width: 56px; height: 40px; border: var(--size-rule) solid var(--rule); overflow: hidden; }
.c-table__thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
@media (max-width: 639px) { .c-table .is-opt { display: none; } }

/* MediaGrid (Galerie): Bilder Kante an Kante, gemeinsame Linien */
.c-gallery { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); grid-auto-flow: dense; border-top: var(--size-rule) solid var(--rule); border-left: var(--size-rule) solid var(--rule); }
.c-gallery__item { position: relative; margin: 0; padding: 0; aspect-ratio: 1; border: 0; border-right: var(--size-rule) solid var(--rule); border-bottom: var(--size-rule) solid var(--rule); background: var(--bg); cursor: zoom-in; overflow: hidden; }
.c-gallery__item--wide { grid-column: span 2; aspect-ratio: auto; }
.c-gallery__item img { width: 100%; height: 100%; object-fit: cover; display: block; }
.c-gallery__item:hover img { opacity: .85; }
.c-gallery__item .c-meta { position: absolute; left: var(--space-2); bottom: var(--space-2); padding: 0 var(--space-1); background: var(--bg); color: var(--ink); opacity: 0; }
.c-gallery__item:hover .c-meta, .c-gallery__item:focus-visible .c-meta { opacity: 1; }
@media (max-width: 539px) { .c-gallery { grid-template-columns: 1fr 1fr; } }
.c-lightbox { position: fixed; inset: 0; z-index: 50; background: var(--scrim); color: #f2f2f2; display: grid; grid-template-rows: auto 1fr auto; }
.c-lightbox[hidden] { display: none; }
.c-lightbox__bar { display: flex; justify-content: space-between; align-items: center; padding: var(--space-3) var(--space-4); border-bottom: var(--size-rule) solid #f2f2f2; font: 500 16px/22px var(--font-sans); }
.c-lightbox__bar .c-meta { color: #f2f2f2; }
.c-lightbox__bar nav { display: flex; gap: var(--space-6); }
.c-lightbox__bar button { padding: 0; border: 0; background: none; color: #f2f2f2; font: inherit; cursor: pointer; text-decoration: underline; text-underline-offset: 4px; }
.c-lightbox__img { min-height: 0; display: flex; align-items: center; justify-content: center; padding: var(--space-4); }
.c-lightbox__img img { max-width: 100%; max-height: 100%; object-fit: contain; }
.c-lightbox__cap { padding: var(--space-3) var(--space-4); border-top: var(--size-rule) solid #f2f2f2; font: 400 14px/20px var(--font-sans); color: #f2f2f2; }

/* VideoEmbed (Zwei-Klick) */
.c-video { position: relative; aspect-ratio: 16 / 9; border: var(--size-rule) solid var(--rule); background: var(--bg); overflow: hidden; }
.c-video iframe, .c-video video { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }
.c-video__consent { position: absolute; inset: 0; display: flex; flex-direction: column; justify-content: space-between; padding: var(--space-4); gap: var(--space-4); }
.c-video__consent p { margin: 0; max-width: 460px; font: 400 14px/20px var(--font-sans); color: var(--ink); }
.c-video__actions { display: flex; flex-wrap: wrap; align-items: center; gap: var(--space-4) var(--space-6); }
.c-video__actions label { display: inline-flex; align-items: center; gap: var(--space-2); font: 400 14px/20px var(--font-sans); cursor: pointer; }
.c-video__cap { display: flex; justify-content: space-between; gap: var(--space-4); padding: var(--space-3) var(--space-3) 0; }

/* ArticleToc */
.c-toc { border-top: var(--size-rule) solid var(--rule); }
.c-toc__head { display: flex; justify-content: space-between; align-items: center; padding: var(--space-3) 0; border-bottom: var(--size-rule) solid var(--rule); }
.c-toc ol { list-style: none; margin: 0; padding: 0; counter-reset: toc; }
.c-toc li { border-bottom: var(--size-rule) solid var(--rule-soft); }
.c-toc li a { display: grid; grid-template-columns: 32px 1fr; padding: var(--space-2) 0; font: 500 15px/20px var(--font-sans); color: var(--ink-muted); text-decoration: none; }
.c-toc li a::before { counter-increment: toc; content: counter(toc, decimal-leading-zero); font: 400 12px/20px var(--font-mono); color: var(--ink-muted); }
.c-toc li a:hover { color: var(--ink); text-decoration: underline; text-underline-offset: 3px; }
.c-toc li a[aria-current="true"] { color: var(--ink); }
.c-toc li a[aria-current="true"]::before { content: "■"; color: var(--accent); }
.c-toc li.is-sub a { padding-left: var(--space-4); }
.c-toc__progress { height: 4px; background: var(--bg); border-bottom: var(--size-rule) solid var(--rule); }
.c-toc__progress span { display: block; height: 100%; background: var(--ink); }

/* SiteFooter */
.c-footer { grid-template-columns: repeat(4, minmax(0, 1fr)); margin-top: var(--space-16); }
.c-footer .c-cell { display: flex; flex-direction: column; justify-content: space-between; gap: var(--space-12); min-height: 260px; padding: var(--space-4); }
.c-footer ul { list-style: none; margin: 0 0 var(--space-6); padding: 0; font: 500 16px/22px var(--font-sans); }
.c-footer ul:last-child { margin-bottom: 0; }
.c-footer ul a { text-decoration: none; }
.c-footer ul a:hover { text-decoration: underline; text-underline-offset: 3px; }
.c-footer p { margin: 0; font: 500 16px/22px var(--font-sans); }
.c-footer__head { font: 500 16px/22px var(--font-sans); }
@media (max-width: 899px) {
  .c-footer { grid-auto-flow: row; grid-template-columns: 1fr 1fr; }
  .c-footer .c-cell { min-height: 180px; border-top: var(--size-rule) solid var(--rule); }
  .c-footer .c-cell:nth-child(-n+2) { border-top: 0; }
  .c-footer .c-cell:nth-child(odd) { border-left: 0; }
}
@media (max-width: 539px) {
  .c-footer { grid-template-columns: 1fr; }
  .c-footer .c-cell { border-left: 0; min-height: 0; }
  .c-footer .c-cell:nth-child(2) { border-top: var(--size-rule) solid var(--rule); }
}

@media (prefers-reduced-motion: reduce) { *, *::before, *::after { transition: none !important; } }
