/* ═══════════════════════════════════════════════════════════════════════
   COMPONENTS — PHP-template-rendered elements only.

   Block-rendered components (cards, steps, principles, FAQ) live in
   block-styles.css, NOT here. This file covers header, footer, mobile
   nav, skip link, page chrome — things output by PHP templates.
   ═══════════════════════════════════════════════════════════════════════ */

/* ─── Reset & Base ─────────────────────────────────────────────────── */

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }

body {
    font-family: var(--font-body);
    font-size: var(--text-base);
    line-height: var(--leading-normal);
    color: var(--color-text);
    background: var(--bg-white);
}

a { color: var(--accent); text-decoration: none; transition: color var(--transition-fast); }
a:hover { color: var(--accent-hover); }
img { max-width: 100%; height: auto; display: block; }

/* ─── Layout Containers ────────────────────────────────────────────── */

.container {
    max-width: var(--zone-content);
    margin: 0 auto;
    padding: 0 var(--space-6);
}

.container--wide  { max-width: var(--zone-wide); }
.container--narrow { max-width: var(--zone-narrow); }

/* ─── Skip Link ────────────────────────────────────────────────────── */

.skip-link {
    position: absolute;
    top: -100%;
    left: var(--space-4);
    background: var(--accent);
    color: white;
    padding: var(--space-2) var(--space-4);
    border-radius: var(--radius-sm);
    font-size: var(--text-sm);
    font-weight: var(--weight-medium);
    z-index: 1000;
}

.skip-link:focus {
    top: var(--space-2);
    color: white;
}

/* ═══════════════════════════════════════════════════════════════════════
   HEADER
   ═══════════════════════════════════════════════════════════════════════ */

.site-header {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    background: var(--bg-white);
    border-bottom: 1px solid var(--color-border);
    z-index: 100;
}

.header-inner {
    max-width: var(--zone-wide);
    margin: 0 auto;
    padding: var(--space-4) var(--space-6);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.site-logo { display: inline-flex; align-items: center; }
.site-logo img { height: 44px; width: auto; }

/* ─── Desktop Navigation ───────────────────────────────────────────── */

.main-nav {
    display: flex;
    gap: var(--space-6);
    align-items: center;
    list-style: none;
}

.main-nav a {
    font-size: var(--text-sm);
    font-weight: var(--weight-medium);
    color: var(--color-muted);
    transition: color var(--transition-fast);
}

.main-nav a:hover { color: var(--color-heading); }
.main-nav a.is-active { color: var(--accent); }

.main-nav .nav-cta a {
    color: var(--accent) !important;
    font-weight: var(--weight-semibold) !important;
}

.main-nav .nav-cta a.is-active { color: var(--accent) !important; }

/* ─── Mobile Nav Toggle ────────────────────────────────────────────── */

.mobile-nav-toggle {
    display: none;
    flex-direction: column;
    gap: var(--space-1);
    background: none;
    border: none;
    cursor: pointer;
    padding: var(--space-2);
}

.hamburger-line {
    display: block;
    width: 24px;
    height: 2px;
    background: var(--color-heading);
    transition: transform var(--transition-normal), opacity var(--transition-normal);
}

/* ─── Mobile Navigation Panel ──────────────────────────────────────── */

.nav-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.4);
    z-index: 200;
    opacity: 0;
    visibility: hidden;
    transition: opacity var(--transition-normal), visibility var(--transition-normal);
}

.nav-overlay.is-active {
    opacity: 1;
    visibility: visible;
}

.mobile-nav {
    position: fixed;
    top: 0;
    right: 0;
    bottom: 0;
    width: 300px;
    max-width: 85vw;
    background: var(--bg-white);
    z-index: 300;
    transform: translateX(100%);
    transition: transform var(--transition-normal);
    display: flex;
    flex-direction: column;
}

.mobile-nav.is-open { transform: translateX(0); }

.mobile-nav-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: var(--space-4) var(--space-6);
    border-bottom: 1px solid var(--color-border);
}

.mobile-nav-title {
    font-size: var(--text-sm);
    font-weight: var(--weight-semibold);
    color: var(--color-heading);
}

.mobile-nav-close {
    background: none;
    border: none;
    font-size: var(--text-2xl);
    color: var(--color-muted);
    cursor: pointer;
    padding: var(--space-1);
    line-height: 1;
}

.mobile-nav-body {
    flex: 1;
    overflow-y: auto;
    padding: var(--space-4) var(--space-6);
}

.mobile-nav-body ul { list-style: none; }

.mobile-nav-body a {
    display: block;
    padding: var(--space-3) 0;
    font-size: var(--text-sm);
    font-weight: var(--weight-medium);
    color: var(--color-text);
    border-bottom: 1px solid var(--color-border);
}

.mobile-nav-body a:hover { color: var(--accent); }

.mobile-nav-footer {
    padding: var(--space-4) var(--space-6);
    border-top: 1px solid var(--color-border);
}

/* ═══════════════════════════════════════════════════════════════════════
   PAGE CHROME (page.php, 404.php)
   ═══════════════════════════════════════════════════════════════════════ */

