/* ===========================================================================
   Region archive: the FAQ
   ===========================================================================

   blocks/region-editorial-faq.php, at the foot of templates/region-template.php: the
   questions as one ruled column across the measure, each row opening on a gold chevron,
   under a centred heading - where the FAQ pattern (5356) rendered a two-column accordion
   with the heading in an otherwise empty left column and a circular chevron button at the
   right of every row.

   Drawn from the design Anthony supplied rather than ported from another template, so the
   rules below are the whole of it: a hairline over each row and under the last, a row that
   is a button the full width of the measure, and a chevron that points at the question
   until the row opens.

   Nothing here may touch `.faq-list`, `.faq-item`, `.faq-toggle` or `.answer`: those are
   custom-blocks/faq-list.php's, ~25 rules in style.css style them, js/more.js binds
   `.faq-toggle` globally, and the block still renders its own way on every other template.
   Every rule below is on the `.rfaq-*` namespace. `.accordion-toggle` is the one shared
   class the partial reuses, for its handler; see the partial.

   inc/region-page.php loads this on lucid_is_region_page() alone, so the region service
   subpages and the landers - both is_tax('region') - never see it.

   @see blocks/region-editorial-faq.php
   @see inc/region-page.php
   --------------------------------------------------------------------------- */

/* The list sits under a centred heading rather than beside a left-aligned one, so it takes
   more air above it than a left-aligned section would: 32px reads as the heading having
   slipped down onto the first rule. */
.tax-region #faq .section-content {
    margin-top: 44px;
}

/* The resets undo `.entry-content ul` (style.css:8067, a 22px indent) and
   `.entry-content ul li` (:8078, a 1em bottom margin that would break the ruled column into
   separate bars). */
.entry-content ul.rfaq-list {
    --rfaq-rule: rgba(210, 175, 107, 0.3);

    margin: 0;
    padding-left: 0;
    list-style: none;

    /* The rule under the last row. Every other rule is a row's own top border, so the list
       closes itself rather than leaving the last question hanging.

       Gold, not a white hairline: --color-text-accent at 0.3, the opacity main's site-wide
       FAQ (style.css "FAQ Block", the `faq-redesign` work) settled on 2026-11-11 after the
       design's sampled 0.55 read too strong. Gold is what keeps a column of eleven rules
       warm rather than grey. */
    border-bottom: 1px solid var(--rfaq-rule);
}

.entry-content ul.rfaq-list > li.rfaq-item {
    margin: 0;
    padding: 0;
    border-top: 1px solid var(--rfaq-rule);
}

.entry-content ul.rfaq-list > li.rfaq-item::before {
    content: none;
}

/* The whole row is the target, not the words in it: a question is a short string and a
   click anywhere along the rule should open it. */
.entry-content ul.rfaq-list .rfaq-toggle {
    display: flex;
    /* Not `baseline`: a question that wraps would hand the chevron the last line's baseline
       on some browsers and the first's on others. Aligned to the top of the row, the mark
       is placed off the padding and stays on the first line whatever the question does. */
    align-items: flex-start;
    gap: 15px;
    width: 100%;
    margin: 0;
    /* 56px rows, as the design measures: a 28px line between 14px above and below. The 2px
       at the left puts the chevron 5px inside the rule, where the design has it. */
    /* 62px rows, as main's FAQ: the design's 56px plus 10% between questions. */
    padding: 17px 0 18px 2px;
    border: 0;
    background: none;
    text-align: left;
    cursor: pointer;
    transition: var(--transition-ease-in-out);
}

/* A fixed box, so a question that wraps to two lines keeps its chevron on the first line
   and the text block stays aligned down the column. */
/* A fixed box the rotated chevron is centred in. The rotation is a paint-time transform, so
   the svg still occupies its drawn 9x5 here and the glyph is drawn 5x9 across the middle of
   it - which is the 5px-wide mark the design has, 5px inside the rule. */
.rfaq-chevron {
    flex: 0 0 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 10px;
    color: var(--color-text-accent);

    /* Onto the question's first line: main's FAQ offsets its 10px chevron by 6px. */
    margin-top: 6px;
}

.rfaq-chevron svg {
    display: block;
    /* Main's chevron: 10px across, drawn at a 2.5px stroke. */
    width: 10px;
    height: auto;
    overflow: visible;
}

