/*
 * Glowflare Horror Festival v1.3.43 — monochrome high-contrast mode.
 * This is a complete reusable component, not a set of per-page CSS patches.
 * Enable with <html class="gf-high-contrast">; no changes to every div needed.
 * Affects both desktop/mobile and WordPress/partner plugin content that shares
 * the document; cross-origin iframe interiors cannot be restyled by the site.
 * Keeps overlay visibility, popup position, controls and native focus handling.
 */

/* The default site remains completely unchanged until the visitor opts in. */
html.gf-high-contrast {
  color-scheme: dark;
  background: #000 !important;
  color: #fff !important;
  --gf-brand-red: #fff;
  --brand-color: #fff;
  --brand: #fff;
  --gf-red: #fff;
  --gf-green: #fff;
  --gf-off: #000;
  --gf-bg: #000;
  --gf-dark: #000;
  --gf-category: #000;
  --gf-description: #000;
  --gf-border: #fff;
  --gf-white: #fff;
  --gf-newsletter-bg: #000;
  --gf-newsletter-dark: #000;
  --gf-newsletter-red: #fff;
  --gf-newsletter-white: #fff;
}

/* Never use an html/body filter: it creates stacking contexts that can break
   fixed modals, prevents true white-on-black controls and shifts popups. */
html.gf-high-contrast body {
  background-color: #000 !important;
  background-image: none !important;
  color: #fff !important;
  border-color: #fff !important;
  text-shadow: none !important;
}

/* Neutralize visual backgrounds, including inline gradients, in site and
   plugin containers while preserving their layout and click handling. */
html.gf-high-contrast body :where(
  header, nav, main, footer, section, article, aside, div,
  figure, figcaption, blockquote, details, summary, fieldset,
  form, table, thead, tbody, tfoot, tr, th, td, ul, ol, li,
  dl, dt, dd, label, dialog, output, progress
) {
  background-color: #000 !important;
  background-image: none !important;
  color: #fff !important;
  border-color: #fff !important;
  outline-color: #fff !important;
  box-shadow: none !important;
  text-shadow: none !important;
}

/* Inherit strong foreground text everywhere, even within third-party cards
   and inline HTML. Preserve aria-hidden/hidden, visibility and opacity. */
html.gf-high-contrast body :where(
  h1,h2,h3,h4,h5,h6,p,span,small,strong,em,b,i,mark,time,
  abbr,cite,code,pre,kbd,samp,legend,caption,sub,sup,
  a,button,input,select,textarea,optgroup,option,
  [role="button"],[role="link"],[role="tab"],[role="switch"],
  [role="checkbox"],[role="menuitem"],svg
) {
  color: #fff !important;
  text-shadow: none !important;
  -webkit-text-fill-color: currentColor !important;
}

/* All form controls have an obvious monochrome border. Do not change their
   dimensions or native validation, or force hidden honeypot inputs visible. */
html.gf-high-contrast body :where(
  button, input:not([type="hidden"]), select, textarea,
  [role="button"], [role="switch"], [role="checkbox"],
  [role="tab"], .options-container > div
) {
  background: #000 !important;
  color: #fff !important;
  border: 2px solid #fff !important;
  box-shadow: none !important;
  text-shadow: none !important;
  accent-color: #fff !important;
  -webkit-text-fill-color: currentColor !important;
}
html.gf-high-contrast body :where(input, textarea)::placeholder {
  color: #fff !important;
  opacity: 1 !important;
  -webkit-text-fill-color: #fff !important;
}
html.gf-high-contrast body :where(select,option,optgroup) {
  background: #000 !important;
  color: #fff !important;
}
html.gf-high-contrast body :where(input,button,select,textarea):disabled,
html.gf-high-contrast body :where([aria-disabled="true"]) {
  border-style: dashed !important;
  cursor: not-allowed;
}

/* Monochrome links and a consistent, unmistakable keyboard focus ring.
   Never use colour alone to identify links or selected controls. */
/* Navigation links may have their own red background: reset the surface too. */
html.gf-high-contrast body a {
  background-color: #000 !important;
  background-image: none !important;
  border-color: #fff !important;
}

