/* ═══════════════════════════════════════════════════════════
   Butler County CPR — Style System
   Aesthetic: Clean medical authority meets Apple minimalism
   Fonts: Fraunces (display), DM Sans (body)
   ═══════════════════════════════════════════════════════════ */

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

:root {
    /* Palette — Brand Magenta / Hot Pink */
    --brand-500: #FF1493;
    --brand-600: #E0117F;
    --brand-700: #C00F6B;
    --brand-50:  #FFF0F7;
    --brand-100: #FFD6EB;

    /* Legacy aliases for backward compat */
    --red-700: var(--brand-500);
    --red-800: var(--brand-600);
    --red-900: var(--brand-700);
    --red-50:  var(--brand-50);
    --red-100: var(--brand-100);

    --gray-50:  #F9FAFB;
    --gray-100: #F3F4F6;
    --gray-200: #E5E7EB;
    --gray-300: #D1D5DB;
    --gray-400: #9CA3AF;
    --gray-500: #6B7280;
    --gray-600: #4B5563;
    --gray-700: #374151;
    --gray-800: #1F2937;
    --gray-900: #111827;

    --white: #FFFFFF;
    --black: #0A0A0A;

    /* Semantic */
    --color-primary:   var(--brand-500);
    --color-primary-h: var(--brand-600);
    --color-bg:        var(--white);
    --color-surface:   var(--gray-50);
    --color-text:      var(--gray-800);
    --color-text-soft: var(--gray-500);
    --color-border:    var(--gray-200);

    /* Typography */
    --font-display: 'Fraunces', Georgia, serif;
    --font-body:    'DM Sans', -apple-system, BlinkMacSystemFont, sans-serif;

    --text-xs:   0.75rem;
    --text-sm:   0.875rem;
    --text-base: 1rem;
    --text-lg:   1.125rem;
    --text-xl:   1.25rem;
    --text-2xl:  1.5rem;
    --text-3xl:  1.875rem;
    --text-4xl:  2.25rem;
    --text-5xl:  3rem;
    --text-6xl:  3.75rem;

    --leading-tight:  1.2;
    --leading-normal: 1.6;
    --leading-loose:  1.8;

    /* Spacing */
    --space-1:  0.25rem;
    --space-2:  0.5rem;
    --space-3:  0.75rem;
    --space-4:  1rem;
    --space-5:  1.25rem;
    --space-6:  1.5rem;
    --space-8:  2rem;
    --space-10: 2.5rem;
    --space-12: 3rem;
    --space-16: 4rem;
    --space-20: 5rem;
    --space-24: 6rem;

    /* Layout */
    --container-max: 1120px;
    --container-pad: var(--space-6);
    --header-height: 72px;

    /* Effects */
    --radius-sm:  6px;
    --radius-md:  10px;
    --radius-lg:  16px;
    --radius-xl:  24px;
    --shadow-sm:  0 1px 2px rgba(0,0,0,0.05);
    --shadow-md:  0 4px 12px rgba(0,0,0,0.08);
    --shadow-lg:  0 12px 32px rgba(0,0,0,0.1);
    --shadow-xl:  0 20px 48px rgba(0,0,0,0.12);
    --transition: 0.2s ease;
    --transition-slow: 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}

/* ─── Base ─────────────────────────────────────────────── */
html {
    scroll-behavior: smooth;
    scroll-padding-top: calc(var(--header-height) + var(--space-8));
    -webkit-text-size-adjust: 100%;
}

body {
    font-family: var(--font-body);
    font-size: var(--text-base);
    line-height: var(--leading-normal);
    color: var(--color-text);
    background: var(--color-bg);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

img, svg {
    display: block;
    max-width: 100%;
    height: auto;
}

a {
    color: var(--color-primary);
    text-decoration: none;
    transition: color var(--transition);
}
a:hover  { color: var(--color-primary-h); }

/* ─── Skip Link (Accessibility) ────────────────────────── */
.skip-link {
    position: absolute;
    top: -100%;
    left: var(--space-4);
    background: var(--color-primary);
    color: var(--white);
    padding: var(--space-3) var(--space-5);
    border-radius: var(--radius-sm);
    font-weight: 600;
    z-index: 1000;
    transition: top var(--transition);
}
.skip-link:focus {
    top: var(--space-4);
    outline: 3px solid var(--red-900);
    outline-offset: 2px;
}

/* ─── Focus States ─────────────────────────────────────── */
:focus-visible {
    outline: 2px solid var(--color-primary);
    outline-offset: 3px;
    border-radius: 2px;
}

/* ─── Container ────────────────────────────────────────── */
.container {
    width: 100%;
    max-width: var(--container-max);
    margin: 0 auto;
    padding-left: var(--container-pad);
    padding-right: var(--container-pad);
}

.container--narrow {
    max-width: 780px;
}

/* ─── Typography ───────────────────────────────────────── */
h1, h2, h3, h4 {
    font-family: var(--font-display);
    font-weight: 600;
    line-height: var(--leading-tight);
    color: var(--gray-900);
}

h1 { font-size: var(--text-4xl); letter-spacing: -0.02em; }
h2 { font-size: var(--text-3xl); letter-spacing: -0.015em; }
h3 { font-size: var(--text-2xl); }
h4 { font-size: var(--text-xl); }

@media (min-width: 768px) {
    h1 { font-size: var(--text-5xl); }
    h2 { font-size: var(--text-4xl); }
}

@media (min-width: 1024px) {
    h1 { font-size: var(--text-6xl); }
}

.eyebrow {
    font-family: var(--font-body);
    font-size: var(--text-sm);
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--color-primary);
    margin-bottom: var(--space-3);
    display: block;
}

