/* Ambient – helles, ruhiges Pelican-Theme. Keine externen Schriften oder Dienste. */

:root {
  --bg: #f6f3ee;
  --surface: rgba(255, 255, 255, .62);
  --surface-solid: #fffdfa;
  --line: rgba(60, 50, 40, .10);
  --text: #2b2924;
  --muted: #7a756c;
  --accent: #4e6e66;          /* gedämpftes Salbeigrün */
  --accent-soft: rgba(78, 110, 102, .10);
  --radius: 14px;
  --shadow: 0 1px 2px rgba(40, 30, 20, .04), 0 8px 28px rgba(40, 30, 20, .06);
  --serif: "Iowan Old Style", "Palatino Linotype", Palatino, "Book Antiqua", Georgia, serif;
  --sans: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --mono: ui-monospace, "Cascadia Code", "SF Mono", Consolas, "Liberation Mono", monospace;
  --wrap: 44rem;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body {
  margin: 0; min-height: 100vh; display: flex; flex-direction: column;
  background: var(--bg); color: var(--text);
  font: 400 1.0625rem/1.7 var(--sans);
  -webkit-font-smoothing: antialiased; text-rendering: optimizeLegibility;
}
main { flex: 1; width: 100%; }
img { max-width: 100%; height: auto; display: block; }
a { color: var(--accent); text-decoration-thickness: 1px; text-underline-offset: .18em; }
a:hover { color: var(--text); }
::selection { background: rgba(78, 110, 102, .2); }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; border-radius: 4px; }

/* Ambient-Licht im Hintergrund */
.ambient { position: fixed; inset: 0; z-index: -1; overflow: hidden; pointer-events: none; }
.ambient span { position: absolute; border-radius: 50%; filter: blur(80px); opacity: .55; }
.ambient span:nth-child(1) { width: 46vmax; height: 46vmax; top: -18vmax; left: -12vmax; background: #f0dcc8; }
.ambient span:nth-child(2) { width: 38vmax; height: 38vmax; top: 8vmax; right: -16vmax; background: #d6e3dc; }
.ambient span:nth-child(3) { width: 34vmax; height: 34vmax; bottom: -18vmax; left: 22vmax; background: #e4dcea; opacity: .4; }

.wrap { width: 100%; max-width: var(--wrap); margin: 0 auto; padding: 0 1.25rem; }

/* Kopf */
.site-header {
  position: sticky; top: 0; z-index: 10;
  background: rgba(246, 243, 238, .72);
  backdrop-filter: saturate(1.4) blur(14px); -webkit-backdrop-filter: saturate(1.4) blur(14px);
  border-bottom: 1px solid var(--line);
}
.header-inner { display: flex; align-items: center; justify-content: space-between; gap: 1rem; height: 3.75rem; }
.brand { display: inline-flex; align-items: center; gap: .6rem; font: 600 1.2rem/1 var(--serif); color: var(--text); text-decoration: none; letter-spacing: .01em; }
.brand-logo { width: 30px; height: 30px; border-radius: 8px; box-shadow: 0 1px 3px rgba(40, 30, 20, .12); transition: transform .2s ease; }
.brand:hover .brand-logo { transform: rotate(-4deg) scale(1.05); }
.nav { display: flex; gap: 1.25rem; }
.nav a { color: var(--muted); text-decoration: none; font-size: .9rem; letter-spacing: .02em; }
.nav a:hover, .nav a[aria-current] { color: var(--text); }
.nav a.lang { font-size: .75rem; letter-spacing: .08em; padding: .1rem .45rem; border: 1px solid var(--line); border-radius: 6px; }
.nav a.lang:hover { border-color: var(--accent); color: var(--accent); }
.sprachhinweis { font-size: .72rem; letter-spacing: .06em; text-transform: uppercase; }

/* Typografie */
h1, h2, h3 { font-family: var(--serif); font-weight: 600; line-height: 1.2; color: var(--text); letter-spacing: -.005em; }
h1 { font-size: clamp(2rem, 1.4rem + 2.6vw, 2.9rem); margin: 0 0 .6rem; }
h2 { font-size: 1.5rem; margin: 2.4rem 0 .8rem; }
h3 { font-size: 1.2rem; margin: 1.8rem 0 .5rem; }
.lead { font-size: 1.2rem; color: var(--muted); margin: 0; max-width: 36rem; }
.muted { color: var(--muted); }
.meta { font-size: .85rem; color: var(--muted); margin: 0 0 .5rem; display: flex; flex-wrap: wrap; align-items: center; gap: .35rem; }
.meta a { color: var(--muted); }
.dot { opacity: .5; }

/* Startseite */
.hero { padding: 4.5rem 0 2.5rem; }
.hero-small { padding: 3.5rem 0 1.5rem; }
.section { margin: 1.5rem 0 3rem; }
.section-head { display: flex; align-items: baseline; justify-content: space-between; gap: 1rem; margin-bottom: 1rem; border-bottom: 1px solid var(--line); padding-bottom: .5rem; }
.section-head h2 { margin: 0; font-size: 1.15rem; letter-spacing: .02em; }
.more { font-size: .9rem; text-decoration: none; }
.cards-more { margin: .75rem 0 0; text-align: right; }

/* Projektkarten */
.cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(15.5rem, 1fr)); gap: 1rem; }
.card {
  display: flex; flex-direction: column; overflow: hidden;
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
  box-shadow: var(--shadow); color: var(--text); text-decoration: none;
  backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px);
  transition: transform .25s ease, box-shadow .25s ease;
}
.card:hover { transform: translateY(-2px); box-shadow: 0 2px 4px rgba(40,30,20,.05), 0 14px 36px rgba(40,30,20,.09); color: var(--text); }
.card-cover { aspect-ratio: 16 / 9; overflow: hidden; background: var(--accent-soft); }
.card-cover img { width: 100%; height: 100%; object-fit: cover; }
.card-body { display: flex; flex-direction: column; gap: .35rem; padding: 1rem 1.1rem 1.15rem; }
.card-title { font: 600 1.15rem/1.25 var(--serif); }
.card-text { color: var(--muted); font-size: .95rem; line-height: 1.55; }
.stack { font-size: .78rem; color: var(--accent); letter-spacing: .04em; text-transform: uppercase; margin-top: .2rem; }

