/* ============================================================
   CKB-WEB-SECTION-CONTINUITY-R1
   Deep Curtain Section Shell + Context-aware Navigation Reclosure
   Parent: CKB-WEB-LEGACY-GAP-CLOSURE-R1
   Scope: preserve the dark navigation identity into secondary pages
   without turning long-reading / form content into dark mode.
   ============================================================ */

:root {
  --section-shell-bg: var(--curtain-bg, #26333d);
  --section-shell-line: rgba(255,255,255,.22);
  --section-shell-muted: rgba(255,255,255,.68);
}

/* Header stays in the same deep field after entering a section page. */
.site-header-shell.is-section {
  background: var(--section-shell-bg) !important;
  color: #fff !important;
  border-color: var(--section-shell-line) !important;
}
.site-header-shell.is-section .brand-lockup-full { display:none !important; }
.site-header-shell.is-section .brand-lockup-full-dark { display:block !important; }
.site-header-shell.is-section .brand-lockup-seal-only { display:none !important; }
.site-header-shell.is-section .nav-trigger,
.site-header-shell.is-section .nav-direct,
.site-header-shell.is-section .language-switch,
.site-header-shell.is-section .mobile-menu-trigger { color:#fff !important; }
.site-header-shell.is-section .language-switch .lang-divider { color:rgba(255,255,255,.48) !important; }
.site-header-shell.is-section .nav-trigger.is-current,
.site-header-shell.is-section .nav-direct.is-current { color:#fff !important; opacity:1; }

/* Remove the old white breathing strip above page heroes. */
body.has-section-continuity .service-main,
body.has-section-continuity .partner-main,
body.has-section-continuity .archive-main,
body.has-section-continuity .content-main,
body.has-section-continuity .article-main,
body.has-section-continuity .detail-main { padding-top:0 !important; }

/* Full-bleed dark field while preserving the existing content grid. */
.section-shell-target,
.section-shell-group {
  position:relative;
  isolation:isolate;
  color:#fff;
}
.section-shell-target::before,
.section-shell-group::before {
  content:"";
  position:absolute;
  z-index:-1;
  top:0;
  bottom:0;
  left:50%;
  width:100vw;
  background:var(--section-shell-bg);
  transform:translateX(-50%) scaleY(1);
  transform-origin:top center;
  animation:ckb-section-curtain-drop 280ms cubic-bezier(.2,.7,.25,1) both;
}
.section-shell-target > *,
.section-shell-group > * {
  animation:ckb-section-shell-content 220ms ease-out 70ms both;
}
@keyframes ckb-section-curtain-drop {
  from { transform:translateX(-50%) scaleY(.02); }
  to   { transform:translateX(-50%) scaleY(1); }
}
@keyframes ckb-section-shell-content {
  from { opacity:0; transform:translateY(-8px); }
  to   { opacity:1; transform:translateY(0); }
}
@media (prefers-reduced-motion: reduce) {
  .section-shell-target::before,
  .section-shell-group::before,
  .section-shell-target > *,
  .section-shell-group > * { animation:none !important; }
}

/* Hero spacing and hierarchy remain editorial, but now belong to the curtain field. */
.service-hero.section-shell-target,
.archive-hero.section-shell-target,
.content-hero.section-shell-target {
  padding-top:64px;
  border-bottom-color:var(--section-shell-line) !important;
}
.calendar-hero.section-shell-target {
  padding-top:50px !important;
  border-bottom-color:var(--section-shell-line) !important;
}
.article-detail > header.section-shell-target {
  padding-top:64px;
  border-bottom-color:var(--section-shell-line) !important;
}
.section-shell-detail-group { padding-top:46px; }
.section-shell-detail-group .detail-back {
  color:#fff;
  margin-bottom:34px;
  border-bottom-color:rgba(255,255,255,.62);
}
.section-shell-detail-group .detail-hero {
  border-bottom-color:var(--section-shell-line) !important;
}

/* White-on-deep section typography. */
.section-shell-target .section-kicker,
.section-shell-target .detail-kicker,
.section-shell-target .article-meta,
.section-shell-group .detail-kicker { color:rgba(255,255,255,.74) !important; }
.section-shell-target > p,
.section-shell-target .article-lede { color:var(--section-shell-muted) !important; }
.section-shell-group .detail-facts > div { border-top-color:var(--section-shell-line) !important; }
.section-shell-group .detail-facts span,
.section-shell-group .detail-facts small { color:var(--section-shell-muted) !important; }
.section-shell-target a,
.section-shell-group a { color:inherit; }

/* Context-aware Bibliothek contact: show the relevant form, not the generic visit grid. */
body.is-library-contact .service-grid { display:none !important; }
body.is-library-contact .shared-form-section { padding-top:46px; }
.library-context-back {
  display:inline-flex;
  margin-top:24px;
  font-size:12px;
  font-weight:700;
  letter-spacing:.08em;
  text-decoration:none;
}
.library-context-back:hover,
.library-context-back:focus-visible { text-decoration:underline; text-underline-offset:4px; }

@media (max-width:860px) {
  .service-hero.section-shell-target,
  .archive-hero.section-shell-target,
  .content-hero.section-shell-target,
  .calendar-hero.section-shell-target,
  .article-detail > header.section-shell-target { padding-top:38px !important; }
  .section-shell-detail-group { padding-top:30px; }
  .section-shell-detail-group .detail-back { margin-bottom:26px; }
  body.is-library-contact .shared-form-section { padding-top:34px; }
}
