/* CKB-WEB-V1-CLIENT-FEEDBACK-INTEGRATION-R1-B1-P1 / Theme 0.4.33
 * One additive last layer. No mutation of protected R1-R4-R4 styles.
 * Accessibility, visual icon candidates, and current CMS page structures only.
 */

/* NEWS added to the real provider-resolved navigation. Keep label size,
   preserve 44px interaction targets, recover spacing from empty margins. */
@media (min-width: 1241px) and (max-width: 1499px) {
  body.ckb-wp-shell .site-header .header-right {
    margin-left: clamp(8px, 1.4vw, 24px) !important;
    gap: clamp(10px, 1.1vw, 22px) !important;
  }
  body.ckb-wp-shell .site-header .main-nav { gap: 3px !important; }
  body.ckb-wp-shell .site-header .nav-trigger,
  body.ckb-wp-shell .site-header .nav-direct { padding-inline: 8px !important; }
}
body.ckb-wp-shell .main-nav .nav-direct.is-current::after {
  width: 100%;
}
body.ckb-wp-shell .main-nav .ckb-shell-pending { cursor: default; opacity: .55; }

/* Readability: deliberately adjust only small metadata, actions and text;
   do not multiply existing large display/H1 typography. */
body.ckb-wp-shell .event-type,
body.ckb-wp-shell .event-meta,
body.ckb-wp-shell .archive-card-copy > p,
body.ckb-wp-shell .archive-card-copy > span,
body.ckb-wp-shell .footer-modern-col .footer-label,
body.ckb-wp-shell .footer-legal a {
  font-size: max(13px, .84rem) !important;
  line-height: 1.48 !important;
}
body.ckb-wp-shell .event-row h3 { line-height: 1.24 !important; }
body.ckb-wp-shell .ckb-b1-event-weekday { font-weight: 700; }
body.ckb-wp-shell .service-main .shared-form-intro,
body.ckb-wp-shell .service-main label,
body.ckb-wp-shell .service-main .shared-form-section input,
body.ckb-wp-shell .service-main .shared-form-section textarea {
  font-size: max(16px, 1rem);
  line-height: 1.5;
}

/* Calendar grid: 9/11px weekday & category, 15/22px date numerals
   -> approximately doubled in their corresponding responsive ranges.
   Layout grows with type; do not cram long activity titles into phone cells. */
@media (min-width: 861px) {
  body.ckb-wp-shell[data-page="calendar"] .month-grid .weekday {
    font-size: 21px !important;
    min-height: 67px !important;
    padding: 17px 11px !important;
    letter-spacing: .04em !important;
  }
  body.ckb-wp-shell[data-page="calendar"] .month-grid .day {
    min-height: 177px !important;
    padding: 16px !important;
  }
  body.ckb-wp-shell[data-page="calendar"] .month-grid .day > span {
    font-size: 42px !important;
    font-weight: 550;
    line-height: 1.12;
  }
  body.ckb-wp-shell[data-page="calendar"] .month-grid .day small {
    font-size: 18px !important;
    line-height: 1.16 !important;
    letter-spacing: 0 !important;
    left: 18px !important;
    right: 9px;
    bottom: 23px !important;
    overflow-wrap: anywhere;
    white-space: normal;
  }
  body.ckb-wp-shell[data-page="calendar"] .month-grid .day i {
    left: 18px !important;
    bottom: 68px !important;
    width: 10px !important;
    height: 10px !important;
  }
}
@media (max-width: 860px) {
  body.ckb-wp-shell[data-page="calendar"] .month-grid .weekday {
    font-size: clamp(16px, 2.35vw, 20px) !important;
    min-height: 46px !important;
    padding: 12px 2px !important;
    line-height: 1.2 !important;
    letter-spacing: 0 !important;
  }
  body.ckb-wp-shell[data-page="calendar"] .month-grid .day {
    min-height: clamp(76px, 10vw, 88px) !important;
    padding: 6px 3px !important;
  }
  body.ckb-wp-shell[data-page="calendar"] .month-grid .day > span {
    font-size: clamp(28px, 4vw, 34px) !important;
    line-height: 1.15 !important;
  }
  body.ckb-wp-shell[data-page="calendar"] .month-grid .day i {
    width: 10px !important;
    height: 10px !important;
    left: 6px !important;
    bottom: 10px !important;
  }
  body.ckb-wp-shell[data-page="calendar"] .month-grid .day small {
    display: none !important;
  }
  body.ckb-wp-shell[data-page="calendar"] .calendar-day-event > span { font-size: 18px !important; }
  body.ckb-wp-shell[data-page="calendar"] .calendar-day-event strong { font-size: 20px !important; }
  body.ckb-wp-shell[data-page="calendar"] .calendar-day-event small { font-size: 14px !important; }
}
@media (max-width: 360px) {
  body.ckb-wp-shell[data-page="calendar"] .month-grid .weekday { font-size: 16px !important; }
  body.ckb-wp-shell[data-page="calendar"] .month-grid .day > span { font-size: 26px !important; }
  body.ckb-wp-shell[data-page="calendar"] .month-grid .day { min-height: 70px !important; }
}
body.ckb-wp-shell[data-page="calendar"] .calendar-day-event small { font-size: max(14px, .9rem); }
body.ckb-wp-shell[data-page="calendar"] .calendar-lede { font-size: max(17px, 1.08rem) !important; }
body.ckb-wp-shell[data-page="calendar"] .ongoing-item span { font-size: max(14px, .9rem) !important; line-height: 1.5; }
body.ckb-wp-shell[data-page="calendar"] .month-grid button.day.has-event:focus-visible {
  outline: 3px solid currentColor;
  outline-offset: -3px;
}

