/* =========================================================================
   FAQ SECTION COMPONENT
   Standalone styles for the reusable _FAQ.cshtml accordion partial.
   Standardised to visually match the Groups FAQ (the gold standard).

   Loaded per-page INSTEAD of faq.css on Home / Groups / About, so this file
   fully defines the accordion base (.fm-* / .plusminus / .open) as well as the
   section container and header. The standalone FAQ.cshtml page keeps faq.css.

   JS contract (global.js -> createTabSystem, mode:'free', heightHack):
   - queries `.faqGroups` containers, reads each id, finds button by id+"Btn"
   - toggles `open` on the CONTAINER and `btn-open` on the button
   - heightHack sets an inline `height` on the CONTAINER (button height when
     closed, auto when open with isFreeOpenHeight). So the container must keep
     `overflow:hidden` and must NOT also carry a conflicting max-height rule.
   ========================================================================= */

/* --- Section shell ------------------------------------------------------- */
.hfq-container-mod {
    background-color: var(--light-10);
    padding: 72px 5%;
    border-top: 1px solid var(--light-20);
}

.hfq-content-mod {
    display: flex;
    flex-direction: column;
    gap: 40px;
    padding: 72px 40px;
    max-width: 860px;
    width: 100%;
    margin: 0 auto;
}

/* --- Header -------------------------------------------------------------- */
.hfq-head {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
    text-align: center;
}

/* Replicates groups.css .gp-section-label so this component does not depend
   on groups.css being loaded (About / Home do not load it). */
.faq-eyebrow {
    font-size: 11px;
    font-weight: 600;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: var(--blue-50);
}

/* Replicates groups.css .gp-section-title. */
.faq-heading {
    font-weight: 700;
    color: var(--blue-90);
    line-height: 1.2;
    margin: 0;
}

/* --- List of rows -------------------------------------------------------- */
.hfq-list {
    display: flex;
    flex-direction: column;
    width: 100%;
}

/* --- Accordion item (the container createTabSystem toggles) -------------- */
.fm-question-wrapped {
    width: 100%;
    display: flex;
    flex-direction: column;
}

.fm-question-wrapped:last-child {
    border-bottom: 1px solid var(--dark-30);
}

/* --- Toggle button ------------------------------------------------------- */
.fm-button {
    width: 100%;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 16px;
    padding: 16px;
    border: none;
    border-top: 1px solid var(--dark-30);
    background: transparent;
    color: inherit;
    font: inherit;
    text-align: left;
    cursor: pointer;
    transition: background-color 0.2s ease;
}

.fm-button:hover {
    background-color: var(--blue-05);
}

.fm-button:focus-visible {
    outline: 2px solid var(--blue-80);
    outline-offset: -2px;
}

/* First row: drop the top divider so the list opens flush. */
.first-question-mod .fm-button {
    border-top: none;
}

.fm-button h4,
.fm-button h5 {
    width: 85%;
    margin: 0;
    text-align: left;
}

/* --- Plus / minus icon (animates to minus when the row is open) ---------- */
.plusminus {
    position: relative;
    flex: 0 0 auto;
    width: 16px;
    height: 16px;
}

.plusminus:before,
.plusminus:after {
    content: "";
    display: block;
    background-color: var(--blue-80);
    position: absolute;
    top: 50%;
    left: 0;
    transition: 0.35s;
    width: 100%;
    height: 3px;
}

.plusminus:before {
    transform: translatey(-50%);
}

.plusminus:after {
    transform: translatey(-50%) rotate(90deg);
}

.open .plusminus:before {
    transform: translatey(-50%) rotate(-90deg);
    opacity: 0;
}

.open .plusminus:after {
    transform: translatey(-50%) rotate(0);
}

/* --- Answer -------------------------------------------------------------- */
.fm-answer {
    overflow: hidden;
    max-height: 0;
    padding: 0;
    transition: max-height 0.35s ease;
}

.open .fm-answer {
    max-height: 400px;
}

.fm-answer-inner {
    display: flex;
    flex-direction: column;
    gap: 16px;
    padding: 0 16px 20px;
}

.fm-answer-inner p {
    margin: 0;
    line-height: 1.6;
    color: var(--dark-70);
}

.fm-answer a.link {
    color: var(--blue-80);
}

/* --- Reduced motion ------------------------------------------------------ */
@media (prefers-reduced-motion: reduce) {
    .fm-question-wrapped,
    .fm-button,
    .plusminus:before,
    .plusminus:after {
        transition: none;
    }
}

/* --- Small screens ------------------------------------------------------- */
@media (max-width: 640px) {
    .hfq-container-mod {
        padding: 48px 5%;
    }

    .hfq-content-mod {
        padding: 0;
        gap: 28px;
    }
}
