/**
 * tee-widget-clearance.css — FINDING #236
 *
 * The ChronoGolf "Book a Tee-Time" widget is a THIRD-PARTY embed declared in
 * includes/footer.php. Its container is position:fixed, bottom:0, and the
 * vendor's script gives it z-index 999999 — measured on the page, not assumed.
 * We do not control anything inside it. This file is everything we CAN do:
 * keep our own UI out from under it.
 *
 * Two reported symptoms, one cause:
 *
 *   DESKTOP — the widget bar sits bottom-right, ~50px tall, directly over the
 *             footer's Privacy Policy / Terms / Cookie Settings / Admin Login
 *             links when the page is scrolled to the bottom.
 *
 *   MOBILE  — the widget covers the cookie banner's Accept button completely.
 *             At z-index 999999 against the banner's 9999, the widget wins by
 *             five orders of magnitude. THE USER CANNOT CONSENT.
 *
 * ⚠ THE MOBILE ONE IS NOT COSMETIC. A consent banner whose accept control is
 *   unreachable is a compliance surface that cannot be completed.
 *
 * ⚠ WHY NOT JUST RAISE THE BANNER'S z-index? Because that trades one overlap
 *   for another: the banner would then cover the widget, and the vendor is free
 *   to change 999999 at any time without telling us. Removing the widget for
 *   the few seconds a blocking decision is on screen has no such race.
 *
 * ⚠ WHY :has() AND NOT A BODY CLASS? The banner is added and removed from THREE
 *   places in js/cookie-consent.js (showBanner, showSettings, removeBanner). A
 *   class toggle would be three sites to keep in step, and the failure mode of
 *   missing one is the bug we are fixing, silently back. :has() reads the DOM
 *   as it actually is, so there is nothing to keep in step.
 *   Degradation: a browser without :has() ignores the rule and behaves exactly
 *   as it does today. It cannot make anything worse than the current state.
 *
 * ⚠ THIS FILE IS LOADED WITH asset_v(), NOT CSS_VERSION. css/style.css is
 *   versioned by the CSS_VERSION constant, which is defined in config.php —
 *   a gitignored file. NO DEPLOY CAN EVER BUMP IT. A rule put in style.css
 *   would sit on the server unread by every browser that already has the old
 *   copy. asset_v() derives the version from filemtime, so shipping the file
 *   IS publishing it.
 */

:root {
    /* One number, named once. The widget measures 50px tall; the rest is room
       to actually hit a link rather than graze it. */
    --tee-widget-clearance: 4.5rem;
}

/* Bootstrap's .py-5 sets padding-bottom: 3rem !important, so this must be
   !important too, and it preserves that 3rem rather than replacing it —
   footer.footer outranks .py-5 on specificity, so this does not depend on
   stylesheet order to win. */
footer.footer {
    padding-bottom: calc(3rem + var(--tee-widget-clearance)) !important;
}

/* While a consent decision is on screen, the widget stands down. Both states:
   the banner itself, and the Customize modal it opens (z-index 10000 — also
   under the widget). */
body:has(#cookie-consent-banner) .chrono-bookingbutton,
body:has(.cookie-modal.show) .chrono-bookingbutton {
    display: none !important;
}