/* Four controlled preview variants, not an approved icon/logo system.
   The source image remains primary; geometry and label stay identical in DE/ZH. */
body.ckb-wp-shell .poster-mount { position: relative; }
body.ckb-wp-shell .ckb-b1-category-badge {
  box-sizing: border-box;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  min-height: 34px;
  max-width: calc(100% - 24px);
  padding: 6px 9px;
  font-size: 13px;
  font-weight: 650;
  line-height: 1.2;
  letter-spacing: .02em;
  background: rgba(255,255,255,.97);
  color: #171f28;
  border: 1px solid #24313a;
  box-shadow: 0 1px 8px rgba(0,0,0,.12);
  overflow-wrap: anywhere;
}
body.ckb-wp-shell .ckb-b1-category-badge svg {
  width: 21px;
  height: 21px;
  flex: none;
}
body.ckb-wp-shell .poster-mount > .ckb-b1-category-badge {
  position: absolute;
  z-index: 1;
  top: 12px;
  left: 12px;
}
body.ckb-wp-shell .ckb-b1-badge--minimal { border-radius: 3px; }
body.ckb-wp-shell .ckb-b1-badge--medallion {
  border-color: #38536d;
  color: #163a5b;
  border-radius: 24px;
}
body.ckb-wp-shell .event-type .ckb-b1-category-badge {
  box-shadow: none;
  padding: 5px 7px;
  min-height: 30px;
  max-width: 100%;
  font-size: 12px;
}
body.ckb-wp-shell .event-type .ckb-b1-category-badge svg { width: 17px; height: 17px; }
@media (max-width: 640px) {
  body.ckb-wp-shell .poster-mount > .ckb-b1-category-badge {
    top: 8px; left: 8px;
    font-size: 12px;
    min-height: 28px;
    padding: 4px 7px;
  }
  body.ckb-wp-shell .poster-mount .ckb-b1-category-badge svg { width: 17px; height: 17px; }
  body.ckb-wp-shell .event-type .ckb-b1-category-badge { gap: 4px; font-size: 11px; }
}

