/**
 * Estilos para FAQs con Schema.org Rich Snippets
 * Plugin: Ceroresiduo Core
 * @since 1.0.0
 *
 * Funciona con CUALQUIER FAQ que use markup de Schema.org correcto
 * No requiere clases personalizadas
 */

/* =============================================
   Contenedor FAQPage
   ============================================= */
[itemtype="https://schema.org/FAQPage"] {
    margin: 2rem 0;
}

/* =============================================
   Items individuales (Questions)
   ============================================= */
[itemtype="https://schema.org/FAQPage"] [itemprop="mainEntity"] {
    margin-bottom: 10px;
}

/* =============================================
   Preguntas (itemprop="name")
   ============================================= */
[itemtype="https://schema.org/FAQPage"] [itemprop="name"] {
    /* Heredar font-size, font-weight, line-height, color del tema */
    margin: 0;
}

/* Modo acordeón: hacer la pregunta clickeable con fondo gris */
[itemtype="https://schema.org/FAQPage"][data-faq-accordion="true"] [itemprop="name"] {
    cursor: pointer;
    padding: 15px 40px 15px 15px;
    position: relative;
    background: #f9f9f9;
    transition: background 0.3s;
}

[itemtype="https://schema.org/FAQPage"][data-faq-accordion="true"] [itemprop="name"]:hover {
    background: #f0f0f0;
}

/* Focus para accesibilidad */
[itemtype="https://schema.org/FAQPage"][data-faq-accordion="true"] [itemprop="name"]:focus {
    outline: 2px solid currentColor;
    outline-offset: 2px;
}

/* =============================================
   Indicador +/- (reemplaza al .faq-toggle)
   ============================================= */
[itemtype="https://schema.org/FAQPage"][data-faq-accordion="true"] [itemprop="name"]::after {
    content: "+";
    position: absolute;
    right: 15px;
    top: 50%;
    transform: translateY(-50%);
    font-size: 24px;
    font-weight: normal;
    transition: transform 0.3s;
}

/* Cuando está abierto: mostrar - */
[itemtype="https://schema.org/FAQPage"][data-faq-accordion="true"] [itemprop="mainEntity"].active [itemprop="name"]::after {
    content: "−";
}

/* Ocultar el span .faq-toggle si existe (ya no lo necesitamos) */
.faq-toggle {
    display: none;
}

/* =============================================
   Respuestas (itemprop="acceptedAnswer")
   ============================================= */
[itemtype="https://schema.org/FAQPage"] [itemprop="acceptedAnswer"] {
    /* Heredar estilos del tema */
}

/* Modo acordeón: ocultar respuesta por defecto */
[itemtype="https://schema.org/FAQPage"][data-faq-accordion="true"] [itemprop="acceptedAnswer"] {
    max-height: 0;
    overflow: hidden;
    padding: 0 15px;
    transition: max-height 0.2s ease-out;
}

/* Cuando está abierto: mostrar respuesta */
[itemtype="https://schema.org/FAQPage"][data-faq-accordion="true"] [itemprop="mainEntity"].active [itemprop="acceptedAnswer"] {
    max-height: 500px;
    padding: 15px;
    transition: max-height 0.3s ease-in;
}

/* =============================================
   Contenido de texto (itemprop="text")
   Heredar TODOS los estilos del tema para p, ul, li, strong, etc.
   ============================================= */
[itemtype="https://schema.org/FAQPage"] [itemprop="text"] {
    /* Heredar completamente los estilos del tema */
}
