/* ============================================================
   public.css - Bautagebuch Public-Variante (2026-05-21)
   Hero + Sidebar-Layout + kompaktere Timeline + breitere Galerie
   ============================================================ */

/* Basis Reset fuer Public-Page */
.page-public {
  margin: 0;
  padding: 0;
  background: var(--color-bg, #FAFBFD);
  color: var(--color-text, #1A1F2E);
}

/* ===== HERO ===== */
.public-hero {
  position: relative;
  min-height: 72vh;
  padding: 10vh 1.5rem 10vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0;
  overflow: hidden;
  color: #fff;
}
.public-hero__bg {
  position: absolute;
  inset: 0;
  z-index: 0;
}
/* Reines Wehr-Blau (Roman 2026-06-19): kein Gold-Schimmer mehr.
   Royal-Blau aus dem Wappen als Basis, nach unten/links dunkler.
   Die helleren Pole oben rechts entsprechen visuell dem Mittel-Blau
   des Wappens; nach unten/links verschattet ins Tief-Blau. */
.public-hero__bg-image {
  position: absolute;
  inset: 0;
  background:
    radial-gradient(ellipse at 75% 28%, rgba(60, 110, 180, 0.42) 0%, transparent 58%),
    radial-gradient(ellipse at 20% 85%, rgba(8, 22, 50, 0.55) 0%, transparent 60%),
    linear-gradient(165deg, #173f78 0%, #102E5C 60%, #0B1F44 100%);
  background-attachment: fixed;
}
/* BG-Wappen (Roman 2026-06-19): komplett weg, war auf Desktop sichtbar
   weil background-attachment: fixed, auf iOS Safari ignoriert wird.
   Reine Plakat-Gradient-Flaeche ist sauberer. */
.public-hero__bg-image::before { display: none; }
/* Veil v2 (Roman 2026-06-19): perzeptuell smooth statt sRGB-linear.
   Drei Techniken kombiniert:
   1. Color-Interpolation in OKLCh (CSS Color 4, Browser-Support
      Chrome 111+/Safari 16.4+/Firefox 128+). OKLCh ist wahrnehmungs-
      uniform, eliminiert die typische "Bauchung" im Blau-zu-Weiss-
      Uebergang den sRGB-Interpolation erzeugt.
   2. Easing-Stops nach quintic-easeIn berechnet - der Verlauf zieht
      sich mit physikalisch korrekter Kurve in den Page-BG, statt linear.
   3. Subtle Noise-Overlay (via ::after, separat) gegen Banding auf
      8-bit Displays.
   Stops mit derselben Endfarbe (transparent-tinted-weiss), damit
   OKLCh nicht zwischen Hue-spruengen interpolieren muss. */
.public-hero__bg-veil {
  position: absolute;
  inset: 0;
  background: linear-gradient(
    in oklch to bottom,
    rgba(250, 251, 253, 0.0)  0%,
    rgba(250, 251, 253, 0.0) 45%,
    rgba(250, 251, 253, 0.015) 58%,
    rgba(250, 251, 253, 0.05) 68%,
    rgba(250, 251, 253, 0.12) 76%,
    rgba(250, 251, 253, 0.24) 83%,
    rgba(250, 251, 253, 0.44) 89%,
    rgba(250, 251, 253, 0.68) 93%,
    rgba(250, 251, 253, 0.86) 96%,
    rgba(250, 251, 253, 0.96) 98%,
    var(--color-bg, #FAFBFD) 100%
  );
}
/* Noise gegen Color-Banding (8-bit Display-Beschraenkung). Sehr subtle.
   SVG-feTurbulence als data-URL, blend-mode overlay damit das Rauschen
   nur im Helligkeits-Bereich wirkt wo Banding auftritt. */
.public-hero__bg-veil::after {
  content: "";
  position: absolute;
  inset: 0;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='240' height='240'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='2' seed='5'/><feColorMatrix values='0 0 0 0 1  0 0 0 0 1  0 0 0 0 1  0 0 0 0.4 0'/></filter><rect width='100%25' height='100%25' filter='url(%23n)'/></svg>");
  background-size: 240px 240px;
  mix-blend-mode: overlay;
  opacity: 0.5;
  pointer-events: none;
}
/* Fallback fuer aeltere Browser ohne OKLCh-Color-Interpolation */
@supports not (background: linear-gradient(in oklch to bottom, red, blue)) {
  .public-hero__bg-veil {
    background: linear-gradient(
      to bottom,
      rgba(250, 251, 253, 0.0)  0%,
      rgba(250, 251, 253, 0.0) 45%,
      rgba(250, 251, 253, 0.05) 65%,
      rgba(250, 251, 253, 0.22) 80%,
      rgba(250, 251, 253, 0.55) 90%,
      rgba(250, 251, 253, 0.88) 96%,
      var(--color-bg, #FAFBFD) 100%
    );
  }
}

.public-hero__inner {
  position: relative;
  z-index: 2;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1.5rem;
  padding: 2rem 1.5rem;
  text-align: center;
  will-change: transform, opacity;
}
.public-hero__wappen-link {
  display: inline-block;
  border-radius: 50%;
  transition: transform 220ms ease, box-shadow 220ms ease;
}
.public-hero__wappen-link:hover {
  transform: scale(1.03);
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.4);
}
/* Responsive Wappen-Groessen (Roman 2026-06-19):
   Mobile 256px (klein) -> Tablet 320px -> Desktop 384px (-20% von 480px).
   aspect-ratio + max-width=max-height verhindern Ei-Form bei Viewport-Clamp. */
.public-hero__wappen {
  width: 384px;
  height: 384px;
  max-width: 80vw;
  max-height: 80vw;
  aspect-ratio: 1 / 1;
  object-fit: contain;
  display: block;
  filter: drop-shadow(0 8px 32px rgba(0, 0, 0, 0.45));
}
@media (max-width: 1024px) and (min-width: 721px) {
  .public-hero__wappen { width: 320px; height: 320px; }
}
.public-hero__text {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  align-items: center;
}
.public-hero__title {
  margin: 0;
  font-family: var(--font-display, var(--font-serif, 'Source Serif 4', Georgia, serif));
  font-style: normal;
  font-weight: 600;
  font-size: clamp(2.4rem, 6vw, 4.6rem);
  line-height: 1.02;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--color-accent, #F4C300);
  text-shadow: 0 2px 12px rgba(0, 0, 0, 0.35);
}
.public-hero__sub {
  margin: 0;
  font-family: var(--font-sans, 'Inter Tight', sans-serif);
  font-weight: 400;
  font-size: clamp(1rem, 2vw, 1.4rem);
  letter-spacing: 0.04em;
  color: rgba(255, 255, 255, 0.92);
  text-shadow: 0 2px 8px rgba(0, 0, 0, 0.25);
}
/* Intro breiter (Roman 2026-06-19): an Headline-Breite orientiert,
   2-zeilig statt 3-zeilig. Etwas groessere Schrift damit der Block
   harmonisch zur Headline wirkt. */
.public-hero__intro {
  margin: 0.95rem 0 0;
  max-width: 52ch;
  font-family: var(--font-sans, 'Inter Tight', sans-serif);
  font-weight: 400;
  font-size: clamp(0.94rem, 1.25vw, 1.1rem);
  line-height: 1.5;
  letter-spacing: 0.005em;
  color: rgba(255, 255, 255, 0.86);
  text-shadow: 0 1px 6px rgba(0, 0, 0, 0.25);
}
@media (max-width: 600px) {
  .public-hero__intro {
    max-width: 34ch;
    font-size: 0.88rem;
    line-height: 1.45;
    margin-top: 0.75rem;
  }
}
/* Scroll-Indikator nicht mehr fix-bottom positioniert (Roman 2026-06-19):
   sitzt als regulaeres Flex-Child UNTER dem Wappen+Text-Block. So richtet
   sich seine Position automatisch nach der Hoehe des Inhalts - er kommt
   nie ins Wappen rein. */
.public-hero__scroll {
  position: relative;
  z-index: 3;
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  gap: 0.4rem;
  margin-top: 3rem;
  color: rgba(255, 255, 255, 0.92);
  text-decoration: none;
  font-family: var(--font-mono, 'JetBrains Mono', monospace);
  font-size: 0.72rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  text-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
  animation: public-bob 2.4s ease-in-out infinite;
}
.public-hero__scroll-arrow {
  font-size: 1.4rem;
  line-height: 1;
  color: var(--color-accent, #F4C300);
}
@keyframes public-bob {
  0%, 100% { transform: translateY(0); }
  50%      { transform: translateY(8px); }
}
@media (prefers-reduced-motion: reduce) {
  .public-hero__scroll { animation: none; }
}

/* ===== SIDEBAR-TOGGLE ===== */
.public-sidebar-toggle {
  position: fixed;
  top: 1rem;
  left: 1rem;
  z-index: 60;
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
  padding: 0.65rem 1rem 0.65rem 0.75rem;
  background: var(--color-primary, #1B4D8C);
  color: #fff;
  border: 0;
  border-radius: 999px;
  cursor: pointer;
  box-shadow: 0 4px 14px rgba(15, 30, 60, 0.25);
  font-family: var(--font-sans, 'Inter Tight', sans-serif);
  font-size: 0.85rem;
  font-weight: 600;
  letter-spacing: 0.01em;
  transition: background 180ms ease, transform 120ms ease;
}
.public-sidebar-toggle:hover {
  background: var(--color-primary-deep, #133a6e);
}
.public-sidebar-toggle:active { transform: scale(0.97); }
.public-sidebar-toggle__icon {
  display: inline-block;
  width: 18px;
  height: 12px;
  position: relative;
}
.public-sidebar-toggle__icon::before,
.public-sidebar-toggle__icon::after,
.public-sidebar-toggle__icon {
  background: currentColor;
}
.public-sidebar-toggle__icon::before,
.public-sidebar-toggle__icon::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  height: 2px;
}
.public-sidebar-toggle__icon { background: transparent; }
.public-sidebar-toggle__icon::before { top: 0; box-shadow: 0 5px 0 currentColor; }
.public-sidebar-toggle__icon::after  { top: 10px; }
.public-sidebar-toggle__label { white-space: nowrap; }

/* ===== LAYOUT ===== */
.public-layout {
  position: relative;
  display: block;
}
.public-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.45);
  z-index: 45;
  opacity: 0;
  pointer-events: none;
  transition: opacity 220ms ease;
}

/* ===== SIDEBAR ===== */
.public-sidebar {
  position: fixed;
  top: 0;
  left: 0;
  bottom: 0;
  width: min(86%, 320px);
  background: var(--color-surface, #fff);
  border-right: 3px solid var(--color-accent, #F4C300);
  z-index: 50;
  transform: translateX(-100%);
  transition: transform 280ms cubic-bezier(0.2, 0, 0, 1);
  overflow-y: auto;
  overscroll-behavior: contain;
  box-shadow: 8px 0 24px rgba(0, 0, 0, 0.25);
}
.public-sidebar__inner {
  padding: 4.5rem 1.25rem 2rem;
}
.public-sidebar__eyebrow {
  margin: 0 0 0.2rem;
  font-family: var(--font-mono, 'JetBrains Mono', monospace);
  font-size: 0.68rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--color-text-muted, #5b6470);
}
.public-sidebar__title {
  margin: 0 0 1.4rem;
  font-family: var(--font-display, 'Source Serif 4', Georgia, serif);
  font-style: italic;
  font-size: 1.6rem;
  font-weight: 600;
  color: var(--color-primary, #1B4D8C);
  letter-spacing: -0.01em;
}
.public-sidebar__months {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}
.public-sidebar__month {
  border-top: 1px solid var(--color-hairline, rgba(15, 30, 60, 0.08));
}
.public-sidebar__month-toggle {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  padding: 0.7rem 0.25rem;
  cursor: pointer;
  list-style: none;
  user-select: none;
  font-family: var(--font-mono, 'JetBrains Mono', monospace);
  font-size: 0.74rem;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--color-text-soft, #5b6470);
}
.public-sidebar__month-toggle::-webkit-details-marker,
.public-sidebar__month-toggle::marker { display: none; content: ''; }
.public-sidebar__month-label {
  flex: 1;
  color: var(--color-text, #1a1f2e);
  font-weight: 600;
}
.public-sidebar__month-count {
  color: var(--color-text-muted, #5b6470);
  font-size: 0.7rem;
  background: rgba(15, 30, 60, 0.06);
  padding: 0.1rem 0.5rem;
  border-radius: 999px;
  font-weight: 600;
}
.public-sidebar__month-arrow {
  color: var(--color-text-muted, #5b6470);
  font-size: 1.5rem;
  line-height: 1;
  transform: rotate(90deg);
  transition: transform 180ms ease;
}
.public-sidebar__month[open] .public-sidebar__month-arrow {
  transform: rotate(-90deg);
}
.public-sidebar__items {
  list-style: none;
  margin: 0;
  padding: 0 0 0.4rem 0.25rem;
}
.public-sidebar__item a {
  display: flex;
  align-items: baseline;
  gap: 0.6rem;
  padding: 0.45rem 0.55rem 0.45rem 0.55rem;
  text-decoration: none;
  color: var(--color-text, #1a1f2e);
  font-size: 0.9rem;
  border-radius: 0 0.3rem 0.3rem 0;
  transition: background 140ms ease, color 140ms ease;
}
.public-sidebar__item a:hover {
  background: rgba(27, 77, 140, 0.06);
  color: var(--color-primary, #1B4D8C);
}
.public-sidebar__day {
  font-family: var(--font-mono, 'JetBrains Mono', monospace);
  font-size: 0.78rem;
  color: var(--color-text-muted, #5b6470);
  flex: 0 0 1.8rem;
  text-align: right;
}
.public-sidebar__label {
  font-size: 0.88rem;
  flex: 1;
  overflow: hidden;
  text-overflow: ellipsis;
}
.public-sidebar__item--milestone a {
  border-left: 3px solid var(--color-accent, #F4C300);
  padding-left: 0.5rem;
  background: rgba(244, 195, 0, 0.07);
}
.public-sidebar__item--milestone .public-sidebar__label {
  font-weight: 600;
  color: var(--color-primary, #1B4D8C);
}
.public-sidebar__item.is-active a {
  background: rgba(27, 77, 140, 0.1);
  color: var(--color-primary, #1B4D8C);
  font-weight: 600;
  border-left: 3px solid var(--color-primary, #1B4D8C);
  padding-left: 0.5rem;
}
.public-sidebar__item--milestone.is-active a {
  background: rgba(244, 195, 0, 0.2);
  border-left-color: var(--color-accent, #F4C300);
}

/* Geoeffneter Zustand (durch JS body-class oder data-attribute) */
.page-public[data-sidebar-open] .public-sidebar {
  transform: translateX(0);
}
.page-public[data-sidebar-open] .public-backdrop {
  opacity: 1;
  pointer-events: auto;
}

/* Toggle-Icon morphed zu X wenn offen */
.page-public[data-sidebar-open] .public-sidebar-toggle__icon::before {
  top: 5px;
  box-shadow: none;
  transform: rotate(45deg);
}
.page-public[data-sidebar-open] .public-sidebar-toggle__icon::after {
  top: 5px;
  transform: rotate(-45deg);
}

/* ===== TIMELINE TWEAKS ===== */
.public-main {
  position: relative;
  z-index: 1;
  padding: 3rem 1rem 4rem;
  max-width: 1500px;
  margin: 0 auto;
  transition: padding-left 280ms cubic-bezier(0.2, 0, 0, 1);
}

/* Sidebar liegt ueberall als Overlay ueber dem Content - kein Layout-Shift.
   (Frueher Desktop main padding-left + 320px - Roman 2026-06-19: das machte
   einen sichtbaren Sprung beim Auf-/Zumachen.) */

/* Scrollspy aus der Standard-View ausblenden (wir haben unsere eigene Sidebar) */
.page-public .scrollspy { display: none !important; }
.page-public .view-toggle { display: none !important; }
.page-public .milestones-nav { display: none !important; }

/* Order-Toggle: erlaubt in der Public-Variante, etwas dezenter platziert */
.page-public .order-toggle {
  justify-content: center;
  margin-top: 0;
  margin-bottom: 2rem;
}

/* (Cap-Regeln fuer .timeline--center::before stehen weiter unten,
   abgestimmt auf die hier neu definierten Patch-Groessen.) */

/* Layout breiter: max-width hoeher damit Cards mehr Platz haben.
   Patch-Groessen bleiben Original (104px / 76px). */
.page-public .timeline--center {
  max-width: 1400px;
  padding-inline: 1rem;
}
.page-public .timeline--center .entry {
  margin-block: 0 3rem;
  min-height: 200px;
}
.page-public .timeline--center .entry:last-child { margin-bottom: 0; }
.page-public .timeline--center .entry__date {
  position: sticky;
  top: 1.5rem;
  align-self: start;
}

/* Mittige Linie endet an Patch-Mitte (104px Patch -> 52px Cap) */
.page-public .timeline--center::before {
  top: 52px;
  bottom: 52px;
}

@media (max-width: 720px) {
  .page-public .timeline--center .entry {
    min-height: 140px;
    margin-block: 0 2rem;
  }
  .page-public .timeline--center .entry__date {
    position: relative;
    top: auto;
  }
  .page-public .timeline--center::before {
    top: 38px;
    bottom: 38px;
  }
}

/* Card-Innen: kein Padding-Block auf der Card selber - Content klebt
   am abgerundeten Rand (Bild bzw. Milestone-Banner direkt an der oberen
   runden Kante, body-Block an der unteren). */
.page-public .entry__card {
  padding-block: 0;
}
.page-public .entry__body {
  padding: 1rem 1.25rem 1.25rem;
}
.page-public .entry__title { margin-top: 0.3rem; margin-bottom: 0.4rem; }
.page-public .entry__content { margin-top: 0.4rem; line-height: 1.6; }

/* Bilder-Raster: pro Card sind alle Bilder gleich gross (aspect-ratio 4:3
   + gleichmaessige Spalten). Desktop dynamische Spalten ueber auto-fit,
   Mobile fix 3 Spalten (Roman: "auf Mobile, dass sich drei Vorschau
   Thumbnails ausgehen in einer Reihe"). 1-2 Bilder behalten cols-1/2.
*/
.page-public .entry__media--cols-1 { grid-template-columns: 1fr; }
.page-public .entry__media--cols-2 { grid-template-columns: 1fr 1fr; }
/* Raster fix 3 Spalten auf Desktop UND Mobile (Roman 2026-05-21):
   konsistente Tile-Groesse, Desktop einfach groesser im Verhaeltnis. */
.page-public .entry__media--cols-3 {
  display: grid;
  gap: 4px;
  grid-template-columns: repeat(3, 1fr);
}
.page-public .entry__media-link {
  aspect-ratio: 4 / 3;
  overflow: hidden;
  display: block;
}
.page-public .entry__media-link img,
.page-public .entry__media-link video {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
@media (max-width: 600px) {
  .page-public .entry__media--cols-1 { grid-template-columns: 1fr; }
  .page-public .entry__media--cols-2 { grid-template-columns: 1fr 1fr; }
  .page-public .entry__media--cols-3 {
    grid-template-columns: repeat(3, 1fr);
  }
}

/* ===== FOOTER ===== */
.public-footer {
  margin-top: 3rem;
  background: var(--color-primary, #1B4D8C);
  color: rgba(255, 255, 255, 0.92);
  padding: 1.5rem 1rem;
}
.public-footer__inner {
  max-width: 1500px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
}
.public-footer__link {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  color: inherit;
  text-decoration: none;
  font-family: var(--font-display, 'Source Serif 4', Georgia, serif);
  font-style: italic;
  font-size: 1.05rem;
}
.public-footer__link:hover { color: var(--color-accent, #F4C300); }
.public-footer__wappen {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.08);
}
.public-footer__copy {
  margin: 0;
  font-family: var(--font-mono, 'JetBrains Mono', monospace);
  font-size: 0.75rem;
  letter-spacing: 0.08em;
  opacity: 0.78;
}

/* Credit-Zeile ganz unten, zentriert. Stil aus Brunner-Footer adoptiert:
   "Crafted with ♥ by bildstelle", Herz dezent weiss-transparent in Serif. */
.public-footer__credit {
  max-width: 1500px;
  margin: 1.5rem auto 0;
  padding-top: 1.25rem;
  border-top: 1px solid rgba(255, 255, 255, 0.12);
  text-align: center;
  font-family: var(--font-sans, 'Inter Tight', sans-serif);
  font-size: 0.78rem;
  letter-spacing: 0.04em;
}
.public-footer__love {
  color: rgba(255, 255, 255, 0.55);
  text-decoration: none;
  transition: color 160ms ease;
}
.public-footer__love:hover { color: var(--color-accent, #F4C300); }
.public-footer__heart {
  font-family: 'Times New Roman', Times, serif;
  color: rgba(255, 255, 255, 0.6);
  font-size: 1.2em;
  line-height: 1;
  vertical-align: -0.08em;
  margin: 0 0.2rem;
}

/* ===== Mobile: Verbindungslinien IMMER nach rechts =====
   Bestehende timeline.css macht das nur unter 600px, im Bereich
   600-720px (Tablet-Portrait) bleibt der even-entry-Strich nach
   links sichtbar. Hier fixen wir das fuer den gesamten Mobile-Bereich. */
@media (max-width: 720px) {
  .page-public .timeline--center .entry__date::after,
  .page-public .timeline--center .entry:nth-child(even) .entry__date::after {
    left: 100% !important;
    right: auto !important;
    width: var(--space-md) !important;
  }
}

/* ===== Mobile-Tweaks ===== */
@media (max-width: 720px) {
  /* Mobile: kompakter, Indikator sitzt jetzt als flex-child unter dem Text. */
  .public-hero {
    min-height: 84vh;
    padding: 6vh 1rem 8vh;
  }
  .public-hero__wappen { width: 256px; height: 256px; max-width: 64vw; max-height: 64vw; }
  .public-sidebar-toggle__label { display: none; }
  .public-sidebar-toggle { padding: 0.65rem; }
  .public-sidebar-toggle__icon { width: 20px; }
  /* Seitenrand reduziert, mehr Platz fuer Content (Roman 2026-05-21) */
  .public-main { padding: 1.5rem 0.25rem 2.5rem; }
  .page-public .timeline--center { padding-inline: 0.25rem; }
  .page-public .entry__body { padding: 0.85rem 0.85rem 1rem; }
  .public-footer__inner { justify-content: center; text-align: center; }
  /* Datums-Patch: Year naeher an Monat, kompakter Block */
  .page-public .entry__month-name {
    margin-top: 0.1rem !important;
  }
  .page-public .entry__year {
    margin-top: 0.15rem !important;
    opacity: 0.9 !important;
  }
}

/* Year-Tweak (Roman 2026-06-19): eine Spur hoeher im Patch (= margin-top
   reduziert, also naeher am Monat-Namen) und 30% sichtbarer (opacity 0.7 -> 0.9)
   auf Desktop. Mobile-Wert siehe Block oben. */
.page-public .entry__year {
  margin-top: 0.25rem !important;
  opacity: 0.9 !important;
}