/* Footer grows to 4 functional columns without losing bilingual readability. */
@media (min-width: 1200px) {
  body.ckb-wp-shell .site-footer-modern .footer-modern-grid {
    grid-template-columns: repeat(2, minmax(0,1fr)) minmax(0,1.25fr) minmax(0,1.2fr) !important;
    column-gap: clamp(18px, 2.1vw, 38px) !important;
  }
}
@media (min-width: 861px) and (max-width: 1199px) {
  body.ckb-wp-shell .site-footer-modern .footer-modern-grid {
    grid-template-columns: repeat(2, minmax(0,1fr)) !important;
    gap: 34px 42px !important;
  }
  body.ckb-wp-shell .site-footer-modern .footer-modern-grid > .footer-modern-col:nth-child(3) { grid-column: 1 !important; }
  body.ckb-wp-shell .site-footer-modern .footer-modern-grid > .footer-modern-col:nth-child(4) { grid-column: 2 !important; }
}
@media (min-width: 641px) and (max-width: 860px) {
  body.ckb-wp-shell .site-footer-modern .footer-newsletter-col { grid-column: 1 !important; }
  body.ckb-wp-shell .site-footer-modern .ckb-b1-footer-accessibility { grid-column: 2 !important; }
}
@media (max-width: 640px) {
  body.ckb-wp-shell .site-footer-modern .ckb-b1-footer-accessibility { grid-column: 1 / -1 !important; }
}
body.ckb-wp-shell .ckb-b1-footer-accessibility-link,
body.ckb-wp-shell .ckb-b1-footer-inactive {
  display: inline-block;
  font-size: 14px;
  line-height: 1.55;
  overflow-wrap: anywhere;
}
body.ckb-wp-shell .ckb-b1-footer-inactive { opacity: .7; cursor: default; }
body.ckb-wp-shell .ckb-b1-footer-accessibility-link:hover,
body.ckb-wp-shell .ckb-b1-footer-accessibility-link:focus-visible { text-decoration: underline; text-underline-offset: 4px; }

/* Team/Accessibility use original Content Hero / Gutenberg editing, not a CRM. */
body.ckb-wp-shell[data-page="team"] #ckbMainContent,
body.ckb-wp-shell[data-page="accessibility"] #ckbMainContent {
  background: #fff; color: var(--ink, #111);
}
body.ckb-wp-shell .ckb-b1-info-main { min-width: 0; }
body.ckb-wp-shell .ckb-b1-info-editorial {
  padding: clamp(24px, 4vw, 56px) 0 clamp(70px, 8vw, 110px);
  border-top: 1px solid var(--hairline);
  line-height: 1.7;
  font-size: 18px;
}
body.ckb-wp-shell .ckb-b1-info-editorial > * { max-width: 800px; }
body.ckb-wp-shell .ckb-b1-info-editorial img,
body.ckb-wp-shell .ckb-b1-info-editorial video { max-width:100%; height:auto; }
body.ckb-wp-shell .ckb-b1-info-editorial .wp-block-columns.ckb-team-grid {
  display: grid; grid-template-columns: repeat(2, minmax(0,1fr));
  gap: 26px; max-width: none; margin: 0 0 32px;
}
body.ckb-wp-shell .ckb-b1-info-editorial .ckb-team-grid > .wp-block-column { min-width: 0; }
body.ckb-wp-shell .ckb-b1-info-editorial .ckb-team-grid img { max-width: 100%; object-fit: cover; }
@media (max-width: 640px) {
  body.ckb-wp-shell .ckb-b1-info-editorial { font-size: 17px; }
  body.ckb-wp-shell .ckb-b1-info-editorial .wp-block-columns.ckb-team-grid {
    grid-template-columns: minmax(0,1fr); gap: 20px;
  }
}


/* B1-P1-R1 / 2026-10-14 — three verified visual reclosures.
 * 1. Gallery fade attached to visible viewport, not scroll-content pseudo-elements.
 * 2. Phone header keeps static R1-R4-R4 sticky behavior; WP admin offset is corrected.
 * 3. Event buttons and empty-day divs share a top-aligned day number.
 * Does not change poster sizes, Gallery movement speeds, WPML routes or Event data.
 */
