/*
===============================================================================
    TheGov Child Theme - Leon.es (versión segura de prueba)

    Theme Name:        Leon.es
    Theme URI:         https://leon.es
    Author:            Ayuntamiento de León
    Author URI:        https://tu-empresa.com
    Description:       Child theme for TheGov - estilos corporativos y ajustes
                       técnicos sin invadir la geometría visual de Elementor.
    Version:           1.2.1-safe-test
    License:           GPL v2 or later
    License URI:       https://www.gnu.org/licenses/gpl-2.0.html
    Template:          thegov
    Template Version:  1.0.3+
    Text Domain:       thegov-child
    Domain Path:       /languages

    Fecha de revisión: 21/07/2026
    Revisión 1.2.1:
    - Encabezados H1–H6: Bouldsand sustituye Quicksand también en enlaces y span.
    - Los descendientes de los encabezados heredan tamaño e interlineado del H.
    - Elementor Free: Bouldsand sustituye las variables tipográficas Roboto.
    - Botones Elementor: solo se fija la fuente, nunca su forma o color.
    - Formularios: se neutraliza display:block heredado del tema padre.
    - Se oculta el bloque social fijo de TheGov.
    - Se elimina cualquier compatibilidad o regla específica de WooCommerce.

    PRINCIPIO DE ESTA VERSIÓN
    ---------------------------------------------------------------------------
    Elementor conserva el control de:
    - fondos y colores de cajas;
    - bordes, radios y sombras;
    - alturas, anchuras y proporciones;
    - padding, márgenes y alineaciones;
    - estilos visuales de botones y formularios;
    - columnas y comportamiento responsive de sus contenedores.

    El child theme conserva únicamente:
    - tipografía corporativa;
    - colores generales no invasivos;
    - correcciones técnicas de TheGov/WGL;
    - componentes propios expresamente acotados;
    - accesibilidad y estilos de impresión.
===============================================================================
*/

/* ========================================================================== 
   1. VARIABLES
   ========================================================================== */

:root {
    --leon-color-primary: #890c58;
    --leon-color-primary-dark: #6a0740;
    --leon-color-dark: #070707;
    --leon-color-white: #ffffff;
    --leon-color-bg-light: #fef8f8;
    --leon-color-gray: #95a5a6;
    --leon-color-light: #f5f6fa;

    /* Alias mantenidos por compatibilidad con reglas antiguas. */
    --color-primary: var(--leon-color-primary);
    --color-secondary: #636e72;
    --color-accent: var(--leon-color-primary);
    --color-success: #27ae60;
    --color-danger: #e74c3c;
    --color-warning: #f39c12;
    --color-info: #3498db;
    --color-white: var(--leon-color-white);
    --color-light: var(--leon-color-light);
    --color-gray: var(--leon-color-gray);
    --color-dark: var(--leon-color-dark);
    --color-black: #000000;

    --font-primary: 'Bouldsand', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Arial, sans-serif;
    --font-heading: 'Bouldsand', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Arial, sans-serif;
    --leon-font-primary: var(--font-primary);
    --leon-font-heading: var(--font-heading);

    --spacing-xs: 4px;
    --spacing-sm: 8px;
    --spacing-md: 16px;
    --spacing-lg: 24px;
    --spacing-xl: 32px;
    --spacing-xxl: 48px;
}

/* ========================================================================== 
   2. FUENTES
   ========================================================================== */

/*
 * El archivo Medium representa los pesos regulares de la identidad.
 * El archivo Bold representa los pesos altos. Las URL se mantienen relativas
 * al style.css del tema child.
 */

@font-face {
    font-family: 'Bouldsand';
    src: url('assets/fonts/bouldsand/Bould-Medium.eot');
    src: url('assets/fonts/bouldsand/Bould-Medium.eot?#iefix') format('embedded-opentype'),
         url('assets/fonts/bouldsand/Bould-Medium.woff2') format('woff2'),
         url('assets/fonts/bouldsand/Bould-Medium.woff') format('woff');
    font-weight: 400;
    font-style: normal;
    font-display: swap;
}

@font-face {
    font-family: 'Bouldsand';
    src: url('assets/fonts/bouldsand/Bould-Medium.eot');
    src: url('assets/fonts/bouldsand/Bould-Medium.eot?#iefix') format('embedded-opentype'),
         url('assets/fonts/bouldsand/Bould-Medium.woff2') format('woff2'),
         url('assets/fonts/bouldsand/Bould-Medium.woff') format('woff');
    font-weight: 500;
    font-style: normal;
    font-display: swap;
}

@font-face {
    font-family: 'Bouldsand';
    src: url('assets/fonts/bouldsand/bould-bold.eot');
    src: url('assets/fonts/bouldsand/bould-bold.eot?#iefix') format('embedded-opentype'),
         url('assets/fonts/bouldsand/bould-bold.woff2') format('woff2'),
         url('assets/fonts/bouldsand/bould-bold.woff') format('woff');
    font-weight: 600;
    font-style: normal;
    font-display: swap;
}

