/* ==========================================================
   Portal Monagas — REV.7 Acotaciones completas + Responsive Android
   Capa final de presentación. No altera rutas, consultas ni acciones.
   ========================================================== */

/* Logo institucional: la versión positiva se usa donde el fondo es oscuro. */
.brand-logo-contrast{display:none!important}
body.contraste .brand-logo-default{display:none!important}
body.contraste .brand-logo-contrast{display:block!important;filter:brightness(0) invert(1)}

footer .footer-logo{
  width:min(255px,100%)!important;
  height:auto!important;
  object-fit:contain!important;
  filter:brightness(0) invert(1)!important;
}

/* Selector explícito de tema, con icono + texto. */
.theme-toggle{display:inline-flex;align-items:center;justify-content:center;gap:7px}
.theme-toggle i{flex:0 0 auto}
.mobile-theme-toggle{width:100%!important}

/* Acotación de la reseña histórica: párrafos legibles y justificados. */
body[data-page-path="gobernacion/historia.php"] main p,
body[data-page-path="gobernacion/historia"] main p{
  text-align:justify;
  text-justify:inter-word;
  hyphens:auto;
}

/* Noticias destacadas añadidas al inicio. */
.home-featured-news-rev6{
  position:relative;
  padding:54px 0;
  background:linear-gradient(180deg,rgba(240,248,252,.78),rgba(255,255,255,.96));
  overflow:hidden;
}
.home-featured-news-rev6::before{
  content:"";
  position:absolute;
  width:300px;
  height:300px;
  right:-140px;
  top:-150px;
  border-radius:50%;
  background:rgba(116,193,235,.13);
  pointer-events:none;
}
.home-featured-news-head-rev6{
  position:relative;
  z-index:1;
  display:flex;
  align-items:end;
  justify-content:space-between;
  gap:24px;
  margin-bottom:24px;
}
.home-featured-news-head-rev6>div{min-width:0}
.home-featured-news-kicker-rev6{
  display:block;
  margin-bottom:6px;
  color:var(--azul,#1378b9);
  font-size:.72rem;
  font-weight:900;
  letter-spacing:.10em;
  text-transform:uppercase;
}
.home-featured-news-head-rev6 h2{
  margin:0;
  font-size:clamp(1.8rem,3vw,2.6rem);
  line-height:1.08;
  letter-spacing:-.035em;
  overflow-wrap:normal;
  word-break:normal;
}
.home-featured-news-head-rev6 p{max-width:700px;margin:8px 0 0;color:var(--texto-suave,#64748b)}
.home-featured-news-grid-rev6{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:18px}
.home-featured-news-card-rev6{
  min-width:0;
  overflow:hidden;
  border:1px solid var(--linea,#dce8ef);
  border-radius:24px;
  background:var(--panel,#fff);
  box-shadow:var(--sombra-sm,0 10px 30px rgba(10,50,80,.08));
}
.home-featured-news-image-rev6{display:block;aspect-ratio:16/9;overflow:hidden;background:#eaf4f9}
.home-featured-news-image-rev6 img{width:100%;height:100%;object-fit:cover;display:block;transition:transform .28s ease}
.home-featured-news-card-rev6:hover .home-featured-news-image-rev6 img{transform:scale(1.025)}
.home-featured-news-body-rev6{padding:18px}
.home-featured-news-body-rev6 time{display:block;margin-bottom:7px;color:var(--azul,#1378b9);font-size:.72rem;font-weight:850}
.home-featured-news-body-rev6 h3{margin:0 0 9px;font-size:1.08rem;line-height:1.28;overflow-wrap:normal;word-break:normal}
.home-featured-news-body-rev6 h3 a{color:inherit;text-decoration:none}
.home-featured-news-body-rev6 p{margin:0 0 14px;color:var(--texto-suave,#64748b);font-size:.88rem;line-height:1.55}
.home-featured-news-link-rev6{display:inline-flex;align-items:center;gap:7px;color:var(--azul,#1378b9);font-size:.82rem;font-weight:900;text-decoration:none}
.home-featured-news-empty-rev6{display:flex;align-items:center;gap:16px;padding:22px;border:1px dashed var(--linea,#dce8ef);border-radius:20px;background:rgba(255,255,255,.76)}
.home-featured-news-empty-rev6>i{font-size:1.7rem;color:var(--azul,#1378b9)}
.home-featured-news-empty-rev6 strong,.home-featured-news-empty-rev6 span{display:block}
.home-featured-news-empty-rev6 span{margin-top:3px;color:var(--texto-suave,#64748b);font-size:.86rem;line-height:1.5}

/* El hotfix anterior permitía cortar cualquier palabra en headings. REV7 lo mantiene corregido. */
main#contenido h1,
main#contenido h2,
main#contenido h3,
main#contenido .breadcrumb{
  overflow-wrap:normal!important;
  word-break:normal!important;
  hyphens:none!important;
}

@media (max-width:900px){
  .home-featured-news-grid-rev6{grid-template-columns:repeat(2,minmax(0,1fr))}
}

@media (max-width:720px){
  /* Android: menos aire desperdiciado y títulos que no cortan palabras. */
  main#contenido .page-hero,
  main#contenido .sistema-hero{
    min-height:0!important;
    padding:28px 0 20px!important;
  }

  main#contenido .page-box,
  main#contenido .sistema-box{
    width:100%!important;
    min-height:0!important;
    height:auto!important;
    padding:24px 20px!important;
    border-radius:26px!important;
  }

  main#contenido .page-hero h1,
  main#contenido .sistema-hero h1{
    max-width:100%!important;
    margin-inline:0!important;
    font-size:clamp(2rem,9vw,2.35rem)!important;
    line-height:1.03!important;
    letter-spacing:-.04em!important;
    text-wrap:balance;
  }

  main#contenido .sistema-box h1,
  main#contenido .sistema-box .hero-copy{
    text-align:left!important;
  }

  main#contenido .breadcrumb{
    margin-bottom:16px!important;
    font-size:clamp(.72rem,3.4vw,.86rem)!important;
    line-height:1.45!important;
    letter-spacing:0!important;
    text-wrap:pretty;
  }

  main#contenido .page-box p,
  main#contenido .sistema-box .hero-copy{
    max-width:100%!important;
    margin-top:14px!important;
    font-size:clamp(.96rem,4vw,1.06rem)!important;
    line-height:1.62!important;
    overflow-wrap:normal!important;
    word-break:normal!important;
    hyphens:none!important;
  }

  .sistema-title-row{grid-template-columns:1fr!important;gap:12px!important;align-items:start!important}
  .sistema-main-icon{width:58px!important;height:58px!important;border-radius:19px!important;font-size:1.5rem!important}
  .sistema-actions{display:grid!important;grid-template-columns:1fr!important;gap:10px!important;margin-top:20px!important}
  .sistema-actions .btn{width:100%!important;min-height:52px!important;justify-content:center!important;padding:12px 14px!important;font-size:.94rem!important}
  .sistema-actions .btn-primary{order:1}
  .sistema-actions .btn-soft{order:2}
  .sistema-actions .btn-light{order:3}

  /* El bot queda reconocible sin invadir CTAs. */
  #chatAssistant .chat-nudge{display:none!important}
  #chatAssistant .chat-window{bottom:70px!important}

  .home-featured-news-rev6{padding:38px 0}
  .home-featured-news-head-rev6{display:grid;align-items:start;gap:14px;margin-bottom:18px}
  .home-featured-news-head-rev6 h2{font-size:clamp(1.7rem,8vw,2.1rem)}
  .home-featured-news-head-rev6 .btn{width:100%;justify-content:center}
  .home-featured-news-grid-rev6{grid-template-columns:1fr;gap:14px}
  .home-featured-news-card-rev6{border-radius:20px}
  .home-featured-news-body-rev6{padding:16px}
  .home-featured-news-empty-rev6{align-items:flex-start;padding:17px}

  /* El logo del footer gana presencia sin desbordar. */
  footer .footer-logo{width:min(220px,78vw)!important}
}

@media (max-width:390px){
  main#contenido .page-box,
  main#contenido .sistema-box{padding:21px 17px!important;border-radius:23px!important}
  main#contenido .page-hero h1,
  main#contenido .sistema-hero h1{font-size:clamp(1.9rem,9.2vw,2.16rem)!important}
  .sistema-actions .btn{font-size:.88rem!important}
}

@media (prefers-reduced-motion:reduce){
  .home-featured-news-image-rev6 img{transition:none}
  .home-featured-news-card-rev6:hover .home-featured-news-image-rev6 img{transform:none}
}

/* ==========================================================
   REV.7 - cierre literal de todas las acotaciones del PDF
   ========================================================== */

/* El control muestra de forma explícita Modo claro / Modo oscuro con iconos. */
.theme-toggle{
  gap:6px!important;
  white-space:nowrap;
}
.theme-toggle .theme-option{
  display:inline-flex;
  align-items:center;
  gap:5px;
  opacity:.52;
  font-weight:750;
  transition:opacity .18s ease,color .18s ease;
}
.theme-toggle .theme-option.is-active{
  opacity:1;
  color:var(--azul,#1378b9);
  font-weight:900;
}
body.contraste .theme-toggle .theme-option.is-active{color:#fff}
.theme-toggle .theme-sep{opacity:.48}
.mobile-theme-toggle .theme-option{justify-content:center}

/* Acotación pág. 1: el robot debe distinguirse mejor en escritorio.
   En teléfono se mantiene compacto para no invadir los CTA observados en Android. */
@media (min-width:721px){
  #chatAssistant:not(.open) .chat-btn{
    width:72px!important;
    height:90px!important;
    min-width:72px!important;
    min-height:90px!important;
  }
  #chatAssistant:not(.open) .chat-btn img{
    width:72px!important;
    height:90px!important;
  }
}

@media (max-width:720px){
  #chatAssistant:not(.open) .chat-btn{
    width:50px!important;
    height:63px!important;
    min-width:50px!important;
    min-height:63px!important;
  }
  #chatAssistant:not(.open) .chat-btn img{
    width:50px!important;
    height:63px!important;
  }
  #chatAssistant:not(.user-positioned){right:5px!important;bottom:max(7px,env(safe-area-inset-bottom))!important}
}

/* ==========================================================
   REV.8 — cierre reforzado de la acotación “Justificar el texto”
   La hoja REV.7 se carga al final; aquí usamos !important para vencer
   reglas históricas de responsive que aún forzaban text-align:left.
   Solo afecta la página institucional de Historia.
   ========================================================== */
body[data-page-path="gobernacion/historia.php"] main p,
body[data-page-path="gobernacion/historia"] main p,
body[data-page-path="gobernacion/historia/"] main p,
body[data-page-path="gobernacion/historia.php"] main .page-description,
body[data-page-path="gobernacion/historia"] main .page-description,
body[data-page-path="gobernacion/historia/"] main .page-description,
body[data-page-path="gobernacion/historia.php"] main .history-copy,
body[data-page-path="gobernacion/historia"] main .history-copy,
body[data-page-path="gobernacion/historia/"] main .history-copy,
body[data-page-path="gobernacion/historia.php"] main .history-content,
body[data-page-path="gobernacion/historia"] main .history-content,
body[data-page-path="gobernacion/historia/"] main .history-content{
  text-align:justify!important;
  text-justify:inter-word!important;
  text-align-last:left;
  hyphens:none!important;
  -webkit-hyphens:none!important;
  overflow-wrap:normal!important;
  word-break:normal!important;
}

/* También cubre párrafos dentro de tarjetas institucionales de la reseña,
   incluidos los bloques laterales “Maturín como capital” y “Línea de tiempo”. */
body[data-page-path^="gobernacion/historia"] main article p,
body[data-page-path^="gobernacion/historia"] main section p,
body[data-page-path^="gobernacion/historia"] main .card p,
body[data-page-path^="gobernacion/historia"] main [class*="history"] p,
body[data-page-path^="gobernacion/historia"] main [class*="historia"] p{
  text-align:justify!important;
  text-justify:inter-word!important;
  text-align-last:left;
  hyphens:none!important;
  -webkit-hyphens:none!important;
  overflow-wrap:normal!important;
  word-break:normal!important;
}

/* ==========================================================
   REV.10 — bot/asistente un poco más grande según acotación pág. 1
   Se aumenta de forma visible tanto en escritorio como en móvil.
   Solo cambia presentación: no altera eventos, drag, enlaces ni lógica.
   ========================================================== */
#chatAssistant:not(.open) .chat-btn,
#chatAssistant:not(.open) .chat-btn img{
  object-fit:contain!important;
}

@media (min-width:721px){
  #chatAssistant:not(.open) .chat-btn{
    width:104px!important;
    height:130px!important;
    min-width:104px!important;
    min-height:130px!important;
    max-width:104px!important;
    max-height:130px!important;
  }
  #chatAssistant:not(.open) .chat-btn img{
    width:104px!important;
    height:130px!important;
    max-width:104px!important;
    max-height:130px!important;
  }
  #chatAssistant:not(.user-positioned){
    right:10px!important;
    bottom:max(10px,env(safe-area-inset-bottom))!important;
  }
}

@media (max-width:720px){
  #chatAssistant:not(.open) .chat-btn{
    width:74px!important;
    height:93px!important;
    min-width:74px!important;
    min-height:93px!important;
    max-width:74px!important;
    max-height:93px!important;
  }
  #chatAssistant:not(.open) .chat-btn img{
    width:74px!important;
    height:93px!important;
    max-width:74px!important;
    max-height:93px!important;
  }
  #chatAssistant:not(.user-positioned){
    right:3px!important;
    bottom:max(5px,env(safe-area-inset-bottom))!important;
  }
}

@media (max-width:390px){
  #chatAssistant:not(.open) .chat-btn{
    width:70px!important;
    height:88px!important;
    min-width:70px!important;
    min-height:88px!important;
    max-width:70px!important;
    max-height:88px!important;
  }
  #chatAssistant:not(.open) .chat-btn img{
    width:70px!important;
    height:88px!important;
    max-width:70px!important;
    max-height:88px!important;
  }
}

