/* ================================================================
   Wholeview Collaborative — site styles
   Design principles: clean, professional, accessible (WCAG AA),
   warm and approachable for families navigating ABA / special ed.
   ================================================================ */

/* ── Custom properties ──────────────────────────────────────────── */
:root {
    --color-primary:    #1D6A7A;   /* Teal — trust, calm */
    --color-primary-dk: #134d58;   /* Darker teal for hover states */
    --color-accent:     #D17A3B;   /* Warm amber — CTA buttons */
    --color-accent-dk:  #b5612a;
    --color-text:       #1a2e35;   /* Near-black */
    --color-muted:      #5a7580;
    --color-bg:         #ffffff;
    --color-bg-alt:     #f4f8f9;   /* Very light teal-grey for section bgs */
    --color-bg-dark:    #1D6A7A;
    --color-border:     #d0e3e8;
    --color-hero-overlay: rgba(13, 46, 54, 0.55);

    --font-body:   'Inter', system-ui, sans-serif;
    --font-serif:  'Source Serif 4', Georgia, serif;

    --radius:  0.5rem;
    --radius-lg: 1rem;
    --shadow:  0 2px 12px rgba(29, 106, 122, 0.10);
    --shadow-lg: 0 6px 32px rgba(29, 106, 122, 0.16);

    --nav-height: 4rem;
    --max-w: 1140px;
    --max-w-prose: 720px;
}

/* ── Reset / base ────────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
    margin: 0;
    padding-top: var(--nav-height);
    font-family: var(--font-body);
    font-size: 1rem;
    line-height: 1.7;
    color: var(--color-text);
    background: var(--color-bg);
    -webkit-font-smoothing: antialiased;
}

img { max-width: 100%; height: auto; display: block; border-radius: var(--radius); }

a {
    color: var(--color-primary);
    text-decoration: underline;
    text-underline-offset: 3px;
}
a:hover { color: var(--color-primary-dk); }

h1, h2, h3, h4, h5, h6 {
    font-family: var(--font-serif);
    font-weight: 600;
    line-height: 1.25;
    margin-top: 1.5em;
    margin-bottom: 0.5em;
    color: var(--color-text);
}
h1 { font-size: clamp(2rem, 5vw, 3rem); }
h2 { font-size: clamp(1.5rem, 3.5vw, 2.1rem); }
h3 { font-size: clamp(1.15rem, 2.5vw, 1.4rem); }

p { margin-top: 0; margin-bottom: 1rem; }

/* ── Skip link ───────────────────────────────────────────────────── */
.skip-link {
    position: absolute;
    top: -100%;
    left: 1rem;
    background: var(--color-primary);
    color: #fff;
    padding: 0.5rem 1rem;
    border-radius: 0 0 var(--radius) var(--radius);
    z-index: 9999;
    font-weight: 600;
    text-decoration: none;
    transition: top 0.2s;
}
.skip-link:focus { top: 0; }

/* ── Navigation ──────────────────────────────────────────────────── */
.site-header {
    position: fixed;
    top: 0; left: 0; right: 0;
    height: var(--nav-height);
    background: var(--color-bg);
    border-bottom: 1px solid var(--color-border);
    box-shadow: var(--shadow);
    z-index: 1000;
}

.navbar { height: 100%; }

.nav-container {
    max-width: var(--max-w);
    margin: 0 auto;
    padding: 0 1.5rem;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1.5rem;
}

.site-logo {
    text-decoration: none;
    flex-shrink: 0;
}
.logo-text {
    font-family: var(--font-serif);
    font-size: 1.15rem;
    font-weight: 600;
    color: var(--color-primary);
    letter-spacing: -0.01em;
}

.primary-nav {
    display: flex;
    list-style: none;
    margin: 0;
    padding: 0;
    gap: 0.25rem;
    align-items: center;
}

.nav-link {
    display: block;
    padding: 0.4rem 0.75rem;
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--color-text);
    text-decoration: none;
    border-radius: var(--radius);
    letter-spacing: 0.01em;
    transition: background 0.15s, color 0.15s;
}
.nav-link:hover { background: var(--color-bg-alt); color: var(--color-primary); }
.nav-link.active, .nav-link[aria-current="page"] {
    color: var(--color-primary);
    background: var(--color-bg-alt);
    font-weight: 600;
}

/* Hamburger toggle — hidden on desktop */
.nav-toggle {
    display: none;
    flex-direction: column;
    gap: 5px;
    background: none;
    border: none;
    cursor: pointer;
    padding: 0.5rem;
    border-radius: var(--radius);
}
.nav-toggle-bar {
    width: 24px;
    height: 2px;
    background: var(--color-text);
    border-radius: 2px;
    display: block;
    transition: transform 0.2s, opacity 0.2s;
}

