:root{
  --c-cream:#e1be83;
  --c-gold:#fda531;
  --c-wine:#b82103;
  --c-orange:#dd430f;
  --c-olive:#4c4f38;

  --text:#1f2328;
  --muted:#6b7280;
  --bg:#ffffff;
  --surface:#f7f4ef;

  --radius:18px;
  --shadow:0 12px 30px rgba(0,0,0,.10);
}

*{ box-sizing:border-box; }

body{
  font-family:'Montserrat', system-ui, -apple-system, Segoe UI, Roboto, Arial, sans-serif;
  color:var(--text);
  background:var(--bg);
  font-size:17px;
  line-height:1.65;
}

.skip-link{
  position:absolute;
  left:-9999px;
}
.skip-link:focus{
  left:1rem; top:1rem;
  padding:.5rem .75rem;
  background:#fff;
  border-radius:12px;
  box-shadow:var(--shadow);
  z-index:9999;
}

.topbar{
  background:linear-gradient(90deg, var(--c-wine), #7c1602);
  color:#fff;
  padding:.35rem 0;
  font-size:.9rem;
}
.topbar-link{
  color:#fff;
  text-decoration:none;
  opacity:.95;
}
.topbar-link:hover{
  opacity:1;
  text-decoration:underline;
}
.topbar-social{
  width:30px;height:30px;
  display:inline-flex;
  align-items:center;justify-content:center;
  border-radius:999px;
  border:1px solid rgba(255,255,255,.3);
  color:#fff;
  text-decoration:none;
}
.topbar-social:hover{
  background:rgba(255,255,255,.15);
}

.site-header{
  background:#fff;
  border-bottom:1px solid rgba(0,0,0,.06);
  position:sticky;
  top:0;
  z-index:1030;
  padding:.4rem 0;
}

.brand-logo{ height:54px; }
.brand-kicker{
  font-size:.78rem;
  letter-spacing:.06em;
  text-transform:uppercase;
  color:var(--muted);
}
.brand-title{
  font-weight:900;
  font-size:1.15rem;
  line-height:1.05;
  color:var(--c-wine);
}
.brand-tagline{
  font-size:.85rem;
  color:var(--muted);
}

.navbar .nav-link{
  font-weight:600;
  color:#222;
  padding:.55rem .8rem;
  border-radius:12px;
}
.navbar .nav-link:hover{
  background:rgba(253,165,49,.18);
}
.navbar .nav-link.active{
  background:rgba(184,33,3,.12);
  color:var(--c-wine);
}

.btn-brand{
  --bs-btn-bg:var(--c-wine);
  --bs-btn-border-color:var(--c-wine);
  --bs-btn-hover-bg:#8f1a02;
  --bs-btn-hover-border-color:#8f1a02;
  --bs-btn-color:#fff;
  border-radius:999px;
}
.btn-brand-outline{
  border-radius:999px;
  border:1px solid rgba(184,33,3,.35);
  color:var(--c-wine);
}
.btn-brand-outline:hover{
  background:rgba(184,33,3,.08);
}

.hero{
  position:relative;
  border-radius:calc(var(--radius) + 8px);
  overflow:hidden;
  background:
    radial-gradient(1200px 600px at 10% 10%, rgba(253,165,49,.35), transparent 60%),
    radial-gradient(900px 500px at 90% 30%, rgba(221,67,15,.28), transparent 60%),
    linear-gradient(180deg, #fff, var(--surface));
  box-shadow:var(--shadow);
}
.hero-media{
  position:absolute;
  inset:0;
  background:center/cover no-repeat;
  opacity:.08;
}
.hero-inner{
  position:relative;
  padding:3.5rem 2.5rem;
}
.hero h1{
  font-weight:900;
  letter-spacing:-.02em;
  font-size:clamp(1.9rem, 3vw, 2.4rem);
  line-height:1.15;
  margin-bottom:.75rem;
}
.hero p{
  color:var(--muted);
  font-size:1.05rem;
  max-width:58ch;
}

.section-title{
  font-weight:900;
  letter-spacing:-.01em;
}
.section-lead{
  color:var(--muted);
}

.kpi-card,
.card-soft,
.quick-link{
  background:#fff;
  border:1px solid rgba(0,0,0,.06);
  border-radius:var(--radius);
  box-shadow:0 6px 16px rgba(0,0,0,.06);
}
.kpi-card{
  padding:1rem;
}
.kpi-icon{
  width:44px;height:44px;
  border-radius:14px;
  display:grid;place-items:center;
  background:rgba(253,165,49,.20);
  color:var(--c-wine);
}
.card-soft .card-body{
  padding:1.1rem;
}
.quick-link{
  display:flex;
  align-items:center;
  gap:.9rem;
  padding:1.1rem 1.15rem;
  text-decoration:none;
  color:inherit;
}
.quick-link:hover{
  background:rgba(225,190,131,.25);
  box-shadow:0 10px 22px rgba(0,0,0,.08);
}
.quick-link .ql-icon{
  width:46px;height:46px;
  border-radius:16px;
  display:grid;place-items:center;
  background:rgba(184,33,3,.10);
  color:var(--c-wine);
}

.news-filter .btn{
  border-radius:999px;
}
.news-card{
  overflow:hidden;
}
.news-card .thumb{
  width:100%;
  /* Miniatura más compacta (mejor lectura del texto)
     Recomendación de imagen: 16:9 (ej. 1200x675) */
  height:140px;
  background-size:cover;
  background-position:center;
  background-repeat:no-repeat;
  border-bottom:1px solid rgba(0,0,0,.06);
}
.news-card .badge-pill{
  border-radius:999px;
}
.news-card h2{
  line-height:1.2;
}
.news-card .card-body{
  display:flex;
  flex-direction:column;
  gap:.25rem;
}
.news-card .btn{
  align-self:flex-start;
  /* Empuja el botón al final para que el resumen se vea completo */
  margin-top:auto;
}
.news-card:hover{
  transform:translateY(-2px);
  box-shadow:0 12px 26px rgba(0,0,0,.10);
}

.noticia-imagen{
  margin:0 0 1rem 0;
}
.noticia-imagen img{
  width:100%;
  height:auto;
  /* Para carteles: mostrar completo (sin recortar) */
  max-height:70vh;
  object-fit:contain;
  background:rgba(255,255,255,.92);
  border-radius:18px;
  border:1px solid rgba(0,0,0,.06);
  cursor:zoom-in;
}

/* Modal para ver imágenes (carteles) en grande */
.img-modal-dialog{
  width:96vw !important;
  max-width:96vw !important;
}
#imgModal .modal-content{
  height:92vh;
}
#imgModal .modal-body{
  padding:0;
  height:calc(92vh - 56px);
  display:flex;
  align-items:center;
  justify-content:center;
  background:#0b0f14;
}
#imgModal img{
  max-width:100%;
  max-height:100%;
  width:auto;
  height:auto;
  display:block;
}