@media (min-width: 641px) {
  /* Absolute pseudo-elements are scrolled with overflow:hidden's scrollLeft.
   * A mask is painted in the viewport's own box and cannot drift with the track.
   * 34px is the parent baseline's edge treatment width. */
  body.ckb-wp-shell .gallery-viewport::before,
  body.ckb-wp-shell .gallery-viewport::after {
    display: none !important;
  }
  body.ckb-wp-shell .gallery-viewport {
    --ckb-b1-edge-visibility: .38;
    -webkit-mask-image: linear-gradient(to right,
      rgba(0,0,0,var(--ckb-b1-edge-visibility)) 0px,
      #000 34px,
      #000 calc(100% - 34px),
      rgba(0,0,0,var(--ckb-b1-edge-visibility)) 100%);
    mask-image: linear-gradient(to right,
      rgba(0,0,0,var(--ckb-b1-edge-visibility)) 0px,
      #000 34px,
      #000 calc(100% - 34px),
      rgba(0,0,0,var(--ckb-b1-edge-visibility)) 100%);
    -webkit-mask-repeat: no-repeat;
    mask-repeat: no-repeat;
  }
}
@media (min-width: 641px) and (prefers-color-scheme: dark) {
  body.ckb-wp-shell[data-color-scheme="r1"] .gallery-viewport {
    --ckb-b1-edge-visibility: .28;
  }
}
@media (prefers-reduced-motion: reduce) {
  body.ckb-wp-shell .gallery-viewport {
    -webkit-mask-image: none !important;
    mask-image: none !important;
  }
}
@media (max-width: 640px) {
  /* Keep the original mobile Gallery swipe with no edge mask. */
  body.ckb-wp-shell .gallery-viewport {
    -webkit-mask-image: none !important;
    mask-image: none !important;
  }
}
/* B1-P1-R2 / 2026-10-15. Original static mobile Header is sticky at top:0.
 * WordPress admin-bar is non-sticky on narrow phones (<=600px); its initial
 * 46px offset must not survive after the admin toolbar itself scrolls away.
 * Otherwise a 46px strip of page appears ABOVE the sticky header. On tablets
 * with a fixed admin bar, preserve the existing CMS offset rule. For logged-out
 * visitors do not change the inherited static top:0 behavior. */
@media (max-width: 600px) {
  body.ckb-wp-shell.admin-bar .site-header-shell {
    top: 0 !important;
  }
}
/* Unlike a div.day, button.day has UA-centered contents by default.
 * Explicit flex start aligns all date numbers, including selected/today cells. */
body.ckb-wp-shell[data-page="calendar"] .month-grid button.day.has-event {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  justify-content: flex-start;
}


/* B1-P1-R3 / 2026-10-15 — Mobile ongoing exhibition readability only.
 * Existing DOM/links/dates remain authoritative. On phones, flatten the
 * presentational content wrapper for a title -> period -> metadata stack.
 * Keep the entire row one link and its next-arrow in a separate narrow column.
 * Tablet/desktop (>=641px) retain the original three-column layout.
 */
@media (max-width: 640px) {
  body.ckb-wp-shell[data-page="calendar"] .ongoing-panel .ongoing-item {
    grid-template-columns: minmax(0, 1fr) 24px !important;
    grid-template-areas:
      "exhibition-title  exhibition-arrow"
      "exhibition-dates  exhibition-arrow"
      "exhibition-meta   exhibition-arrow";
    column-gap: 12px !important;
    row-gap: 7px !important;
    align-items: start;
    min-width: 0;
    padding: 12px 0 16px;
  }
  body.ckb-wp-shell[data-page="calendar"] .ongoing-panel .ongoing-item > div {
    display: contents;
  }
  body.ckb-wp-shell[data-page="calendar"] .ongoing-panel .ongoing-item > div > strong {
    grid-area: exhibition-title;
    min-width: 0;
    font-size: 18px !important;
    line-height: 1.35 !important;
    overflow-wrap: anywhere;
  }
  body.ckb-wp-shell[data-page="calendar"] .ongoing-panel .ongoing-item > time {
    grid-area: exhibition-dates;
    display: block;
    min-width: 0;
    font-size: 14px !important;
    font-weight: 600;
    line-height: 1.5;
    overflow-wrap: anywhere;
    white-space: normal;
    text-wrap: balance;
  }
  body.ckb-wp-shell[data-page="calendar"] .ongoing-panel .ongoing-item > div > span {
    grid-area: exhibition-meta;
    min-width: 0;
    margin-top: 0 !important;
    font-size: 14px !important;
    line-height: 1.45 !important;
    letter-spacing: .015em !important;
    overflow-wrap: anywhere;
  }
  body.ckb-wp-shell[data-page="calendar"] .ongoing-panel .ongoing-item > span[aria-hidden="true"] {
    grid-area: exhibition-arrow;
    align-self: center;
    justify-self: center;
    margin-top: 0 !important;
    line-height: 1 !important;
  }
}