html.gf-high-contrast body a,
html.gf-high-contrast body a:link,
html.gf-high-contrast body a:visited,
html.gf-high-contrast body a:hover,
html.gf-high-contrast body a:focus {
  color: #fff !important;
  -webkit-text-fill-color: #fff !important;
  text-decoration-line: underline !important;
  text-underline-offset: .18em !important;
  text-decoration-color: #fff !important;
  text-decoration-thickness: max(1px, .075em) !important;
  background-image: none !important;
}
html.gf-high-contrast body :where(
  a, button, input, textarea, select, summary, iframe,
  [tabindex], [role="button"], [role="switch"], [role="checkbox"]
):focus-visible {
  outline: 3px solid #fff !important;
  outline-offset: 3px !important;
  box-shadow: 0 0 0 2px #000 !important;
}
html.gf-high-contrast body :where(
  button, [role="button"], [role="tab"], .options-container > div
):is(:hover,:active) {
  border-color: #fff !important;
  text-decoration-color: #fff !important;
}
html.gf-high-contrast body :where(
  button[aria-pressed="true"], button[aria-selected="true"],
  [role="tab"][aria-selected="true"],
  .gf-mobile-accessibility-grid button.is-active,
  .gf-contrast-desktop-btn.is-active,
  .gf-contrast-kiosk-btn.is-active
) {
  background: #fff !important;
  color: #000 !important;
  -webkit-text-fill-color: #000 !important;
}
html.gf-high-contrast body :where(
  button[aria-pressed="true"], button[aria-selected="true"],
  [role="tab"][aria-selected="true"],
  .gf-mobile-accessibility-grid button.is-active,
  .gf-contrast-desktop-btn.is-active,
  .gf-contrast-kiosk-btn.is-active
) :where(span,i,svg) {
  color: #000 !important;
  -webkit-text-fill-color: #000 !important;
}

/* An active page is visibly inverted rather than merely recoloured. */
html.gf-high-contrast body a[aria-current="page"],
html.gf-high-contrast body li.current-menu-item > a,
html.gf-high-contrast body li.current_page_item > a {
  background: #fff !important;
  color: #000 !important;
  -webkit-text-fill-color: #000 !important;
}
html.gf-high-contrast body a[aria-current="page"] :where(span,i,svg),
html.gf-high-contrast body li.current-menu-item > a :where(span,i,svg) {
  color: #000 !important;
  -webkit-text-fill-color: #000 !important;
}

/* Media remains visible: grayscale the picture itself, rather than filtering
   the complete page and accidentally disturbing fixed-position overlays. */
