:root {
  --ink: #2c2624;
  --muted: #756864;
  --line: #ead5cc;
  --paper: #fff9f3;
  --soft: #faeee7;
  --accent: #9f2634;
  --accent-dark: #741823;
  --sage: #4c8b74;
  --gold: #c79345;
  --pin-blue: #1f78a8;
  --nav-width: 300px;
  --font-heading: 'Manrope', Arial, Helvetica, sans-serif;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  font-family: Arial, Helvetica, sans-serif;
  color: var(--ink);
  background: var(--paper);
  line-height: 1.62;
}
a {
  color: var(--accent-dark);
  text-decoration-color: rgba(159, 38, 52, .28);
  text-decoration-thickness: 1px;
  text-underline-offset: .22em;
  transition: color .18s ease, text-decoration-color .18s ease;
}
a:hover {
  color: var(--pin-blue);
  text-decoration-color: rgba(31, 120, 168, .45);
}
img { max-width: 100%; height: auto; display: block; }

.mobile-nav-bar {
  position: absolute;
  top: 10px;
  right: clamp(12px, 3vw, 30px);
  z-index: 2;
}
.menu-button {
  width: 42px;
  height: 42px;
  border: 1px solid rgba(159, 38, 52, .16);
  background: #fff;
  box-shadow: 0 2px 8px rgba(36, 31, 33, .18);
  display: grid;
  place-content: center;
  gap: 5px;
  cursor: pointer;
}
.menu-button span { width: 20px; height: 2px; background: var(--ink); }

.nav-scrim {
  position: fixed;
  z-index: 50;
  inset: 0;
  background: rgba(36,31,33,.38);
  opacity: 0;
  pointer-events: none;
  transition: opacity .2s ease;
}
.nav-scrim.active { opacity: 1; pointer-events: auto; }
.side-nav {
  position: fixed;
  z-index: 60;
  inset: 0 auto 0 0;
  width: min(var(--nav-width), 88vw);
  overflow-y: auto;
  padding: 18px;
  background: rgba(255,250,248,.98);
  transform: translateX(-104%);
  transition: transform .24s ease;
}
.side-nav.open { transform: translateX(0); box-shadow: 20px 0 44px rgba(36,31,33,.16); }
.side-nav-head { display: flex; justify-content: flex-end; margin-bottom: 12px; }
.side-nav-head button {
  width: 40px;
  height: 40px;
  border: 1px solid var(--line);
  background: #fff;
  cursor: pointer;
  font-size: 1.1rem;
}
.nav-tree, .nav-tree ul { list-style: none; margin: 0; padding: 0; }
.nav-tree { display: grid; gap: 4px; }
.nav-tree ul { margin: 4px 0 8px 12px; padding-left: 12px; border-left: 1px solid var(--line); }
.nav-tree a {
  display: flex;
  align-items: center;
  min-height: 34px;
  padding: 7px 10px;
  border-left: 3px solid transparent;
  color: #5f4b48;
  text-decoration: none;
  font-size: .92rem;
  white-space: nowrap;
  transition: color .18s ease, background .18s ease, border-color .18s ease;
}
.nav-tree a:hover {
  color: var(--accent-dark);
  background: rgba(255,255,255,.7);
  border-left-color: var(--accent);
}
.nav-tree a.active {
  color: var(--accent-dark);
  background: var(--soft);
  border-left-color: var(--accent);
  font-weight: 700;
}

.page-shell { min-height: 100vh; }
.hero-wrap {
  position: relative;
  margin-bottom: 16px;
  box-shadow: 0 15px 6px -10px rgba(36, 31, 33, .38);
}
.hero {
  position: relative;
  height: min(20vw, 240px);
  overflow: hidden;
  background-image: url(assets/images/bildoben_fill.jpg);
  background-repeat: repeat-x;
  background-position: left top;
  background-size: auto 100%;
}
.hero img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: contain;
  object-position: left top;
  opacity: 1;
  mask-image: linear-gradient(90deg, #000 0 88%, transparent 100%);
  -webkit-mask-image: linear-gradient(90deg, #000 0 88%, transparent 100%);
}
.hero::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(0deg, rgba(44,38,36,.10), transparent 55%);
}
.hero-parallax {
  will-change: transform;
}

