:root {
  --bg: #fff;
  --fg: #1d1d1b;
  --muted: #6a6a66;
  --accent: #8c1d18;
  --line: #e3e0da;
  --soft: #f6f4ef;
  --maxw: 70rem;
  --ed-bvc: #8c1d18;
  --ed-bnve: #1d5a8c;
}
@media (prefers-color-scheme: dark) {
  :root { --bg: #181816; --fg: #ecebe6; --muted: #a3a29b; --accent: #e07a70; --line: #34332f; --soft: #22221f; --ed-bvc: #e07a70; --ed-bnve: #7fb4e0; }
  .brand img, .hero img, .logos img, .ed-intro img, .ed-logo { filter: invert(1); }
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--bg); color: var(--fg);
  font: 1.0625rem/1.65 Georgia, "Droid Serif", "Times New Roman", serif;
}
.wrap { max-width: var(--maxw); margin: 0 auto; padding: 0 1rem; }
main.wrap { padding-top: 2rem; padding-bottom: 3rem; min-height: 60vh; }
a { color: var(--accent); text-underline-offset: .15em; }
a:hover { text-decoration-thickness: 2px; }
h1, h2, h3, h4 { font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif; line-height: 1.25; font-weight: 600; }
h1 { font-size: clamp(1.7rem, 4vw, 2.4rem); margin: 0 0 1rem; }
h2 { font-size: 1.5rem; margin: 2.2rem 0 .8rem; }
h3 { font-size: 1.15rem; margin: 0 0 .4rem; }
img, video, iframe { max-width: 100%; height: auto; }
video, iframe { display: block; width: 100%; max-width: 48rem; margin: 1rem 0; }
iframe { aspect-ratio: 16/9; border: 0; }
hr { border: 0; border-top: 1px solid var(--line); margin: 1.5rem 0; }

/* Kopf */
.site-header { border-bottom: 1px solid var(--line); background: var(--bg); position: sticky; top: 0; z-index: 10; }
.header-in { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: .4rem 1.5rem; padding-top: .6rem; padding-bottom: .6rem; }
.brand { display: flex; align-items: center; gap: .6rem; text-decoration: none; color: var(--fg);
  font: 600 clamp(1.35rem, 4.5vw, 1.9rem) system-ui, sans-serif; line-height: 1.15; }
.brand img { height: 3rem; width: auto; }
.brand-block { display: flex; flex-direction: column; gap: .1rem; }
.editions { margin: 0; font: .8rem system-ui, sans-serif; color: var(--muted); }
.editions a { display: inline-flex; align-items: center; gap: .3rem; color: var(--fg); text-decoration: none; border-bottom: 1px solid var(--line); }
.editions a:hover { border-bottom-color: var(--accent); }
@media (max-width: 30rem) { .editions-label { display: none; } }
.main-nav { display: flex; flex-wrap: wrap; gap: .2rem 1.1rem; font: .95rem system-ui, sans-serif; }
.main-nav a { color: var(--fg); text-decoration: none; padding: .25rem 0; border-bottom: 2px solid transparent; }
.main-nav a:hover, .main-nav a[aria-current] { border-bottom-color: var(--accent); }

/* Fuß */
.site-footer { border-top: 1px solid var(--line); background: var(--soft); color: var(--muted); font: .9rem system-ui, sans-serif; padding: 1.2rem 0; }
.site-footer p { margin: .2rem 0; }
.site-footer a { color: inherit; }

