/* CKB-VISUAL-REFINE-DETAIL-CONTINUITY-R1 / Theme 0.4.75
 * Scoped to the templates with historically detached back navigation.
 * The title band stays dark; long-form content stays light.
 * Keep old routes, language labels, disabled/pending states, and forms unchanged.
 */

/* Shared back control: the parent is always a full-bleed dark Section Hero. */
body.ckb-wp-shell .ckb-detail-hero--unified .ckb-hero-back {
  grid-column: 1 / -1;
  justify-self: start;
  align-self: start;
  width: fit-content;
  max-width: 100%;
  min-height: 44px;
  margin: 0 0 clamp(16px, 2.2vw, 28px);
  padding: 5px 0;
  display: inline-flex;
  align-items: center;
  border: 0;
  font-size: 12px;
  line-height: 1.5;
  font-weight: 650;
  letter-spacing: .055em;
  color: rgba(255,255,255,.82);
  text-decoration: none;
  overflow-wrap: anywhere;
  box-sizing: border-box;
}
body.ckb-wp-shell .ckb-detail-hero--unified a.ckb-hero-back:hover,
body.ckb-wp-shell .ckb-detail-hero--unified .ckb-library-back a:hover {
  color: #fff;
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 5px;
}
body.ckb-wp-shell .ckb-detail-hero--unified a.ckb-hero-back:focus-visible,
body.ckb-wp-shell .ckb-detail-hero--unified .ckb-library-back a:focus-visible {
  color: #fff;
  outline: 2px solid #fff;
  outline-offset: 3px;
  text-decoration: underline;
  text-underline-offset: 5px;
}

/* Article + Grußwort: old white back strips are replaced by hero-contained links.
 * Article reading and video-iframe CSS are not touched. */
body.ckb-wp-shell .ckb-article-detail .article-detail > header.ckb-detail-hero--unified,
body.ckb-wp-shell .ckb-greeting-detail > header.ckb-detail-hero--unified {
  padding-top: clamp(28px, 3.5vw, 46px);
}
body.ckb-wp-shell .ckb-article-detail .article-detail > header.ckb-detail-hero--unified .detail-back,
body.ckb-wp-shell .ckb-greeting-main .ckb-greeting-detail > header.ckb-detail-hero--unified .detail-back {
  margin: 0 0 clamp(15px, 2vw, 25px);
  border: 0;
  color: rgba(255,255,255,.82);
}
body.ckb-wp-shell .ckb-greeting-main .ckb-greeting-detail > header.ckb-detail-hero--unified .ckb-greeting-back-pending {
  opacity: .56;
  cursor: not-allowed;
  text-decoration: none;
}
/* Draft flag remains visible to authorized editors, but no longer creates a white strip. */
body.ckb-wp-shell[data-page="article"] .ckb-article-detail .ckb-hero-preview-notice {
  display: block;
  max-width: 720px;
  margin: 0 0 22px;
  padding: 11px 15px;
  border-left: 3px solid rgba(255,255,255,.85);
  background: rgba(255,255,255,.1);
  color: #fff !important;
  font-size: 14px;
  line-height: 1.5;
}

/* Library Signup / Reservation: back link occupies a full grid row above kicker.
 * `ckb_theme_library_link()` still emits disabled text when target unavailable. */
body.ckb-wp-shell .ckb-library-main .service-hero.ckb-detail-hero--unified .ckb-library-back {
  display: block;
  grid-column: 2 / -1; /* align with heading; keep kicker in the first column */
  min-height: 44px;
  margin: 0 0 clamp(10px, 1.8vw, 22px);
  padding: 0;
  color: rgba(255,255,255,.82);
  line-height: 1.5;
}
body.ckb-wp-shell .ckb-library-main .service-hero.ckb-detail-hero--unified .ckb-library-back a,
body.ckb-wp-shell .ckb-library-main .service-hero.ckb-detail-hero--unified .ckb-library-back span {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  max-width: 100%;
  padding: 5px 0;
  color: inherit;
  font-size: 12px;
  line-height: 1.5;
  text-decoration: none;
  overflow-wrap: anywhere;
}
body.ckb-wp-shell .ckb-library-main .service-hero.ckb-detail-hero--unified .ckb-library-back .ckb-library-pending {
  color: rgba(255,255,255,.54);
  cursor: not-allowed;
}

/* Course detail: keep Kurse vs Kurstermine return semantics exactly as generated. */
body.ckb-wp-shell .ckb-course-detail .content-hero.ckb-detail-hero--unified .ckb-course-back {
  grid-column: 2 / -1; /* title column on desktop */
  margin: 0 0 clamp(12px, 1.7vw, 23px);
  color: rgba(255,255,255,.82);
  font-size: 12px;
  font-weight: 650;
  line-height: 1.5;
}

@media (max-width: 860px) {
  body.ckb-wp-shell .ckb-detail-hero--unified .ckb-hero-back { margin-bottom: 17px; }
  body.ckb-wp-shell .ckb-article-detail .article-detail > header.ckb-detail-hero--unified,
  body.ckb-wp-shell .ckb-greeting-detail > header.ckb-detail-hero--unified { padding-top: 30px; }
  body.ckb-wp-shell .ckb-library-main .service-hero.ckb-detail-hero--unified .ckb-library-back { grid-column: 1 / -1; margin-bottom: 14px; }
  body.ckb-wp-shell .ckb-course-detail .content-hero.ckb-detail-hero--unified .ckb-course-back { grid-column: 1 / -1; }
}
