/* Math hub — v2 layout (preview). Loaded AFTER bergen-county-academies-v2.css and
   only adds math-specific components. Everything is scoped under .bcav2-page or a
   .mathv2-* class so nothing leaks into the shared header/nav/footer. */

.bcav2-page {
    --math-remedial: #1f7a5a;      /* "catch up" path — calm green */
    --math-remedial-bg: #eaf6f0;
    --math-advanced: #B12C00;      /* "get ahead" path — brand orange */
    --math-advanced-bg: #fdf0ea;
}

/* ===== Sticky quick-nav (same pattern as bergen-county-academies.php and the SAT page) =====
   Global style.css sets overflow-x:hidden on html/body, which blocks position:sticky.
   clip still stops horizontal scroll but does not create a scroll container.
   --bcav2-sticky-top is set to the real header height by the page script; 90px is
   only the no-JS fallback. z-index stays under the site header (1000). */
html,
body { overflow-x: clip; }
.bcav2-page { overflow-x: clip; }
.bcav2-page .bcav2-quicknav-wrap {
    position: sticky;
    top: var(--bcav2-sticky-top, 90px);
    z-index: 900;
    box-shadow: 0 4px 10px rgba(0, 0, 0, .06);
}
.bcav2-page .bcav2-quicknav a.is-active {
    background: var(--bca-primary);
    color: #fff;
    border-color: var(--bca-primary);
}
/* Anchored sections clear both the fixed header and the sticky bar (~60px). */
.bcav2-page .bcav2-section,
.bcav2-page #amc-guide { scroll-margin-top: calc(var(--bcav2-sticky-top, 90px) + 70px); }
.bcav2-page #mathv2-form { scroll-margin-top: calc(var(--bcav2-sticky-top, 90px) + 12px); }

/* ===== Compact form: two fields per row ===== */
.mathv2-form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.mathv2-form-row .form-group { min-width: 0; }
.bcav2-form-card .form-group { margin-bottom: 10px; }
.bcav2-form-card input,
.bcav2-form-card select { height: 42px; padding: 0 10px; line-height: 42px; }
.bcav2-form-card textarea { min-height: 58px; padding: 9px 10px; }
.bcav2-form-card .sub { margin-bottom: 12px; }
@media (max-width: 359px) {
    .mathv2-form-row { grid-template-columns: 1fr; gap: 0; }
}

