/* ── FAQ Block ──────────────────────────────────────────────────────────────── */

.faq-block {
    padding: 40px 0;
}

.faq-inner {
    background: var(--wp--preset--color--white);
    border: 1px solid var(--wp--preset--color--purple-100);
    box-shadow: 2px 2px 8px 0 rgba(26, 26, 37, 0.10);
    border-radius: 4px;
    padding: 40px;
}

/* ── Header ──────────────────────────────────────────────────────────────────── */

.faq-header {
    display: flex;
    align-items: center;
    gap: 20px;
    margin-bottom: 32px;
}

.faq-icon-wrap {
    flex-shrink: 0;
    width: 64px;
    height: 64px;
    background: rgba(67, 11, 142, 0.08);
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--wp--preset--color--purple-500);
    line-height: 0;
}

.faq-icon-wrap svg,
.faq-icon-wrap img {
    width: 28px;
    height: 28px;
}

.faq-icon-wrap .dashicons {
    font-size: 24px;
    width: 24px;
    height: 24px;
    color: var(--wp--preset--color--purple-500);
}

.faq-head-text {
    flex: 1;
    min-width: 0;
}

.faq-label {
    margin: 0 0 4px;
    font-size: 12px;
    font-weight: 600;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--wp--preset--color--neutral-300, #888);
    line-height: 1.4;
}

.faq-label--hidden {
    display: none;
}

.faq-title {
    margin: 0;
    font-size: clamp(20px, 2.5vw, 26px);
    font-weight: 700;
    color: var(--wp--preset--color--black);
    line-height: 1.25;
}

/* ── FAQ List ─────────────────────────────────────────────────────────────────── */

.faq-list {
    border-top: 1px solid var(--wp--preset--color--neutral-200, #E5E7EB);
}

.faq-item {
    border-bottom: 1px solid var(--wp--preset--color--neutral-200, #E5E7EB);
}

.faq-item--hidden {
    display: none;
}

/* ── Question button ──────────────────────────────────────────────────────────── */

.faq-question {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    width: 100%;
    padding: 20px 0;
    background: none;
    border: none;
    cursor: pointer;
    text-align: left;
    color: var(--wp--preset--color--black);
    transition: color 0.15s ease;
}

.faq-question:hover {
    color: var(--wp--preset--color--purple-500);
}

.faq-question-text {
    font-size: 16px;
    font-weight: 400;
    line-height: 1.4;
}

.faq-toggle {
    flex-shrink: 0;
    width: 20px;
    height: 20px;
    line-height: 0;
}

.faq-icon-minus {
    display: none;
}

.faq-item.is-open .faq-icon-plus {
    display: none;
}

.faq-item.is-open .faq-icon-minus {
    display: block;
}

/* ── Answer (CSS grid smooth animation) ──────────────────────────────────────── */

.faq-answer {
    display: grid;
    grid-template-rows: 0fr;
    transition: grid-template-rows 0.3s ease;
}

.faq-item.is-open .faq-answer {
    grid-template-rows: 1fr;
}

.faq-answer-inner {
    overflow: hidden;
    padding-bottom: 0;
    transition: padding-bottom 0.3s ease;
    font-size: 15px;
    line-height: 1.65;
    color: var(--wp--preset--color--neutral-300, #555);
}

.faq-item.is-open .faq-answer-inner {
    padding-bottom: 20px;
}

.faq-answer-inner p {
    margin: 0 0 10px;
}

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

.faq-answer-inner ul,
.faq-answer-inner ol {
    margin: 0 0 10px;
    padding-left: 20px;
}

/* ── Footer – Pokaż więcej ──────────────────────────────────────────────────── */

.faq-footer {
    display: flex;
    justify-content: flex-end;
    padding-top: 20px;
}

.faq-footer--hidden {
    display: none;
}

.faq-more-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: none;
    border: none;
    cursor: pointer;
    font-size: 14px;
    font-weight: 600;
    color: var(--wp--preset--color--black);
    padding: 0;
    transition: color 0.15s ease;
}

.faq-more-btn:hover {
    color: var(--wp--preset--color--purple-500);
}

.faq-more-btn svg {
    transition: transform 0.25s ease;
}

.faq-more-btn[aria-expanded="true"] svg {
    transform: rotate(180deg);
}

/* ── Hidden state (no FAQ items) ────────────────────────────────────────────── */

.faq-block--hidden {
    display: none;
}

/* ── Loading state ──────────────────────────────────────────────────────────── */

.faq-block.faq-loading .faq-list {
    opacity: 0.5;
    pointer-events: none;
    transition: opacity 0.2s ease;
}

/* ── Align with ac-results column — only on pages with archive-courses sidebar ── */

@media (min-width: 992px) {
    .faq-block--with-sidebar .faq-inner {
        margin-left: calc(220px + 32px);
    }
}

/* ── Mobile ─────────────────────────────────────────────────────────────────── */

@media (max-width: 767px) {
    .faq-block {
        padding: 24px 0;
    }

    .faq-inner {
        padding: 24px 20px;
        border-radius: 8px;
    }

    .faq-header {
        gap: 14px;
        margin-bottom: 20px;
    }

    .faq-icon-wrap {
        width: 48px;
        height: 48px;
    }

    .faq-icon-wrap svg,
    .faq-icon-wrap img {
        width: 22px;
        height: 22px;
    }

    .faq-question {
        padding: 16px 0;
    }

    .faq-question-text {
        font-size: 14px;
    }
}

/* ── Dark mode ─────────────────────────────────────────────────────────────── */

html[data-theme="dark"] .faq-block {
    background: var(--wp--preset--color--dark, #2E2E39);
}

html[data-theme="dark"] .faq-inner {
    background: var(--wp--preset--color--dark, #2E2E39);
    border-color: rgba(255, 255, 255, .12);
    box-shadow: 0 2px 8px rgba(0, 0, 0, .2);
}

html[data-theme="dark"] .faq-icon-wrap {
    background: rgba(255, 229, 0, .16);
    color: var(--wp--preset--color--yellow, #FFE500);
}

html[data-theme="dark"] .faq-icon-wrap .dashicons {
    color: var(--wp--preset--color--yellow, #FFE500);
}

html[data-theme="dark"] .faq-label {
    color: rgba(255, 255, 255, .5);
}

html[data-theme="dark"] .faq-title {
    color: var(--wp--preset--color--white);
}

html[data-theme="dark"] .faq-list,
html[data-theme="dark"] .faq-item {
    border-color: rgba(255, 255, 255, .12);
}

html[data-theme="dark"] .faq-question {
    color: var(--wp--preset--color--white);
}

html[data-theme="dark"] .faq-question:hover {
    color: var(--wp--preset--color--yellow, #FFE500);
}

html[data-theme="dark"] .faq-answer-inner {
    color: rgba(255, 255, 255, .7);
}

html[data-theme="dark"] .faq-more-btn {
    color: var(--wp--preset--color--white);
}

html[data-theme="dark"] .faq-more-btn:hover {
    color: var(--wp--preset--color--yellow, #FFE500);
}