/**
 * IB Math Master — Shared Components
 * Reusable across all pages
 *
 * ASTRA OWNS: body, h1-h6, links, primary buttons, container width
 * This file: ib-* scoped classes only, no bare element selectors
 */


/* =========================================
   SKIP LINK
   ========================================= */

.ib-skip-link {
    background: var(--ib-navy);
    border-radius: 0 0 var(--ib-radius-xs) var(--ib-radius-xs);
    color: var(--ib-white);
    font-weight: 600;
    left: 16px;
    padding: 12px 24px;
    position: absolute;
    text-decoration: none;
    top: -50px;
    transition: top var(--ib-transition-fast);
    z-index: 1000;
}

.ib-skip-link:focus {
    top: 0;
}


/* =========================================
   FOCUS STYLES — scoped to ib-* components
   ========================================= */

.ib-btn:focus-visible,
.ib-btn-primary:focus-visible,
.ib-btn-secondary:focus-visible,
.ib-btn-white:focus-visible,
.ib-btn-outline-white:focus-visible,
.ib-eyebrow:focus-visible,
.ib-faq-question:focus-visible,
.ib-skip-link:focus-visible {
    outline: 3px solid var(--ib-accent);
    outline-offset: 2px;
}


/* =========================================
   CONTAINER
   ========================================= */

.ib-container {
    margin: 0 auto;
    max-width: var(--ib-container-max);
    padding: 0 var(--ib-container-pad);
}


/* =========================================
   SECTION UTILITIES
   Composable: combine .ib-section with
   .ib-section-light and/or .ib-section-bordered
   ========================================= */

.ib-section {
    padding: var(--ib-section-pad) 0;
}

.ib-section-light {
    background: var(--ib-light);
}

.ib-section-bordered {
    border-bottom: 1px solid var(--ib-border);
    border-top: 1px solid var(--ib-border);
}


/* =========================================
   BUTTONS
   (Astra owns primary .ast-button styling;
    these are for blueprint-specific buttons
    used inside ib-* sections)
   ========================================= */

.ib-btn {
    align-items: center;
    border-radius: var(--ib-radius-pill);
    border: none;
    cursor: pointer;
    display: inline-flex;
    font-size: var(--ib-font-size-base);
    font-weight: 600;
    justify-content: center;
    padding: 18px 36px;
    text-decoration: none;
    transition: all var(--ib-transition);
}

.ib-btn-lg {
    font-size: var(--ib-font-size-md);
    padding: 20px 48px;
}

.ib-btn-primary {
    background: var(--ib-navy);
    box-shadow: var(--ib-shadow-btn);
    color: var(--ib-white);
}

.ib-btn-primary:hover {
    background: var(--ib-navy-light);
    box-shadow: var(--ib-shadow-btn-hover);
    transform: translateY(-3px);
}

.ib-btn-secondary {
    background: var(--ib-white);
    border: 2px solid var(--ib-border);
    color: var(--ib-navy);
}

.ib-btn-secondary:hover {
    background: var(--ib-light);
    border-color: var(--ib-navy);
}

.ib-btn-white {
    background: var(--ib-white);
    box-shadow: var(--ib-shadow-btn-white);
    color: var(--ib-navy);
}

.ib-btn-white:hover {
    box-shadow: var(--ib-shadow-btn-wh-hover);
    transform: translateY(-3px);
}

.ib-btn-outline-white {
    background: transparent;
    border: 2px solid rgba(255, 255, 255, 0.3);
    color: var(--ib-white);
}

.ib-btn-outline-white:hover {
    background: rgba(255, 255, 255, 0.08);
    border-color: rgba(255, 255, 255, 0.5);
}


/* =========================================
   BUTTON GROUP
   Horizontal row of buttons with wrapping
   ========================================= */

.ib-btn-group {
    align-items: center;
    display: flex;
    flex-wrap: wrap;
    gap: var(--ib-space-16);
    justify-content: center;
}


/* =========================================
   EYEBROW PILL
   Label badge for heroes and section headers
   ========================================= */

.ib-eyebrow {
    align-items: center;
    background: rgba(56, 189, 248, 0.12);
    border: 1px solid rgba(56, 189, 248, 0.2);
    border-radius: var(--ib-radius-pill);
    color: var(--ib-accent);
    display: inline-flex;
    font-size: var(--ib-font-size-xs);
    font-weight: 700;
    gap: var(--ib-space-6);
    letter-spacing: 1.5px;
    padding: var(--ib-space-8) var(--ib-space-20);
    text-transform: uppercase;
}

.ib-eyebrow::before {
    background: var(--ib-accent);
    border-radius: var(--ib-radius-circle);
    content: '';
    display: block;
    height: 6px;
    width: 6px;
}


/* =========================================
   HERO — Shared Grid Structure
   (Variants in per-page CSS)
   ========================================= */

.ib-hero-grid {
    align-items: center;
    display: grid;
    gap: 0 var(--ib-space-64);
    grid-template-columns: 1fr var(--ib-hero-sidebar);
    grid-template-rows: auto auto;
    position: relative;
    z-index: 1;
}

.ib-hero-content-top {
    grid-column: 1;
    grid-row: 1;
}

.ib-hero-content-bottom {
    grid-column: 1;
    grid-row: 2;
}


/* =========================================
   HERO — Centered Variant
   For inner pages (Apply, Reviews, IA, etc.)
   Reuses .ib-hero background from page CSS
   ========================================= */

