/*
 * PASC Conference Theme — Edition CSS Variables
 *
 * This file is the CSS foundation for the edition palette system.
 * It declares the --ed-* custom properties used by .edition-zone
 * elements throughout the theme.
 *
 * The PHP function pasc_inject_edition_vars() in inc/enqueue.php
 * overrides :root values inline in <head> using pasc_derive_palette(),
 * which auto-calculates ALL derived vars from just primary + accent.
 *
 * The :root block below provides sensible defaults (PASC 26 palette)
 * for pages that don't have an edition context. On edition pages,
 * all 10 vars are overridden by the inline <style id="pasc-edition-vars">.
 */

/* ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
   DEFAULT EDITION PALETTE (PASC 26 — Precision / Navy + Gold)
   Overridden at runtime by pasc_inject_edition_vars() in PHP.
   ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ */
:root {
  /* Edition identity */
  --ed-primary:        #1A2744;   /* edition nav bar background, hero, CTA */
  --ed-accent:         #C9A227;   /* highlight colour, gold rule, buttons */
  --ed-primary-hover:  #243660;
  --ed-accent-hover:   #DAB840;

  /* Edition neutrals */
  --ed-bg:             #FFFFFF;
  --ed-surface:        #F4F6F9;
  --ed-surface-tint:   #EDEEF0;   /* 8 % primary on white — alternating sections */
  --ed-text:           #1A2744;
  --ed-muted:          #4A5568;
  --ed-border:         #D8DEE9;

  /* WCAG contrast-safe text on primary backgrounds */
  --ed-on-primary:     #FFFFFF;   /* auto-set by PHP — white or dark depending on primary */
  --ed-on-primary-80:  rgba(255,255,255,0.8);
  --ed-on-primary-60:  rgba(255,255,255,0.6);
  --ed-on-primary-55:  rgba(255,255,255,0.55);

  /* Overlay / glass tints */
  --ed-overlay-10:     rgba(26,39,68,0.10);
  --ed-overlay-20:     rgba(26,39,68,0.20);

  /* Glow (used by Apex variation) */
  --ed-glow:           none;

  /* ── Global bar & site-wide defaults ────────────────────── */
  --global-primary:    #1A2744;
  --global-primary-hover: #243660;
  --global-accent:     #C9A227;
  --global-accent-hover: #DAB840;
}

/* ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
   EDITION ZONE — elements that respond to the active edition
   ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ */

.edition-zone {
  --zone-bg:     var(--ed-primary);
  --zone-accent: var(--ed-accent);
}

/* Edition nav bar background */
.header-edition.edition-zone {
  background-color: var(--ed-primary);
}

/* ── Sub-menu overflow fix ────────────────────────────────────────────────
   WordPress's wp-block-group stylesheet can apply overflow:hidden to
   .wp-block-group elements, which clips position:absolute sub-menus.
   Force overflow:visible on all header containers that wrap the nav.
   ──────────────────────────────────────────────────────────────────────── */
.site-header,
.site-header .wp-block-group,
.header-edition,
.header-global,
.nav-edition,
.nav-primary {
  overflow: visible !important;
}

/* Hero section background */
.hero.edition-zone,
.archive-header.edition-zone {
  background-color: var(--ed-primary);
  color: var(--ed-on-primary, #fff);
}

/* CTA banner background */
.cta-banner.edition-zone {
  background-color: var(--ed-primary);
  color: var(--ed-on-primary, #fff);
}

/* Accent-coloured elements */
.edition-zone .cta-banner__eyebrow {
  color: var(--ed-accent);
}

.edition-zone .hero__title em {
  color: var(--ed-accent);
}

/* Buttons in edition zones */
.edition-zone .cta-banner__btn-primary .wp-block-button__link {
  background-color: var(--ed-accent);
  color: var(--ed-text);
}

/* Edition switcher active state */
.edition-switcher__btn[data-edition]:is(.is-active, [aria-pressed="true"]) {
  background: rgba(255,255,255,0.2);
  color: var(--ed-on-primary, #fff);
}

/* ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
   GLOBAL BAR — deliberately NOT edition-aware
   ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ */

.header-global {
  /* Always uses the global-primary var which is locked in theme.json */
  background-color: var(--global-primary, var(--wp--preset--color--primary, #1A2744));
}

/* ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
   BODY CLASS OVERRIDES (applied by pasc_edition_body_class())
   Edition class on body: .edition-pasc26, .edition-pasc27 ...
   ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ */

/* Body class mirrors the inline <style> approach. On edition pages,
   pasc_inject_edition_vars() outputs :root overrides in <head> that
   take precedence. Body classes are used for visibility guards only. */

/* ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
   SCHEDULE SESSION TYPE COLOUR OVERRIDES (edition-tinted)
   ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ */

.session-type--plenary {
  background: color-mix(in srgb, var(--ed-accent) 18%, transparent);
  color: color-mix(in srgb, var(--ed-accent) 60%, #000);
}

/* ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
   LINK ACCENT COLOUR (edition-aware)
   ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ */

a.edition-link {
  color: var(--ed-primary);
  text-decoration: underline;
  text-underline-offset: 0.2em;
}

a.edition-link:hover {
  color: var(--ed-accent);
}

/* ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
   EDITION-AWARE LINKS & BUTTONS
   On edition pages, override WP's palette-locked colours
   with dynamic --ed-* variables so links/buttons adapt
   when the edition palette changes.
   ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ */

/* Links — scoped to .site-main so header/footer nav is never affected */
body[class*="edition-pasc"] .site-main a:not(.wp-block-button__link) {
  color: var(--ed-primary);
}
body[class*="edition-pasc"] .site-main a:not(.wp-block-button__link):hover {
  color: var(--ed-accent);
}

/* Buttons (core/button block) */
body[class*="edition-pasc"] .wp-block-button__link {
  background-color: var(--ed-accent);
  color: var(--ed-primary);
  transition: background-color 0.15s, transform 0.15s, box-shadow 0.15s;
}
body[class*="edition-pasc"] .wp-block-button__link:hover {
  background-color: var(--ed-accent-hover);
  transform: translateY(-1px);
  box-shadow: 0 4px 16px var(--ed-overlay-20, rgba(201,162,39,.3));
}
body[class*="edition-pasc"] .wp-block-button__link:active {
  transform: translateY(0) scale(0.98);
  box-shadow: none;
  transition-duration: 0.05s;
}

/* Outline button variant */
body[class*="edition-pasc"] .wp-block-button.is-style-outline .wp-block-button__link {
  background-color: transparent;
  border-color: var(--ed-accent);
  color: var(--ed-primary);
  transition: background-color 0.15s, color 0.15s, transform 0.15s, box-shadow 0.15s;
}
body[class*="edition-pasc"] .wp-block-button.is-style-outline .wp-block-button__link:hover {
  background-color: var(--ed-accent);
  color: var(--ed-primary);
  transform: translateY(-1px);
  box-shadow: 0 4px 16px var(--ed-overlay-20, rgba(201,162,39,.3));
}

/* ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
   EDITION CHROME VISIBILITY GUARD
   .header-edition (coloured nav bar) is present in the FSE
   template on every page. It must be hidden by default and
   revealed only when the body carries an edition class added
   by pasc_edition_body_class() (gated on pasc_is_edition_context()).
   ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ */

/* Hidden by default — non-edition pages never see this element */
.header-edition {
  display: none;
}

/* Reveal on edition pages (body class added by PHP) */
body[class*="edition-pasc"] .header-edition {
  display: block;
}