.lead {
    font-size: var(--text-lg);
    color: var(--color-text-soft);
    line-height: var(--leading-loose);
    max-width: 600px;
}

/* ─── Buttons ──────────────────────────────────────────── */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: var(--space-2);
    font-family: var(--font-body);
    font-size: var(--text-sm);
    font-weight: 600;
    letter-spacing: 0.01em;
    padding: var(--space-3) var(--space-6);
    border-radius: var(--radius-md);
    border: none;
    cursor: pointer;
    transition: all var(--transition);
    text-decoration: none;
    line-height: 1.4;
    white-space: nowrap;
}

.btn-primary {
    background: var(--color-primary);
    color: var(--white);
    box-shadow: 0 1px 3px rgba(255,20,147,0.3);
}
.btn-primary:hover {
    background: var(--color-primary-h);
    color: var(--white);
    box-shadow: 0 4px 12px rgba(255,20,147,0.35);
    transform: translateY(-1px);
}

.btn-secondary {
    background: var(--white);
    color: var(--gray-800);
    border: 1.5px solid var(--gray-300);
}
.btn-secondary:hover {
    background: var(--gray-50);
    border-color: var(--gray-400);
    color: var(--gray-900);
}

.btn-lg {
    font-size: var(--text-base);
    padding: var(--space-4) var(--space-8);
    border-radius: var(--radius-lg);
}

/* ─── Sticky Header ────────────────────────────────────── */
.site-header {
    position: sticky;
    top: 0;
    z-index: 100;
    background: rgba(255,255,255,0.88);
    backdrop-filter: blur(16px) saturate(180%);
    -webkit-backdrop-filter: blur(16px) saturate(180%);
    border-bottom: 1px solid var(--color-border);
    height: var(--header-height);
}

.header-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 100%;
    gap: var(--space-6);
}

/* Logo */
.logo {
    display: flex;
    align-items: center;
    gap: var(--space-3);
    text-decoration: none;
    flex-shrink: 0;
}
.logo:hover { opacity: 0.85; }
.logo-badge {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    object-fit: contain;
    flex-shrink: 0;
}
.logo-wordmark {
    height: 24px;
    width: auto;
    display: none;
}
@media (min-width: 480px) {
    .logo-wordmark { display: block; }
}

/* Nav (sits outside header in DOM) */
.main-nav { display: none; }

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

.nav-list a {
    display: block;
    padding: var(--space-2) var(--space-3);
    color: var(--gray-600);
    font-size: var(--text-sm);
    font-weight: 500;
    border-radius: var(--radius-sm);
    transition: all var(--transition);
    white-space: nowrap;
}
.nav-list a:hover,
.nav-list a[aria-current="page"] {
    color: var(--gray-900);
    background: var(--gray-100);
}

.header-cta { display: none; }

/* Hamburger */
.nav-toggle {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 44px;
    height: 44px;
    background: none;
    border: none;
    cursor: pointer;
    border-radius: var(--radius-sm);
}
.nav-toggle:hover { background: var(--gray-100); }

.hamburger,
.hamburger::before,
.hamburger::after {
    display: block;
    width: 20px;
    height: 2px;
    background: var(--gray-700);
    border-radius: 2px;
    transition: all 0.25s ease;
}
.hamburger { position: relative; }
.hamburger::before,
.hamburger::after {
    content: '';
    position: absolute;
    left: 0;
}
.hamburger::before { top: -6px; }
.hamburger::after  { top: 6px; }

