/* FAQ groups use native <details>, so the accordion needs no JavaScript and each
   answer stays in the DOM for crawlers. The card styling matches the coded FAQ
   page; the marker is drawn here because browsers style the default one
   inconsistently. */
.wagtail-public-content__faq {
    --faq-border: #dbe5ea;
    --faq-surface: #ffffff;
    --faq-text: #18232e;
    --faq-muted: #5d6a75;
    --faq-surface-soft: #eef6f8;
    --faq-accent: var(--clr-primary-100);
    --faq-accent-strong: #123746;

    display: grid;
    gap: 0.75rem;
}

.wagtail-public-content__faq-heading {
    margin: 0 0 0.125rem;
    color: var(--faq-text);
    font-size: clamp(1.25rem, 2.4vw, 1.9rem);
    line-height: 1.15;
}

.wagtail-public-content__faq-item {
    overflow: hidden;
    border: 1px solid var(--faq-border);
    border-radius: 10px;
    background: var(--faq-surface);
    transition: border-color 160ms ease, box-shadow 160ms ease;
}

.wagtail-public-content__faq-item:hover,
.wagtail-public-content__faq-item[open] {
    border-color: color-mix(in srgb, var(--faq-accent) 30%, var(--faq-border));
    box-shadow: 0 10px 22px rgba(16, 28, 46, 0.06);
}

/* No min-height: the question box is sized by its own padding so the gap above
   the text matches the gap below it, and an open card reads as one stack rather
   than a fixed-height bar with the answer hanging off it. */
.wagtail-public-content__faq-question {
    position: relative;
    display: flex;
    align-items: center;
    padding: 1.1rem 3rem 1.1rem 1.25rem;
    color: var(--faq-text);
    font-size: 1rem;
    font-weight: 600;
    line-height: 1.35;
    cursor: pointer;
    list-style: none;
}

.wagtail-public-content__faq-question::-webkit-details-marker {
    display: none;
}

/* Marker drawn from two bars rather than a glyph — rationale, and the reason
   background-color and background-image stay separate, in home/static/home/css/faq.css. */
.wagtail-public-content__faq-question::after {
    content: "";
    position: absolute;
    top: 50%;
    right: 1rem;
    transform: translateY(-50%);
    width: 1.75rem;
    height: 1.75rem;
    border-radius: 999px;
    background-color: var(--faq-surface-soft);
    background-image:
        linear-gradient(currentColor, currentColor),
        linear-gradient(currentColor, currentColor);
    background-repeat: no-repeat;
    background-position: center;
    background-size: 0.7rem 2px, 2px 0.7rem;
    color: var(--faq-accent);
}

/* Fill on hover only while the card is closed: there the question fills the card,
   so it reads as the whole card highlighting. On an open card the same fill would
   stop at the answer and read as a header rule, making the question look pinned
   to the top rather than sitting inside the card. */
.wagtail-public-content__faq-item:not([open]) .wagtail-public-content__faq-question:hover {
    background: color-mix(in srgb, var(--faq-surface-soft) 62%, white);
}

.wagtail-public-content__faq-question:hover,
.wagtail-public-content__faq-question:focus-visible {
    color: var(--faq-accent-strong);
}

.wagtail-public-content__faq-question:focus-visible {
    outline: 3px solid color-mix(in srgb, var(--faq-accent) 24%, transparent);
    outline-offset: -3px;
}

/* Open: drop the vertical bar so the plus becomes a minus. */
.wagtail-public-content__faq-item[open] .wagtail-public-content__faq-question::after {
    background-color: var(--faq-accent);
    background-size: 0.7rem 2px, 0 0;
    color: #ffffff;
}

.wagtail-public-content__faq-answer {
    padding: 0.75rem 1.25rem 1rem;
    color: var(--faq-muted);
    font-size: 0.98rem;
    line-height: 1.7;
}

.wagtail-public-content__faq-answer p {
    margin: 0 0 0.75rem;
}

.wagtail-public-content__faq-answer > :first-child {
    margin-top: 0;
}

.wagtail-public-content__faq-answer > :last-child {
    margin-bottom: 0;
}

.wagtail-public-content__faq-answer strong {
    color: var(--faq-accent-strong);
}
