/* ======================================================
    CORE: ACCESIBILIDAD, FLUIDEZ Y TEXTO
====================================================== */
html { scroll-behavior: smooth; }

body {
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    text-rendering: optimizeLegibility;
}

::selection { background-color: #ffcc00; color: #1a202c; }

:focus-visible { outline: 2px solid #0073aa; outline-offset: 2px; }

h1, h2, h3 {
    font-family: 'Roboto', sans-serif;
    font-weight: 700;
    line-height: 1.3;
    color: #085a72;
    margin-top: 1.5em;
    margin-bottom: 0.5em;
    overflow-wrap: break-word;
    hyphens: none;
}

h1 { font-size: 2.5rem; }
h2 { font-size: 2rem; }
h3 { font-size: 1.6rem; }

@media (max-width: 768px) {
    h1 { font-size: 2rem; }
    h2 { font-size: 1.7rem; }
}

p {
    overflow-wrap: break-word;
    hyphens: none;
    font-size: 18px;
    line-height: 1.6;
    margin-bottom: 16px;
}

/* ======================================================
    ELEMENTOS DE CONTENIDO Y ESPACIADO
====================================================== */
.entry-content > *:not(h1):not(h2):not(h3) { margin-bottom: 16px; }

hr, .wp-block-separator {
    border: none;
    height: 1px;
    background: linear-gradient(to right, rgba(0,0,0,0), rgba(0,0,0,0.1) 50%, rgba(0,0,0,0));
    margin: 20px 0;
}

.entry-content img:not([src*="loterias"]), 
.wp-block-image img:not([src*="loterias"]) {
    border-radius: 8px;
    animation: fadeInSmooth 0.6s ease-out;
}

@keyframes fadeInSmooth {
    from { opacity: 0; transform: translateY(5px); }
    to { opacity: 1; transform: translateY(0); }
}

.entry-content a:not(.wp-block-button__link) {
    color: #0073aa;
    text-decoration: none;
    transition: all 0.2s;
}

.entry-content a:not(.wp-block-button__link):hover {
    border-bottom: 1px solid #ffcc00;
    background-color: rgba(255, 204, 0, 0.05);
}

/* ======================================================
    COMPONENTES (BOTONES, ACORDEONES, RESEÑAS)
====================================================== */
.wp-block-button__link, .wp-element-button {
    font-weight: 600 !important;
    letter-spacing: 0.5px;
    text-transform: uppercase;
    border-radius: 8px !important;
    transition: transform 0.3s cubic-bezier(0.2, 0, 0, 1), box-shadow 0.3s cubic-bezier(0.2, 0, 0, 1);
}

.wp-block-button__link:hover, .wp-element-button:hover {
    transform: translateY(-3px);
    box-shadow: 0 10px 20px rgba(0, 0, 0, 0.08);
}

.wp-block-create-block-accordion-item, .su-spoiler {
    border: 1px solid #e2e8f0;
    border-radius: 10px;
    margin-bottom: 12px;
    overflow: hidden;
    transition: all 0.3s ease;
}

.wp-block-create-block-accordion-item[open], .su-spoiler-open {
    background-color: #d6efee;
    border-color: #0073aa;
    border-left: 4px solid #0073aa;
}

.bloque-resenas {
    background-color: #f9f9f9;
    padding: 20px;
    border-radius: 10px;
    border-left: 4px solid #ffcc00;
    margin: 20px 0;
    text-align: center;
}

/* ======================================================
    FOOTER MODERNIZADO (ESTILO GENERAL)
====================================================== */
.wp-block-post-author, .author-profile, .author-bio, 
.post-author-box, .vcard, .post-navigation, 
.site-info, .powered-by, .wp-block-theme-button,
a[href*="wordpress.org"], .wp-block-digitall-footer-wordpress-icon {
    display: none !important;
}

.footer-moderno {
    background-color: #f9f9f9;
    padding: 35px 0 20px 0;
    border-top: 4px solid #0C80A1;
    margin-top: 35px;
    box-sizing: border-box;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    overflow-x: hidden;
}

.footer-contenido {
    display: flex;
    justify-content: space-around;
    flex-wrap: wrap;
    gap: 30px;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

.footer-col { 
    flex: 1; 
    min-width: 280px;
    max-width: 450px;
    padding: 5px;
    text-align: center; 
    box-sizing: border-box;
}

.footer-moderno h3 {
    color: #00597b;
    font-size: 19px;
    font-weight: 700;
    margin-top: 0;
    margin-bottom: 16px;
    letter-spacing: 0.5px;
}

.contenedor-imagen-contacto {
    display: flex;
    justify-content: center;
    margin-bottom: 14px;
}

.enlace-imagen-footer {
    display: inline-block;
    border-radius: 50%;
    transition: transform 0.3s ease;
}

.enlace-imagen-footer:hover { transform: scale(1.05); }

.imagen-circular-footer {
    width: 125px !important;
    height: 125px !important;
    object-fit: cover !important;
    border-radius: 50% !important;
    border: 3px solid #ffffff;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.08);
}

.texto-footer {
    color: #475569;
    font-size: 14px;
    line-height: 1.6;
    margin: 0 auto;
    max-width: 360px;
}

.enlace-texto-footer {
    color: #0C80A1;
    text-decoration: none;
    font-weight: 600;
    border-bottom: 1px dashed #0C80A1;
}

.footer-redes {
    display: flex;
    justify-content: center;
    gap: 12px;
    margin-top: 15px;
}

.icono-red {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    background-color: #ffffff;
    color: #0C80A1;
    border: 1px solid #e2e8f0;
    border-radius: 50%;
    font-size: 16px;
    transition: all 0.3s ease;
}

.icono-red:hover {
    background-color: #0C80A1;
    color: #ffffff;
    transform: translateY(-3px);
}

.bloque-horarios {
    display: inline-block;
    text-align: left;
    background: #ffffff;
    padding: 16px 20px;
    border-radius: 10px;
    border: 1px solid #e2e8f0;
    width: 100%;
    max-width: 380px;
    box-sizing: border-box;
}

.linea-horario {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
    font-size: 14px;
}

.linea-horario:last-child { margin-bottom: 0; }
.dia-semana { font-weight: 600; }

/* ======================================================
    FRANJA DE MENÚ ULTRA-ANCHO (HÍBRIDO Y EFECTOS)
====================================================== */
.franja-menu-global {
    width: 100vw;
    position: relative;
    left: 50%;
    right: 50%;
    margin-left: -50vw;
    margin-right: -50vw;
    background-color: #0C80A1;
    margin-top: 35px;
    margin-bottom: 25px;
    box-sizing: border-box;
}

/* --- MODO ESCRITORIO --- */
.menu-escritorio-directo {
    max-width: 1200px;
    margin: 0 auto;
    display: block;
}

.menu-footer-lista {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    justify-content: center;
    align-items: stretch;
}

.menu-footer-lista li {
    display: flex;
    align-items: center;
    position: relative;
}

.menu-footer-lista a {
    color: #ffffff !important;
    text-decoration: none;
    font-size: 13px;
    font-weight: 700;
    letter-spacing: 0.8px;
    padding: 16px 24px;
    display: block;
    background-color: transparent;
    transition: background-color 0.2s ease-in-out;
}

.menu-footer-lista a:hover {
    background-color: rgba(0, 0, 0, 0.2) !important;
}

.menu-footer-lista li:not(:last-child)::after {
    content: "•";
    color: #ffffff;
    font-size: 12px;
    opacity: 0.6;
    pointer-events: none;
    padding: 0 2px;
}

/* --- MODO MÓVIL (ESTRUCTURA INVERTIDA BASE) --- */
.menu-movil-wrapper {
    display: none;
    width: 100%;
}

.boton-desplegable-footer {
    background-color: transparent;
    color: #ffffff !important;
    border: none;
    width: 100%;
    padding: 16px 20px;
    font-size: 14px;
    font-weight: 700;
    letter-spacing: 1px;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    transition: background-color 0.2s ease;
}

.boton-desplegable-footer:hover, .boton-desplegable-footer.activo {
    background-color: rgba(0, 0, 0, 0.15);
}

.menu-oculto-footer {
    width: 100%;
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    background-color: #0b7290;
}

.menu-oculto-footer.abierto {
    max-height: 350px;
}

.menu-footer-lista-movil {
    list-style: none;
    padding: 0;
    margin: 0;
    width: 100%;
}

.menu-footer-lista-movil a {
    color: #ffffff !important;
    text-decoration: none;
    font-size: 14px;
    font-weight: 700;
    display: block;
    padding: 14px 24px;
    text-align: left;
    box-sizing: border-box;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
    transition: background-color 0.2s;
}

.menu-footer-lista-movil a:hover {
    background-color: rgba(0, 0, 0, 0.15);
}

/* ======================================================
    SECCIÓN INFERIOR (LEGAL Y COPYRIGHT)
====================================================== */
.footer-inferior {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

.contenedor-legal {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 10px;
    font-size: 12px;
    color: #64748b;
    padding-top: 15px;
}

.copyright { margin: 0; }
.enlaces-legales { display: flex; gap: 15px; }

.enlaces-legales a {
    color: #64748b;
    text-decoration: none;
}

.enlaces-legales a:hover { color: #0C80A1; }

.wp-block-site-logo img:hover, .home-gato-animado img:hover {
    animation: gatoSaluda 0.5s ease-in-out infinite alternate;
}

@keyframes gatoSaluda {
    from { transform: rotate(-5deg); }
    to { transform: rotate(5deg); }
}

/* ======================================================
    RESPONSIVE: INTERRUPTOR REGLA 768PX (SOLUCIÓN DEFINITIVA)
====================================================== */
@media (max-width: 768px) {
    .menu-escritorio-directo { display: none; }
    
    /* Neutralizamos el comportamiento heredado negativo del ancho ultra-ancho */
    .franja-menu-global {
        width: 100% !important;
        left: 0 !important;
        right: 0 !important;
        margin-left: 0 !important;
        margin-right: 0 !important;
        background-color: #0C80A1;
    }

    /* Posicionado relativo estricto para anclar el submenú */
    .menu-movil-wrapper { 
        display: block !important; 
        position: relative !important;
        width: 100% !important;
    } 

    /* BOTÓN MENÚ: Siempre visible abajo en la barra */
    .boton-desplegable-footer {
        width: 100% !important;
        display: inline-flex !important;
        position: relative;
        z-index: 20;
    }

    /* SUBMENÚ FIJO DESPLAZADO HACIA ARRRIBA (Posicionamiento Absoluto) */
    .menu-oculto-footer {
        position: absolute !important;
        bottom: 100% !important; /* Lo fuerza a abrirse ESTRICTAMENTE hacia arriba */
        left: 0 !important;
        width: 100% !important;
        max-height: 0;
        overflow: hidden;
        z-index: 9999 !important; /* Capa prioritaria flotante sobre cualquier contenido */
        background-color: #0b7290 !important;
        box-shadow: 0 -4px 10px rgba(0, 0, 0, 0.15);
        transition: max-height 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    }

    .menu-oculto-footer.abierto {
        max-height: 380px !important; /* Altura ideal fija para leer las 6 secciones limpiamente */
    }

    /* Lista adaptada perfectamente al ancho de cualquier dispositivo móvil */
    .menu-footer-lista-movil {
        list-style: none !important;
        padding: 0 !important;
        margin: 0 !important;
        width: 100% !important;
        display: block !important;
    }

    .menu-footer-lista-movil li {
        width: 100% !important;
        display: block !important;
    }

    /* ENLACES: Alineación izquierda sin cortes laterales estéticos */
    .menu-footer-lista-movil a {
        color: #ffffff !important;
        text-decoration: none;
        font-size: 14px;
        font-weight: 700;
        display: block !important;
        padding: 15px 24px !important; /* Distancia perfecta desde el borde de pantalla */
        text-align: left !important;   /* Alineación estricta a la izquierda */
        box-sizing: border-box !important;
        border-bottom: 1px solid rgba(255, 255, 255, 0.08) !important;
        white-space: nowrap !important; /* Evita roturas de palabra indeseadas */
        width: 100% !important;
    }

    /* EFECTO HOVER: Idéntico al de escritorio */
    .menu-footer-lista-movil a:hover,
    .menu-footer-lista-movil a:active {
        background-color: rgba(0, 0, 0, 0.2) !important;
    }

    /* Ajustes generales del contenido del footer */
    .footer-contenido {
        flex-direction: column;
        align-items: center;
        gap: 25px;
    }

    .footer-col { min-width: 100%; }

    .bloque-horarios {
        text-align: center;
        padding: 14px;
        margin: 0 auto;
    }

    .linea-horario {
        flex-direction: column;
        gap: 4px;
        text-align: center;
    }

    .horas-bloque { text-align: center; font-size: 13px; }

    .contenedor-legal {
        flex-direction: column-reverse;
        text-align: center;
        gap: 12px;
    }

    .enlaces-legales { justify-content: center; }
}