.ib-hero-centered {
    margin: 0 auto;
    max-width: var(--ib-content-medium);
    position: relative;
    text-align: center;
    z-index: 1;
}

.ib-hero-centered p {
    margin-left: auto;
    margin-right: auto;
    max-width: var(--ib-content-narrow);
}


/* =========================================
   VIDEO CAPTION (shared)
   ========================================= */

.ib-video-caption {
    color: var(--ib-text-muted);
    font-size: var(--ib-font-size-base);
    font-style: italic;
    margin-top: var(--ib-space-16);
    text-align: center;
}


/* =========================================
   TESTIMONIALS — Shared Header
   (Card variants in per-page CSS)
   ========================================= */

.ib-testimonials-header {
    margin-bottom: var(--ib-space-48);
    text-align: center;
}


/* =========================================
   FAQ ACCORDION
   WAI-ARIA APG pattern: button + region
   ========================================= */

.ib-faq {
    background: var(--ib-light);
    padding: var(--ib-section-pad) 0;
}

.ib-faq-grid {
    align-items: start;
    display: grid;
    gap: var(--ib-space-64);
    grid-template-columns: var(--ib-faq-sidebar) 1fr;
}

.ib-faq-header h2 {
    margin-bottom: var(--ib-space-20);
}

.ib-faq-header p {
    color: var(--ib-text-muted);
    font-size: var(--ib-font-size-md);
    line-height: 1.6;
}

.ib-faq-list {
    display: flex;
    flex-direction: column;
    gap: var(--ib-space-12);
}

.ib-faq-item {
    background: var(--ib-white);
    border-radius: var(--ib-radius-md);
    box-shadow: var(--ib-shadow-sm);
    overflow: visible;
}

.ib-faq-question {
    align-items: center;
    background: none;
    border-radius: var(--ib-radius-md);
    border: none;
    color: var(--ib-navy);
    cursor: pointer;
    display: flex;
    font-family: inherit;
    font-size: var(--ib-font-size-md);
    font-weight: 600;
    justify-content: space-between;
    padding: 22px 24px;
    text-align: left;
    width: 100%;
}

.ib-faq-toggle {
    align-items: center;
    background: var(--ib-accent-softer);
    border-radius: var(--ib-radius-circle);
    color: var(--ib-navy);
    display: flex;
    flex-shrink: 0;
    font-size: var(--ib-font-size-lg);
    height: 32px;
    justify-content: center;
    transition: all var(--ib-transition);
    width: 32px;
}

.ib-faq-item.is-open .ib-faq-toggle {
    background: var(--ib-navy);
    color: var(--ib-white);
    transform: rotate(45deg);
}

.ib-faq-answer {
    padding: 0 24px 22px;
}

.ib-faq-answer p {
    color: var(--ib-text-muted);
    font-size: var(--ib-font-size-md);
    line-height: 1.7;
    margin: 0;
}


/* =========================================
   CTA SECTION
   ========================================= */

.ib-cta {
    background: linear-gradient(135deg, var(--ib-navy) 0%, var(--ib-navy-light) 100%);
    overflow: hidden;
    padding: var(--ib-section-pad-cta);
    position: relative;
    text-align: center;
}

.ib-cta::before {
    background: radial-gradient(circle, rgba(56, 189, 248, 0.1) 0%, transparent 60%);
    border-radius: var(--ib-radius-circle);
    content: '';
    height: 400px;
    position: absolute;
    right: -100px;
    top: -100px;
    width: 400px;
}

.ib-cta-content {
    margin: 0 auto;
    max-width: 600px;
    position: relative;
    z-index: 1;
}

.ib-cta-content h2 {
    color: var(--ib-white);
    font-size: 44px;
    margin-bottom: var(--ib-space-20);
}

.ib-cta-content p {
    color: rgba(255, 255, 255, 0.8);
    font-size: var(--ib-font-size-lg);
    font-weight: 500;
    line-height: 1.6;
    margin-bottom: var(--ib-space-36);
}


/* =========================================
   REDUCED MOTION
   ========================================= */

@media (prefers-reduced-motion: reduce) {
    .ib-btn,
    .ib-faq-toggle,
    .ib-skip-link {
        transition-duration: 0.01ms !important;
    }
}


/* =========================================
   RESPONSIVE — 1024px
   ========================================= */

@media (max-width: 1024px) {
    .ib-hero-grid {
        gap: var(--ib-space-40);
        grid-template-columns: 1fr;
        grid-template-rows: auto;
        text-align: center;
    }

    .ib-hero-content-top {
        grid-column: 1;
        grid-row: 1;
    }

    .ib-hero-content-bottom {
        grid-column: 1;
        grid-row: 3;
    }

    .ib-hero-buttons {
        justify-content: center;
    }

    .ib-hero-text {
        margin-left: auto;
        margin-right: auto;
    }

    .ib-faq-grid {
        gap: var(--ib-space-40);
        grid-template-columns: 1fr;
    }
}


/* =========================================
   RESPONSIVE — 768px
   ========================================= */

@media (max-width: 768px) {
    .ib-hero {
        padding: var(--ib-section-pad-mobile);
    }

    .ib-hero-buttons {
        flex-direction: column;
        gap: var(--ib-space-12);
    }

    .ib-btn {
        width: 100%;
    }

    .ib-btn-group {
        flex-direction: column;
        width: 100%;
    }

    .ib-btn-group .ib-btn {
        width: 100%;
    }

    .ib-section {
        padding: 56px 0;
    }

    .ib-cta-content h2 {
        font-size: 32px;
    }
}