.content-layout {
  width: min(1120px, calc(100% - 32px));
  margin: clamp(28px, 6vw, 72px) auto;
  display: grid;
  grid-template-columns: minmax(0, 1fr) 280px;
  gap: clamp(24px, 4vw, 54px);
  align-items: start;
}
.content {
  min-width: 0;
  padding-bottom: 30px;
}
.content h1 {
  margin: 0 0 20px;
  color: var(--accent-dark);
  font-family: var(--font-heading);
  font-size: clamp(1.4rem, 2.4vw, 2rem);
  line-height: 1.2;
  letter-spacing: 0;
  font-weight: 600;
}
.richtext {
  font-size: 1rem;
  overflow-wrap: anywhere;
}
.richtext h1, .richtext h2, .richtext h3 {
  color: inherit;
  font-family: Arial, Helvetica, sans-serif;
  line-height: 1.25;
  letter-spacing: 0;
  font-weight: inherit;
  clear: both;
}
.richtext h1 { margin: 1.4em 0 .8em; font-size: 1rem; }
.richtext h2 { margin-top: 1.4em; font-size: 1rem; }
.richtext h3 { margin-top: 1.3em; font-size: 1rem; }
.richtext h1.ta-center:has(u),
.richtext h1:has(u) {
  text-align: left !important;
  color: inherit !important;
  font: inherit !important;
  font-weight: 700 !important;
}
.richtext h1:has(u) * {
  color: inherit !important;
  font-size: inherit !important;
  font-family: inherit !important;
  text-align: left !important;
}
.richtext p:has(> u),
.richtext p:has(> b > u),
.richtext p:has(> u > b) {
  clear: both;
  width: 100%;
  text-align: left !important;
  color: inherit;
  font: inherit;
  font-weight: 700;
  margin: 1.4em 0 .8em;
}
.richtext .legacy-subheading {
  display: block;
  clear: both;
  float: none;
  width: 100%;
  text-align: left !important;
  color: inherit;
  font: inherit;
  font-weight: 700;
  padding: 0;
  margin: 1.4em 0 .8em;
}
.richtext .legacy-subheading *,
.richtext p:has(> u) * {
  color: inherit !important;
  font-size: inherit !important;
  text-align: left !important;
}
.richtext::after { content: ""; display: block; clear: both; }
.richtext .legacy-image-band {
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
  align-items: flex-start;
  margin: 18px 0 24px;
}
.richtext .legacy-image-band a,
.richtext .legacy-image-band img {
  flex: 0 1 auto;
}
.richtext .legacy-image-band img {
  width: auto;
  max-width: min(100%, 280px);
  max-height: 260px;
  object-fit: cover;
  margin: 0;
}
.richtext table {
  width: 100%;
  max-width: 100%;
  border-collapse: collapse;
  margin: 1.2em 0;
}
.richtext th, .richtext td {
  border: 1px solid var(--line);
  padding: 8px 10px;
  text-align: left;
  vertical-align: top;
}
.richtext th { background: var(--soft); color: var(--accent-dark); font-weight: 600; }
.richtext img {
  max-width: min(100%, 680px);
  margin: 12px 0;
  border-radius: 6px;
}
.richtext a img { cursor: zoom-in; }
.richtext .img-float-right {
  display: block;
  float: right;
  margin: 4px 0 10px 16px;
  max-width: 45%;
}
.richtext .img-float-left {
  display: block;
  float: left;
  margin: 4px 16px 10px 0;
  max-width: 45%;
}
.richtext .img-center { display: block; margin: 16px auto; float: none; }
.richtext .img-full { display: block; width: 100%; max-width: 100%; margin: 16px 0; float: none; }
.richtext .ta-center { text-align: center; }
.richtext .ta-right { text-align: right; }
.richtext [align="left"],
.richtext .ta-center[align="left"] {
  text-align: left !important;
}
.richtext [style] { max-width: 100%; }
@media (max-width: 640px) {
  .richtext .img-float-right, .richtext .img-float-left {
    display: block;
    max-width: 100%;
    margin: 12px 0;
  }
  .richtext table {
    display: block;
    overflow-x: auto;
    white-space: nowrap;
  }
  .richtext .legacy-image-band {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  }
  .richtext .legacy-image-band img {
    width: 100%;
    max-width: 100%;
    max-height: none;
    aspect-ratio: 4 / 3;
  }
}
.richtext .legacy-gallery {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 14px;
}
.richtext .legacy-gallery img { width: 100%; aspect-ratio: 4 / 3; object-fit: cover; margin: 0; }

