/*
Theme Name: Fairview Children
Description: Modern, professional, sleek, and intuitive theme for Fairview Children's Center
Author: Brian Anderson
Author URI: https://briananderson.xyz
version: 2.0
Tags: two-column, site, responsive, modern
*/

/* ============================================
   CSS VARIABLES
   ============================================ */
:root {
    --bg-body: #f4f5f7;
    --bg-card: #ffffff;
    --bg-light: #f8f9fa;
    --bg-header: #ffffff;
    --bg-footer: #062556;
    --bg-overlay: rgba(6, 37, 86, 0.12);
    
    --text-main: #333333;
    --text-muted: #7f8c8d;
    --text-light: #bdc3c7;
    --text-on-brand: #ffffff;
    --text-headings: #062556;
    
    --brand-primary: #062556;
    --brand-secondary: #1e498f;
    --brand-accent: #fdd835;
    --brand-red: #e74c3c;
    --brand-green: #27ae60;
    
    --border-color: #dddddd;
    --shadow-subtle: rgba(0,0,0,0.05);
    --shadow-medium: rgba(0,0,0,0.1);
}

[data-theme="dark"] {
    --bg-body: #121212;
    --bg-card: #1e1e1e;
    --bg-light: #252525;
    --bg-header: #1e1e1e;
    --bg-footer: #0a1020;
    --bg-overlay: rgba(0, 0, 0, 0.35);
    
    --text-main: #e0e0e0;
    --text-muted: #a0a0a0;
    --text-light: #b0b0b0;
    --text-on-brand: #e0e0e0;
    --text-headings: #e0e0e0;
    
    --brand-primary: #8ab4f8;
    --brand-secondary: #64b5f6;
    --brand-accent: #ffd700;
    --brand-red: #ff6b6b;
    --brand-green: #6abf69;
    
    --border-color: #333333;
    --shadow-subtle: rgba(0,0,0,0.3);
    --shadow-medium: rgba(0,0,0,0.5);
}

/* ============================================
   RESET & BASE
   ============================================ */
*, *:before, *:after { box-sizing: border-box; }
html { font-size: 16px; -webkit-text-size-adjust: 100%; }
body {
    margin: 0; padding: 0;
    font-family: 'Open Sans', 'Helvetica Neue', Helvetica, Arial, sans-serif;
    color: var(--text-main);
    line-height: 1.6;
    background-color: var(--bg-body);
    transition: background-color 0.3s ease, color 0.3s ease;
}
a { color: var(--brand-secondary); text-decoration: none; transition: all 0.2s ease; }
a:hover { color: var(--brand-primary); text-decoration: none; }
img { max-width: 100%; height: auto; display: block; }

h1, h2, h3, h4, h5, h6 {
    color: var(--text-headings);
    margin-top: 0; font-weight: 700; line-height: 1.3;
}
h1 { font-size: 2.25rem; margin-bottom: 1rem; }
h2 { font-size: 1.75rem; margin-bottom: 1rem; }
h3 { font-size: 1.5rem; margin-bottom: 0.75rem; }
p { margin-bottom: 1.5rem; }

/* ============================================
   STRUCTURE
   ============================================ */
#container { width: 100%; display: flex; flex-direction: column; min-height: 100vh; }

/* ============================================
   HEADER & NAVIGATION
   ============================================ */
header {
    background: var(--bg-header);
    padding: 10px 0;
    box-shadow: 0 2px 10px var(--shadow-subtle);
    position: sticky; top: 0; z-index: 1000;
    transition: background-color 0.3s ease;
}
header .container {
    max-width: 1200px; margin: 0 auto; padding: 0 20px;
    display: flex; flex-wrap: nowrap; align-items: center; justify-content: space-between;
}

/* Logo */
/* flex-shrink was 0, so the logo held 275px at every width and pushed the menu
   button off screen below ~449px. It gives way first now. */
#logo { flex: 0 1 auto; min-width: 0; text-align: left; }
#logo img { height: 70px; width: auto; display: block; margin: 0; }
.logo-container { display: flex; align-items: center; gap: 15px; }
.logo-text {
    display: flex;
    flex-direction: column;
}
.logo-text span {
    font-size: 1.8rem; font-weight: 700; color: var(--brand-primary);
    line-height: 1.2; text-transform: uppercase; letter-spacing: 0.5px;
}
.logo-text .logo-location {
    font-size: 0.9rem;
    font-weight: 400;
    text-transform: none;
    letter-spacing: normal;
    color: var(--text-muted);
    line-height: 1.2;
    margin-top: 2px;
}
#phone { display: none; }

/* Mobile Menu Controls */
#mobile-menu-controls {
    display: none;
    align-items: center;
    gap: 15px;
}

 /* Theme Toggle */
#theme-toggle, #theme-toggle-mobile {
    background: transparent;
    border: none;
    cursor: pointer;
    font-size: 1.2rem;
    color: var(--text-headings);
    padding: 0;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: transform 0.3s ease;
    outline: none;
    box-shadow: none;
    appearance: none;
    -webkit-appearance: none;
    position: relative;
    z-index: 1003;
    -webkit-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
    user-select: none;
}
#theme-toggle svg, #theme-toggle-mobile svg {
    pointer-events: none;
    width: 20px;
    height: 20px;
    flex-shrink: 0;
    stroke: var(--text-headings);
}
#theme-toggle:hover, #theme-toggle-mobile:hover {
    transform: rotate(15deg);
}

/* Dark mode theme toggle colors */
[data-theme="dark"] #theme-toggle,
[data-theme="dark"] #theme-toggle-mobile {
    color: #FFED00;
}
[data-theme="dark"] #theme-toggle svg,
[data-theme="dark"] #theme-toggle-mobile svg {
    stroke: #FFED00;
}
[data-theme="dark"] #theme-toggle svg:hover,
[data-theme="dark"] #theme-toggle-mobile svg:hover {
    stroke: #FFF59D;
}

/* Mobile Menu Toggle */
#mobile-menu-toggle {
    display: none; flex-direction: column; justify-content: space-around;
    width: 30px; height: 24px; background: transparent; border: none;
    cursor: pointer; padding: 0; z-index: 1001;
}
#mobile-menu-toggle .bar {
    width: 100%; height: 3px; background-color: var(--text-headings);
    border-radius: 10px;
    transform-origin: center;
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1),
                opacity 0.2s ease;
}

