/* Webseite – Stil für alle öffentlichen Seiten (keine externen Schriften oder Dienste) */
:root {
  --bg: #f6f5f1; --bg-alt: #ecebe5; --fg: #1b1b19; --muted: #6a6a64; --card: #ffffff; --line: #dcdbd4;
  --accent: #2f6fed; --accent-fg: #fff; --err: #b3261e;
  --hover-dim: .35; --lb-dim: .92; --radius: 10px; --gap: 10px;
  --head-h: 64px; --wrap: 1240px; --narrow: 720px;
  --serif: "Iowan Old Style", "Palatino Linotype", Palatino, "Book Antiqua", Georgia, serif;
  color-scheme: light;
}
:root[data-theme="dark"] {
  --bg: #121211; --bg-alt: #1a1a18; --fg: #ecebe7; --muted: #9b9a93; --card: #1e1e1c; --line: #2e2e2b;
  --accent: #7ba5ff; --accent-fg: #0b0b0b; --err: #ff8a80;
  color-scheme: dark;
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; scroll-padding-top: calc(var(--head-h) + 8px); }
body {
  margin: 0; min-height: 100vh; display: flex; flex-direction: column;
  background: var(--bg); color: var(--fg);
  font: 17px/1.6 system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", sans-serif;
  transition: background .25s, color .25s;
}
body > main { flex: 1; }
img { max-width: 100%; }
a { color: inherit; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.muted { color: var(--muted); }
.small { font-size: .85rem; }
[hidden] { display: none !important; }
.skip { position: absolute; left: 12px; top: -60px; z-index: 100; background: var(--accent); color: var(--accent-fg); padding: 8px 14px; border-radius: 8px; }
.skip:focus { top: 12px; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

.btn {
  display: inline-block; border: 1px solid var(--line); background: var(--card); color: var(--fg);
  padding: 9px 18px; border-radius: 999px; font: inherit; font-size: .92rem; cursor: pointer; text-decoration: none;
  transition: border-color .2s, transform .2s;
}
.btn:hover { border-color: var(--fg); }
.btn.primary { background: var(--accent); border-color: var(--accent); color: var(--accent-fg); font-weight: 600; }
.theme-toggle {
  display: inline-grid; place-items: center; width: 36px; height: 36px; padding: 0; border: 1px solid transparent;
  border-radius: 50%; background: transparent; color: inherit; cursor: pointer;
}
.theme-toggle:hover { border-color: currentColor; }

/* ---------- Kopfzeile ---------- */
.site-head {
  position: sticky; top: 0; z-index: 40; height: var(--head-h);
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
  padding: 0 max(18px, 3vw);
  background: color-mix(in srgb, var(--bg) 88%, transparent);
  -webkit-backdrop-filter: saturate(1.4) blur(12px); backdrop-filter: saturate(1.4) blur(12px);
  border-bottom: 1px solid var(--line);
  transition: background .3s, border-color .3s, color .3s;
}
.brand { display: grid; line-height: 1.15; text-decoration: none; font-weight: 650; font-size: 1.08rem; letter-spacing: -.01em; }
.brand small { font-weight: 400; font-size: .78rem; opacity: .75; letter-spacing: 0; }
.nav { display: flex; align-items: center; gap: 4px; }
.nav a { text-decoration: none; padding: 7px 12px; border-radius: 999px; font-size: .95rem; }
.nav a:hover { background: color-mix(in srgb, currentColor 10%, transparent); }
.nav a[aria-current="page"] { font-weight: 650; box-shadow: inset 0 -2px 0 currentColor; border-radius: 0; }
.nav-toggle { display: none; }

/* über dem Header-Video: transparent, nach dem Scrollen normal */
.site-head.over { position: fixed; left: 0; right: 0; background: transparent; border-color: transparent; color: #fff;
  -webkit-backdrop-filter: none; backdrop-filter: none; }
.site-head.over .brand, .site-head.over .nav { text-shadow: 0 1px 8px rgb(0 0 0 / .45); }
.site-head.over.solid { background: color-mix(in srgb, var(--bg) 88%, transparent); color: var(--fg); border-color: var(--line);
  -webkit-backdrop-filter: saturate(1.4) blur(12px); backdrop-filter: saturate(1.4) blur(12px); }
.site-head.over.solid .brand, .site-head.over.solid .nav { text-shadow: none; }

@media (max-width: 760px) {
  .nav-toggle {
    display: grid; gap: 5px; width: 42px; height: 42px; place-content: center; border: 0; background: transparent; color: inherit; cursor: pointer;
  }
  .nav-toggle span { display: block; width: 22px; height: 2px; background: currentColor; border-radius: 2px; transition: transform .25s, opacity .25s; }
  .nav-toggle[aria-expanded="true"] span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
  .nav-toggle[aria-expanded="true"] span:nth-child(2) { opacity: 0; }
  .nav-toggle[aria-expanded="true"] span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }
  .nav {
    position: fixed; top: var(--head-h); left: 0; right: 0; flex-direction: column; align-items: stretch; gap: 0;
    padding: 8px 14px 16px; background: var(--bg); color: var(--fg); border-bottom: 1px solid var(--line);
    box-shadow: 0 12px 30px rgb(0 0 0 / .12); transform: translateY(-8px); opacity: 0; visibility: hidden;
    transition: opacity .2s, transform .2s, visibility .2s;
  }
  .nav.open { opacity: 1; transform: none; visibility: visible; }
  .nav a { padding: 12px 10px; border-radius: 8px; font-size: 1.05rem; }
  .nav a[aria-current="page"] { box-shadow: none; background: var(--bg-alt); }
  .site-head.over .nav { text-shadow: none; }
  .nav .theme-toggle { align-self: flex-start; margin: 6px 4px 0; border-color: var(--line); }
}

/* ---------- Header-Video ---------- */
.hero { position: relative; display: grid; place-items: center; overflow: hidden; color: #fff; background: #1a1a18; isolation: isolate; }
.hero.h-full { min-height: 100vh; min-height: 100svh; }
.hero.h-large { min-height: 78vh; min-height: 78svh; }
.hero.h-medium { min-height: 52vh; min-height: 52svh; }
.hero-media { position: absolute; inset: 0; z-index: -1; }
.hero-media::after { content: ""; position: absolute; inset: 0; background: linear-gradient(180deg, rgb(0 0 0 / calc(var(--hero-dim) + .18)) 0%, rgb(0 0 0 / var(--hero-dim)) 35%, rgb(0 0 0 / calc(var(--hero-dim) + .12)) 100%); }
.hero-poster, .hero-video { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.hero-video { opacity: 0; transition: opacity 1.2s; }
.hero-video.playing { opacity: 1; }
.hero-text { text-align: center; padding: calc(var(--head-h) + 20px) 24px 70px; max-width: 900px; }
.hero-text h1 { margin: 0; font-family: var(--serif); font-weight: 500; font-size: clamp(2.2rem, 6vw, 4.6rem); line-height: 1.05; letter-spacing: -.01em; text-shadow: 0 2px 24px rgb(0 0 0 / .35); }
.hero-logo { display: block; height: auto; margin: 0 auto 22px; filter: drop-shadow(0 2px 18px rgb(0 0 0 / .35)); }
.hero-logo-h { margin: 0; line-height: 0; }
.hero-logo-h .hero-logo { margin-bottom: 0; }
.hero-text p { margin: 16px auto 0; max-width: 46ch; font-size: clamp(1.02rem, 1.8vw, 1.3rem); opacity: .92; text-shadow: 0 1px 12px rgb(0 0 0 / .4); }
.hero-down {
  position: absolute; bottom: 22px; left: 50%; transform: translateX(-50%); width: 44px; height: 44px; display: grid; place-items: center;
  border: 1px solid rgb(255 255 255 / .6); border-radius: 50%; text-decoration: none; color: #fff; font-size: 1.15rem;
  animation: bob 2.4s ease-in-out infinite;
}
@keyframes bob { 0%, 100% { transform: translate(-50%, 0); } 50% { transform: translate(-50%, 6px); } }
.hero-pause {
  position: absolute; right: 18px; bottom: 22px; width: 38px; height: 38px; border-radius: 50%; border: 1px solid rgb(255 255 255 / .5);
  background: rgb(0 0 0 / .25); color: #fff; font-size: .7rem; letter-spacing: -1px; cursor: pointer;
}
.hero-pause.paused span { letter-spacing: 0; }

/* ---------- Sektionen ---------- */
.sec { padding: clamp(48px, 8vw, 104px) max(18px, 4vw); }
.sec.alt { background: var(--bg-alt); }
.sec + .sec:not(.alt):not(.sec-image) { padding-top: clamp(16px, 3vw, 40px); }
.sec.alt + .sec, .sec-image + .sec { padding-top: clamp(48px, 8vw, 104px); }
.narrow { max-width: var(--narrow); margin: 0 auto; }
.narrow-l { max-width: var(--narrow); }
.wide-in { max-width: var(--wrap); margin: 0 auto; }
.sec h2, .page h1, .post-head h1 { font-family: var(--serif); font-weight: 500; letter-spacing: -.01em; line-height: 1.15; }
.sec h2 { font-size: clamp(1.7rem, 3.4vw, 2.5rem); margin: 0 0 .6em; }
.intro h1 { font-family: var(--serif); font-weight: 500; font-size: clamp(2rem, 5vw, 3.4rem); margin: 0; line-height: 1.1; }
.lead { font-size: 1.2rem; color: var(--muted); margin-top: .6em; }

.prose p, .prose ul, .prose blockquote { margin: 0 0 1.1em; }
.prose h2 { font-family: var(--serif); font-weight: 500; font-size: 1.7rem; margin: 1.6em 0 .5em; line-height: 1.2; }
.prose h3 { font-size: 1.2rem; margin: 1.5em 0 .4em; }
.prose > :first-child { margin-top: 0; }
.prose a { color: var(--accent); text-underline-offset: 3px; }
.prose ul { padding-left: 1.3em; }
.prose blockquote { border-left: 3px solid var(--line); padding: 2px 0 2px 18px; color: var(--muted); font-family: var(--serif); font-size: 1.15rem; font-style: italic; }
.prose blockquote p { margin: 0; }
.prose hr { border: 0; height: 1px; width: min(240px, 40%); margin: 2.6em auto; background: var(--muted); opacity: .45; }

/* Bilder im Text */
.fig { margin: 2em 0; }
.fig img { display: block; width: 100%; height: auto; border-radius: var(--radius); }
.fig figcaption, .band figcaption { margin-top: 8px; font-size: .88rem; color: var(--muted); text-align: center; }
.fig.wide { margin-left: calc(50% - min(50vw, 600px)); margin-right: calc(50% - min(50vw, 600px)); }
@media (max-width: 760px) { .fig.wide { margin-left: calc(-1 * max(18px, 4vw)); margin-right: calc(-1 * max(18px, 4vw)); } .fig.wide img { border-radius: 0; } }
.figrow { display: flex; gap: var(--gap); margin: 2em 0; }
.figrow .fig { margin: 0; flex: var(--ar) 1 0; min-width: 0; }
@media (max-width: 560px) { .figrow { flex-direction: column; } }
.zoom { display: block; cursor: zoom-in; }

/* Bild + Text */
.split { max-width: var(--wrap); margin: 0 auto; display: grid; grid-template-columns: 1.15fr 1fr; gap: clamp(28px, 5vw, 72px); align-items: center; }
.split.img-right .split-img { order: 2; }
.split.no-img { grid-template-columns: 1fr; max-width: var(--narrow); }
.split-img img { display: block; width: 100%; height: auto; border-radius: var(--radius); }
@media (max-width: 860px) { .split { grid-template-columns: 1fr; } .split.img-right .split-img { order: 0; } }

/* Breites Bild */
.sec-image { padding: 0; }
.band { margin: 0; }
.band img { display: block; width: 100%; height: auto; max-height: 92vh; object-fit: cover; }
.band figcaption { padding: 0 18px 8px; }

/* Galerie-Ausschnitt */
.teaser-grid { display: grid; gap: var(--gap); grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); margin-top: 28px; }
.tile { position: relative; overflow: hidden; border-radius: var(--radius); aspect-ratio: 4 / 3; background: var(--line); }
.tile img { width: 100%; height: 100%; object-fit: cover; display: block; transition: transform .45s cubic-bezier(.2, .7, .2, 1); }
.veil { position: absolute; inset: 0; background: #000; opacity: 0; transition: opacity .3s; pointer-events: none; }
@media (hover: hover) { .tile:hover img { transform: scale(1.05); } .tile:hover .veil { opacity: var(--hover-dim); } }
.cta { margin: 28px 0 0; text-align: center; }

/* Beitragskacheln */
.post-grid { display: grid; gap: 28px; grid-template-columns: repeat(auto-fill, minmax(290px, 1fr)); margin-top: 8px; }
.card-post a { display: flex; flex-direction: column; height: 100%; text-decoration: none; background: var(--card); border: 1px solid var(--line); border-radius: calc(var(--radius) + 4px); overflow: hidden; transition: transform .25s, box-shadow .25s; }
.card-post a:hover { transform: translateY(-3px); box-shadow: 0 14px 34px rgb(0 0 0 / .1); }
.cp-img { aspect-ratio: 3 / 2; overflow: hidden; background: var(--line); }
.cp-img img { width: 100%; height: 100%; object-fit: cover; display: block; }
.cp-body { display: grid; gap: 6px; padding: 18px 20px 20px; flex: 1; align-content: start; }
.cp-body time { font-size: .82rem; color: var(--muted); }
.cp-body strong { font-family: var(--serif); font-weight: 500; font-size: 1.35rem; line-height: 1.2; }
.cp-ex { color: var(--muted); font-size: .95rem; }
.more { margin-top: 6px; font-size: .9rem; color: var(--accent); }

/* ---------- Unterseiten ---------- */
.page { padding: clamp(36px, 6vw, 72px) max(18px, 4vw) clamp(48px, 7vw, 96px); }
.page h1 { font-size: clamp(2rem, 4.4vw, 3rem); margin: 0 0 .5em; }
.empty { text-align: center; color: var(--muted); padding: 60px 0; }
.post-head { margin-bottom: 28px; }
.post-head h1 { margin: .15em 0 0; }
.post-head .muted a { color: inherit; }
.post-cover { margin: 0 auto 40px; max-width: 1100px; }
.post-cover img { display: block; width: 100%; height: auto; max-height: 80vh; object-fit: cover; border-radius: var(--radius); }
.post .prose { font-size: 1.08rem; line-height: 1.7; }
.post-nav { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; margin-top: 56px; padding-top: 24px; border-top: 1px solid var(--line); }
.post-nav a { display: grid; text-decoration: none; font-family: var(--serif); font-size: 1.1rem; }
.post-nav a small { font-family: system-ui, sans-serif; color: var(--muted); font-size: .8rem; }
.post-nav a.r { text-align: right; grid-column: 2; }
.draft-note { max-width: var(--narrow); margin: 0 auto 20px; padding: 8px 14px; border-radius: 8px; background: #f7e2a8; color: #4a3800; font-size: .9rem; }
.legal { font-size: 1rem; }
.legal h2 { font-size: 1.3rem; }

/* ---------- Fußzeile ---------- */
.site-foot { border-top: 1px solid var(--line); padding: 28px max(18px, 4vw); font-size: .9rem; color: var(--muted); }
.foot-in { max-width: var(--wrap); margin: 0 auto; display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px 24px; }
.foot-text p { margin: 0; }
.foot-text a { color: inherit; }
.foot-nav { display: flex; align-items: center; gap: 18px; }
.foot-links { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 18px; margin-left: auto; }
.foot-links a { color: inherit; text-decoration: none; }
.foot-links a:hover { color: var(--fg); text-decoration: underline; }
.foot-links .ext { font-size: .75em; margin-left: 3px; opacity: .7; }
.foot-links + .foot-nav { padding-left: 18px; border-left: 1px solid var(--line); }
.foot-nav a { color: inherit; text-decoration: none; }
.foot-nav a:hover { color: var(--fg); text-decoration: underline; }

/* ---------- Anmeldung ---------- */
.login { min-height: 80vh; display: grid; place-items: center; padding: 20px; }
.login-card { width: min(380px, 100%); background: var(--card); border: 1px solid var(--line); border-radius: calc(var(--radius) + 6px); padding: 32px 28px 28px; display: grid; gap: 10px; }
.login-card h1 { margin: 0; font-size: 1.4rem; }
.login-card p { margin: 0; }
.login-card label { font-size: .85rem; color: var(--muted); }
.login-card input[type=password] { padding: 10px 12px; border: 1px solid var(--line); border-radius: 8px; background: var(--bg); color: var(--fg); font: inherit; }
.err { color: var(--err); font-size: .9rem; }

/* ---------- Galerie-Seite ---------- */
.page-gallery { padding: 24px max(16px, 3vw) 56px; }
.g-top { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px 20px; margin-bottom: 8px; }
.g-top h1 { margin: 0; font-family: var(--serif); font-weight: 500; font-size: clamp(1.8rem, 3.4vw, 2.6rem); }
.tools { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.search input { width: min(260px, 60vw); padding: 8px 14px; border: 1px solid var(--line); border-radius: 999px; background: var(--card); color: var(--fg); font: inherit; font-size: .92rem; }
.seg { display: inline-flex; border: 1px solid var(--line); border-radius: 999px; overflow: hidden; background: var(--card); }
.seg button { border: 0; background: transparent; color: var(--muted); padding: 7px 12px; font-size: 1rem; cursor: pointer; line-height: 1; }
.seg button + button { border-left: 1px solid var(--line); }
.seg button.on { background: var(--accent); color: var(--accent-fg); }
.chips { display: flex; flex-wrap: wrap; gap: 8px; padding: 10px 0 16px; }
.chip { border: 1px solid var(--line); background: var(--card); color: var(--fg); padding: 5px 13px; border-radius: 999px; font: inherit; font-size: .88rem; cursor: pointer; }
.chip span { color: var(--muted); font-size: .8em; margin-left: 3px; }
.chip.active { background: var(--accent); border-color: var(--accent); color: var(--accent-fg); }
.chip.active span { color: inherit; opacity: .8; }

.gallery .item { position: relative; display: block; overflow: hidden; border-radius: var(--radius); background: var(--line); isolation: isolate; cursor: zoom-in; }
.gallery .item img { display: block; width: 100%; height: 100%; object-fit: cover; transition: transform .45s cubic-bezier(.2, .7, .2, 1); }
@media (hover: hover) {
  .gallery .item:hover img { transform: scale(1.05); }
  .gallery .item:hover .veil { opacity: var(--hover-dim); }
}
.gallery .item:focus-visible .veil { opacity: var(--hover-dim); }
.gallery .item.out { display: none; }
.gallery[data-layout="grid"] { display: grid; gap: var(--gap); grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); }
.gallery[data-layout="grid"] .item { aspect-ratio: 4 / 3; }
.gallery[data-layout="mosaic"] { column-width: 260px; column-gap: var(--gap); }
.gallery[data-layout="mosaic"] .item { margin-bottom: var(--gap); break-inside: avoid; aspect-ratio: var(--ar); }
.gallery[data-layout="rows"] { display: flex; flex-wrap: wrap; gap: var(--gap); }
.gallery[data-layout="rows"] .item { flex: calc(var(--ar) * 100) 1 calc(var(--ar) * 240px); aspect-ratio: var(--ar); }
.gallery[data-layout="rows"]::after { content: ""; flex: 100000 1 0; }
.gallery[data-layout="collage"] { display: grid; gap: var(--gap); grid-auto-flow: dense; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); grid-auto-rows: 170px; }
.gallery[data-layout="collage"] .item { height: 100%; }
.gallery[data-layout="collage"] .item.wide { grid-column: span 2; }
.gallery[data-layout="collage"] .item.tall { grid-row: span 2; }
.gallery[data-layout="collage"] .item.big { grid-column: span 2; grid-row: span 2; }

/* ---------- Lightbox ---------- */
.lb { position: fixed; inset: 0; z-index: 60; display: grid; place-items: center; padding: 56px 64px 24px; background: rgb(0 0 0 / var(--lb-dim)); animation: lbIn .2s ease-out; }
@keyframes lbIn { from { opacity: 0; } to { opacity: 1; } }
.lb-stage { margin: 0; display: grid; gap: 12px; justify-items: center; max-width: 100%; max-height: 100%; min-height: 0; }
.lb-img { max-width: 100%; max-height: calc(100vh - 150px); border-radius: var(--radius); box-shadow: 0 10px 40px rgb(0 0 0 / .5); background: #222; transition: opacity .2s; }
.lb-img.loading { opacity: .35; }
.lb-cap { text-align: center; color: #f1f1ee; max-width: 70ch; display: grid; gap: 2px; }
.lb-title { font-size: 1.05rem; font-weight: 600; }
.lb-title:empty, .lb-meta:empty { display: none; }
.lb-meta { font-size: .85rem; color: #b8b8b2; }
.lb-count { position: absolute; top: 18px; left: 20px; color: #b8b8b2; font-size: .85rem; }
.lb-close, .lb-nav { position: absolute; border: 0; background: rgb(255 255 255 / .12); color: #fff; cursor: pointer; width: 44px; height: 44px; border-radius: 50%; font-size: 1.4rem; line-height: 1; display: grid; place-items: center; transition: background .2s; }
.lb-close:hover, .lb-nav:hover { background: rgb(255 255 255 / .25); }
.lb-close:focus-visible, .lb-nav:focus-visible { outline: 2px solid #fff; outline-offset: 2px; }
.lb-close { top: 12px; right: 14px; }
.lb-nav { top: 50%; transform: translateY(-50%); font-size: 2rem; padding-bottom: 4px; }
.lb-prev { left: 12px; }
.lb-next { right: 12px; }
body.lb-open { overflow: hidden; }

@media (max-width: 640px) {
  body { font-size: 16px; }
  .lb { padding: 56px 8px 16px; }
  .lb-nav { top: auto; bottom: 14px; transform: none; }
  .lb-prev { left: 14px; }
  .lb-next { right: 14px; }
  .lb-img { max-height: calc(100vh - 190px); }
  .gallery[data-layout="grid"] { grid-template-columns: repeat(2, 1fr); }
  .gallery[data-layout="mosaic"] { column-width: 150px; }
  .gallery[data-layout="collage"] { grid-template-columns: repeat(3, 1fr); grid-auto-rows: 100px; }
  .teaser-grid { grid-template-columns: repeat(2, 1fr); }
  .foot-in { flex-direction: column; align-items: flex-start; }
  .foot-links { margin-left: 0; }
  .foot-links + .foot-nav { padding-left: 0; border-left: 0; }
  .post-nav { grid-template-columns: 1fr; }
  .post-nav a.r { grid-column: 1; }
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  * { transition: none !important; animation: none !important; }
}
