/**
 * FAQ Schema Block - Frontend Styles
 * Estilos basados en el diseño del plugin USFBD Churches
 */

/* ===========================
   CONTENEDOR PRINCIPAL
=========================== */
.faq-schema-block {
    margin: 40px 0;
    padding: 30px;
    background: var(--faq-bg-color, #f8f8f8) !important;
    border-radius: 8px;
    color: #333 !important; /* Forzar texto oscuro */
}

/* Título principal */
.faq-schema-block .faq-main-title {
    text-align: center;
    margin-bottom: 30px;
    color: var(--faq-title-color, #2c5d3f) !important;
    font-size: 2em;
    font-weight: 700;
    display: block; /* Por defecto visible */
}

/* Ocultar título si está configurado */
.faq-schema-block.hide-title .faq-main-title {
    display: none;
}

/* ===========================
   CONTENEDOR DE FAQ
=========================== */
.faq-container {
    max-width: 800px;
    margin: 0 auto;
}

/* ===========================
   ITEMS DE FAQ
=========================== */
.faq-item {
    background: white !important;
    border: 1px solid #ddd !important;
    border-radius: 8px;
    margin-bottom: 15px;
    overflow: hidden;
    transition: all 0.3s ease;
    color: #333 !important;
}

.faq-item:hover {
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
}

/* ===========================
   PREGUNTA (BOTÓN)
=========================== */
.faq-question {
    width: 100%;
    background: white !important;
    border: none;
    padding: 15px 20px;
    text-align: left;
    cursor: pointer;
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 1.05em;
    font-weight: 600;
    color: var(--faq-title-color, #2c5d3f) !important;
    transition: background 0.3s ease;
}

.faq-question:hover {
    background: #f8f8f8 !important;
}

.faq-question:focus {
    outline: 2px solid var(--faq-accent-color, #ff8c8c);
    outline-offset: -2px;
}

.faq-q-text {
    flex: 1;
    padding-right: 15px;
    color: inherit !important;
}

/* ===========================
   ICONO +/-
=========================== */
.faq-icon {
    font-size: 1.5em;
    color: var(--faq-accent-color, #ff8c8c) !important;
    font-weight: bold;
    min-width: 30px;
    text-align: center;
    transition: transform 0.3s ease;
}

.faq-question[aria-expanded="true"] .faq-icon {
    transform: rotate(45deg);
}

/* ===========================
   RESPUESTA
=========================== */
.faq-answer {
    padding: 0 20px 15px 20px;
    overflow: hidden;
    background: white !important;
}

.faq-answer p {
    margin: 0;
    line-height: 1.6;
    color: #555 !important;
}

.faq-answer p:not(:last-child) {
    margin-bottom: 12px;
}

/* ===========================
   ANIMACIONES
=========================== */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.faq-answer.faq-opening {
    animation: fadeIn 0.3s ease;
}

/* ===========================
   RESPONSIVE
=========================== */
@media (max-width: 768px) {
    .faq-schema-block {
        padding: 20px;
        margin: 20px 0;
    }

    .faq-schema-block .faq-main-title {
        font-size: 1.5em;
        margin-bottom: 20px;
    }

    .faq-question {
        padding: 12px 15px;
        font-size: 1em;
    }

    .faq-icon {
        font-size: 1.3em;
        min-width: 25px;
    }

    .faq-answer {
        padding: 0 15px 12px 15px;
    }
}

@media (max-width: 480px) {
    .faq-schema-block {
        padding: 15px;
        border-radius: 5px;
    }

    .faq-question {
        padding: 10px 12px;
        font-size: 0.95em;
    }

    .faq-q-text {
        padding-right: 10px;
    }
}

/* ===========================
   ESTADOS DE ACCESIBILIDAD
=========================== */
.faq-question:focus-visible {
    outline: 3px solid var(--faq-accent-color, #ff8c8c);
    outline-offset: 2px;
}

/* Modo alto contraste */
@media (prefers-contrast: high) {
    .faq-item {
        border: 2px solid #333;
    }

    .faq-question {
        border-bottom: 2px solid #ddd;
    }
}

/* Modo oscuro */
@media (prefers-color-scheme: dark) {
    .faq-schema-block {
        background: #1a1a1a;
    }

    .faq-item {
        background: #2d2d2d;
        border-color: #444;
    }

    .faq-question {
        background: #2d2d2d;
        color: #e0e0e0;
    }

    .faq-question:hover {
        background: #363636;
    }

    .faq-answer p {
        color: #b0b0b0;
    }
}

/* ===========================
   PRINT STYLES
=========================== */
@media print {
    .faq-schema-block {
        background: white !important;
        padding: 0;
    }

    .faq-item {
        page-break-inside: avoid;
        border: 1px solid #ddd !important;
        margin-bottom: 10px;
    }

    .faq-question {
        background: white !important;
    }

    .faq-icon {
        display: none;
    }

    .faq-answer {
        display: block !important;
        padding: 10px 15px !important;
    }
}