/* Menu */
#menu { width: auto; margin-top: 0; background: transparent; order: 1; display: flex; align-items: center; }
#menu ul { list-style: none; padding: 0; margin: 0; display: flex; align-items: center; }
#menu ul li { position: relative; text-align: center; }
#menu ul li a {
    display: block; padding: 15px 15px;
    color: var(--text-headings);
    font-weight: 700; text-transform: uppercase; font-size: 0.85rem;
    text-decoration: none; transition: all 0.2s ease;
}
#menu ul li a:hover,
#menu ul li.current-menu-item > a,
#menu ul li.current-menu-ancestor > a {
    color: var(--brand-red); background: transparent;
}

/* Submenu */
#menu ul ul {
    display: none; position: absolute; top: 100%; left: 0;
    background: var(--bg-card);
    min-width: 220px; z-index: 1000; flex-direction: column; align-items: stretch;
    box-shadow: 0 10px 15px var(--shadow-medium);
    border-radius: 0 0 6px 6px; padding: 10px 0;
    border-top: 3px solid var(--brand-red);
}
#menu ul li:hover > ul { display: flex; }
#menu ul ul li { text-align: left; width: 100%; }
#menu ul ul li a {
    display: block; width: 100%; padding: 12px 25px;
    font-size: 0.8rem; text-transform: none; text-align: left;
    color: var(--text-main); box-sizing: border-box;
}
#menu ul ul li a:hover {
    background: var(--bg-light); color: var(--brand-red);
}

/* Mobile menu toggle states */
#mobile-menu-toggle.open .bar:nth-child(1) { transform: rotate(45deg) translate(5px, 5px); }
#mobile-menu-toggle.open .bar:nth-child(2) { opacity: 0; }
#mobile-menu-toggle.open .bar:nth-child(3) { transform: rotate(-45deg) translate(5px, -5px); }

/* Submenu toggle button */
.submenu-toggle {
    display: none !important; position: absolute; top: 0; right: 0;
    width: 50px; height: 50px; line-height: 50px; text-align: center;
    color: #fff; background: rgba(255,255,255,0.1); cursor: pointer;
    font-size: 1.2rem; z-index: 10;
}
.submenu-toggle:hover { background: rgba(255,255,255,0.1); }

/* ============================================
   HERO & HOME PAGE
   ============================================ */
#header-image-home-frame {
    background-color: #244c8b; /* Keep brand specific */
    color: #fff; padding: 40px 20px; text-align: center;
}
#header-image-home-frame h2 { font-size: 2.5rem; color: #fff; margin-bottom: 15px; }
#header-image-home-frame h3 { font-size: 1.4rem; color: var(--text-light); font-weight: 300; }
#cimy_div_id_0 { width: 100% !important; height: 450px !important; }
#cimy_div_id_0 img { width: 100%; height: 100%; object-fit: cover; }

#hero-section {
    /* Capped so the photograph is not stretched into a thin letterbox on very
       wide displays. Beyond 1600px the section centres instead of spanning, so
       the crop stays close to the image's own proportions. */
    position: relative; width: 100%; max-width: 1600px; margin-inline: auto;
    min-height: 260px;
    aspect-ratio: 3/1; max-height: 360px;
    background-size: cover; background-position: center 70%;
    background-repeat: no-repeat; display: flex; align-items: center;
}
.hero-overlay {
    position: absolute; top: 0; left: 0; right: 0; bottom: 0;
    background: var(--bg-overlay); display: flex; align-items: center;
}
.hero-content {
    text-align: center; color: #fff; max-width: 800px;
    margin: 0 auto; padding: 20px; z-index: 1;
}
.hero-content h2 {
    font-size: 3rem; color: #fff; margin-bottom: 10px;
    text-shadow: 0 2px 6px rgba(0,0,0,0.45);
}
.hero-content h3 {
    font-size: 1.8rem; color: var(--brand-accent);
    font-weight: 400; text-shadow: 0 2px 6px rgba(0,0,0,0.45);
}

/* Callout Buttons */
#callout-btns {
    max-width: 1200px; margin: -50px auto 40px;
    display: flex; flex-wrap: wrap; gap: 30px; padding: 0 20px;
    justify-content: center; position: relative; z-index: 10;
}
a.callout-btn-red, a.callout-btn-yellow {
    flex: 1; min-width: 300px; padding: 40px; border-radius: 12px;
    display: flex; align-items: center; text-decoration: none;
    color: #fff; transition: all 0.3s ease;
    box-shadow: 0 10px 20px var(--shadow-medium);
}
a.callout-btn-red { background: var(--brand-red); }
a.callout-btn-yellow { background: var(--brand-accent); }
a.callout-btn-red:hover, a.callout-btn-yellow:hover {
    transform: translateY(-8px); box-shadow: 0 15px 30px rgba(0,0,0,0.2);
}

/* ============================================
   CONTENT AREAS
   ============================================ */
/* width: 100% is load-bearing. #container is a column flex container, and auto
   cross-axis margins on a flex item disable the default stretch -- so without an
   explicit width #main sized to fit-content and rendered WIDER than the
   viewport on narrow screens (350px inside a 290px container), giving the whole
   page a horizontal scrollbar. */
#main { max-width: 1200px; margin: 0 auto; width: 100%; padding: 20px; }
#content {
    background: var(--bg-card); padding: 40px;
    border-radius: 12px; box-shadow: 0 4px 20px var(--shadow-subtle);
}
/* Headings here set margin-top: 0, so a page starting with a heading sits flush
   against the padding above. Paragraphs only set margin-bottom, leaving the
   browser default margin-top of 1em -- so a page starting with a paragraph
   (as the home page now does, with its H1 moved into the CTA band) picked up an
   extra ~16px. Collapse the first child's top margin either way. */
#content > *:first-child { margin-top: 0; }