/* ==========================================================
   REV.11 — justificación tipo Word + sangría de primera línea
   Página: Gobernación > Historia.
   Formato editorial únicamente; no toca contenido ni lógica.
   ========================================================== */
body[data-page-path^="gobernacion/historia"] main p,
body[data-page-path^="gobernacion/historia"] main .page-description,
body[data-page-path^="gobernacion/historia"] main .history-copy,
body[data-page-path^="gobernacion/historia"] main .history-content{
  text-align:justify!important;
  text-justify:inter-word!important;
  text-align-last:left!important;
  text-indent:2.25rem!important;
  hyphens:none!important;
  -webkit-hyphens:none!important;
  overflow-wrap:normal!important;
  word-break:normal!important;
}

/* En teléfono conserva la sangría, pero proporcional al ancho disponible. */
@media (max-width:720px){
  body[data-page-path^="gobernacion/historia"] main p,
  body[data-page-path^="gobernacion/historia"] main .page-description,
  body[data-page-path^="gobernacion/historia"] main .history-copy,
  body[data-page-path^="gobernacion/historia"] main .history-content{
    text-indent:1.5rem!important;
  }
}

/* ==========================================================
   REV.14 — BASE REV.11 + BOT MÁS GRANDE
   Parte exclusivamente de REV.11. No incluye la sección
   “Nuestras entidades” ni ningún cambio incorporado en REV.12/REV.13.
   Solo amplía visualmente el robot flotante.
   ========================================================== */