/* Open state */
.nav-toggle[aria-expanded="true"] .hamburger {
    background: transparent;
}
.nav-toggle[aria-expanded="true"] .hamburger::before {
    top: 0;
    transform: rotate(45deg);
}
.nav-toggle[aria-expanded="true"] .hamburger::after {
    top: 0;
    transform: rotate(-45deg);
}

/* Mobile nav overlay */
.main-nav.is-open {
    display: flex;
    flex-direction: column;
    position: fixed;
    top: var(--header-height);
    left: 0;
    right: 0;
    bottom: 0;
    background: #FFFFFF;
    padding: var(--space-4) var(--space-6) var(--space-6);
    z-index: 999;
    animation: fadeIn 0.2s ease;
    overflow-y: auto;
    border-top: 1px solid var(--gray-200);
}

.main-nav.is-open .nav-list {
    flex-direction: column;
    align-items: stretch;
    gap: 8px;
}

.main-nav.is-open .nav-list a {
    font-size: var(--text-lg);
    padding: 16px 20px;
    color: var(--gray-800);
    background: var(--gray-50);
    border: 1px solid var(--gray-200);
    border-radius: 12px;
    font-weight: 600;
    text-align: left;
}
.main-nav.is-open .nav-list a:hover,
.main-nav.is-open .nav-list a[aria-current="page"] {
    background: var(--brand-50);
    border-color: var(--brand-500);
    color: var(--brand-600);
}

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

/* Desktop */
@media (min-width: 768px) {
    .main-nav {
        display: flex;
        position: fixed;
        top: 0;
        left: calc(50% + 40px);
        transform: translateX(-50%);
        height: var(--header-height);
        align-items: center;
        z-index: 101;
        pointer-events: auto;
    }
    .header-cta { display: inline-flex; }
    .nav-toggle { display: none; }
}

/* ─── Sections ─────────────────────────────────────────── */
.section {
    padding: var(--space-16) 0;
}

.section--lg {
    padding: var(--space-20) 0;
}

.section--surface {
    background: var(--color-surface);
}

.section-header {
    text-align: center;
    margin-bottom: var(--space-12);
}

.section-header .lead {
    margin: var(--space-4) auto 0;
}

/* ─── Hero ─────────────────────────────────────────────── */
.hero {
    padding: var(--space-20) 0 var(--space-16);
    text-align: center;
    position: relative;
    overflow: hidden;
}

.hero::before {
    content: '';
    position: absolute;
    top: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 800px;
    height: 800px;
    background: radial-gradient(circle, rgba(185,28,28,0.06) 0%, transparent 70%);
    pointer-events: none;
    z-index: 0;
}

.hero > * { position: relative; z-index: 1; }

.hero h1 {
    margin-bottom: var(--space-6);
}

.hero .lead {
    margin: 0 auto var(--space-8);
    max-width: 560px;
    font-size: var(--text-lg);
}

.hero-actions {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: var(--space-4);
    flex-wrap: wrap;
}

@media (min-width: 768px) {
    .hero {
        padding: var(--space-24) 0 var(--space-20);
    }
    .hero .lead {
        font-size: var(--text-xl);
    }
}

/* Hero with background image */
.hero--image {
    position: relative;
    min-height: 480px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: var(--space-16) 0;
}
.hero--image::before { display: none; }
.hero-bg {
    position: absolute; inset: 0;
    width: 100%; height: 100%;
    object-fit: cover; object-position: center;
    z-index: 0;
}
.hero-overlay {
    position: absolute; inset: 0;
    background: rgba(0,0,0,0.55);
    z-index: 1;
}
.hero-content { position: relative; z-index: 2; }
.eyebrow--light { color: rgba(255,255,255,0.8); }
.hero--image h1 { color: #fff; }
.lead--light { color: rgba(255,255,255,0.9); }
.btn-white {
    background: rgba(255,255,255,0.15);
    color: #fff;
    border: 1.5px solid rgba(255,255,255,0.5);
    backdrop-filter: blur(4px);
}
.btn-white:hover {
    background: rgba(255,255,255,0.25);
    color: #fff;
}

/* Pillar images */
.pillar-img {
    width: 100%;
    aspect-ratio: 3 / 2;
    border-radius: var(--radius-lg);
    overflow: hidden;
    margin-bottom: var(--space-5);
}
.pillar-img img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

/* Image break section */
.section-image-break {
    width: 100%;
    aspect-ratio: 21 / 9;
    max-height: 400px;
    overflow: hidden;
}
.section-image-break img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

/* ─── Cards ────────────────────────────────────────────── */
.card-grid {
    display: grid;
    gap: var(--space-6);
    grid-template-columns: 1fr;
}

@media (min-width: 640px) {
    .card-grid { grid-template-columns: repeat(2, 1fr); }
}

@media (min-width: 900px) {
    .card-grid { grid-template-columns: repeat(3, 1fr); }
}

.card {
    background: var(--white);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-lg);
    padding: var(--space-8);
    transition: all var(--transition-slow);
    display: flex;
    flex-direction: column;
}