html.gf-high-contrast body :where(img,video,canvas,iframe,picture img) {
  filter: grayscale(1) contrast(1.18) !important;
}
html.gf-high-contrast body :where(svg) { filter: grayscale(1) contrast(1.2) !important; }
html.gf-high-contrast body :where(i,[class*="fa-"],[class*="icon-"]) {
  color: #fff !important;
}
html.gf-high-contrast body :where(hr) { background: #fff !important; border-color: #fff !important; }
html.gf-high-contrast ::selection { background: #fff; color: #000; }

/* Links/buttons in the desktop navigation, mobile header and kiosk.
   Active state is an inverted button, not a different coloured button. */
html.gf-high-contrast body :where(
  .current-menu-item > a, .current_page_item > a, [aria-current="page"],
  .gf-navbar-cart .active, .nav-btn.is-active, .gf-mobile-nav .is-active
) {
  background: #fff !important;
  color: #000 !important;
  -webkit-text-fill-color: #000 !important;
  border-color: #fff !important;
}
html.gf-high-contrast body :where(
  .current-menu-item > a, .current_page_item > a, [aria-current="page"]
) :where(span,i) {
  color: #000 !important;
  -webkit-text-fill-color: #000 !important;
}
/* Font Awesome is already present; no extra fonts or licences required. */
html.gf-high-contrast body .gf-navbar-access .gf-contrast-desktop-btn,
html.gf-high-contrast body .gf-navbar-access .gf-contrast-kiosk-btn {
  min-height: 44px;
  display: flex;
  flex: 1 1 30%;
  justify-content: center;
  align-items: center;
  flex-direction: column;
  gap: 3px;
  padding: 10px 8px;
  margin: 4px;
  border-radius: 10px;
}
/* Keep the new native button identical to the old kiosk div when mode is off. */
.gf-navbar-access .gf-contrast-kiosk-btn {
  flex: 1 1 calc(33.333% - 8px);
  min-height: 44px;
  border: 0;
  border-radius: 10px;
  padding: 10px 8px;
  background: rgba(255,255,255,.08);
  color: #fff;
  font: inherit;
  font-size: .8125rem;
  font-weight: 700;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  gap: 6px;
  margin: 4px;
}

/* Cookie consent: preserve Complianz's state and layout; only change colours.
   The many existing component selectors use !important, so give the same
   specificity here. Never force an inactive cookie banner to display. */
html.gf-high-contrast #cmplz-cookiebanner-container .cmplz-cookiebanner {
  --gf-bg: #000;
  --gf-dark: #000;
  --gf-red: #fff;
  --gf-green: #fff;
  --gf-off: #000;
  --gf-category: #000;
  --gf-description: #000;
  --gf-border: #fff;
  background: #000 !important;
  color: #fff !important;
  border: 2px solid #fff !important;
  box-shadow: none !important;
}
html.gf-high-contrast #cmplz-cookiebanner-container .cmplz-cookiebanner :where(
  .cmplz-header,.cmplz-body,.cmplz-message,.cmplz-categories,.cmplz-category,
  .cmplz-category-header,.cmplz-description,.cmplz-buttons,.cmplz-close
) {
  background: #000 !important;
  color: #fff !important;
  border-color: #fff !important;
  box-shadow: none !important;
}
html.gf-high-contrast #cmplz-cookiebanner-container .cmplz-cookiebanner :where(
  .cmplz-title,.cmplz-message,.cmplz-category-title,.cmplz-always-active,
  .cmplz-description,.cmplz-description *, .cmplz-links a,
  .cmplz-icon, .cmplz-icon svg
) { color: #fff !important; }
/* Overrides the readable green badge only while Contrast is enabled. */
html.gf-high-contrast #cmplz-cookiebanner-container .cmplz-cookiebanner .cmplz-category .cmplz-always-active {
  background: #000 !important;
  color: #fff !important;
  border: 1px solid #fff !important;
  -webkit-text-fill-color: #fff !important;
}
html.gf-high-contrast #cmplz-cookiebanner-container .cmplz-cookiebanner .cmplz-category summary {
  background: #000 !important;
  color: #fff !important;
  border: 1px solid #fff !important;
}
html.gf-high-contrast #cmplz-cookiebanner-container .cmplz-cookiebanner .cmplz-buttons .cmplz-btn,
html.gf-high-contrast #cmplz-cookiebanner-container .cmplz-cookiebanner .cmplz-close {
  background: #000 !important;
  color: #fff !important;
  border: 2px solid #fff !important;
}
html.gf-high-contrast #cmplz-cookiebanner-container .cmplz-cookiebanner .cmplz-buttons .cmplz-btn.cmplz-accept {
  background: #fff !important;
  color: #000 !important;
  -webkit-text-fill-color: #000 !important;
}
html.gf-high-contrast #cmplz-cookiebanner-container .cmplz-cookiebanner .cmplz-buttons .cmplz-btn.cmplz-accept :where(span,i,svg) {
  color: #000 !important;
  -webkit-text-fill-color: #000 !important;
}
html.gf-high-contrast #cmplz-cookiebanner-container .cmplz-cookiebanner .cmplz-category .cmplz-banner-checkbox label.cmplz-label {
  background: #000 !important;
  border: 2px solid #fff !important;
  box-shadow: none !important;
}
html.gf-high-contrast #cmplz-cookiebanner-container .cmplz-cookiebanner .cmplz-category .cmplz-banner-checkbox label.cmplz-label::after {
  background: #fff !important;
  box-shadow: none !important;
}
html.gf-high-contrast #cmplz-cookiebanner-container .cmplz-cookiebanner .cmplz-category .cmplz-banner-checkbox input.cmplz-consent-checkbox:checked + label.cmplz-label {
  background: #fff !important;
  border: 2px solid #fff !important;
}
html.gf-high-contrast #cmplz-cookiebanner-container .cmplz-cookiebanner .cmplz-category .cmplz-banner-checkbox input.cmplz-consent-checkbox:checked + label.cmplz-label::after {
  background: #000 !important;
  border: 1px solid #000 !important;
}
html.gf-high-contrast #cmplz-manage-consent .cmplz-manage-consent,
html.gf-high-contrast #manageconsent {
  background: #000 !important;
  border: 2px solid #fff !important;
  color: #fff !important;
}
html.gf-high-contrast .gf-consent-visual-backdrop { background: rgba(0,0,0,.82) !important; }

