/**
 * ITSWEBER CMS – FAQ Accordion Plugin
 * Accessible, animated accordion with Schema.org support.
 *
 * @author  Benny Weber (ITSWEBER)
 * @version 1.0.0
 */

/* ═══════════════════════════════════════════════════════════════════
   Section Base
   ═══════════════════════════════════════════════════════════════════ */
.faq-section {
    padding: 5rem 0;
}

/* ── Header ────────────────────────────────────────────────────── */
.faq-header {
    text-align: center;
    margin-bottom: 3rem;
}
.faq-label {
    font-size: 0.875rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--color-primary, #15779b);
    margin: 0 0 0.5rem;
}
.faq-title {
    font-size: clamp(1.5rem, 3vw, 2.25rem);
    font-weight: 800;
    letter-spacing: -0.02em;
    line-height: 1.2;
    margin: 0;
    color: var(--color-text, #1a1a2e);
}

/* ═══════════════════════════════════════════════════════════════════
   Accordion Container
   ═══════════════════════════════════════════════════════════════════ */
.faq-accordion {
    max-width: 800px;
    margin: 0 auto;
}

/* ═══════════════════════════════════════════════════════════════════
   FAQ Item
   ═══════════════════════════════════════════════════════════════════ */
.faq-item {
    border-bottom: 1px solid var(--color-border, rgba(0, 0, 0, 0.08));
}
.faq-item:first-child {
    border-top: 1px solid var(--color-border, rgba(0, 0, 0, 0.08));
}

/* ── Trigger Button ────────────────────────────────────────────── */
.faq-trigger {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    width: 100%;
    padding: 1.25rem 0;
    background: none;
    border: none;
    cursor: pointer;
    font-family: inherit;
    font-size: 1.0625rem;
    font-weight: 600;
    color: var(--color-text, #1a1a2e);
    text-align: left;
    line-height: 1.4;
    transition: color 0.2s ease;
}
.faq-trigger:hover {
    color: var(--color-primary, #15779b);
}
.faq-trigger:focus-visible {
    outline: 2px solid var(--color-primary, #15779b);
    outline-offset: 2px;
    border-radius: 2px;
}

/* ── Chevron ───────────────────────────────────────────────────── */
.faq-chevron {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    flex-shrink: 0;
    border-radius: 50%;
    background: var(--color-bg-alt, #f5f5f5);
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1),
                background 0.2s ease;
}
.faq-chevron::before {
    content: '';
    display: block;
    width: 0;
    height: 0;
    border-left: 5px solid transparent;
    border-right: 5px solid transparent;
    border-top: 5.5px solid currentColor;
    opacity: 0.6;
}
.faq-trigger[aria-expanded="true"] .faq-chevron {
    transform: rotate(180deg);
    background: var(--color-primary-bg, rgba(21, 119, 155, 0.1));
}

/* ═══════════════════════════════════════════════════════════════════
   Panel (Answer)
   ═══════════════════════════════════════════════════════════════════ */
.faq-panel {
    overflow: hidden;
}

/* Smooth animation mode */
.faq--animate-smooth .faq-panel {
    max-height: 0;
    opacity: 0;
    transition: max-height 0.35s cubic-bezier(0.4, 0, 0.2, 1),
                opacity 0.25s ease;
}
.faq--animate-smooth .faq-panel[aria-hidden="false"] {
    max-height: 600px;
    opacity: 1;
}

/* Instant mode — no animation */
.faq--animate-instant .faq-panel[hidden] {
    display: none;
}

.faq-answer {
    padding: 0 0 1.25rem;
    font-size: 0.9375rem;
    line-height: 1.7;
    color: var(--color-text-light, #555);
}
.faq-answer p { margin: 0 0 0.75em; }
.faq-answer p:last-child { margin-bottom: 0; }
.faq-answer a { color: var(--color-primary, #15779b); text-decoration: underline; }
.faq-answer ul, .faq-answer ol { margin: 0.5em 0; padding-left: 1.5em; }
.faq-answer li { margin-bottom: 0.25em; }

/* ═══════════════════════════════════════════════════════════════════
   Color Scheme Overrides
   ═══════════════════════════════════════════════════════════════════ */
.dark-section .faq-title,
.dark-section .faq-trigger { color: #fff; }
.dark-section .faq-answer  { color: rgba(255, 255, 255, 0.75); }
.dark-section .faq-item    { border-color: rgba(255, 255, 255, 0.12); }
.dark-section .faq-chevron { background: rgba(255, 255, 255, 0.1); }
.dark-section .faq-trigger[aria-expanded="true"] .faq-chevron {
    background: rgba(255, 255, 255, 0.2);
}

/* ═══════════════════════════════════════════════════════════════════
   Accessibility: prefers-reduced-motion
   ═══════════════════════════════════════════════════════════════════ */
@media (prefers-reduced-motion: reduce) {
    .faq-panel,
    .faq-chevron {
        transition: none !important;
    }
}

/* ═══════════════════════════════════════════════════════════════════
   Responsive
   ═══════════════════════════════════════════════════════════════════ */
@media (max-width: 768px) {
    .faq-section { padding: 3.5rem 0; }
    .faq-header  { margin-bottom: 2rem; }
    .faq-trigger { font-size: 1rem; padding: 1rem 0; }
    .faq-answer  { font-size: 0.875rem; }
}
