/* ═══════════════════════════════════════════════════════
   BPTK FAQ Accordion — Frontend Styles
   ───────────────────────────────────────────────────────
   All theme values are CSS custom properties injected
   inline by the PHP shortcode, making every instance
   independently styled.

   Custom property reference (set on .bptk-faq):
     --faq-section-bg      section wrapper background
     --faq-eyebrow-color   eyebrow text colour
     --faq-title-color     section title colour
     --faq-icon-bg         icon square background
     --faq-icon-color      emoji/icon tint colour
     --faq-item-bg         accordion item background
     --faq-item-border     accordion item border
     --faq-question-color  question text colour
     --faq-answer-color    answer text colour
     --faq-chevron-color   chevron icon colour
     --faq-accent-color    active/hover accent

     --faq-eyebrow-size    eyebrow font size (px)
     --faq-title-size      section title font size (px)
     --faq-question-size   question font size (px)
     --faq-answer-size     answer font size (px)
═══════════════════════════════════════════════════════ */

/* ── Fallback defaults ──────────────────────────────── */

.bptk-faq {
    --faq-section-bg:     #f1f5f9;
    --faq-eyebrow-color:  #2d6a4f;
    --faq-title-color:    #0d1b2a;
    --faq-icon-bg:        #d8f3dc;
    --faq-icon-color:     #2d6a4f;
    --faq-item-bg:        #ffffff;
    --faq-item-border:    #e2e8f0;
    --faq-question-color: #0d1b2a;
    --faq-answer-color:   #374151;
    --faq-chevron-color:  #6b7280;
    --faq-accent-color:   #2d6a4f;
    --faq-eyebrow-size:   11px;
    --faq-title-size:     32px;
    --faq-question-size:  16px;
    --faq-answer-size:    15px;

    background:  var(--faq-section-bg);
    border-radius: 18px;
    padding: 48px 52px;
    width: 100%;
    box-sizing: border-box;
    font-family: inherit;
}

.bptk-faq *,
.bptk-faq *::before,
.bptk-faq *::after {
    box-sizing: inherit;
}

/* ══════════════════════════════════════════════════════
   HEADER
══════════════════════════════════════════════════════ */

.bptk-faq-header {
    margin-bottom: 32px;
}

.bptk-faq-header-top {
    display: flex;
    align-items: center;
    gap: 16px;
}

.bptk-faq-header-text {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

/* ── Icon square ────────────────────────────────────── */

.bptk-faq-icon-wrap {
    width: 46px;
    height: 46px;
    border-radius: 11px;
    background: var(--faq-icon-bg);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    overflow: hidden;
}

/* Iconify web component icon rendered inside the icon square */
.bptk-faq-icon-svg,
.bptk-faq-icon-wrap iconify-icon {
    width: 24px;
    height: 24px;
    display: block;
    color: var(--faq-icon-color);
    flex-shrink: 0;
}

/* ── Eyebrow ────────────────────────────────────────── */

.bptk-faq-eyebrow {
    font-size: var(--faq-eyebrow-size) !important;
    font-weight: 700;
    letter-spacing: .09em;
    text-transform: uppercase;
    color: var(--faq-eyebrow-color);
    line-height: 1;
    text-align: left;
}

/* ── Section title ──────────────────────────────────── */

.bptk-faq-title {
    font-size: var(--faq-title-size) !important;
    font-weight: 700;
    color: var(--faq-title-color);
    line-height: 1.18;
    margin: 0;
    padding: 0;
    border: none;
    text-align: left;
}

/* ══════════════════════════════════════════════════════
   ACCORDION LIST
══════════════════════════════════════════════════════ */

.bptk-faq-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
    list-style: none;
    margin: 0;
    padding: 0;
}

/* ── Individual accordion item ──────────────────────── */

.bptk-faq-item {
    background:    var(--faq-item-bg);
    border:        1px solid var(--faq-item-border);
    border-radius: 10px;
    overflow:      hidden;
    transition:    box-shadow .2s ease, border-color .2s ease;
}