/* Newsletter panel, including forms, validation and scrim. Preserve the
   user's approved layout and the exact FluentCRM submission behaviour. */
html.gf-high-contrast #gf-newsletter-popup .gf-newsletter-popup__scrim {
  background: rgba(0,0,0,.82) !important;
}
html.gf-high-contrast #gf-newsletter-popup .gf-newsletter-popup__panel {
  background: #000 !important;
  color: #fff !important;
  border: 2px solid #fff !important;
  box-shadow: none !important;
}
html.gf-high-contrast #gf-newsletter-popup .gf-newsletter-popup__panel :where(
  .gf-newsletter-popup__header,.gf-newsletter-popup__content,.gf-newsletter-popup__form,
  .gf-newsletter-popup__name-row,.gf-newsletter-popup__status,
  .gf-newsletter-popup__intro,.gf-newsletter-popup__privacy
) {
  background: #000 !important;
  color: #fff !important;
}
html.gf-high-contrast #gf-newsletter-popup .gf-newsletter-popup__form input:not(.gf-newsletter-popup__trap) {
  background: #000 !important;
  color: #fff !important;
  border: 2px solid #fff !important;
  box-shadow: none !important;
}
html.gf-high-contrast #gf-newsletter-popup .gf-newsletter-popup__form input:not(.gf-newsletter-popup__trap):focus-visible {
  outline: 3px solid #fff !important;
  outline-offset: 3px !important;
  box-shadow: 0 0 0 2px #000 !important;
}
html.gf-high-contrast #gf-newsletter-popup .gf-newsletter-popup__submit {
  background: #fff !important;
  color: #000 !important;
  -webkit-text-fill-color: #000 !important;
  border: 2px solid #fff !important;
}
html.gf-high-contrast #gf-newsletter-popup .gf-newsletter-popup__later,
html.gf-high-contrast #gf-newsletter-popup .gf-newsletter-popup__close {
  background: #000 !important;
  color: #fff !important;
  border: 2px solid #fff !important;
}

/* Third-party UI and WooCommerce states: contrast without overriding display,
   stacking order, interactive handlers or accordion open/closed state. */
html.gf-high-contrast body :where(
  .woocommerce-message, .woocommerce-info, .woocommerce-error,
  .woocommerce .button, .woocommerce button, .woocommerce input,
  .wc-block-components-button, .wp-block-button__link,
  .select2-container .select2-selection, .select2-dropdown,
  .select2-results__option, .ui-widget, .ui-dialog, .modal-content,
  .dropdown-menu, .popover, .tooltip, .film-card,
  .fm-card, .fm-sponsor, .gf-sponsor
) {
  color: #fff !important;
  background: #000 !important;
  background-image: none !important;
  border-color: #fff !important;
  box-shadow: none !important;
}
html.gf-high-contrast body :where(
  .select2-results__option--highlighted,
  .select2-results__option[aria-selected="true"],
  .woocommerce .button:focus-visible
) {
  outline: 3px solid #fff !important;
  outline-offset: 2px !important;
}

/* When OS/browser forced colours are active, preserve user's chosen system
   palette instead of overriding it with our own black/white theme. */
@media (forced-colors: active) {
  html.gf-high-contrast { forced-color-adjust: auto; }
  html.gf-high-contrast body :where(button,input,select,textarea,a):focus-visible {
    outline-color: Highlight !important;
  }
}
