/* =====================================================================
   FAQ intro hero — top of /faqs/ singleton page.
   Full-width hero with two render modes:
     1. No featured image: solid teal-100 -> grape-100 gradient (matches
        the FAQ accordion wash below it).
     2. With featured image (.mm-faq-intro--photo): the page's featured
        image fills the hero as a cover background, with a semi-transparent
        teal-700 -> grape-700 gradient layered over it via ::before so
        text stays legible.
===================================================================== */

/* Clip body overflow so the .alignfull viewport-edge escape below can't
   trigger a horizontal scrollbar. faq.css is enqueued on /faqs/, homepage,
   /programs/, and single-mm_program — all safe to clip. */
html,
body {
    overflow-x: clip;
}

/* Defeat voyager-block-theme/public/css/main.css's
   .alignfull:not(.is-layout-constrained) > * { max-width: wide-size; margin-inline: auto }
   rule, which has specificity (0,2,0) and otherwise caps the section at 1440px
   and forces auto margins. !important is the cleanest override here. */
.mm-faq-intro {
    position: relative;
    width: 100vw !important;
    max-width: 100vw !important;
    margin-left: calc(50% - 50vw) !important;
    margin-right: calc(50% - 50vw) !important;
    height: 500px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding-inline: var(--mm-s-8);
    background: linear-gradient(135deg, var(--wp--preset--color--teal-100) 0%, var(--wp--preset--color--grape-100) 100%);
    overflow: hidden;
}

/* Photo mode — featured image fills the section edge to edge; cover
   keeps it from squishing or letterboxing, center keeps the subject
   visible at any viewport width. */
.mm-faq-intro--photo {
    background-color: var(--mm-teal-800);
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
}

.mm-faq-intro--photo::before {
    content: "";
    position: absolute;
    inset: 0;
    background: linear-gradient(135deg, rgba(21, 92, 85, 0.82) 0%, rgba(95, 44, 117, 0.78) 100%);
    pointer-events: none;
    z-index: 1;
}

.mm-faq-intro__inner {
    position: relative;
    z-index: 2;
    max-width: 880px;
    margin-inline: auto;
    text-align: center;
}

.mm-faq-intro__eyebrow {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    margin: 0 0 18px 0;
    padding: 6px 14px;
    background: rgba(255, 255, 255, 0.7);
    border-radius: 999px;
    font-family: var(--mm-font-display);
    font-size: 12px;
    font-weight: 700;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    color: var(--mm-teal-700);
}

.mm-faq-intro__eyebrow-dot {
    width: 6px;
    height: 6px;
    border-radius: 999px;
    background: var(--mm-teal);
}

.mm-faq-intro__headline {
    margin: 0 0 18px 0;
    font-family: var(--mm-font-display);
    font-weight: 800;
    font-size: clamp(40px, 5vw, 64px);
    line-height: 1.04;
    letter-spacing: -0.02em;
    color: var(--mm-ink);
    text-wrap: balance;
}

.mm-faq-intro__headline-accent {
    color: var(--mm-grape-700);
    font-style: italic;
}

.mm-faq-intro__body {
    max-width: 56ch;
    margin: 0 auto;
    font-family: var(--mm-font-body);
    font-size: clamp(16px, 0.6vw + 14px, 19px);
    line-height: 1.55;
    color: var(--mm-ink-2);
}

/* Photo mode legibility — flip text colors so they read on top of the
   image+overlay scrim. Eyebrow keeps its white pill but the dot/text
   warm up; headline goes white with butter italic accent; body softens
   to a near-white. */
.mm-faq-intro--photo .mm-faq-intro__eyebrow {
    background: rgba(255, 255, 255, 0.92);
    color: var(--mm-teal-800);
}

.mm-faq-intro--photo .mm-faq-intro__headline {
    color: #fff;
    text-shadow: 0 2px 24px rgba(14, 63, 58, 0.35);
}