@font-face {
    font-family: 'Bouldsand';
    src: url('assets/fonts/bouldsand/bould-bold.eot');
    src: url('assets/fonts/bouldsand/bould-bold.eot?#iefix') format('embedded-opentype'),
         url('assets/fonts/bouldsand/bould-bold.woff2') format('woff2'),
         url('assets/fonts/bouldsand/bould-bold.woff') format('woff');
    font-weight: 700;
    font-style: normal;
    font-display: swap;
}

/* ========================================================================== 
   3. BASE TIPOGRÁFICA
   ========================================================================== */

html {
    scroll-behavior: smooth;
}

body {
    margin: 0;
    color: var(--leon-color-dark);
    background-color: var(--leon-color-white);
    font-family: var(--font-primary);
    font-size: 1rem;
    font-weight: 400;
    line-height: 1.7;
}

/*
 * Solo se fija la familia tipográfica. No se cambian fondos, tamaños, padding,
 * bordes, radios, alturas ni alineaciones definidos desde Elementor.
 */
body :where(
    p,
    li,
    label,
    legend,
    input,
    textarea,
    select,
    .elementor-widget-text-editor,
    .elementor-text-editor,
    .wgl-infobox_content,
    .wgl-services_text,
    .blog-post_content,
    .post-content,
    .page-content
) {
    font-family: var(--font-primary) !important;
}

body :where(
    h1,
    h2,
    h3,
    h4,
    h5,
    h6,
    strong,
    b,
    .page-header_title,
    .page-title,
    .page_title,
    .wgl-page-title h1,
    .wgl-page-title .page_title,
    .elementor-heading-title,
    .theme-header-font,
    .widget-title,
    .wgl-infobox_title,
    .wgl-services_title,
    .wgl-double_heading .dbl-title,
    .events-post_title,
    .blog-post_title,
    .leon-destacado,
    .destacado,
    .destacados,
    .highlight,
    .lead
) {
    font-family: var(--font-heading) !important;
    font-weight: 700 !important;
}


/*
 * TheGov asigna Quicksand y medidas propias directamente a h1/h2/... y a
 * sus enlaces y span. El child sustituye únicamente la familia y el peso.
 * Los descendientes heredan tamaño e interlineado del encabezado para que
 * Elementor pueda seguir controlándolos desde cada widget.
 */
h1,
h2,
h3,
h4,
h5,
h6 {
    font-family: var(--font-heading, 'Bouldsand', Arial, sans-serif) !important;
    font-weight: 700 !important;
}

:is(h1, h2, h3, h4, h5, h6) :is(a, span):not(.elementor-icon):not([class^='fa']):not([class*=' fa-']):not([class^='flaticon']):not([class*=' flaticon']):not([class^='wgl-icon']):not([class*=' wgl-icon']) {
    font-family: inherit !important;
    font-weight: inherit !important;
    font-size: inherit;
    line-height: inherit;
}

/*
 * Botones propios del frontal, acotados al contenido público.
 * No se seleccionan button ni .elementor-button de forma global para evitar
 * modificar la interfaz del constructor de Elementor.
 */
:where(#main, #main-content, #wgl-content-wrapper, .site-content) :where(
    input[type='submit'],
    input[type='button'],
    a.button,
    button.button,
    .btn-primary,
    .wgl-button,
    .button-read-more,
    #comments .comment-reply-link,
    .load_more_item
) {
    font-family: var(--font-heading) !important;
    font-weight: 700 !important;
}

/* Enlaces editoriales sin clase: los enlaces/botones de Elementor quedan fuera. */
:where(.entry-content, .post-content, .page-content) a:not([class]) {
    color: var(--leon-color-primary);
    text-decoration-thickness: 0.08em;
    text-underline-offset: 0.15em;
}

:where(.entry-content, .post-content, .page-content) a:not([class]):hover {
    color: var(--leon-color-primary-dark);
}

/* ========================================================================== 
   4. ELEMENTOR FREE: VARIABLES TIPOGRÁFICAS CORPORATIVAS
   ========================================================================== */

/*
 * Elementor Free genera variables globales que pueden apuntar a Roboto.
 * Esta regla cambia únicamente la familia tipográfica; no modifica fondos,
 * colores, bordes, radios, tamaños, padding ni geometría de los widgets.
 */
body[class*='elementor-kit-'] {
    --e-global-typography-primary-font-family: 'Bouldsand';
    --e-global-typography-secondary-font-family: 'Bouldsand';
    --e-global-typography-text-font-family: 'Bouldsand';
    --e-global-typography-accent-font-family: 'Bouldsand';
}

/*
 * Protección específica para el texto de los botones del contenido.
 * El selector queda dentro del frontal y no alcanza los botones de la interfaz
 * del constructor de Elementor.
 */