.sub-entry {
  margin-top: 2.6em;
  padding-top: 2.2em;
  border-top: 2px solid var(--line);
}
.sub-entry > h2 {
  margin: 0 0 .6em;
  font-family: var(--font-heading);
  font-size: 1.3rem;
  font-weight: 600;
  color: var(--accent-dark);
}

.sidebar {
  position: sticky;
  top: 96px;
  display: grid;
  gap: 14px;
}
.info-panel {
  border: 1px solid var(--line);
  background: #fff;
  padding: 18px;
  border-radius: 8px;
}
.info-panel h2 {
  margin: 0 0 10px;
  font-family: var(--font-heading);
  font-size: .95rem;
  font-weight: 600;
  color: var(--accent-dark);
}
.info-panel p {
  margin: 0 0 7px;
  color: var(--muted);
  font-size: .82rem;
  white-space: nowrap;
}
.info-panel p:last-child { margin-bottom: 0; }
.info-panel a { font-size: .82rem; }

body.lex-modal-lock { overflow: hidden; }
.lex-modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 300;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  background: rgba(36, 31, 33, 0);
  opacity: 0;
  pointer-events: none;
  transition: opacity .28s ease, background-color .28s ease;
}
.lex-modal-backdrop.open {
  opacity: 1;
  background: rgba(36, 31, 33, .5);
  pointer-events: auto;
}
.lex-modal {
  width: min(640px, 100%);
  max-height: min(82vh, 720px);
  background: #fff;
  border-radius: 16px;
  box-shadow: 0 30px 70px rgba(36, 31, 33, .35);
  position: relative;
  overflow: hidden;
  transform: scale(.92) translateY(14px);
  opacity: 0;
  transition: transform .32s cubic-bezier(.22, 1, .36, 1), opacity .26s ease;
}
.lex-modal-backdrop.open .lex-modal {
  transform: scale(1) translateY(0);
  opacity: 1;
}
.lex-modal-close {
  position: absolute;
  top: 10px;
  right: 10px;
  z-index: 1;
  width: 40px;
  height: 40px;
  border: 0;
  border-radius: 50%;
  background: var(--soft);
  color: var(--ink);
  font-size: 1.4rem;
  line-height: 1;
  cursor: pointer;
  display: grid;
  place-items: center;
  transition: background .15s ease, color .15s ease, transform .15s ease;
}
.lex-modal-close:hover { background: var(--accent); color: #fff; transform: rotate(90deg); }
.lex-modal-scroll {
  max-height: min(82vh, 720px);
  overflow-y: auto;
  padding: 34px 30px 28px;
}
.lex-modal-title {
  margin: 0 0 14px;
  padding-right: 30px;
  font-family: var(--font-heading);
  font-size: 1.35rem;
  font-weight: 600;
  color: var(--accent-dark);
}
.lex-modal-content { font-size: .98rem; }
@media (max-width: 640px) {
  .lex-modal-backdrop { padding: 0; align-items: flex-end; }
  .lex-modal {
    width: 100%;
    max-height: 86vh;
    border-radius: 18px 18px 0 0;
    transform: translateY(100%);
  }
  .lex-modal-backdrop.open .lex-modal { transform: translateY(0); }
  .lex-modal-scroll { max-height: 86vh; padding: 28px 20px 26px; }
}

.lightbox-backdrop {
  position: fixed;
  inset: 0;
  z-index: 300;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  background: rgba(20, 17, 18, 0);
  opacity: 0;
  pointer-events: none;
  transition: opacity .28s ease, background-color .28s ease;
}
.lightbox-backdrop.open {
  opacity: 1;
  background: rgba(20, 17, 18, .88);
  pointer-events: auto;
}
.lightbox-img {
  max-width: min(92vw, 1100px);
  max-height: 88vh;
  border-radius: 6px;
  box-shadow: 0 30px 70px rgba(0, 0, 0, .5);
  transform: scale(.92);
  opacity: 0;
  transition: transform .32s cubic-bezier(.22, 1, .36, 1), opacity .26s ease;
  cursor: default;
}
.lightbox-backdrop.open .lightbox-img { transform: scale(1); opacity: 1; }
.lightbox-close {
  position: fixed;
  top: 16px;
  right: 20px;
  z-index: 1;
  width: 44px;
  height: 44px;
  border: 0;
  border-radius: 50%;
  background: rgba(255, 255, 255, .92);
  color: var(--ink);
  font-size: 1.6rem;
  line-height: 1;
  cursor: pointer;
  display: grid;
  place-items: center;
  transition: background .15s ease, color .15s ease, transform .15s ease;
}
.lightbox-close:hover { background: var(--accent); color: #fff; transform: rotate(90deg); }

.site-footer {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px 22px;
  padding: 24px clamp(16px, 4vw, 46px);
  border-top: 1px solid var(--line);
  background: #fff;
  color: var(--muted);
}
.footer-link {
  appearance: none;
  border: 0;
  padding: 0;
  background: transparent;
  color: var(--accent-dark);
  font: inherit;
  text-decoration: underline;
  text-decoration-color: rgba(159, 38, 52, .28);
  text-underline-offset: .22em;
  cursor: pointer;
}
.footer-link:hover { color: var(--pin-blue); }

.cookie-consent {
  position: fixed;
  z-index: 500;
  left: clamp(12px, 3vw, 34px);
  right: clamp(12px, 3vw, 34px);
  bottom: clamp(12px, 3vw, 28px);
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 18px;
  align-items: end;
  max-width: 980px;
  margin: 0 auto;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 250, 248, .98);
  box-shadow: 0 20px 52px rgba(36, 31, 33, .18);
}
.cookie-consent[hidden] { display: none; }
.cookie-consent h2 {
  margin: 0 0 6px;
  color: var(--accent-dark);
  font-family: var(--font-heading);
  font-size: 1rem;
  font-weight: 700;
}
.cookie-consent p {
  margin: 0 0 10px;
  color: var(--muted);
  font-size: .92rem;
  line-height: 1.45;
}
.cookie-choice {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: .92rem;
  font-weight: 700;
  color: var(--ink);
}
.cookie-choice input { width: auto; accent-color: var(--accent); }
.cookie-consent-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 8px;
}
.cookie-consent button {
  min-height: 38px;
  border: 1px solid var(--accent);
  border-radius: 6px;
  padding: 8px 12px;
  background: var(--accent);
  color: #fff;
  font: inherit;
  font-weight: 700;
  cursor: pointer;
}
.cookie-consent button.ghost {
  border-color: var(--line);
  background: #fff;
  color: var(--ink);
}
.cookie-consent button:hover { filter: brightness(.96); }

