/*
Theme Name: Apogaea 2026
Theme URI: https://apogaea.com/
Description: Apogaea 2026 — child theme of Hello Elementor for apogaea.com
Author: Apogaea, Inc.
Author URI: https://apogaea.com/
Template: hello-elementor
Version: 2026.2
Text Domain: hello-elementor-child
License: GNU General Public License v3 or later.
License URI: https://www.gnu.org/licenses/gpl-3.0.html
Tags: flexible-header, custom-colors, custom-menu, custom-logo, editor-style, featured-images, rtl-language-support, threaded-comments, translation-ready
*/


/* ============================================================
   ANNUAL THEME CONFIG
   Update this block each year when the new Apo theme drops.
   Everything else in this file references these variables.
   ============================================================ */

:root {

    /* --- 2026 — Mythos & Mechanica --- */

    /* Dark backgrounds (darkest → mid) */
    --apo-bg-darkest:       #000000;    /* body base */
    --apo-bg-dark:          #1C0E00;    /* near-black warm brown — sections, nav */
    --apo-bg-deep:          #160A00;    /* very dark overlay/widget bg */
    --apo-bg-mid:           #3D2A00;    /* mid-dark widget / box bg */

    /* Light backgrounds (for content areas on dark-themed pages) */
    --apo-bg-warm:          #FFE8D1;    /* pale peach — page/post content bg */
    --apo-bg-content:       #FFFAE5;    /* near-white warm — home page sections */
    --apo-bg-highlight-bar: #FCF791;    /* yellow — callout / important dates */

    /* Brand / accent colors */
    --apo-primary:          #882021;    /* deep red — buttons, bold UI */
    --apo-primary-hover:    #FF0000;    /* bright red — button hover */
    --apo-secondary:        #C48E4C;    /* warm tan-gold — borders, secondary UI */
    --apo-accent:           #C8922A;    /* copper gold — dominant accent, links */
    --apo-accent-bright:    #E8C12F;    /* bright yellow-gold — system accent */
    --apo-highlight:        #FF7F00;    /* bright orange — nav hover, CTAs */
    --apo-highlight-warm:   #E8B86D;    /* light gold — labels, subtle accents */
    --apo-highlight-active: #9F5001;    /* burnt orange — nav active state */

    /* Gradient (body bg) */
    --apo-gradient-from:    #000000;
    --apo-gradient-to:      #D36B03;
    --apo-gradient-radial:  radial-gradient(ellipse at center top, #D36B03 0%, #6B2A00 35%, #000000 80%);

    /* Text colors */
    --apo-text-dark:        #5A3A10;    /* dark brown — text on light bg */
    --apo-text-mid:         #825E24;    /* medium brown — body text, links */
    --apo-text-warm:        #C9A47A;    /* light tan — text on dark bg */
    --apo-text-on-dark:     #E8B86D;    /* gold — headings on dark bg */
    --apo-text-white:       #FFFFFF;

    /* Borders */
    --apo-border:           #C48E4C;    /* standard border */
    --apo-border-dark:      #3D2A00;    /* dark border */
    --apo-border-faint:     #C9A47A;    /* subtle divider */

    /* Typography */
    --apo-font-heading:     'Stint Ultra Expanded', 'Zilla Slab', Georgia, serif;
    --apo-font-subheading:  'Zilla Slab', 'RockwellStd', 'Rockwell', 'Roboto Slab', Georgia, serif;
    --apo-font-body:        'Open Sans', system-ui, -apple-system, 'Helvetica Neue', Arial, sans-serif;

    /* Type scale — desktop */
    --apo-fs-display: 56px;
    --apo-fs-h1:      44px;
    --apo-fs-h2:      34px;
    --apo-fs-h3:      26px;
    --apo-fs-h4:      20px;
    --apo-fs-h5:      18px;
    --apo-fs-h6:      16px;
    --apo-fs-body:    18px;
    --apo-fs-small:   15px;
    --apo-fs-caption: 13px;
    --apo-fs-nav:     14px;
    --apo-fs-button:  15px;
    --apo-fs-body-mobile: 16px;

    /* Line heights */
    --apo-lh-tight:   1.1;
    --apo-lh-snug:    1.25;
    --apo-lh-normal:  1.5;
    --apo-lh-loose:   1.7;

    /* Letter spacing */
    --apo-ls-display: 0.01em;
    --apo-ls-heading: 0.005em;
    --apo-ls-caps:    0.08em;
    --apo-ls-nav:     0.08em;

    /* Font weights */
    --apo-fw-regular:  400;
    --apo-fw-medium:   500;
    --apo-fw-semibold: 600;
    --apo-fw-bold:     700;
    --apo-fw-heavy:    800;

    /* Layout */
    --apo-content-max:    1200px;
    --apo-content-wide:   1440px;
    --apo-content-narrow: 860px;
    --apo-gutter:         24px;
    --apo-section-y:      80px;
    --apo-section-y-sm:   48px;
    --apo-header-h:       80px;

    /* Spacing scale (4px base) */
    --apo-space-1:  4px;
    --apo-space-2:  8px;
    --apo-space-3:  12px;
    --apo-space-4:  16px;
    --apo-space-5:  24px;
    --apo-space-6:  32px;
    --apo-space-7:  48px;
    --apo-space-8:  64px;
    --apo-space-9:  96px;

    /* Radii */
    --apo-radius-sm:   4px;
    --apo-radius-md:   8px;
    --apo-radius-lg:   16px;
    --apo-radius-xl:   24px;
    --apo-radius-pill: 999px;

    /* Shadows — warm, fire-tinted */
    --apo-shadow-sm:   0 1px 2px rgba(0,0,0,0.4);
    --apo-shadow-md:   0 4px 14px rgba(0,0,0,0.45);
    --apo-shadow-lg:   0 10px 36px rgba(0,0,0,0.55);
    --apo-shadow-glow: 0 0 24px rgba(255,127,0,0.35);

    /* Motion */
    --apo-ease:      cubic-bezier(0.2, 0.7, 0.2, 1);
    --apo-dur-fast:  120ms;
    --apo-dur-base:  200ms;
    --apo-dur-slow:  400ms;

    /* Semantic aliases — bind components to these */
    --color-bg:         var(--apo-bg-darkest);
    --color-bg-panel:   var(--apo-bg-dark);
    --color-bg-content: var(--apo-bg-warm);
    --color-fg:         var(--apo-text-dark);
    --color-fg-strong:  var(--apo-text-on-dark);
    --color-fg-content: var(--apo-text-dark);
    --color-link:       var(--apo-accent);
    --color-link-hover: var(--apo-highlight);
    --color-cta:        var(--apo-primary);
    --color-cta-hover:  var(--apo-primary-hover);
    --color-border:     var(--apo-border);
    --color-divider:    var(--apo-border-faint);

    /* Header background image — injected at runtime by functions.php */
    --apo-header-bg-url: url('https://apogaea.com/wp-content/uploads/2026/05/apogaea-2026-header-bkgd.avif');
}


/* ============================================================
   GLOBAL BASELINE
   ============================================================ */

html { box-sizing: border-box; }
*, *::before, *::after { box-sizing: inherit; }

body {
    background: var(--apo-bg-darkest);
    color: var(--apo-text-dark);
    font-family: var(--apo-font-body);
    font-size: var(--apo-fs-body);
    line-height: var(--apo-lh-normal);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* Text selection */
::selection { background-color: var(--apo-accent); color: var(--apo-bg-dark); }

/* Focus ring */
:focus-visible { outline: 2px solid var(--apo-accent); outline-offset: 2px; }

/* Scrollbar (Webkit) */
::-webkit-scrollbar              { width: 8px; }
::-webkit-scrollbar-track        { background: var(--apo-bg-dark); }
::-webkit-scrollbar-thumb        { background: var(--apo-accent); border-radius: 4px; }
::-webkit-scrollbar-thumb:hover  { background: var(--apo-highlight); }

/* WP content links */
.entry-content a,
.wp-block-post-content a {
    color: var(--apo-accent);
    text-decoration: underline;
    text-underline-offset: 3px;
}
.entry-content a:hover,
.wp-block-post-content a:hover { color: var(--apo-highlight); }

/* Atmospheric body backgrounds
   !important beats Elementor's Global Kit stylesheet which loads after ours. */
body.tmpl-home {
    background: linear-gradient(180deg, #FFFAE5 0%, #FFE8CD 100%) !important;
}
body.tmpl-page,
body.tmpl-event {
    background-color: var(--apo-bg-darkest) !important;
    background-image: url('https://apogaea.com/wp-content/uploads/2020/03/apogaea-2026-background-1.png') !important;
    background-size: cover !important;
    background-position: center top !important;
    background-attachment: fixed !important;
}
body.tmpl-post {
    background-color: var(--apo-bg-darkest) !important;
    background-image: url('https://apogaea.com/wp-content/uploads/2020/03/apogaea-page-bkgd.png') !important;
    background-size: cover !important;
    background-position: center top !important;
    background-attachment: fixed !important;
}
body.tmpl-archive,
body.tmpl-search,
body.tmpl-404 {
    background:
        radial-gradient(at 0% 50%, rgba(159,80,1,0.18), transparent 30%),
        radial-gradient(at 100% 60%, rgba(159,80,1,0.18), transparent 30%),
        var(--apo-bg-darkest) !important;
    background-attachment: fixed !important;
}

/* Prevent scroll when mobile nav open */
body.apo-nav-open { overflow: hidden; }

/* Screen-reader only */
.sr-only {
    position: absolute; width: 1px; height: 1px;
    padding: 0; margin: -1px; overflow: hidden;
    clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}


/* ============================================================
   SKIP LINK
   ============================================================ */

.skip-link {
    position: absolute;
    top: -40px; left: 0;
    background: var(--apo-primary);
    color: #fff;
    font-family: var(--apo-font-body);
    font-size: 14px;
    font-weight: 700;
    padding: 8px 16px;
    z-index: 9999;
    text-decoration: none;
    border-radius: 0 0 var(--apo-radius-md) 0;
    transition: top var(--apo-dur-base);
}
.skip-link:focus { top: 0; }


/* ============================================================
   HEADER / NAV
   ============================================================ */

.apo-header {
    position: sticky;
    top: 0;
    z-index: 200;
    display: flex;
    align-items: center;
    gap: 16px;
    background: var(--apo-bg-dark);
    border-bottom: 1px solid rgba(196,142,76,0.15);
    padding: 0 28px;
    height: var(--apo-header-h);
}

.apo-brand {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    text-decoration: none;
    color: var(--apo-highlight);
    flex-shrink: 0;
    transition: color var(--apo-dur-base);
}
.apo-brand:hover { color: var(--apo-highlight-warm); }

.apo-footer-brand {
    display: inline-flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 4px;
    text-decoration: none;
    color: var(--apo-highlight);
    transition: color var(--apo-dur-base);
}
.apo-footer-brand:hover { color: var(--apo-highlight-warm); }
.apo-footer-brand-word {
    font-family: var(--apo-font-body);
    font-weight: 800;
    font-size: 16px;
    letter-spacing: 0.1em;
    text-transform: uppercase;
}
.apo-brand-word {
    font-family: var(--apo-font-body);
    font-weight: 800;
    font-size: 16px;
    letter-spacing: 0.1em;
    text-transform: uppercase;
}

/* Desktop nav wrapper — grows to fill header, yields space to search on expand */
#apo-desktop-nav {
    flex: 1;
    min-width: 0;
}

/* Desktop nav — flex row of top-level items */
.apo-nav {
    display: flex;
    gap: 2px;
    flex: 1;
    justify-content: left;
    list-style: none;
    margin: 0;
    padding: 0;
}
.apo-nav li { position: relative; min-width: 0; }
.apo-nav > li > a {
    font-family: var(--apo-font-body);
    font-weight: 700;
    font-size: var(--apo-fs-nav);
    letter-spacing: var(--apo-ls-nav);
    text-transform: uppercase;
    color: #fff;
    text-decoration: none;
    padding: 10px 14px;
    border-radius: var(--apo-radius-md);
    display: inline-flex;
    align-items: center;
    white-space: nowrap;
    max-width: 100%;
    overflow: hidden;
    transition: color var(--apo-dur-base) var(--apo-ease),
                background var(--apo-dur-base) var(--apo-ease);
}
.apo-nav > li > a:hover { color: var(--apo-highlight); }
/* Space before extra words — hides with the span at narrow widths */
.apo-nav-extra::before { content: '\00a0'; }
.apo-nav li.current-menu-item > a,
.apo-nav li.current-menu-ancestor > a {
    background: var(--apo-highlight-active);
    color: #fff;
}

/* Dropdown caret — CSS triangle, no icon font */
.apo-nav li.menu-item-has-children > a {
    padding-right: 28px;
}
.apo-nav li.menu-item-has-children > a::after {
    content: '';
    position: absolute;
    right: 10px;
    top: 50%;
    transform: translateY(-50%);
    width: 0; height: 0;
    border-left: 4px solid transparent;
    border-right: 4px solid transparent;
    border-top: 5px solid currentColor;
    pointer-events: none;
}

/* Dropdown sub-menu */
.apo-nav .sub-menu {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    min-width: 220px;
    background: var(--apo-bg-dark);
    border: 1px solid rgba(196,142,76,0.25);
    border-radius: var(--apo-radius-md);
    box-shadow: var(--apo-shadow-lg);
    list-style: none;
    margin: 0;
    padding: 6px 0;
    z-index: 300;
}
/* Invisible bridge fills the gap between the nav trigger and dropdown,
   so moving the cursor downward never loses hover state. */
.apo-nav .sub-menu::before {
    content: '';
    position: absolute;
    top: -8px;
    left: 0;
    right: 0;
    height: 8px;
}
.apo-nav li:hover > .sub-menu,
.apo-nav li:focus-within > .sub-menu { display: block; }
.apo-nav .sub-menu > li > a {
    border-radius: 0;
    padding: 9px 18px;
    font-size: 13px;
    display: block;
    color: var(--apo-highlight-warm);
}
.apo-nav .sub-menu > li > a:hover {
    background: var(--apo-bg-mid);
    color: var(--apo-highlight);
}

/* Second-level sub-menu: fly out to the right */
.apo-nav .sub-menu .sub-menu {
    top: -6px;      /* align with the triggering item's padding */
    left: 100%;
    margin-top: 0;
}
.apo-nav .sub-menu .sub-menu::before {
    top: 0;
    left: -8px;
    right: auto;
    width: 8px;
    height: 100%;
}

/* Header search */
.apo-header-search { display: flex; align-items: center; flex-shrink: 0; }
.apo-header-search input[type="search"] {
    appearance: none;
    background: rgba(255,255,255,0.92);
    border: none;
    border-radius: var(--apo-radius-pill);
    padding: 8px 16px;
    font-family: var(--apo-font-body);
    font-size: 14px;
    color: var(--apo-text-dark);
    width: 130px;
    transition: width var(--apo-dur-slow) var(--apo-ease);
}
.apo-header-search input[type="search"]:focus {
    outline: none;
    width: 200px;
    box-shadow: 0 0 0 2px var(--apo-accent);
}

/* Hamburger — hidden desktop, shown mobile */
.apo-hamburger {
    display: none;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    gap: 5px;
    width: 40px;
    height: 40px;
    background: transparent;
    border: 1px solid rgba(196,142,76,0.35);
    border-radius: var(--apo-radius-md);
    cursor: pointer;
    padding: 8px;
    flex-shrink: 0;
    transition: border-color var(--apo-dur-base);
}
.apo-hamburger:hover { border-color: var(--apo-accent); }
.apo-hamburger span {
    display: block;
    width: 20px;
    height: 2px;
    background: #fff;
    border-radius: 2px;
    transition: transform var(--apo-dur-base) var(--apo-ease),
                opacity var(--apo-dur-base) var(--apo-ease);
    transform-origin: center;
}
.apo-hamburger.is-open span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.apo-hamburger.is-open span:nth-child(2) { opacity: 0; transform: scaleX(0); }
.apo-hamburger.is-open span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }


/* ============================================================
   MOBILE FULL-SCREEN OVERLAY
   ============================================================ */

.apo-mobile-overlay {
    position: fixed;
    inset: 0;
    z-index: 500;
    background: var(--apo-bg-dark);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 40px 24px;
    animation: apo-overlay-in var(--apo-dur-slow) var(--apo-ease);
}
.apo-mobile-overlay[hidden] { display: none; }

@keyframes apo-overlay-in {
    from { opacity: 0; transform: scale(0.97); }
    to   { opacity: 1; transform: scale(1); }
}

.apo-mobile-close {
    position: absolute;
    top: 20px;
    right: 20px;
    background: transparent;
    border: 1px solid rgba(196,142,76,0.35);
    color: #fff;
    font-size: 28px;
    line-height: 1;
    width: 44px;
    height: 44px;
    border-radius: var(--apo-radius-md);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: border-color var(--apo-dur-base), color var(--apo-dur-base);
}
.apo-mobile-close:hover { border-color: var(--apo-accent); color: var(--apo-highlight); }

.apo-mobile-nav { width: 100%; max-width: 420px; text-align: center; }
.apo-mobile-nav .menu {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 4px;
}
.apo-mobile-nav .menu-item a {
    display: block;
    font-family: var(--apo-font-heading);
    font-size: 28px;
    color: var(--apo-text-on-dark);
    text-decoration: none;
    padding: 14px 20px;
    border-radius: var(--apo-radius-md);
    transition: background var(--apo-dur-base) var(--apo-ease),
                color var(--apo-dur-base) var(--apo-ease);
}
.apo-mobile-nav .menu-item a:hover { color: var(--apo-highlight); background: rgba(255,127,0,0.08); }
.apo-mobile-nav .menu-item.current-menu-item a { color: var(--apo-highlight); }
/* Mobile submenus — shown inline, indented beneath parent */
.apo-mobile-nav .sub-menu {
    display: flex;
    flex-direction: column;
    list-style: none;
    margin: 0;
    padding: 0 0 6px;
    gap: 0;
}
.apo-mobile-nav .sub-menu .menu-item a {
    font-family: var(--apo-font-body);
    font-size: 15px;
    font-weight: 600;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    padding: 7px 24px;
    opacity: 0.8;
    border-radius: var(--apo-radius-sm);
}
.apo-mobile-nav .sub-menu .menu-item a:hover {
    opacity: 1;
    color: var(--apo-highlight);
    background: rgba(255,127,0,0.08);
}

.apo-overlay-brand {
    position: absolute;
    top: 22px;
    left: 24px;
    opacity: 0.6;
}

/* Mobile overlay search */
.apo-mobile-search {
    display: flex;
    align-items: center;
    width: 100%;
    max-width: 380px;
    margin: 0 0 28px;
    background: rgba(255,255,255,0.1);
    border: 1px solid rgba(232,184,109,0.35);
    border-radius: var(--apo-radius-pill);
    overflow: hidden;
}
.apo-mobile-search input[type="search"] {
    flex: 1;
    background: transparent;
    border: none;
    outline: none;
    padding: 11px 16px;
    font-family: var(--apo-font-body);
    font-size: 15px;
    color: #fff;
    -webkit-appearance: none;
}
.apo-mobile-search input[type="search"]::placeholder { color: rgba(255,255,255,0.5); }
.apo-mobile-search button[type="submit"] {
    background: transparent;
    border: none;
    padding: 11px 16px;
    color: var(--apo-highlight-warm);
    cursor: pointer;
    display: flex;
    align-items: center;
    transition: color var(--apo-dur-base);
}
.apo-mobile-search button[type="submit"]:hover { color: var(--apo-highlight); }


/* ============================================================
   PAGE BANNER (subpage title band)
   ============================================================ */

.apo-page-banner {
    background: linear-gradient(180deg, rgba(196,142,76,0.55), rgba(122,90,32,0.55));
    padding: 36px 24px;
    text-align: center;
    border-bottom: 1px solid rgba(255,232,209,0.2);
}
.apo-page-banner-title {
    font-family: var(--apo-font-heading);
    color: #ffffff;
    text-shadow: 1px 1px 0 #000;
    font-size: var(--apo-fs-h1);
    margin: 0;
    letter-spacing: var(--apo-ls-heading);
    line-height: var(--apo-lh-snug);
}


/* ============================================================
   MAIN / PAPER LAYOUT (subpages)
   ============================================================ */

.apo-main { min-height: 60vh; }
.apo-main--paper { padding: 48px var(--apo-gutter) 48px; }

.apo-paper {
    background: var(--apo-bg-warm);
    color: var(--apo-text-dark);
    max-width: 1100px;
    margin: 0 auto;
    padding: 32px 44px 48px;
    border-radius: var(--apo-radius-sm);
    box-shadow: 0 20px 80px rgba(0,0,0,0.5);
}
.apo-paper h1,
.apo-paper h2,
.apo-paper h3,
.apo-paper h4 { font-family: var(--apo-font-heading); color: var(--apo-bg-dark); }
.apo-paper h1 { font-size: var(--apo-fs-h1); margin: 0 0 0.5em; }
.apo-paper h2 { font-size: var(--apo-fs-h2); margin: 24px 0 14px; }
.apo-paper h3 { font-size: var(--apo-fs-h3); margin: 18px 0 10px; }
.apo-paper p  { font-family: var(--apo-font-body); color: var(--apo-text-dark); line-height: 1.65; }
.apo-paper a  { color: var(--apo-accent); font-weight: 700; text-decoration: underline; text-underline-offset: 3px; }
.apo-paper a:hover { color: var(--apo-highlight); }
.apo-paper ul,
.apo-paper ol { margin: 0 0 22px; padding-left: 24px; }
.apo-paper li { margin-bottom: 10px; line-height: 1.6; }

/* ============================================================
   POST PREV / NEXT NAVIGATION
   ============================================================ */

.apo-post-nav {
    display: flex;
    justify-content: space-between;
    gap: 24px;
    margin-top: 40px;
    padding-top: 28px;
    border-top: 2px solid var(--apo-border);
}
.apo-post-nav-prev,
.apo-post-nav-next { max-width: 46%; }
.apo-post-nav-next { text-align: right; margin-left: auto; }
.apo-post-nav a {
    display: flex;
    flex-direction: column;
    gap: 5px;
    text-decoration: none;
    color: var(--apo-accent);
    font-family: var(--apo-font-subheading);
    font-size: 17px;
    font-weight: 600;
    line-height: 1.3;
    transition: color var(--apo-dur-base);
}
.apo-post-nav a:hover { color: var(--apo-highlight); }
.apo-post-nav .nav-label {
    font-family: var(--apo-font-body);
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: var(--apo-text-mid);
}

.apo-highlight-bar {
    background: var(--apo-bg-highlight-bar);
    color: var(--apo-text-dark);
    padding: 12px 18px;
    border-radius: var(--apo-radius-md);
    font-family: var(--apo-font-body);
    font-weight: 600;
    margin: 18px 0 22px;
}

/* Post meta */
.apo-post-meta {
    font-family: var(--apo-font-body);
    font-size: var(--apo-fs-small);
    color: var(--apo-text-mid);
    letter-spacing: 0.04em;
    text-transform: uppercase;
    margin-bottom: 20px;
    padding-bottom: 16px;
    border-bottom: 1px solid var(--apo-border-faint);
}
.apo-post-meta a { color: var(--apo-text-mid); }
.apo-post-meta a:hover { color: var(--apo-accent); }


/* ============================================================
   ACCENT DIVIDER — thin gold rule + upward chevron
   ============================================================ */

.apo-accent-divider {
    display: flex;
    align-items: center;
    gap: 10px;
    max-width: var(--apo-content-max);
    margin: 40px auto;
    padding: 0 var(--apo-gutter);
}
.apo-accent-divider::before,
.apo-accent-divider::after {
    content: '';
    flex: 1;
    height: 1px;
    background: var(--apo-border);
    opacity: 0.6;
}
.apo-paper .apo-accent-divider { padding: 0; margin: 32px 0; }


/* ============================================================
   SOCIAL ROW
   ============================================================ */

.apo-social-row {
    display: flex;
    gap: 10px;
    justify-content: center;
    flex-wrap: wrap;
    margin: 16px 0;
}
.apo-social {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    background: var(--apo-bg-mid);
    display: flex;
    align-items: center;
    justify-content: center;
    text-decoration: none;
    transition: background var(--apo-dur-base) var(--apo-ease),
                transform var(--apo-dur-base) var(--apo-ease);
}
.apo-social:hover { background: var(--apo-highlight-active); transform: translateY(-2px); }
.apo-social svg { display: block; }


/* ============================================================
   FOOTER
   ============================================================ */

.apo-footer {
    background: var(--apo-bg-dark);
    color: var(--apo-text-warm);
    padding: 56px 24px 0;
    margin-top: 64px;
    border-top: 1px solid rgba(196,142,76,0.18);
}
.apo-footer-inner {
    max-width: var(--apo-content-max);
    margin: 0 auto;
    display: grid;
    grid-template-columns: 1.4fr 1fr 1fr 1fr;
    gap: 32px;
}
.apo-footer-col-head {
    font-family: var(--apo-font-heading);
    color: var(--apo-text-on-dark);
    font-size: 14px;
    letter-spacing: var(--apo-ls-caps);
    text-transform: uppercase;
    margin: 0 0 14px;
    display: block;
}
.apo-footer-tag {
    font-family: var(--apo-font-subheading);
    font-size: 14px;
    letter-spacing: 0.04em;
    margin: 12px 0 8px;
    color: var(--apo-text-on-dark);
}
.apo-footer-fine {
    font-family: var(--apo-font-body);
    font-size: 12px;
    line-height: 1.5;
    opacity: 0.85;
    margin: 0;
}
.apo-footer-col ul { list-style: none; padding: 0; margin: 0; }
.apo-footer-col li { margin-bottom: 8px; }
.apo-footer-col a {
    font-family: var(--apo-font-body);
    font-size: 14px;
    color: var(--apo-text-warm);
    text-decoration: none;
    transition: color var(--apo-dur-base) var(--apo-ease);
}
.apo-footer-col a:hover { color: var(--apo-highlight); }
.apo-footer-bottom {
    max-width: var(--apo-content-max);
    margin: 40px auto 0;
    padding: 18px 0 24px;
    border-top: 1px solid rgba(196,142,76,0.15);
    font-family: var(--apo-font-body);
    font-size: 11px;
    line-height: 1.7;
    text-align: center;
    color: var(--apo-text-warm);
    opacity: 0.75;
}
.apo-footer-bottom p { margin: 0; }
.apo-footer-bottom a { color: var(--apo-highlight-warm); text-decoration: underline; }
.apo-footer-bottom a:hover { color: var(--apo-highlight); }


/* ============================================================
   404 PAGE
   ============================================================ */

.apo-404 {
    min-height: 60vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: 80px 24px;
}
.apo-404-code {
    font-family: var(--apo-font-heading);
    font-size: 120px;
    color: var(--apo-highlight-active);
    line-height: 1;
    margin: 0 0 16px;
    opacity: 0.6;
}
.apo-404-title {
    font-family: var(--apo-font-heading);
    font-size: var(--apo-fs-h2);
    color: var(--apo-text-on-dark);
    margin: 0 0 12px;
}
.apo-404-body { color: var(--apo-text-dark); max-width: 44ch; margin: 0 0 28px; }

.apo-btn {
    font-family: var(--apo-font-body);
    font-weight: 700;
    font-size: var(--apo-fs-button);
    letter-spacing: 0.06em;
    text-transform: uppercase;
    padding: 14px 26px;
    border-radius: var(--apo-radius-md);
    border: 2px solid transparent;
    cursor: pointer;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: background var(--apo-dur-base) var(--apo-ease),
                color var(--apo-dur-base) var(--apo-ease),
                border-color var(--apo-dur-base) var(--apo-ease);
}
.apo-btn-primary { background: var(--apo-primary); color: #fff; border-color: var(--apo-primary); }
.apo-btn-primary:hover,
.apo-btn-primary:focus { background: var(--apo-primary-hover); border-color: var(--apo-primary-hover); color: #fff; }

/* Donate CTA variant — understated, secondary-style */
.apo-btn-donate {
    background: transparent;
    border-color: var(--apo-highlight-active);
    color: var(--apo-highlight-warm);
    font-size: 12px;
    padding: 6px 16px;
    letter-spacing: 0.06em;
    text-shadow: none;
    opacity: 0.8;
}
.apo-btn-donate:hover,
.apo-btn-donate:focus {
    background: rgba(255,127,0,0.12);
    border-color: var(--apo-highlight);
    color: var(--apo-highlight);
    opacity: 1;
}
.apo-donate-form { display: block; text-align: center; margin: 0; }


/* ============================================================
   ARCHIVE / SEARCH RESULTS
   ============================================================ */

.apo-archive-wrap {
    max-width: var(--apo-content-max);
    margin: 0 auto;
    padding: 40px var(--apo-gutter) 80px;
}
.apo-archive-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 24px;
    margin-bottom: 40px;
}
.apo-post-card {
    background: var(--apo-bg-warm);
    border-radius: var(--apo-radius-lg);
    overflow: hidden;
    box-shadow: var(--apo-shadow-md);
    transition: transform var(--apo-dur-base) var(--apo-ease),
                box-shadow var(--apo-dur-base) var(--apo-ease);
}
.apo-post-card:hover { transform: translateY(-2px); box-shadow: var(--apo-shadow-lg); }
.apo-post-card-thumb {
    aspect-ratio: 16 / 9;
    background: linear-gradient(135deg, var(--apo-bg-mid), var(--apo-bg-deep));
    overflow: hidden;
}
.apo-post-card-thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.apo-post-card-body { padding: 18px 20px 22px; }
.apo-post-card-meta {
    font-family: var(--apo-font-body);
    font-size: 11px;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--apo-text-mid);
    margin-bottom: 6px;
}
.apo-post-card-title {
    font-family: var(--apo-font-heading);
    font-size: 20px;
    color: var(--apo-primary);
    margin: 0 0 10px;
    line-height: 1.2;
}
.apo-post-card-title a { text-decoration: none; color: inherit; }
.apo-post-card-title a:hover { color: var(--apo-primary-hover); }
.apo-post-card-excerpt { font-size: 14px; color: var(--apo-text-dark); margin: 0 0 14px; }
.apo-read-more {
    font-family: var(--apo-font-body);
    font-size: 13px;
    color: var(--apo-accent);
    font-weight: 700;
    text-decoration: none;
    border-bottom: 1px solid var(--apo-accent);
    transition: color var(--apo-dur-base), border-color var(--apo-dur-base);
}
.apo-read-more:hover { color: var(--apo-highlight); border-bottom-color: var(--apo-highlight); }

/* Pagination */
.apo-pagination {
    display: flex;
    justify-content: center;
    gap: 8px;
    padding: 16px 0;
}
.apo-pagination a,
.apo-pagination span {
    font-family: var(--apo-font-body);
    font-size: 14px;
    font-weight: 700;
    padding: 8px 14px;
    border: 1px solid var(--apo-border);
    border-radius: var(--apo-radius-md);
    color: var(--apo-text-warm);
    text-decoration: none;
    transition: background var(--apo-dur-base), color var(--apo-dur-base);
}
.apo-pagination a:hover { background: var(--apo-bg-mid); color: var(--apo-highlight); }
.apo-pagination .current { background: var(--apo-primary); border-color: var(--apo-primary); color: #fff; }

/* Search highlighted term */
.apo-search-results mark {
    background-color: var(--apo-accent-bright);
    color: var(--apo-bg-dark);
    padding: 0 2px;
    border-radius: 2px;
}
.apo-search-no-results {
    text-align: center;
    padding: 64px 24px;
    color: var(--apo-text-warm);
}


/* ============================================================
   ELEMENTOR CONTENT OVERRIDES
   Elementor still renders widget content via the_content().
   These rules keep its output on-brand inside our PHP templates.
   ============================================================ */

/* Buttons */
.elementor-button {
    background-color: var(--apo-primary);
    color: var(--apo-text-white);
    border-color: var(--apo-primary);
    transition: background-color var(--apo-dur-base) var(--apo-ease),
                border-color var(--apo-dur-base) var(--apo-ease);
}
.elementor-button:hover,
.elementor-button:focus {
    background-color: var(--apo-primary-hover);
    border-color: var(--apo-primary-hover);
    color: var(--apo-text-white);
}

/* Headings */
.elementor-widget-heading .elementor-heading-title { color: var(--apo-text-on-dark); }
body.tmpl-page .elementor-widget-heading .elementor-heading-title,
body.tmpl-post .elementor-widget-heading .elementor-heading-title { color: var(--apo-text-dark); }
body.tmpl-page .elementor-widget-heading h1.elementor-heading-title,
body.tmpl-post .elementor-widget-heading h1.elementor-heading-title { color: var(--apo-bg-dark); }

/* Gravity Forms */
.gform_wrapper .gfield_label { color: var(--apo-text-dark); font-family: var(--apo-font-subheading); }
.gform_wrapper input[type="text"],
.gform_wrapper input[type="email"],
.gform_wrapper input[type="tel"],
.gform_wrapper input[type="number"],
.gform_wrapper input[type="url"],
.gform_wrapper input[type="password"],
.gform_wrapper textarea,
.gform_wrapper select {
    border: 1px solid var(--apo-border);
    background-color: #fff;
    color: var(--apo-text-dark);
}
.gform_wrapper input:focus,
.gform_wrapper textarea:focus,
.gform_wrapper select:focus {
    border-color: var(--apo-accent);
    outline: none;
    box-shadow: 0 0 0 2px rgba(200,146,42,0.25);
}
.gform_wrapper .gform_footer input[type="submit"],
.gform_wrapper .gform_page_footer input[type="submit"],
.gform_wrapper .gform_footer button[type="submit"] {
    background-color: var(--apo-primary) !important;
    color: var(--apo-text-white) !important;
    border-color: var(--apo-primary) !important;
    font-family: var(--apo-font-subheading);
}
.gform_wrapper .gform_footer input[type="submit"]:hover,
.gform_wrapper .gform_footer button[type="submit"]:hover {
    background-color: var(--apo-primary-hover) !important;
    border-color: var(--apo-primary-hover) !important;
}
.gform_wrapper .validation_error {
    border-color: var(--apo-primary) !important;
    background-color: #fff0f0;
    color: var(--apo-primary);
}
.gform_wrapper .gfield_error input,
.gform_wrapper .gfield_error textarea { border-color: var(--apo-primary) !important; }

/* TablePress */
.tablepress { border-collapse: collapse; width: 100%; font-family: var(--apo-font-body); }
.tablepress thead th {
    background-color: var(--apo-bg-dark) !important;
    color: var(--apo-accent) !important;
    font-family: var(--apo-font-subheading);
    border-bottom: 2px solid var(--apo-accent) !important;
    padding: 10px 12px;
}
.tablepress tbody td { border-bottom: 1px solid var(--apo-border-faint) !important; padding: 8px 12px; color: var(--apo-text-dark); }
.tablepress tbody tr:nth-child(even) td { background-color: var(--apo-bg-warm) !important; }
.tablepress tbody tr:hover td { background-color: rgba(200,146,42,0.12) !important; }
.tablepress a { color: var(--apo-accent); }
.tablepress a:hover { color: var(--apo-highlight); }

/* Upcoming Events widget */
.upcoming-events h2 {
    font-size: 16px !important;
    line-height: 1 !important;
    margin-top: 5px !important;
    background-color: var(--apo-bg-mid);
    padding: 10px;
    color: var(--apo-accent);
}

/* Pretty Google Calendar */
body.page-calendar .pgc-main { font-family: var(--apo-font-body); }
body.page-calendar .pgc-event-title a { color: var(--apo-accent); font-weight: bold; }
body.page-calendar .pgc-event-title a:hover { color: var(--apo-primary); }
body.page-calendar .pgc-heading { background-color: var(--apo-bg-dark) !important; color: var(--apo-accent) !important; }

/* Misc structural fixes */
div.elementor-text-editor ul li:last-child,
div.elementor-text-editor ol li:last-child { margin-bottom: 20px; }
.ms-slide-info { min-height: 20px !important; }
.page-anchor { margin: -100px 0px 100px 0px !important; }


/* ============================================================
   TEMPLATE-SPECIFIC OVERRIDES
   ============================================================ */

body.tmpl-post .elementor-post__title a,
body.tmpl-post .entry-title a { color: var(--apo-bg-dark); text-decoration: none; }
body.tmpl-post .elementor-post__title a:hover,
body.tmpl-post .entry-title a:hover { color: var(--apo-primary); }
body.tmpl-post .elementor-post__meta-data,
body.tmpl-post .elementor-post-info { color: var(--apo-text-mid); font-size: 0.9em; }
body.tmpl-post .elementor-widget-theme-post-content a,
body.tmpl-post .entry-content a { color: var(--apo-accent); font-weight: bold; text-decoration: underline; text-underline-offset: 2px; }
body.tmpl-post .elementor-widget-theme-post-content a:hover,
body.tmpl-post .entry-content a:hover { color: var(--apo-highlight); }
body.tmpl-post .elementor-post-info__terms-list a { color: var(--apo-accent); }

body.tmpl-archive .elementor-post__title a { color: var(--apo-bg-dark); }
body.tmpl-archive .elementor-post__title a:hover { color: var(--apo-primary); }
body.tmpl-archive .elementor-post__excerpt { color: var(--apo-text-dark); }
body.tmpl-archive .elementor-post__read-more { color: var(--apo-accent); border-bottom: 1px solid var(--apo-accent); }
body.tmpl-archive .elementor-post__read-more:hover { color: var(--apo-highlight); border-bottom-color: var(--apo-highlight); }

body.tmpl-search .elementor-post__title a { color: var(--apo-bg-dark); }
body.tmpl-search .elementor-post__title a:hover { color: var(--apo-primary); }
body.tmpl-search .elementor-post__excerpt { color: var(--apo-text-dark); }
body.tmpl-search mark { background-color: var(--apo-accent-bright); color: var(--apo-bg-dark); padding: 0 2px; border-radius: 2px; }


/* ============================================================
   PAGE-SPECIFIC OVERRIDES
   ============================================================ */

body.page-tickets .elementor-widget-heading h2 { color: var(--apo-bg-dark); }
body.page-creative-grants .elementor-widget-heading .elementor-heading-title { color: var(--apo-bg-dark); }
body.page-about .elementor-widget-heading h1 { color: var(--apo-bg-dark); }


/* ============================================================
   UTILITY CLASSES
   ============================================================ */

.apo-text-accent  { color: var(--apo-accent) !important; }
.apo-text-primary { color: var(--apo-primary) !important; }
.apo-text-warm    { color: var(--apo-text-warm) !important; }
.apo-bg-dark      { background-color: var(--apo-bg-dark) !important; }
.apo-bg-mid       { background-color: var(--apo-bg-mid) !important; }
.apo-bg-warm      { background-color: var(--apo-bg-warm) !important; }
.apo-border-top   { border-top: 2px solid var(--apo-border) !important; }
.apo-border-bottom { border-bottom: 2px solid var(--apo-border) !important; }
.apo-divider { border: none; border-top: 1px solid var(--apo-border); margin: 1.5em 0; opacity: 0.5; }
.apo-callout { border-left: 4px solid var(--apo-accent) !important; background-color: var(--apo-bg-warm) !important; padding: 1em 1.5em !important; }


/* ============================================================
   RESPONSIVE
   ============================================================ */

/* 960–1200px: one-word nav labels + collapsed search icon */
@media (max-width: 1200px) {
    .apo-nav-extra { display: none; }
    .apo-nav > li > a { padding: 10px 10px; font-size: 13px; }

    /* Search: collapses to a magnifying-glass icon; expands on focus */
    .apo-header-search input[type="search"] {
        width: 36px;
        padding: 8px;
        color: transparent;
        background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%23555' stroke-width='2.5' stroke-linecap='round'%3E%3Ccircle cx='11' cy='11' r='7'/%3E%3Cline x1='16.5' y1='16.5' x2='22' y2='22'/%3E%3C/svg%3E");
        background-repeat: no-repeat;
        background-position: center;
        cursor: pointer;
        transition: width var(--apo-dur-slow) var(--apo-ease),
                    padding var(--apo-dur-slow) var(--apo-ease),
                    color var(--apo-dur-slow) var(--apo-ease);
    }
    .apo-header-search input[type="search"]::placeholder { color: transparent; }
    .apo-header-search input[type="search"]:focus {
        width: 200px;
        padding: 8px 16px;
        color: var(--apo-text-dark);
        background-image: none;
        cursor: text;
    }
    .apo-header-search input[type="search"]:focus::placeholder {
        color: rgba(0,0,0,0.45);
    }
}

@media (max-width: 960px) {
    .apo-nav { display: none; }
    .apo-hamburger { display: flex; }
    .apo-header-search { display: none; }
    .apo-footer-inner { grid-template-columns: 1fr 1fr; }
    .apo-page-banner-title { font-size: 32px; }
    .apo-paper { padding: 24px 24px 24px; }
    .elementor-post__excerpt { display: none; }
}

@media (max-width: 640px) {
    .apo-header { padding: 0 16px; }
    .apo-paper { padding: 20px 16px 20px; }
    .apo-page-banner-title { font-size: 24px; }
    .apo-archive-grid { grid-template-columns: 1fr; }
    .apo-mobile-nav .menu-item a { font-size: 22px; }

    /* Compact mobile footer */
    .apo-footer { padding: 28px 20px 0; margin-top: 36px; }
    .apo-footer-inner {
        grid-template-columns: 1fr 1fr;
        gap: 20px 16px;
    }
    /* Brand spans full width */
    .apo-footer-col:first-child { grid-column: 1 / -1; }
    /* Social col spans full width */
    .apo-footer-col:last-child  { grid-column: 1 / -1; }
    /* Hide nonprofit blurb — covered by bottom disclaimer */
    .apo-footer-fine { display: none; }
    .apo-footer-tag  { margin: 4px 0 0; font-size: 13px; }
    .apo-footer-col-head { margin: 0 0 8px; font-size: 12px; }
    .apo-footer-col li { margin-bottom: 5px; }
    .apo-footer-col a { font-size: 13px; }
    /* Social row: centered, tighter */
    .apo-social-row { justify-content: flex-start !important; gap: 14px; margin: 0 0 10px !important; }
    .apo-footer-bottom { margin-top: 20px; font-size: 10px; }
}

@media (max-width: 480px) {
    :root { --apo-fs-body: var(--apo-fs-body-mobile); }
}
