/* ============================================================
   Radio Armería Premium 10.0.6
   Contención de ancho desde Programación Destacada hacia abajo.
   Objetivo: alinear los módulos con el contenedor maestro de 1140px
   sin modificar hero, chat, noticias principales, header o player.
   ============================================================ */

:root {
  --ra-home-content-max: 1140px;
  --ra-home-content-gutter: 32px;
}

/*
 * Estos widgets no traían max-width propio. Cuando Elementor los coloca
 * dentro de una sección de ancho completo, crecían hasta todo el viewport.
 * Los contenemos de forma local, sin cambiar la estructura de Elementor.
 */
body.home .nxradio-featured-program,
body.home .elty-section-schedule,
body.home .elty-section-2,
body.home .ra-react-news--more,
body.home .elementor-widget-container:has(iframe[src*="open.spotify.com"]),
body.home .elementor-widget-container:has(iframe[src*="spotify.com/embed"]),
body.home .elementor-widget-html:has(iframe[src*="spotify"]),
body.home .elementor-widget-shortcode:has(iframe[src*="spotify"]) {
  width: min(var(--ra-home-content-max), calc(100% - var(--ra-home-content-gutter))) !important;
  max-width: var(--ra-home-content-max) !important;
  min-width: 0 !important;
  margin-left: auto !important;
  margin-right: auto !important;
  box-sizing: border-box !important;
}

/* React + Noticias ya incluye padding propio; aquí solo igualamos el ancho. */
body.home .ra-react-news--more {
  padding-left: 0 !important;
  padding-right: 0 !important;
}

/* Seguridad de encogimiento: evita que grids/flex-items impongan ancho extra. */
body.home .nxradio-featured-program,
body.home .nxradio-featured-program .feat-program,
body.home .nxradio-featured-program .feat-program > *,
body.home .elty-section-schedule,
body.home .elty-section-schedule .schedule-header,
body.home .elty-section-schedule .schedule-list__wrapper,
body.home .elty-section-schedule .schedule-list__wrapper > *,
body.home .elty-section-2,
body.home .elty-section-2 .elty-section__items,
body.home .elty-section-2 .elty-section__items > *,
body.home .ra-react-news--more,
body.home .ra-react-news--more .ra-rnews-shell,
body.home .ra-react-news--more .ra-rnews-grid,
body.home .ra-react-news--more .ra-rnews-grid > * {
  min-width: 0 !important;
  max-width: 100% !important;
  box-sizing: border-box !important;
}

body.home .nxradio-featured-program .feat-program,
body.home .elty-section-schedule .schedule-header,
body.home .elty-section-schedule .schedule-list__wrapper,
body.home .elty-section-2 .elty-section__items,
body.home .ra-react-news--more .ra-rnews-shell,
body.home .ra-react-news--more .ra-rnews-grid {
  width: 100% !important;
}

/* Spotify: el reproductor ocupa el contenedor, nunca el viewport completo. */
body.home iframe[src*="open.spotify.com"],
body.home iframe[src*="spotify.com/embed"] {
  display: block !important;
  width: 100% !important;
  max-width: 100% !important;
  min-width: 0 !important;
  margin-left: auto !important;
  margin-right: auto !important;
  box-sizing: border-box !important;
}

/*
 * Las flechas antiguas usan margen negativo de 24px. En anchos intermedios
 * eso puede crear scroll horizontal aunque el contenido ya esté contenido.
 */
@media (max-width: 1199px) {
  body.home .elty-section-2 .elty-slider-navigation .elty-slider-prev,
  body.home .elty-section-2 .elty-slider-navigation .elty-slider-next {
    margin-left: 6px !important;
    margin-right: 6px !important;
  }
}

/* Tablet y móvil: mismo alineado lateral que el resto de la portada. */
@media (max-width: 767px) {
  :root {
    --ra-home-content-gutter: 18px;
  }

  body.home .nxradio-featured-program,
  body.home .elty-section-schedule,
  body.home .elty-section-2,
  body.home .ra-react-news--more,
  body.home .elementor-widget-container:has(iframe[src*="open.spotify.com"]),
  body.home .elementor-widget-container:has(iframe[src*="spotify.com/embed"]),
  body.home .elementor-widget-html:has(iframe[src*="spotify"]),
  body.home .elementor-widget-shortcode:has(iframe[src*="spotify"]) {
    width: calc(100% - var(--ra-home-content-gutter)) !important;
    max-width: calc(100% - var(--ra-home-content-gutter)) !important;
  }

  /* Los días siguen en una sola línea, pero pueden desplazarse dentro
     del propio módulo en pantallas extremadamente angostas. */
  body.home .elty-section-schedule .schedule-header {
    overflow-x: auto !important;
    overflow-y: hidden !important;
    overscroll-behavior-inline: contain;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
  }

  body.home .elty-section-schedule .schedule-header::-webkit-scrollbar {
    display: none;
  }
}

/* Última barrera local contra contenido multimedia sobredimensionado. */
body.home .nxradio-featured-program img,
body.home .elty-section-schedule img,
body.home .elty-section-2 img,
body.home .ra-react-news--more img {
  max-width: 100% !important;
}
