/**
 * Wolkenstein site identity (D34 / A0).
 * Merged from themes/dropbits/style.css + former dropbits-base-theme.css.
 * Overrides: dropbits-user.css only (LLM / Appearance).
 */

/* Dropbits / Wolkenstein structural shell (merged into dropbits-site.css). */

:root {
  --nav-mobile-max: 900px;
  --color-surface: #ffffff;
  --color-muted: #5c6b6a;
  --color-accent-light: #d8c8b8;
  --color-border: #d8c8b8;
  --color-link: var(--color-accent);
  --color-link-hover: var(--color-accent-light);
  /* Brand tokens follow in the section below (primary, accent, content-*, bg, …). */
}

* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: var(--font-sans);
  font-size: 1.05rem;
  line-height: 1.65;
  color: var(--color-text);
  background: var(--color-bg);
  position: relative;
  min-height: 100vh;
}

.db-page {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  width: 100%;
}

/* Admin + status bars must span full viewport (not a grid column) */
.db-page > .site-header,
.db-page > .site-footer,
.db-page > .db-widget,
.db-page > .site-main,
.db-page > main.content.db-admin-body,
.db-page > .preview-banner {
  width: 100%;
  max-width: none;
  flex: 0 0 auto;
  align-self: stretch;
}

.db-page > main.content.db-admin-body {
  flex: 1 1 auto;
}

.db-widget[data-slot="full"] {
  flex: 0 0 auto;
}

.db-widget.db-content-band {
  flex: 1 1 auto;
}

/* ── Header / nav ─────────────────────────────────────────────────── */

.site-header {
  background: var(--color-surface);
  color: var(--color-nav-fg, var(--color-primary));
  position: sticky;
  top: 0;
  z-index: 100;
  box-shadow: 0 1px 8px rgba(0, 0, 0, 0.08);
  border-bottom: 1px solid var(--color-border);
  /* Keep chrome stable across MPA View Transitions (reduces header “jump”). */
  view-transition-name: site-header;
}

.header-inner {
  max-width: 72rem;
  margin: 0 auto;
  padding: .75rem 1.25rem;
  display: flex;
  align-items: center;
  gap: 1rem;
  flex-wrap: wrap;
}

.brand {
  display: flex;
  align-items: center;
  gap: .75rem;
  color: inherit;
  text-decoration: none;
  flex: 1;
  min-width: 200px;
}

.logo {
  height: 56px;
  width: auto;
}

.brand-text strong {
  font-weight: 600;
  color: var(--color-nav-fg, var(--color-primary));
  display: block;
}

.brand-text small {
  display: block;
  margin-top: 0.15rem;
  font-size: .78rem;
  color: var(--color-muted);
}

.nav-toggle {
  display: none;
  background: none;
  border: 1px solid var(--color-border);
  color: var(--color-nav-fg, var(--color-primary));
  font-size: 1.4rem;
  padding: .25rem .5rem;
  border-radius: 4px;
  cursor: pointer;
}

html.db-nav-compact .site-header .nav-toggle {
  display: block;
}

.main-nav > .nav-links {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: .15rem .35rem;
  list-style: none;
  margin: 0;
  padding: 0;
}

.main-nav > .nav-links > li > a,
.main-nav > .nav-links > li > a:link,
.main-nav > .nav-links > li > a:visited {
  color: var(--color-nav-fg, var(--color-primary));
  text-decoration: none;
  font-size: .88rem;
  padding: .35rem .6rem;
  border-radius: 4px;
  white-space: nowrap;
  display: inline-block;
}

.main-nav > .nav-links > li > a:hover,
.main-nav > .nav-links > li > a.active {
  background: color-mix(in srgb, var(--color-primary) 8%, transparent);
}

.main-nav > .nav-links > li.nav-auth-chip {
  display: inline-flex;
  align-items: stretch;
  border: 1px solid var(--color-border);
  border-radius: 4px;
  overflow: hidden;
  flex-shrink: 0;
}