@media (max-width: 768px) {
    .nav-toggle { display: flex; }

    .primary-nav {
        display: none;
        position: absolute;
        top: var(--nav-height);
        left: 0; right: 0;
        background: var(--color-bg);
        border-bottom: 1px solid var(--color-border);
        flex-direction: column;
        align-items: stretch;
        padding: 1rem 1.5rem;
        gap: 0.125rem;
        box-shadow: var(--shadow-lg);
    }
    .primary-nav.is-open { display: flex; }
    .nav-link { font-size: 1rem; padding: 0.6rem 0.75rem; }
}

/* ── Hero (home page) ────────────────────────────────────────────── */
.hero {
    position: relative;
    min-height: 80vh;
    display: flex;
    align-items: center;
    background-color: var(--color-primary);
    background-size: cover;
    background-position: center;
    color: #fff;
    text-align: center;
}

.hero-overlay {
    position: absolute;
    inset: 0;
    background: var(--color-hero-overlay);
}

.hero-content {
    position: relative;
    z-index: 1;
    max-width: 760px;
    margin: 0 auto;
    padding: 4rem 1.5rem;
}

.hero h1 {
    color: #fff;
    font-size: clamp(2.25rem, 6vw, 3.5rem);
    margin-top: 0;
    text-shadow: 0 1px 3px rgba(0,0,0,.25);
}

.hero .lead {
    font-size: clamp(1.05rem, 2vw, 1.25rem);
    color: rgba(255,255,255,.9);
    max-width: 600px;
    margin: 0 auto 2rem;
}

/* ── Buttons ─────────────────────────────────────────────────────── */
.btn {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.7rem 1.5rem;
    border-radius: var(--radius);
    font-size: 0.95rem;
    font-weight: 600;
    text-decoration: none;
    cursor: pointer;
    border: 2px solid transparent;
    transition: background 0.15s, color 0.15s, border-color 0.15s, transform 0.1s;
}
.btn:focus-visible {
    outline: 3px solid var(--color-accent);
    outline-offset: 3px;
}
.btn:active { transform: scale(0.98); }

.btn-primary {
    background: var(--color-accent);
    color: #fff;
    border-color: var(--color-accent);
}
.btn-primary:hover {
    background: var(--color-accent-dk);
    border-color: var(--color-accent-dk);
    color: #fff;
}

.btn-outline {
    background: transparent;
    color: var(--color-primary);
    border-color: var(--color-primary);
}
.btn-outline:hover {
    background: var(--color-primary);
    color: #fff;
}

.btn-outline-white {
    background: transparent;
    color: #fff;
    border-color: rgba(255,255,255,.7);
}
.btn-outline-white:hover {
    background: rgba(255,255,255,.15);
    border-color: #fff;
    color: #fff;
}

/* ── Section utility ─────────────────────────────────────────────── */
.section { padding: 4rem 0; }
.section-alt { background: var(--color-bg-alt); }

.container {
    max-width: var(--max-w);
    margin: 0 auto;
    padding: 0 1.5rem;
}

.prose {
    max-width: var(--max-w-prose);
    margin: 0 auto;
}

/* ── Page header (non-home pages) ────────────────────────────────── */
.page-header {
    background: var(--color-bg-dark);
    color: #fff;
    padding: 4rem 0 3rem;
    position: relative;
    background-size: cover;
    background-position: center;
}
.page-header-overlay {
    position: absolute;
    inset: 0;
    background: var(--color-hero-overlay);
}
.page-header-content {
    position: relative;
    z-index: 1;
    text-align: center;
}
.page-header h1 {
    color: #fff;
    margin-top: 0;
    text-shadow: 0 1px 3px rgba(0,0,0,.3);
}
.page-header .lead {
    color: rgba(255,255,255,.88);
    font-size: 1.15rem;
    max-width: 600px;
    margin: 0 auto;
}

/* ── Content blocks ──────────────────────────────────────────────── */
.block {
    padding: 0 0 2rem;
}
.block img { border-radius: var(--radius); }

/* ── Archive listing ─────────────────────────────────────────────── */
.archive-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 2rem;
    margin-top: 2rem;
}

.post-card {
    border: 1px solid var(--color-border);
    border-radius: var(--radius-lg);
    overflow: hidden;
    background: var(--color-bg);
    box-shadow: var(--shadow);
    display: flex;
    flex-direction: column;
    transition: box-shadow 0.2s, transform 0.2s;
}
.post-card:hover {
    box-shadow: var(--shadow-lg);
    transform: translateY(-2px);
}

.post-card-img img {
    width: 100%;
    height: 200px;
    object-fit: cover;
    border-radius: 0;
}

.post-card-body {
    padding: 1.25rem 1.5rem;
    flex: 1;
    display: flex;
    flex-direction: column;
}

