/* Identidad municipal. Los componentes mantienen su navegación y su orden. */
body .header-principal, body .header-principal.header-compacto,
body.interna-page .header-principal {
  background: radial-gradient(ellipse at 88% 0%,#12695f 0,transparent 55%),
              linear-gradient(108deg,#470d32,#572043 44%,#203c4b 83%) !important;
  border-bottom: 0 !important;
  box-shadow: 0 3px 15px #39103130;
}
.header-principal::after {
  content: ""; position: absolute; inset: auto 0 0; height: 4px; pointer-events: none;
  background: linear-gradient(90deg,#d6a52d 0 21%,#75a044 21% 42%,#087b65 42% 64%,#007baa 64% 85%,#c90060 85%);
}
body .header-principal .navbar-brand {
  position: relative; isolation: isolate; flex-shrink: 0;
}
body .header-principal .navbar-brand img.logo-muni {
  background: transparent !important; filter: none !important; box-shadow: none !important;
  border-radius: 0; padding: 0 5px; margin-block: 0 !important;
}
body .header-principal .navbar-brand {margin-top: -32px;}
body .header-principal.header-compacto .navbar-brand,
body.interna-page .header-principal .navbar-brand {margin-top:-8px;}
body #contenido-municipal .lc-portada {
  background: radial-gradient(ellipse at 90% 130%,#c6e0c5 0,transparent 50%),
              linear-gradient(110deg,#f9f2df,#f7f5ed 62%,#e0ece3);
  padding-block: clamp(24px,4vw,58px); align-items:center; border-bottom:1px solid #d8dfd5;
}
#contenido-municipal .lc-portada h1 {font-family:Georgia,serif;line-height:1.03;letter-spacing:-.045em;font-size:clamp(2.1rem,4.8vw,4.6rem);max-width:19em;color:#531039}
#contenido-municipal .lc-portada a {
  background:#541039;color:white;display:inline-flex;align-items:center;text-decoration:none;
  border-radius:24px;padding:.65em 1.2em;white-space:nowrap;
}
#contenido-municipal .lc-portada a:hover {background:#743257}
body #contenido-municipal .municipal-panel-carousel__box {
  border-radius:clamp(10px,1.6vw,24px);overflow:hidden;border-bottom:4px solid #d6a52d;
  box-shadow:0 12px 32px #3015351a;
}
#contenido-municipal #noticias-recientes .card-noticia,
#contenido-municipal .portal-card {border:1px solid #d9dfd9;border-radius:18px;box-shadow:0 5px 18px #223d3310!important}
#contenido-municipal .portal-card:hover,#contenido-municipal #noticias-recientes .card-noticia:hover {box-shadow:0 10px 23px #273b3924!important}
body .acceso-funcionarios {border-radius:14px;background:#eaf1e7;border-left-color:#087b65}
body.dark-mode #contenido-municipal .lc-portada,body.dark-mode .acceso-funcionarios {background:#24202a}
body.dark-mode #contenido-municipal .lc-portada h1 {color:#fff}
body #chat-btn, body #chat-btn:hover {
  background:transparent;border:0;border-radius:10px;box-shadow:none;overflow:visible;
  width:112px;height:140px;right:14px;bottom:12px;animation:none;transform:none;
}
body #chat-btn img {width:100%;height:100%;object-fit:contain;filter:drop-shadow(0 3px 3px #24142238)}
body #chat-btn:focus-visible {outline:3px solid #007baa}
body #chat-box {right:140px;bottom:14px;width:380px;max-width:calc(100vw - 154px);
  height:520px;max-height:calc(100vh - 28px);max-height:calc(100dvh - 28px)}
body #chat-box .chat-header {background:linear-gradient(115deg,#541039 25%,#175d55);color:white;flex:none}
body #chat-box .chat-messages {min-height:0;overflow-y:auto;overscroll-behavior:contain}
body #chat-bubble-popup {bottom:158px;right:18px;white-space:normal;max-width:min(270px,85vw)}
.lc-chat-abierto #chat-bubble-popup {display:none}
@media(max-width:767px) {
  body .header-principal .navbar-brand {margin-top:0}
  body #contenido-municipal .lc-portada {align-items:flex-start}
}
@media(max-width:600px) {
  body #chat-btn,body #chat-btn:hover {width:72px;height:90px;right:8px;bottom:8px}
  .lc-chat-abierto body #chat-btn {width:52px;height:65px}
  body #chat-bubble-popup {bottom:106px;right:12px}
  body #chat-box {right:8px;bottom:80px;box-sizing:border-box;width:calc(100% - 16px);max-width:420px;height:500px;
    max-height:calc(100vh - 90px);max-height:calc(100dvh - 90px)}
}