.card:hover {
    box-shadow: var(--shadow-lg);
    border-color: transparent;
    transform: translateY(-4px);
}

.card-icon {
    width: 48px;
    height: 48px;
    border-radius: var(--radius-md);
    background: var(--red-50);
    color: var(--color-primary);
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: var(--space-5);
    flex-shrink: 0;
}

.card h3 {
    font-size: var(--text-xl);
    margin-bottom: var(--space-3);
}

.card p {
    color: var(--color-text-soft);
    font-size: var(--text-sm);
    line-height: var(--leading-loose);
    flex: 1;
}

.card-meta {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-top: var(--space-6);
    padding-top: var(--space-4);
    border-top: 1px solid var(--gray-100);
    font-size: var(--text-sm);
}

.card-meta .price {
    font-weight: 700;
    color: var(--gray-900);
}

/* ─── Class Listing Card ───────────────────────────────── */
.class-card {
    background: var(--white);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-lg);
    overflow: hidden;
    transition: all var(--transition-slow);
}

.class-card:hover {
    box-shadow: var(--shadow-lg);
    border-color: transparent;
}

.class-card-body {
    padding: var(--space-6) var(--space-8);
}

.class-card-date {
    display: inline-flex;
    align-items: center;
    gap: var(--space-2);
    background: var(--red-50);
    color: var(--color-primary);
    font-size: var(--text-sm);
    font-weight: 600;
    padding: var(--space-2) var(--space-3);
    border-radius: var(--radius-sm);
    margin-bottom: var(--space-4);
}

.class-card h3 {
    font-size: var(--text-xl);
    margin-bottom: var(--space-2);
}

.class-card p {
    color: var(--color-text-soft);
    font-size: var(--text-sm);
    line-height: var(--leading-loose);
}

.class-card-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: var(--space-4) var(--space-8);
    background: var(--gray-50);
    border-top: 1px solid var(--gray-100);
}

.class-card-footer .price {
    font-weight: 700;
    font-size: var(--text-lg);
    color: var(--gray-900);
}

/* ─── Value Pillars ────────────────────────────────────── */
.pillars {
    display: grid;
    gap: var(--space-8);
    grid-template-columns: 1fr;
    text-align: center;
}

@media (min-width: 640px) {
    .pillars { grid-template-columns: repeat(3, 1fr); }
}

.pillar-icon {
    width: 56px;
    height: 56px;
    margin: 0 auto var(--space-4);
    border-radius: 50%;
    background: var(--red-50);
    color: var(--color-primary);
    display: flex;
    align-items: center;
    justify-content: center;
}

.pillar h3 {
    font-size: var(--text-lg);
    margin-bottom: var(--space-2);
}

.pillar p {
    font-size: var(--text-sm);
    color: var(--color-text-soft);
}

/* ─── CTA Banner ───────────────────────────────────────── */
.cta-banner {
    background: var(--gray-900);
    border-radius: var(--radius-xl);
    padding: var(--space-12) var(--space-8);
    text-align: center;
    color: var(--white);
}

.cta-banner h2 {
    color: var(--white);
    margin-bottom: var(--space-4);
}

.cta-banner p {
    color: var(--gray-400);
    max-width: 500px;
    margin: 0 auto var(--space-8);
}

.cta-banner .btn-primary {
    background: var(--white);
    color: var(--gray-900);
    box-shadow: none;
}
.cta-banner .btn-primary:hover {
    background: var(--gray-100);
}

/* ─── Prose (general content pages) ────────────────────── */
.prose {
    max-width: 720px;
    margin: 0 auto;
}

.prose h2 {
    font-size: var(--text-2xl);
    margin: var(--space-10) 0 var(--space-4);
}

.prose h3 {
    font-size: var(--text-xl);
    margin: var(--space-8) 0 var(--space-3);
}

.prose p {
    margin-bottom: var(--space-4);
    line-height: var(--leading-loose);
}

.prose ul, .prose ol {
    margin: 0 0 var(--space-4) var(--space-6);
}

.prose li {
    margin-bottom: var(--space-2);
    line-height: var(--leading-loose);
}

.prose a {
    text-decoration: underline;
    text-decoration-thickness: 1px;
    text-underline-offset: 2px;
}

/* ─── FAQ Accordion ────────────────────────────────────── */
.faq-list {
    max-width: 720px;
    margin: 0 auto;
}

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

