/* ============================================================
   Airmatter Theme — main.css
   Base styles, layout, header, footer, utilities
   ============================================================ */

/* ── CSS Custom Properties ─────────────────────────────────── */
:root {
    --brand-color: #0057A8;       /* overridden per-brand via wp_head injection */
    --brand-color-dark: color-mix(in srgb, var(--brand-color) 75%, black);
    --brand-color-light: color-mix(in srgb, var(--brand-color) 15%, white);

    --color-text:       #1a1a2e;
    --color-text-muted: #6b7280;
    --color-bg:         #ffffff;
    --color-bg-alt:     #f8f9fa;
    --color-border:     #e5e7eb;

    --font-display: 'Barlow Condensed', sans-serif;
    --font-body:    'Barlow', sans-serif;

    --radius:    8px;
    --radius-lg: 16px;

    --shadow-sm: 0 1px 3px rgba(0,0,0,.08);
    --shadow-md: 0 4px 16px rgba(0,0,0,.12);
    --shadow-lg: 0 8px 32px rgba(0,0,0,.16);

    --container-max: 1280px;
    --container-pad: clamp(1rem, 4vw, 2.5rem);

    --header-height: 72px;
    --transition: 200ms ease;
}

/* ── Google Fonts ───────────────────────────────────────────── */
@import url('https://fonts.googleapis.com/css2?family=Barlow:wght@400;500;600&family=Barlow+Condensed:wght@500;600;700&display=swap');

/* ── Reset / Base ───────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html { scroll-behavior: smooth; }

body {
    font-family: var(--font-body);
    font-size: 1rem;
    line-height: 1.6;
    color: var(--color-text);
    background: var(--color-bg);
    -webkit-font-smoothing: antialiased;
}

img, video { max-width: 100%; display: block; }

a { color: inherit; text-decoration: none; }
a:hover { color: var(--brand-color); }

ul { list-style: none; }

h1, h2, h3, h4, h5, h6 {
    font-family: var(--font-display);
    font-weight: 700;
    line-height: 1.2;
}

/* ── Layout Utilities ───────────────────────────────────────── */
.am-container {
    width: 100%;
    max-width: var(--container-max);
    margin-inline: auto;
    padding-inline: var(--container-pad);
}

.am-container--narrow {
    max-width: 860px;
}

#main-content {
    min-height: calc(100vh - var(--header-height) - 200px);
    padding-top: var(--header-height); /* offset for fixed header */
}

/* ── Header ─────────────────────────────────────────────────── */
.am-header {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 100;
    height: var(--header-height);
    background: #fff;
    border-bottom: 1px solid var(--color-border);
    box-shadow: var(--shadow-sm);
}

.am-header__inner {
    display: flex;
    align-items: center;
    gap: 2rem;
    height: 100%;
    max-width: var(--container-max);
    margin-inline: auto;
    padding-inline: var(--container-pad);
}

.am-header__logo {
    flex-shrink: 0;
    font-family: var(--font-display);
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--color-text);
    letter-spacing: -0.02em;
}

.am-header__logo img { height: 40px; width: auto; }

/* Primary nav */
.am-header__nav { margin-left: auto; }

.am-nav__list {
    display: flex;
    align-items: center;
    gap: 0.25rem;
}

.am-nav__list li a {
    display: block;
    padding: 0.4rem 0.75rem;
    font-size: 0.9rem;
    font-weight: 500;
    border-radius: var(--radius);
    transition: background var(--transition), color var(--transition);
}

.am-nav__list li a:hover,
.am-nav__list li.current-menu-item a {
    background: var(--brand-color-light);
    color: var(--brand-color);
}

/* Brands strip in header */
.am-brands__list {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.am-brands__link {
    display: flex;
    align-items: center;
    opacity: 0.7;
    transition: opacity var(--transition);
}

.am-brands__link:hover { opacity: 1; }

.am-brands__logo {
    height: 28px;
    width: auto;
    object-fit: contain;
}

/* Mobile toggle */
.am-header__toggle {
    display: none;
    flex-direction: column;
    justify-content: center;
    gap: 5px;
    width: 36px;
    height: 36px;
    background: none;
    border: none;
    cursor: pointer;
    margin-left: auto;
    padding: 4px;
}

.am-toggle__bar {
    display: block;
    height: 2px;
    width: 100%;
    background: var(--color-text);
    border-radius: 2px;
    transition: transform var(--transition), opacity var(--transition);
}

/* Mobile nav open state */
.am-header__toggle[aria-expanded="true"] .am-toggle__bar:nth-child(1) {
    transform: translateY(7px) rotate(45deg);
}
.am-header__toggle[aria-expanded="true"] .am-toggle__bar:nth-child(2) {
    opacity: 0;
}
.am-header__toggle[aria-expanded="true"] .am-toggle__bar:nth-child(3) {
    transform: translateY(-7px) rotate(-45deg);
}

/* Mobile menu */
.am-mobile-menu {
    position: absolute;
    top: var(--header-height);
    left: 0;
    right: 0;
    background: #fff;
    border-bottom: 1px solid var(--color-border);
    padding: 1rem var(--container-pad);
    box-shadow: var(--shadow-md);
}

.am-mobile-menu[hidden] { display: none; }

.am-mobile-menu__list {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.am-mobile-menu__list li a {
    display: block;
    padding: 0.6rem 0.75rem;
    font-size: 1rem;
    font-weight: 500;
    border-radius: var(--radius);
}

.am-mobile-menu__list li a:hover {
    background: var(--brand-color-light);
    color: var(--brand-color);
}

/* ── Footer ─────────────────────────────────────────────────── */
.am-footer {
    background: var(--color-text);
    color: rgba(255,255,255,0.8);
    padding-block: 3rem 1.5rem;
    margin-top: 4rem;
}

.am-footer__inner {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr;
    gap: 2rem;
    max-width: var(--container-max);
    margin-inline: auto;
    padding-inline: var(--container-pad);
}

.am-footer__heading {
    font-size: 0.75rem;
    font-weight: 600;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: rgba(255,255,255,0.4);
    margin-bottom: 1rem;
}

.am-footer__brand-list,
.am-footer__nav-list {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.am-footer__brand-list a,
.am-footer__nav-list a {
    font-size: 0.9rem;
    transition: color var(--transition);
}

.am-footer__brand-list a:hover,
.am-footer__nav-list a:hover {
    color: #fff;
}

.am-footer__copy {
    grid-column: 1 / -1;
    border-top: 1px solid rgba(255,255,255,0.1);
    padding-top: 1.5rem;
    font-size: 0.8rem;
    color: rgba(255,255,255,0.4);
    text-align: center;
}

/* ── Responsive ─────────────────────────────────────────────── */
@media (max-width: 768px) {
    .am-header__nav,
    .am-header__brands { display: none; }

    .am-header__toggle { display: flex; }

    .am-footer__inner {
        grid-template-columns: 1fr 1fr;
    }
}

@media (max-width: 480px) {
    .am-footer__inner {
        grid-template-columns: 1fr;
    }
}