@media (min-width:721px){
  #chatAssistant:not(.open) .chat-btn{
    width:122px!important;
    height:153px!important;
    min-width:122px!important;
    min-height:153px!important;
    max-width:122px!important;
    max-height:153px!important;
  }
  #chatAssistant:not(.open) .chat-btn img{
    width:122px!important;
    height:153px!important;
    max-width:122px!important;
    max-height:153px!important;
    object-fit:contain!important;
  }
  #chatAssistant:not(.user-positioned){
    right:10px!important;
    bottom:max(10px,env(safe-area-inset-bottom))!important;
  }
}

@media (max-width:720px){
  #chatAssistant:not(.open) .chat-btn{
    width:86px!important;
    height:108px!important;
    min-width:86px!important;
    min-height:108px!important;
    max-width:86px!important;
    max-height:108px!important;
  }
  #chatAssistant:not(.open) .chat-btn img{
    width:86px!important;
    height:108px!important;
    max-width:86px!important;
    max-height:108px!important;
    object-fit:contain!important;
  }
  #chatAssistant:not(.user-positioned){
    right:3px!important;
    bottom:max(5px,env(safe-area-inset-bottom))!important;
  }
}

@media (max-width:390px){
  #chatAssistant:not(.open) .chat-btn{
    width:82px!important;
    height:103px!important;
    min-width:82px!important;
    min-height:103px!important;
    max-width:82px!important;
    max-height:103px!important;
  }
  #chatAssistant:not(.open) .chat-btn img{
    width:82px!important;
    height:103px!important;
    max-width:82px!important;
    max-height:103px!important;
  }
}