.faq-item summary {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: var(--space-5) 0;
    cursor: pointer;
    font-weight: 600;
    font-size: var(--text-lg);
    color: var(--gray-900);
    list-style: none;
    transition: color var(--transition);
}

.faq-item summary::-webkit-details-marker { display: none; }

.faq-item summary::after {
    content: '+';
    font-size: var(--text-xl);
    font-weight: 300;
    color: var(--gray-400);
    transition: transform 0.25s ease;
    flex-shrink: 0;
    margin-left: var(--space-4);
}

.faq-item[open] summary::after {
    content: '−';
}

.faq-item summary:hover { color: var(--color-primary); }

.faq-answer {
    padding: 0 0 var(--space-5);
    color: var(--color-text-soft);
    line-height: var(--leading-loose);
}

/* ─── Forms ────────────────────────────────────────────── */
.form-group {
    margin-bottom: var(--space-5);
}

.form-label {
    display: block;
    font-size: var(--text-sm);
    font-weight: 600;
    color: var(--gray-700);
    margin-bottom: var(--space-2);
}

.form-input,
.form-textarea,
.form-select {
    width: 100%;
    padding: var(--space-3) var(--space-4);
    font-family: var(--font-body);
    font-size: var(--text-base);
    color: var(--gray-800);
    background: var(--white);
    border: 1.5px solid var(--gray-300);
    border-radius: var(--radius-md);
    transition: border-color var(--transition), box-shadow var(--transition);
}

.form-input:focus,
.form-textarea:focus,
.form-select:focus {
    outline: none;
    border-color: var(--color-primary);
    box-shadow: 0 0 0 3px rgba(255,20,147,0.12);
}

.form-textarea {
    min-height: 140px;
    resize: vertical;
}

/* ─── Alerts ───────────────────────────────────────────── */
.alert {
    padding: var(--space-4) var(--space-5);
    border-radius: var(--radius-md);
    font-size: var(--text-sm);
    font-weight: 500;
    margin-bottom: var(--space-6);
}

.alert--success {
    background: #ECFDF5;
    color: #065F46;
    border: 1px solid #A7F3D0;
}

.alert--error {
    background: var(--red-50);
    color: var(--red-800);
    border: 1px solid var(--red-100);
}

/* ─── Page Header ──────────────────────────────────────── */
.page-header {
    padding: var(--space-12) 0 var(--space-8);
    text-align: center;
}

.page-header h1 {
    font-size: var(--text-3xl);
    margin-bottom: var(--space-3);
}

@media (min-width: 768px) {
    .page-header h1 { font-size: var(--text-4xl); }
    .page-header { padding: var(--space-16) 0 var(--space-10); }
}

.page-header .lead {
    margin: 0 auto;
}

/* ─── Footer ───────────────────────────────────────────── */
.site-footer {
    background: var(--gray-900);
    color: var(--gray-400);
    padding: var(--space-16) 0 var(--space-8);
}

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

@media (min-width: 640px) {
    .footer-grid { grid-template-columns: 2fr 1fr 1fr; }
}

.footer-logo {
    font-family: var(--font-body);
    font-size: var(--text-lg);
    color: var(--white);
}

.footer-tagline {
    font-size: var(--text-sm);
    margin-top: var(--space-2);
}

.footer-contact {
    margin-top: var(--space-4);
    font-size: var(--text-sm);
    line-height: 1.8;
}

.footer-contact a {
    color: var(--gray-400);
}
.footer-contact a:hover { color: var(--white); }

.footer-heading {
    font-weight: 600;
    color: var(--white);
    font-size: var(--text-sm);
    text-transform: uppercase;
    letter-spacing: 0.06em;
    margin-bottom: var(--space-4);
}

.footer-links ul {
    list-style: none;
}

.footer-links li {
    margin-bottom: var(--space-3);
}

.footer-links a {
    color: var(--gray-400);
    font-size: var(--text-sm);
    transition: color var(--transition);
}
.footer-links a:hover { color: var(--white); }

.footer-bottom {
    padding-top: var(--space-8);
    border-top: 1px solid rgba(255,255,255,0.1);
    font-size: var(--text-xs);
    text-align: center;
}

/* ─── Utility ──────────────────────────────────────────── */
.text-center { text-align: center; }
.mt-4  { margin-top: var(--space-4); }
.mt-8  { margin-top: var(--space-8); }
.mb-4  { margin-bottom: var(--space-4); }
.mb-8  { margin-bottom: var(--space-8); }
.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0,0,0,0);
    white-space: nowrap;
    border-width: 0;
}
