/* ═══════════════════════════════════════════════════════════════════════════
   Sitio público municipal (cabecera, pie y portada).
   Institucional y cercano: superficies limpias, el color de la ciudad como
   acento (--color-primary / --color-secondary, que cada municipio define en su
   configuración) y titulares en serif. Modo oscuro por la clase .dark de <html>.
   Prefijo s- para no chocar con las utilidades de Tailwind del resto del sitio.
   ═══════════════════════════════════════════════════════════════════════════ */

:root {
  --s-primario: var(--color-primary, #6e1239);
  --s-primario-osc: var(--color-primary-dark, #4a0d26);
  --s-acento: var(--color-secondary, #B1893D);
  --s-fondo: #f4f1ec;
  --s-papel: #fdfcfa;
  --s-sutil: #eeeae3;
  --s-tinta: #15171c;
  --s-tinta-2: #454b56;
  --s-tinta-3: #5f6672;
  --s-borde: rgb(17 24 39 / 0.1);
  --s-enlace: var(--s-primario);
  --s-sombra: 0 1px 2px rgb(17 24 39 / .06), 0 8px 24px -12px rgb(17 24 39 / .18);
  --s-radio: 18px;
  --s-serif: 'Source Serif 4', Georgia, 'Times New Roman', serif;
  --s-sans: Inter, system-ui, -apple-system, 'Segoe UI', sans-serif;
  --s-ancho: 1240px;
  --s-salida: cubic-bezier(0.22, 1, 0.36, 1);
}
html.dark {
  --s-fondo: #0f1116;
  --s-papel: #171a21;
  --s-sutil: #1e222b;
  --s-tinta: #eef0f4;
  --s-tinta-2: #c6cbd4;
  --s-tinta-3: #9ba2ae;
  --s-borde: rgb(255 255 255 / 0.1);
  --s-enlace: var(--s-acento);
  --s-sombra: 0 1px 2px rgb(0 0 0 / .4);
}

.s-envoltura { width: 100%; max-width: var(--s-ancho); margin-inline: auto; padding-inline: clamp(1rem, 4vw, 2rem); }
.s-oculto { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.s-salto { position: absolute; left: -999px; top: .5rem; z-index: 100; background: var(--s-primario); color: #fff; padding: .6rem 1rem; border-radius: 8px; font-weight: 600; }
.s-salto:focus { left: .5rem; }
body.s-sin-scroll { overflow: hidden; }
.s-solo-oscuro { display: none !important; }
html.dark .s-solo-oscuro { display: inline-block !important; }
html.dark .s-solo-claro { display: none !important; }

/* Botones */
.s-btn { display: inline-flex; align-items: center; justify-content: center; gap: .5rem; min-height: 2.75rem; padding: .6rem 1.15rem; border-radius: 999px; font: 600 .9375rem/1.1 var(--s-sans); text-decoration: none; border: 1px solid transparent; cursor: pointer; transition: background .2s, color .2s, border-color .2s, transform .2s var(--s-salida); }
.s-btn .material-icons { font-size: 1.15rem; }
.s-btn--primario { background: var(--s-primario); color: #fff; }
.s-btn--primario:hover { background: var(--s-primario-osc); }
.s-btn--claro { background: #fff; color: var(--s-primario); }
.s-btn--claro:hover { background: #fff7ec; }
.s-btn--contorno { border-color: var(--s-borde); color: var(--s-tinta); background: transparent; }
.s-btn--contorno:hover { border-color: var(--s-primario); color: var(--s-primario); }
html.dark .s-btn--contorno:hover { border-color: var(--s-acento); color: var(--s-acento); }
.s-btn:focus-visible, .s-icono-btn:focus-visible, .s-menu a:focus-visible, .s-menu button:focus-visible { outline: 2px solid var(--s-acento); outline-offset: 2px; }
.s-icono-btn { width: 2.75rem; height: 2.75rem; border-radius: 999px; display: grid; place-items: center; border: 0; background: transparent; color: var(--s-tinta-2); cursor: pointer; }
.s-icono-btn:hover { background: var(--s-sutil); color: var(--s-tinta); }

/* ── Cabecera ─────────────────────────────────────────────────────────────── */
.s-cabecera { position: sticky; top: 0; z-index: 50; background: var(--s-papel); border-bottom: 1px solid var(--s-borde); font-family: var(--s-sans); transition: box-shadow .25s; }
.s-cabecera--flotando { box-shadow: 0 6px 20px -12px rgb(17 24 39 / .35); }
.s-franja { background: var(--s-primario); color: rgb(255 255 255 / .9); font-size: .8125rem; }
html.dark .s-franja { background: var(--s-primario-osc); }
.s-franja-in { display: flex; align-items: center; justify-content: space-between; gap: 1rem; min-height: 2.25rem; }
.s-franja-in > span:first-child { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.s-franja-der { display: flex; align-items: center; gap: 1.1rem; flex: none; }
.s-franja a { color: inherit; text-decoration: none; display: inline-flex; align-items: center; gap: .3rem; }
.s-franja a:hover { color: #fff; text-decoration: underline; text-underline-offset: 3px; }
.s-franja .material-icons { font-size: 1rem; }
.s-franja-911 { font-weight: 700; }
.s-tema { border: 0; background: rgb(255 255 255 / .12); color: #fff; width: 1.9rem; height: 1.9rem; border-radius: 999px; display: grid; place-items: center; cursor: pointer; }
.s-tema .material-icons { font-size: 1.05rem; }
@media (max-width: 760px) {
  .s-franja-in > span:first-child { display: none; }
  .s-franja-der { width: 100%; justify-content: space-between; gap: .6rem; }
  .s-franja-der a:nth-child(2) { display: none; }
}

.s-nav-in { display: flex; align-items: center; gap: 1.25rem; min-height: 4.5rem; }
.s-marca { display: flex; align-items: center; gap: .75rem; text-decoration: none; color: var(--s-tinta); flex: none; }
.s-marca-logo { height: 3rem; width: auto; max-width: 7rem; object-fit: contain; }
.s-marca-txt { display: grid; line-height: 1.1; }
.s-marca-txt small { font-size: .75rem; color: var(--s-tinta-3); font-weight: 500; }
.s-marca-txt b { font-family: var(--s-serif); font-size: 1.25rem; font-weight: 700; color: var(--s-primario); letter-spacing: -.01em; }
html.dark .s-marca-txt b { color: var(--s-tinta); }

.s-menu { display: flex; align-items: center; gap: .15rem; list-style: none; margin: 0 0 0 auto; padding: 0; }
.s-menu > li > a, .s-menu > li > button { display: inline-flex; align-items: center; gap: .15rem; padding: .55rem .8rem; border-radius: 10px; border: 0; background: transparent; color: var(--s-tinta-2); font: 600 .9375rem/1 var(--s-sans); text-decoration: none; cursor: pointer; position: relative; }
.s-menu > li > a:hover, .s-menu > li > button:hover { color: var(--s-tinta); background: var(--s-sutil); }
.s-menu > li > a[aria-current="page"], .s-menu > li > button.s-activo { color: var(--s-primario); }
html.dark .s-menu > li > a[aria-current="page"], html.dark .s-menu > li > button.s-activo { color: var(--s-acento); }
.s-menu > li > a[aria-current="page"]::after, .s-menu > li > button.s-activo::after { content: ''; position: absolute; left: .8rem; right: .8rem; bottom: .2rem; height: 2px; border-radius: 2px; background: currentColor; }
.s-menu button .material-icons { font-size: 1.1rem; transition: transform .2s; }
.s-menu-emergencia { color: #c62828 !important; }
html.dark .s-menu-emergencia { color: #ff8a80 !important; }
.s-grupo { position: relative; }
.s-sub { position: absolute; top: calc(100% + .4rem); left: 0; min-width: 18rem; list-style: none; margin: 0; padding: .45rem; background: var(--s-papel); border: 1px solid var(--s-borde); border-radius: 14px; box-shadow: var(--s-sombra); opacity: 0; visibility: hidden; transform: translateY(-4px); transition: opacity .18s, transform .18s var(--s-salida), visibility .18s; z-index: 60; }
.s-grupo > button[aria-expanded="true"] + .s-sub,
.s-grupo:focus-within > .s-sub { opacity: 1; visibility: visible; transform: none; }
.s-grupo > button[aria-expanded="true"] .material-icons { transform: rotate(180deg); }
@media (hover: hover) and (min-width: 1081px) {
  .s-grupo:hover > .s-sub { opacity: 1; visibility: visible; transform: none; }
}
.s-sub a { display: flex; align-items: flex-start; gap: .7rem; padding: .6rem .7rem; border-radius: 10px; text-decoration: none; color: var(--s-tinta); }
.s-sub a:hover, .s-sub a:focus-visible { background: var(--s-sutil); outline: none; }
.s-sub .material-icons { color: var(--s-primario); font-size: 1.3rem; margin-top: .05rem; }
html.dark .s-sub .material-icons { color: var(--s-acento); }
.s-sub b { display: block; font-size: .9rem; font-weight: 600; }
.s-sub small { display: block; font-size: .78rem; color: var(--s-tinta-3); margin-top: .1rem; }

.s-nav-acciones { display: flex; align-items: center; gap: .35rem; flex: none; }
.s-hamburguesa { display: none; }
.s-solo-movil { display: none; }
.s-buscar { border-top: 1px solid var(--s-borde); background: var(--s-papel); padding-block: .85rem; }
.s-buscar form { display: flex; align-items: center; gap: .75rem; }
.s-buscar form > .material-icons { color: var(--s-tinta-3); }
.s-buscar input { flex: 1; min-width: 0; border: 0; background: transparent; font: 400 1.0625rem/1.4 var(--s-sans); color: var(--s-tinta); padding: .5rem 0; }
.s-buscar input:focus { outline: none; }

@media (max-width: 1080px) {
  .s-nav-cta { display: none; }
  .s-hamburguesa { display: grid; }
  .s-menu { position: fixed; inset: var(--s-cab-alto, 6.75rem) 0 0 0; flex-direction: column; align-items: stretch; gap: 0; padding: 1rem clamp(1rem, 4vw, 2rem) 2rem; background: var(--s-papel); overflow-y: auto; display: none; margin: 0; }
  .s-menu--abierto { display: flex; }
  .s-menu > li > a, .s-menu > li > button { width: 100%; justify-content: space-between; padding: .95rem .5rem; font-size: 1.05rem; border-radius: 0; border-bottom: 1px solid var(--s-borde); }
  .s-menu > li > a[aria-current="page"]::after, .s-menu > li > button.s-activo::after { display: none; }
  .s-sub { position: static; opacity: 1; visibility: visible; transform: none; box-shadow: none; border: 0; padding: .25rem 0 .5rem; display: none; min-width: 0; }
  .s-grupo > button[aria-expanded="true"] + .s-sub { display: block; }
  .s-grupo:focus-within > .s-sub { display: none; }
  .s-grupo > button[aria-expanded="true"] + .s-sub { display: block; }
  .s-solo-movil { display: block; margin-top: 1.25rem; }
  .s-menu > li.s-solo-movil > a { width: 100%; justify-content: center; border: 0; border-radius: 999px; color: #fff; padding: .9rem 1rem; }
}
@media (max-width: 420px) { .s-marca-txt b { font-size: 1.05rem; } .s-marca-logo { height: 2.5rem; } }

/* ── Pie ──────────────────────────────────────────────────────────────────── */
.s-pie { margin-top: auto; background: #14161b; color: rgb(255 255 255 / .74); font: 400 .9rem/1.6 var(--s-sans); border-top: 4px solid var(--s-primario); }
.s-pie-rejilla { display: grid; grid-template-columns: minmax(0, 1.5fr) repeat(3, minmax(0, 1fr)); gap: 2.5rem; padding-block: 3.5rem 2.5rem; }
.s-pie p { margin: 0; }
.s-pie-logo { height: 3.25rem; width: auto; margin-bottom: 1rem; }
.s-pie-nombre { font-family: var(--s-serif); font-size: 1.2rem; font-weight: 700; color: #fff; line-height: 1.3; margin-bottom: .25rem !important; }
.s-pie-frase { margin-top: .9rem !important; color: rgb(255 255 255 / .86); font-style: italic; }
.s-pie address { font-style: normal; margin-top: 1rem; }
.s-pie-tit { font-weight: 700; color: #fff; margin-bottom: .8rem !important; font-size: .9rem; }
.s-pie ul { list-style: none; margin: 0; padding: 0; display: grid; gap: .55rem; }
.s-pie a { color: inherit; text-decoration: none; }
.s-pie a:hover { color: #fff; text-decoration: underline; text-underline-offset: 3px; }
.s-pie-tels a { display: grid; line-height: 1.25; }
.s-pie-tels b { color: #fff; font-variant-numeric: tabular-nums; }
.s-pie-tels span { font-size: .8rem; }
.s-pie-mas { display: inline-flex; align-items: center; gap: .3rem; margin-top: .9rem; color: var(--s-acento) !important; font-weight: 600; }
.s-pie-mas .material-icons { font-size: 1rem; }
.s-pie-base { border-top: 1px solid rgb(255 255 255 / .08); font-size: .8125rem; }
.s-pie-base .s-envoltura { display: flex; flex-wrap: wrap; justify-content: space-between; gap: .5rem 1.5rem; padding-block: 1.1rem; }
@media (max-width: 900px) { .s-pie-rejilla { grid-template-columns: 1fr 1fr; } .s-pie-marca { grid-column: 1 / -1; } }
@media (max-width: 520px) { .s-pie-rejilla { grid-template-columns: 1fr; gap: 2rem; } }

/* ═══ Portada ═════════════════════════════════════════════════════════════ */
.s-portada { background: var(--s-fondo); color: var(--s-tinta); font-family: var(--s-sans); }
.s-portada h1, .s-portada h2, .s-portada h3 { font-family: var(--s-serif); color: var(--s-tinta); margin: 0; letter-spacing: -.012em; text-wrap: balance; }
.s-portada h2 { font-size: clamp(1.7rem, 1.2rem + 1.7vw, 2.45rem); line-height: 1.15; font-weight: 700; }
.s-portada h3 { font-size: 1.15rem; line-height: 1.3; font-weight: 700; }
.s-portada p { margin: 0; text-wrap: pretty; }
.s-seccion { padding-block: clamp(3.5rem, 2.5rem + 4vw, 6rem); }
.s-seccion--papel { background: var(--s-papel); }
/* Alternancia de fondos aunque alguna sección no aparezca (hero=1, ahora=2). */
.s-portada #contenido main > section.s-seccion:nth-of-type(even) { background: var(--s-papel); }
#contenido:focus { outline: none; }
.s-sec-cab { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 1rem 2rem; margin-bottom: 2rem; }
.s-sec-cab p { color: var(--s-tinta-2); max-width: 46rem; margin-top: .6rem; font-size: 1.0625rem; }
.s-ver-mas { display: inline-flex; align-items: center; gap: .3rem; font-weight: 600; color: var(--s-enlace); text-decoration: none; white-space: nowrap; }
.s-ver-mas:hover { text-decoration: underline; text-underline-offset: 4px; }
.s-ver-mas .material-icons { font-size: 1.1rem; transition: transform .2s var(--s-salida); }
.s-ver-mas:hover .material-icons { transform: translateX(3px); }

/* Hero */
.s-hero { position: relative; min-height: clamp(30rem, 78vh, 46rem); display: grid; align-items: end; color: #fff; overflow: hidden; isolation: isolate; background: var(--s-primario-osc); }
.s-hero-fondo { position: absolute; inset: 0; z-index: -2; }
.s-hero-fondo img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; opacity: 0; transition: opacity 1.4s ease; }
.s-hero-fondo img.s-activa { opacity: 1; animation: s-zoom 16s ease-out both; }
@keyframes s-zoom { from { transform: scale(1.07); } to { transform: scale(1); } }
.s-hero::before { content: ''; position: absolute; inset: 0; z-index: -1;
  background:
    linear-gradient(180deg, rgb(0 0 0 / .1) 0%, rgb(0 0 0 / .18) 40%, rgb(10 6 8 / .8) 100%),
    linear-gradient(90deg, color-mix(in srgb, var(--s-primario-osc) 88%, transparent) 0%, color-mix(in srgb, var(--s-primario-osc) 62%, transparent) 38%, transparent 72%); }
.s-hero--sin-foto::before { background: radial-gradient(120% 90% at 85% 10%, color-mix(in srgb, var(--s-primario) 70%, #fff 0%) 0%, var(--s-primario-osc) 60%); }
.s-hero-in { padding-block: 7rem 8.5rem; display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: end; gap: 2rem; }
.s-hero-kicker { display: inline-flex; align-items: center; gap: .5rem; font-weight: 600; font-size: .9rem; color: rgb(255 255 255 / .92); }
.s-hero-kicker::before { content: ''; width: 1.75rem; height: 2px; background: var(--s-acento); }
.s-hero h1 { color: #fff; font-size: clamp(2.3rem, 1.4rem + 3.6vw, 4.25rem); line-height: 1.05; font-weight: 700; margin-top: .8rem; max-width: 16ch; text-shadow: 0 2px 30px rgb(0 0 0 / .25); }
.s-hero-sub { margin-top: 1rem !important; font-size: clamp(1.02rem, .95rem + .4vw, 1.2rem); color: rgb(255 255 255 / .9); max-width: 38rem; }
.s-hero-logo { width: clamp(8rem, 14vw, 13rem); height: auto; filter: drop-shadow(0 10px 30px rgb(0 0 0 / .35)); }
.s-busca { margin-top: 1.75rem; display: flex; align-items: center; gap: .5rem; background: #fff; border-radius: 999px; padding: .4rem .4rem .4rem 1.1rem; max-width: 40rem; box-shadow: 0 12px 40px -12px rgb(0 0 0 / .45); }
.s-busca .material-icons { color: #6b7280; }
.s-busca input { flex: 1; min-width: 0; border: 0; background: transparent; font: 400 1.0625rem/1.3 var(--s-sans); color: #111; padding: .55rem 0; }
.s-busca input:focus { outline: none; }
.s-busca:focus-within { box-shadow: 0 0 0 3px var(--s-acento), 0 12px 40px -12px rgb(0 0 0 / .45); }
.s-chips { display: flex; flex-wrap: wrap; gap: .5rem; margin-top: .9rem; }
.s-chips a { display: inline-flex; align-items: center; gap: .35rem; padding: .4rem .8rem; border-radius: 999px; background: rgb(255 255 255 / .14); border: 1px solid rgb(255 255 255 / .28); color: #fff; font-size: .84rem; font-weight: 500; text-decoration: none; backdrop-filter: blur(6px); transition: background .2s; }
.s-chips a:hover { background: rgb(255 255 255 / .26); }
.s-chips .material-icons { font-size: 1rem; }
.s-hero-ctrl { position: absolute; right: clamp(1rem, 4vw, 2rem); bottom: 7.25rem; display: flex; align-items: center; gap: .4rem; z-index: 2; }
.s-hero-ctrl button { border: 0; background: rgb(255 255 255 / .18); color: #fff; width: 2.25rem; height: 2.25rem; border-radius: 999px; display: grid; place-items: center; cursor: pointer; }
.s-hero-ctrl button .material-icons { font-size: 1.2rem; }
.s-puntos { display: flex; gap: .35rem; }
.s-puntos button { width: .55rem; height: .55rem; padding: 0; background: rgb(255 255 255 / .45); }
.s-puntos button[aria-current="true"] { background: #fff; width: 1.4rem; }
@media (max-width: 860px) {
  .s-hero-in { grid-template-columns: minmax(0, 1fr); padding-block: 5rem 9.5rem; }
  .s-hero-logo { display: none; }
  .s-hero-ctrl { bottom: 8.5rem; }
}

/* Franja "Ahora en…" (sobre el borde del hero) */
.s-ahora { position: relative; z-index: 3; margin-top: -4.5rem; }
.s-ahora-rejilla { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 230px), 1fr)); gap: .85rem; }
.s-ahora a, .s-ahora div.s-dato { display: grid; grid-template-columns: auto 1fr; gap: .85rem; align-items: center; padding: 1rem 1.1rem; background: var(--s-papel); border: 1px solid var(--s-borde); border-radius: var(--s-radio); box-shadow: var(--s-sombra); text-decoration: none; color: var(--s-tinta); transition: transform .2s var(--s-salida), border-color .2s; }
.s-ahora a:hover { transform: translateY(-2px); border-color: color-mix(in srgb, var(--s-primario) 35%, transparent); }
.s-ahora .s-dato-ico { width: 2.75rem; height: 2.75rem; border-radius: 12px; display: grid; place-items: center; background: color-mix(in srgb, var(--s-primario) 10%, transparent); color: var(--s-primario); }
html.dark .s-ahora .s-dato-ico { background: rgb(255 255 255 / .06); color: var(--s-acento); }
.s-dato small { display: block; font-size: .78rem; color: var(--s-tinta-3); font-weight: 500; }
.s-dato b { display: block; font-size: 1.05rem; line-height: 1.25; font-weight: 700; }
.s-dato span.s-dato-extra { display: block; font-size: .8rem; color: var(--s-tinta-2); margin-top: .1rem; }
.s-semaforo { display: inline-flex; align-items: center; gap: .35rem; font-size: .78rem; font-weight: 700; }
.s-semaforo i { width: .55rem; height: .55rem; border-radius: 50%; background: currentColor; }

/* ¿Qué necesitas hacer? */
.s-servicios { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); grid-auto-rows: minmax(9.5rem, auto); gap: 1rem; }
.s-serv { position: relative; display: flex; flex-direction: column; justify-content: space-between; gap: 1rem; padding: 1.35rem; border-radius: var(--s-radio); background: var(--s-papel); border: 1px solid var(--s-borde); text-decoration: none; color: var(--s-tinta); transition: border-color .2s, transform .2s var(--s-salida), box-shadow .2s; }
.s-serv:hover { transform: translateY(-2px); box-shadow: var(--s-sombra); border-color: color-mix(in srgb, var(--s-primario) 30%, transparent); }
.s-serv:focus-visible { outline: 2px solid var(--s-acento); outline-offset: 3px; }
.s-serv .material-icons { font-size: 1.9rem; color: var(--s-primario); }
html.dark .s-serv .material-icons { color: var(--s-acento); }
.s-serv h3 { font-size: 1.1rem; }
.s-serv p { color: var(--s-tinta-2); font-size: .9rem; margin-top: .3rem !important; }
.s-serv-flecha { position: absolute; top: 1.25rem; right: 1.25rem; font-size: 1.2rem !important; color: var(--s-tinta-3) !important; transition: transform .2s var(--s-salida); }
.s-serv:hover .s-serv-flecha { transform: translate(2px, -2px); }
.s-serv--destacado { grid-column: span 2; grid-row: span 2; background: var(--s-primario); color: #fff; border-color: transparent; overflow: hidden; }
.s-serv--destacado h3 { color: #fff; font-size: clamp(1.5rem, 1.1rem + 1.2vw, 2rem); line-height: 1.15; }
.s-serv--destacado p { color: rgb(255 255 255 / .86); font-size: 1rem; max-width: 30rem; }
.s-serv--destacado .material-icons { color: #fff !important; }
.s-pasos { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: .75rem; counter-reset: paso; }
.s-pasos li { counter-increment: paso; background: rgb(255 255 255 / .1); border: 1px solid rgb(255 255 255 / .16); border-radius: 12px; padding: .75rem .8rem; font-size: .84rem; line-height: 1.35; }
.s-pasos li::before { content: counter(paso); display: grid; place-items: center; width: 1.5rem; height: 1.5rem; border-radius: 50%; background: var(--s-acento); color: #1a1206; font-weight: 800; font-size: .78rem; margin-bottom: .45rem; }
.s-serv--destacado .s-btn { align-self: flex-start; }
.s-serv-num { font-size: .8rem; font-weight: 600; color: var(--s-tinta-3); }
/* Tarjetas con foto: la foto de fondo y un velo para que el texto se lea siempre. */
.s-serv--foto, .s-serv--con-foto { overflow: hidden; isolation: isolate; border-color: transparent; }
.s-serv-foto { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; z-index: -2; transition: transform .8s var(--s-salida); }
.s-serv--foto:hover .s-serv-foto, .s-serv--con-foto:hover .s-serv-foto { transform: scale(1.04); }
.s-serv--foto { color: #fff; background: #1b1d22; min-height: 11rem; }
.s-serv--foto::before { content: ""; position: absolute; inset: 0; z-index: -1; background: linear-gradient(180deg, rgb(0 0 0 / .15) 0%, rgb(0 0 0 / .25) 40%, rgb(10 8 10 / .82) 100%); }
.s-serv--foto h3, .s-serv--foto .material-icons { color: #fff !important; }
.s-serv--foto p { color: rgb(255 255 255 / .86); }
.s-serv--foto .s-serv-flecha { color: rgb(255 255 255 / .85) !important; }
.s-serv--con-foto::before { content: ""; position: absolute; inset: 0; z-index: -1; background: linear-gradient(100deg, color-mix(in srgb, var(--s-primario) 96%, transparent) 0%, color-mix(in srgb, var(--s-primario) 86%, transparent) 42%, color-mix(in srgb, var(--s-primario) 35%, transparent) 75%, color-mix(in srgb, var(--s-primario) 10%, transparent) 100%); }
.s-serv--tramites { background: color-mix(in srgb, var(--s-acento) 14%, var(--s-papel)); border-color: color-mix(in srgb, var(--s-acento) 30%, transparent); }
html.dark .s-serv--tramites { background: color-mix(in srgb, var(--s-acento) 10%, var(--s-papel)); }
.s-serv--alerta:not(.s-serv--foto) .material-icons:first-child { color: #c62828 !important; }
@media (max-width: 1000px) { .s-servicios { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 560px) { .s-servicios { grid-template-columns: 1fr; } .s-serv--destacado { grid-column: auto; grid-row: auto; } .s-pasos { grid-template-columns: 1fr; } }

/* Gobierno */
.s-gobierno { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: clamp(2rem, 5vw, 4.5rem); align-items: center; }
/* Banda institucional: el color de la ciudad, en claro y en oscuro. */
.s-portada #contenido main > section.s-seccion.s-banda:nth-of-type(n) { background:
    radial-gradient(90% 120% at 100% 0%, color-mix(in srgb, var(--s-acento) 22%, transparent) 0%, transparent 55%),
    linear-gradient(160deg, var(--s-primario) 0%, var(--s-primario-osc) 70%, color-mix(in srgb, var(--s-primario-osc) 80%, #000) 100%);
  color: #fff; }
.s-banda h2, .s-banda h3 { color: #fff !important; }
.s-banda-kicker { display: inline-flex; align-items: center; gap: .5rem; font-weight: 600; font-size: .85rem; color: rgb(255 255 255 / .8); margin-bottom: .6rem; }
.s-banda-kicker::before { content: ""; width: 1.75rem; height: 2px; background: var(--s-acento); }
.s-banda-txt { color: rgb(255 255 255 / .86); margin-top: .75rem !important; font-size: 1.0625rem; max-width: 34rem; }
.s-banda .s-cifra { background: rgb(255 255 255 / .07); border-color: rgb(255 255 255 / .14); }
.s-banda .s-cifra b { color: var(--s-acento) !important; }
.s-banda .s-cifra span { color: rgb(255 255 255 / .8); }
.s-titular { display: grid; grid-template-columns: auto 1fr; gap: 1.5rem; align-items: center; padding: 1.25rem 1.5rem 1.25rem 1.25rem; border-radius: calc(var(--s-radio) + 4px); background: rgb(255 255 255 / .07); border: 1px solid rgb(255 255 255 / .16); text-decoration: none; color: #fff; backdrop-filter: blur(6px); transition: background .2s, transform .2s var(--s-salida); }
.s-titular:hover { background: rgb(255 255 255 / .11); transform: translateY(-2px); }
/* Retrato: las fotos oficiales suelen venir con fondo blanco, que sobre la banda
   se ve como un disco brillante. Sobre un fondo cálido y con "multiplicar", el
   blanco toma ese tono y la persona queda igual. */
.s-retrato { position: relative; width: clamp(7.5rem, 11vw, 9.5rem); aspect-ratio: 4 / 5; border-radius: 16px; overflow: hidden; background: radial-gradient(120% 90% at 50% 20%, #f6efe2 0%, #e4d3b4 60%, #c9ad7c 100%); box-shadow: 0 0 0 3px color-mix(in srgb, var(--s-acento) 70%, transparent), 0 18px 40px -18px rgb(0 0 0 / .6); flex: none; }
.s-retrato img { width: 100%; height: 100%; object-fit: cover; object-position: center 20%; mix-blend-mode: multiply; display: block; }
.s-retrato .s-avatar { width: 100%; height: 100%; display: grid; place-items: center; font: 700 2.5rem/1 var(--s-serif); color: var(--s-primario); }
.s-titular-txt small { color: rgb(255 255 255 / .75); font-size: .8rem; font-weight: 600; }
.s-titular h3 { font-size: 1.5rem; margin-top: .2rem; }
.s-titular p { color: rgb(255 255 255 / .85); font-size: .95rem; margin-top: .15rem !important; }
.s-titular .s-ver-mas { color: var(--s-acento); margin-top: .7rem; }
.s-avatar { display: grid; place-items: center; font: 700 2rem/1 var(--s-serif); color: var(--s-primario); }
.s-cifras { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: .75rem; margin-top: 1.4rem; }
.s-cifra { padding: .9rem 1rem; border-radius: 14px; background: var(--s-papel); border: 1px solid var(--s-borde); }
.s-cifra b { display: block; font: 700 1.6rem/1.1 var(--s-serif); color: var(--s-primario); }
html.dark .s-cifra b { color: var(--s-acento); }
.s-cifra span { font-size: .82rem; color: var(--s-tinta-2); }
/* Cabildo: caras, nombre y cargo */
.s-cabildo { margin-top: clamp(2.5rem, 4vw, 3.5rem); padding-top: 2rem; border-top: 1px solid rgb(255 255 255 / .14); }
.s-cabildo-tit { font-size: .78rem; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: rgb(255 255 255 / .7); margin-bottom: 1.1rem !important; }
.s-cabildo ul { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(9.5rem, 1fr)); gap: 1rem; }
.s-cabildo a { display: grid; justify-items: center; text-align: center; gap: .15rem; text-decoration: none; color: #fff; padding: .6rem .4rem; border-radius: 14px; transition: background .2s; }
.s-cabildo a:hover { background: rgb(255 255 255 / .07); }
.s-cara { position: relative; width: 5.25rem; height: 5.25rem; border-radius: 50%; overflow: hidden; margin-bottom: .55rem; background: radial-gradient(120% 90% at 50% 20%, #f6efe2 0%, #dcc7a3 70%); box-shadow: 0 0 0 2px color-mix(in srgb, var(--s-acento) 65%, transparent); }
.s-cara img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; object-position: center 20%; mix-blend-mode: multiply; }
.s-cara i { display: none; }
.s-cara--sin i { position: absolute; inset: 0; display: grid; place-items: center; font: 700 1.6rem/1 var(--s-serif); font-style: normal; color: var(--s-primario); }
.s-cabildo b { font-size: .88rem; font-weight: 600; line-height: 1.25; }
.s-cabildo small { font-size: .76rem; color: rgb(255 255 255 / .7); }
@media (max-width: 900px) { .s-gobierno { grid-template-columns: 1fr; } }

/* Noticias */
.s-noticias { display: grid; grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr); gap: 1.25rem; }
.s-nota { display: grid; text-decoration: none; color: var(--s-tinta); border-radius: var(--s-radio); overflow: hidden; background: var(--s-papel); border: 1px solid var(--s-borde); transition: box-shadow .2s, transform .2s var(--s-salida); }
.s-nota:hover { box-shadow: var(--s-sombra); transform: translateY(-2px); }
.s-nota-img { aspect-ratio: 16 / 9; background: var(--s-sutil); overflow: hidden; }
.s-nota-img img { width: 100%; height: 100%; object-fit: cover; transition: transform .6s var(--s-salida); }
.s-nota:hover .s-nota-img img { transform: scale(1.03); }
.s-nota-txt { padding: 1.1rem 1.2rem 1.3rem; display: grid; gap: .45rem; }
.s-nota-meta { font-size: .78rem; color: var(--s-tinta-3); font-weight: 600; }
.s-nota--principal h3 { font-size: 1.5rem; }
.s-notas-lista { display: grid; gap: 1rem; align-content: start; }
.s-notas-lista .s-nota { grid-template-columns: 9rem 1fr; }
.s-notas-lista .s-nota-img { aspect-ratio: auto; height: 100%; min-height: 6.5rem; }
.s-notas-lista h3 { font-size: 1rem; }
@media (max-width: 900px) { .s-noticias { grid-template-columns: 1fr; } }
@media (max-width: 480px) { .s-notas-lista .s-nota { grid-template-columns: 1fr; } .s-notas-lista .s-nota-img { aspect-ratio: 16 / 9; } }

/* Agenda */
.s-agenda { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 270px), 1fr)); gap: 1rem; }
.s-evento { display: grid; grid-template-columns: auto 1fr; gap: 1rem; padding: 1.1rem; border-radius: var(--s-radio); background: var(--s-papel); border: 1px solid var(--s-borde); text-decoration: none; color: var(--s-tinta); height: 100%; transition: border-color .2s; }
.s-evento:hover { border-color: color-mix(in srgb, var(--s-primario) 35%, transparent); }
.s-fecha { width: 3.75rem; text-align: center; border-radius: 12px; overflow: hidden; border: 1px solid var(--s-borde); align-self: start; }
.s-fecha small { display: block; background: var(--s-primario); color: #fff; font-size: .7rem; font-weight: 700; text-transform: uppercase; padding: .2rem 0; letter-spacing: .04em; }
.s-fecha b { display: block; font: 700 1.55rem/1.3 var(--s-serif); padding: .15rem 0; }
.s-evento h3 { font-size: 1.02rem; }
.s-evento p { font-size: .84rem; color: var(--s-tinta-2); margin-top: .35rem !important; display: flex; align-items: center; gap: .3rem; }
.s-evento p .material-icons { font-size: 1rem; color: var(--s-tinta-3); }
.s-etiqueta { display: inline-block; font-size: .7rem; font-weight: 700; padding: .15rem .5rem; border-radius: 999px; background: color-mix(in srgb, var(--s-acento) 18%, transparent); color: color-mix(in srgb, var(--s-acento) 60%, #3a2a0a); margin-bottom: .35rem; }
html.dark .s-etiqueta { color: var(--s-acento); }

/* Lo más reciente */
.s-recientes { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 1rem; }
.s-reciente { display: grid; grid-template-rows: auto 1fr; text-decoration: none; color: var(--s-tinta); border-radius: var(--s-radio); overflow: hidden; background: var(--s-papel); border: 1px solid var(--s-borde); transition: box-shadow .2s, transform .2s var(--s-salida); }
.s-reciente:hover { box-shadow: var(--s-sombra); transform: translateY(-2px); }
.s-reciente-img { display: block; aspect-ratio: 4 / 3; background: var(--s-sutil); overflow: hidden; }
.s-reciente-img img { width: 100%; height: 100%; object-fit: cover; transition: transform .6s var(--s-salida); }
.s-reciente:hover .s-reciente-img img { transform: scale(1.04); }
.s-reciente-txt { display: grid; gap: .35rem; align-content: start; padding: 1rem 1.1rem 1.15rem; }
.s-reciente h3 { font-size: 1.02rem !important; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.s-reciente p { font-size: .82rem; color: var(--s-tinta-2); display: flex; align-items: center; gap: .25rem; }
.s-reciente p .material-icons { font-size: 1rem; color: var(--s-tinta-3); }
@media (max-width: 1000px) { .s-recientes { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 480px) { .s-recientes { grid-template-columns: 1fr; } }

/* Trámites: cuadrícula pareja (misma altura, nombre a 2 líneas, área a 1) */
.s-busca-tramite { display: flex; align-items: center; gap: .5rem; background: var(--s-papel); border: 1px solid var(--s-borde); border-radius: 999px; padding: .2rem .4rem .2rem .9rem; min-width: min(100%, 20rem); }
.s-busca-tramite:focus-within { border-color: var(--s-acento); box-shadow: 0 0 0 3px color-mix(in srgb, var(--s-acento) 25%, transparent); }
.s-busca-tramite .material-icons { color: var(--s-tinta-3); font-size: 1.2rem; }
.s-busca-tramite input { flex: 1; min-width: 0; border: 0; background: transparent; font: 400 .95rem/1.3 var(--s-sans); color: var(--s-tinta); padding: .6rem 0; }
.s-busca-tramite input:focus { outline: none; }
.s-tramites { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 1rem; }
.s-tramites li { display: flex; }
.s-tramite { position: relative; flex: 1; display: grid; grid-template-rows: auto 1fr auto; gap: .55rem; padding: 1.2rem 1.2rem 1.1rem; border-radius: var(--s-radio); background: var(--s-papel); border: 1px solid var(--s-borde); text-decoration: none; color: var(--s-tinta); min-height: 11rem; transition: border-color .2s, box-shadow .2s, transform .2s var(--s-salida); }
.s-tramite:hover { border-color: color-mix(in srgb, var(--s-primario) 35%, transparent); box-shadow: var(--s-sombra); transform: translateY(-2px); }
.s-tramite:focus-visible { outline: 2px solid var(--s-acento); outline-offset: 3px; }
.s-tramite .s-tramite-ico { width: 2.75rem; height: 2.75rem; border-radius: 12px; display: grid; place-items: center; background: color-mix(in srgb, var(--s-primario) 9%, transparent); color: var(--s-primario); font-size: 1.4rem !important; }
html.dark .s-tramite .s-tramite-ico { background: rgb(255 255 255 / .06); color: var(--s-acento); }
.s-tramite b { font-size: 1rem; font-weight: 650; line-height: 1.3; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; align-self: start; }
.s-tramite small { font-size: .8rem; color: var(--s-tinta-3); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; padding-right: 1.6rem; }
.s-tramite-flecha { position: absolute; right: 1.1rem; bottom: 1rem; font-size: 1.1rem !important; color: var(--s-tinta-3); transition: transform .2s var(--s-salida), color .2s; }
.s-tramite:hover .s-tramite-flecha { transform: translateX(3px); color: var(--s-primario); }
html.dark .s-tramite:hover .s-tramite-flecha { color: var(--s-acento); }
@media (max-width: 1000px) { .s-tramites { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 480px) { .s-tramites { grid-template-columns: 1fr; } .s-tramite { min-height: 0; } }

/* Turismo */
.s-turismo { display: grid; grid-template-columns: 1fr 1.25fr 1fr; grid-template-rows: repeat(2, minmax(11rem, 15rem)); gap: 1rem; }
.s-lugar { position: relative; border-radius: var(--s-radio); overflow: hidden; display: flex; align-items: flex-end; text-decoration: none; color: #fff; background: var(--s-primario-osc); isolation: isolate; min-height: 11rem; }
.s-lugar img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; z-index: -2; transition: transform .8s var(--s-salida); }
.s-lugar::before { content: ''; position: absolute; inset: 0; z-index: -1; background: linear-gradient(180deg, transparent 35%, rgb(0 0 0 / .72)); }
.s-lugar:hover img { transform: scale(1.04); }
.s-lugar-txt { padding: 1.1rem 1.2rem; }
.s-lugar h3 { color: #fff; font-size: 1.3rem; }
.s-lugar p { font-size: .88rem; color: rgb(255 255 255 / .88); margin-top: .2rem !important; }
.s-lugar--1 { grid-column: 1; grid-row: 1 / span 2; }
.s-lugar--2 { grid-column: 2; grid-row: 1; }
.s-lugar--3 { grid-column: 3; grid-row: 1 / span 2; }
.s-lugar--4 { grid-column: 2; grid-row: 2; }
@media (max-width: 900px) { .s-turismo { grid-template-columns: 1fr 1fr; grid-template-rows: none; grid-auto-rows: 14rem; } .s-lugar--1, .s-lugar--2, .s-lugar--3, .s-lugar--4 { grid-row: auto; grid-column: auto; } }
@media (max-width: 520px) { .s-turismo { grid-template-columns: 1fr; } }

/* Aparición al hacer scroll: atada a la posición de scroll (no a un temporizador),
   así nada queda oculto en pestañas en segundo plano ni en capturas. */
@supports (animation-timeline: view()) {
  @media (prefers-reduced-motion: no-preference) {
    .s-aparece { animation: s-aparecer linear both; animation-timeline: view(); animation-range: entry 0% cover 18%; }
    @keyframes s-aparecer { from { opacity: .001; transform: translateY(18px); } }
  }
}
@media (prefers-reduced-motion: reduce) {
  .s-hero-fondo img.s-activa { animation: none; }
  .s-portada *, .s-cabecera * { transition-duration: .01ms !important; }
}

@media (max-width: 560px) { .s-cifras { gap: .5rem; } .s-cifra { padding: .75rem .7rem; } .s-cifra b { font-size: 1.2rem; } }