/* ==========================================================
   REV.15 — AUDITORÍA RESPONSIVE PÚBLICA (BASE REV.11/REV.14)
   Corrige títulos que desbordan la tarjeta/viewport en Android.
   No incorpora ningún elemento de REV.12/REV.13.
   ========================================================== */
@media (max-width:720px){
  /* Cualquier bloque de contenido público debe poder encogerse dentro
     del viewport. Esto evita que grid/flex mantengan anchos mínimos. */
  main#contenido,
  main#contenido section,
  main#contenido article,
  main#contenido .container,
  main#contenido [class*="grid"],
  main#contenido [class*="box"],
  main#contenido [class*="card"],
  main#contenido [class*="panel"],
  main#contenido [class*="hero"]{
    min-width:0!important;
    max-width:100%!important;
    box-sizing:border-box!important;
  }

  /* Regla final para TODOS los H1 públicos. La reducción es deliberada:
     palabras largas como “institucionales” deben caber completas sin
     partirse ni salirse por el lateral. */
  main#contenido h1{
    width:auto!important;
    max-width:100%!important;
    min-width:0!important;
    margin-left:0!important;
    margin-right:0!important;
    font-size:clamp(1.65rem,7.6vw,2.05rem)!important;
    line-height:1.06!important;
    letter-spacing:-.035em!important;
    white-space:normal!important;
    overflow:visible!important;
    overflow-wrap:normal!important;
    word-break:normal!important;
    hyphens:none!important;
    -webkit-hyphens:none!important;
    text-wrap:wrap!important;
  }

  /* Subtítulos grandes también quedan contenidos, pero conservan
     jerarquía visual respecto al H1. */
  main#contenido h2{
    max-width:100%!important;
    min-width:0!important;
    white-space:normal!important;
    overflow-wrap:normal!important;
    word-break:normal!important;
    hyphens:none!important;
    -webkit-hyphens:none!important;
  }

  /* Breadcrumbs, descripciones y botones: nunca generan scroll lateral. */
  main#contenido .breadcrumb,
  main#contenido p,
  main#contenido .hero-copy,
  main#contenido .page-description{
    max-width:100%!important;
    min-width:0!important;
    overflow-wrap:normal!important;
    word-break:normal!important;
    hyphens:none!important;
    -webkit-hyphens:none!important;
  }

  main#contenido .btn,
  main#contenido button,
  main#contenido a.btn{
    max-width:100%!important;
    min-width:0!important;
    white-space:normal!important;
    text-align:center!important;
    line-height:1.25!important;
  }

  /* Heroes/tarjetas de entrada: más ancho útil para el texto. */
  main#contenido .page-box,
  main#contenido .sistema-box,
  main#contenido .support-hero-card,
  main#contenido [class*="hero-card"]{
    padding-left:18px!important;
    padding-right:18px!important;
  }

  /* El robot sigue grande, pero en móvil queda anclado al borde inferior
     para no aparecer encima de los CTA por posiciones guardadas antiguas. */
  #chatAssistant:not(.open){
    right:2px!important;
    bottom:max(2px,env(safe-area-inset-bottom))!important;
  }
}