.nav-auth-user {
  display: inline-flex;
  align-items: center;
  padding: 0.35rem 0.6rem;
  color: var(--color-nav-fg, var(--color-primary));
  font-size: 0.85rem;
  font-weight: 600;
  max-width: 10rem;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.nav-auth-logout {
  display: inline-flex;
  align-items: center;
  padding: 0.35rem 0.65rem;
  border-left: 1px solid var(--color-border);
  background: color-mix(in srgb, var(--color-accent) 14%, transparent);
  color: var(--color-nav-fg, var(--color-primary));
  text-decoration: none;
  font-size: 0.85rem;
  font-weight: 600;
}

.nav-auth-logout:hover {
  background: color-mix(in srgb, var(--color-accent) 24%, transparent);
  text-decoration: none;
}

.main-nav > .nav-links > li { position: relative; }

.main-nav > .nav-links > li:has(> .nav-links) > a::after {
  content: "";
  display: inline-block;
  width: 0; height: 0;
  margin-left: .35rem;
  vertical-align: middle;
  border-left: 4px solid transparent;
  border-right: 4px solid transparent;
  border-top: 5px solid var(--color-nav-fg, var(--color-primary));
  transition: transform 0.22s ease;
}

/* Caret / flyout follow .open only (nested-nav.js sets .open on hover+click). */
.main-nav > .nav-links > li.open > a::after {
  transform: rotate(180deg);
}

.main-nav > .nav-links > li > .nav-links {
  display: block;
  position: absolute;
  top: 100%;
  left: 0;
  min-width: 13rem;
  margin: 0;
  padding: .35rem 0;
  list-style: none;
  background: var(--color-surface);
  border-radius: 6px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.12);
  z-index: 200;
  visibility: hidden;
  opacity: 0;
  transform: translateY(-6px);
  transition: opacity 0.2s ease, transform 0.2s ease, visibility 0.2s;
  pointer-events: none;
}

/* Invisible bridge — prevents submenu closing when crossing the gap from parent link */
.main-nav > .nav-links > li > .nav-links::before {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  top: -10px;
  height: 10px;
}

.main-nav > .nav-links > li.open > .nav-links {
  visibility: visible;
  opacity: 1;
  transform: translateY(0);
  pointer-events: auto;
}

.main-nav > .nav-links > li > .nav-links a,
.main-nav > .nav-links > li > .nav-links a:link,
.main-nav > .nav-links > li > .nav-links a:visited {
  display: block;
  padding: .45rem 1rem;
  color: var(--color-nav-sub-fg, var(--color-nav-fg, var(--color-primary)));
  text-decoration: none;
  font-size: .88rem;
  white-space: normal;
}

.main-nav > .nav-links > li > .nav-links a:hover,
.main-nav > .nav-links > li > .nav-links a.active {
  background: var(--color-bg);
  color: var(--color-nav-fg, var(--color-primary));
}

.main-nav > .nav-links > li > .nav-links a.active {
  font-weight: 600;
  border-left: 3px solid var(--color-accent);
  padding-left: calc(1rem - 3px);
}

.site-top-band {
  background: var(--color-accent);
  min-height: 1.35rem;
}

.preview-banner {
  background: var(--color-accent);
  color: #fff;
  text-align: center;
  padding: .4rem;
  font-size: .82rem;
  font-weight: 600;
  grid-column: 1 / -1;
}

.preview-banner a {
  color: #fff;
  margin-left: .75rem;
}

/* ── Bleed layout (full viewport width) ─────────────────────────── */

.db-widget--bleed {
  width: 100%;
  max-width: none;
  margin: 0;
  padding: 0;
  background: transparent;
}

.db-widget--bleed .db-field-label {
  display: none;
}

/* ── Hero ─────────────────────────────────────────────────────────── */

.hero-jumbo {
  position: relative;
  width: 100%;
  aspect-ratio: 16 / 9;
  max-height: min(52vh, 520px);
  overflow: hidden;
  z-index: 1;
}

.hero-media {
  position: absolute;
  inset: 0;
  display: block;
}

.hero-media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center 40%;
  display: block;
}

/* Multi-image hero rotation (jumbo field with 2+ images) */
.hero-jumbo--rotating {
  --hero-interval: 6s;
  --hero-count: 2;
}

.hero-jumbo--rotating .hero-media-stack {
  position: absolute;
  inset: 0;
  animation: hero-jumbo-entrance var(--hero-fade, 1.2s) ease-out both;
}