/* Interior Header */
.interior-banner-container { max-width: 1200px; width: 100%; margin: 0 auto; padding: 0 20px; }
#interior-header-image {
    position: relative; width: 100%; height: 350px; overflow: hidden;
    background: var(--brand-primary); border-radius: 12px; margin-top: 20px;
}
#interior-header-image img {
    width: 100%; height: 100%; object-fit: cover; object-position: center 45%; display: block;
}
#interior-header-image .interior-header-overlay {
    position: absolute; top: 0; left: 0; width: 100%; height: 100%;
    background: rgba(6, 37, 86, 0.2); pointer-events: none;
}

/* Programs Section */
.programs-section { padding: 60px 0; background: var(--bg-light); }
.programs-section .container {
    max-width: 1200px; margin: 0 auto; padding: 0 20px;
    display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 30px;
}
.program-tile {
    background: var(--bg-card); border-radius: 12px; overflow: hidden;
    box-shadow: 0 4px 20px var(--shadow-subtle);
    transition: transform 0.3s ease;
}
.program-tile:hover { transform: translateY(-5px); }
.tile-image { height: 200px; overflow: hidden; }
.tile-image img { width: 100%; height: 100%; object-fit: cover; transition: transform 0.3s; }
.program-tile:hover .tile-image img { transform: scale(1.1); }
.tile-content { padding: 25px; text-align: center; }

/* Alert Banner */
.alert-banner {
    background: var(--brand-accent);
    color: #062556; /* Keep dark text on yellow even in dark mode for contrast */
    padding: 15px 0; text-align: center; position: relative;
    box-shadow: 0 2px 5px var(--shadow-medium);
}
.alert-banner .container {
    display: flex; justify-content: center; align-items: center;
    padding-right: 40px; position: relative;
}
.alert-banner p { margin: 0; font-size: 1rem; font-weight: 600; line-height: 1.4; color: #062556; }
.alert-dismiss {
    background: transparent; border: none; color: #062556;
    font-size: 1.5rem; cursor: pointer; position: absolute; right: 0; top: 50%;
    transform: translateY(-50%); opacity: 0.6; transition: opacity 0.2s;
    padding: 0 10px; line-height: 1;
}
.alert-dismiss:hover { opacity: 1; }

/* ============================================
   FOOTER
   ============================================ */
footer {
    background: var(--bg-footer); color: var(--text-on-brand);
    padding: 20px 0 20px; margin-top: auto;
}
footer .container {
    max-width: 1200px; margin: 0 auto; padding: 0 20px;
    display: flex; flex-wrap: wrap; justify-content: space-between;
    align-items: center; gap: 20px;
}
#footer-left { display: flex; flex: 2; gap: 40px; flex-wrap: wrap; align-items: flex-start; }
#contact-footer { flex: 0 1 auto; min-width: 250px; }
#contact-footer h2 {
    color: var(--text-on-brand); font-size: 1.5rem; margin-bottom: 20px;
    position: relative; padding-bottom: 15px;
}
#contact-footer h2:after {
    content: ""; position: absolute; bottom: 0; left: 0;
    width: 50px; height: 3px; background: var(--brand-red);
}
#contact-footer p { color: var(--text-light); margin-bottom: 10px; font-size: 0.95rem; }
#contact-footer a { color: var(--brand-accent); text-decoration: underline; text-decoration-color: rgba(255,255,255,0.3); text-underline-offset: 3px; transition: all 0.2s ease; }
#contact-footer a:hover { color: var(--text-on-brand); text-decoration-color: var(--brand-accent); }

#footer-links { flex: 0 1 auto; min-width: 200px; }
#footer-links ul { list-style: none; padding: 0; margin: 0; }
#footer-links ul li a {
    color: var(--text-on-brand); display: block; padding: 10px 0;
    font-size: 1rem; font-weight: 600; transition: color 0.2s;
}
#footer-links ul li a:hover { color: var(--brand-accent); }

#column-right {
    flex: 1; min-width: 250px; text-align: right;
    display: flex; flex-direction: column; align-items: flex-end;
}
#column-right img { height: auto; width: auto; margin-bottom: 20px; }
#column-right > a { text-decoration: none; display: inline-block; }
p.copyright {
    font-size: 0.8rem; color: var(--text-muted); margin: 0;
    border-top: 1px solid rgba(255,255,255,0.05); padding-top: 15px; width: 100%;
}

/* Footer Components */
.social-links { display: flex; gap: 15px; margin-top: 20px; }
.social-icon {
    width: 36px; height: 36px; background: rgba(255,255,255,0.1);
    border-radius: 50%; display: flex; align-items: center; justify-content: center;
    color: #fff; font-size: 0.8rem; font-weight: 700; text-decoration: none;
    transition: all 0.3s ease;
}
.social-icon:hover { background: var(--brand-red); transform: translateY(-3px); }
.social-icon svg { width: 18px; height: 18px; fill: currentColor; stroke: currentColor; stroke-width: 0; }
.social-icon[aria-label="Instagram"] svg { fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }

#footer-links-container { display: flex; gap: 40px; flex: 1; justify-content: flex-start; }
.footer-link-group h3 {
    color: var(--brand-accent); font-size: 1.3rem; margin-bottom: 15px;
    font-weight: 700; text-transform: none; padding: 5px 0 10px;
}
.footer-link-group ul { list-style: none; padding: 0; margin: 0; }
.footer-link-group ul li a {
    color: var(--text-on-brand); display: block; padding: 8px 0;
    font-size: 0.95rem; text-decoration: underline; text-decoration-color: rgba(255,255,255,0.3); text-underline-offset: 3px; transition: all 0.2s;
}
.footer-link-group ul li a:hover { color: var(--brand-accent); text-decoration-color: var(--brand-accent); }

#back-to-top {
    position: fixed; bottom: 20px; right: 20px; width: 40px; height: 40px;
    background: var(--brand-red); color: #fff; border-radius: 50%;
    display: none; align-items: center; justify-content: center;
    text-decoration: none; box-shadow: 0 4px 10px var(--shadow-subtle);
    z-index: 9999; transition: all 0.3s ease; opacity: 0.8;
}
#back-to-top:hover { background: #c0392b; transform: translateY(-3px); opacity: 1; }
.arrow-up {
    border: solid white; border-width: 0 2px 2px 0; display: block;
    padding: 4px; position: absolute; top: 50%; left: 50%;
    transform: translate(-50%, -35%) rotate(-135deg);
}