/* Beitragsliste */
.entries { display: flex; flex-direction: column; }
.entry { display: flex; gap: 1.25rem; align-items: flex-start; padding: 1.25rem 0; border-bottom: 1px solid var(--line); }
.entry:last-child { border-bottom: 0; }
.entry-text { flex: 1; min-width: 0; }
.entry h3 { margin: 0 0 .3rem; font-size: 1.3rem; }
.entry h3 a { color: var(--text); text-decoration: none; }
.entry h3 a:hover { color: var(--accent); }
.summary { margin: 0; color: var(--muted); font-size: .98rem; line-height: 1.6; }
.entry-thumb { flex: 0 0 7.5rem; aspect-ratio: 4 / 3; border-radius: 10px; overflow: hidden; background: var(--accent-soft); margin-top: .3rem; }
.entry-thumb img { width: 100%; height: 100%; object-fit: cover; transition: transform .4s ease; }
.entry:hover .entry-thumb img { transform: scale(1.04); }

.chip {
  display: inline-block; padding: .05rem .55rem; border-radius: 99px;
  background: var(--accent-soft); color: var(--accent) !important; text-decoration: none; font-size: .78rem;
}
.tag { display: inline-block; margin: 0 .5rem .5rem 0; padding: .2rem .7rem; border-radius: 99px; border: 1px solid var(--line); background: var(--surface); color: var(--muted); text-decoration: none; font-size: .88rem; }
.tag:hover { color: var(--accent); border-color: var(--accent); }
.tagcloud { margin-top: 0; }

.pager { display: flex; justify-content: space-between; align-items: center; margin-top: 1.5rem; font-size: .92rem; }

/* Beitrag */
.post-head { padding: 3.5rem 0 1.5rem; }
.post-head .lead { margin-top: .4rem; }
.cover { margin: 0 0 2rem; }
.cover img { width: 100%; border-radius: var(--radius); box-shadow: var(--shadow); cursor: zoom-in; }
@media (min-width: 52rem) { .cover { margin-left: -3rem; margin-right: -3rem; } }

.facts { display: flex; flex-wrap: wrap; gap: .75rem 2rem; margin: 1.4rem 0 0; padding: 1rem 1.2rem; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); }
.facts div { min-width: 0; }
.facts dt { font-size: .72rem; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); }
.facts dd { margin: 0; font-size: .95rem; }

.prose > :first-child { margin-top: 0; }
.prose p, .prose ul, .prose ol { margin: 0 0 1.2rem; }
.prose li { margin: .25rem 0; }
.prose blockquote { margin: 1.6rem 0; padding: .2rem 0 .2rem 1.2rem; border-left: 2px solid var(--accent); color: var(--muted); font-family: var(--serif); font-size: 1.12rem; font-style: italic; }
.prose hr { border: 0; height: 1px; background: var(--line); margin: 2.5rem 0; }
.prose table { width: 100%; border-collapse: collapse; font-size: .95rem; margin: 1.5rem 0; display: block; overflow-x: auto; }
.prose th, .prose td { padding: .5rem .75rem; border-bottom: 1px solid var(--line); text-align: left; }
.prose th { font-weight: 600; }
.prose code { font-family: var(--mono); font-size: .88em; background: rgba(60,50,40,.06); padding: .12em .35em; border-radius: 5px; }
.prose pre, .prose .highlight pre {
  font-family: var(--mono); font-size: .86rem; line-height: 1.6; overflow-x: auto;
  background: var(--surface-solid); border: 1px solid var(--line); border-radius: 10px; padding: 1rem 1.15rem; margin: 1.5rem 0;
}
.prose pre code { background: none; padding: 0; font-size: inherit; }