@keyframes hero-jumbo-entrance {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

.hero-jumbo--rotating .hero-slide {
  position: absolute;
  inset: 0;
  opacity: 0;
  z-index: 1;
  animation-duration: calc(var(--hero-count) * var(--hero-interval));
  animation-timing-function: linear;
  animation-iteration-count: infinite;
  animation-fill-mode: both;
}

.hero-jumbo--rotating .hero-slide .hero-media,
.hero-jumbo--rotating .hero-slide picture {
  position: absolute;
  inset: 0;
}

@media (prefers-reduced-motion: reduce) {
  .hero-jumbo--rotating .hero-media-stack {
    animation: none;
    opacity: 1;
  }
  .hero-jumbo--rotating .hero-slide {
    animation: none;
    opacity: 0;
  }
  .hero-jumbo--rotating .hero-slide:first-child {
    opacity: 1;
  }
}

.hero-inner {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: flex-end;
  /* Match .db-content-band column so title left edge lines up with body text */
  padding: 0 1.25rem 2.5rem;
  z-index: 3;
  max-width: var(--max-width);
  margin: 0 auto;
  left: 0;
  right: 0;
  width: 100%;
  box-sizing: border-box;
}

.hero-title-box {
  background: color-mix(in srgb, var(--color-primary) 82%, transparent);
  backdrop-filter: blur(6px);
  padding: 1.25rem 1.75rem;
  border-radius: 6px;
  border-left: 4px solid var(--color-accent);
  max-width: min(36rem, 100%);
}

.hero-title-box h1 {
  margin: 0;
  font-size: clamp(1.25rem, 4vw, 2.5rem);
  font-weight: 600;
  color: #fff;
  line-height: 1.15;
}

.hero-subtitle {
  margin: .5rem 0 0;
  font-size: clamp(0.85rem, 2.5vw, 1.05rem);
  color: var(--color-accent-light);
}

.hero-jumbo--bottom-left .hero-inner { align-items: flex-end; justify-content: flex-start; }
.hero-jumbo--bottom-center .hero-inner { align-items: flex-end; justify-content: center; }
.hero-jumbo--bottom-right .hero-inner { align-items: flex-end; justify-content: flex-end; }
.hero-jumbo--center-left .hero-inner { align-items: center; justify-content: flex-start; }
.hero-jumbo--center .hero-inner { align-items: center; justify-content: center; }
.hero-jumbo--center-right .hero-inner { align-items: center; justify-content: flex-end; }
.hero-jumbo--top-left .hero-inner { align-items: flex-start; justify-content: flex-start; padding-top: 1.5rem; }
.hero-jumbo--top-center .hero-inner { align-items: flex-start; justify-content: center; padding-top: 1.5rem; }
.hero-jumbo--top-right .hero-inner { align-items: flex-start; justify-content: flex-end; padding-top: 1.5rem; }

/* ── Content band — widgets: .db-content-band; legacy flat HTML: main.content ─ */

.db-content-band,
main.content:not(.db-admin-body) {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 2rem 1.25rem 3rem;
  background: var(--color-content-bg);
  color: var(--color-content-fg);
  min-height: 40vh;
  position: relative;
  z-index: 1;
  width: 100%;
  overflow: hidden;
}

.db-content-band .content-inner,
.db-content-band .db-detail {
  position: relative;
}

.db-content-band h1 {
  font-size: 2rem;
  color: var(--color-content-heading);
  margin-top: 0;
  border-bottom: 2px solid var(--color-accent);
  padding-bottom: .5rem;
  font-weight: 600;
}

.db-content-band h2 {
  font-size: 1.35rem;
  color: var(--color-content-heading);
  margin-top: 2rem;
  font-weight: 600;
}

.db-content-band h3 {
  font-size: 1.1rem;
  color: var(--color-accent);
  margin-top: 1.5rem;
  font-weight: 600;
}

.db-content-band p { margin: 1rem 0; }
.db-content-band ul { padding-left: 1.25rem; }
.db-content-band li { margin: .4rem 0; }
.db-content-band a,
main.content:not(.db-admin-body) a {
  color: var(--color-link);
  text-decoration: underline;
  text-decoration-color: color-mix(in srgb, var(--color-link) 55%, transparent);
  text-underline-offset: 0.12em;
}
.db-content-band a:hover,
main.content:not(.db-admin-body) a:hover {
  color: var(--color-link-hover);
}

.db-content-band blockquote {
  margin: 1.25rem 0;
  padding: .75rem 1rem;
  border-left: 4px solid var(--color-accent);
  background: color-mix(in srgb, var(--color-content-heading) 8%, transparent);
}

.db-content-band table {
  width: 100%;
  border-collapse: collapse;
  margin: 1.25rem 0;
  font-size: .92rem;
}

.db-content-band th,
.db-content-band td {
  border: 1px solid color-mix(in srgb, var(--color-content-fg) 25%, transparent);
  padding: .5rem .75rem;
}

.db-content-band th {
  background: color-mix(in srgb, var(--color-content-heading) 12%, transparent);
}

/* ── Footer ─────────────────────────────────────────────────────── */

.site-footer {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 1.5rem 1.25rem 2rem;
  text-align: center;
  font-size: .88rem;
  color: var(--color-muted);
  position: relative;
  z-index: 1;
}

.site-footer a { color: var(--color-link, var(--color-accent)); }

.site-footer-auth {
  margin: 0.75rem 0 0;
  font-size: 0.85rem;
}

.site-footer-user {
  font-weight: 600;
  color: var(--color-muted);
}

/* ── Responsive ───────────────────────────────────────────────────── */

.nav-edit-trigger {
  flex-shrink: 0;
  font-size: 0.85rem;
  white-space: nowrap;
}

/* Compact nav (--nav-mobile-max → nested-nav.js → html.db-nav-compact) */
html.db-nav-compact .site-header .nav-edit-trigger { order: 1; }
html.db-nav-compact .site-header .main-nav {
  display: none;
  width: 100%;
  order: 3;
}
html.db-nav-compact .site-header .main-nav.open {
  display: block;
  max-height: min(80vh, 48rem);
  overflow-x: hidden;
  overflow-y: auto;
  padding-bottom: .5rem;
}
html.db-nav-compact .site-header .main-nav > .nav-links {
  flex-direction: column;
  align-items: stretch;
  gap: 0;
}
html.db-nav-compact .site-header .main-nav > .nav-links > li > a {
  display: block;
  width: 100%;
  text-align: left;
  padding: .6rem .75rem;
  border-radius: 0;
}


@media (min-width: 901px) {
  body {
    background: var(--color-gutter, var(--color-bg));
    /* Gutter is often dark while --color-text tracks nav/primary — use content fg on the shell */
    color: var(--color-content-fg, var(--color-text));
  }

  /* Page shell blocks outside the content band (index teaser, termine sections) */
  .index-next-event a,
  .termine-upcoming a,
  .termine-past a,
  .termine-hub-links a {
    color: var(--color-link, var(--color-content-heading));
    text-decoration: underline;
    text-decoration-color: color-mix(in srgb, var(--color-link, var(--color-content-heading)) 55%, transparent);
    text-underline-offset: 0.12em;
  }

  .index-next-event a:hover,
  .termine-upcoming a:hover,
  .termine-past a:hover,
  .termine-hub-links a:hover {
    color: var(--color-link-hover, var(--color-accent-light));
  }

  .site-footer {
    color: var(--color-accent-light);
  }

  .site-footer a {
    color: var(--color-link, var(--color-content-heading));
  }

  .site-footer a:hover {
    color: var(--color-link-hover, var(--color-accent-light));
  }

  .hero-jumbo { aspect-ratio: 21 / 9; }
}

/* High-contrast content band on colored page bg (Wolkenstein-style desktop) */
@media (min-width: 901px) {
  .db-content-band {
    box-shadow: none;
  }
}

/* —— Brand tokens + site chrome (ex dropbits-base-theme.css) —— */

:root {
  --color-primary: #384848;
  --color-accent: #a89868;
  --color-content-bg: #384848;
  --color-content-fg: #d8c8b8;
  --color-content-heading: #ffffff;
  --color-nav-fg: #384848;
  --color-nav-sub-fg: #384848;
  --color-gutter: #384848;
  --color-bg: #f7f4ef;
  --color-text: #384848;
  --max-width: 52rem;
  --font-sans: system-ui, -apple-system, "Segoe UI", sans-serif;
  /* Page-to-page View Transition duration; override in dropbits-user.css via patch_user_css */
  --page-fade-duration: 0.28s;
}

@font-face {
  font-family: "Source Sans 3";
  font-style: normal;
  font-weight: 300 700;
  font-display: swap;
  src: url("assets/fonts/SourceSans3-Variable.ttf") format("truetype");
}
:root {
  --font-sans: "Source Sans 3", system-ui, -apple-system, "Segoe UI", sans-serif;
}

/* Page shell matches content (left/right/below). Header stays --color-surface. */
body.db-page {
  background: var(--color-gutter, var(--color-content-bg));
  color: var(--color-content-fg, var(--color-text));
}
.db-page > article[data-page-canvas] {
  flex: 1 1 auto;
  display: flex;
  flex-direction: column;
  width: 100%;
  background: var(--color-gutter, var(--color-content-bg));
}

/* decorative_snake — one continuous tile on the main region (not per richtext band).
 * Width is owned by .db-page-body center track (page-layout.css + --db-content-max). */
.region-main {
  position: relative;
  flex: 1 1 auto;
  max-width: none;
  margin: 0;
  width: 100%;
  background: var(--color-content-bg);
  color: var(--color-content-fg);
  container-type: inline-size;
}
.db-page > article[data-page-canvas] > .db-page-body {
  flex: 1 1 auto;
  width: 100%;
  background: var(--color-gutter, var(--color-content-bg));
}
/* Bands share the region background so the snake is not restarted per widget */
.region-main > .db-content-band {
  background: transparent;
  max-width: none;
  margin-left: 0;
  margin-right: 0;
}
.region-main::before {
  content: "";
  position: absolute;
  right: -1rem;
  top: calc(2rem + 4 * 1.65em);
  bottom: 0;
  width: 32rem;
  background: url("assets/schlange-tile.png") repeat-y right top / 32rem auto;
  opacity: 0.85;
  filter: drop-shadow(0 0 6px rgba(0, 0, 0, 0.12));
  pointer-events: none;
  z-index: 1;
}
/* Legacy: no per-band snake (avoids restart when adding another richtext block) */
.db-content-band::before {
  content: none;
  display: none;
}
.region-main .db-content-band img,
.region-main .db-content-band picture,
.region-main .db-content-band .db-img,
.region-main .db-content-band .hero-media {
  position: relative;
  z-index: 0;
}
.region-main .db-content-band :is(h1, h2, h3, h4, h5, h6, p, ul, ol, blockquote, table, dl, fieldset, .db-list, figcaption) {
  position: relative;
  z-index: 2;
}
body:has(.hero-jumbo) .region-main > .db-content-band:first-child {
  margin-top: 0;
}
@media (max-width: 900px) {
  .region-main::before {
    width: 22rem;
    right: 0;
    background-size: 22rem auto;
  }
}

/* jumbo_hide_subtitle_mobile — hide hero subtitle on narrow viewports */
@media (max-width: 480px) {
  .hero-jumbo .hero-subtitle {
    display: none;
  }
  .hero-jumbo .hero-title-box {
    padding-block: 1rem;
  }
}

/* Soft page-to-page blend (MPA View Transitions). Tune via --page-fade-duration in :root /
 * dropbits-user.css. Unsupported browsers ignore this and navigate instantly.
 * Firefox fallback: page-fade.js (+ html.db-page-fade-pending from a head snippet). */
html.db-page-fade-pending {
  opacity: 0;
}

@view-transition {
  navigation: auto;
}

::view-transition-old(root) {
  animation: wk-page-fade-out var(--page-fade-duration, 0.28s) ease-out both;
}

::view-transition-new(root) {
  animation: wk-page-fade-in var(--page-fade-duration, 0.28s) ease-out both;
}

/* Header is its own VT group — don’t crossfade it with the page body. */
::view-transition-old(site-header),
::view-transition-new(site-header) {
  animation: none;
}

@keyframes wk-page-fade-out {
  to { opacity: 0; }
}

@keyframes wk-page-fade-in {
  from { opacity: 0; }
}

@media (prefers-reduced-motion: reduce) {
  html.db-page-fade-pending {
    opacity: 1;
  }

  .site-header {
    view-transition-name: none;
  }

  @view-transition {
    navigation: none;
  }

  ::view-transition-old(root),
  ::view-transition-new(root) {
    animation: none;
  }
}