/* Ajuste responsivo de miniatura de noticias */
@media (max-width: 575.98px){
  .news-card .thumb{ height:120px; }
}
@media (min-width: 992px){
  .news-card .thumb{ height:150px; }
}

/* Evita el “espacio en blanco” debajo cuando la página tiene poco contenido */
html, body{ height:100%; }
body{
  min-height:100vh;
  display:flex;
  flex-direction:column;
}
main#contenido{ flex:1 0 auto; }
.site-footer{ margin-top:auto; }
.noticia-imagen figcaption{
  margin-top:.4rem;
  font-size:.85rem;
  color:var(--muted);
}

.pdf-list{
  display:flex;
  flex-direction:column;
  gap:.5rem;
}
.pdf-item{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:.75rem;
  padding:.75rem .9rem;
  background:#fff;
  border:1px solid rgba(0,0,0,.06);
  border-radius:16px;
  box-shadow:0 6px 16px rgba(0,0,0,.06);
  cursor:pointer;
}

.pdf-item:focus{
  outline:none;
  box-shadow:0 0 0 3px rgba(220,53,69,.25), 0 6px 16px rgba(0,0,0,.06);
}

.pdf-item:hover{
  transform:translateY(-1px);
}
.pdf-item .meta{
  min-width:0;
}
.pdf-item .title{
  font-weight:700;
  white-space:nowrap;
  overflow:hidden;
  text-overflow:ellipsis;
}
.pdf-item .sub{
  font-size:.8rem;
  color:var(--muted);
}

.pdf-modal .modal-body{
  padding:1rem;
}
.pdf-stage{
  width:100%;
  overflow:auto;
  -webkit-overflow-scrolling:touch; border:1px solid rgba(0,0,0,.08);
  border-radius:14px;
  background:#fff;
  display:grid;
  place-items:center;
  min-height:40vh;
}
.pdf-stage canvas{
  max-width:100%;
}

.site-footer{
  background: var(--c-orange);
  color:#fff;
  font-size: .9rem;
}

