/* ============================================================
   DirectoryPress FAQ — scoped accordion styles
   ============================================================ */

.dp-faq {
    margin: 2rem 0;
    font-family: inherit;
    color: inherit;
}

.dp-faq__heading {
    font-size: 1.35rem;
    font-weight: 700;
    margin: 0 0 1rem;
    padding: 0;
    line-height: 1.3;
}

/* ---- Accordion list ---- */
.dp-faq__list {
    border-radius: 8px;
    overflow: hidden;
    border: 1px solid #e2e5ea;
}

/* ---- Each item ---- */
.dp-faq__item {
    border-bottom: 1px solid #e2e5ea;
    background: #fff;
    transition: background 0.15s ease;
}

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

.dp-faq__item[open] {
    background: #f8f9fc;
}

/* ---- Question (summary) ---- */
.dp-faq__question {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 1rem 1.25rem;
    cursor: pointer;
    list-style: none;
    font-weight: 600;
    font-size: 0.975rem;
    line-height: 1.4;
    user-select: none;
    -webkit-user-select: none;
}

/* Remove default marker in all browsers */
.dp-faq__question::-webkit-details-marker { display: none; }
.dp-faq__question::marker               { display: none; }

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

/* ---- Chevron icon ---- */
.dp-faq__icon {
    flex-shrink: 0;
    width: 20px;
    height: 20px;
    position: relative;
    transition: transform 0.25s ease;
}

.dp-faq__icon::before,
.dp-faq__icon::after {
    content: '';
    position: absolute;
    background: currentColor;
    border-radius: 2px;
    transition: transform 0.25s ease;
}

/* Plus shape by default (closed) */
.dp-faq__icon::before {
    width: 12px;
    height: 2px;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
}

.dp-faq__icon::after {
    width: 2px;
    height: 12px;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    transition: transform 0.25s ease, opacity 0.25s ease;
}

/* Minus shape when open */
.dp-faq__item[open] .dp-faq__icon::after {
    transform: translate(-50%, -50%) rotate(90deg);
    opacity: 0;
}

/* ---- Answer ---- */
.dp-faq__answer {
    padding: 0 1.25rem 1rem;
    font-size: 0.925rem;
    line-height: 1.7;
    color: #444;
    overflow: hidden;
}

/* JS-enhanced smooth animation — height transition driven by frontend.js */
.dp-faq__answer.dp-faq--animating {
    transition: max-height 0.3s ease, opacity 0.3s ease, padding 0.3s ease;
    overflow: hidden;
}

/* ---- Focus ring ---- */
.dp-faq__question:focus-visible {
    outline: 2px solid #4a90e2;
    outline-offset: -2px;
}

/* ---- Mobile ---- */
@media (max-width: 600px) {
    .dp-faq__heading {
        font-size: 1.15rem;
    }
    .dp-faq__question {
        padding: 0.85rem 1rem;
        font-size: 0.9rem;
    }
    .dp-faq__answer {
        padding: 0 1rem 0.85rem;
        font-size: 0.875rem;
    }
}