.post-card-body h3 {
    font-size: 1.15rem;
    margin-top: 0;
    margin-bottom: 0.5rem;
}
.post-card-body h3 a { text-decoration: none; color: var(--color-text); }
.post-card-body h3 a:hover { color: var(--color-primary); }

.post-meta {
    font-size: 0.8rem;
    color: var(--color-muted);
    margin-bottom: 0.75rem;
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    align-items: center;
}
.post-meta a { color: var(--color-muted); }

.post-card-excerpt {
    flex: 1;
    font-size: 0.95rem;
    color: var(--color-muted);
    margin-bottom: 1rem;
}

/* ── Pagination ──────────────────────────────────────────────────── */
.pagination {
    display: flex;
    justify-content: center;
    gap: 0.25rem;
    list-style: none;
    padding: 0;
    margin: 2rem 0 0;
}
.page-item .page-link {
    display: flex;
    align-items: center;
    justify-content: center;
    min-width: 2.25rem;
    height: 2.25rem;
    padding: 0 0.5rem;
    border-radius: var(--radius);
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--color-primary);
    text-decoration: none;
    border: 1px solid var(--color-border);
    transition: background 0.15s, color 0.15s;
}
.page-item .page-link:hover { background: var(--color-bg-alt); }
.page-item.active .page-link {
    background: var(--color-primary);
    border-color: var(--color-primary);
    color: #fff;
}

/* ── Post single ─────────────────────────────────────────────────── */
.post-content {
    padding: 3rem 0;
}
.post-content .container { max-width: var(--max-w-prose); }

/* ── Footer ──────────────────────────────────────────────────────── */
.site-footer {
    background: var(--color-text);
    color: rgba(255,255,255,.75);
    padding: 3rem 0 2rem;
    margin-top: 4rem;
}

.footer-container {
    max-width: var(--max-w);
    margin: 0 auto;
    padding: 0 1.5rem;
    display: grid;
    grid-template-columns: 1fr auto;
    gap: 2rem 3rem;
    align-items: start;
}

.footer-brand strong {
    display: block;
    font-family: var(--font-serif);
    font-size: 1.05rem;
    color: #fff;
    margin-bottom: 0.35rem;
}
.footer-brand p { font-size: 0.875rem; margin: 0; }

.footer-nav ul {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem 1.25rem;
}
.footer-nav a {
    color: rgba(255,255,255,.7);
    font-size: 0.875rem;
    text-decoration: none;
}
.footer-nav a:hover { color: #fff; }

.footer-copy {
    grid-column: 1 / -1;
    font-size: 0.8rem;
    color: rgba(255,255,255,.45);
    margin: 0;
    padding-top: 2rem;
    border-top: 1px solid rgba(255,255,255,.1);
}

@media (max-width: 600px) {
    .footer-container { grid-template-columns: 1fr; }
}

/* ── HeroBlock (reusable block in pages) ─────────────────────────── */
.block-hero {
    padding: 0;
    margin-bottom: 2rem;
}

.block-hero .hero-block-inner {
    position: relative;
    min-height: 50vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--color-primary);
    background-size: cover;
    background-position: center;
    color: #fff;
    text-align: center;
    border-radius: var(--radius-lg);
    overflow: hidden;
}

.block-hero .hero-block-overlay {
    position: absolute;
    inset: 0;
    background: rgba(13, 46, 54, 0.5);
}

.block-hero .hero-block-content {
    position: relative;
    z-index: 1;
    padding: 3rem 2rem;
    max-width: 680px;
    margin: 0 auto;
}

.block-hero h2 { color: #fff; margin-top: 0; }
.block-hero p { color: rgba(255,255,255,.88); margin-bottom: 1.5rem; }

/* ── Access denied ───────────────────────────────────────────────── */
.access-denied {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 60vh;
    text-align: center;
    padding: 2rem 1.5rem;
}

/* ── Utility classes ─────────────────────────────────────────────── */
.text-center { text-align: center; }
.text-muted { color: var(--color-muted); }
.lead { font-size: 1.2rem; line-height: 1.6; }
.mt-0 { margin-top: 0; }
.mb-0 { margin-bottom: 0; }
.mt-1 { margin-top: 0.5rem; }
.mb-1 { margin-bottom: 0.5rem; }
.mt-2 { margin-top: 1rem; }
.mb-2 { margin-bottom: 1rem; }
.mt-3 { margin-top: 1.5rem; }
.mb-3 { margin-bottom: 1.5rem; }
.mt-4 { margin-top: 2rem; }
.mb-4 { margin-bottom: 2rem; }

.row { display: flex; flex-wrap: wrap; gap: 1.5rem; }
.col-md-4 { flex: 1 1 260px; }
.col-md-6 { flex: 1 1 45%; }
.col-md-12 { flex: 1 1 100%; }

.g-4 { gap: 2rem; }
