/*
 * GF FAQ Manager — Frontend Styles
 * Matches Grön Folkbildning brand:
 * Forest green #2C5A1E, Yellow #F5C518, Cream #FBF5E4
 */

/* ── Wrapper ── */
.gf-faq-wrap {
    margin: 0;
    padding: 0;
}

/* ── Optional section title ── */
.gf-faq-section-title {
    font-family: 'Playfair Display', serif;
    font-size: clamp(1.3rem, 2.8vw, 1.8rem);
    font-weight: 600;
    color: #141F0A;
    line-height: 1.25;
    margin-bottom: clamp(20px, 3.5vw, 32px);
}

/* ── FAQ list container ── */
.gf-faq-list {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

/* ═══════════════════════════════════
   ACCORDION STYLE (default)
═══════════════════════════════════ */

.gf-faq-item {
    background: #FFFEF9;
    border: 1.5px solid rgba(44, 90, 30, 0.12);
    border-radius: 14px;
    overflow: hidden;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.gf-faq-item[open] {
    border-color: rgba(44, 90, 30, 0.28);
    box-shadow: 0 4px 18px rgba(20, 31, 10, 0.07);
}

/* Summary / question row */
.gf-faq-q {
    list-style: none;
    padding: 17px 20px;
    font-family: 'Montserrat', sans-serif;
    font-size: 0.9rem;
    font-weight: 600;
    color: #141F0A;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 10px;
    line-height: 1.4;
    transition: color 0.15s;
    user-select: none;
}

/* Remove default browser triangle */
.gf-faq-q::-webkit-details-marker { display: none; }
.gf-faq-q::marker { display: none; }

.gf-faq-q:hover { color: #2C5A1E; }

.gf-faq-item[open] .gf-faq-q { color: #2C5A1E; }

/* Emoji icon */
.gf-faq-icon {
    font-size: 1.1em;
    flex-shrink: 0;
    line-height: 1;
}

/* Question text — flex:1 so arrow stays right */
.gf-faq-q-text {
    flex: 1;
}

/* Custom +/× arrow */
.gf-faq-arrow {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    background: rgba(44, 90, 30, 0.08);
    flex-shrink: 0;
    position: relative;
    transition: background 0.2s, transform 0.25s;
}

.gf-faq-arrow::before,
.gf-faq-arrow::after {
    content: '';
    position: absolute;
    background: #2C5A1E;
    border-radius: 2px;
    left: 50%;
    top: 50%;
    transform: translate(-50%, -50%);
    transition: transform 0.25s, opacity 0.2s;
}

/* Horizontal bar */
.gf-faq-arrow::before {
    width: 10px;
    height: 2px;
}

/* Vertical bar */
.gf-faq-arrow::after {
    width: 2px;
    height: 10px;
}

/* Rotate to × when open */
.gf-faq-item[open] .gf-faq-arrow {
    background: rgba(44, 90, 30, 0.14);
}

.gf-faq-item[open] .gf-faq-arrow::after {
    transform: translate(-50%, -50%) rotate(90deg);
    opacity: 0;
}

/* Answer content */
.gf-faq-answer {
    padding: 0 20px 18px;
    border-top: 1px solid rgba(44, 90, 30, 0.10);
    margin: 0 20px;
    font-family: 'Montserrat', sans-serif;
    font-size: 0.84rem;
    line-height: 1.75;
    color: #6b7c5e;
    animation: gfFaqSlide 0.2s ease;
}

@keyframes gfFaqSlide {
    from { opacity: 0; transform: translateY(-4px); }
    to   { opacity: 1; transform: translateY(0); }
}

.gf-faq-answer p {
    margin: 0 0 0.8em;
    font-family: inherit;
    font-size: inherit;
    line-height: inherit;
    color: inherit;
}
.gf-faq-answer p:last-child { margin-bottom: 0; }

.gf-faq-answer a {
    color: #2C5A1E;
    font-weight: 600;
    text-decoration: underline;
    text-decoration-thickness: 1px;
    text-underline-offset: 2px;
    transition: color 0.15s;
}
.gf-faq-answer a:hover { color: #3a7528; }

.gf-faq-answer ul,
.gf-faq-answer ol {
    padding-left: 18px;
    margin: 0 0 0.8em;
}

.gf-faq-answer li {
    margin-bottom: 4px;
    font-family: inherit;
    font-size: inherit;
    color: inherit;
}

.gf-faq-answer strong { color: #141F0A; }

.gf-faq-answer code {
    background: rgba(44, 90, 30, 0.07);
    padding: 1px 5px;
    border-radius: 4px;
    font-size: 0.9em;
}

/* ═══════════════════════════════════
   FLAT LIST STYLE  [gf_faq style="list"]
═══════════════════════════════════ */

.gf-faq-list--flat { gap: 0; }

.gf-faq-item--flat {
    background: transparent;
    border: none;
    border-bottom: 1px solid rgba(44, 90, 30, 0.12);
    border-radius: 0;
    padding: 20px 0;
    overflow: visible;
    box-shadow: none;
}

.gf-faq-item--flat:first-child { padding-top: 0; }
.gf-faq-item--flat:last-child { border-bottom: none; padding-bottom: 0; }

.gf-faq-q-flat {
    font-family: 'Playfair Display', serif;
    font-size: 1rem;
    font-weight: 600;
    color: #141F0A;
    margin-bottom: 8px;
    display: flex;
    align-items: center;
    gap: 8px;
    line-height: 1.35;
}

.gf-faq-item--flat .gf-faq-answer {
    padding: 0;
    border-top: none;
    margin: 0;
    color: #6b7c5e;
}

/* ═══════════════════════════════════
   RESPONSIVE
═══════════════════════════════════ */

@media (max-width: 600px) {
    .gf-faq-q {
        padding: 14px 16px;
        font-size: 0.85rem;
    }
    .gf-faq-answer {
        padding: 0 16px 14px;
        margin: 0 16px;
        font-size: 0.82rem;
    }
    .gf-faq-arrow {
        width: 22px;
        height: 22px;
    }
}