/* Startseite */
.hero { text-align: center; padding: 2rem 0 1rem; }
.hero img { width: min(260px, 60vw); height: auto; }
.hero h1 { margin: .6rem 0 .2rem; font-size: clamp(2rem, 6vw, 3rem); }
.lead { font-size: 1.25rem; color: var(--muted); margin: 0 0 1rem; }
.hero-links { display: flex; flex-wrap: wrap; gap: .6rem; justify-content: center; }
.btn { display: inline-block; padding: .55rem 1.2rem; border-radius: 3px; background: var(--accent); color: #fff; text-decoration: none; font: .95rem system-ui, sans-serif; border: 1px solid var(--accent); }
.btn.ghost { background: transparent; color: var(--accent); }
.more { font: .95rem system-ui, sans-serif; margin: .4rem 0 0; }
.crumb { font: .9rem system-ui, sans-serif; margin: 0 0 1.2rem; }

/* Karten */
.cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 19rem), 1fr)); gap: 1.6rem; }
.card { display: flex; flex-direction: column; border: 1px solid var(--line); border-radius: 4px; background: var(--bg); overflow: hidden; }
.card-img { display: flex; justify-content: center; align-items: center; background: var(--soft); padding: 1rem; height: 18rem; }
.card-img img { max-height: 100%; width: auto; object-fit: contain; box-shadow: 0 2px 8px rgba(0,0,0,.18); }
.card-text { padding: 1rem 1.1rem 1.1rem; display: flex; flex-direction: column; flex: 1; }
.card-text h3 a { color: var(--fg); text-decoration: none; }
.card-text h3 a:hover { color: var(--accent); }
.card-text p { margin: 0 0 .6rem; font-size: .98rem; }
.card-text .more { margin-top: auto; }

/* Detailseiten */
.detail { display: block; }
.detail.has-cover { display: grid; grid-template-columns: minmax(10rem, 22rem) 1fr; gap: 2rem; align-items: start; }
.cover { margin: 0; }
.cover a { display: block; cursor: zoom-in; }
.cover img { width: 100%; box-shadow: 0 3px 12px rgba(0,0,0,.25); }
.prose { max-width: 46rem; }
.prose img { display: block; margin: 1.2rem 0; }
.prose p { margin: 0 0 1rem; }
.prose ul, .prose ol { padding-left: 1.4rem; }
.meta { color: var(--muted); font: .9rem system-ui, sans-serif; margin-top: -.6rem; }
.logos { display: flex; gap: 1.5rem; flex-wrap: wrap; margin: 1rem 0; }
.logos img { width: 9rem; margin: 0; }
.logos a { display: flex; flex-direction: column; align-items: center; gap: .4rem; text-decoration: none; color: var(--fg); font: .9rem system-ui, sans-serif; }
.logos a:hover span { color: var(--accent); text-decoration: underline; }
@media (max-width: 40rem) {
  .detail.has-cover { grid-template-columns: 1fr; }
  .cover { max-width: 20rem; }
}

/* Listen */
.news-list { list-style: none; padding: 0; margin: 0 0 1rem; }
.news-list li { padding: .5rem 0; border-bottom: 1px solid var(--line); }
.news-list .leer { color: var(--muted); border-bottom: 0; }
.news-list time { display: inline-block; min-width: 6.5rem; color: var(--muted); font: .9rem system-ui, sans-serif; }
.titelliste ul { list-style: none; padding: 0; }
.titelliste li { padding: .7rem 0; border-bottom: 1px solid var(--line); font-size: 1rem; }

details.titelliste { margin-top: 2.5rem; border: 1px solid var(--line); border-radius: 4px; }
.titelliste summary { cursor: pointer; padding: .8rem 1rem; font: 600 1.15rem system-ui, sans-serif; color: var(--accent); }
.titelliste summary:hover { background: var(--soft); }
.titelliste ul { margin: 0; padding: 0 1rem .5rem; border-top: 1px solid var(--line); }

details.year { border: 1px solid var(--line); border-radius: 4px; margin: 0 0 .6rem; }
details.year summary { cursor: pointer; padding: .6rem 1rem; font: 600 1.05rem system-ui, sans-serif; color: var(--accent); }
details.year summary:hover { background: var(--soft); }
details.year .news-list { margin: 0; padding: 0 1rem; border-top: 1px solid var(--line); }

.more-btn { margin-top: 1.2rem; }
.more-btn .btn { padding: .65rem 1.4rem; font-size: 1rem; }

/* Sprung an den Seitenanfang: schwebender Button (ohne JavaScript) */
@media (prefers-reduced-motion: no-preference) { html { scroll-behavior: smooth; } }
.to-top { position: fixed; right: max(1rem, env(safe-area-inset-right)); bottom: max(1rem, env(safe-area-inset-bottom)); z-index: 20; margin: 0; font: .95rem system-ui, sans-serif; }
.to-top a { display: inline-block; padding: .55rem .9rem; border: 1px solid var(--accent); border-radius: 3px; background: var(--bg); color: var(--accent); text-decoration: none; box-shadow: 0 2px 8px rgba(0,0,0,.25); }
.to-top a:hover, .to-top a:focus-visible { background: var(--accent); color: var(--bg); }
/* Wo unterstützt: erst nach etwas Scrollen einblenden; sonst immer sichtbar */
@supports (animation-timeline: scroll()) {
  .to-top { opacity: 0; visibility: hidden; animation: to-top-in linear both; animation-timeline: scroll(root); animation-range: 150px 400px; }
  @keyframes to-top-in { to { opacity: 1; visibility: visible; } }
}
@media print { .to-top { display: none; } }