/* Einzelbilder (vom Script erzeugt) */
.prose figure.bild { margin: 2rem 0; }
.prose figure.bild img { border-radius: 10px; box-shadow: var(--shadow); cursor: zoom-in; margin: 0 auto; }
@media (min-width: 52rem) { .prose figure.bild.breit { margin-left: -3rem; margin-right: -3rem; } }
.prose figcaption { font-size: .86rem; color: var(--muted); text-align: center; margin-top: .6rem; }

/* Galerie (mehrere Bilder hintereinander) */
.galerie { display: grid; gap: .5rem; margin: 2rem 0; grid-template-columns: repeat(2, 1fr); }
.galerie button { appearance: none; border: 0; padding: 0; margin: 0; font: inherit; display: block; width: 100%; cursor: zoom-in; position: relative; overflow: hidden; border-radius: 8px; aspect-ratio: 1; background: var(--accent-soft); }
.galerie button:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.galerie img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; transition: transform .45s ease, filter .3s; }
.galerie button:hover img { transform: scale(1.04); }
.galerie[data-anzahl="3"] button:first-child,
.galerie[data-anzahl="5"] button:first-child { grid-column: span 2; aspect-ratio: 2 / 1; }
.galerie .mehr { position: absolute; inset: 0; display: grid; place-items: center; background: rgba(30,28,24,.45); color: #fff; font: 600 1.4rem var(--serif); }
@media (min-width: 40rem) {
  .galerie { grid-template-columns: repeat(3, 1fr); }
  .galerie[data-anzahl="2"], .galerie[data-anzahl="4"] { grid-template-columns: repeat(2, 1fr); }
  .galerie[data-anzahl="2"] button { aspect-ratio: 4 / 3; }
  .galerie[data-anzahl="3"] button:first-child { grid-column: auto; aspect-ratio: 1; }
  .galerie[data-anzahl="5"] button:first-child { aspect-ratio: auto; }
}
@media (min-width: 52rem) { .galerie { margin-left: -3rem; margin-right: -3rem; } }

/* Chronik auf Projektseiten */
.timeline { list-style: none; margin: 0; padding: 0 0 0 1.3rem; border-left: 1px solid var(--line); }
.timeline li { position: relative; padding: 0 0 1.6rem; }
.timeline li::before { content: ""; position: absolute; left: calc(-1.3rem - 5px); top: .55rem; width: 9px; height: 9px; border-radius: 50%; background: var(--bg); border: 2px solid var(--accent); }
.timeline li:first-child::before { background: var(--accent); }
.timeline time { display: block; font-size: .8rem; color: var(--muted); }
.timeline a { font: 600 1.12rem/1.3 var(--serif); color: var(--text); text-decoration: none; }
.timeline a:hover { color: var(--accent); }
.timeline p { margin: .2rem 0 0; color: var(--muted); font-size: .95rem; }

/* Fuß des Beitrags */
.post-foot { margin: 3rem 0 1rem; padding-top: 1.5rem; border-top: 1px solid var(--line); }
.series { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; margin-top: 1.5rem; }
.series a { display: flex; flex-direction: column; gap: .15rem; padding: .9rem 1rem; border-radius: var(--radius); background: var(--surface); border: 1px solid var(--line); color: var(--text); text-decoration: none; font-family: var(--serif); font-weight: 600; line-height: 1.3; }
.series a .muted { font: .8rem var(--sans); }
.series a:hover { border-color: var(--accent); }
.series-next { text-align: right; grid-column: 2; }

/* Archiv */
.archive-year h2 { font-size: 1.1rem; color: var(--muted); margin: 2rem 0 .5rem; }
.archive-list { list-style: none; padding: 0; margin: 0; }
.archive-list li { display: flex; gap: 1rem; padding: .45rem 0; border-bottom: 1px solid var(--line); }
.archive-list time { flex: 0 0 3.5rem; color: var(--muted); font-size: .9rem; font-variant-numeric: tabular-nums; padding-top: .1rem; }
.archive-list a { color: var(--text); text-decoration: none; }
.archive-list a:hover { color: var(--accent); }

/* Fuß */
.site-footer { margin-top: 4rem; border-top: 1px solid var(--line); font-size: .85rem; color: var(--muted); }
.footer-inner { display: flex; justify-content: space-between; flex-wrap: wrap; gap: .5rem 1rem; padding-top: 1.5rem; padding-bottom: 2rem; }
.footer-links { display: flex; gap: 1rem; }
.footer-links a { color: var(--muted); }

/* Code-Hervorhebung (Pygments, hell) */
.highlight .c, .highlight .c1, .highlight .cm, .highlight .ch { color: #9a948a; font-style: italic; }
.highlight .k, .highlight .kd, .highlight .kn, .highlight .kc, .highlight .ow { color: #8a4f7d; }
.highlight .s, .highlight .s1, .highlight .s2, .highlight .sd, .highlight .sa { color: #4e7a55; }
.highlight .m, .highlight .mi, .highlight .mf { color: #b0603a; }
.highlight .nf, .highlight .fm { color: #3b6795; }
.highlight .nc, .highlight .nn { color: #3b6795; font-weight: 600; }
.highlight .nb, .highlight .bp { color: #7a6a2e; }
.highlight .o, .highlight .p { color: #5f5a52; }
.highlight .nd { color: #8a4f7d; }

/* Mobil */
@media (max-width: 34rem) {
  body { font-size: 1rem; }
  .header-inner { height: auto; padding-top: .8rem; padding-bottom: .8rem; flex-wrap: wrap; gap: .4rem 1rem; }
  .nav { gap: 1rem; }
  .hero { padding: 3rem 0 1.75rem; }
  .post-head { padding-top: 2.5rem; }
  .entry { gap: .9rem; }
  .entry-thumb { flex-basis: 5.5rem; }
  .entry h3 { font-size: 1.15rem; }
  .series { grid-template-columns: 1fr; }
  .series-next { grid-column: 1; }
}

/* ---------- Bildbetrachter ---------- */
.lb { position: fixed; inset: 0; z-index: 100; display: none; background: rgba(22, 21, 19, .97); backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px); color: #f2efe9; touch-action: none; user-select: none; -webkit-user-select: none; }
.lb.offen { display: block; animation: lb-ein .22s ease; }
@keyframes lb-ein { from { opacity: 0; } to { opacity: 1; } }
.lb-spur { position: absolute; inset: 0; display: flex; will-change: transform; }
.lb-folie { flex: 0 0 100%; height: 100%; display: flex; align-items: center; justify-content: center; padding: 3.5rem 1rem 4.5rem; overflow: hidden; }
.lb-folie img { max-width: 100%; max-height: 100%; object-fit: contain; border-radius: 4px; transform-origin: center; transition: transform .25s ease; -webkit-user-drag: none; }
.lb-folie img.ziehen { transition: none; }
.lb-oben { position: absolute; top: 0; left: 0; right: 0; display: flex; justify-content: space-between; align-items: center; padding: .8rem 1rem; font-size: .9rem; z-index: 2; background: linear-gradient(rgba(0,0,0,.35), transparent); }
.lb-zaehler { opacity: .8; font-variant-numeric: tabular-nums; }
.lb-text { position: absolute; left: 0; right: 0; bottom: 0; padding: 1.2rem 1.5rem 1.4rem; text-align: center; font-size: .92rem; line-height: 1.5; background: linear-gradient(transparent, rgba(0,0,0,.45)); z-index: 2; min-height: 3rem; }
.lb button { appearance: none; border: 0; padding: 0; margin: 0; font: inherit; background: transparent; cursor: pointer; display: grid; place-items: center; width: 2.75rem; height: 2.75rem; border-radius: 50%; color: #f2efe9; transition: background .2s; }
.lb button:hover, .lb button:focus-visible { background: rgba(255,255,255,.12); }
.lb .lb-pfeil { position: absolute; top: 50%; transform: translateY(-50%); z-index: 2; }
.lb-zurueck { left: .75rem; } .lb-vor { right: .75rem; }
.lb svg { width: 1.4rem; height: 1.4rem; stroke: currentColor; fill: none; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.lb.einzeln .lb-pfeil, .lb.einzeln .lb-zaehler { display: none; }
@media (hover: none) { .lb .lb-pfeil { display: none; } }
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { transition: none !important; animation: none !important; } }

/* Themen-Übersicht */
.themen-liste { list-style: none; margin: 0; padding: 0; }
.themen-liste li { padding: .8rem 0; border-bottom: 1px solid var(--line); }
.themen-liste li:last-child { border-bottom: 0; }
.themen-liste a { font: 600 1.2rem/1.3 var(--serif); color: var(--text); text-decoration: none; }
.themen-liste a:hover { color: var(--accent); }
.themen-liste p { margin: .25rem 0 0; color: var(--muted); font-size: .96rem; }
.revision { font-size: .85rem; margin-top: 2.5rem; padding-top: 1rem; border-top: 1px solid var(--line); }