.legal-links { font-size: 0.75rem; color: var(--text-muted); margin-top: 10px; width: 100%; }
.site-credit {
    font-size: 0.7rem; color: #555; margin-top: 5px;
    margin-bottom: 0; opacity: 0.6;
}
.legal-links a, .site-credit a { color: inherit; text-decoration: underline; text-decoration-color: rgba(255,255,255,0.3); text-underline-offset: 3px; transition: all 0.2s ease; }
.legal-links a:hover, .site-credit a:hover { color: var(--brand-accent); text-decoration-color: var(--brand-accent); }

/* ============================================
   COMPONENTS
   ============================================ */

/* Forms */
input[type='text'], input[type='email'], textarea {
    width: 100%; padding: 12px 15px;
    border: 1px solid var(--border-color); background: var(--bg-card); color: var(--text-main);
    border-radius: 6px; margin-bottom: 15px;
}

/* Buttons */
.button, .button:visited {
    display: inline-block; padding: 12px 24px;
    background-color: var(--button-bg, var(--brand-secondary)); color: #fff !important;
    text-decoration: none; border-radius: 4px; font-weight: 600;
    transition: transform 0.2s ease, filter 0.2s ease;
}
.button:hover {
    transform: translateY(-2px);
    filter: brightness(0.85);
}
.button.download-button { --button-bg: var(--brand-green); }
.button.schedule-tour-button { --button-bg: var(--brand-primary); }
button.button {
    border: 0; cursor: pointer; font-family: inherit; font-size: 1rem;
}

/* Jobs application preview */
body.jobs-modal-open { overflow: hidden; }
.jobs-modal[hidden] { display: none !important; }
.jobs-modal {
    position: fixed; inset: 0; z-index: 10010;
    display: flex; align-items: center; justify-content: center;
    padding: 20px;
}
.jobs-modal-backdrop {
    position: absolute; inset: 0; background: rgba(0,0,0,0.72);
}
.jobs-modal-panel {
    position: relative; z-index: 1;
    width: min(920px, 100%);
    max-height: calc(100vh - 40px);
    overflow: auto;
    background: var(--bg-card);
    color: var(--text-main);
    border-radius: 12px;
    padding: 28px 24px 20px;
    box-shadow: 0 16px 48px rgba(0,0,0,0.28);
}
.jobs-modal-close {
    position: absolute; top: 10px; right: 14px;
    background: none; border: 0; color: var(--text-muted);
    font-size: 32px; line-height: 1; cursor: pointer;
}
.jobs-modal-close:hover { color: var(--brand-primary); }
.jobs-modal-panel h2 {
    margin: 0 32px 12px 0;
    color: var(--text-headings);
    font-size: 1.5rem;
}
.jobs-modal-instructions {
    margin-bottom: 16px; font-size: 0.95rem; line-height: 1.5;
}
.jobs-modal-instructions p { margin: 0 0 0.6rem; }
.jobs-modal-preview {
    background: var(--bg-light);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    overflow: auto;
    height: min(62vh, 640px);
    -webkit-overflow-scrolling: touch;
}
#jobs-pdf-pages { padding: 8px; }
.jobs-pdf-page {
    display: block; width: 100%; height: auto;
    margin: 0 0 10px; background: #fff;
    box-shadow: 0 1px 4px rgba(0,0,0,0.12);
}
.jobs-modal-fallback { margin: 1rem; font-size: 0.95rem; }
.jobs-modal-actions {
    display: flex; flex-wrap: wrap; gap: 10px;
    margin-top: 16px;
}
.jobs-application-block {
    display: flex; flex-wrap: wrap; gap: 10px;
    align-items: center;
    margin: 12px 0;
}
.jobs-modal-panel > .jobs-source-url {
    flex: 1 1 100%;
    margin: 4px 0 0;
    font-size: 0.85rem;
    line-height: 1.4;
    word-break: break-all;
    color: var(--text-muted);
}
.jobs-source-url a { color: inherit; }

.page-enrollment #interior-header-image { background: #fff; }
.page-enrollment #interior-header-image .interior-header-overlay { background: none; }

/* Opt-in classes on Meet Our Team (editor: block → Advanced → Additional CSS class).
   Do not target raw h2/h3 — the editor would then disagree with the public page. */
.team-section {
    font-size: 0.82rem;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    font-weight: 700;
    color: var(--brand-primary);
    border-bottom: 2px solid var(--brand-primary);
    padding-bottom: 0.4rem;
    margin: 2.2rem 0 1.1rem;
}
.team-section:first-of-type { margin-top: 1.6rem; }
.team-name {
    font-size: 1.45rem;
    margin: 1.4rem 0 0.15rem;
}
.team-role {
    margin-bottom: 0.75rem;
    color: var(--text-muted);
    font-weight: 600;
}

/* Dark mode inverts the brand colours to light tints (--brand-primary becomes
   #8ab4f8), so the hardcoded white button label drops to roughly 2:1 contrast --
   well under WCAG AA. Dark text on those light fills instead. */
[data-theme="dark"] .button,
[data-theme="dark"] .button:visited {
    color: #10233f !important;
}

/* Read more links */
.read-more {
    display: inline-block; margin-top: 1rem;
    color: var(--brand-secondary); font-weight: 600;
    text-decoration: none; transition: color 0.2s ease;
}
.read-more:hover {
    color: var(--brand-primary); text-decoration: underline;
}