:where(#main, #main-content, #wgl-content-wrapper, .site-content)
.elementor-widget-button .elementor-button,
:where(#main, #main-content, #wgl-content-wrapper, .site-content)
.elementor-widget-button .elementor-button-text {
    font-family: var(--font-heading) !important;
    font-weight: 700;
}

/* ========================================================================== 
   5. THEGOV / WGL: OVERRIDE TIPOGRÁFICO ACOTADO
   ========================================================================== */

/*
 * Neutraliza fuentes antiguas del tema padre sin aplicar propiedades de caja.
 * Se evita seleccionar span de forma global para no romper pesos e iconos.
 */
body :where(
    .dropcap,
    .elementor-drop-cap,
    .dropcap-bg,
    .banner_404,
    .theme-header-font,
    .heading_subtitle,
    .wgl-button,
    .button-read-more,
    .page-header_title,
    .blog-post_text-bg,
    .blog-post_meta-date .date_post,
    .author-info_content .author-info_name,
    .comments-title .number-comments,
    .thegov_module_progress_bar .progress_label,
    .thegov_module_progress_bar .progress_value,
    .thegov_module_progress_bar .progress_units,
    .thegov_module_double_headings,
    .thegov_module_counter .counter_title,
    .thegov_module_counter .counter_value_wrapper,
    .thegov_module_counter .counter_value_placeholder,
    .thegov_module_videobox .title,
    .thegov_module_services_2 .services_link,
    .thegov_module_services_4 .services_subtitle,
    .wgl-countdown .countdown-section .countdown-period,
    .countdown-section .countdown-amount,
    .wgl-counter .wgl-counter_value-wrap,
    .elementor-counter,
    .wgl-double_heading .dbl-subtitle,
    .wgl-testimonials .wgl-testimonials_quote,
    .wgl-testimonials .wgl-testimonials_position,
    .events-post_meta-categories a,
    .single_meta .meta-wrapper,
    .prev-link,
    .next-link,
    .load_more_item,
    .load_more_wrapper .load_more_item
) {
    font-family: var(--font-primary) !important;
}

/* Font Awesome: solo clases inequívocas. No se toca .icon, .wgl-icon o flaticon. */
.fa,
.fas,
.far,
.fal,
[class^='fa-'],
[class*=' fa-'] {
    font-family: 'Font Awesome 6 Free', 'Font Awesome 5 Free', 'Font Awesome 4', FontAwesome !important;
    font-style: normal;
    font-variant: normal;
    text-rendering: auto;
    -webkit-font-smoothing: antialiased;
}

.fa,
.fas,
[class^='fa-']:not(.fab):not(.far),
[class*=' fa-']:not(.fab):not(.far) {
    font-weight: 900;
}

.far {
    font-weight: 400;
}

.fab {
    font-family: 'Font Awesome 6 Brands', 'Font Awesome 5 Brands' !important;
    font-weight: 400;
}

/* ========================================================================== 
   6. ACCESIBILIDAD Y MOVIMIENTO
   ========================================================================== */

:where(#main, #main-content, #wgl-content-wrapper, .site-content)
:where(a, button, input, textarea, select, summary, [tabindex]):focus-visible {
    outline: 2px solid var(--leon-color-primary);
    outline-offset: 3px;
}

:where(#main, #main-content, #wgl-content-wrapper, .site-content)
:where(input[type='checkbox'], input[type='radio']):focus-visible {
    outline-offset: 4px;
}

@media (prefers-reduced-motion: reduce) {
    html {
        scroll-behavior: auto;
    }

    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        scroll-behavior: auto !important;
        transition-duration: 0.01ms !important;
    }
}

/* ========================================================================== 
   7. HEADER Y NAVEGACIÓN
   ========================================================================== */

.page-header {
    position: relative;
    z-index: 0;
}

.wgl-theme-header,
.header_wrap,
.site-header,
#header {
    position: relative !important;
    z-index: 100 !important;
}

.primary-nav ul.sub-menu,
.main-menu ul.sub-menu,
.menu ul.sub-menu,
.mobile_nav_wrapper,
.wgl-mobile-header {
    z-index: 200 !important;
}

/*
 * Se conserva la decisión actual de desactivar el header superpuesto.
 * Al estar en el flujo normal, no se añade padding automático a page titles.
 */
.wgl-theme-header.header_overlap {
    position: relative !important;
    top: auto !important;
    right: auto !important;
    left: auto !important;
    width: 100% !important;
    z-index: 100 !important;
}

.wgl-theme-header.header_overlap + *,
.wgl-theme-header.header_overlap ~ .page-wrapper,
.wgl-theme-header.header_overlap ~ #wgl-content-wrapper {
    margin-top: 0 !important;
    padding-top: 0 !important;
}

.header_logo .custom-logo-link img,
.header_logo img,
.site-logo img,
.custom-logo-link img,
#site-logo img,
.thegov-logo img {
    width: auto !important;
    max-height: 58px !important;
    transition: max-height 0.3s ease;
}

.header_sticky .header_logo img,
.sticky-active .header_logo img,
.header-sticky .custom-logo-link img {
    max-height: 48px !important;
}

.breadcrumbs,
.breadcrumb-trail,
.wgl-breadcrumbs {
    text-transform: lowercase;
}

.breadcrumbs > *,
.breadcrumb-trail > *,
.wgl-breadcrumbs > * {
    display: inline-block;
}

.breadcrumbs > *::first-letter,
.breadcrumb-trail > *::first-letter,
.wgl-breadcrumbs > *::first-letter {
    text-transform: uppercase;
}

@media (max-width: 768px) {
    .header_logo img,
    .custom-logo-link img {
        max-height: 44px !important;
    }
}

@media (max-width: 400px) {
    .breadcrumbs,
    .breadcrumb-trail,
    .wgl-breadcrumbs {
        display: none;
    }
}

/* ========================================================================== 
   8. FOOTER
   ========================================================================== */

footer,
#footer,
.site-footer,
.footer_wrap {
    color: var(--leon-color-white);
}

footer h2,
footer h3,
footer .footer-title,
#footer h2,
#footer h3 {
    color: var(--leon-color-white);
    font-size: 1rem;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

footer address,
footer .footer-contact,
footer p {
    color: rgba(255, 255, 255, 0.85);
    font-style: normal;
    line-height: 1.7;
}

footer a[href^='mailto:'] {
    color: var(--leon-color-white);
    text-decoration: underline;
    text-decoration-color: rgba(255, 255, 255, 0.4);
    transition: text-decoration-color 0.2s ease;
}

footer a[href^='mailto:']:hover {
    text-decoration-color: var(--leon-color-white);
}

.footer-bottom {
    border-top: 1px solid #e8e8e8;
    padding: 20px 0;
    color: #999999;
    font-size: 12px;
    text-align: center;
}

/* No se fuerzan anchuras, apilado ni alineación de columnas de Elementor. */

/* ========================================================================== 
   8. BLOG, ARCHIVOS Y CONTENIDO NATIVO
   ========================================================================== */

.blog .site-main .post,
.archive .site-main .post {
    margin-bottom: 40px;
    padding-bottom: 40px;
    border-bottom: 1px solid #eeeeee;
}

.blog .site-main .post:last-child,
.archive .site-main .post:last-child {
    border-bottom: 0;
}

.blog .site-main .post-title,
.archive .site-main .post-title {
    margin-bottom: 15px;
}

.blog .site-main .post-meta,
.archive .site-main .post-meta {
    margin-bottom: 15px;
    color: var(--leon-color-gray);
    font-size: 12px;
}

.blog .site-main .post-thumbnail,
.archive .site-main .post-thumbnail {
    margin-bottom: 20px;
}

.blog .site-main .post-thumbnail img,
.archive .site-main .post-thumbnail img {
    display: block;
    max-width: 100%;
    height: auto;
}

.single-post .post-content,
body:not([class*='elementor-page']) .page-content {
    color: #444444;
    font-size: 1rem;
    line-height: 1.8;
}

.single-post .post-content blockquote,
body:not([class*='elementor-page']) .page-content blockquote {
    margin: 20px 0;
    padding: 20px;
    border-left: 4px solid var(--leon-color-primary);
    background-color: var(--leon-color-light);
    font-style: italic;
}

.single-post .post-tags,
.single-post .post-categories {
    margin: 30px 0;
    padding-top: 30px;
    border-top: 1px solid #eeeeee;
}

/* ========================================================================== 
   10. SIDEBAR Y WIDGETS NATIVOS
   ========================================================================== */

.sidebar {
    margin-left: 40px;
}

/* Acotado a sidebar: no altera widgets colocados dentro de Elementor. */
.sidebar .widget {
    margin-bottom: 30px;
    padding: 20px;
    border-radius: 4px;
    background-color: var(--leon-color-light);
}

.sidebar .widget-title {
    margin-bottom: 20px;
    padding-bottom: 10px;
    border-bottom: 2px solid var(--leon-color-primary);
    font-size: 16px;
}

.sidebar .widget ul {
    margin: 0;
    padding: 0;
    list-style: none;
}

.sidebar .widget ul li {
    padding: 8px 0;
    border-bottom: 1px solid #e8e8e8;
}

.sidebar .widget ul li:last-child {
    border-bottom: 0;
}

@media (max-width: 1024px) {
    .sidebar {
        margin-left: 30px;
    }
}

@media (max-width: 768px) {
    .sidebar {
        margin-top: 40px;
        margin-left: 0;
    }
}

/* ========================================================================== 
   11. REDES SOCIALES Y COMPARTIR
   ========================================================================== */

/* Bloque lateral fijo de compartir del tema TheGov. */
.wgl-social-share_pages.fixed {
    display: none !important;
}

/* Solo se ocultan módulos de compartir de Jetpack en páginas. */
.page .sd-sharing-enabled,
.page .sharedaddy {
    display: none !important;
}

.single-post .sd-sharing-enabled,
.single-post .sharedaddy,
.single-tribe_events .sd-sharing-enabled {
    display: block !important;
}

.footer-social-icons a,
.widget_social_media a {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    transition: background-color 0.2s ease, color 0.2s ease;
}

.footer-social-icons a:hover {
    color: var(--leon-color-white);
    background-color: var(--leon-color-primary);
}

/* ========================================================================== 
   12. EVENTS MANAGER: COMPONENTES FUNCIONALES
   ========================================================================== */

.em-loading,
.em-categories-loading,
.em-search-loading,
.em-ajax-loading,
[class*='em-loading'] {
    display: none !important;
}

.em-events-footer,
.em-load-more-button,
a.em-more {
    clear: both;
    margin-top: 40px !important;
}

.em-calendar td.eventless-day {
    color: #cccccc;
    opacity: 0.5;
}

.em-calendar td:not(.eventless-day) {
    color: var(--leon-color-dark);
    font-weight: 600;
}

/* ========================================================================== 
   13. CARDS VISUALES DE EVENTOS WGL
   ========================================================================== */

/*
 * El diseño especial se limita a grids WGL y a wrappers con la clase manual
 * .leon-event-cards. No alcanza calendario, buscador ni listados .em-*.
 */

:is(.wgl-events .events-style-grid, .leon-event-cards)
.events-post:not(.no-leon-event-card) .events-post-hero_wrapper {
    position: relative;
    min-height: 350px;
    overflow: hidden;
    background-color: var(--leon-color-white);
    transition: background-color 0.35s ease, box-shadow 0.35s ease;
}

:is(.wgl-events .events-style-grid, .leon-event-cards)
.events-post:not(.no-leon-event-card) .events-post-hero_thumb,
:is(.wgl-events .events-style-grid, .leon-event-cards)
.events-post:not(.no-leon-event-card) .events-post_feature-link,
:is(.wgl-events .events-style-grid, .leon-event-cards)
.events-post:not(.no-leon-event-card) .events-post_bg_media {
    display: block;
    width: 100%;
    height: 100%;
}

:is(.wgl-events .events-style-grid, .leon-event-cards)
.events-post:not(.no-leon-event-card) .events-post_bg_media {
    min-height: 350px;
    background-repeat: no-repeat;
    background-position: center;
    background-size: cover;
    transition: opacity 0.35s ease, transform 0.35s ease;
}

:is(.wgl-events .events-style-grid, .leon-event-cards)
.events-post:not(.no-leon-event-card) .events-post-hero_wrapper::before {
    content: '';
    position: absolute;
    inset: 0;
    z-index: 1;
    pointer-events: none;
    background: rgba(7, 7, 7, 0.48);
    transition: opacity 0.35s ease;
}

:is(.wgl-events .events-style-grid, .leon-event-cards)
.events-post:not(.no-leon-event-card) .events-post-hero-content_wrapper {
    position: absolute;
    right: 0;
    bottom: 0;
    left: 0;
    z-index: 2;
    padding: 48px;
    color: var(--leon-color-white);
    background: transparent;
    transition: color 0.35s ease, background-color 0.35s ease, padding 0.35s ease;
}

:is(.wgl-events .events-style-grid, .leon-event-cards)
.events-post:not(.no-leon-event-card) .events-post-hero_content,
:is(.wgl-events .events-style-grid, .leon-event-cards)
.events-post:not(.no-leon-event-card) .events-post-hero_content * {
    color: var(--leon-color-white);
}

:is(.wgl-events .events-style-grid, .leon-event-cards)
.events-post:not(.no-leon-event-card) .events-post_cats,
:is(.wgl-events .events-style-grid, .leon-event-cards)
.events-post:not(.no-leon-event-card) .post_categories,
:is(.wgl-events .events-style-grid, .leon-event-cards)
.events-post:not(.no-leon-event-card) .meta-categories,
:is(.wgl-events .events-style-grid, .leon-event-cards)
.events-post:not(.no-leon-event-card) .cat-links {
    position: relative;
    z-index: 3;
}

:is(.wgl-events .events-style-grid, .leon-event-cards)
.events-post:not(.no-leon-event-card) :is(
    .events-post_cats,
    .post_categories,
    .meta-categories,
    .cat-links
) a {
    display: inline-block;
    margin: 0 6px 8px 0;
    color: var(--leon-color-white) !important;
    font-size: 12px;
    line-height: 1.2;
    letter-spacing: 0.04em;
    text-decoration: none !important;
    text-transform: uppercase;
}

:is(.wgl-events .events-style-grid, .leon-event-cards)
.events-post:not(.no-leon-event-card) .date_post {
    display: inline-block;
    margin-bottom: 10px;
    color: var(--leon-color-white) !important;
    font-size: 14px;
    line-height: 1.2;
    letter-spacing: 0.02em;
    text-transform: uppercase;
}

:is(.wgl-events .events-style-grid, .leon-event-cards)
.events-post:not(.no-leon-event-card) .events-post_title {
    margin: 0 0 22px;
    font-size: 32px;
    line-height: 1.18;
}

:is(.wgl-events .events-style-grid, .leon-event-cards)
.events-post:not(.no-leon-event-card) .events-post_title a {
    color: var(--leon-color-white) !important;
    text-decoration: none !important;
}

:is(.wgl-events .events-style-grid, .leon-event-cards)
.events-post:not(.no-leon-event-card) .events-post_location,
:is(.wgl-events .events-style-grid, .leon-event-cards)
.events-post:not(.no-leon-event-card) .events-post_location :is(span, a) {
    color: var(--leon-color-white) !important;
    font-size: 15px;
    line-height: 1.35;
    font-weight: 600;
    text-decoration: none !important;
}

:is(.wgl-events .events-style-grid, .leon-event-cards)
.events-post:not(.no-leon-event-card) :is(
    .events-post-hero_meta-desc,
    .divider_post_info
) {
    display: none;
}

/* Pastillas de categorías. */
:is(.wgl-events .events-style-grid, .leon-event-cards)
.events-post:not(.no-leon-event-card)
.events-post_cats .events-post_meta-categories span a {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 7px 14px;
    border-radius: 999px;
    color: var(--leon-color-white) !important;
    background-color: var(--leon-color-primary) !important;
    font-size: 12px;
    font-weight: 600;
    line-height: 1;
    letter-spacing: 0;
    text-decoration: none !important;
    text-transform: none;
}

:is(.wgl-events .events-style-grid, .leon-event-cards)
.events-post:not(.no-leon-event-card)
.events-post_cats .events-post_meta-categories span a:hover {
    color: var(--leon-color-white) !important;
    background-color: var(--leon-color-primary-dark) !important;
}

/* Hover solo en dispositivos que realmente lo soportan. */
@media (hover: hover) and (pointer: fine) {
    :is(.wgl-events .events-style-grid, .leon-event-cards)
    .events-post:not(.no-leon-event-card) .events-post-hero_wrapper:hover,
    :is(.wgl-events .events-style-grid, .leon-event-cards)
    .events-post:not(.no-leon-event-card) .events-post-hero_wrapper:focus-within {
        background-color: var(--leon-color-white);
    }

    :is(.wgl-events .events-style-grid, .leon-event-cards)
    .events-post:not(.no-leon-event-card) .events-post-hero_wrapper:hover::before,
    :is(.wgl-events .events-style-grid, .leon-event-cards)
    .events-post:not(.no-leon-event-card) .events-post-hero_wrapper:focus-within::before {
        opacity: 0;
    }

    :is(.wgl-events .events-style-grid, .leon-event-cards)
    .events-post:not(.no-leon-event-card) .events-post-hero_wrapper:hover .events-post_bg_media,
    :is(.wgl-events .events-style-grid, .leon-event-cards)
    .events-post:not(.no-leon-event-card) .events-post-hero_wrapper:focus-within .events-post_bg_media {
        opacity: 0;
        transform: scale(1.02);
    }

    :is(.wgl-events .events-style-grid, .leon-event-cards)
    .events-post:not(.no-leon-event-card) .events-post-hero_wrapper:hover .events-post-hero-content_wrapper,
    :is(.wgl-events .events-style-grid, .leon-event-cards)
    .events-post:not(.no-leon-event-card) .events-post-hero_wrapper:focus-within .events-post-hero-content_wrapper {
        top: 0;
        bottom: auto;
        height: 100%;
        padding: 86px 48px 48px;
        color: var(--leon-color-dark);
        background-color: var(--leon-color-white);
    }

    :is(.wgl-events .events-style-grid, .leon-event-cards)
    .events-post:not(.no-leon-event-card) .events-post-hero_wrapper:is(:hover, :focus-within)
    .events-post-hero_content,
    :is(.wgl-events .events-style-grid, .leon-event-cards)
    .events-post:not(.no-leon-event-card) .events-post-hero_wrapper:is(:hover, :focus-within)
    .events-post-hero_content * {
        color: var(--leon-color-dark);
    }

    :is(.wgl-events .events-style-grid, .leon-event-cards)
    .events-post:not(.no-leon-event-card) .events-post-hero_wrapper:is(:hover, :focus-within)
    .date_post,
    :is(.wgl-events .events-style-grid, .leon-event-cards)
    .events-post:not(.no-leon-event-card) .events-post-hero_wrapper:is(:hover, :focus-within)
    .events-post_location,
    :is(.wgl-events .events-style-grid, .leon-event-cards)
    .events-post:not(.no-leon-event-card) .events-post-hero_wrapper:is(:hover, :focus-within)
    .events-post_location :is(span, a) {
        color: var(--leon-color-dark) !important;
    }

    :is(.wgl-events .events-style-grid, .leon-event-cards)
    .events-post:not(.no-leon-event-card) .events-post-hero_wrapper:is(:hover, :focus-within)
    .events-post_title a {
        color: var(--leon-color-primary) !important;
    }

    :is(.wgl-events .events-style-grid, .leon-event-cards)
    .events-post:not(.no-leon-event-card) .events-post-hero_wrapper:is(:hover, :focus-within)
    .events-post_cats .events-post_meta-categories span a {
        color: var(--leon-color-white) !important;
        background-color: var(--leon-color-primary) !important;
    }
}

:is(.wgl-events .events-style-grid, .leon-event-cards) .slick-slide
.events-post:not(.no-leon-event-card),
:is(.wgl-events .events-style-grid, .leon-event-cards) .slick-slide
.events-post:not(.no-leon-event-card) .events-post-hero_wrapper {
    height: 100%;
}

/* Solo filtros conocidos del módulo, nunca [class*='filter']. */
:is(.events-filter, .events-posts-filter, .isotope-filter, .wgl-filter) {
    position: relative;
    z-index: 5;
}

:is(.events-filter, .events-posts-filter, .isotope-filter, .wgl-filter) a {
    color: var(--leon-color-dark);
    text-decoration: none !important;
    transition: color 0.25s ease;
}

:is(.events-filter, .events-posts-filter, .isotope-filter, .wgl-filter) a:is(:hover, .active) {
    color: var(--leon-color-primary);
}

@media (max-width: 1024px) {
    :is(.wgl-events .events-style-grid, .leon-event-cards)
    .events-post:not(.no-leon-event-card) :is(.events-post-hero_wrapper, .events-post_bg_media) {
        min-height: 320px;
    }

    :is(.wgl-events .events-style-grid, .leon-event-cards)
    .events-post:not(.no-leon-event-card) .events-post-hero-content_wrapper {
        padding: 38px;
    }

    :is(.wgl-events .events-style-grid, .leon-event-cards)
    .events-post:not(.no-leon-event-card) .events-post_title {
        font-size: 26px;
    }
}

@media (max-width: 767px) {
    :is(.wgl-events .events-style-grid, .leon-event-cards)
    .events-post:not(.no-leon-event-card) :is(.events-post-hero_wrapper, .events-post_bg_media) {
        min-height: 280px;
    }

    :is(.wgl-events .events-style-grid, .leon-event-cards)
    .events-post:not(.no-leon-event-card) .events-post-hero-content_wrapper {
        padding: 28px;
    }

    :is(.wgl-events .events-style-grid, .leon-event-cards)
    .events-post:not(.no-leon-event-card) .events-post_title {
        font-size: 23px;
    }

    :is(.wgl-events .events-style-grid, .leon-event-cards)
    .events-post:not(.no-leon-event-card) .date_post {
        font-size: 12px;
    }

    :is(.wgl-events .events-style-grid, .leon-event-cards)
    .events-post:not(.no-leon-event-card) .events-post_location {
        font-size: 13px;
    }
}

/* ========================================================================== 
   14. FORMULARIOS: TIPOGRAFÍA, ACCESIBILIDAD Y NORMALIZACIÓN
   ========================================================================== */

:where(#main, #main-content, #wgl-content-wrapper, .site-content)
:where(input, textarea, select, button) {
    font: inherit;
}

/*
 * TheGov agrupa campos genéricos con selectores de WooCommerce y puede imponer
 * display:block. Como este proyecto no usa WooCommerce, se devuelve cada campo
 * al comportamiento natural del navegador dentro del contenido público.
 * No se modifican anchura, padding, borde, fondo, radio ni color.
 */
:where(#main, #main-content, #wgl-content-wrapper, .site-content)
:where(
    input[type='text'],
    input[type='url'],
    input[type='search'],
    input[type='email'],
    input[type='password'],
    input[type='tel'],
    input[type='time'],
    input[type='number'],
    input[type='date'],
    select,
    textarea
) {
    display: revert;
}

:where(#main, #main-content, #wgl-content-wrapper, .site-content) textarea {
    resize: vertical;
}

/*
 * No se fijan width, padding, margin, border, border-radius, fondo ni colores
 * de botones. Elementor y cada plugin conservan sus propios estilos.
 */

/* ========================================================================== 
   15. SCROLL UP
   ========================================================================== */

#scroll_up {
    position: fixed;
    right: 24px;
    bottom: 24px;
    z-index: 999;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 44px;
    height: 44px;
    border-radius: 50%;
    color: var(--leon-color-white);
    background-color: var(--leon-color-primary);
    box-shadow: 0 4px 12px rgba(137, 12, 88, 0.35);
    transition: background-color 0.2s ease, transform 0.2s ease;
}

#scroll_up:hover {
    background-color: var(--leon-color-primary-dark);
    transform: translateY(-2px);
}

/* ========================================================================== 
   16. SLIDER REVOLUTION 7
   ========================================================================== */

/*
 * Corrección estructural mínima. No se fuerza altura, fondo ni recorte del
 * módulo, de modo que prevalezca la configuración del propio slider.
 */
.elementor-widget-slider_revolution,
.elementor-widget-slider_revolution .elementor-widget-container,
.elementor-widget-slider_revolution .wp-block-themepunch-revslider,
.elementor-widget-slider_revolution .revslider,
.elementor-widget-slider_revolution .rev_slider_wrapper,
.elementor-widget-slider_revolution .rev-slider-wrapper {
    width: 100%;
    max-width: none;
}

.elementor-widget-slider_revolution sr7-module[id^='SR7_'] {
    display: block;
    width: 100%;
    max-width: none;
}

/* Solo tipografía de capas de texto; no se modifica su geometría. */
.elementor-widget-slider_revolution :is(
    sr7-txt,
    sr7-txt *,
    sr7-grp,
    sr7-grp *,
    a.sr7-layer,
    .sr7-layer[data-type='text']
) {
    font-family: var(--font-primary) !important;
}

.elementor-widget-slider_revolution :is(
    a.sr7-layer,
    .sr7-layer[data-type='text'],
    sr7-grp > a
) {
    font-family: var(--font-heading) !important;
    font-weight: 700 !important;
}

/* ========================================================================== 
   16. PRELOADER
   ========================================================================== */

/* Se conserva la desactivación existente, consolidada en una única regla. */
#preloader,
.preloader,
#page-preloader,
#preloader-wrapper,
.preloader-wrapper,
.preloader-container {
    display: none !important;
    visibility: hidden !important;
    opacity: 0 !important;
    pointer-events: none !important;
}

/* ========================================================================== 
   17. UTILIDADES EXISTENTES
   ========================================================================== */

.mt-0 { margin-top: 0; }
.mt-1 { margin-top: var(--spacing-xs); }
.mt-2 { margin-top: var(--spacing-sm); }
.mt-3 { margin-top: var(--spacing-md); }
.mt-4 { margin-top: var(--spacing-lg); }
.mt-5 { margin-top: var(--spacing-xl); }

.mb-0 { margin-bottom: 0; }
.mb-1 { margin-bottom: var(--spacing-xs); }
.mb-2 { margin-bottom: var(--spacing-sm); }
.mb-3 { margin-bottom: var(--spacing-md); }
.mb-4 { margin-bottom: var(--spacing-lg); }
.mb-5 { margin-bottom: var(--spacing-xl); }

.p-0 { padding: 0; }
.p-1 { padding: var(--spacing-xs); }
.p-2 { padding: var(--spacing-sm); }
.p-3 { padding: var(--spacing-md); }
.p-4 { padding: var(--spacing-lg); }
.p-5 { padding: var(--spacing-xl); }

.d-none { display: none; }
.d-block { display: block; }
.d-inline { display: inline; }
.d-inline-block { display: inline-block; }
.d-flex { display: flex; }
.d-grid { display: grid; }

.text-center { text-align: center; }
.text-left { text-align: left; }
.text-right { text-align: right; }
.text-justify { text-align: justify; }

.font-weight-normal { font-weight: 400; }
.font-weight-bold { font-weight: 700; }

.text-muted { color: var(--leon-color-gray); }
.text-primary { color: var(--leon-color-primary); }
.text-success { color: var(--color-success); }
.text-danger { color: var(--color-danger); }

/* ========================================================================== 
   19. IMPRESIÓN
   ========================================================================== */

@media print {
    header,
    #header,
    .header_wrap,
    footer,
    #footer,
    .site-footer,
    #scroll_up,
    .rev_slider_wrapper,
    [id^='SR7_'],
    [id^='rev_slider'],
    .sd-sharing-enabled,
    .sharedaddy,
    nav,
    .breadcrumbs,
    .elementor-widget-button {
        display: none !important;
    }

    body,
    #main,
    #main-content,
    .elementor-section {
        width: 100% !important;
        margin: 0 !important;
        padding: 0 !important;
    }

    body {
        color: #000000;
        background: #ffffff;
        font-size: 12pt;
    }

    h1,
    h2,
    h3 {
        color: #000000;
        break-after: avoid-page;
        page-break-after: avoid;
    }

    img {
        max-width: 100%;
        break-inside: avoid;
        page-break-inside: avoid;
    }

    a[href]::after {
        content: ' (' attr(href) ')';
        color: #555555;
        font-size: 9pt;
    }

    a[href^='#']::after,
    a[href^='javascript']::after {
        content: '';
    }
}