.rfaq-chevron svg path {
    stroke-width: 2.5px;
}

/* Pointing at the question while the row is shut. style.css:16610 sets `rotate(0)` on every
   `.accordion-toggle svg` and :16619 turns it 180deg when the toggle goes active, both of
   which this overrides outright: a quarter turn anticlockwise to point right, and back to
   the artwork's own orientation - down - when the row opens. */
.rfaq-list .accordion-toggle svg {
    transform: rotate(-90deg);
}

.rfaq-list .accordion-toggle.active svg {
    transform: rotate(0deg);
}

.rfaq-question {
    /* The size the question is set at everywhere else on the site: custom-blocks/faq-list.php
       puts `.body-lg` on its own question span, and the design keeps it. Taken as the token
       rather than the class, because `.body-lg` carries `font-size` as `!important` and
       nothing here should need to out-shout it later.

       The line-height is below the token's 1.4: at 1.4 a 23px question makes a 32px line and
       the rows come out at 62px, where the design measures 56. */
    font-size: var(--fs-body-lg);
    /* 1.2, snapped to a whole pixel as main's is: a fractional row height puts every other
       1px hairline on a half pixel, where it blurs to grey instead of gold. */
    line-height: 1.2;
    line-height: round(1.2em, 1px);
    letter-spacing: var(--ls-body-lg);
    color: var(--color-text-primary);
}

/* The design carries no hover state, and a disclosure with no affordance at all is worse
   than a quiet one: the chevron leans the way it points, and nothing else moves. */
.entry-content ul.rfaq-list .rfaq-toggle:hover .rfaq-chevron {
    transform: translateX(2px);
}

.rfaq-chevron {
    transition: var(--transition-ease-in-out);
}

/* Collapsed until the shared .accordion-toggle handler in js/more.js slideToggles it, which
   means the open state is an inline `display: block` - so this must stay a plain
   `display: none` with no !important and no media-query override, or the row would never
   open. */
.rfaq-answer {
    display: none;
    /* Indented to the question above it: 2px of row padding, the 10px chevron box and the
       15px gap. */
    padding: 0 0 20px 27px;
    color: rgba(255, 255, 255, 0.7);
    /* Main's reveal: the answer fades and sharpens in as its row slides open. The handler
       puts `active` on the button, the answer's previous sibling. */
    opacity: 0;
    filter: blur(1px);
    transition:
        opacity 0.3s ease 0.1s,
        filter 0.2s ease 0.1s;
}

.rfaq-toggle.active + .rfaq-answer {
    opacity: 1;
    filter: blur(0);
}

.rfaq-answer p {
    font-size: var(--fs-body-md);
    line-height: 165%;
    margin-bottom: 0.8em;
}

.rfaq-answer > *:first-child {
    margin-top: 0;
}

.rfaq-answer > *:last-child {
    margin-bottom: 0;
}

/* The list inside an answer needs its marker back. `.entry-content ul li:before`
   (style.css:8099) only paints the checkmark for `.faq-item`, `ul.wp-block-list` and
   `.excerpt ul`, so a plain list in this column gets nothing - and the accordion this
   section replaces had it, through the first of those three. Same checkmark, same
   geometry, from the same file. */
.entry-content .rfaq-answer ul {
    margin: 10px 0;
    padding-left: calc(16px + .375rem);
    list-style: none;
}

.entry-content .rfaq-answer ul li {
    position: relative;
    margin: 0 0 7px;
}

.entry-content .rfaq-answer ul li:last-child {
    margin-bottom: 0;
}

.entry-content .rfaq-answer ul li::before {
    content: "";
    position: absolute;
    left: calc(-16px - .375rem);
    top: 6px;
    width: 12px;
    height: 10px;
    background-image: url("../images/icon-bullet.svg");
    background-size: contain;
    background-repeat: no-repeat;
}

@media (max-width: 680px) {

    .tax-region #faq .section-content {
        margin-top: 32px;
    }

    /* A tighter gap and a shorter indent, as main's FAQ takes at this width. */
    .entry-content ul.rfaq-list .rfaq-toggle {
        gap: 12px;
    }

    .rfaq-answer {
        padding-left: 24px;
    }
}
