/* CKB CP09 EVT-03 + NAV-02 / Theme 0.4.67
 * Calendar-only readability closure. No event date data or interaction changes.
 * This layer is loaded after the existing protected CSS stack, exclusively on
 * the Event archive's calendar view. It does not run on other templates.
 */

/* The former --muted (#6d747b) made weekdays hard to recognize on the
 * near-black calendar. Keep the current 21px desktop / 16px mobile typography;
 * strengthen contrast without making weekday labels as dominant as dates. */
body.ckb-wp-shell[data-page="calendar"] .month-grid .weekday {
  color: #c3cdd5 !important;
  opacity: 1 !important;
}

/* Allow full start/end dates (including weekdays) to wrap naturally instead of
 * forcing the desktop 118px column to split most of the words. */
@media (min-width: 861px) {
  body.ckb-wp-shell[data-page="calendar"] .ongoing-panel .ongoing-item {
    grid-template-columns: 236px minmax(0, 1fr) 24px !important;
    gap: 18px !important;
    min-width: 0;
  }
  body.ckb-wp-shell[data-page="calendar"] .ongoing-panel .ongoing-item > time {
    font-size: 15px !important;
    line-height: 1.48 !important;
    white-space: normal;
    overflow-wrap: normal;
    word-break: normal;
    font-variant-numeric: tabular-nums;
  }
  /* Fixed arrow positions from R2 remain stable after growing 38 -> 44px. */
  body.ckb-wp-shell[data-page="calendar"] .calendar-title-cluster {
    grid-template-columns: 44px 352px 44px !important;
    min-width: 468px !important;
  }
  body.ckb-wp-shell[data-page="calendar"] .calendar-title-cluster h1 {
    width: 352px !important;
    min-width: 352px !important;
    max-width: 352px !important;
  }
}
@media (min-width: 641px) and (max-width: 860px) {
  body.ckb-wp-shell[data-page="calendar"] .ongoing-panel .ongoing-item {
    grid-template-columns: minmax(185px, 215px) minmax(0, 1fr) 24px !important;
    gap: 16px !important;
    min-width: 0;
  }
}

/* The button is a true 44px target, not an artificially enlarged visual glyph.
 * Keep existing form/GET submission, month selector and Today link unchanged. */
body.ckb-wp-shell[data-page="calendar"] .calendar-title-cluster .month-controls button {
  box-sizing: border-box;
  width: 44px !important;
  min-width: 44px !important;
  height: 44px !important;
  min-height: 44px !important;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0 !important;
}
body.ckb-wp-shell[data-page="calendar"] .calendar-today,
body.ckb-wp-shell[data-page="calendar"] .calendar-month-select {
  box-sizing: border-box;
  height: 44px !important;
  min-height: 44px !important;
}
body.ckb-wp-shell[data-page="calendar"] .calendar-title-cluster .month-controls button:focus-visible,
body.ckb-wp-shell[data-page="calendar"] .calendar-today:focus-visible,
body.ckb-wp-shell[data-page="calendar"] .calendar-month-select:focus-visible {
  outline: 3px solid #c3cdd5 !important;
  outline-offset: 2px !important;
}

/* In the existing two-row mobile controls, reserve enough space for both
 * arrow targets. Keep long German month names on a single readable line. */
@media (max-width: 860px) {
  body.ckb-wp-shell[data-page="calendar"] .calendar-title-cluster {
    grid-template-columns: 44px minmax(0, 1fr) 44px !important;
    column-gap: 8px !important;
    min-width: 0 !important;
  }
  body.ckb-wp-shell[data-page="calendar"] .calendar-title-cluster h1 {
    min-width: 0 !important;
    max-width: 100% !important;
    font-size: clamp(22px, 6.25vw, 36px) !important;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: clip;
  }
}
@media (max-width: 360px) {
  body.ckb-wp-shell[data-page="calendar"] .calendar-title-cluster {
    column-gap: 6px !important;
  }
  body.ckb-wp-shell[data-page="calendar"] .calendar-title-cluster h1 {
    font-size: clamp(20px, 6.45vw, 22px) !important;
  }
}
