/* TV en vivo dejó de estar disponible; ocultar sus accesos en la navegación. */
:root #subheader a[href*="/pagina/id/region_en_accion/"],
:root #subheader li:has(> a[href*="/pagina/id/region_en_accion/"]) { display: none !important; }
/* Un mismo marco para todos los boletines, sin recortar ni deformar imágenes. */
:root #inst-03 .front-trj { aspect-ratio: 4 / 5; height: auto; background-color: #fff; }
:root #inst-03 .front-trj img {
  position: absolute; inset: 0; width: 100% !important; height: 100% !important;
  object-fit: contain; margin: 0; padding: 0; border: 0;
}
/* Correcciones del portal PHP original. Mantener el escritorio desde 992px. */
@media screen and (max-width: 991.98px) {
  :root #rJunBod, :root #page, :root #pcontent { width: 100%; min-width: 0; }
  :root #pcontent .bgpage { width: 100% !important; padding: 16px !important; display: flex; flex-direction: column; }
  :root #bgtop .container-fluid.px-5 { padding-left: 12px !important; padding-right: 12px !important; }
  :root #pcontent .container-fluid { min-width: 0; }
  :root #pcontent .pdt_page, :root #pcontent .pdt_page.list, :root #pdt_sidebar, :root .pageimg {
    float: none !important; width: 100% !important; max-width: 100%; min-width: 0;
  }
  :root #pcontent .bgpage > .pdt_page { order: 1; }
  :root #pdt_sidebar { order: 2; margin: 24px 0; }
  :root #pcontent .pdt_page { font-size: 16px; line-height: 1.6; overflow-wrap: anywhere; }
  :root #pcontent .pdt_page p { text-align: left; }
  :root #pcontent .pdt_page .ptitle, :root #pcontent .ptitle2 {
    width: 100% !important; margin: 16px 0 !important; padding: 16px !important;
    font-size: clamp(20px, 5vw, 28px); line-height: 1.35; overflow-wrap: anywhere;
  }
  :root #pcontent .pdt_page figure { width: 100% !important; margin: 16px 0 !important; }
  :root #pcontent .pdt_page img, :root #pcontent .pdt_page figure img, :root .pageimg img {
    max-width: 100% !important; width: auto !important; height: auto !important; margin-left: 0 !important;
  }
  :root #pcontent .pdt_page iframe { width: 100% !important; max-width: 100%; margin-left: 0 !important; }
  :root #pcontent .pfecha { width: 100% !important; margin: 0 !important; padding: 12px 0; display: flex; flex-wrap: wrap; gap: 12px; }
  :root #pcontent .pfecha > * { float: none !important; max-width: 100%; }
  :root #inst-02 { padding-top: 24px !important; }
  :root #inst-02 .owl-stage { width: 100% !important; transform: none !important; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 20px; }
  :root #inst-02 .owl-item { width: 100% !important; min-width: 0; float: none; }
  :root #inst-02 .owl-item.cloned { display: none; }
  :root #inst-02 .links-ext { display: flex; width: 100%; min-height: 80px; align-items: center; justify-content: center; }
  :root #inst-02 .links-ext img { max-width: calc(100% - 30px) !important; object-fit: contain; }
  :root .agendas { width: 100% !important; }
  :root .agendas .agenda { width: calc(50% - 10px); min-height: 44px; margin-bottom: 10px; }
  :root .agendas #calendar { width: 100% !important; margin: 16px 0 !important; padding: 0 !important; min-width: 0; }
  :root #calendar .fc-event { overflow-wrap: normal; }
  :root #calendar .fc-event-inner { overflow: hidden; }
  :root #calendar .fc-event-title { white-space: nowrap; }
  :root #calendar .fc-header { width: 100%; }
  :root #calendar .fc-header tbody, :root #calendar .fc-header tr { display: flex; flex-wrap: wrap; width: 100%; gap: 8px; }
  :root #calendar .fc-header td { display: block; width: auto; padding: 0; }
  :root #calendar .fc-header .fc-header-title h2 { font-size: 20px; }
  :root #calendar .fc-header .fc-button { min-height: 36px; }
  :root #calendar .fc-header .fc-button-inner { min-height: 34px; }
  :root #pcontent video { max-width: 100%; }
  :root .grj-table-scroll { width: 100%; overflow-x: auto; -webkit-overflow-scrolling: touch; }
  :root .grj-table-scroll table { min-width: 100%; max-width: none; }
  :root #pcontent input, :root #pcontent select, :root #pcontent textarea { max-width: 100%; font-size: 16px; }
  :root #pcontent .input-group, :root #filter_name { max-width: 100%; }
  :root #pcontent .pagination { flex-wrap: wrap; }
  :root #pcontent .pagination a { min-width: 44px; min-height: 44px; }

  /* Encabezado y navegación con submenús dentro del ancho disponible. */
  :root #subheader header { position: relative !important; top: auto !important; margin-bottom: 16px !important; }
  :root #menu-main { height: auto !important; }
  :root #menu-main > #container-second-bar-header { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px; }
  :root #menu-main > #container-second-bar-header > .brand-mobile-mod,
  :root #menu-main #logos-mainpage, :root #menu-main #slogan { display: none !important; }
  :root #menu-main .logo-mobile-mod { display: flex; align-items: center; margin: 0; padding: 0; }
  :root #menu-main .logo-mobile-mod img { width: 90px !important; height: auto; max-height: 48px; object-fit: contain; }
  :root #menu-main #navbarSupportedContent { flex-basis: 100%; }
  :root #container-second-bar-header { width: 100%; max-width: 100%; padding: 0 12px !important; }
  :root #menu-main .brand-mobile-mod { font-size: 12px; white-space: normal; }
  :root #menu-main .logo-mobile-mod { margin-right: 8px; }
  :root #menu-main .navbar-toggler { min-width: 44px; min-height: 44px; }
  :root #navbarSupportedContent { padding: 8px 0; max-width: 100%; max-height: 75vh; overflow-y: auto; }
  :root #navbarSupportedContent .navbar-nav { width: 100%; align-items: stretch !important; }
  :root #navbarSupportedContent .nav-link, :root #navbarSupportedContent .dropdown-item {
    min-height: 44px; white-space: normal; overflow-wrap: anywhere; padding: 12px;
  }
  :root #navbarSupportedContent .dropdown-menu, :root #navbarSupportedContent .submenu {
    position: static !important; float: none; width: 100% !important; min-width: 0;
    max-width: 100%; margin: 0; transform: none !important; inset: auto !important;
  }
  :root #navbarSupportedContent .dropdown-menu .submenu { padding-left: 12px; }
  :root #navbarSupportedContent .dropdown-menu:not(.show) { display: none !important; }
  :root #navbarSupportedContent .dropdown-menu.show { display: block !important; }

  :root .grid-container-first, :root .grid-container, :root .grid-container-two {
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important; gap: 12px !important;
    padding: 12px 0 !important; width: 100%;
  }
  :root .grid-item, :root .grid-item-ext { min-width: 0; overflow-wrap: anywhere; }
  :root .grid-item-ext img { max-width: 100% !important; height: auto !important; margin-left: 0 !important; margin-right: 0 !important; }
  /* Portada: sin deformar imágenes y sin acumular márgenes laterales. */
  :root .wrapper-geo { padding: 0 !important; margin-bottom: 0 !important; }
  :root .carousel-geo { padding: 0 !important; }
  :root .carousel-geo .cardd { height: auto !important; margin: 0 !important; }
  :root .carousel-geo .cardd img { display: block; height: auto !important; width: 100% !important; }
  :root .colors-element { min-height: 6px; }
  :root #inst-03 .card-trj { margin: 12px 0; }
  :root #inst-03 .front-trj, :root #inst-03 .card-trj:hover .front-trj { transform: none; }
  :root #inst-03 .back-trj, :root #inst-03 .card-trj:hover .back-trj {
    position: relative; height: auto; transform: none; padding: 12px; margin-top: 8px;
  }
  :root #inst-03 .back-trj a { display: inline-flex; min-height: 44px; align-items: center; }
  :root #pcontent .container-fluid > h1, :root #wb_grilla .fagrda h1 {
    font-size: clamp(20px, 4.8vw, 26px) !important; line-height: 1.35 !important;
    height: auto !important; margin: 0 !important; padding: 0 0 10px !important;
    white-space: normal !important; overflow-wrap: anywhere;
  }
  :root #wb_grilla .fagrda h1 span, :root #pcontent .container-fluid > h1 > span { padding: 0 !important; }

  /* Noticias: tarjetas legibles, sin comprimir varias en una fila. */
  :root #wb_grilla, :root #wb_grilla .fagrda { width: 100% !important; height: auto !important; }
  :root #wb_grilla .fagrda .btngr { position: relative; top: auto; right: auto; float: none; display: inline-flex; align-items: center; min-height: 44px; margin-bottom: 16px; }
  :root #wb_grilla #carrusel { display: grid !important; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 20px; overflow: visible !important; }
  :root #wb_grilla #carrusel > li { display: block !important; width: 100% !important; min-width: 0; height: auto !important; margin: 0 !important; float: none !important; }
  :root #wb_grilla #carrusel .gri_shadow { width: 100%; height: auto !important; min-height: 0; }
  :root #wb_grilla #carrusel .gri-title { position: static; padding: 16px; width: 100%; height: auto !important; overflow: visible; }
  :root #wb_grilla #carrusel .liphoto { width: 100% !important; }

  /* Sucesos: imagen arriba y texto completo debajo. */
  :root .container-bol { margin: 16px 0; padding: 0 !important; }
  :root .carousel-newslet { display: block; height: auto !important; max-height: none !important; }
  :root .carousel-newslet .carousel-item { display: none; position: relative; height: auto; flex-direction: column; }
  :root .carousel-newslet .carousel-item.active-bol { display: flex; }
  :root .carousel-newslet .carousel-item__image { width: 100%; flex-basis: auto; height: 260px; order: 0; background-size: contain; transform: none; }
  :root .carousel-newslet .carousel-item__info { width: 100%; height: auto; padding: 20px; margin: 0; }
  :root .carousel-newslet .carousel-item__title { font-size: 22px; line-height: 1.35; }
  :root .carousel-newslet .carousel-item__description { margin-top: 16px; text-align: left; color: #555; }
  :root .carousel-newslet .carousel-item__container { overflow-wrap: anywhere; }
  :root .carousel-newslet .carousel__nav { position: relative; display: flex; justify-content: flex-end; }
  :root .carousel__arrow { min-width: 44px; min-height: 44px; }

  :root #videoPlayer { display: block; width: 100%; height: auto; max-height: 70vh; }
  :root #videoCarousel .carousel-btn { min-width: 44px; min-height: 44px; }
  :root #videoCarousel + * { min-width: 0; }
  :root #pcontent .card-body { padding: 16px 0; }
  :root #videoDescription { text-align: left !important; overflow-wrap: anywhere; }
  :root #videoFecha { overflow-wrap: anywhere; }
  :root .content-contact { display: flex; flex-direction: column; }
  :root .content-contact .map-contact iframe { height: 280px; }
  :root .content-contact .info-float { position: static !important; width: 100% !important; height: auto !important; background-color: #1255b3 !important; }
  :root .info-float p:has(.oculto), :root .info-float p:has(.texto_transparente) { display: none; }
  :root #wbfooter .row { margin-left: 0; margin-right: 0; }
  :root #wbfooter .px-5 { padding-left: 16px !important; padding-right: 16px !important; }
  :root #wbfooter .third-foot > div { max-width: 100%; overflow-wrap: anywhere; }
  :root #overlay_mod .modal_mod { width: calc(100% - 24px); max-width: 640px; max-height: calc(100dvh - 24px); }
  :root #overlay_mod img { max-width: 100%; max-height: 80dvh; width: auto; height: auto; object-fit: contain; }
  :root #overlay_mod .close_mod { min-width: 44px; min-height: 44px; display: grid; place-items: center; }
  :root #pcontent main, :root #pcontent main#concursos { display: block; padding: 24px 0; }
  :root #pcontent .cards, :root #pcontent .cards_con { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 20px; }
  :root #pcontent .cards > .card, :root #pcontent .cards_con > .card_con { grid-column: auto; min-width: 0; }
  :root #pcontent .card__image-container img, :root #pcontent .card__image-container_con img { left: 50% !important; }
}
@media screen and (max-width: 575.98px) {
  :root #wb_grilla #carrusel, :root #pcontent .cards, :root #pcontent .cards_con { grid-template-columns: minmax(0, 1fr); }
  :root #menu-main .brand-mobile-mod:not(a) { max-width: 160px; font-size: 11px; }
}
