/* 
 * Stylowy FAQ Accordion - wersja 1.1.0
 * CSS z zachowaniem tagów h3 i bez efektu przesunięcia
 * Obsługa zarówno treści postów jak i opisów kategorii
 */

.stylowy-faq-container {
    max-width: 100%;
    margin: 2rem 0;
    font-family: inherit;
}

.stylowy-faq-header {
    margin-bottom: 1.5rem;
    font-size: 1.8rem;
    color: #333;
    border-bottom: none !important;
    padding-bottom: 0.5rem;
}

.stylowy-faq-accordion {
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

/* Reset dla wszystkich elementów */
.stylowy-faq-item {
    background: #fff;
    border-bottom: 1px solid #eaeaea;
    overflow: hidden;
}

.stylowy-faq-item:last-child {
    border-bottom: none;
}

/* Style dla pytań (h3) */
.stylowy-faq-question {
    /* Reset wszystkich stylów h3, aby zapewnić konsekwencję */
    all: initial;
    font-family: inherit;
    
    /* Ustawienie stylu pytania */
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1.2rem;
    padding-left: calc(1.2rem + 4px); /* Kompensacja za wskaźnik */
    margin: 0;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: background-color 0.3s ease, color 0.3s ease;
    color: #2c3e50;
    background-color: #f8f9fa;
    position: relative;
    width: 100%;
    box-sizing: border-box;
}

/* Dodanie wizualnego wskaźnika aktywności */
.stylowy-faq-question::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    height: 100%;
    width: 4px;
    background-color: transparent;
    transition: background-color 0.3s ease;
}

.stylowy-faq-question:hover {
    background-color: #f0f4f8;
}

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

.stylowy-faq-icon {
    width: 20px;
    height: 20px;
    position: relative;
    transition: transform 0.3s ease;
    flex-shrink: 0;
    margin-left: 15px;
}

.stylowy-faq-icon:before,
.stylowy-faq-icon:after {
    content: '';
    position: absolute;
    background-color: #4a90e2;
    transition: transform 0.3s ease;
}

.stylowy-faq-icon:before {
    top: 9px;
    left: 0;
    width: 100%;
    height: 2px;
}

.stylowy-faq-icon:after {
    top: 0;
    left: 9px;
    width: 2px;
    height: 100%;
}

/* Style dla aktywnego stanu */
.stylowy-faq-item.active .stylowy-faq-icon:after {
    transform: rotate(90deg);
}

.stylowy-faq-item.active .stylowy-faq-question {
    background-color: #f0f4f8;
    color: #4a90e2;
}

.stylowy-faq-item.active .stylowy-faq-question::before {
    background-color: #4a90e2;
}

/* Stały padding dla elementu odpowiedzi */
.stylowy-faq-answer {
    background-color: #ffffff;
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.4s ease;
    box-sizing: border-box;
}

/* Wewnętrzny div dla odpowiedzi zapobiega przesunięciu */
.stylowy-faq-answer-inner {
    padding: 1.2rem;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.stylowy-faq-item.active .stylowy-faq-answer {
    max-height: 5000px;
}

.stylowy-faq-item.active .stylowy-faq-answer-inner {
    opacity: 1;
}

.stylowy-faq-answer p:last-child {
    margin-bottom: 0;
}

/* Style dla list w odpowiedziach */
.stylowy-faq-answer ul, 
.stylowy-faq-answer ol {
    padding-left: 1.5rem;
    margin-bottom: 1rem;
}

.stylowy-faq-answer li {
    margin-bottom: 0.5rem;
}

/* Style dla urządzeń mobilnych */
@media (max-width: 768px) {
    .stylowy-faq-question {
        padding: 1rem;
        padding-left: calc(1rem + 4px);
    }
    
    .stylowy-faq-answer-inner {
        padding: 1rem;
    }
}

/* Dodatkowe style dla obsługi opisów kategorii */
.taxonomy-description .stylowy-faq-container {
    margin-top: 1.5rem;
}