/**
 * FAQ Shortcode Styles
 *
 * Accordion-style FAQ with Schema.org JSON-LD support.
 * BEM naming: .oe-faq (block), __element, --modifier
 *
 * @since 1.0.0
 */

/* ==========================================================================
   Container
   ========================================================================== */

.oe-faq {
    margin: 1.5em 0;
}

.oe-faq__title {
    margin: 0 0 1em;
    font-size: 1.25em;
    font-weight: 600;
    color: var(--oe-color-text-dark);
}

/* ==========================================================================
   FAQ Item
   ========================================================================== */

.oe-faq__item {
    border: 1px solid var(--oe-color-border);
    border-radius: 8px;
    margin-bottom: 0.5em;
    background: var(--oe-color-white);
    overflow: hidden;
    transition: box-shadow 0.2s ease;
}

.oe-faq__item:last-child {
    margin-bottom: 0;
}

.oe-faq__item:hover {
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
}

/* ==========================================================================
   Question (Button)
   ========================================================================== */

.oe-faq__question {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
    padding: 1em 1.25em;
    margin: 0;
    border: none;
    background: transparent;
    text-align: left;
    font-family: inherit;
    font-size: 1em;
    font-weight: 600;
    color: var(--oe-color-text-dark);
    cursor: pointer;
    transition: background-color 0.15s ease;
    gap: 1em;
}

.oe-faq__question:hover {
    background: var(--oe-color-bg);
    color: var(--oe-color-text-dark);
}

.oe-faq__question:focus {
    outline: 2px solid var(--oe-color-primary);
    outline-offset: -2px;
}

.oe-faq__question:focus:not(:focus-visible) {
    outline: none;
}

.oe-faq__item--open .oe-faq__question {
    background: var(--oe-color-primary-tint);
    color: var(--oe-color-primary);
    border-bottom: 1px solid var(--oe-color-primary-a15);
}

.oe-faq__question-text {
    flex: 1;
}

/* ==========================================================================
   Icon
   ========================================================================== */

.oe-faq__icon {
    flex-shrink: 0;
    width: 20px;
    height: 20px;
    color: var(--oe-color-text-light);
    transition: transform 0.3s ease;
}

.oe-faq__item--open .oe-faq__icon {
    transform: rotate(180deg);
}

/* ==========================================================================
   Answer
   ========================================================================== */

.oe-faq__answer {
    overflow: hidden;
    max-height: 0;
    transition: max-height 0.3s ease-out, padding 0.3s ease-out;
}

.oe-faq__answer[hidden] {
    display: block !important; /* Override hidden for animation */
}

.oe-faq__item--open .oe-faq__answer {
    max-height: var(--faq-answer-height, 2000px);
}

.oe-faq__answer-content {
    padding: 10px;
    font-size: 0.9375em;
    color: var(--oe-color-text);
    line-height: 1.6;
}

.oe-faq__answer-content p:first-child {
    margin-top: 0;
}

.oe-faq__answer-content p:last-child {
    margin-bottom: 0;
}

/* ==========================================================================
   Variations: Style modifiers
   ========================================================================== */

/* Minimal style - no borders between items */
.oe-faq--minimal .oe-faq__item {
    border: none;
    border-radius: 0;
    border-bottom: 1px solid var(--oe-color-border);
    margin-bottom: 0;
}

.oe-faq--minimal .oe-faq__item:last-child {
    border-bottom: none;
}

/* Boxed style - stronger borders */
.oe-faq--boxed .oe-faq__item {
    border-width: 2px;
}

.oe-faq--boxed .oe-faq__item--open {
    border-color: var(--oe-color-primary);
}

/* ==========================================================================
   Responsive
   ========================================================================== */

@media (max-width: 640px) {
    .oe-faq__question {
        padding: 0.875em 1em;
        font-size: 0.9375em;
    }

    .oe-faq__answer-content {
        padding: 10px;
        font-size: 0.875em;
    }
}

/* ==========================================================================
   Reduced Motion
   ========================================================================== */

@media (prefers-reduced-motion: reduce) {
    .oe-faq__icon,
    .oe-faq__answer {
        transition: none;
    }
}

/* ==========================================================================
   Print
   ========================================================================== */

@media print {
    .oe-faq__item {
        break-inside: avoid;
        border: 1px solid #ccc;
    }

    .oe-faq__answer {
        max-height: none !important;
        display: block !important;
    }

    .oe-faq__icon {
        display: none;
    }
}