/*
 * knallt Booking: shared base styles.
 *
 * Loaded before every skin. Contains only resets and accessibility primitives, all with
 * zero specificity (:where), and never sets brand colours, fonts, radii or spacing.
 */

:where(*, *::before, *::after) { box-sizing: border-box; }
:where(html) { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }
:where(body) { margin: 0; overflow-wrap: break-word; }
:where(img, svg) { display: block; max-width: 100%; height: auto; }
:where(h1, h2, h3, h4, p, dl, dd, figure) { margin: 0; }
:where(ul, ol) { margin: 0; padding: 0; list-style: none; }
:where(button, input, select, textarea) { font: inherit; color: inherit; }
:where(button) { cursor: pointer; }
:where(table) { border-collapse: collapse; }
:where([hidden]) { display: none !important; }

/* Skip link: visible on focus only. */
:where(.bk-skip) {
    position: absolute;
    left: -9999px;
    top: 0;
    z-index: 100;
}
:where(.bk-skip:focus) { left: 1rem; top: 1rem; }

/* Main is a skip-link target; it should not show a focus ring when focused programmatically. */
:where(.bk-main:focus) { outline: none; }

/* Visually hidden but available to assistive technology. */
:where(.bk-sr-only) {
    position: absolute;
    width: 1px;
    height: 1px;
    margin: -1px;
    padding: 0;
    overflow: hidden;
    clip: rect(0 0 0 0);
    white-space: nowrap;
    border: 0;
}

/* The theme toggle only exists for skins that declare two themes. */
:where(html:not([data-themes~="light"]) [data-bk-theme-toggle]),
:where(html:not([data-themes~="dark"]) [data-bk-theme-toggle]) { display: none; }
:where(html[data-theme="dark"] [data-when="light"]),
:where(html[data-theme="light"] [data-when="dark"]) { display: none; }

/* Session titles link the whole item (stretched link); items must be positioned by the skin. */
:where(.bk-session) { position: relative; }
:where(.bk-session__link)::after { content: ""; position: absolute; inset: 0; }

/* Calendar and slot buttons expose state via ARIA; keep touch targets usable everywhere. */
:where(.bk-slot, .bk-button, .bk-calendar__nav) { min-height: 44px; min-width: 44px; }
/* Day cells keep a 44px height; their width follows the 7-column grid so a month fits
   on a 320px screen (WCAG 2.2 AA target size is 24px). */
:where(.bk-day) { min-height: 44px; min-width: 0; }
:where(.bk-day[aria-disabled="true"]) { cursor: default; }

/* Long words (German compounds, names) must wrap instead of overflowing. */
:where(.bk-hero__title, .bk-event__title, .bk-session__title, .bk-result__title, .bk-summary__value) {
    overflow-wrap: anywhere;
    hyphens: auto;
}

@media (prefers-reduced-motion: reduce) {
    :where(*, *::before, *::after) {
        animation-duration: 0.001ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.001ms !important;
        scroll-behavior: auto !important;
    }
}

/* Checkbox questions: the whole label is the target; colours come from the skin. */
:where(.bk-field__check) { display: flex; gap: 0.6rem; align-items: flex-start; min-height: 44px; cursor: pointer; }
:where(.bk-field__checkbox) { flex: none; width: 1.25rem; height: 1.25rem; margin: 0.15rem 0 0; accent-color: currentColor; }
