/*
 * Ajustes para celulares y tablets del contenido (iframe inferior).
 * Se carga despues de style.css. En escritorio (992px o mas) solo aplica
 * las dos primeras reglas, que no cambian nada visible.
 */

/* El reproductor y el menu ya estan en el iframe superior (menu.php).
   El de header.php quedaba duplicado en celulares. */
nav.navbar-fixed-top.mobile {
  display: none !important;
}

/* Nada puede ser mas ancho que la pantalla */
img,
iframe,
video,
embed,
object {
  max-width: 100%;
}

@media (max-width: 991px) {

  /* Copia del reproductor que footer.php agrega dentro del contenido */
  #page_effect > iframe#iframe01 {
    display: none !important;
  }

  html,
  body {
    overflow-x: hidden;
  }

  body {
    font-size: 15px;
  }

  /* Sin la copia del reproductor, el contenido empieza justo debajo
     de la barra superior (110px; el iframe de contenido arranca a 20px) */
  .content-all {
    background-size: 100% auto;
    margin-top: 90px;
  }

  .backgroud-content-grey {
    margin-top: 40px;
  }

  .container,
  .backgroud-content-grey {
    width: auto;
    max-width: 100%;
  }

  /* La columna principal ocupa todo el ancho; los banners van debajo */
  .backgroud-content-grey .col-sm-8 {
    float: none;
    width: auto;
  }

  .backgroud-content-grey > .row {
    margin-left: 0;
    margin-right: 0;
  }

  /* Contenido de las notas y paginas */
  .content img,
  .content iframe,
  .content video,
  .wp-caption {
    max-width: 100% !important;
    height: auto;
  }

  .content iframe[src*="youtube"],
  .content iframe[src*="vimeo"] {
    width: 100% !important;
    aspect-ratio: 16 / 9;
    height: auto !important;
  }

  .content table {
    display: block;
    max-width: 100%;
    overflow-x: auto;
  }

  .content {
    word-wrap: break-word;
    overflow-wrap: break-word;
  }

  .single .content h1,
  .page .content h1 {
    font-size: 26px;
    line-height: 1.25;
  }

  /* Titulo con fondo de las paginas (Programacion, La Radio, etc.) */
  .page h1 {
    height: auto;
    min-height: 80px;
    padding: 20px 15px;
    font-size: 28px;
  }

  .page .clima h1 {
    height: auto;
    min-height: 80px;
    padding: 20px 15px;
  }

  /* Iconos para compartir que quedaban fuera de la pantalla */
  .icons-social,
  .page .icons-social,
  .single .icons-social {
    position: static;
    display: flex;
    gap: 6px;
    padding: 10px 15px 0;
  }

  .icons-social img {
    width: 34px;
    height: auto;
  }

  /* Carrusel de la portada */
  .nota-principal.backgroud-content {
    margin: 10px 0;
  }

  .carousel-caption a h4 {
    font-size: 18px;
  }

  /* Banners de la columna lateral: lista simple, sin alturas fijas */
  .page .sidebar,
  .single .sidebar,
  .page-template-index_default .sidebar,
  .sidebar-page {
    display: block !important;
    width: 100% !important;
    height: auto !important;
    min-height: 0 !important;
    margin: 10px 0 !important;
    padding: 10px !important;
    background: #fff !important;
  }

  .page .sidebar .widget-area,
  .single .sidebar .widget-area,
  .page-template-index_default .sidebar .widget-area,
  .sidebar-page .widget-area {
    width: 100% !important;
    height: auto !important;
    margin: 0 !important;
    padding: 0 !important;
    overflow: visible !important;
    background: transparent !important;
  }

  .sidebar .swiperv,
  .sidebar-page .swiperv {
    height: auto !important;
    overflow: visible !important;
  }

  .sidebar .swiper-wrapper,
  .sidebar-page .swiper-wrapper {
    display: grid !important;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 10px;
    height: auto !important;
    transform: none !important;
  }

  .sidebar .swiper-wrapper .widget_sp_image,
  .sidebar-page .swiper-wrapper .widget_sp_image {
    width: auto !important;
    height: auto !important;
    margin: 0 !important;
  }

  /* Swiper repite banners para el bucle: los duplicados se ocultan */
  .sidebar .swiper-wrapper .swiper-slide-duplicate,
  .sidebar-page .swiper-wrapper .swiper-slide-duplicate,
  .sidebar .swiper-wrapper [data-swiper-slide-index].swiper-slide-duplicate {
    display: none !important;
  }

  .sidebar img,
  .sidebar-page img,
  .out-sidebar img {
    display: block;
    width: 100% !important;
    height: auto !important;
    margin: 0 auto;
  }

  .out-sidebar {
    margin-top: 10px;
  }

  /* Pie de pagina */
  footer {
    padding: 20px 15px;
  }

  footer .row > [class*="col-"] {
    margin-bottom: 15px;
  }

  /* Columna vacia del medio */
  footer .row.text-left > .col-md-4:not(.col-xs-12) {
    display: none;
  }

  a.logo-face {
    float: none;
    display: block;
    padding: 0;
    margin: 0 0 15px;
  }

  footer,
  .copy,
  .contacto-footer {
    font-size: 14px;
  }

  .copy {
    text-align: center;
  }

  .btn-facebook {
    padding-left: 15px !important;
    padding-right: 15px;
  }
}

/* Tablets: las noticias de la portada van de a dos por fila */
@media (min-width: 768px) and (max-width: 991px) {
  .notas.col-sm-3 {
    width: 50%;
    clear: none !important;
  }

  .notas.col-sm-3:nth-child(2n+1) {
    clear: both !important;
  }

  .notas img {
    width: 100%;
    height: auto !important;
    max-height: 260px;
    object-fit: cover;
  }
}

/* Celulares */
@media (max-width: 767px) {

  .backgroud-content-grey {
    padding-left: 10px;
    padding-right: 10px;
  }

  .backgroud-content-grey .backgroud-content,
  .container.all-width.backgroud-content {
    margin: 10px 0 !important;
  }

  .nota-principal.backgroud-content {
    padding: 0 10px 10px;
  }

  .content-all h1 {
    font-size: 26px;
  }

  .notas {
    margin-bottom: 20px !important;
  }

  .notas img {
    width: 100%;
    height: auto !important;
  }

  .notas .titulo {
    line-height: 1.25 !important;
  }

  .notas .titulo a {
    font-size: 18px;
  }

  .notas p {
    font-size: 14px;
  }

  .titulo a {
    font-size: 20px;
  }

  .page .content,
  .single .content {
    padding: 12px;
    font-size: 16px;
  }

  .page .programcion p {
    font-size: 17px;
  }

  .carousel-caption a h4 {
    font-size: 16px;
  }

  .sidebar .swiper-wrapper,
  .sidebar-page .swiper-wrapper {
    grid-template-columns: 1fr 1fr;
    gap: 8px;
  }
}