/* FAQ & Details */
details {
    margin-bottom: 1rem; border: 1px solid var(--border-color);
    border-radius: 8px; overflow: hidden; transition: all 0.3s ease;
    background: var(--bg-card);
}
details[open] { border-color: var(--brand-secondary); box-shadow: 0 2px 8px rgba(30, 73, 143, 0.1); }
 details summary {
    padding: 1.2rem; background: var(--bg-light); cursor: pointer;
    font-weight: 600; font-size: 1.1rem; border: none; outline: none;
    transition: all 0.3s ease; position: relative; padding-right: 2.5rem;
    color: var(--text-main); list-style: none;
}
details summary::-webkit-details-marker { display: none; }
details summary::after {
    content: '+'; position: absolute; right: 1.2rem; top: 50%;
    transform: translateY(-50%); font-size: 1.5rem; font-weight: 300;
    color: var(--brand-secondary); transition: transform 0.3s ease;
}
details[open] summary::after { content: '−'; transform: translateY(-50%) rotate(180deg); }
details[open] summary { background: var(--brand-secondary); color: #fff; }
details summary:hover { background: var(--border-color); }
details[open] summary:hover { background: var(--brand-primary); }
details summary > * { display: inline; }
details[open] summary ~ * { animation: slideDown 0.3s ease; }
details > *:not(summary) { padding: 1.2rem; margin: 0; }

@keyframes slideDown { from { opacity: 0; transform: translateY(-10px); } to { opacity: 1; transform: translateY(0); } }

/* Announcements, Events, News */
.announcement-item, .event-item, .news-item {
    padding: 1.5rem; margin-bottom: 1.5rem; border-radius: 8px;
    transition: all 0.3s ease; animation: fadeInUp 0.5s ease;
}
.announcement-item { border-left: 4px solid var(--brand-accent); background: #fef9e7; }
.announcement-item:hover {
    transform: translateX(5px); box-shadow: 0 4px 12px rgba(243, 156, 18, 0.15); background: var(--bg-card);
}
.event-item { border: 1px solid var(--border-color); background: var(--bg-card); }
.event-item:hover {
    transform: translateY(-3px); box-shadow: 0 6px 20px rgba(30, 73, 143, 0.2); border-color: var(--brand-secondary);
}
.news-item {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-left: 4px solid var(--brand-green);
    color: var(--text-main);
}
.news-item h3 { color: var(--text-headings); margin: 0.35rem 0 0.6rem; }
.news-item:hover { background: var(--bg-light); }
.news-item p { color: var(--text-main); }

.event-date, .announcement-date, .news-date { display: inline-block; margin-bottom: 0.5rem; font-weight: 600; }
.event-date { background: var(--brand-secondary); color: var(--text-on-brand); padding: 0.3rem 0.8rem; border-radius: 20px; }
.announcement-date { color: var(--brand-accent); }
.news-date { color: var(--text-muted); font-style: italic; font-size: 0.9rem; }
.announcements-section h2, .events-section h2, .news-section h2 {
    border-bottom: 3px solid var(--brand-secondary); padding-bottom: 10px; margin-bottom: 1.5rem;
}
.announcements-section h2 { border-color: var(--brand-accent); }
.events-section h2 { border-color: var(--brand-secondary); }
.news-section h2 { border-color: var(--brand-green); }

.news-toolbar {
    display: flex;
    flex-wrap: wrap;
    gap: 12px 20px;
    align-items: center;
    justify-content: space-between;
    margin: 0 0 1.5rem;
}
.news-view-toggle {
    display: inline-flex;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    overflow: hidden;
    background: var(--bg-card);
}
.news-view-btn {
    padding: 0.45rem 1rem;
    color: var(--text-main);
    font-weight: 600;
    font-size: 0.95rem;
}
.news-view-btn + .news-view-btn { border-left: 1px solid var(--border-color); }
.news-view-btn.is-active {
    background: var(--brand-primary);
    color: var(--text-on-brand);
}
.news-export, .news-item-ics { display: flex; flex-wrap: wrap; gap: 8px; }
.news-item-ics { margin: 0.8rem 0 0; }
.news-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    padding: 0.4rem 0.75rem;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    background: var(--bg-card);
    color: var(--text-main);
    font-weight: 600;
    font-size: 0.85rem;
    line-height: 1;
}
.news-btn:hover {
    background: var(--bg-light);
    color: var(--brand-primary);
    text-decoration: none;
}
.news-cal-icon { display: block; flex-shrink: 0; width: 16px; height: 16px; }
.news-empty { color: var(--text-muted); }
.news-sr {
    position: absolute;
    width: 1px; height: 1px;
    padding: 0; margin: -1px;
    overflow: hidden; clip: rect(0, 0, 0, 0);
    border: 0;
}
.news-cal-nav {
    display: flex;
    align-items: center;
    justify-content: center;
    flex-wrap: wrap;
    gap: 8px 12px;
    margin-bottom: 0.6rem;
}
.news-cal-jump { display: inline-flex; align-items: center; gap: 8px; }
.news-cal-month {
    font: inherit;
    font-weight: 600;
    color: var(--text-headings);
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 0.4rem 0.6rem;
}
.news-cal-chevron {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 2.2rem;
    height: 2.2rem;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    background: var(--bg-card);
    color: var(--text-headings);
    font-size: 1.4rem;
    line-height: 1;
}
.news-cal-chevron:hover { background: var(--bg-light); color: var(--brand-primary); text-decoration: none; }
.news-cal-chevron.is-disabled { opacity: 0.35; pointer-events: none; }
.news-cal-note { color: var(--text-muted); font-size: 0.9rem; margin: 0 0 1rem; }
.news-cal {
    display: grid;
    grid-template-columns: repeat(7, minmax(0, 1fr));
    gap: 4px;
}
.news-cal-dow {
    text-align: center;
    font-size: 0.75rem;
    font-weight: 700;
    color: var(--text-muted);
    padding: 0.3rem 0;
}
.news-cal-day {
    min-height: 6.2rem;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 6px;
    padding: 6px;
}
.news-cal-day.is-pad { background: transparent; border-color: transparent; min-height: 0; }
.news-cal-day.is-today { border-color: var(--brand-primary); box-shadow: inset 0 0 0 1px var(--brand-primary); }
.news-cal-day.has-events { background: var(--bg-light); }
.news-cal-num { font-size: 0.8rem; font-weight: 700; color: var(--text-headings); }
.news-cal-events { list-style: none; margin: 6px 0 0; padding: 0; }
.news-cal-events li { margin: 0 0 4px; font-size: 0.75rem; line-height: 1.3; }
.news-cal-events a { font-weight: 600; }

@keyframes fadeInUp { from { opacity: 0; transform: translateY(20px); } to { opacity: 1; transform: translateY(0); } }
@keyframes slideInRight { from { opacity: 0; transform: translateX(-20px); } to { opacity: 1; transform: translateX(0); } }

 /* Testimonials Section */
.testimonials-section {
    padding: 30px 20px;
    background: linear-gradient(135deg, var(--bg-light) 0%, var(--bg-body) 100%);
    text-align: center;
}
.testimonials-section h2 {
    color: var(--brand-primary);
    margin-bottom: 0.5rem;
}
.testimonials-intro {
    font-size: 1.1rem; color: var(--text-muted);
    margin-bottom: 3rem; max-width: 700px;
    margin-left: auto; margin-right: auto;
}
.testimonials-carousel {
    position: relative; margin: 0 auto; overflow: hidden;
    padding: 15px 0;
}
.testimonials-track {
    display: flex; transition: transform 0.5s ease-in-out;
}
.testimonial-slide {
    min-width: 100%; padding: 0 15px; box-sizing: border-box;
}
.testimonial-card {
    background: var(--bg-card); padding: 2rem; border-radius: 12px;
    text-align: left; position: relative;
}
.testimonial-card::before {
    content: '"'; position: absolute; top: 1rem; left: 1rem;
    font-size: 4rem; color: var(--brand-accent);
    font-family: Georgia, serif; opacity: 0.3; line-height: 1;
}
.testimonial-card .stars {
    color: var(--brand-accent); font-size: 1.5rem;
    margin-bottom: 1rem; letter-spacing: 0.2rem;
}
.testimonial-text {
    font-size: 1rem; line-height: 1.6; color: var(--text-main);
    margin-bottom: 1.5rem; font-style: italic; position: relative; z-index: 1;
}
.testimonial-author {
    border-top: 2px solid var(--brand-accent); padding-top: 1rem; font-size: 0.9rem;
}
.testimonial-author em {
    color: var(--brand-primary); font-size: 1rem;
    font-style: italic;
    font-weight: 600;
}
.testimonial-author strong {
    color: var(--brand-primary); font-size: 1rem;
}
.carousel-nav {
    position: absolute; top: 50%; transform: translateY(-50%);
    background: var(--brand-primary); color: #fff; border: none;
    width: 50px; height: 50px; border-radius: 50%; font-size: 2rem;
    cursor: pointer; z-index: 10; display: flex; align-items: center;
    justify-content: center; transition: all 0.3s ease;
}

.testimonials-carousel[data-count="1"] .carousel-nav {
    display: none;
}
.carousel-nav:hover {
    background: var(--brand-secondary); transform: translateY(-50%) scale(1.1);
}
.carousel-prev { left: 10px; }
.carousel-next { right: 10px; }
.testimonials-dots {
    display: flex; justify-content: center; gap: 10px; margin-top: 20px;
}
.testimonials-dots button {
    width: 12px; height: 12px; border-radius: 50%; border: 2px solid var(--brand-primary);
    background: transparent; cursor: pointer; padding: 0; transition: all 0.3s ease;
}
.testimonials-dots button.active {
    background: var(--brand-primary);
}

/* Gallery */
.fairview-gallery-grid, .wp-block-gallery {
    display: grid !important; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)) !important;
    gap: 15px !important; margin-top: 20px; list-style: none; padding: 0;
}
.wp-block-gallery .wp-block-image, .wp-block-gallery .blocks-gallery-item {
    width: auto !important; margin: 0 !important; flex: none !important;
}
.gallery-item, .wp-block-gallery .wp-block-image, .wp-block-gallery .blocks-gallery-item {
    position: relative; overflow: hidden; border-radius: 8px;
    box-shadow: 0 2px 5px var(--shadow-medium);
    transition: transform 0.3s ease; aspect-ratio: 1 / 1;
}
.gallery-item:hover, .wp-block-gallery .wp-block-image:hover, .wp-block-gallery .blocks-gallery-item:hover {
    transform: scale(1.03); z-index: 2;
}
.gallery-item img, .wp-block-gallery .wp-block-image img, .wp-block-gallery .blocks-gallery-item img {
    width: 100%; height: 100%; object-fit: cover; display: block;
}
.gallery-item figcaption, .wp-block-gallery .wp-block-image figcaption, .wp-block-gallery .blocks-gallery-item figcaption {
    position: absolute; bottom: 0; left: 0; right: 0;
    background: rgba(0, 0, 0, 0.7); color: #fff;
    font-size: 0.8rem; padding: 8px; text-align: center;
    transition: opacity 0.3s ease; opacity: 0; pointer-events: none;
    margin: 0 !important; width: 100% !important; box-sizing: border-box; line-height: 1.2;
}
.gallery-item:hover figcaption, .wp-block-gallery .wp-block-image:hover figcaption, .wp-block-gallery .blocks-gallery-item:hover figcaption {
    opacity: 1;
}