/* El contraste pertenece al encabezado completo. El escudo conserva su alfa. */
body .header-principal,body .header-principal.header-compacto,
body.interna-page .header-principal,body.dark-mode .header-principal {
  background:linear-gradient(110deg,#511139 0%,#59183f 46%,#174853 76%,#076452 100%)!important;
}
body .header-principal::before,body .header-principal .navbar-brand::before {content:none!important}
body .header-principal .navbar-brand,body .header-principal img.logo-muni,
body .banner-interior .logo-banner,body .footer-municipal .footer-logo {
  background:transparent!important;border:0!important;box-shadow:none!important;border-radius:0;
}
body .header-principal .navbar-nav .nav-link {color:#fff!important;text-shadow:none}
body .header-principal .navbar-nav .nav-link:hover,body .header-principal .navbar-nav .nav-link:focus-visible {color:#ffe8a8!important;text-decoration:underline;text-underline-offset:.35em}
body .header-principal .navbar-toggler {background:#511538;border:0}
body .banner-interior h1.text-white {color:#fff!important}
body .header-principal .navbar-brand img.logo-muni,body .banner-interior .logo-banner,
body .footer-municipal .footer-logo {
  filter:drop-shadow(0 0 .75px #ffebc5) drop-shadow(0 0 .65px #ffebc5)!important;
}

body:not(.dark-mode) #contenido-municipal {
  background:linear-gradient(180deg,#e7efe9 0,#f8f7f1 48rem,#faf9f5 70%,#e8f2ed 100%);
}
body #contenido-municipal .municipal-panel-carousel__box {
  border:1px solid #829a8c;border-bottom:4px solid #11735f;border-radius:20px;
  box-shadow:0 14px 32px -15px #234c48;
}
#contenido-municipal section:is(#comuna-avanza,#servicios,#noticias-recientes) .text-center.mb-5 {
  text-align:start!important;padding-bottom:.75rem;border-bottom:1px solid #9daea4;
}
#contenido-municipal section:is(#comuna-avanza,#servicios,#noticias-recientes) .text-center.mb-5 h2 {
  font:700 clamp(1.85rem,3.8vw,3.4rem)/1.12 Georgia,serif;letter-spacing:-.035em;
}
#contenido-municipal section:is(#comuna-avanza,#servicios,#noticias-recientes) .text-center.mb-5 .mx-auto {
  margin-left:0!important;width:5rem!important;background:#08745d!important;
}
#contenido-municipal .card-comuna,#contenido-municipal #noticias-recientes .card-noticia {
  border-radius:18px 18px 4px 4px;overflow:hidden;border-bottom:3px solid #c99e38!important;
  box-shadow:0 10px 28px -17px #38483e!important;
}
#contenido-municipal .titulo-comuna,#contenido-municipal .titulo-noticia {
  font-family:Georgia,serif;line-height:1.18;letter-spacing:-.02em;
}
#contenido-municipal .portal-card .portal-overlay {background:linear-gradient(0deg,#103d37f5,rgba(16,50,44,.68) 40%,transparent 85%)}
#contenido-municipal .portal-card .portal-content span {background:#f2e6bb;color:#411433;border-radius:30px;padding:.42em 1em}
#contenido-municipal .custom-pagination .active .page-link {background:#075f51;border-color:#075f51}
body .acceso-funcionarios {border-radius:4px 20px 4px 20px;border-left:6px solid #c79a27;background:#dcebe0}

.paltin-figura {
  position:absolute;left:50%;top:50%;transform:translate(-50%,-50%);
  width:100%;height:0;padding-top:121.78%;display:block;pointer-events:none;
}
body #chat-btn .paltin-figura img {position:absolute;inset:0;width:100%;height:100%;filter:none;animation:none}
.paltin-figura .paltin-mano {display:none;transform-origin:82% 40%}
.paltin-boca {
  position:absolute;left:42.623%;top:35%;width:17.799%;height:10.577%;visibility:hidden;
  -webkit-mask-image:radial-gradient(ellipse,#000 60%,transparent 77%);
  mask-image:radial-gradient(ellipse,#000 60%,transparent 77%);
}
@media(prefers-reduced-motion:no-preference) {
  .paltin-figura.saludando #chat-btn-img {
    clip-path:polygon(0 0,100% 0,100% 24%,76% 24%,77% 38%,85% 43%,100% 43%,100% 100%,0 100%);
  }
  .paltin-figura.saludando .paltin-mano {
    display:block;clip-path:polygon(76% 24%,100% 24%,100% 43%,85% 43%,77% 38%);
    animation:paltin-saludo .46s ease-in-out 3 alternate!important;
  }
  @keyframes paltin-saludo {0%,100%{transform:rotate(0deg)}35%{transform:rotate(-16deg)}72%{transform:rotate(12deg)}}
}
@media(max-width:991px) {
  .header-principal #menuPrincipal.show,.header-principal #menuPrincipal.collapsing {background:#511139}
}
#contenido-municipal .portal-card .portal-overlay {background:linear-gradient(180deg,#153d39c7 0%,transparent 48%,#103d37c7 100%)}
body.dark-mode .acceso-funcionarios {background:#233930}
html.high-contrast-mode .header-principal .top-bar-diagonal {background:#fff}