@media (max-width:390px){
  main#contenido h1{
    font-size:clamp(1.58rem,7.5vw,1.88rem)!important;
    line-height:1.07!important;
  }
  main#contenido .page-box,
  main#contenido .sistema-box,
  main#contenido .support-hero-card,
  main#contenido [class*="hero-card"]{
    padding-left:16px!important;
    padding-right:16px!important;
  }
}

/* Evita scroll horizontal residual provocado por decoraciones o headings,
   sin recortar el contenido vertical. */
@media (max-width:720px){
  html,body{max-width:100%;overflow-x:clip}
}

/* ==========================================================
   REV.20 — tipografía institucional + acceso a Revista Monagas
   ========================================================== */

/* Los textos de contenido del portal se presentan justificados y con
   sangría de primera línea. Se excluyen únicamente controles y metadatos. */
main#contenido p:not(.no-justify){
  text-align:justify!important;
  text-justify:inter-word!important;
  text-align-last:left;
  text-indent:1.65rem;
  hyphens:none!important;
  -webkit-hyphens:none!important;
  overflow-wrap:normal!important;
  word-break:normal!important;
}

/* La reseña histórica ahora se renderiza en párrafos reales para que cada
   bloque reciba su propia sangría y conserve una lectura institucional. */
body[data-page-path^="gobernacion/historia"] .history-content{
  color:var(--texto,#172033);
  font-size:1rem;
  line-height:1.72;
}
body[data-page-path^="gobernacion/historia"] .history-content p{
  margin:0 0 1.45rem!important;
}
body[data-page-path^="gobernacion/historia"] .history-content p:last-child{
  margin-bottom:0!important;
}

/* Tarjeta institucional solicitada en Inicio. */
.home-monagas-discovery{
  padding:38px 0 18px;
}
.home-monagas-card{
  position:relative;
  overflow:hidden;
  padding:34px 38px 36px;
  border:1px solid var(--linea,#dce8ef);
  border-radius:38px;
  background:
    radial-gradient(circle at 92% 5%,rgba(116,193,235,.14),transparent 32%),
    var(--panel,#fff);
  box-shadow:var(--sombra,0 16px 42px rgba(10,50,80,.10));
}
.home-monagas-card::after{
  content:"";
  position:absolute;
  width:190px;
  height:190px;
  right:-86px;
  bottom:-110px;
  border-radius:50%;
  background:rgba(19,120,185,.07);
  pointer-events:none;
}
.home-monagas-card .kicker{position:relative;z-index:1}
.home-monagas-card h2{
  position:relative;
  z-index:1;
  max-width:900px;
  margin-bottom:12px;
}
.home-monagas-card>p{
  position:relative;
  z-index:1;
  max-width:850px;
  margin:0 0 24px;
  color:var(--texto-suave,#64748b);
  font-size:1rem;
  line-height:1.7;
}
.home-monagas-actions{
  position:relative;
  z-index:1;
  display:flex;
  flex-wrap:wrap;
  gap:12px;
  align-items:center;
}
.btn-revista-monagas{
  background:rgba(116,193,235,.12);
  color:var(--azul,#1378b9);
  border:1px solid rgba(19,120,185,.28);
  box-shadow:0 12px 28px rgba(19,120,185,.10);
}
.btn-revista-monagas:hover{
  background:#fff;
  border-color:rgba(19,120,185,.58);
  box-shadow:0 18px 38px rgba(19,120,185,.17);
}
.revista-external-icon{
  font-size:.72rem;
  opacity:.72;
}
body.contraste .btn-revista-monagas{
  background:rgba(116,193,235,.12);
  color:#9ed8f6;
  border-color:rgba(116,193,235,.35);
}

@media(max-width:720px){
  main#contenido p:not(.no-justify){
    text-indent:1.35rem;
  }
  .home-monagas-discovery{padding:26px 0 10px}
  .home-monagas-card{padding:27px 22px 28px;border-radius:29px}
  .home-monagas-card h2{font-size:clamp(1.85rem,8vw,2.35rem)}
  .home-monagas-actions{display:grid;grid-template-columns:1fr}
  .home-monagas-actions .btn{width:100%;white-space:normal;line-height:1.25}
}
