/**
 * FAQ Shortcode Styles
 *
 * BEM naming convention: .bf-faq (block), __element, --modifier
 * Accessible, responsive, and SEO-friendly accordion styles.
 *
 * @since 1.1.0
 */

/* Container */
.bf-faq {
    margin: 1.5em 0;
    font-family: inherit;
}

/* Title */
.bf-faq__title {
    margin: 0 0 1em;
    font-size: 1.5em;
    font-weight: 600;
    line-height: 1.3;
}

/* Definition list reset */
.bf-faq__list {
    margin: 0;
    padding: 0;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    overflow: hidden;
}

/* Individual FAQ item */
.bf-faq__item {
    border-bottom: 1px solid #e0e0e0;
}

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

/* Question (dt) */
.bf-faq__question {
    margin: 0;
    padding: 0;
}

/* Question button */
.bf-faq__question-btn {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
    padding: 1em 1.25em;
    margin: 0;
    border: none;
    background: transparent;
    color: #333;
    font-family: inherit;
    font-size: 1em;
    font-weight: 600;
    line-height: 1.4;
    text-align: left;
    cursor: pointer;
    transition: background-color 0.2s ease;
    gap: 1em;
}

.bf-faq__question-btn:hover {
    background: rgba(0, 0, 0, 0.05);
}

.bf-faq__question-btn:focus {
    outline: 2px solid #0066cc;
    outline-offset: -2px;
}

.bf-faq__question-btn:focus:not(:focus-visible) {
    outline: none;
}

.bf-faq__question-btn:focus-visible {
    outline: 2px solid #0066cc;
    outline-offset: -2px;
}

/* Question text */
.bf-faq__question-btn span {
    flex: 1;
}

/* Chevron icon */
.bf-faq__question-icon {
    flex-shrink: 0;
    width: 20px;
    height: 20px;
    color: #666;
    transition: transform 0.3s ease;
}

/* Rotate chevron when open */
.bf-faq__item--open .bf-faq__question-icon {
    transform: rotate(180deg);
}

/* Answer (dd) */
.bf-faq__answer {
    margin: 0;
    overflow: hidden;
}

/* Hidden state handled by HTML attribute, but also set display for older browsers */
.bf-faq__answer[hidden] {
    display: none;
}

/* Answer content wrapper */
.bf-faq__answer-content {
    padding: 0 1.25em 1.25em;
    line-height: 1.6;
}

/* Answer content typography */
.bf-faq__answer-content p {
    margin: 0 0 1em;
}

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

.bf-faq__answer-content ul,
.bf-faq__answer-content ol {
    margin: 0 0 1em;
    padding-left: 1.5em;
}

.bf-faq__answer-content ul:last-child,
.bf-faq__answer-content ol:last-child {
    margin-bottom: 0;
}

.bf-faq__answer-content li {
    margin-bottom: 0.5em;
}

.bf-faq__answer-content li:last-child {
    margin-bottom: 0;
}

.bf-faq__answer-content a {
    color: #0066cc;
    text-decoration: underline;
}

.bf-faq__answer-content a:hover {
    text-decoration: none;
}

/* Animation for smooth open/close */
.bf-faq__answer.bf-faq__answer--animating {
    display: block !important;
    transition: height 0.3s ease;
    overflow: hidden;
}

/* Open item styling */
.bf-faq__item--open .bf-faq__question-btn {
    background: transparent;
}

/* Responsive adjustments */
@media (max-width: 600px) {
    .bf-faq__question-btn {
        padding: 0.875em 1em;
        font-size: 0.9375em;
    }

    .bf-faq__answer-content {
        padding: 0 1em 1em;
    }

    .bf-faq__question-icon {
        width: 18px;
        height: 18px;
    }
}

/* Reduced motion preference */
@media (prefers-reduced-motion: reduce) {
    .bf-faq__question-icon,
    .bf-faq__answer.bf-faq__answer--animating {
        transition: none;
    }
}

/* Print styles */
@media print {
    .bf-faq__answer[hidden] {
        display: block !important;
    }

    .bf-faq__question-icon {
        display: none;
    }

    .bf-faq__list {
        border: none;
    }

    .bf-faq__item {
        border-bottom: 1px solid #ccc;
        page-break-inside: avoid;
    }

    .bf-faq__question-btn {
        background: none;
        padding-left: 0;
        padding-right: 0;
    }

    .bf-faq__answer-content {
        padding-left: 0;
        padding-right: 0;
    }
}