.mm-faq-intro--photo .mm-faq-intro__headline-accent {
    color: var(--mm-butter, #f4d16a);
}

.mm-faq-intro--photo .mm-faq-intro__body {
    color: rgba(255, 255, 255, 0.92);
    text-shadow: 0 1px 12px rgba(14, 63, 58, 0.35);
}

@media (max-width: 640px) {
    .mm-faq-intro {
        padding-inline: var(--mm-s-5);
    }
}

/* The FAQ accordion immediately below the intro shouldn't carry the
   112px top margin that lifts it off white pages — the hero already
   provides separation. Tighten when the two patterns are siblings. */
.mm-faq-intro + .mm-faq,
.mm-faq-intro + * .mm-faq:first-child {
    margin-block-start: 0;
}

/* =====================================================================
   FAQ accordion — shared between homepage and /programs/ archive.
   8 single-open questions, narrow 960 max-width for focused reading.
   Vanilla button-driven accordion (not <details>) for cross-browser
   trigger background + icon swap consistency. Q1 opens by default.

   Extracted from homepage.css when /programs/ began re-using the FAQ
   pattern; the styles live here so any page that includes the faq
   pattern can enqueue this single stylesheet.
===================================================================== */

.mm-faq {
    margin-block-start: 112px;
    padding-block: var(--mm-s-12);
    padding-inline: var(--mm-s-8);
    scroll-margin-top: 88px;
    /* P14 → 5/21 review: was a grape-100 → teal-100 wash, but stacked on
       top of the grape-tinted middle testimonial card it pushed too much
       light purple into the lower homepage. Now a soft teal lift only —
       fades down from white into teal-100 so the white FAQ card stack
       still sits visibly raised against the section background. */
    background: linear-gradient(180deg, #ffffff 0%, var(--wp--preset--color--teal-100) 100%);
}

/* EVERY FAQ accordion (home block + /programs/ /classes/ /faqs/ patterns +
   per-program FAQ) — light teal→grape→teal wash. !important overrides the
   soft white→teal base above. Universalized 2026-06-01 (Ben: "all FAQs
   should look like the front-page one"). */
.mm-faq {
    background: linear-gradient(135deg, rgba(21, 92, 85, 0.24) 0%, rgba(21, 92, 85, 0.20) 40%, rgba(122, 58, 150, 0.12) 65%, rgba(21, 92, 85, 0.22) 100%) !important;
}

/* /programs/: kill the gap between the Try-a-Class band and the FAQ wash — the
   shared .mm-faq top margin (112px) was showing the page background between the
   two colored sections (Ben 6/1). Scoped to the catalog page. */
.mm-programs-page .mm-faq {
    margin-block-start: 0;
}

/* ---------------------------------------------------------------------
   FAQ accordion polish — applies to EVERY .mm-faq accordion now.
   The indicator is a brand grape star: outline when closed, full-color
   purple when open. The active row + question lean grape to match it,
   and answers are a touch larger. Requires the markup to emit
   .mm-faq__icon-star — the block (render.php) and both patterns
   (faq.php, program-faqs.php) all do.
   --------------------------------------------------------------------- */

/* Star indicator replaces the +/- circle chip — no chip, grape outline. */
.mm-faq .mm-faq__icon,
.mm-faq .mm-faq__item.is-open > .mm-faq__trigger > .mm-faq__icon {
    background: none;
    color: var(--mm-grape-500);
}
.mm-faq .mm-faq__icon-star {
    position: absolute;
    inset: 0;
    margin: auto;
    fill: none;
    stroke: var(--mm-grape-500);
    transition: fill var(--mm-dur) var(--mm-ease), transform var(--mm-dur) var(--mm-ease);
}
/* Open → full-color purple star, with a small pop. */
.mm-faq .mm-faq__item.is-open .mm-faq__icon-star {
    fill: var(--mm-grape-500);
    transform: scale(1.08);
}
/* Hovering a closed row → light teal wash + a soft teal star tint (the
   open/active state stays grape, so hover and active read differently). */
.mm-faq .mm-faq__item:not(.is-open) > .mm-faq__trigger:hover {
    background-color: var(--mm-teal-50);
}
.mm-faq .mm-faq__item:not(.is-open) > .mm-faq__trigger:hover .mm-faq__icon-star {
    fill: rgba(66, 174, 154, 0.18);
}

/* Active row + question lean grape to match the star (was teal-50). */
.mm-faq .mm-faq__item.is-open > .mm-faq__trigger,
.mm-faq .mm-faq__item.is-open > .mm-faq__trigger:hover {
    background-color: rgba(128, 64, 160, 0.07);
}
.mm-faq .mm-faq__item.is-open .mm-faq__question {
    color: var(--mm-grape-700);
}

/* Larger, more readable answer text. */
.mm-faq .mm-faq__panel p {
    font-size: 18px;
    line-height: 1.65;
}

.mm-faq__inner {
    max-width: 960px;
    margin-inline: auto;
}

/* Header */

.mm-faq__header {
    text-align: center;
    margin-bottom: var(--mm-s-10);
}

.mm-faq__eyebrow {
    margin: 0 0 12px 0;
    font-family: var(--mm-font-display);
    font-size: 12px;
    font-weight: 700;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    color: var(--mm-teal-700);
    display: inline-flex;
    align-items: center;
    gap: 10px;
}

.mm-faq__eyebrow-dot {
    width: 6px;
    height: 6px;
    border-radius: 999px;
    background-color: var(--mm-teal);
    display: inline-block;
}

.mm-faq__heading {
    margin: 0;
    font-family: var(--mm-font-display);
    font-weight: 800;
    font-size: clamp(30px, 3vw, 42px);
    letter-spacing: -0.02em;
    line-height: 1.1;
    color: var(--mm-ink);
    text-wrap: balance;
}

/* Empty-state — rendered when WP_Query returns 0 mm_faq posts.
   Sits in place of the accordion until the seeder runs. */

.mm-faq__empty {
    margin: 0 auto;
    padding: 28px 32px;
    background-color: #fff;
    border: 1px solid var(--mm-line);
    border-radius: 20px;
    font-family: var(--mm-font-body);
    font-size: 16px;
    line-height: 1.55;
    color: var(--mm-ink-2);
    text-align: center;
}

/* List + items */

.mm-faq__list {
    display: flex;
    flex-direction: column;
    gap: 0;
    background-color: #fff;
    border-radius: 20px;
    border: 1px solid var(--mm-line);
    overflow: hidden;
}

.mm-faq__item {
    border-bottom: 1px solid var(--mm-line);
}

.mm-faq__item:last-child {
    border-bottom: none;
}

/* Trigger button */

.mm-faq__trigger {
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
    padding: 22px 28px;
    background: transparent;
    border: 0;
    cursor: pointer;
    text-align: left;
    font-family: var(--mm-font-display);
    font-size: 18px;
    font-weight: 700;
    color: var(--mm-ink);
    line-height: 1.3;
    transition: background-color var(--mm-dur) var(--mm-ease);
}

.mm-faq__trigger:hover {
    background-color: var(--mm-paper-2);
}

.mm-faq__trigger:focus-visible {
    outline: 3px solid var(--mm-focus-ring);
    outline-offset: -3px;
}

.mm-faq__item.is-open > .mm-faq__trigger,
.mm-faq__item.is-open > .mm-faq__trigger:hover {
    background-color: var(--mm-teal-50);
}

.mm-faq__question {
    flex: 1;
    min-width: 0;
}

/* Trigger icon — plus default, minus when open */

.mm-faq__icon {
    width: 36px;
    height: 36px;
    border-radius: 999px;
    background-color: var(--mm-paper-2);
    color: var(--mm-ink-2);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    position: relative;
    transition: background-color var(--mm-dur) var(--mm-ease), color var(--mm-dur) var(--mm-ease);
}

.mm-faq__item.is-open > .mm-faq__trigger > .mm-faq__icon {
    background-color: var(--mm-teal);
    color: #fff;
}

.mm-faq__icon-minus,
.mm-faq__icon-plus {
    position: absolute;
    inset: 0;
    margin: auto;
}

.mm-faq__icon-minus { display: none; }

.mm-faq__item.is-open > .mm-faq__trigger > .mm-faq__icon > .mm-faq__icon-plus { display: none; }
.mm-faq__item.is-open > .mm-faq__trigger > .mm-faq__icon > .mm-faq__icon-minus { display: block; }

/* Panel */

.mm-faq__panel {
    display: none;
    padding: 16px 28px 24px 28px;
}

.mm-faq__item.is-open > .mm-faq__panel {
    display: block;
}

.mm-faq__panel p {
    margin: 0;
    font-family: var(--mm-font-body);
    font-size: 16px;
    line-height: 1.6;
    color: var(--mm-ink-2);
}

/* Footer link */

.mm-faq__footer {
    margin: 24px 0 0 0;
    text-align: center;
    font-family: var(--mm-font-body);
    font-size: 15px;
    color: var(--mm-ink-3);
}

/* Homepage FAQ: more breathing room between the accordion stack and the
   "Still curious? Text Us" link (scoped to --home; program pages keep 24px). */
.mm-faq .mm-faq__footer {
    margin-top: 48px;
}

.mm-faq__footer-link {
    margin-left: 6px;
    font-family: var(--mm-font-display);
    font-weight: 700;
    color: var(--mm-teal-700);
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 4px;
    transition: color var(--mm-dur) var(--mm-ease);
}

.mm-faq__footer-link:hover,
.mm-faq__footer-link:focus-visible {
    color: var(--mm-teal-800);
    text-decoration: underline;
    text-underline-offset: 3px;
}

.mm-faq__footer-arrow {
    display: inline-flex;
    align-items: center;
    transition: transform var(--mm-dur) var(--mm-ease);
}

.mm-faq__footer-link:hover .mm-faq__footer-arrow,
.mm-faq__footer-link:focus-visible .mm-faq__footer-arrow {
    transform: translateX(2px);
}

/* Tablet 768–1023 */
@media (min-width: 768px) and (max-width: 1023px) {
    .mm-faq__trigger {
        padding: 20px 24px;
        font-size: 17px;
    }
    .mm-faq__panel {
        padding: 14px 24px 22px 24px;
    }
}

/* Mobile <768 */
@media (max-width: 767px) {
    .mm-faq {
        margin-block-start: 64px;
        padding-inline: var(--mm-s-5);
    }
    .mm-faq__inner {
        max-width: 100%;
    }
    .mm-faq__trigger {
        padding: 18px 20px;
        font-size: 16px;
        gap: 14px;
    }
    .mm-faq__icon {
        width: 32px;
        height: 32px;
    }
    .mm-faq__panel {
        padding: 12px 20px 20px 20px;
    }
    .mm-faq__panel p {
        font-size: 15.5px;
    }
}

/* Reduced motion */
@media (prefers-reduced-motion: reduce) {
    .mm-faq__trigger,
    .mm-faq__icon,
    .mm-faq__footer-link,
    .mm-faq__footer-arrow {
        transition: none;
    }
}