@media (min-width: 1120px) {
  .mobile-nav-bar, .side-nav-head, .nav-scrim { display: none; }
  .side-nav {
    position: sticky;
    top: 0;
    z-index: 40;
    width: 100%;
    height: auto;
    padding: 0 clamp(12px, 3vw, 34px);
    box-shadow: none;
    border-bottom: 1px solid var(--line);
    transform: none;
  }
  .side-nav nav > .nav-tree {
    max-width: 1480px;
    margin: 0 auto;
    display: flex;
    flex-wrap: nowrap;
    gap: 0 4px;
    justify-content: center;
    overflow-x: auto;
    scrollbar-width: thin;
  }
  .side-nav nav > .nav-tree > li > a {
    min-height: 34px;
    padding: 7px 10px;
    border-left: none;
    border-radius: 999px;
    font-size: .82rem;
    letter-spacing: 0;
  }
  .side-nav nav > .nav-tree > li > a.active {
    background: var(--soft);
    color: var(--accent-dark);
    font-weight: 700;
    border-radius: 0;
    box-shadow: inset 0 -2px 0 var(--accent);
  }
  .side-nav nav > .nav-tree > li > a.active:hover { color: var(--accent-dark); }
  .nav-tree li { position: relative; }
  .nav-tree ul {
    position: fixed;
    z-index: 60;
    min-width: 218px;
    display: none;
    margin: 0;
    padding: 6px;
    border: 1px solid var(--line);
    background: #fff;
    box-shadow: 0 18px 38px rgba(36,31,33,.12);
  }
  .nav-tree li:hover > ul { display: grid; }
  .nav-tree li:has(> ul) > a::after {
    content: "";
    display: inline-block;
    width: 6px;
    height: 6px;
    margin: 0 0 2px 6px;
    border-right: 2px solid currentColor;
    border-bottom: 2px solid currentColor;
    transform: rotate(45deg);
    opacity: .85;
  }
}

@media (max-width: 880px) {
  .content-layout { grid-template-columns: 1fr; }
  .sidebar { position: static; }
}

@media (max-width: 560px) {
  .content-layout { width: min(100% - 32px, 1120px); }
  .cookie-consent {
    grid-template-columns: 1fr;
    align-items: stretch;
  }
  .cookie-consent-actions { justify-content: stretch; }
  .cookie-consent button { flex: 1 1 100%; }
}