/* WordPress Block Image Override - Exclude aligned images */
.wp-block-image:not(.alignleft):not(.alignright):not(.aligncenter) img:not([data-wp-bind--src="state.enlargedSrc"]) {
    height: 250px !important;
    object-fit: cover !important;
    object-position: center 35% !important;
    width: 100% !important;
}

/* Lightbox */
.lightbox-overlay {
    display: none; position: fixed; z-index: 10000; left: 0; top: 0; width: 100%; height: 100%;
    overflow: hidden; background-color: rgba(0,0,0,0.95);
    justify-content: center; align-items: center; flex-direction: column; padding: 20px 0;
    touch-action: pan-y;
}
.lightbox-main-area {
    display: flex; flex-direction: column; justify-content: center;
    align-items: center; width: 100%; max-height: calc(100vh - 150px); position: relative;
}
.lightbox-content {
    max-width: 90%; max-height: 100%; border-radius: 4px;
    box-shadow: 0 0 20px rgba(0,0,0,0.5); animation: zoomIn 0.3s; object-fit: contain;
    touch-action: none;
}
#lightbox-caption { margin-top: 15px; color: #fff; font-size: 1rem; text-align: center; }
.lightbox-close {
    position: absolute; top: 20px; right: 35px; color: #f1f1f1; font-size: 40px;
    font-weight: bold; cursor: pointer; transition: 0.3s; line-height: 1; z-index: 10002;
}
.lightbox-close:hover, .lightbox-close:focus { color: #bbb; text-decoration: none; cursor: pointer; }
@keyframes zoomIn { from {transform:scale(0)} to {transform:scale(1)} }

.lightbox-prev, .lightbox-next {
    cursor: pointer; position: absolute; top: 50%; width: auto; padding: 16px;
    margin-top: -50px; color: white; font-weight: bold; font-size: 30px;
    transition: 0.6s ease; border-radius: 0 3px 3px 0;
    user-select: none; -webkit-user-select: none;
    background-color: rgba(0, 0, 0, 0.3); z-index: 10001;
}
.lightbox-next { right: 0; border-radius: 3px 0 0 3px; }
.lightbox-prev { left: 0; }
.lightbox-prev:hover, .lightbox-next:hover { background-color: rgba(0, 0, 0, 0.8); }

 /* Lightbox Carousel */
#lightbox-carousel {
    height: 120px; width: 100%; max-width: 1200px; display: flex; gap: 10px;
    overflow-x: auto; overflow-y: hidden; padding: 10px;
    background: rgba(0,0,0,0.5); border-radius: 8px; margin-top: 20px;
    scrollbar-width: thin; scrollbar-color: var(--brand-accent) rgba(0,0,0,0.3); z-index: 10002;
    scroll-behavior: smooth; touch-action: pan-x;
}
#lightbox-carousel::-webkit-scrollbar { height: 8px; }
#lightbox-carousel::-webkit-scrollbar-track { background: rgba(0,0,0,0.3); }
#lightbox-carousel::-webkit-scrollbar-thumb { background-color: var(--brand-accent); border-radius: 4px; }
.carousel-thumb {
    height: 100%; width: 100px; aspect-ratio: 1/1; object-fit: cover; border-radius: 4px;
    cursor: pointer; opacity: 0.5; transition: all 0.2s ease;
    border: 2px solid transparent; flex-shrink: 0;
}
.carousel-thumb:hover { opacity: 0.8; }
.carousel-thumb.active { opacity: 1; border-color: var(--brand-accent); transform: scale(1.05); }

