/* Frontend Styles for Blog FAQ Widget */
.blog-faq-widget {
    margin: 2rem 0;
    font-family: inherit;
}

.faq-accordion-container {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.faq-item {
    border: 2px solid #e1e5e9;
    border-radius: 8px;
    background: #ffffff;
    overflow: hidden;
    transition: all 0.3s ease;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.faq-item:hover {
    border-color: #007cba;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.15);
}

.faq-question-wrapper {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1.5rem;
    background: #f8f9fa;
    border-bottom: 1px solid #e1e5e9;
    cursor: pointer;
    transition: background-color 0.3s ease;
    user-select: none;
}

.faq-question-wrapper:hover {
    background: #e9ecef;
}

.faq-question-wrapper:focus {
    outline: 2px solid #007cba;
    outline-offset: -2px;
}

.faq-question {
    margin: 0;
    font-weight: 600;
    color: #1d2327;
    line-height: 1.4;
    flex: 1;
    padding-right: 1rem;
}

/* Dynamic font sizes support */
.blog-faq-widget[data-question-font-size] .faq-question {
    font-size: var(--question-font-size, 18px);
}

.blog-faq-widget[data-answer-font-size] .faq-answer {
    font-size: var(--answer-font-size, 16px);
}

.faq-toggle-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 24px;
    height: 24px;
    color: #007cba;
    transition: transform 0.3s ease;
    flex-shrink: 0;
}

.faq-toggle-icon svg {
    width: 20px;
    height: 20px;
}

.faq-answer-wrapper {
    max-height: 0;
    overflow: hidden;
    opacity: 0;
    transition: max-height 0.4s ease, opacity 0.3s ease, padding 0.3s ease;
    background: #ffffff;
}

.faq-item-open .faq-answer-wrapper {
    padding: 1.5rem;
}

.faq-answer {
    color: #3c434a;
    line-height: 1.6;
}

.faq-answer p {
    margin: 0 0 1rem 0;
}

.faq-answer p:last-child {
    margin-bottom: 0;
}

.faq-answer ul,
.faq-answer ol {
    margin: 0.5rem 0;
    padding-left: 1.5rem;
}

.faq-answer li {
    margin-bottom: 0.5rem;
}

.faq-answer a {
    color: #007cba;
    text-decoration: none;
}

.faq-answer a:hover {
    text-decoration: underline;
}

/* Heading styles for different levels */
.faq-question.h1 {
    font-size: 1.8rem;
}

.faq-question.h2 {
    font-size: 1.6rem;
}

.faq-question.h3 {
    font-size: 1.4rem;
}

.faq-question.h4 {
    font-size: 1.2rem;
}

.faq-question.h5 {
    font-size: 1.1rem;
}

.faq-question.h6 {
    font-size: 1rem;
}

/* Mobile responsiveness */
@media (max-width: 768px) {
    .faq-question-wrapper {
        padding: 1rem;
    }
    
    .faq-item-open .faq-answer-wrapper {
        padding: 1rem;
    }
    
    .faq-question {
        font-size: 1rem;
        padding-right: 0.5rem;
    }
    
    .faq-question.h1 {
        font-size: 1.4rem;
    }
    
    .faq-question.h2 {
        font-size: 1.3rem;
    }
    
    .faq-question.h3 {
        font-size: 1.2rem;
    }
    
    .faq-question.h4,
    .faq-question.h5,
    .faq-question.h6 {
        font-size: 1.1rem;
    }
}

/* Accessibility improvements */
@media (prefers-reduced-motion: reduce) {
    .faq-item,
    .faq-question-wrapper,
    .faq-toggle-icon,
    .faq-answer-wrapper {
        transition: none;
    }
}

/* High contrast mode support */
@media (prefers-contrast: high) {
    .faq-item {
        border-color: #000000;
    }
    
    .faq-question-wrapper {
        background: #ffffff;
        border-bottom-color: #000000;
    }
    
    .faq-question-wrapper:hover {
        background: #f0f0f0;
    }
    
    .faq-question {
        color: #000000;
    }
    
    .faq-toggle-icon {
        color: #000000;
    }
}