.footer-top{
  background: linear-gradient(180deg, #ffb45a, var(--c-orange));
  padding: .9rem 0; /* más compacto */
}

.footer-top .row{
  --bs-gutter-y: .6rem;
}

.footer-logo{
  height: 34px;
  width: auto;
  display:block;
}

.footer-heading{
  font-size: 1rem;
  line-height: 1.2;
}

.footer-title{
  font-weight: 700;
  font-size: .85rem;
  margin-bottom: .25rem;
  letter-spacing: .3px;
  text-transform: uppercase;
  opacity: .95;
}

.footer-muted{
  color: rgba(255,255,255,.88) !important;
}

.footer-links{
  line-height: 1.25;
  margin: 0;
}

.site-footer p,
.site-footer ul,
.site-footer ol{
  margin: 0;
}

.site-footer .footer-links li{
  margin-bottom: .25rem;
}

.footer-links a{
  color: rgba(255,255,255,.82);
  text-decoration: none;
  font-size: .82rem;
}

.footer-links a:hover{
  color:#fff;
  text-decoration: underline;
}

.footer-bottom{
  position: relative;
  padding: .28rem 0;
  font-size: .75rem;
}

.footer-bottom::before{
  content:"";
  position:absolute;
  left:0; right:0; top:0;
  height:1px;
  background: rgba(255,255,255,.18);
  transform: scaleY(.5);
  transform-origin: top;
}

@media (max-width: 768px){
  .footer-top{
    padding: .75rem 0;
  }
  .footer-logo{
    height: 32px;
  }
  .footer-links a{
    font-size: .8rem;
  }
}
  font-size: .82rem;
}

.footer-links a:hover{
  color:#fff;
  text-decoration: underline;
}

.footer-bottom{
  position: relative;
  padding: .28rem 0;
  font-size: .75rem;
}

.footer-bottom::before{
  content:"";
  position:absolute;
  left:0; right:0; top:0;
  height:1px;
  background: rgba(255,255,255,.18);
  transform: scaleY(.5);
  transform-origin: top;
}

@media (max-width: 768px){
  .footer-top{
    padding: .75rem 0;
  }
  .footer-logo{
    height: 32px;
  }
  .footer-links a{
    font-size: .8rem;
  }
}
.mapa-ubicacion{
  border-radius:16px;
  overflow:hidden;
  border:1px solid rgba(0,0,0,.08);
}

@media (max-width:768px){
  body{ font-size:16px; }
  .hero-inner{ padding:2rem 1.5rem; }
}

.footer-top{
  padding:1.2rem 0; }

.footer-title{
  margin-bottom:.35rem;
  font-size:.85rem;
}

.site-footer p,
.footer-links a{
  font-size:.8rem;
  line-height:1.35;
}

.site-footer p{
  margin-bottom:.35rem;
}
.footer-links a{
  padding:.1rem 0;
}

.footer-logo{
  height:42px; }

.footer-bottom{
  padding:.3rem 0;
  font-size:.75rem;
}

.footer-bottom::before{
  background:rgba(255,255,255,.18);
}

.footer-top{
  padding: .8rem 0 !important;   }

.footer-top .row{
  --bs-gutter-y: .5rem;          }

.site-footer p,
.site-footer ul,
.site-footer ol{
  margin: 0 !important;
}

.footer-links{
  line-height: 1.25;
}

.footer-logo{
  height: 36px !important;
}

.footer-bottom{
  padding: .25rem 0 !important;
}
.footer-top .row > *{
  padding-top: .25rem !important;
  padding-bottom: .25rem !important;
}


/* === PDF iframe viewer (stable across browsers) === */
.pdf-modal .modal-body{
  display: flex;
  flex-direction: column;
  height: calc(100vh - 56px); /* header aprox */
  min-height: 0;
}
.pdf-iframe-wrap{
  width: 100%;
  flex: 1 1 auto;
  height: auto;
  min-height: 0;
  background: #f6f6f6;
  border-bottom: 1px solid rgba(0,0,0,.06);
}

/* Mensaje inferior compacto (no roba altura al PDF) */
.pdf-hint{
  padding: .4rem .75rem !important;
  background: rgba(255,255,255,.95);
}
#pdfFrame{
  width: 100%;
  height: 100%;
  border: 0;
  display: block;
}

/* === Compact footer (override final) === */
.site-footer{ font-size: .82rem !important; }
.footer-top{ padding: .55rem 0 !important; }
.footer-logo{ height: 30px !important; }
.footer-heading{ font-size: .95rem !important; margin: 0 !important; }
.footer-title{ font-size: .8rem !important; margin-bottom: .2rem !important; }
.site-footer .small{ font-size: .78rem !important; }
.site-footer .footer-links li{ margin-bottom: .18rem !important; }
.footer-bottom{ padding: .2rem 0 !important; }
/* En iPhone con notch */
@supports(padding: max(0px)){
  .pdf-iframe-wrap{
    padding-bottom: env(safe-area-inset-bottom);
  }
}