/* Program Grid */
.fairview-program-grid {
    display: grid; grid-template-columns: repeat(2, 1fr);
    gap: 30px; max-width: 900px; margin: 40px auto;
}
.fairview-program-grid .program-tile {
    background: var(--bg-card); border-radius: 12px; overflow: hidden;
    transition: transform 0.3s ease; text-decoration: none; display: flex; flex-direction: column;
}
.fairview-program-grid .program-tile a {
    text-decoration: none; color: inherit; display: flex; flex-direction: column; height: 100%;
}
.fairview-program-grid .tile-image { height: 200px; overflow: hidden; }
.fairview-program-grid .tile-image img {
    width: 100%; height: 100%; object-fit: cover; transition: transform 0.5s ease;
}
.fairview-program-grid .program-tile:hover .tile-image img { transform: scale(1.05); }
.fairview-program-grid .tile-content {
    padding: 25px; text-align: center; flex-grow: 1; display: flex; flex-direction: column; justify-content: center;
}
.fairview-program-grid .tile-content h3 {
    font-size: 1.25rem; color: var(--text-headings); margin-bottom: 10px; line-height: 1.3;
}
.fairview-program-grid .tile-content p {
    font-size: 1rem; color: var(--text-muted); margin-bottom: 0;
}

@media (max-width: 768px) {
    .fairview-program-grid {
        grid-template-columns: 1fr;
    }
}

/* ============================================
   RESPONSIVE STYLES
   ============================================ */