.page-header {
    padding-top: calc(var(--header-height) + var(--space-16));
    padding-bottom: var(--space-8);
}

.page-title {
    font-size: var(--text-3xl);
    font-weight: var(--weight-semibold);
    color: var(--color-heading);
    line-height: var(--leading-snug);
}

.page-content {
    padding-bottom: var(--space-16);
}

/* ═══════════════════════════════════════════════════════════════════════
   BUTTONS (shared between blocks and templates)
   ═══════════════════════════════════════════════════════════════════════ */

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: var(--space-3) var(--space-8);
    border-radius: var(--radius-sm);
    font-family: inherit;
    font-size: var(--text-sm);
    font-weight: var(--weight-semibold);
    line-height: 1;
    cursor: pointer;
    border: none;
    transition: background-color var(--transition-fast);
}

.btn-primary { background: var(--accent); color: white; }
.btn-primary:hover { background: var(--accent-hover); color: white; }
.btn-block { width: 100%; text-align: center; }

/* ─── Contact Form Overrides ───────────────────────────────────────── */

.scf__field--submit { text-align: right; }

.scf__button {
    background: var(--accent);
    font-weight: var(--weight-medium);
    font-family: var(--font-body);
    border-radius: var(--radius-sm);
}

.scf__button:hover,
.scf__button:focus {
    background: var(--accent-hover);
}

/* ═══════════════════════════════════════════════════════════════════════
   CONTACT INFO (contact page)
   ═══════════════════════════════════════════════════════════════════════ */

.contact-info {
    margin-top: var(--space-12);
    padding-top: var(--space-8);
    border-top: 1px solid var(--color-border);
}

.contact-info h3 {
    font-size: var(--text-xl);
    font-weight: var(--weight-semibold);
    color: var(--color-heading);
    margin-bottom: var(--space-4);
}

.contact-detail {
    font-size: var(--text-sm);
    color: var(--color-secondary);
    line-height: var(--leading-relaxed);
}

/* ═══════════════════════════════════════════════════════════════════════
   FOOTER
   ═══════════════════════════════════════════════════════════════════════ */

.site-footer {
    background: var(--bg-dark);
    padding: var(--space-12) var(--space-6) var(--space-6);
    color: var(--color-placeholder);
}

.footer-inner {
    max-width: var(--zone-content);
    margin: 0 auto;
}

.footer-grid {
    display: grid;
    grid-template-columns: 2fr 1fr 1fr;
    gap: var(--space-8);
    margin-bottom: var(--space-8);
}

.footer-col h4 {
    font-size: var(--text-xs);
    font-weight: var(--weight-semibold);
    color: white;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: var(--space-3);
}

.footer-col p,
.footer-col a {
    font-size: var(--text-xs);
    color: var(--color-placeholder);
    line-height: var(--leading-relaxed);
    display: block;
}

.footer-col a:hover { color: white; }

.footer-logo { margin-bottom: var(--space-3); }
.footer-logo img { height: 44px; width: auto; filter: brightness(0) invert(1); }

.footer-bottom {
    border-top: 1px solid var(--gray-700);
    padding-top: var(--space-4);
    font-size: var(--text-xs);
    color: var(--color-muted);
}

/* ═══════════════════════════════════════════════════════════════════════
   FAQ ACCORDION (JS-generated wrapper)
   JS wraps h4.faq-q + p.faq-a pairs into .faq-item divs at runtime.
   These styles only apply after JS has modified the DOM.
   ═══════════════════════════════════════════════════════════════════════ */

.faq-item {
    border-bottom: 1px solid var(--color-border);
    padding: var(--space-4) 0;
}

.faq-item:last-child { border-bottom: none; }

.faq-item .faq-q {
    font-size: var(--text-base);
    font-weight: var(--weight-medium);
    color: var(--color-heading);
    cursor: pointer;
    display: flex;
    align-items: center;
    margin: 0;
    padding: 0;
    border: none;
}

.faq-item .faq-q::before {
    content: '\203A';
    font-size: var(--text-xl);
    font-weight: var(--weight-normal);
    color: var(--color-muted);
    flex-shrink: 0;
    margin-right: var(--space-3);
    width: var(--space-3);
    transition: transform var(--transition-normal);
    display: inline-block;
}

.faq-item.is-open .faq-q::before {
    transform: rotate(90deg);
}

.faq-item .faq-a {
    font-size: var(--text-sm);
    color: var(--color-secondary);
    line-height: var(--leading-normal);
    margin-top: var(--space-2);
    padding-left: var(--space-6);
    display: none;
}

.faq-item.is-open .faq-a {
    display: block;
}

/* ═══════════════════════════════════════════════════════════════════════
   RESPONSIVE
   ═══════════════════════════════════════════════════════════════════════ */

@media (max-width: 768px) {
    .main-nav { display: none; }
    .mobile-nav-toggle { display: flex; }
    .footer-grid { grid-template-columns: 1fr; gap: var(--space-6); }
}