/* ===== Hero ===== */
.mathv2-h1-lead { display: block; color: #fff !important; }
.mathv2-h1-geo { display: block; color: #ffe08a; }
.mathv2-tagline {
    font-size: 1.2rem;
    font-weight: 700;
    color: #ffe08a;
    margin: 0 0 10px;
    letter-spacing: .2px;
}
.mathv2-hero-proof {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 14px;
    color: rgba(255,255,255,.92);
    margin: -6px 0 22px;
}
.mathv2-hero-proof .stars { color: var(--bca-gold); letter-spacing: 1px; }
.mathv2-hero-proof a { color: #fff; text-decoration: underline !important; }

/* ===== Answer-first summary (AEO / AI-citable passage) ===== */
.mathv2-answer {
    background: #f3f6fc;
    border: 1px solid #d3e0f5;
    border-left: 5px solid var(--bca-primary);
    border-radius: 12px;
    padding: 18px 20px;
    margin-bottom: 22px;
}
.mathv2-answer .label {
    display: inline-block;
    font-size: 11.5px;
    font-weight: 800;
    letter-spacing: .6px;
    text-transform: uppercase;
    color: var(--bca-primary);
    margin-bottom: 6px;
}
.mathv2-answer p { font-size: 15.5px; line-height: 1.7; color: #2f343a; margin: 0; }

/* ===== Path chooser (the main CRO fork) ===== */
.mathv2-fork { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; margin-top: 6px; }
.mathv2-fork-card {
    display: flex;
    flex-direction: column;
    border: 2px solid var(--bca-line);
    border-radius: 14px;
    overflow: hidden;
    background: #fff;
    transition: box-shadow .15s ease, transform .15s ease, border-color .15s ease;
}
.mathv2-fork-card:hover { transform: translateY(-3px); box-shadow: 0 14px 28px rgba(0,0,0,.08); }
.mathv2-fork-card.remedial:hover { border-color: var(--math-remedial); }
.mathv2-fork-card.advanced:hover { border-color: var(--math-advanced); }
.mathv2-fork-card picture, .mathv2-fork-card img { display: block; width: 100%; aspect-ratio: 16 / 9; object-fit: cover; }
.mathv2-fork-body { padding: 18px 20px 20px; display: flex; flex-direction: column; flex: 1; }
.mathv2-fork-body h3 { font-size: 1.2rem; font-weight: 800; margin: 6px 0 6px; color: var(--bca-ink); }
.mathv2-fork-body > p { font-size: 14.5px; line-height: 1.6; color: #3a3f45; margin: 0 0 10px; }
.mathv2-fork-body ul { list-style: none; padding: 0; margin: 0 0 16px; }
.mathv2-fork-body li { display: flex; gap: 10px; font-size: 14px; line-height: 1.55; padding: 4px 0; color: #3a3f45; }
.mathv2-fork-card.remedial li i { color: var(--math-remedial); margin-top: 4px; }
.mathv2-fork-card.advanced li i { color: var(--math-advanced); margin-top: 4px; }
.mathv2-fork-body .bcav2-btn { margin-top: auto; }

.mathv2-pill {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    align-self: flex-start;
    font-size: 11.5px;
    font-weight: 800;
    letter-spacing: .6px;
    text-transform: uppercase;
    padding: 5px 11px;
    border-radius: 999px;
}
.mathv2-pill.remedial { background: var(--math-remedial-bg); color: var(--math-remedial); }
.mathv2-pill.advanced { background: var(--math-advanced-bg); color: var(--math-advanced); }

/* Solid buttons on white sections (the bcav2 outline button is white-on-blue only) */
.mathv2-btn-remedial { background: var(--math-remedial); color: #fff !important; }
.mathv2-btn-remedial:hover { background: #165c43; transform: translateY(-2px); }
.mathv2-btn-advanced { background: var(--math-advanced); color: #fff !important; }
.mathv2-btn-advanced:hover { background: #8a2200; transform: translateY(-2px); }
.mathv2-btn-blue { background: var(--bca-primary); color: #fff !important; }
.mathv2-btn-blue:hover { background: var(--bca-primary-dark); transform: translateY(-2px); }
.mathv2-btn-ghost {
    background: #fff;
    color: var(--bca-primary) !important;
    border: 2px solid var(--bca-primary);
}
.mathv2-btn-ghost:hover { background: #eaf0fb; transform: translateY(-2px); }
.mathv2-cta-row { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 18px; }

/* Coloured top rule so each path section reads as its own "lane" */
.bcav2-section.mathv2-lane-remedial { border-top: 5px solid var(--math-remedial); }
.bcav2-section.mathv2-lane-advanced { border-top: 5px solid var(--math-advanced); }
.mathv2-lane-remedial .bcav2-section-icon { background: var(--math-remedial-bg); color: var(--math-remedial); }
.mathv2-lane-advanced .bcav2-section-icon { background: var(--math-advanced-bg); color: var(--math-advanced); }
.mathv2-lane-remedial h2 span { color: var(--math-remedial) !important; }
.mathv2-lane-advanced h2 span { color: var(--math-advanced) !important; }
.mathv2-lead { font-size: 1.12rem; font-weight: 700; color: var(--bca-ink); margin: 0 0 10px; }

/* Check cards in the remedial lane use the lane colour */
.mathv2-lane-remedial .bcav2-check-card li i { color: var(--math-remedial); }

/* ===== Callout (diagnostic, AMC "why it matters") ===== */
.mathv2-callout {
    display: grid;
    grid-template-columns: 56px 1fr;
    gap: 16px;
    background: var(--bca-bg);
    border: 1px solid var(--bca-line);
    border-radius: 12px;
    padding: 18px 20px;
    margin-top: 18px;
}
.mathv2-callout .icon {
    width: 56px;
    height: 56px;
    border-radius: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
    background: var(--math-remedial-bg);
    color: var(--math-remedial);
}
.mathv2-callout.advanced .icon { background: var(--math-advanced-bg); color: var(--math-advanced); }
.mathv2-callout h3 { font-size: 1.05rem; font-weight: 800; margin: 0 0 6px; color: var(--bca-ink); }
.mathv2-callout p { font-size: 14.5px; line-height: 1.65; color: #3a3f45; margin: 0 0 8px; }
.mathv2-callout p:last-child { margin-bottom: 0; }

/* ===== Sample problem with reveal ===== */
.mathv2-problem {
    border: 1px dashed #c9c2b5;
    border-radius: 12px;
    padding: 16px 18px;
    margin-top: 18px;
    background: #fff;
}
.mathv2-problem .q-label {
    font-size: 11.5px;
    font-weight: 800;
    letter-spacing: .6px;
    text-transform: uppercase;
    color: var(--bca-muted);
    display: block;
    margin-bottom: 6px;
}
.mathv2-problem .q { font-size: 16px; font-weight: 600; font-style: italic; color: var(--bca-ink); margin: 0 0 10px; line-height: 1.55; }
.mathv2-problem details summary {
    cursor: pointer;
    font-weight: 700;
    font-size: 14px;
    color: var(--bca-primary);
    list-style: none;
    display: inline-flex;
    align-items: center;
    gap: 6px;
}
.mathv2-problem details summary::-webkit-details-marker { display: none; }
.mathv2-problem details summary::before { content: "\25B8"; transition: transform .2s ease; display: inline-block; }
.mathv2-problem details[open] summary::before { transform: rotate(90deg); }
.mathv2-problem details p { font-size: 14.5px; line-height: 1.65; color: #3a3f45; margin: 10px 0 0; }

/* ===== Advanced roadmap (stepper) ===== */
.mathv2-roadmap {
    list-style: none;
    padding: 0;
    margin: 18px 0 6px;
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 14px;
    counter-reset: road;
    position: relative;
}
.mathv2-roadmap li {
    position: relative;
    background: var(--bca-bg);
    border: 1px solid var(--bca-line);
    border-radius: 12px;
    padding: 16px 16px 18px;
}
.mathv2-roadmap li:not(:last-child)::after {
    content: "\2192";
    position: absolute;
    right: -13px;
    top: 26px;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    background: var(--math-advanced);
    color: #fff;
    font-size: 13px;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1;
}
.mathv2-roadmap .step {
    display: inline-block;
    font-size: 11px;
    font-weight: 800;
    letter-spacing: .6px;
    text-transform: uppercase;
    color: var(--math-advanced);
    margin-bottom: 4px;
}
.mathv2-roadmap h3 { font-size: 15.5px; font-weight: 800; margin: 0 0 4px; color: var(--bca-ink); }
.mathv2-roadmap .grades {
    display: inline-block;
    font-size: 12px;
    font-weight: 700;
    background: #fff;
    border: 1px solid var(--bca-line);
    border-radius: 999px;
    padding: 2px 9px;
    margin-bottom: 8px;
    color: var(--bca-muted);
}
.mathv2-roadmap p { font-size: 13.5px; line-height: 1.55; color: #3a3f45; margin: 0; }

/* ===== Contest quick-reference table ===== */
.mathv2-table-wrap { overflow-x: auto; margin-top: 18px; border: 1px solid var(--bca-line); border-radius: 12px; }
.mathv2-table { width: 100%; border-collapse: collapse; font-size: 14px; min-width: 560px; }
.mathv2-table caption {
    caption-side: top;
    text-align: left;
    font-weight: 800;
    font-size: 15px;
    color: var(--bca-ink);
    padding: 14px 16px 6px;
}
.mathv2-table th, .mathv2-table td { padding: 11px 16px; text-align: left; vertical-align: top; border-top: 1px solid var(--bca-line); line-height: 1.5; }
.mathv2-table thead th { background: var(--bca-bg); font-size: 12.5px; text-transform: uppercase; letter-spacing: .5px; color: var(--bca-muted); }
.mathv2-table tbody th { font-weight: 800; color: var(--bca-ink); white-space: nowrap; }
.mathv2-table td { color: #3a3f45; }

.mathv2-fineprint { font-size: 12px; line-height: 1.55; color: var(--bca-muted); margin: 14px 0 0; }
.mathv2-fineprint a { color: var(--bca-primary); text-decoration: underline !important; }

/* ===== Math Kangaroo block ===== */
.mathv2-kangaroo { display: grid; grid-template-columns: 1fr 300px; gap: 26px; align-items: start; }
.mathv2-kangaroo-logo {
    background: #fff;
    border: 1px solid var(--bca-line);
    border-radius: 12px;
    padding: 18px;
    text-align: center;
}
.mathv2-kangaroo-logo img { max-width: 240px; width: 100%; height: auto; }
.mathv2-kangaroo-logo p { font-size: 12.5px; color: var(--bca-muted); margin: 10px 0 0; }
.mathv2-facts { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; margin: 14px 0 4px; }
.mathv2-fact {
    background: var(--bca-bg);
    border: 1px solid var(--bca-line);
    border-radius: 10px;
    padding: 12px 14px;
    display: flex;
    gap: 10px;
    align-items: flex-start;
}
.mathv2-fact i { color: var(--bca-primary); margin-top: 3px; font-size: 16px; flex-shrink: 0; }
.mathv2-fact b { display: block; font-size: 15px; color: var(--bca-ink); }
.mathv2-fact span { font-size: 13px; color: var(--bca-muted); line-height: 1.45; }

/* ===== "How to start" — 4 steps instead of the base 3 ===== */
.mathv2-steps.bcav2-timeline { grid-template-columns: repeat(4, 1fr); }
.mathv2-steps .bcav2-timeline-step h3 { font-size: 15px; font-weight: 700; margin: 0 0 6px; color: var(--bca-ink); }

/* ===== Trust grid ===== */
.mathv2-trust { display: grid; grid-template-columns: repeat(2, 1fr); gap: 14px; }
.mathv2-trust-item { display: flex; gap: 12px; align-items: flex-start; border: 1px solid var(--bca-line); border-radius: 12px; padding: 16px; }
.mathv2-trust-item i {
    width: 40px; height: 40px; border-radius: 10px; flex-shrink: 0;
    display: flex; align-items: center; justify-content: center;
    background: #e8eef9; color: var(--bca-primary); font-size: 17px;
}
.mathv2-trust-item h3 { font-size: 15px; font-weight: 800; margin: 0 0 4px; color: var(--bca-ink); }
.mathv2-trust-item p { font-size: 14px; line-height: 1.6; color: #3a3f45; margin: 0; }

.mathv2-rating-line { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; font-size: 14.5px; margin: 0 0 14px; color: #3a3f45; }
.mathv2-rating-line .stars { color: #e0a800; letter-spacing: 1px; font-size: 16px; }

.mathv2-content { padding-top: 26px; }

/* ===== Responsive ===== */
@media (max-width: 991px) {
    .mathv2-fork,
    .mathv2-trust,
    .mathv2-kangaroo { grid-template-columns: 1fr; }
    .mathv2-kangaroo-logo { max-width: 340px; }
    .mathv2-roadmap,
    .mathv2-steps.bcav2-timeline { grid-template-columns: 1fr 1fr; }
    .mathv2-roadmap li:not(:last-child)::after { display: none; }
}
@media (max-width: 575px) {
    .mathv2-roadmap,
    .mathv2-steps.bcav2-timeline,
    .mathv2-facts { grid-template-columns: 1fr; }
    .mathv2-callout { grid-template-columns: 1fr; }
    .mathv2-callout .icon { width: 46px; height: 46px; font-size: 20px; }
    .mathv2-tagline { font-size: 1.05rem; }
    .mathv2-cta-row .bcav2-btn { width: 100%; }
}
@media (prefers-reduced-motion: reduce) {
    .mathv2-fork-card, .mathv2-fork-card:hover { transition: none; transform: none; }
}