@media (max-width: 1100px) {
    /* Header */
    header { padding: 10px 0; position: sticky; top: 0; z-index: 1002; box-shadow: 0 2px 5px var(--shadow-medium); }
    .admin-bar header { top: 32px; }
    @media screen and (max-width: 782px) { .admin-bar header { top: 46px; } }
    
    header .container { flex-wrap: nowrap; justify-content: space-between; }
    #logo img { height: 60px; }
    #mobile-menu-controls { display: flex; }
    #mobile-menu-toggle { display: flex; }
    #phone { display: none; }
    
    /* Logo adjustments */
    .logo-container { gap: 10px; }
    .logo-text span { font-size: 1.2rem; max-width: 200px; }
    
    /* Mobile Menu */
    #menu {
        display: block; position: absolute; top: 100%; left: 0; width: 100%;
        background: var(--brand-primary); z-index: 1000; border-radius: 0;
        margin-top: 0;
    }
    #menu:not(.open) {
        max-height: 0;
        overflow: hidden;
        opacity: 0;
        visibility: hidden;
        pointer-events: none;
        transition: max-height 0.4s cubic-bezier(0.4, 0, 0.2, 1),
                    opacity 0.3s cubic-bezier(0.4, 0, 0.2, 1),
                    visibility 0.3s;
    }
    .admin-bar #menu.open { max-height: calc(100vh - 112px); }
    #menu.open {
        max-height: calc(100vh - 80px);
        opacity: 1;
        visibility: visible;
        pointer-events: auto;
        overflow-y: auto;
        transition: max-height 0.4s cubic-bezier(0.4, 0, 0.2, 1),
                    opacity 0.3s cubic-bezier(0.4, 0, 0.2, 1),
                    visibility 0.3s;
    }
    #menu ul { flex-direction: column; width: 100%; }
    #menu ul li {
        border-bottom: 1px solid rgba(255,255,255,0.05); text-align: left;
        position: relative; display: block; width: 100%;
    }
    #menu ul li a {
        padding: 15px 60px 15px 20px; display: block; width: 100%;
        color: #ffffff; text-decoration: none; text-align: left;
    }
    #menu ul ul {
        display: block; position: static; box-shadow: none; width: 100%;
        background: rgba(0,0,0,0.15); padding: 0; border-top: none;
    }
    #menu ul li.submenu-collapsed > ul { display: none; }
    #menu ul ul li { width: 100%; }
    #menu ul ul li a {
        padding: 12px 30px; font-size: 0.85rem; width: 100%;
        box-sizing: border-box; color: #ddd;
    }
    .submenu-toggle {
        display: block !important; position: absolute; top: 0; right: 0;
        width: 50px; height: 50px; line-height: 50px; text-align: center;
        color: #fff; background: rgba(255,255,255,0.1); cursor: pointer;
        font-size: 1.2rem; z-index: 10;
    }
    .submenu-toggle:hover { background: rgba(255,255,255,0.1); }
    
    /* Hide desktop theme toggle in menu */
    #menu #theme-toggle { display: none; }
    
    /* Mobile theme toggle animation */
    #mobile-menu-controls #theme-toggle-mobile {
        transition: opacity 0.4s ease, transform 0.4s cubic-bezier(0.4, 0, 0.2, 1);
        opacity: 0;
        transform: translateX(-20px);
    }
    header.menu-open #mobile-menu-controls #theme-toggle-mobile {
        opacity: 1;
        transform: translateX(0);
    }
    header.menu-open #mobile-menu-controls #theme-toggle-mobile:hover {
        transform: rotate(15deg);
    }
    
    /* Content */
    #main { padding: 20px; }
    #content { padding: 20px; }
    
    /* Home Page */
    #callout-btns { margin-top: 20px; }
    #header-image-home-frame h2 { font-size: 1.8rem; }
    
    /* Hero */
    #hero-section { height: 220px; min-height: 0; aspect-ratio: auto; }
    .hero-content h2 { font-size: 2rem; }
    .hero-content h3 { font-size: 1.4rem; }
    
    /* Interior Header */
    #interior-header-image { height: 250px; border-radius: 6px; margin-top: 10px; }
    
    /* Footer */
    footer .container { flex-direction: column; text-align: center; gap: 20px; }
    #footer-left { flex-direction: column; align-items: center; gap: 20px; width: 100%; }
    #contact-footer { text-align: center; width: 100%; display: flex; flex-direction: column; align-items: center; }
    #contact-footer h2:after { left: 50%; transform: translateX(-50%); }
    .social-links { justify-content: center; width: 100%; }
    #footer-links-container { flex-direction: row; flex-wrap: wrap; justify-content: center; width: 100%; gap: 20px; text-align: center; }
    .footer-link-group { min-width: 140px; }
    #column-right { align-items: center; text-align: center; width: 100%; margin-top: 0; }
    #column-right img { margin: 0 auto 20px; }
    .legal-links, .site-credit { text-align: center !important; display: block !important; width: 100%; margin-bottom: 0; }
    #back-to-top { bottom: 15px; right: 15px; width: 35px; height: 35px; font-size: 1rem; }
    
    /* Components */
    .lightbox-prev, .lightbox-next { padding: 8px; font-size: 20px; }
    #lightbox-carousel { height: 60px; padding: 5px; }
    
    .testimonials-cta { max-width: 100%; padding: 1.5rem; }
    
    /* FAQ */
    details summary { padding: 1rem; padding-right: 2.2rem; font-size: 1rem; }
    details summary::after { font-size: 1.3rem; right: 1rem; }
    details > *:not(summary) { padding: 1rem; }

    .jobs-modal { padding: 10px; }
    .jobs-modal-panel { padding: 22px 16px 16px; }
    .jobs-modal-preview { height: 48vh; }
    .announcement-item, .event-item, .news-item { padding: 1.2rem; margin-bottom: 1.2rem; }
    .news-cal-day { min-height: 4.4rem; }
    .news-cal-nav { flex-wrap: wrap; }
}


/* =============================================================================
   Hero call-to-action band (home page)
   Sits directly under the hero so the primary action is above the fold without
   putting text over the photograph.
   ============================================================================= */
#hero-cta {
    background: var(--bg-card);
    border-bottom: 1px solid var(--border-color);
    box-shadow: 0 1px 3px var(--shadow-subtle);
}
/* The theme has no generic .container rule -- each section defines its own
   (see `header .container`), so this one needs the gutter spelled out. */
#hero-cta .container {
    max-width: 1200px; margin: 0 auto; padding: 18px 20px;
    display: flex; align-items: center; justify-content: space-between;
    gap: 20px; flex-wrap: wrap;
}
/* Deliberately NOT the page <h1> -- the page keeps its own heading. This line
   exists to say something the heading does not, so the two do not repeat. */
.hero-cta-lede {
    margin: 0; font-size: 1.15rem; line-height: 1.3; font-weight: 700;
    color: var(--text-headings);
}
.hero-cta-actions {
    display: flex; align-items: center; gap: 18px; flex-wrap: wrap;
}
.hero-cta-phone {
    font-weight: 600; color: var(--brand-secondary);
    text-decoration: none; white-space: nowrap;
}
.hero-cta-phone:hover { text-decoration: underline; }

[data-theme="dark"] .hero-cta-phone { color: var(--brand-accent); }

/* Tap-to-call in the mobile header. Hidden on desktop, where the number is
   already in the CTA band and the footer. */
#mobile-call { display: none; }
#mobile-call svg { width: 22px; height: 22px; display: block; }

@media (max-width: 768px) {
    #mobile-call {
        display: flex; align-items: center; justify-content: center;
        color: var(--brand-primary); text-decoration: none;
        padding: 4px; margin-right: 4px;
    }
    [data-theme="dark"] #mobile-call { color: var(--brand-accent); }

    #hero-cta .container {
        flex-direction: column; align-items: stretch; text-align: center;
        gap: 14px;
    }
    .hero-cta-actions { justify-content: center; }
}


/* =============================================================================
   Narrow phones
   The header is logo + controls on one row. Below roughly 450px the logo has to
   give way or the menu button is pushed off screen. Measured: logo 275px +
   controls 134px + 40px padding = 449px minimum before this.
   ============================================================================= */
@media (max-width: 480px) {
    header .container { padding: 0 12px; }
    #logo img { height: 48px; }
    .logo-container { gap: 8px; }
    .logo-text span { font-size: 0.95rem; max-width: none; }
    #mobile-menu-controls { gap: 2px; }
}

@media (max-width: 380px) {
    /* Last resort on the smallest handsets: the number is still one tap away in
       the CTA band and the footer, whereas losing the menu button strands the
       visitor entirely. */
    #mobile-call { display: none; }
    .logo-text .logo-location { display: none; }
    #logo img { height: 42px; }
    .logo-text span { font-size: 0.9rem; }
}
