/**
 * GPRO FAQ — Frontend Styles
 *
 * Minimal, theme-friendly styling.
 * Override in your child theme with higher specificity if needed.
 *
 * @since 1.0.0
 */

/* ── Container ─────────────────────────────────────────────────── */

.gpro-faq {
    margin: 1.5em 0;
}

/* ── Group headings (when group="yes") ─────────────────────────── */

.gpro-faq__group {
    margin-bottom: 1.5em;
}

.gpro-faq__group-title {
    font-size: 1.2em;
    font-weight: 600;
    margin: 0 0 0.75em;
    padding-bottom: 0.4em;
    border-bottom: 1px solid currentColor;
    opacity: 0.8;
}

/* ── Single FAQ item ───────────────────────────────────────────── */

.gpro-faq__item {
    border-bottom: 1px solid rgba(0, 0, 0, 0.08);
}

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

/* ── Question (accordion button) ───────────────────────────────── */

.gpro-faq__question {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
    padding: 1em 0;
    margin: 0;
    background: none;
    border: none;
    cursor: pointer;
    font-size: 1em;
    font-weight: 600;
    line-height: 1.4;
    text-align: left;
    color: inherit;
    font-family: inherit;
    gap: 1em;
    transition: opacity 0.15s ease;
}

.gpro-faq__question:hover {
    opacity: 0.7;
}

.gpro-faq__question:focus-visible {
    outline: 2px solid currentColor;
    outline-offset: 2px;
}

/* Static question (list mode) */
.gpro-faq__question--static {
    display: block;
    padding: 1em 0 0.25em;
    cursor: default;
}

.gpro-faq__question--static:hover {
    opacity: 1;
}

/* ── Accordion icon (plus / minus) ─────────────────────────────── */

.gpro-faq__icon {
    position: relative;
    flex-shrink: 0;
    width: 20px;
    height: 20px;
}

.gpro-faq__icon::before,
.gpro-faq__icon::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    background: currentColor;
    transition: transform 0.25s ease;
}

/* Horizontal bar (always visible) */
.gpro-faq__icon::before {
    width: 14px;
    height: 2px;
    transform: translate(-50%, -50%);
}

/* Vertical bar (rotates to form +/−) */
.gpro-faq__icon::after {
    width: 2px;
    height: 14px;
    transform: translate(-50%, -50%);
}

/* When expanded, rotate vertical bar to 0° (forms a minus) */
.gpro-faq__question[aria-expanded="true"] .gpro-faq__icon::after {
    transform: translate(-50%, -50%) rotate(90deg);
}

/* ── Answer ────────────────────────────────────────────────────── */

.gpro-faq__answer {
    overflow: hidden;
    transition: max-height 0.3s ease, opacity 0.2s ease;
}

.gpro-faq__answer[hidden] {
    display: block;
    max-height: 0;
    opacity: 0;
    visibility: hidden;
}

.gpro-faq__answer:not([hidden]) {
    max-height: 2000px;
    opacity: 1;
    visibility: visible;
}

.gpro-faq__answer--visible {
    max-height: none;
    opacity: 1;
}

.gpro-faq__answer > div {
    padding: 0 0 1.25em;
    line-height: 1.65;
}

/* Ensure content inside answer inherits spacing */
.gpro-faq__answer p:first-child {
    margin-top: 0;
}

.gpro-faq__answer p:last-child {
    margin-bottom: 0;
}