/* Videokacheln (Venezianische Eindrücke) */
.video-card video { display: block; width: 100%; max-width: none; margin: 0; aspect-ratio: 16 / 9; object-fit: contain; background: #000; }

/* Editionen: Filter der Veröffentlichungen (ohne JavaScript, per :target; Standard = alle Titel) */
.anchor { display: block; height: 0; scroll-margin-top: 10rem; }
.filter { display: flex; flex-wrap: wrap; gap: .5rem; margin: 0 0 1.4rem; font: .95rem system-ui, sans-serif; }
.filter a { padding: .4rem .9rem; border: 1px solid var(--line); border-radius: 999px; color: var(--fg); text-decoration: none; }
.filter a:hover { border-color: var(--accent); }
.filter a span { color: var(--muted); margin-left: .3rem; }
main:not(:has(.anchor:target)) .f-alle,
main:has(#alle:target) .f-alle,
main:has(#edition-bonner-verlags-comptoir:target) .f-bvc,
main:has(#edition-bonn-venedig:target) .f-bnve { background: var(--accent); border-color: var(--accent); color: #fff; }
main:not(:has(.anchor:target)) .f-alle span,
main:has(#alle:target) .f-alle span,
main:has(#edition-bonner-verlags-comptoir:target) .f-bvc span,
main:has(#edition-bonn-venedig:target) .f-bnve span { color: inherit; opacity: .8; }
main:has(#edition-bonner-verlags-comptoir:target) [data-edition="bnve"],
main:has(#edition-bonn-venedig:target) [data-edition="bvc"] { display: none; }
.ed-intro { display: none; align-items: center; gap: 1rem; margin: 0 0 1.4rem; }
.ed-intro img { flex: none; width: 3rem; max-width: 3rem; height: auto; margin: 0; }
.ed-intro p { margin: 0; }
main:has(#edition-bonner-verlags-comptoir:target) .ed-intro-bvc,
main:has(#edition-bonn-venedig:target) .ed-intro-bnve { display: flex; }
body:has(#edition-bonner-verlags-comptoir:target) .editions a[data-ed="bvc"],
body:has(#edition-bonn-venedig:target) .editions a[data-ed="bnve"] { border-bottom-color: var(--accent); font-weight: 600; }

/* Edition und Erscheinungsdatum auf den Karten */
.card-meta { display: flex; flex-wrap: wrap; align-items: center; gap: .3rem .7rem; margin: 0 0 .5rem !important; font: .8rem system-ui, sans-serif !important; color: var(--muted); }
.badge { padding: .1rem .55rem; border: 1px solid currentColor; border-radius: 999px; font-weight: 600; }
.badge-bvc { color: var(--ed-bvc); }
.badge-bnve { color: var(--ed-bnve); }

/* kleine Editions-Logos (Kopfzeile, Filter, Karten) */
.ed-logo { display: inline-block; flex: none; width: auto; height: 1rem; max-width: none; margin: 0; vertical-align: middle; }
.filter a { display: inline-flex; align-items: center; gap: .45rem; }
.filter a .ed-logo { height: 1.1rem; }
.badge { display: inline-flex; align-items: center; gap: .35rem; }
.badge .ed-logo { height: .95rem; }
/* Logo im aktiven Filter-Button: hell auf dunklem Grund */
main:has(#edition-bonner-verlags-comptoir:target) .f-bvc .ed-logo,
main:has(#edition-bonn-venedig:target) .f-bnve .ed-logo { filter: invert(1); }
@media (prefers-color-scheme: dark) {
  main:has(#edition-bonner-verlags-comptoir:target) .f-bvc .ed-logo,
  main:has(#edition-bonn-venedig:target) .f-bnve .ed-logo { filter: none; }
}
