/* Winsiders FAQ — Frontend styles
 *
 * Uses local CSS variables (--wfaq-*) mapped to Enfold's section color
 * variables. Each Enfold color zone (main_color, alternate_color,
 * header_color, footer_color, socket_color) sets its own mapping,
 * so all components below use the same --wfaq-* vars regardless of
 * which section the FAQ element lives in.
 */

/* ─── Enfold zone variable mappings ─────────────────────────────── */

.winsiders-faq-section {
    --wfaq-bg: var(--enfold-main-color-bg, #fff);
    --wfaq-bg2: var(--enfold-main-color-bg2, #f8f8f8);
    --wfaq-color: var(--enfold-main-color-color, #3F3D3E);
    --wfaq-heading: var(--enfold-main-color-heading, #3F3D3E);
    --wfaq-meta: var(--enfold-main-color-meta, #7a7677);
    --wfaq-primary: var(--enfold-main-color-primary, #E3001B);
    --wfaq-constant-font: var(--enfold-main-color-constant-font, #fff);
    --wfaq-border: var(--enfold-main-color-border, #e8e6e6);
}

.main_color .winsiders-faq-section {
    --wfaq-bg: var(--enfold-main-color-bg, #fff);
    --wfaq-bg2: var(--enfold-main-color-bg2, #f8f8f8);
    --wfaq-color: var(--enfold-main-color-color, #3F3D3E);
    --wfaq-heading: var(--enfold-main-color-heading, #3F3D3E);
    --wfaq-meta: var(--enfold-main-color-meta, #7a7677);
    --wfaq-primary: var(--enfold-main-color-primary, #E3001B);
    --wfaq-constant-font: var(--enfold-main-color-constant-font, #fff);
    --wfaq-border: var(--enfold-main-color-border, #e8e6e6);
}

.alternate_color .winsiders-faq-section {
    --wfaq-bg: var(--enfold-alternate-color-bg, #f5f4f4);
    --wfaq-bg2: var(--enfold-alternate-color-bg2, #ffffff);
    --wfaq-color: var(--enfold-alternate-color-color, #3F3D3E);
    --wfaq-heading: var(--enfold-alternate-color-heading, #3F3D3E);
    --wfaq-meta: var(--enfold-alternate-color-meta, #7a7677);
    --wfaq-primary: var(--enfold-alternate-color-primary, #E3001B);
    --wfaq-constant-font: var(--enfold-alternate-color-constant-font, #fff);
    --wfaq-border: var(--enfold-alternate-color-border, #e8e6e6);
}

.footer_color .winsiders-faq-section {
    --wfaq-bg: var(--enfold-footer-color-bg, #3F3D3E);
    --wfaq-bg2: var(--enfold-footer-color-bg2, #3F3D3E);
    --wfaq-color: var(--enfold-footer-color-color, #cfcfd0);
    --wfaq-heading: var(--enfold-footer-color-heading, #ffffff);
    --wfaq-meta: var(--enfold-footer-color-meta, #9a9899);
    --wfaq-primary: var(--enfold-footer-color-primary, #ffffff);
    --wfaq-constant-font: var(--enfold-footer-color-constant-font, #3F3D3E);
    --wfaq-border: var(--enfold-footer-color-border, #575455);
}

/* ─── Base ──────────────────────────────────────────────────────── */

.winsiders-faq-section {
    margin: 0 auto;
}

.winsiders-faq-section__head {
    margin-bottom: 24px;
}

.winsiders-faq-section__head h2 {
    margin-top: 0;
}

.winsiders-faq .toggler {
    display: block;
    margin: 0;
    font-weight: 700;
    letter-spacing: 0;
}

.winsiders-faq .toggle_content {
    font-size: 16px;
    line-height: 1.7;
}

/* ─── Search ─────────────────────────────────────────────────────── */

.wfaq-search {
    position: relative;
    margin-bottom: 24px;
}

#top input[type="search"].wfaq-search-input {
    width: 100%;
    padding: 12px 16px 12px 48px;
    font-size: 16px;
    line-height: 1.5;
    border: 1px solid var(--wfaq-border);
    border-radius: 8px;
    background: var(--wfaq-bg);
    color: var(--wfaq-color);
    box-sizing: border-box;
    transition: border-color 0.2s, box-shadow 0.2s;
}

#top input[type="search"].wfaq-search-input::placeholder {
    color: var(--wfaq-meta);
}

#top input[type="search"].wfaq-search-input:focus {
    outline: none;
    border-color: var(--wfaq-primary);
    box-shadow: 0 0 0 3px rgba(227, 0, 27, 0.12);
}

.wfaq-search-icon {
    position: absolute;
    left: 16px;
    top: 50%;
    transform: translateY(-50%);
    width: 18px;
    height: 18px;
    pointer-events: none;
    opacity: 0.4;
    color: var(--wfaq-meta);
}

.wfaq-search-icon::before {
    content: "";
    position: absolute;
    width: 12px;
    height: 12px;
    border: 2px solid currentColor;
    border-radius: 50%;
    top: 0;
    left: 0;
}

.wfaq-search-icon::after {
    content: "";
    position: absolute;
    width: 7px;
    height: 2px;
    background: currentColor;
    bottom: 1px;
    right: 0;
    transform: rotate(45deg);
    transform-origin: right center;
}

.wfaq-search-suggestions {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    z-index: 100;
    background: var(--wfaq-bg);
    border: 1px solid var(--wfaq-border);
    border-radius: 0 0 8px 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    max-height: 280px;
    overflow-y: auto;
}

.wfaq-suggestion-item {
    padding: 10px 16px;
    cursor: pointer;
    font-size: 15px;
    border-bottom: 1px solid var(--wfaq-border);
    color: var(--wfaq-color);
    transition: background 0.15s;
}

.wfaq-suggestion-item:last-child {
    border-bottom: none;
}

.wfaq-suggestion-item:hover,
.wfaq-suggestion-item:focus {
    background: var(--wfaq-bg2);
    outline: none;
}

/* ─── Filter ─────────────────────────────────────────────────────── */

.wfaq-filter {
    margin-bottom: 24px;
}

.wfaq-filter-label {
    display: inline-block;
    font-weight: 600;
    margin-right: 12px;
    font-size: 14px;
    color: var(--wfaq-heading);
}

/* Tag style */
.wfaq-filter-tags {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px;
}

.wfaq-filter-tag {
    display: inline-flex;
    align-items: center;
    padding: 6px 14px;
    font-size: 14px;
    border: 1px solid var(--wfaq-border);
    border-radius: 20px;
    background: transparent;
    color: var(--wfaq-color);
    cursor: pointer;
    transition: all 0.2s;
}

.wfaq-filter-tag:hover {
    border-color: var(--wfaq-primary);
    color: var(--wfaq-primary);
}

.wfaq-filter-tag.is-active {
    background: var(--wfaq-primary);
    color: var(--wfaq-constant-font);
    border-color: var(--wfaq-primary);
}

.wfaq-filter-tag.is-active .wfaq-filter-count {
    color: rgba(255, 255, 255, 0.8);
}

.wfaq-filter-count {
    font-size: 12px;
    opacity: 0.7;
    margin-left: 2px;
}

/* Dropdown style */
.wfaq-filter-dropdown-wrap {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    flex-wrap: wrap;
}

.wfaq-filter-select {
    min-width: 200px;
    max-width: 400px;
    padding: 8px 12px;
    font-size: 14px;
    border: 1px solid var(--wfaq-border);
    border-radius: 6px;
    background: var(--wfaq-bg);
    color: var(--wfaq-color);
}

.wfaq-filter-clear {
    padding: 8px 16px;
    font-size: 14px;
    border: 1px solid var(--wfaq-border);
    border-radius: 6px;
    background: transparent;
    color: var(--wfaq-color);
    cursor: pointer;
    transition: all 0.2s;
}

.wfaq-filter-clear:hover {
    background: var(--wfaq-bg2);
}

/* ─── Grouping ───────────────────────────────────────────────────── */

.wfaq-groups {
    margin-bottom: 16px;
}

.wfaq-group {
    margin-bottom: 32px;
}

.wfaq-group:last-child {
    margin-bottom: 0;
}

.wfaq-group-title {
    margin: 0 0 16px;
}

.wfaq-group-hidden,
.wfaq-group-page-hidden {
    display: none;
}

/* ─── Pagination ─────────────────────────────────────────────────── */

.wfaq-pagination {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    margin-top: 32px;
    padding-top: 24px;
    flex-wrap: wrap;
}

.wfaq-page-btn {
    min-width: 40px;
    height: 40px;
    padding: 0 12px;
    font-size: 14px;
    border: 1px solid var(--wfaq-border);
    border-radius: 6px;
    background: transparent;
    color: var(--wfaq-color);
    cursor: pointer;
    transition: all 0.2s;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.wfaq-page-btn:hover:not(:disabled):not(.is-active) {
    border-color: var(--wfaq-primary);
    color: var(--wfaq-primary);
}

.wfaq-page-btn.is-active {
    background: var(--wfaq-primary);
    color: var(--wfaq-constant-font);
    border-color: var(--wfaq-primary);
}

.wfaq-page-btn:disabled {
    opacity: 0.4;
    cursor: not-allowed;
}

.wfaq-page-numbers {
    display: flex;
    align-items: center;
    gap: 4px;
}

/* ─── Item visibility ────────────────────────────────────────────── */

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

/* ─── No results ─────────────────────────────────────────────────── */

.wfaq-no-results {
    text-align: center;
    padding: 32px 16px;
}

.wfaq-no-results p {
    font-size: 16px;
    color: var(--wfaq-meta);
    margin: 0;
}

/* ─── Publication links in answer ────────────────────────────────── */

.wfaq-faq-links {
    margin-top: 16px;
    padding-top: 12px;
    border-top: 1px solid var(--wfaq-border);
    font-size: 14px;
}

.wfaq-faq-links-label {
    font-weight: 600;
    margin-right: 6px;
    color: var(--wfaq-meta);
}

.wfaq-faq-links a {
    color: var(--wfaq-primary);
    text-decoration: none;
    transition: color 0.2s;
}

.wfaq-faq-links a:hover {
    text-decoration: underline;
}

.wfaq-faq-links-sep {
    margin: 0 4px;
    color: var(--wfaq-meta);
    opacity: 0.5;
}

/* ─── Responsive ─────────────────────────────────────────────────── */

@media (max-width: 767px) {
    .wfaq-filter-tags {
        flex-direction: column;
        align-items: stretch;
    }

    .wfaq-filter-tag {
        width: 100%;
        justify-content: center;
    }

    .wfaq-filter-dropdown-wrap {
        flex-direction: column;
    }

    .wfaq-filter-select {
        width: 100%;
    }

    .wfaq-pagination {
        gap: 4px;
    }

    .wfaq-page-btn {
        min-width: 36px;
        height: 36px;
        font-size: 13px;
    }
}