/*
 * FAQ accordion (category, brand and product FAQ). Shared by the Luma and Hyvä themes; a theme only
 * sets the variables on .faq-container. Text size, line height and colour match the theme's other
 * content texts (category intro and bottom text, brand and product description); the defaults are
 * the Luma sites' 15px/1.5 #626262. Open/close and the aria attributes come from
 * Wezz_CategoryFaq::faq-script.phtml. Answers stay in the HTML when closed (also for FAQPage schema).
 */
.faq-container {
    --faq-accent: #f07000;
    --faq-accent-soft: #fdf1e6;
    --faq-border: #e4e4e4;
    --faq-font-size: 15px;
    --faq-line-height: 1.5;
    --faq-text: #626262;
    --faq-heading: #626262;
    --faq-question: #333;
    margin: 40px 0 30px;
}
/* Page Builder rows: no inline padding, so heading/intro/items line up with the page's other texts */
.faq-container [data-content-type="row"] > [data-element="inner"] {
    padding: 0 !important;
}
.faq-container [data-content-type="heading"] {
    margin: 0 0 10px;
    color: var(--faq-heading);
}
.faq-container [data-content-type="text"] {
    margin-bottom: 16px;
    font-size: var(--faq-font-size);
    line-height: var(--faq-line-height);
    color: var(--faq-text);
}
.faq-container [data-content-type="text"] p:last-child {
    margin-bottom: 0;
}

[data-content-type="wezz_faq"] {
    margin-bottom: 8px;
    background: #fff;
    border: 1px solid var(--faq-border);
    font-size: var(--faq-font-size);
    line-height: var(--faq-line-height);
    color: var(--faq-text);
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}
[data-content-type="wezz_faq"]:hover {
    border-color: #cfcfcf;
}
[data-content-type="wezz_faq"].is-open {
    border-color: var(--faq-accent);
    box-shadow: 0 4px 14px rgba(0, 0, 0, 0.06);
}

[data-content-type="wezz_faq"] .faq-items-question {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 14px;
    font-size: var(--faq-font-size);
    font-weight: 700;
    line-height: var(--faq-line-height);
    color: var(--faq-question);
    cursor: pointer;
    user-select: none;
}
[data-content-type="wezz_faq"] .faq-items-question:hover,
[data-content-type="wezz_faq"].is-open .faq-items-question {
    color: var(--faq-accent);
}
[data-content-type="wezz_faq"] .faq-items-question:focus {
    outline: none;
}
[data-content-type="wezz_faq"] .faq-items-question:focus-visible {
    outline: 2px solid var(--faq-accent);
    outline-offset: 2px;
}
/* Plus in a soft circle; turns into a white minus on the accent colour when open */
[data-content-type="wezz_faq"] .faq-items-question::after {
    content: '';
    flex: 0 0 24px;
    height: 24px;
    margin-left: auto;
    border-radius: 50%;
    background:
        linear-gradient(var(--faq-accent), var(--faq-accent)) center / 10px 2px no-repeat,
        linear-gradient(var(--faq-accent), var(--faq-accent)) center / 2px 10px no-repeat,
        var(--faq-accent-soft);
    transition: transform 0.25s ease;
}
[data-content-type="wezz_faq"] .faq-items-question.open::after {
    transform: rotate(180deg);
    background:
        linear-gradient(#fff, #fff) center / 10px 2px no-repeat,
        var(--faq-accent);
}

[data-content-type="wezz_faq"] .faq-items-answer {
    max-height: 0;
    overflow: hidden;
    visibility: hidden;
    transition: max-height 0.25s ease, visibility 0s linear 0.25s;
}
[data-content-type="wezz_faq"] .faq-items-answer.active {
    visibility: visible;
    transition: max-height 0.25s ease, visibility 0s;
}
/* No JS (yet): max-height can't be measured, so just show it */
[data-content-type="wezz_faq"] .faq-items-answer.active:not([style*="max-height"]) {
    max-height: none;
}
[data-content-type="wezz_faq"] .faq-items-answer > div {
    padding: 0 14px 12px;
}
[data-content-type="wezz_faq"] .faq-items-answer p:last-child {
    margin-bottom: 0;
}
[data-content-type="wezz_faq"] .faq-items-answer ul,
[data-content-type="wezz_faq"] .faq-items-answer ol {
    padding-left: 22px;
}
/* Tailwind's reset (Hyvä) removes the markers */
[data-content-type="wezz_faq"] .faq-items-answer ul {
    list-style: disc;
}
[data-content-type="wezz_faq"] .faq-items-answer ol {
    list-style: decimal;
}
[data-content-type="wezz_faq"] .faq-items-answer li {
    margin-bottom: 4px;
}
[data-content-type="wezz_faq"] .faq-items-answer a {
    color: var(--faq-accent);
    text-decoration: underline;
}

@media (max-width: 767px) {
    .faq-container {
        margin-top: 30px;
    }
    [data-content-type="wezz_faq"] .faq-items-question {
        padding: 10px 12px;
    }
    [data-content-type="wezz_faq"] .faq-items-answer > div {
        padding: 0 12px 10px;
    }
}

@media (prefers-reduced-motion: reduce) {
    [data-content-type="wezz_faq"],
    [data-content-type="wezz_faq"] .faq-items-question::after,
    [data-content-type="wezz_faq"] .faq-items-answer,
    [data-content-type="wezz_faq"] .faq-items-answer.active {
        transition: none;
    }
}