.bptk-faq-item:hover {
    box-shadow:   0 2px 12px rgba(0, 0, 0, .07);
    border-color: color-mix(in srgb, var(--faq-item-border) 60%, var(--faq-accent-color) 40%);
}

.bptk-faq-item.is-open {
    box-shadow: 0 4px 16px rgba(0, 0, 0, .08);
}

/* ── Question button ────────────────────────────────── */

.bptk-faq-question {
    width:           100%;
    display:         flex;
    align-items:     center;
    justify-content: space-between;
    gap:             20px;
    padding:         20px 26px;
    background:      none;
    border:          none;
    cursor:          pointer;
    text-align:      left !important;
    color:           var(--faq-question-color);
    font-size:       var(--faq-question-size) !important;
    font-weight:     500;
    line-height:     1.4;
    font-family:     inherit;
    transition:      color .18s;
}

.bptk-faq-question:hover,
.bptk-faq-item.is-open .bptk-faq-question {
    color: var(--faq-accent-color);
}

.bptk-faq-question:focus-visible {
    outline: 2px solid var(--faq-accent-color);
    outline-offset: -2px;
    border-radius: 10px;
}

.bptk-faq-question-text {
    flex: 1;
}

/* ── Chevron icon ───────────────────────────────────── */

.bptk-faq-chevron {
    display:          flex;
    align-items:      center;
    justify-content:  center;
    flex-shrink:      0;
    color:            var(--faq-chevron-color);
    transition:       transform .32s cubic-bezier(.4,0,.2,1), color .18s;
    width:            24px;
    height:           24px;
}

.bptk-faq-chevron svg {
    display: block;
}

.bptk-faq-item.is-open .bptk-faq-chevron {
    transform: rotate(180deg);
    color:     var(--faq-accent-color);
}

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

.bptk-faq-answer {
    overflow:   hidden;
    max-height: 0;              /* JS animates this */
    transition: max-height .35s cubic-bezier(.4,0,.2,1);
}

/* Respect user motion preferences */
@media (prefers-reduced-motion: reduce) {
    .bptk-faq-answer {
        transition: none;
    }
    .bptk-faq-chevron {
        transition: none;
    }
}

.bptk-faq-answer-inner {
    padding:     4px 26px 24px;
    font-size:   var(--faq-answer-size) !important;
    color:       var(--faq-answer-color);
    line-height: 1.7;
    text-align:  left;
}

.bptk-faq-answer-inner > *:first-child { margin-top: 0; }
.bptk-faq-answer-inner > *:last-child  { margin-bottom: 0; }

.bptk-faq-answer-inner p {
    margin: 0 0 .75em;
}

.bptk-faq-answer-inner ul,
.bptk-faq-answer-inner ol {
    padding-left: 1.4em;
    margin: 0 0 .75em;
}

.bptk-faq-answer-inner a {
    color:           var(--faq-accent-color);
    text-decoration: underline;
}

.bptk-faq-answer-inner a:hover {
    opacity: .8;
}

/* ══════════════════════════════════════════════════════
   RESPONSIVE
══════════════════════════════════════════════════════ */

@media (max-width: 900px) {
    .bptk-faq {
        padding: 36px 36px;
    }
}

@media (max-width: 600px) {
    .bptk-faq {
        padding:       24px 20px;
        border-radius: 12px;
    }

    .bptk-faq-header {
        margin-bottom: 24px;
    }

    .bptk-faq-title {
        /* Clamp so very large title-size values don't overflow on mobile */
        font-size: clamp(22px, 6vw, var(--faq-title-size));
    }

    .bptk-faq-list {
        gap: 8px;
    }

    .bptk-faq-question {
        padding:   16px 18px;
        font-size: max(14px, var(--faq-question-size));
        gap:       14px;
    }

    .bptk-faq-answer-inner {
        padding:   2px 18px 18px;
        font-size: max(13px, var(--faq-answer-size));
    }
}