/* ===== Fix: miniatura completa para COMUNICADOS ===== */
.news-card.is-comunicado .thumb{
  background-size: contain;
  background-color: #7a0000;
  height: 220px;
}


/* ===== Mobile navbar/viewport overflow fix (Safari/Opera/Chrome) ===== */
html, body{
  max-width:100%;
  overflow-x:hidden;
  -webkit-text-size-adjust:100%;
}

.site-header .container > .d-flex{
  flex-wrap:wrap;
}

.site-header .brand{
  min-width:0;
  max-width:75%;
}

.site-header .brand-logo-sm{
  width:52px;
  height:auto;
  max-width:52px;
  flex:0 0 auto;
  display:block;
}

.site-header nav.navbar{
  max-width:100%;
}

@media (max-width: 576px){
  .site-header .container{
    padding-left:12px;
    padding-right:12px;
  }
  .site-header .brand{
    max-width:78%;
  }
  .navbar-toggler{
    padding:.25rem .5rem;
  }
  .navbar-collapse{
    width:100%;
  }
  .navbar-nav{
    width:100%;
  }
}


/* Trámites y rutas */
.tramite-card{border:none;}
.tramite-icon{width:44px;height:44px;border-radius:14px;display:grid;place-items:center;background:rgba(184,33,3,.10);color:var(--c-wine);font-size:1.15rem;flex:0 0 auto;}
.tramite-lista{padding-left:1.1rem;margin:0;}
.tramite-lista li{margin-bottom:.45rem;color:#374151;}
.tramite-alert{background:rgba(253,165,49,.12);border:1px solid rgba(221,67,15,.18);border-radius:14px;color:#5b3413;}
.ruta-card{border:none;overflow:hidden;}
.ruta-grid{display:grid;grid-template-columns:repeat(1,minmax(0,1fr));gap:1rem;}
.ruta-dia-card{background:linear-gradient(180deg,#fff,#fff7ef);border:1px solid rgba(0,0,0,.06);border-radius:18px;overflow:hidden;box-shadow:0 6px 16px rgba(0,0,0,.05);}
.ruta-dia-head{background:linear-gradient(135deg,var(--c-gold),var(--c-orange));color:#fff;font-weight:800;padding:.8rem 1rem;letter-spacing:.01em;}
.ruta-zonas{padding-left:1.1rem;}
.ruta-zonas li{margin-bottom:.35rem;color:#374151;}
.rutas-accordion .accordion-item{border:1px solid rgba(0,0,0,.06);border-radius:16px!important;overflow:hidden;margin-bottom:.75rem;background:#fff;box-shadow:0 6px 16px rgba(0,0,0,.05);}
.rutas-accordion .accordion-button{font-weight:700;background:linear-gradient(135deg,rgba(253,165,49,.16),rgba(221,67,15,.12));}
.rutas-accordion .accordion-button:not(.collapsed){color:var(--c-wine);box-shadow:none;background:linear-gradient(135deg,rgba(253,165,49,.26),rgba(221,67,15,.18));}
.rutas-accordion .accordion-button:focus{box-shadow:none;}
@media (min-width:768px){.ruta-grid{grid-template-columns:repeat(2,minmax(0,1fr));}}


.section-title,
.section-title strong,
h1.section-title,
h2.section-title,
.card-soft h2,
.card-soft h3,
.surface .fw-bold,
.page-subtitle,
.section-lead strong{
  font-weight: 800 !important;
}
.section-lead{
  font-weight: 700;
}
.gallery-tile{
  display:block;
  text-decoration:none;
  color:inherit;
  background:#fff;
  border:1px solid rgba(0,0,0,.08);
  border-radius:18px;
  overflow:hidden;
  box-shadow:0 6px 16px rgba(0,0,0,.06);
  height:100%;
}
.gallery-thumb{
  aspect-ratio: 16/10;
  display:flex;
  align-items:center;
  justify-content:center;
  overflow:hidden;
  background:linear-gradient(180deg, rgba(184,33,3,.08), rgba(225,190,131,.15));
}
.gallery-thumb img,
.gallery-thumb video{
  width:100%;
  height:100%;
  object-fit:cover;
  display:block;
}
.gallery-empty{
  min-height:180px;
  display:grid;
  place-items:center;
  text-align:center;
  border:1px dashed rgba(0,0,0,.15);
  border-radius:18px;
  background:#fff;
}
