/* =============================================================
   TPF FAQ – Frontend styles
   Orange brand colors: #f37021
   ============================================================= */

/* ---------- Custom properties (brand colors from site) ---------- */
.tpf-faq {
    --tpf-orange:      #f37021;
    --tpf-orange-dark: #d4611a;
    --tpf-orange-bg:   #fff4ed;
    --tpf-border:      #ffffff;
    --tpf-text:        #1a1a1a;
    --tpf-text-muted:  #5a5a5a;
    --tpf-white:       #ffffff;
    --tpf-radius:      10px;
    --tpf-shadow:      0 2px 12px rgba(243, 112, 33, 0.08);
    --tpf-shadow-open: 0 4px 24px rgba(243, 112, 33, 0.16);
    --tpf-duration:    0.32s;
    --tpf-ease:        cubic-bezier(0.4, 0, 0.2, 1);

    width: 70%;

    padding: 0;
}

/* ---------- Individual item ---------- */
.tpf-faq__item {
    background: var(--tpf-white);
    border: 1.5px solid var(--tpf-border);
    border-radius: var(--tpf-radius);
    margin-bottom: 10px;
    box-shadow: var(--tpf-shadow);
    overflow: hidden;
    transition:
        border-color var(--tpf-duration) var(--tpf-ease),
        box-shadow var(--tpf-duration) var(--tpf-ease);
}

.tpf-faq__item:last-child {
    margin-bottom: 0;
}

.tpf-faq__item.is-open {
    border-color: var(--tpf-orange);
    box-shadow: var(--tpf-shadow-open);
}

/* ---------- Question button ---------- */
.tpf-faq__question {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    width: 100%;
    background: var(--tpf-white);
    border: none;
    padding: 20px 24px;
    text-align: left;
    cursor: pointer;
    color: var(--tpf-text);
    font-size: 1rem;
    font-weight: 600;
    line-height: 1.45;
    font-family: inherit;
    transition:
        background var(--tpf-duration) var(--tpf-ease),
        color var(--tpf-duration) var(--tpf-ease);
}

.tpf-faq__question:hover {
    background: var(--tpf-orange-bg);
    color: var(--tpf-orange);
}

.tpf-faq__item.is-open .tpf-faq__question {
    background: var(--tpf-orange-bg);
    color: var(--tpf-orange);
}

.tpf-faq__question:focus-visible {
    outline: 2px solid var(--tpf-orange);
    outline-offset: -2px;
}

.tpf-faq__question-text {
    flex: 1;
}

/* ---------- Animated chevron icon ---------- */
.tpf-faq__icon {
    flex-shrink: 0;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    background: var(--tpf-orange-bg);
    border: 1.5px solid var(--tpf-border);
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    transition:
        background var(--tpf-duration) var(--tpf-ease),
        border-color var(--tpf-duration) var(--tpf-ease),
        transform var(--tpf-duration) var(--tpf-ease);
}

/* Plus cross made with pseudo-elements */
.tpf-faq__icon::before,
.tpf-faq__icon::after {
    content: '';
    position: absolute;
    background: var(--tpf-orange);
    border-radius: 2px;
    transition: transform var(--tpf-duration) var(--tpf-ease), opacity var(--tpf-duration) var(--tpf-ease);
}

/* Horizontal bar */
.tpf-faq__icon::before {
    width: 12px;
    height: 2px;
}

/* Vertical bar */
.tpf-faq__icon::after {
    width: 2px;
    height: 12px;
}

/* Open state: rotate vertical bar to create minus */
.tpf-faq__item.is-open .tpf-faq__icon {
    background: var(--tpf-orange);
    border-color: var(--tpf-orange);
    transform: rotate(45deg);
}

.tpf-faq__item.is-open .tpf-faq__icon::before,
.tpf-faq__item.is-open .tpf-faq__icon::after {
    background: #fff;
}

/* ---------- Answer panel ---------- */
.tpf-faq__answer {
    overflow: hidden;
    /* height managed by JS */
    transition: height var(--tpf-duration) var(--tpf-ease);
}

.tpf-faq__answer[hidden] {
    display: block !important; /* override, height drives visibility */
    height: 0 !important;
}

.tpf-faq__answer-inner {
    padding: 0 24px 22px;
    color: var(--tpf-text-muted);
    font-size: 0.95rem;
    line-height: 1.7;
    border-top: 1px solid var(--tpf-border);
    padding-top: 18px;
}

.tpf-faq__answer-inner p:first-child { margin-top: 0; }
.tpf-faq__answer-inner p:last-child  { margin-bottom: 0; }

.tpf-faq__answer-inner a {
    color: var(--tpf-orange);
    text-decoration: underline;
    text-underline-offset: 2px;
}

.tpf-faq__answer-inner a:hover {
    color: var(--tpf-orange-dark);
}

.tpf-faq__answer-inner ul,
.tpf-faq__answer-inner ol {
    padding-left: 1.4em;
}

/* ---------- Responsive ---------- */
@media (max-width: 600px) {
    .tpf-faq__question {
        padding: 16px 18px;
        font-size: 0.95rem;
    }
    .tpf-faq__answer-inner {
        padding: 14px 18px 18px;
    }
}

/* ---------- Reduced motion ---------- */
@media (prefers-reduced-motion: reduce) {
    .tpf-faq__item,
    .tpf-faq__question,
    .tpf-faq__icon,
    .tpf-faq__icon::before,
    .tpf-faq__icon::after,
    .tpf-faq__answer {
        transition: none !important;
    }
}

/* ---------- Tablet / mobile full width ---------- */
@media (max-width: 992px) {
    .tpf-faq {
        width: 100%;
    }
}
