/* CMS-034 · Sitio municipal compartido. Identidad por tenant vía tokens. */
/* Fuentes precargadas en el <head> y con font-display: optional: nunca cambian
   de letra después de pintar, así el menú no salta al cambiar de página. */
@font-face {
  font-family: MuniText;
  src: url("/site-assets/source-sans-3-latin-400-normal.woff2") format("woff2");
  font-style: normal;
  font-weight: 400;
  font-display: optional;
}
@font-face {
  font-family: MuniText;
  src: url("/site-assets/source-sans-3-latin-600-normal.woff2") format("woff2");
  font-style: normal;
  font-weight: 600;
  font-display: optional;
}
:root {
  /* CMS-034: --site-color llega de /site-theme.css (Apariencia del CMS). */
  --brand: var(--site-color, #1d4e57);
  --brand-deep: #133840;
  --brand-deep: color-mix(in oklab, var(--brand) 66%, black);
  --brand-soft: #e3eeec;
  --brand-soft: color-mix(in oklab, var(--brand) 12%, white);
  --sand: #f4f1ea;
  --card: #ffffff;
  --ink: #15262b;
  --muted: #4d5f63;
  --line: #d6dcd8;
  --accent: #9a5b00;
  --accent-soft: #fff3dc;
  --focus: #b85c00;
  --on-brand: #ffffff;
  /* Aliases consumed by shared block styles. */
  --blue: var(--brand);
  --yellow: #f2c14e;
  --paper: var(--sand);
  color-scheme: only light;
  font: 18px/1.55 MuniText, "Segoe UI", Arial, sans-serif;
  color: var(--ink);
  background: var(--sand);
}

* {
  box-sizing: border-box;
}
html {
  scroll-behavior: smooth;
}
/* Mismo ancho útil con o sin barra de desplazamiento: la cabecera no se corre.
   Solo con mouse: en celular la barra flota y el espacio reservado cortaba el menú. */
@media (hover: hover) and (pointer: fine) {
  html {
    scrollbar-gutter: stable;
  }
}
body {
  margin: 0;
  background: var(--sand);
  color: var(--ink);
  overflow-wrap: anywhere;
}
img {
  max-width: 100%;
  height: auto;
}
a {
  color: inherit;
  text-underline-offset: 3px;
}
a:hover {
  text-decoration-thickness: 2px;
}
:focus-visible {
  outline: 3px solid var(--focus);
  outline-offset: 3px;
  border-radius: 4px;
}
h1,
h2,
h3 {
  line-height: 1.15;
  font-weight: 600;
  letter-spacing: -0.01em;
  margin: 0 0 0.5em;
}
h1 {
  font-size: clamp(30px, 4vw, 46px);
}
h2 {
  font-size: clamp(22px, 2.4vw, 28px);
}
h3 {
  font-size: 20px;
}
.wrap {
  width: min(1320px, 100% - 32px);
  margin-inline: auto;
}
.wrap-narrow {
  width: min(860px, 100% - 32px);
  margin-inline: auto;
}
.skip {
  position: absolute;
  left: 16px;
  top: -80px;
  z-index: 50;
  padding: 10px 16px;
  background: var(--card);
  color: var(--ink);
}
.skip:focus {
  top: 12px;
}
.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  padding: 8px 18px;
  border: 1px solid var(--brand);
  border-radius: 8px;
  background: var(--brand);
  color: var(--on-brand);
  font: inherit;
  font-weight: 600;
  text-decoration: none;
  cursor: pointer;
}
.text-link {
  font-weight: 600;
  color: var(--brand);
}
.external {
  margin-left: 0.3em;
  font-size: 0.85em;
}
.badge {
  display: inline-block;
  padding: 1px 8px;
  border-radius: 99px;
  background: var(--accent-soft);
  color: var(--accent);
  font-size: 14px;
  font-weight: 600;
  letter-spacing: 0.02em;
}

/* Header */
.legal-bar {
  background: var(--brand-deep);
  color: #fff;
  font-size: 16px;
}
.legal-bar .wrap {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 4px 22px;
  padding-block: 6px;
}
.legal-bar a {
  display: inline-flex;
  align-items: center;
  min-height: 36px;
}
.header-main {
  display: flex;
  align-items: center;
  gap: 24px;
  min-height: 92px;
}
.site-header {
  background: var(--card);
  border-bottom: 1px solid var(--line);
}
.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  text-decoration: none;
  margin-right: auto;
}
.brand img {
  width: 56px;
  height: 56px;
  object-fit: contain;
}
.brand span {
  display: flex;
  flex-direction: column;
  line-height: 1.1;
}
.brand small {
  font-size: 13px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--muted);
}
.brand strong {
  font-size: 27px;
}
.desktop-nav {
  display: flex;
  align-items: center;
  gap: 4px;
}
.nav-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}
.search-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 44px;
  min-height: 44px;
  border-radius: 50%;
}

/* Hero and search */
.hero {
  position: relative;
  isolation: isolate;
  color: #fff;
  background: var(--brand-deep);
}
.hero-photo,
.hero-photo .cms-carousel {
  position: absolute;
  inset: 0;
  z-index: -1;
}
.hero-photo img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: 0.5;
}
/* Readable text over any photo: a steady dark scrim behind the copy. */
.hero-photo::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(90deg, rgb(10 30 34 / 0.85) 0%, rgb(10 30 34 / 0.6) 55%, rgb(10 30 34 / 0.25) 100%);
}
@media (max-width: 700px) {
  .hero-photo::after {
    background: rgb(10 30 34 / 0.72);
  }
}
.hero-copy {
  padding-block: 56px 44px;
}
.hero h1 {
  max-width: 820px;
  text-shadow: 0 2px 12px rgb(0 0 0 / 0.35);
}
.hero p {
  max-width: 720px;
  font-size: 20px;
  margin: 0 0 24px;
  text-shadow: 0 1px 8px rgb(0 0 0 / 0.4);
}
.search-form label {
  display: block;
  font-weight: 600;
  margin-bottom: 6px;
}
.search-form > div {
  display: flex;
  gap: 8px;
  max-width: 820px;
}
.search-form input,
.doc-filter input,
.doc-filter select {
  flex: 1;
  min-width: 0;
  min-height: 52px;
  padding: 8px 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  font: inherit;
  color: var(--ink);
  background: var(--card);
}
.search-form .button {
  flex-shrink: 0;
  min-width: 96px;
  min-height: 52px;
}
.search-big .button {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
}

/* Sections */
.section-heading {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: 8px 20px;
  margin-bottom: 14px;
}
.section-heading h2 {
  margin: 0;
}
.needs {
  padding-block: 32px 8px;
}
.tramites {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
}
.tramite {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  height: 100%;
  min-height: 72px;
  padding: 14px 16px;
  background: var(--card);
  border: 1px solid var(--line);
  border-left: 5px solid var(--brand);
  border-radius: 8px;
  font-weight: 600;
  text-decoration: none;
}
.tramite:hover {
  border-color: var(--brand);
}
.tramite-all {
  background: var(--brand);
  color: var(--on-brand);
}
.home-columns {
  display: grid;
  grid-template-columns: minmax(0, 2fr) minmax(300px, 1fr);
  gap: 32px;
  padding-block: 36px;
}
.news-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 18px;
  margin-bottom: 18px;
}
.news-lead {
  grid-template-columns: 1fr;
}
.news-card {
  display: flex;
  flex-direction: column;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 10px;
  overflow: hidden;
}
.news-picture img {
  display: block;
  width: 100%;
  aspect-ratio: 16 / 9;
  object-fit: cover;
  background: var(--brand-soft);
}
.news-lead .news-picture img {
  aspect-ratio: 21 / 9;
}
.news-body {
  padding: 14px 18px 18px;
}
.news-card time {
  font-size: 15px;
  color: var(--muted);
}
.news-card h3 {
  margin: 4px 0 6px;
  font-size: 20px;
}
.news-lead h3 {
  font-size: 24px;
}
.news-card h3 a {
  text-decoration: none;
}
.news-card h3 a:hover {
  text-decoration: underline;
}
.news-card p {
  margin: 0;
  color: var(--muted);
  font-size: 17px;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.home-aside {
  display: flex;
  flex-direction: column;
  gap: 20px;
}
.today,
.transparency-card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 10px;
  overflow: hidden;
}
.today-photo {
  display: block;
  width: 100%;
  aspect-ratio: 16 / 7;
  object-fit: cover;
}
.today-body,
.transparency-card {
  padding: 18px 20px;
}
.today-body > p {
  color: var(--muted);
  font-size: 16px;
}
.weather {
  padding: 12px 14px;
  border-radius: 8px;
  background: var(--brand-soft);
}
.weather p {
  margin: 0;
}
.weather-now {
  display: flex;
  align-items: baseline;
  gap: 10px;
}
.weather-now strong {
  font-size: 30px;
}
.weather-meta,
.weather-note {
  font-size: 15px;
  color: var(--muted);
}
.plain-links {
  list-style: none;
  margin: 8px 0;
  padding: 0;
}
.plain-links a {
  display: flex;
  align-items: center;
  min-height: 44px;
  border-bottom: 1px solid var(--line);
}
.capsules {
  padding-block: 8px 36px;
}
.capsules ul {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 14px;
}
.capsule {
  display: flex;
  flex-direction: column;
  height: 100%;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 8px;
  overflow: hidden;
  text-decoration: none;
  font-size: 16px;
  font-weight: 600;
}
.capsule img {
  display: block;
  width: 100%;
  aspect-ratio: 2 / 1;
  object-fit: contain;
  background: #fff;
}
.more {
  margin-top: 14px;
}
.more summary {
  min-height: 44px;
  display: flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  font-weight: 600;
}
.more ul {
  margin-top: 12px;
}
.featured-documents {
  padding-block: 8px 36px;
}
.document-list {
  list-style: none;
  margin: 0 0 16px;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}
.document-list .document-link {
  display: flex;
  flex-direction: column;
  gap: 2px;
  height: 100%;
  min-height: 64px;
  padding: 12px 16px;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 8px;
  text-decoration: none;
  font-weight: 600;
}
.document-list small {
  color: var(--muted);
  font-weight: 400;
}
.doc-filter {
  display: flex;
  flex-wrap: wrap;
  align-items: end;
  gap: 8px 12px;
  margin: 20px 0;
}
.doc-filter label {
  font-weight: 600;
}
.doc-filter .field {
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.doc-filter .field:first-child {
  flex: 2 1 260px;
}
.doc-filter .field:nth-child(2) {
  flex: 1 1 180px;
}
/* Listings and documents */
.listing {
  padding-block: 28px 56px;
}
.legacy-archive img {
  max-width: 100%;
  height: auto;
}
.legacy-archive article + article {
  margin-block-start: 1.5rem;
}
.listing > .lead,
.article-heading .lead {
  font-size: 20px;
  color: var(--muted);
  max-width: 820px;
}
.breadcrumbs {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  font-size: 15px;
  color: var(--muted);
  margin-bottom: 14px;
}
.callout,
.contact-card {
  margin-top: 28px;
  padding: 20px 22px;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 10px;
}
.contact-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
}
.contact-card {
  margin-top: 0;
}
.contact-lines p {
  margin: 0 0 12px;
}
.note {
  margin-top: 20px;
  color: var(--muted);
  font-size: 16px;
}
.search-results article {
  padding-block: 14px;
  border-bottom: 1px solid var(--line);
}
.search-results h2 {
  font-size: 21px;
  margin: 0;
}
.pagination {
  display: flex;
  gap: 16px;
  align-items: center;
  margin-top: 24px;
}
.pagination a {
  min-height: 44px;
  display: inline-flex;
  align-items: center;
}
.document {
  padding-bottom: 48px;
}
.article-heading {
  padding-top: 28px;
}
.article-heading time {
  color: var(--muted);
}
.article-cover img {
  display: block;
  width: 100%;
  max-height: 560px;
  object-fit: contain;
  border-radius: 10px;
  background: var(--card);
}
.article-back {
  margin-top: 32px;
}
.empty {
  padding-block: 64px;
}

/* Footer */
.site-footer {
  margin-top: 24px;
  background: var(--brand-deep);
  color: #fff;
}
.footer-main {
  display: grid;
  grid-template-columns: 1.3fr 1fr 1fr;
  gap: 32px;
  padding-block: 40px;
}
.footer-brand img {
  width: 64px;
  height: 64px;
  object-fit: contain;
  background: #fff;
  border-radius: 50%;
  padding: 4px;
}
.footer-brand strong {
  display: block;
  font-size: 22px;
  margin: 10px 0 12px;
}
.footer-links h2 {
  font-size: 18px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}
.footer-links a {
  display: flex;
  align-items: center;
  min-height: 40px;
}
.footer-bottom {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  padding-block: 16px 24px;
  border-top: 1px solid rgb(255 255 255 / 0.2);
  font-size: 15px;
}

/* Responsive */
@media (max-width: 1150px) {
  .tramites {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
  .capsules ul {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
  .desktop-nav {
    display: none;
  }
}
@media (max-width: 800px) {
  .home-columns,
  .footer-main,
  .contact-grid {
    grid-template-columns: 1fr;
  }
  .document-list {
    grid-template-columns: 1fr;
  }
}
@media (max-width: 700px) {
  body {
    font-size: 17px;
  }
  .legal-bar .wrap {
    justify-content: flex-start;
    font-size: 15px;
    gap: 0 16px;
  }
  .header-main {
    min-height: 72px;
    gap: 12px;
  }
  .brand img {
    width: 44px;
    height: 44px;
  }
  .brand strong {
    font-size: 22px;
  }
  .brand small {
    font-size: 11px;
    white-space: nowrap;
  }
  .hero-copy {
    padding-block: 28px 24px;
  }
  .hero p {
    font-size: 17px;
    margin-bottom: 16px;
  }
  .tramites {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
  }
  .tramite {
    min-height: 64px;
    padding: 10px 12px;
    font-size: 16px;
    border-left-width: 4px;
  }
  .needs {
    padding-top: 22px;
  }
  .news-grid {
    grid-template-columns: 1fr;
  }
  .news-lead .news-picture img {
    aspect-ratio: 16 / 9;
  }
  .capsules ul {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .proposals {
    padding: 16px;
  }
  .footer-bottom {
    flex-direction: column;
  }
}
.prose {
  max-width: 800px;
  margin: 45px auto;
  padding: 0 24px;
  overflow-wrap: anywhere;
}
.prose p {
  white-space: pre-line;
}
.prose h2 {
  font-size: 38px;
  line-height: 1.12;
  margin-block: 32px 18px;
}
.prose .block {
  margin-bottom: 24px;
}
.columns {
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: minmax(0, 1fr);
  gap: 30px;
}
.columns > div {
  min-width: 0;
}
.block img {
  border-radius: 4px;
  width: 100%;
  object-fit: contain;
}
.block figcaption {
  font-size: 15px;
  color: var(--muted);
  margin-top: 8px;
}
.photo-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
}
.photo-grid img {
  aspect-ratio: 4/3;
  object-fit: cover;
}
.prose .document-link {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  padding: 14px 4px;
  border-bottom: 1px solid var(--line);
  font-weight: 600;
  color: var(--brand);
}
.site-loading:not([hidden]) {
  position: fixed;
  z-index: 99;
  right: 18px;
  bottom: 18px;
  background: white;
  box-shadow: 0 5px 25px #10274730;
  padding: 15px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  gap: 10px;
}
.site-loading img {
  object-fit: contain;
  width: 55px;
  height: 42px;
}
.site-loading span {
  width: 18px;
  height: 18px;
  border: 2px solid var(--line);
  border-top-color: var(--blue);
  border-radius: 50%;
  animation: spin 1s linear infinite;
}
@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}
[hidden] {
  display: none !important;
}
.cms-carousel {
  position: relative;
  overflow: hidden;
}
.carousel-track {
  display: grid;
}
.carousel-slide {
  grid-area: 1/1;
  margin: 0;
  visibility: hidden;
  opacity: 0;
  transition: opacity 0.6s;
}
.carousel-slide:first-child,
.carousel-slide.is-current {
  visibility: visible;
  opacity: 1;
}
.carousel-ready .carousel-slide:not(.is-current) {
  visibility: hidden;
  opacity: 0;
}
.carousel-slide img {
  width: 100%;
  aspect-ratio: 16/9;
  object-fit: cover;
}
.carousel-controls {
  display: none;
}
.carousel-ready .carousel-controls {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 8px;
  padding: 12px;
  background: var(--blue);
  color: white;
  position: relative;
  z-index: 5;
}
.carousel-controls button {
  border: 1px solid #ffffff70;
  background: transparent;
  color: inherit;
  min-height: 44px;
  min-width: 44px;
  padding: 5px;
}
.carousel-controls [aria-current="true"] {
  background: var(--yellow);
  color: var(--ink);
}
.carousel-hero {
  height: 100%;
}
.carousel-hero .carousel-track,
.carousel-hero .carousel-slide,
.carousel-hero .carousel-slide img {
  height: 100%;
  min-height: 610px;
  object-position: 50% 65%;
}
.carousel-hero .carousel-controls {
  position: absolute;
  bottom: 16px;
  left: 16px;
  right: 16px;
  background: #193766ed;
  border-radius: 4px;
}
.gallery-dialog {
  border: 0;
  background: #102747f5;
  color: white;
  max-width: 100vw;
  max-height: 100dvh;
  width: 100vw;
  height: 100dvh;
  padding: 65px;
}
.gallery-dialog[open] {
  display: grid;
  place-items: center;
}
.gallery-dialog img {
  max-height: calc(100dvh - 130px);
  max-width: 90vw;
  object-fit: contain;
}
.gallery-dialog button {
  background: var(--blue);
  border: 1px solid #ffffff75;
  color: white;
  min-width: 44px;
  min-height: 44px;
}
.gallery-toolbar {
  position: absolute;
  right: 20px;
  top: 15px;
  display: flex;
  gap: 8px;
}
.gallery-prev,
.gallery-next {
  position: absolute;
  top: 50%;
}
.gallery-prev {
  left: 10px;
}
.gallery-next {
  right: 10px;
}
.gallery-dialog p {
  position: absolute;
  left: 20px;
  top: 20px;
}
.gallery-zoomed {
  overflow: auto;
}
.gallery-zoomed img {
  max-height: none;
  max-width: none;
}
@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }
  *,
  *::before,
  *::after {
    animation: none !important;
    transition: none !important;
  }
}
.private-banner {
  padding: 12px 20px;
  background: #f6c945;
  color: #102747;
  text-align: center;
  font-weight: 600;
}
.cms-bridge-selected {
  outline: 3px solid #a94a0b;
  outline-offset: 4px;
}
.preview-loading {
  padding: 40px;
}
.prototype-banner {
  margin: 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  padding: 6px 16px;
  background: var(--accent-soft);
  color: var(--ink);
  font-size: 14px;
  text-align: center;
}

.document-list .document-link {
  text-align: left;
  align-items: flex-start;
}
.listing .featured-documents {
  width: auto;
  padding: 0;
  margin-bottom: 24px;
}


/* ==========================================================================
   CMS-034 · Inicio D (diseño elegido por Francisco, 10-11-2026)
   Solo modo claro. Colores de la franja cívica: --civic-N desde
   /site-theme.css (CMS, sección muni-identidad); sin franja, el color del sitio.
   ========================================================================== */
@font-face {
  font-family: MuniDisplay;
  src: url("/site-assets/bricolage-grotesque-latin-700-800.woff2") format("woff2");
  font-weight: 700 800;
  font-display: optional;
}
:root {
  --site: var(--site-color, #1d4e57);
  --brand: var(--site);
  --paper: var(--theme-paper, #fbfaf6);
  --sand: var(--paper);
  --ink: #13262b;
  --muted: #51656a;
  --line: #e3e8e6;
  --link: var(--theme-link, #17556b);
  --focus: var(--theme-deep, #2b6d9e);
  --deep: var(--theme-deep, color-mix(in oklab, var(--site) 70%, #0b1b1f));
  --radius: 16px;
  --display: MuniDisplay, "Segoe UI", Arial, sans-serif;
  background: var(--paper);
  font-size: 17px;
}
body {
  background: var(--paper);
}
a {
  color: var(--link);
}
:focus-visible {
  outline: 3px solid var(--focus);
  outline-offset: 2px;
}
.visually-hidden {
  position: absolute !important;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}
.wrap {
  width: min(1280px, 100% - 80px);
}
h1,
h2,
.display,
.brand strong {
  font-family: var(--display);
  letter-spacing: -0.01em;
}
.section-heading h2 {
  font-size: clamp(22px, 2.2vw, 26px);
  font-weight: 700;
}
.section-heading .display {
  font-size: clamp(28px, 3vw, 34px);
  font-weight: 800;
}
.tagline,
.today-time {
  margin: 0;
  color: var(--muted);
  font-size: 15px;
}

/* Franja cívica: cada clase toma su color; sin franja, el del sitio. */
.civic-0 { --c: var(--civic-0, var(--site)); }
.civic-1 { --c: var(--civic-1, var(--site)); }
.civic-2 { --c: var(--civic-2, var(--site)); }
.civic-3 { --c: var(--civic-3, var(--site)); }
.civic-4 { --c: var(--civic-4, var(--site)); }
.civic-5 { --c: var(--civic-5, var(--site)); }
.civic-6 { --c: var(--civic-6, var(--site)); }
.civic-7 { --c: var(--civic-7, var(--site)); }
[class*="civic-"] {
  --tint: color-mix(in srgb, var(--c) 13%, white);
}
.civic-bar {
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: 1fr;
  height: 8px;
}
.civic-bar span {
  background: var(--c);
}
.civic-bar-thin {
  height: 6px;
}

/* Cabecera: un solo buscador (escritorio en la cabecera; celular en el inicio). */
.site-header {
  background: #fff;
  border-bottom: 1px solid var(--line);
}
.header-main {
  min-height: 84px;
  gap: 24px;
}
/* Escudo alto (Guaitecas) o logo ancho (Palena): alto fijo, ancho natural. */
.brand img {
  width: auto;
  max-width: 132px;
  height: 56px;
  object-fit: contain;
}
@media (max-width: 640px) {
  .brand img {
    max-width: 96px;
  }
}
.brand strong {
  font-size: 26px;
  font-weight: 800;
}
.desktop-nav {
  flex-grow: 1;
}
.header-search {
  display: flex;
  align-items: center;
  gap: 8px;
  width: min(340px, 30vw);
  padding: 5px 5px 5px 14px;
  background: #f2f5f4;
  border: 1px solid #d5dedb;
  border-radius: 999px;
}
.header-search .icon,
.mobile-search .icon {
  width: 18px;
  height: 18px;
  flex: none;
  color: var(--muted);
}
.header-search input,
.mobile-search input {
  flex-grow: 1;
  min-width: 0;
  border: 0;
  background: transparent;
  font: inherit;
  font-size: 15px;
  color: var(--ink);
}
.header-search .button,
.mobile-search .button {
  min-height: 44px;
  padding: 0 14px;
  border-radius: 999px;
  background: var(--site);
  border-color: var(--site);
  color: #fff;
  font-weight: 700;
  font-size: 14px;
}
.mobile-search {
  display: none;
}
.cajon .mobile-search {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 0 16px 12px;
  padding: 6px 6px 6px 14px;
  border: 1px solid #c9d4d1;
  border-radius: 14px;
}
.search-link .icon {
  width: 22px;
  height: 22px;
}

/* Necesito… */
.needs {
  padding-block: 28px 8px;
  container-type: inline-size;
}
.tramites {
  grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: 12px;
}
@container (max-width: 1100px) {
  .tramites { grid-template-columns: repeat(4, minmax(0, 1fr)); }
}
@container (max-width: 640px) {
  .tramites { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
  .tramites > li:has(.tramite-all) { grid-column: 1 / -1; }
  .tramite-all { min-height: 52px; flex-direction: row; align-items: center; }
  .tramite-all .tile-icon { order: 2; background: none; }
}
.tramite {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  justify-content: space-between;
  gap: 14px;
  min-height: 128px;
  padding: 16px;
  background: #fff;
  border: 2px solid var(--c, var(--site));
  border-radius: var(--radius);
  color: var(--ink);
}
.tramite:hover {
  border-color: var(--c, var(--site));
}
.tramite-top {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
}
.tile-icon {
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  border-radius: 12px;
  background: var(--tint, #eef3f2);
  color: var(--ink);
}
.tile-icon .icon {
  width: 24px;
  height: 24px;
}
.tramite .external .icon {
  width: 18px;
  height: 18px;
  opacity: 0.7;
}
.tramite-label {
  font-weight: 700;
  font-size: 17px;
  line-height: 1.25;
}
.tramite-all {
  background: var(--site);
  border-color: var(--site);
  color: #fff;
}
.tramite-all .tile-icon {
  background: rgb(255 255 255 / 0.16);
  color: #fff;
}

/* Noticias + hoy */
.home-columns {
  grid-template-columns: minmax(0, 2fr) minmax(320px, 1fr);
  gap: 24px;
  padding-block: 28px 16px;
}
.news-lead {
  display: grid;
  grid-template-columns: 1.15fr 1fr;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 18px;
  overflow: hidden;
  text-decoration: none;
  color: var(--ink);
}
.news-lead img {
  width: 100%;
  height: 100%;
  min-height: 280px;
  max-height: 340px;
  object-fit: cover;
}
.news-lead-body {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 22px 24px;
}
.news-lead-body strong {
  font-family: var(--display);
  font-size: 23px;
  line-height: 1.2;
}
.news-summary {
  color: #3e5257;
  font-size: 16px;
  display: -webkit-box;
  -webkit-line-clamp: 4;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.news-more {
  margin-top: auto;
  font-weight: 700;
  color: var(--link);
  font-size: 15px;
}
.news-cards {
  list-style: none;
  margin: 16px 0 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
}
.news-card {
  display: flex;
  flex-direction: column;
  height: 100%;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
  text-decoration: none;
  color: var(--ink);
}
.news-card img {
  width: 100%;
  height: 130px;
  object-fit: cover;
  background: #eef3f2;
}
.news-card-body,
.news-lead-body {
  font-size: 16px;
}
.news-card-body {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 12px 14px 16px;
}
.news-card-body strong {
  line-height: 1.3;
}
.news-lead time,
.news-card time {
  color: var(--muted);
  font-size: 13px;
  font-weight: 600;
}
.home-aside {
  display: flex;
  flex-direction: column;
  gap: 16px;
}
.weather {
  background: color-mix(in srgb, var(--civic-5, var(--site)) 14%, white);
  border: 2px solid var(--civic-5, var(--site));
  border-radius: 18px;
  overflow: hidden;
}
.weather-photo,
.weather-photo img {
  display: block;
  width: 100%;
  height: 96px;
  object-fit: cover;
}
.weather-now {
  display: flex;
  align-items: center;
  gap: 14px;
  margin: 0;
  padding: 16px 18px 6px;
}
.weather-now strong {
  display: block;
  font-family: var(--display);
  font-size: 40px;
  font-weight: 800;
  line-height: 1;
}
.weather-now span {
  font-weight: 600;
}
.weather-icon {
  width: 44px;
  height: 44px;
  flex: none;
}
.weather-range {
  margin: 0 0 0 auto;
  font-size: 14px;
  color: #2e4a55;
  text-align: right;
}
.weather-note {
  margin: 0;
  padding: 4px 18px 14px;
  font-size: 12.5px;
  color: #3e5257;
}
.today-text {
  margin: 0;
  color: #3e5257;
  font-size: 16px;
}
.today-links {
  background: #fff;
  border: 2px solid var(--c, var(--site));
  border-radius: 18px;
  padding: 14px 18px;
}
.today-links-title {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 0 0 4px;
  font-weight: 700;
}
.today-links-title .icon {
  width: 22px;
  height: 22px;
}
.today-links ul {
  list-style: none;
  margin: 0;
  padding: 0;
}
.today-links li a {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  min-height: 44px;
  align-items: center;
  border-top: 1px solid var(--line);
  font-weight: 600;
}

.today-more {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 4px 18px;
  font-weight: 600;
  font-size: 15px;
}
.today-more a {
  display: inline-flex;
  min-height: 44px;
  align-items: center;
}

/* Transparencia: franja propia con tarjetas grandes */
.transparency-band {
  margin-top: 32px;
  background: #fff;
  border-block: 1px solid var(--line);
}
.transparency-band > .wrap {
  padding-block: 36px;
}
.transparency-cards {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
}
.transparency-card {
  display: flex;
  gap: 16px;
  align-items: flex-start;
  height: 100%;
  padding: 22px;
  background: var(--tint);
  border: 2px solid var(--c);
  border-radius: 18px;
  color: var(--ink);
  text-decoration: none;
}
.transparency-card .tile-icon {
  width: 56px;
  height: 56px;
  border-radius: 16px;
  background: #fff;
  flex: none;
}
.transparency-card .tile-icon .icon {
  width: 28px;
  height: 28px;
}
.transparency-card strong {
  display: block;
  font-family: var(--display);
  font-size: 21px;
  line-height: 1.2;
}
.transparency-detail {
  display: block;
  margin-top: 4px;
  font-size: 15px;
  color: #2e4147;
}
.transparency-cta {
  display: block;
  margin-top: 8px;
  font-weight: 700;
  font-size: 14px;
}
.transparency-links {
  list-style: none;
  margin: 18px 0 0;
  padding: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 8px 22px;
  font-weight: 600;
  font-size: 15px;
}

/* Documentos: hoja girada sobre una franja de color */
.featured-documents {
  padding-block: 44px 8px;
}
.doc-grid {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 16px;
}
.doc {
  display: flex;
  flex-direction: column;
  height: 100%;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 20px;
  overflow: hidden;
  text-decoration: none;
  color: var(--ink);
}
.doc-sheet-wrap {
  position: relative;
  display: block;
  height: 220px;
  padding: 22px 34px 0;
  background: var(--tint);
  overflow: hidden;
}
.doc-sheet {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: top;
  background: #fff;
  box-shadow: 0 8px 22px rgb(19 38 43 / 0.22);
  transform: rotate(-2.5deg);
  transition: transform 0.25s ease;
}
.doc:hover .doc-sheet {
  transform: rotate(0deg) translateY(-4px);
}
.doc-sheet-empty {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 18px;
}
.doc-sheet-empty span {
  height: 6px;
  width: 86%;
  background: #d5dedb;
}
.doc-sheet-empty span:first-child {
  height: 10px;
  width: 70%;
  background: var(--site);
}
.doc-kind {
  position: absolute;
  top: 12px;
  right: 12px;
  background: var(--ink);
  color: #fff;
  font-weight: 800;
  font-size: 12px;
  padding: 3px 8px;
  border-radius: 6px;
}
.doc-label {
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: 12px 16px 16px;
}
.doc-label strong {
  line-height: 1.3;
}
.doc-label small {
  color: var(--muted);
  font-size: 14px;
}

/* Destacados: uno grande e insignia que sobresale (fila deslizable al final) */
.capsules {
  padding-block: 44px 60px;
}
.capsules .capsule-grid {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(12, minmax(0, 1fr));
  gap: 16px;
}
.capsules .capsule-grid > li {
  grid-column: span 3;
}
.capsules .capsule-grid > .capsule-big {
  grid-column: span 6;
  grid-row: span 2;
}
.capsule {
  position: relative;
  display: block;
  height: 100%;
  min-height: 172px;
  border-radius: 20px;
  overflow: hidden;
  background: var(--tint);
  color: #0e1e22;
  text-decoration: none;
}
.capsule-big .capsule {
  min-height: 360px;
}
/* Los destacados son afiches con texto: se muestran completos (Lumen). */
.capsule > img,
.capsule > picture,
.capsule > picture img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: calc(100% - 56px);
  object-fit: contain;
  object-position: center top;
  padding: 10px 10px 0;
  box-sizing: border-box;
}
.capsule-big .capsule > img,
.capsule-big .capsule > picture,
.capsule-big .capsule > picture img {
  height: calc(100% - 80px);
  padding: 16px 16px 0;
}
.capsule-label {
  position: absolute;
  left: 12px;
  right: 12px;
  bottom: 12px;
  padding: 20px 12px 10px;
  background: #fff;
  border-radius: 12px;
  border-top: 4px solid var(--c);
  font-weight: 800;
  font-size: 15px;
  line-height: 1.2;
}
.capsule-big .capsule-label {
  left: 18px;
  right: 18px;
  bottom: 18px;
  padding: 30px 18px 14px;
  font-family: var(--display);
  font-size: 24px;
  border-top-width: 5px;
}
.capsule-badge {
  position: absolute;
  top: -20px;
  left: 12px;
  display: grid;
  place-items: center;
  width: 36px;
  height: 36px;
  border-radius: 999px;
  background: #fff;
  border: 3px solid var(--c);
  box-shadow: 0 3px 8px rgb(19 38 43 / 0.2);
  color: #13262b;
}
.capsule-big .capsule-badge {
  top: -26px;
  left: 18px;
  width: 48px;
  height: 48px;
  border-width: 4px;
}
.capsule-badge .icon {
  width: 18px;
  height: 18px;
}
/* Pie */
.site-footer {
  margin-top: 0;
  background: var(--deep);
  color: #e6efee;
}
.site-footer a {
  color: #fff;
}
.footer-brand {
  display: flex;
  gap: 16px;
}
.footer-brand img {
  width: 56px;
  height: 72px;
  padding: 6px;
  background: #fff;
  border-radius: 10px;
}

/* Movimiento: aparición al hacer scroll (nativo) y fundido entre páginas. */
.lift {
  transition:
    transform 0.18s ease,
    box-shadow 0.18s ease;
}
.lift:hover {
  transform: translateY(-3px);
  box-shadow: 0 12px 24px -14px rgb(19 38 43 / 0.45);
}
@keyframes aparece {
  from {
    opacity: 0;
    transform: translateY(8px);
  }
  to {
    opacity: 1;
    transform: none;
  }
}
@supports (animation-timeline: view()) {
  .rv,
  .rvc {
    animation: aparece linear both;
    animation-timeline: view();
    animation-range: entry 0% entry 60%;
  }
  .rvc:nth-child(2) { animation-range: entry 6% entry 66%; }
  .rvc:nth-child(3) { animation-range: entry 12% entry 72%; }
  .rvc:nth-child(4) { animation-range: entry 18% entry 78%; }
  .rvc:nth-child(n + 5) { animation-range: entry 24% entry 84%; }
}
@view-transition {
  navigation: auto;
}
::view-transition-old(root),
::view-transition-new(root) {
  animation-duration: 0.22s;
}
@media (prefers-reduced-motion: reduce) {
  .rv,
  .rvc {
    animation: none;
  }
  .lift,
  .doc-sheet {
    transition: none;
  }
  .lift:hover {
    transform: none;
  }
  .doc:hover .doc-sheet {
    transform: rotate(-2.5deg);
  }
  ::view-transition-old(root),
  ::view-transition-new(root) {
    animation: none;
  }
}

/* Celular */
@media (min-width: 1151px) {
  .search-link {
    display: none;
  }
}
@media (max-width: 1150px) {
  .header-search {
    display: none;
  }
}
@media (max-width: 900px) {
  .home-columns {
    grid-template-columns: 1fr;
  }
  .doc-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .transparency-cards {
    grid-template-columns: 1fr;
  }
  .capsules .capsule-grid > li {
    grid-column: span 6;
  }
  .capsules .capsule-grid > .capsule-big {
    grid-column: 1 / -1;
    grid-row: auto;
  }
}
@media (max-width: 700px) {
  .wrap {
    width: min(1280px, 100% - 32px);
  }
  .mobile-search {
    display: flex;
    align-items: center;
    gap: 8px;
    margin: 14px 16px 0;
    padding: 6px 6px 6px 14px;
    background: #fff;
    border: 1px solid #c9d4d1;
    border-radius: 14px;
  }
  .needs {
    padding-top: 16px;
  }
  .tramite {
    min-height: 96px;
    padding: 12px;
    gap: 8px;
  }
  .tile-icon {
    width: 36px;
    height: 36px;
    border-radius: 10px;
  }
  .tramite-label {
    font-size: 15px;
  }
  .news-lead {
    grid-template-columns: 1fr;
  }
  .news-lead img {
    min-height: 0;
    height: 190px;
  }
  .news-lead-body {
    padding: 12px 14px 16px;
  }
  .news-lead-body strong {
    font-size: 19px;
  }
  .news-summary,
  .news-more {
    display: none;
  }
  .news-cards {
    grid-template-columns: 1fr;
    gap: 0;
    margin-top: 8px;
  }
  .news-card {
    flex-direction: row;
    gap: 12px;
    padding: 10px 0;
    background: none;
    border: 0;
    border-bottom: 1px solid var(--line);
    border-radius: 0;
  }
  .news-card img {
    width: 84px;
    height: 64px;
    border-radius: 10px;
    flex: none;
  }
  .news-card-body {
    padding: 0;
  }
  .transparency-card {
    padding: 14px;
  }
  .transparency-card .tile-icon {
    width: 44px;
    height: 44px;
  }
  .transparency-card strong {
    font-size: 18px;
  }
  .doc-grid {
    display: flex;
    overflow-x: auto;
    scroll-snap-type: x mandatory;
    padding-bottom: 8px;
  }
  .doc-grid > li {
    flex: 0 0 200px;
    scroll-snap-align: start;
  }
  .doc-sheet-wrap {
    height: 170px;
    padding: 16px 26px 0;
  }
  .capsule-big .capsule {
    min-height: 260px;
  }
  .capsule {
    min-height: 150px;
  }
  .capsule-label {
    font-size: 13px;
  }
  .capsule-big .capsule-label {
    font-size: 19px;
  }
  .footer-brand {
    flex-direction: column;
  }
}

/* Ajustes de revisión Lumen (CMS-034) */
.site-footer :focus-visible {
  outline: 3px solid #fff;
  outline-offset: 3px;
}
@container (max-width: 640px) {
  .tramites > li:has(.tramite-all) {
    grid-column: 1 / -1;
  }
  .tramite.tramite-all {
    min-height: 52px;
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
    padding: 0 16px;
  }
  .tramite-all .tile-icon {
    order: 2;
    background: none;
  }
}

/* ==========================================================================
   CMS-034 · Tema propio del municipio («Tema:» en muni-identidad del CMS).
   Cada regla usa --theme-*; sin tema (Guaitecas) el resultado es el de siempre.
   ========================================================================== */
.section-heading h2 {
  text-decoration-line: underline;
  text-decoration-color: var(--theme-mark, transparent);
  text-decoration-thickness: 0.2em;
  text-underline-offset: 0.16em;
  text-decoration-skip-ink: none;
}
.tramite-all .tile-icon {
  background: var(--theme-mark, rgb(255 255 255 / 0.16));
  color: var(--theme-mark-ink, #fff);
}
.transparency-band {
  background: var(--theme-band, #fff);
}
.site-header {
  box-shadow: inset 0 -4px 0 var(--theme-mark, transparent);
}
:root {
  --theme-mark-ink: var(--theme-deep, #fff);
  --theme-band: color-mix(in srgb, var(--theme-paper, #fff) 40%, white);
}

/* Destacados: etiquetas de igual alto por fila para que los círculos queden
   a la misma altura (Lumen, ronda Palena). Dos líneas en escritorio, tres en celular. */
.capsule-grid > li:not(.capsule-big) .capsule-label {
  box-sizing: border-box;
  min-height: calc(2.4em + 34px);
}
@media (max-width: 640px) {
  .capsule-grid > li:not(.capsule-big) .capsule-label {
    min-height: calc(3.6em + 34px);
  }
}
.capsule-grid > li:not(.capsule-big) .capsule > img,
.capsule-grid > li:not(.capsule-big) .capsule > picture,
.capsule-grid > li:not(.capsule-big) .capsule > picture img {
  height: calc(100% - 84px);
}
@media (max-width: 640px) {
  .capsule-grid > li:not(.capsule-big) .capsule > img,
  .capsule-grid > li:not(.capsule-big) .capsule > picture,
  .capsule-grid > li:not(.capsule-big) .capsule > picture img {
    height: calc(100% - 104px);
  }
}
.capsule-grid > li:not(.capsule-big) .capsule {
  min-height: 200px;
}

/* ==========================================================================
   CMS-034 · Páginas interiores: hoja blanca + costado con el resumen del
   inicio. El fondo del sitio (tema del municipio) se mantiene alrededor.
   ========================================================================== */
.interior {
  display: grid;
  grid-template-columns: 300px minmax(0, 1fr);
  grid-template-areas: "rail paper";
  gap: 28px;
  align-items: start;
  padding-block: 28px 64px;
}
.interior-paper {
  grid-area: paper;
  min-width: 0;
  background: var(--card, #fff);
  border: 1px solid var(--line);
  border-radius: var(--radius, 16px);
  box-shadow: 0 1px 2px rgb(16 39 46 / 0.05), 0 12px 32px -18px rgb(16 39 46 / 0.22);
  padding: clamp(20px, 3.4vw, 48px);
}
.interior-paper .wrap,
.interior-paper .wrap-narrow {
  width: auto;
  margin-inline: 0;
}
.interior-paper .listing,
.interior-paper .empty {
  padding-block: 0;
}
.interior-paper .document {
  padding-bottom: 0;
}
.interior-paper .article-heading {
  padding-top: 0;
  max-width: 820px;
}
.interior-paper .article-heading h1 {
  text-wrap: balance;
}
.interior-paper .article-cover {
  margin-top: 8px;
}
.interior-paper .article-cover img {
  max-height: 620px;
  background: var(--paper);
  border-radius: 12px;
}
.interior-paper .prose {
  max-width: 760px;
  margin: 36px 0 0;
  padding: 0;
}
.interior-paper .prose h2 {
  font-size: clamp(24px, 2.4vw, 30px);
  text-wrap: balance;
}
.interior-paper .prose p {
  text-wrap: pretty;
}

/* Costado */
.side-rail {
  grid-area: rail;
  display: grid;
  gap: 16px;
}
.rail-card {
  background: var(--card, #fff);
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 16px 16px 14px;
  font-size: 15px;
}
.rail-card h2 {
  font-family: var(--display);
  font-size: 17px;
  margin: 0 0 10px;
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: 4px 8px;
}
.rail-card h2 small {
  font-family: MuniText, sans-serif;
  font-weight: 400;
  font-size: 13px;
  color: var(--muted);
}
.rail-card .text-link {
  display: inline-block;
  margin-top: 8px;
  font-size: 14px;
  color: var(--link, var(--brand));
}
.rail-today {
  background: linear-gradient(160deg, color-mix(in oklab, var(--site) 12%, white), #fff 70%);
}
.rail-weather {
  display: grid;
  grid-template-columns: auto auto 1fr;
  align-items: center;
  gap: 10px;
  margin: 0;
}
.rail-weather svg {
  width: 34px;
  height: 34px;
  color: var(--deep);
}
.rail-weather strong {
  font-family: var(--display);
  font-size: 28px;
  line-height: 1;
}
.rail-weather span {
  display: grid;
  line-height: 1.25;
}
.rail-weather small,
.rail-note {
  color: var(--muted);
  font-size: 12.5px;
  margin: 0;
}
.rail-links,
.rail-featured,
.rail-news {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 6px;
}
.rail-links a {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 44px;
  padding: 6px 10px;
  border-radius: 10px;
  border-left: 4px solid var(--c, var(--site));
  background: color-mix(in oklab, var(--c, var(--site)) 7%, white);
  text-decoration: none;
  font-weight: 600;
  line-height: 1.2;
  transition: background-color 0.15s ease;
}
.rail-links a:hover {
  background: color-mix(in oklab, var(--c, var(--site)) 15%, white);
}
.rail-links svg {
  flex: none;
  width: 20px;
  height: 20px;
  color: color-mix(in oklab, var(--c, var(--site)) 75%, black);
}
.rail-links span {
  flex: 1;
}
.rail-featured a {
  display: grid;
  grid-template-columns: 56px 1fr;
  gap: 10px;
  align-items: center;
  min-height: 48px;
  text-decoration: none;
  font-weight: 600;
  line-height: 1.25;
}
.rail-featured a:hover span {
  text-decoration: underline;
}
.rail-featured img {
  width: 56px;
  height: 42px;
  object-fit: cover;
  border-radius: 8px;
  background: var(--paper);
}
.rail-badge {
  display: grid;
  place-items: center;
  width: 56px;
  height: 42px;
  border-radius: 8px;
  background: color-mix(in oklab, var(--c, var(--site)) 14%, white);
  color: color-mix(in oklab, var(--c, var(--site)) 75%, black);
}
.rail-badge svg {
  width: 22px;
  height: 22px;
}
.rail-news a {
  display: grid;
  gap: 2px;
  padding-block: 6px;
  border-bottom: 1px solid var(--line);
  text-decoration: none;
  line-height: 1.3;
}
.rail-news li:last-child a {
  border-bottom: 0;
}
.rail-news time {
  font-size: 12.5px;
  color: var(--muted);
}
.rail-news span {
  font-weight: 600;
}
.rail-news a:hover span {
  text-decoration: underline;
}

/* Documento adjunto */
.prose .block-documento {
  margin-block: 28px;
}
.doc-card {
  display: grid;
  grid-template-columns: 112px minmax(0, 1fr);
  grid-template-rows: auto auto;
  column-gap: 20px;
  row-gap: 12px;
  align-items: center;
  padding: 16px;
  border: 1px solid var(--line);
  border-left: 5px solid var(--site);
  border-radius: 14px;
  background: color-mix(in oklab, var(--site) 5%, white);
}
.doc-card-sheet {
  position: relative;
  display: block;
  width: 112px;
  aspect-ratio: 3 / 4;
  border-radius: 6px;
  overflow: hidden;
  background: #fff;
  box-shadow: 0 1px 2px rgb(16 39 46 / 0.12), 0 8px 18px -10px rgb(16 39 46 / 0.4);
  grid-row: span 2;
  align-self: start;
}
@media (hover: hover) and (prefers-reduced-motion: no-preference) {
  .doc-card-sheet {
    rotate: -2deg;
    transition: rotate 0.2s ease, translate 0.2s ease;
  }
  .doc-card:hover .doc-card-sheet {
    rotate: 0deg;
    translate: 0 -2px;
  }
  .mosaic-grid img {
    transition: scale 0.3s ease;
  }
  .mosaic-grid a:hover img {
    scale: 1.04;
  }
}
.doc-card-sheet img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: top;
  border-radius: 0;
  z-index: 1;
}
.doc-card-blank {
  position: absolute;
  inset: 16px 14px;
  display: grid;
  align-content: start;
  gap: 8px;
}
.doc-card-blank span {
  height: 6px;
  border-radius: 3px;
  background: var(--line);
}
.doc-card-blank span:nth-child(2) {
  width: 70%;
}
.doc-card-blank small {
  margin-top: 10px;
  font-size: 11px;
  line-height: 1.2;
  color: var(--muted);
}
.doc-card-kind {
  position: absolute;
  z-index: 2;
  left: 6px;
  bottom: 6px;
  padding: 1px 7px;
  border-radius: 5px;
  background: var(--deep);
  color: #fff;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.04em;
}
.doc-card-body {
  min-width: 0;
}
.doc-card-body p {
  white-space: normal;
  margin: 0;
}
.doc-card-eyebrow {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--muted);
}
.doc-card-eyebrow svg {
  width: 16px;
  height: 16px;
}
.doc-card-title {
  font-family: var(--display);
  font-size: 20px;
  font-weight: 700;
  line-height: 1.2;
  margin-top: 4px !important;
  text-wrap: balance;
}
.doc-card-meta {
  color: var(--muted);
  font-size: 15px;
  margin-top: 2px !important;
}
.doc-card-actions {
  grid-column: 2;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.doc-card-actions .button,
.share .button {
  gap: 8px;
  min-height: 44px;
  padding: 8px 14px;
  font-size: 16px;
}
.doc-card-actions svg {
  width: 18px;
  height: 18px;
}
.button-soft {
  background: #fff;
  color: var(--deep);
  border-color: color-mix(in oklab, var(--site) 35%, white);
}
.button-soft:hover {
  background: color-mix(in oklab, var(--site) 8%, white);
}
.doc-card-status {
  font-size: 14px;
  color: var(--deep);
  margin-top: 6px !important;
}

/* Galería en la noticia */
.mosaic {
  margin: 0;
}
.mosaic-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  grid-auto-rows: 150px;
  gap: 8px;
}
.mosaic-grid a {
  position: relative;
  display: block;
  overflow: hidden;
  border-radius: 10px;
  background: var(--paper);
}
.mosaic-grid a[hidden] {
  display: none;
}
.mosaic-grid img {
  width: 100%;
  height: 100%;
  aspect-ratio: auto;
  object-fit: cover;
  border-radius: 0;
}
.mosaic-grid a:first-child {
  grid-column: span 2;
  grid-row: span 2;
}
.mosaic-1 {
  grid-template-columns: 1fr;
  grid-auto-rows: auto;
}
.mosaic-1 a:first-child {
  grid-column: auto;
  grid-row: auto;
}
.mosaic-1 img {
  max-height: 560px;
  object-fit: contain;
}
.mosaic-2 {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  grid-auto-rows: 260px;
}
.mosaic-2 a:first-child,
.mosaic-3 a:first-child {
  grid-column: auto;
  grid-row: auto;
}
.mosaic-3 {
  grid-template-columns: 2fr 1fr;
  grid-auto-rows: 150px;
}
.mosaic-3 a:first-child {
  grid-row: span 2;
}
.mosaic-4 a:first-child {
  grid-column: span 2;
  grid-row: span 2;
}
.mosaic-4 a:last-child:not([hidden]) {
  grid-column: span 2;
}
.mosaic-more {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  background: rgb(10 25 30 / 0.55);
  color: #fff;
  font-family: var(--display);
  font-size: 30px;
  font-weight: 700;
}
.mosaic figcaption {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 10px;
  font-size: 15px;
  color: var(--muted);
}
.mosaic figcaption svg {
  width: 18px;
  height: 18px;
}

/* Compartir */
.share {
  margin-top: 40px !important;
  padding-top: 20px;
  border-top: 1px solid var(--line);
}
.interior-paper .share {
  margin-inline: 0;
  padding-inline: 0;
}
.share-title {
  font-weight: 600;
  margin: 0 0 10px;
}
.share ul {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.share a,
.share button {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 44px;
  padding: 8px 14px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: #fff;
  color: var(--ink);
  font: inherit;
  font-size: 16px;
  font-weight: 600;
  text-decoration: none;
  cursor: pointer;
}
.share svg {
  width: 18px;
  height: 18px;
}
.share a:hover,
.share button:hover {
  border-color: var(--site);
  background: color-mix(in oklab, var(--site) 7%, white);
}
.share-whatsapp svg {
  color: #128c4a;
}
.share-facebook svg {
  color: #1659c7;
}
.share-status {
  min-height: 1.5em;
  margin: 8px 0 0;
  font-size: 15px;
  color: var(--deep);
}

/* Visor de PDF dentro del sitio (solo computador) */
.doc-dialog {
  width: min(1100px, 100vw - 48px);
  height: min(92dvh, 1200px);
  max-width: none;
  max-height: none;
  padding: 0;
  border: 0;
  border-radius: 14px;
  overflow: hidden;
  display: none;
  grid-template-rows: auto 1fr;
  background: #fff;
}
.doc-dialog[open] {
  display: grid;
}
.doc-dialog::backdrop {
  background: rgb(8 20 24 / 0.7);
}
.doc-dialog-bar {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 12px 10px 18px;
  border-bottom: 1px solid var(--line);
}
.doc-dialog-title {
  flex: 1;
  margin: 0;
  font-weight: 600;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.doc-dialog iframe {
  width: 100%;
  height: 100%;
  border: 0;
  background: #525659;
}
html.doc-open {
  overflow: hidden;
}
@media (prefers-reduced-motion: no-preference) {
  .doc-dialog[open] {
    animation: doc-in 0.22s ease-out;
  }
  @keyframes doc-in {
    from {
      opacity: 0;
      translate: 0 12px;
    }
  }
}
@media (prefers-reduced-motion: reduce) {
  .rail-links a {
    transition: none;
  }
}

/* Celular y tablet: el costado baja al final, después del contenido. */
@media (max-width: 960px) {
  .interior {
    grid-template-columns: minmax(0, 1fr);
    grid-template-areas: "paper" "rail";
    gap: 20px;
    padding-block: 16px 40px;
  }
  .side-rail {
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  }
}
@media (max-width: 600px) {
  .interior {
    width: min(100% - 20px, 1320px);
  }
  .interior-paper {
    padding: 20px 16px 24px;
    border-radius: 12px;
  }
  .doc-card {
    grid-template-columns: 76px minmax(0, 1fr);
    gap: 14px;
    padding: 14px;
  }
  .doc-card-sheet {
    width: 76px;
  }
  .doc-card-sheet {
    grid-row: auto;
  }
  .doc-card-actions {
    grid-column: 1 / -1;
  }
  .doc-card-actions .button {
    flex: 1 1 auto;
  }
  .doc-card-title {
    font-size: 18px;
  }
  .mosaic-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    grid-auto-rows: 120px;
  }
  .mosaic-grid a:first-child,
  .mosaic-4 a:last-child:not([hidden]) {
    grid-column: span 2;
    grid-row: span 2;
  }
  .mosaic-3 {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .mosaic-2 {
    grid-auto-rows: 160px;
  }
  .mosaic-2 a:first-child {
    grid-column: auto;
    grid-row: auto;
  }
}

/* ==========================================================================
   CMS-034 · Ronda de pulido (10-11-2026)
   ========================================================================== */
/* Trámites: las palabras nunca se cortan a la mitad («circulació / n»). */
.tramite-label,
.tramite-detail {
  overflow-wrap: normal;
  word-break: normal;
  hyphens: manual;
}
/* Páginas interiores (Trámites, Transparencia): el doble de ancho y crecen hacia abajo. */
.tramites.tramites-wide {
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 232px), 1fr));
  gap: 14px;
}
.tramites-wide .tramite {
  justify-content: flex-start;
  min-height: 0;
  height: 100%;
  padding: 18px 20px 20px;
}
.tramites-wide .tramite-label {
  font-size: 18px;
  text-wrap: balance;
}
.tramite-detail {
  color: var(--muted);
  font-size: 15px;
  line-height: 1.4;
  text-wrap: pretty;
}

/* Fondo vivo: degradé suave que cambia al bajar (scroll-driven, nativo) y cuyo
   tono depende del tipo de página, para sentir el cambio de página.
   Sin soporte de animation-timeline queda el degradé fijo; con movimiento
   reducido, sin animación. */
body {
  --page-tint: var(--civic-2, var(--site));
  --page-tint-2: var(--civic-5, var(--civic-0, var(--site)));
  background: var(--paper);
  isolation: isolate;
}
body[data-view="news"],
body[data-view="noticia"] {
  --page-tint: var(--civic-1, var(--site));
  --page-tint-2: var(--civic-3, var(--site));
}
body[data-view="tramites"],
body[data-view="contacto"] {
  --page-tint: var(--civic-3, var(--site));
  --page-tint-2: var(--civic-0, var(--site));
}
body[data-view="transparencia"],
body[data-view="documents"] {
  --page-tint: var(--civic-5, var(--site));
  --page-tint-2: var(--civic-2, var(--site));
}
body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  /* Tonos claros de la franja del municipio sobre su fondo; nunca gris. */
  background:
    radial-gradient(
      90% 60% at 0% 0%,
      color-mix(in oklab, var(--page-tint) 22%, transparent),
      transparent 72%
    ),
    radial-gradient(
      80% 60% at 100% 45%,
      color-mix(in oklab, var(--page-tint-2) 18%, transparent),
      transparent 70%
    ),
    radial-gradient(
      90% 50% at 10% 100%,
      color-mix(in oklab, var(--civic-3, var(--page-tint)) 20%, transparent),
      transparent 72%
    ),
    var(--paper);
  background-size: 100% 260%;
  background-position: 50% 0%;
}
@supports (animation-timeline: scroll()) {
  @media (prefers-reduced-motion: no-preference) {
    body::before {
      animation: fondo-scroll linear both;
      animation-timeline: scroll(root block);
    }
  }
}
@keyframes fondo-scroll {
  to {
    background-position: 50% 100%;
  }
}
/* Las secciones a todo lo ancho ya no tapan el fondo con su propio color plano. */
main,
.page-body {
  background: transparent;
}

/* Noticias por tema: filtro arriba, temas de la noticia y nube al final. */
.topic-filter {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 4px 0 24px;
}
.topic-filter a {
  display: inline-flex;
  align-items: center;
  min-height: 40px;
  padding: 0 16px;
  border: 1.5px solid var(--line);
  border-radius: 999px;
  background: #fff;
  color: var(--ink);
  font-weight: 600;
  text-decoration: none;
  transition: background-color 0.15s, border-color 0.15s;
}
.topic-filter a:hover {
  border-color: var(--site);
  background: color-mix(in oklab, var(--site) 8%, white);
}
.topic-filter a[aria-current="page"] {
  background: var(--site);
  border-color: var(--site);
  color: #fff;
}
.article-topics {
  margin-block: 8px 0;
}
.topic-cloud {
  margin-top: 40px;
  padding-top: 24px;
  border-top: 1px solid var(--line);
}
.topic-cloud h2 {
  font-size: 22px;
  margin: 0 0 12px;
}
.topic-cloud ul {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 6px 18px;
  margin: 0;
  padding: 0;
  list-style: none;
}
.topic-cloud a {
  color: var(--link);
  font-weight: 600;
  text-decoration-thickness: 1px;
  text-underline-offset: 3px;
}
.topic-cloud a span {
  color: var(--muted);
  font-size: 0.75em;
  font-weight: 400;
}
.topic-cloud .w1 { font-size: 15px; }
.topic-cloud .w2 { font-size: 18px; }
.topic-cloud .w3 { font-size: 22px; }
.topic-cloud .w4 { font-size: 27px; font-family: var(--display); }

/* Ajustes de Lumen (ronda de pulido) · celular */
@media (max-width: 640px) {
  /* Columnas importadas (imagen + texto) se apilan. */
  .columns {
    grid-auto-flow: row;
    gap: 18px;
  }
  /* Miniatura de noticia con ancho reservado: nunca una franja. */
  .news-card > .news-picture {
    flex: none;
    width: 96px;
  }
  .news-card > .news-picture img {
    width: 96px;
    height: 72px;
    aspect-ratio: auto;
    border-radius: 10px;
  }
  /* Filtro de temas en una sola fila deslizable; el tema activo queda a la vista. */
  .topic-filter:not(.article-topics) {
    flex-wrap: nowrap;
    overflow-x: auto;
    scroll-snap-type: x proximity;
    margin-inline: -4px;
    padding: 2px 4px 8px;
    scrollbar-width: thin;
  }
  .topic-filter:not(.article-topics) a {
    flex: none;
    scroll-snap-align: start;
  }
  /* Logos anchos (Palena): la cabecera nunca empuja el botón Menú fuera de la pantalla. */
  .header-main {
    gap: 10px;
  }
  .brand {
    min-width: 0;
    flex: 1 1 auto;
  }
  .brand img {
    max-width: 84px;
    height: 44px;
  }
  .brand strong {
    font-size: 22px;
  }
}

/* ==========================================================================
   CMS-034 · Departamentos / Unidades municipales (Listado 1, Ficha, Organigrama 1)
   Color de cada unidad: --c desde la franja cívica (clases civic-N).
   ========================================================================== */
.dept-page { padding-block: 24px 56px; }
.dept-title {
  margin: 8px 0 6px;
  font-family: var(--display);
  font-size: clamp(32px, 4.2vw, 48px);
  font-weight: 800;
  line-height: 1.05;
  text-wrap: balance;
}
.dept-lead { margin: 0 0 18px; max-width: 68ch; color: #3e5257; font-size: 19px; text-wrap: pretty; }
.dept-lead a { font-weight: 700; }
.dept-tools {
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: 14px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 18px;
}
.dept-search {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 52px;
  padding: 0 6px 0 14px;
  border: 2px solid var(--ink);
  border-radius: 12px;
}
.dept-search input {
  flex: 1;
  min-width: 0;
  border: 0;
  outline: 0;
  background: transparent;
  font: inherit;
  font-size: 17px;
  color: var(--ink);
}
.dept-search:focus-within { outline: 3px solid var(--focus); outline-offset: 2px; }
.dept-search button {
  min-height: 40px;
  padding: 0 16px;
  border: 0;
  border-radius: 9px;
  background: var(--deep);
  color: #fff;
  font: inherit;
  font-weight: 700;
  cursor: pointer;
}
.dept-chips { display: flex; flex-wrap: wrap; gap: 8px; }
.dept-chips a {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 40px;
  padding: 0 14px;
  border: 1.5px solid var(--line);
  border-radius: 999px;
  background: #fff;
  color: var(--ink);
  font-weight: 600;
  font-size: 15px;
  text-decoration: none;
}
.dept-chips a i { width: 10px; height: 10px; border-radius: 3px; background: var(--c, var(--site)); }
.dept-chips a span { color: var(--muted); font-weight: 500; }
.dept-chips a[aria-current="page"] {
  border-color: var(--c, var(--deep));
  background: color-mix(in oklab, var(--c, var(--site)) 16%, white);
}
.dept-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 340px;
  gap: 28px;
  margin-top: 22px;
  align-items: start;
}
.dept-layout.org-full { grid-template-columns: minmax(0, 1fr); }
.dept-count { margin: 0 0 12px; font-size: 14px; color: var(--muted); }
.dept-empty {
  padding: 28px;
  text-align: center;
  color: #3e5257;
  background: #fff;
  border: 1px dashed #c9d2cf;
  border-radius: 16px;
}
.dept-cards {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 330px), 1fr));
  gap: 16px;
  margin: 0;
  padding: 0;
  list-style: none;
}
.dept-card {
  display: flex;
  flex-direction: column;
  height: 100%;
  overflow: hidden;
  background: #fff;
  border: 1px solid var(--line);
  border-top: 6px solid var(--c, var(--site));
  border-radius: 18px;
  transition: box-shadow 0.2s, transform 0.2s;
}
.dept-card:hover { box-shadow: 0 14px 30px -22px rgb(19 38 43 / 0.55); }
.dept-card-head { display: flex; gap: 14px; align-items: flex-start; padding: 18px 20px 10px; }
.dept-card-head > div { min-width: 0; }
.dept-avatar {
  flex: none;
  width: 72px;
  height: 72px;
  border-radius: 50%;
  object-fit: cover;
  border: 3px solid color-mix(in oklab, var(--c, var(--site)) 30%, white);
  background: color-mix(in oklab, var(--c, var(--site)) 25%, white);
}
.dept-initials {
  display: grid;
  place-items: center;
  font-weight: 800;
  font-size: 22px;
  color: var(--ink);
}
.dept-area {
  display: inline-block;
  padding: 2px 10px;
  border-radius: 999px;
  background: color-mix(in oklab, var(--c, var(--site)) 22%, white);
  font-size: 12px;
  font-weight: 700;
}
.dept-card h2 {
  margin: 6px 0 2px;
  font-family: var(--display);
  font-size: 20px;
  font-weight: 700;
  line-height: 1.15;
}
.dept-card h2 a { color: inherit; text-decoration: none; }
.dept-card h2 a:hover { text-decoration: underline; }
.dept-sigla { color: var(--muted); font-weight: 600; }
.dept-head { display: block; color: var(--deep); }
.dept-role { display: block; font-size: 14px; color: var(--muted); }
.dept-summary { margin: 0; padding: 0 20px; color: #2e4147; font-size: 15px; }
.dept-contacts { display: flex; flex-wrap: wrap; gap: 6px 16px; padding: 12px 20px 0; font-weight: 600; font-size: 15px; }
.dept-contacts a { display: inline-flex; align-items: center; gap: 6px; color: var(--link); }
.dept-contacts .icon { width: 16px; height: 16px; }
.dept-mail { overflow-wrap: anywhere; }
.dept-pills { display: flex; flex-wrap: wrap; gap: 8px; padding: 12px 20px 0; }
.dept-pills a {
  padding: 5px 12px;
  border: 1.5px solid var(--c, var(--site));
  border-radius: 999px;
  color: var(--ink);
  font-size: 14px;
  font-weight: 600;
  text-decoration: none;
}
.dept-card-more {
  display: flex;
  justify-content: space-between;
  margin-top: auto;
  padding: 12px 20px;
  border-top: 1px solid #eef1f0;
  color: var(--link);
  font-weight: 700;
  text-decoration: none;
}
.dept-card > :nth-last-child(2) { margin-bottom: 16px; }
.dept-side { display: flex; flex-direction: column; gap: 16px; }
.dept-side-card {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 18px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 18px;
  color: var(--ink);
  text-decoration: none;
}
.dept-side-card h2 { margin: 0; font-family: var(--display); font-size: 19px; font-weight: 700; }
.dept-side-card p { margin: 0; font-size: 15px; color: #2e4147; }
.dept-help {
  background: color-mix(in oklab, var(--civic-2, var(--site)) 10%, white);
  border: 2px solid var(--civic-2, var(--site));
}
.dept-help .contact-lines p { margin: 6px 0 0; font-size: 15px; }
.dept-more { font-weight: 700; color: var(--link); }
.dept-side-links { margin: 0; padding: 0; list-style: none; }
.dept-side-links a {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 0;
  border-top: 1px solid #eef1f0;
  color: var(--ink);
  font-weight: 600;
  text-decoration: none;
}
.dept-side-links a > span:last-child { margin-left: auto; color: var(--muted); }
.dept-side-links a i { flex: none; width: 10px; height: 10px; border-radius: 3px; background: var(--c, var(--site)); }
.dept-org-teaser strong { font-family: var(--display); font-size: 20px; }
.dept-org-teaser > span:not(.dept-org-mini):not(.dept-more) { font-size: 15px; color: #3e5257; }
.dept-org-mini {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  padding: 14px;
  background: #f4f6f5;
  border-radius: 12px;
}
.dept-org-mini > i { width: 70px; height: 22px; border-radius: 6px; background: var(--deep); }
.dept-org-mini > b { width: 80%; height: 2px; background: #c9d2cf; }
.dept-org-mini > span { display: flex; gap: 6px; }
.dept-org-mini > span i { width: 30px; height: 18px; border-radius: 5px; background: var(--c, var(--site)); }
.dept-org-teaser:hover { border-color: var(--deep); }

/* Ficha */
.dept-sheet { overflow: hidden; background: #fff; border: 1px solid var(--line); border-radius: 22px; }
.dept-sheet-band { height: 8px; background: var(--c, var(--site)); }
.dept-sheet-body { padding: 26px 36px 36px; }
.dept-sheet-body .dept-area { margin-top: 12px; font-size: 13px; }
.dept-sigla-big { margin: 0; font-family: var(--display); font-size: 22px; font-weight: 700; color: var(--muted); }
.dept-sheet h2 { margin: 30px 0 10px; font-family: var(--display); font-size: 24px; font-weight: 700; }
.dept-sheet h2 small { font-family: inherit; font-size: 16px; font-weight: 500; color: var(--muted); }
.dept-boss {
  display: flex;
  align-items: center;
  gap: 18px;
  margin-top: 22px;
  padding: 16px;
  border-radius: 18px;
  background: color-mix(in oklab, var(--c, var(--site)) 12%, white);
}
.dept-boss .dept-avatar { width: 120px; height: 120px; border: 4px solid #fff; font-size: 30px; }
.dept-boss strong { display: block; font-family: var(--display); font-size: 24px; line-height: 1.15; }
.dept-kicker { font-size: 13px; font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase; color: var(--muted); }
.dept-functions,
.dept-tramites,
.dept-team,
.dept-docs { display: grid; gap: 10px; margin: 0; padding: 0; list-style: none; }
.dept-functions { grid-template-columns: repeat(auto-fill, minmax(min(100%, 280px), 1fr)); }
.dept-functions li {
  display: flex;
  gap: 10px;
  padding: 12px 14px;
  border-radius: 12px;
  background: var(--paper);
}
.dept-functions li::before {
  content: "";
  flex: none;
  width: 10px;
  height: 10px;
  margin-top: 7px;
  border-radius: 3px;
  background: var(--c, var(--site));
}
.dept-tramites { grid-template-columns: repeat(auto-fill, minmax(min(100%, 220px), 1fr)); gap: 12px; }
.dept-tramites a {
  display: flex;
  flex-direction: column;
  gap: 4px;
  height: 100%;
  padding: 14px 16px;
  border: 2px solid var(--c, var(--site));
  border-radius: 16px;
  color: var(--ink);
  text-decoration: none;
}
.dept-tramites strong { font-size: 17px; }
.dept-tramites span { font-size: 14px; color: #3e5257; }
.dept-tramites em { margin-top: 4px; font-style: normal; font-size: 14px; font-weight: 700; color: var(--link); }
.dept-team { grid-template-columns: repeat(auto-fill, minmax(min(100%, 240px), 1fr)); gap: 12px; }
.dept-team li {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px;
  border: 1px solid #eef1f0;
  border-radius: 14px;
  line-height: 1.3;
}
.dept-team .dept-avatar { width: 52px; height: 52px; font-size: 16px; border-width: 0; }
.dept-team strong { display: block; }
.dept-team span span { font-size: 14px; color: var(--muted); }
.dept-internal { display: flex; flex-wrap: wrap; gap: 8px; }
.dept-internal > * {
  padding: 6px 14px;
  border-radius: 999px;
  background: color-mix(in oklab, var(--c, var(--site)) 20%, white);
  color: var(--ink);
  font-size: 15px;
  font-weight: 600;
}
.dept-docs { grid-template-columns: repeat(auto-fill, minmax(min(100%, 280px), 1fr)); gap: 12px; }
.dept-docs a {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 16px;
  color: var(--ink);
  text-decoration: none;
}
.dept-doc-sheet {
  display: grid;
  place-items: center;
  flex: none;
  width: 74px;
  height: 92px;
  overflow: hidden;
  border-radius: 10px;
  background: color-mix(in oklab, var(--c, var(--site)) 22%, white);
}
.dept-doc-sheet img { width: 84%; height: 90%; object-fit: cover; object-position: top; rotate: -3deg; box-shadow: 0 4px 10px rgb(19 38 43 / 0.2); }
.dept-docs strong { display: block; }
.dept-docs a > span:last-child span { font-size: 14px; color: var(--muted); }
.dept-contact { border: 2px solid var(--c, var(--site)); }
.dept-contact .button { display: flex; justify-content: center; align-items: center; gap: 8px; min-height: 48px; }
.dept-contact .button-ghost { background: #fff; color: var(--deep); border: 2px solid var(--deep); }
.dept-path { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; }
.dept-path a { padding: 6px 12px; border-radius: 10px; background: #eef3f2; color: var(--ink); font-weight: 600; text-decoration: none; }
.dept-path b { padding: 6px 12px; border-radius: 10px; background: var(--c, var(--site)); color: #fff; }

/* Organigrama 1: árbol desde los datos del CMS. */
.org-heading { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 12px; }
.org-legend { display: flex; flex-wrap: wrap; gap: 6px 14px; margin: 0 0 18px; padding: 0; list-style: none; font-size: 14px; }
.org-legend li { display: inline-flex; align-items: center; gap: 6px; }
.org-legend i { width: 12px; height: 12px; border-radius: 4px; background: var(--c, var(--site)); }
.org-tree {
  --line-c: #c9d2cf;
  padding: 26px 24px 30px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 22px;
}
.org-top { display: grid; grid-template-columns: minmax(0, 1fr) minmax(240px, 300px) minmax(0, 1fr); align-items: center; }
.org-box {
  display: block;
  overflow: hidden;
  background: #fff;
  border: 2px solid var(--line);
  border-radius: 16px;
  color: var(--ink);
  text-decoration: none;
  transition: box-shadow 0.2s, border-color 0.2s;
}
.org-box:hover,
.org-box[aria-current="true"] { border-color: var(--ink); box-shadow: 0 12px 24px -14px rgb(19 38 43 / 0.55); }
.org-band { display: block; height: 6px; background: var(--c, var(--site)); }
.org-box-main { display: flex; align-items: center; gap: 10px; padding: 10px 12px; line-height: 1.2; }
.org-box-main > span:last-child { min-width: 0; }
.org-box-main strong { display: block; font-size: 15px; }
.org-box-main span span { font-size: 13px; color: var(--muted); }
.org-box .dept-avatar { width: 40px; height: 40px; font-size: 14px; border-width: 0; }
.org-root { border-color: var(--c, var(--site)); background: color-mix(in oklab, var(--site) 8%, white); }
.org-root .org-band { display: none; }
.org-root .org-box-main { padding: 14px 16px; }
.org-root strong { font-family: var(--display); font-size: 20px; }
.org-root .dept-avatar { width: 60px; height: 60px; }
.org-advisory { display: flex; flex-direction: column; gap: 8px; margin: 0; padding: 0; list-style: none; }
.org-advisory li { display: flex; align-items: center; }
.org-advisory li::before { content: ""; width: 40px; border-top: 2px dashed #9aa5a8; }
.org-advice { max-width: 260px; border-style: dashed; border-color: #9aa5a8; }
.org-advice .org-band { display: none; }
.org-advice .org-box-main { padding: 8px 12px; }
.org-row { position: relative; }
.org-row::before { content: ""; display: block; width: 2px; height: 26px; margin: 0 auto; background: var(--line-c); }
.org-row ul {
  position: relative;
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: minmax(0, 1fr);
  gap: 14px;
  margin: 0;
  padding: 0;
  list-style: none;
}
/* Línea horizontal entre el centro de la primera y la última caja. */
.org-row ul::before {
  content: "";
  position: absolute;
  top: 0;
  left: calc(50% / var(--n, 1));
  right: calc(50% / var(--n, 1));
  height: 2px;
  background: var(--line-c);
}
.org-row[data-count="1"] ul { --n: 1; }
.org-row[data-count="2"] ul { --n: 2; }
.org-row[data-count="3"] ul { --n: 3; }
.org-row[data-count="4"] ul { --n: 4; }
.org-row[data-count="5"] ul { --n: 5; }
.org-row[data-count="6"] ul { --n: 6; }
.org-row[data-count="7"] ul { --n: 7; }
.org-row[data-count="8"] ul { --n: 8; }
.org-row li { display: flex; flex-direction: column; }
.org-row li::before { content: ""; width: 2px; height: 18px; margin: 0 auto; background: var(--line-c); }
.org-row-more::after { content: ""; position: absolute; left: calc(50% - 1px); top: 26px; bottom: 0; width: 2px; background: var(--line-c); z-index: 0; }
.org-row li > * { position: relative; z-index: 1; }
.org-sub { display: flex; flex-wrap: wrap; gap: 4px; padding: 8px 2px 0; }
.org-sub > * { padding: 2px 8px; border-radius: 999px; font-size: 12px; }
.org-sub a { border: 1.5px solid var(--c, var(--site)); background: #fff; color: var(--ink); font-weight: 700; text-decoration: none; }
.org-sub span { background: #eef3f2; }
.org-sub em { font-style: normal; font-weight: 700; color: var(--muted); }
.org-official { margin-top: 24px; }
.org-official summary { cursor: pointer; font-weight: 700; color: var(--link); }
.org-official img { margin-top: 12px; width: 100%; height: auto; border-radius: 12px; }
.org-side { position: sticky; top: 16px; }
.org-panel { border-top: 8px solid var(--c, var(--site)); }
.org-panel-top { display: flex; justify-content: space-between; align-items: center; }
.org-panel h2 { font-size: 24px; font-weight: 800; line-height: 1.1; }
.org-panel .dept-card-head { padding: 0; }
.org-panel .dept-avatar { width: 64px; height: 64px; }
.org-panel .dept-contacts { padding: 0; }
.org-panel .button { display: flex; justify-content: center; min-height: 46px; align-items: center; }
.org-close {
  display: grid;
  place-items: center;
  width: 40px;
  height: 40px;
  border: 1px solid var(--line);
  border-radius: 10px;
  color: var(--ink);
  font-size: 20px;
  text-decoration: none;
}

@media (max-width: 1000px) {
  .dept-layout { grid-template-columns: minmax(0, 1fr); }
  .org-side { position: static; }
}
@media (max-width: 760px) {
  .dept-sheet-body { padding: 18px 16px 24px; }
  .dept-boss .dept-avatar { width: 84px; height: 84px; }
  .dept-chips { flex-wrap: nowrap; overflow-x: auto; padding-bottom: 4px; }
  .dept-chips a { flex: none; }
  /* Árbol vertical en celular. */
  .org-tree { padding: 14px 12px; }
  .org-top { display: block; }
  .org-top > span:first-child { display: none; }
  .org-advisory { margin: 10px 0 0 22px; padding-left: 16px; border-left: 2px dashed #9aa5a8; }
  .org-advisory li::before { display: none; }
  .org-advice { max-width: none; width: 100%; }
  .org-row::before,
  .org-row ul::before,
  .org-row li::before,
  .org-row-more::after { display: none; }
  .org-row ul {
    grid-auto-flow: row;
    gap: 10px;
    margin: 6px 0 0 22px;
    padding: 8px 0 0 16px;
    border-left: 2px solid var(--line-c);
  }
  .org-row li { position: relative; }
  .org-row li > .org-box { box-shadow: inset 6px 0 0 var(--c, var(--site)); }
  .org-row li .org-band { display: none; }
}
@media (prefers-reduced-motion: reduce) {
  .dept-card,
  .org-box { transition: none; }
}
.dept-help-lines { display: flex; flex-direction: column; gap: 4px; }
.dept-help-lines a { display: inline-flex; align-items: center; gap: 6px; font-weight: 700; color: var(--link); }
.dept-help-lines .icon { width: 16px; height: 16px; }
.dept-help-lines p { margin-top: 6px; font-size: 14px; color: #3e5257; }
.org-row[data-count="1"] ul, .org-row:not([data-count]) ul { --n: 1; }
.dept-search > .icon { flex: none; width: 20px; height: 20px; }
/* Resúmenes largos importados: cuatro líneas en la tarjeta; el texto completo va en la ficha. */
.dept-summary {
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 4;
  line-clamp: 4;
  overflow: hidden;
}
/* Ajustes de Lumen (Departamentos) */
.dept-intro details { margin: -8px 0 6px; }
.dept-intro summary { cursor: pointer; font-weight: 700; color: var(--link); min-height: 44px; display: flex; align-items: center; }
.dept-intro details p { margin: 8px 0 0; color: #2e4147; max-width: 72ch; }
.dept-quick { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 18px; margin-top: 14px; }
.dept-quick .dept-contacts { padding: 0; }
.dept-quick > span { font-size: 15px; color: #3e5257; }
.dept-path b { background: color-mix(in oklab, var(--c, var(--site)) 30%, white); color: var(--ink); }
.org-top { position: relative; }
.org-top::after {
  content: "";
  position: absolute;
  left: calc(50% - 1px);
  top: 50%;
  bottom: 0;
  width: 2px;
  background: var(--line-c);
}
.org-top > * { position: relative; z-index: 1; }
@media (max-width: 760px) {
  .org-top::after { display: none; }
  .dept-chips { flex-wrap: wrap; overflow: visible; }
}

/* CMS-050 · Destacados: el grande a la izquierda y el resto en una fila que se
   desliza hacia el lado (scroll-snap nativo), sin «Ver N más» hacia abajo.
   Con más de cuatro se asoma la columna siguiente para que se note que hay más. */
.capsule-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 16px;
}
.capsule-layout.capsule-solo {
  grid-template-columns: minmax(0, 1fr);
}
.capsule-layout > .capsule-big .capsule {
  height: 100%;
}
.capsules .capsule-track {
  grid-template-columns: none;
  grid-auto-flow: column;
  grid-template-rows: repeat(2, minmax(172px, 1fr));
  grid-auto-columns: calc((100% - 16px) / 2);
  overflow-x: auto;
  overscroll-behavior-x: contain;
  scroll-snap-type: x mandatory;
  scrollbar-width: thin;
  scrollbar-color: color-mix(in srgb, var(--site) 45%, transparent) transparent;
  /* Aire para la sombra al pasar el mouse, que el desplazamiento recortaría. */
  padding: 6px 4px 12px;
  margin: -6px -4px 0;
}
.capsules .capsule-track.capsule-track-more {
  grid-auto-columns: calc((100% - 32px) / 2.2);
}
.capsules .capsule-track > li {
  grid-column: auto;
  min-width: 0;
  scroll-snap-align: start;
}
.capsule-track:focus-visible {
  outline: 3px solid var(--site);
  outline-offset: 2px;
  border-radius: 20px;
}
.capsules .section-heading {
  align-items: center;
}
.capsule-nav {
  display: flex;
  gap: 8px;
  margin-left: auto;
}
.capsule-nav[hidden] {
  display: none;
}
.capsule-arrow {
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  padding: 0;
  border: 2px solid var(--site);
  border-radius: 999px;
  background: #fff;
  color: var(--site);
  cursor: pointer;
}
.capsule-arrow .icon {
  width: 20px;
  height: 20px;
  transform: rotate(-90deg);
}
.capsule-arrow[data-dir="-1"] .icon {
  transform: rotate(90deg);
}
.capsule-arrow:disabled {
  opacity: 0.35;
  cursor: default;
}
.capsule-arrow:focus-visible {
  outline: 3px solid var(--site);
  outline-offset: 2px;
}
@media (hover: hover) {
  .capsule-arrow:not(:disabled):hover {
    background: var(--site);
    color: #fff;
  }
}
@media (max-width: 900px) {
  .capsule-layout {
    grid-template-columns: minmax(0, 1fr);
  }
  .capsules .capsule-track,
  .capsules .capsule-track.capsule-track-more {
    grid-template-rows: minmax(160px, auto);
    grid-auto-columns: calc((100% - 32px) / 2.3);
  }
}
@media (max-width: 640px) {
  .capsules .capsule-track,
  .capsules .capsule-track.capsule-track-more {
    grid-auto-columns: 72%;
  }
}
@media (prefers-reduced-motion: reduce) {
  .capsule-track {
    scroll-behavior: auto;
  }
}

/* CMS-050 · Menús siempre encima. Las tarjetas de «Necesito…», Destacados y
   noticias tienen transform (aparición y «lift»), que crea capas propias más
   abajo en el documento: el desplegable «Municipio» quedaba debajo de ellas.
   La cabecera es su propia capa sobre el contenido y sobre el aviso flotante
   del evento (z 45): un menú abierto nunca queda tapado. */
.site-header {
  position: relative;
  z-index: 60;
}

/* CMS-050 · Destacados: desvanecido sutil en el borde donde hay más (no un corte).
   destacados.js marca data-mas-izquierda / data-mas-derecha según el desplazamiento;
   sin JavaScript, la fila con más de cuatro lo trae a la derecha. */
@property --fade-izq {
  syntax: "<length>";
  inherits: false;
  initial-value: 0px;
}
@property --fade-der {
  syntax: "<length>";
  inherits: false;
  initial-value: 0px;
}
.capsules .capsule-track {
  --fade-izq: 0px;
  --fade-der: 0px;
  -webkit-mask-image: linear-gradient(to right, transparent, #000 var(--fade-izq), #000 calc(100% - var(--fade-der)), transparent);
  mask-image: linear-gradient(to right, transparent, #000 var(--fade-izq), #000 calc(100% - var(--fade-der)), transparent);
  transition: --fade-izq 0.25s ease, --fade-der 0.25s ease;
}
.capsules .capsule-track.capsule-track-more,
.capsules .capsule-track[data-mas-derecha] {
  --fade-der: 28px;
}
.capsules .capsule-track[data-mas-derecha="no"] {
  --fade-der: 0px;
}
.capsules .capsule-track[data-mas-izquierda] {
  --fade-izq: 28px;
}
@media (prefers-reduced-motion: reduce) {
  .capsules .capsule-track {
    transition: none;
  }
}

/* CMS-050 r3: crédito discreto en el pie. */
.footer-credit {
  opacity: 0.75;
}
.footer-credit a {
  color: inherit;
}

/* ── CMS-050 r3 · Inicio B (lienzo «Inicio B», elegido para Palena) ───────────
   Colores de la franja del sitio (civic-N → --c); fondo tenue y borde fuerte
   para que el texto siempre se lea (Palena tiene verdes oscuros y negro). */
.quickbar {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
}
.quickbar-item {
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: 76px;
  padding: 12px 20px;
  box-sizing: border-box;
  background: color-mix(in oklab, var(--c) 22%, white);
  border-bottom: 4px solid var(--c);
  color: #0e1e22;
  text-decoration: none;
  transition: background-color 0.15s ease;
}
.quickbar-item:hover {
  background: color-mix(in oklab, var(--c) 34%, white);
}
.quickbar-icon {
  flex-shrink: 0;
  display: grid;
  place-items: center;
  width: 40px;
  height: 40px;
  border-radius: 12px;
  background: #fff;
  color: var(--c);
}
.quickbar-icon .icon {
  width: 22px;
  height: 22px;
}
.quickbar-text {
  display: flex;
  flex-direction: column;
  line-height: 1.15;
}
.quickbar-text strong {
  font-size: 16px;
  font-weight: 800;
}
.quickbar-text span {
  font-size: 13px;
  font-weight: 600;
}
.home-b .section-heading h2,
.home-b .hb-needs h2 {
  font-family: var(--display);
}
.hb-top {
  display: grid;
  grid-template-columns: repeat(12, minmax(0, 1fr));
  gap: 24px;
  padding-block: 28px 8px;
}
.hb-lead {
  grid-column: span 8;
  position: relative;
  display: block;
  min-height: 440px;
  border-radius: 22px;
  overflow: hidden;
  color: var(--ink, #13262b);
  text-decoration: none;
  background: var(--card);
}
.hb-top-full .hb-lead {
  grid-column: 1 / -1;
  min-height: 460px;
}
.hb-lead > img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  max-width: none;
  object-fit: cover;
}
.hb-lead-card {
  position: absolute;
  left: 24px;
  bottom: 24px;
  right: 160px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 20px 22px;
  background: #fff;
  border-radius: 16px;
  border-top: 6px solid var(--c);
}
.hb-lead-card time {
  font-size: 13px;
  font-weight: 700;
  color: #51656a;
  text-transform: uppercase;
}
.hb-lead-card strong {
  font-family: var(--display);
  font-size: clamp(22px, 2.2vw, 30px);
  font-weight: 800;
  line-height: 1.1;
  text-wrap: balance;
}
.hb-lead-card .news-summary {
  color: #3e5257;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.hb-side-news {
  grid-column: span 4;
  display: flex;
  flex-direction: column;
}
.hb-news-stack,
.hb-news-row {
  list-style: none;
  margin: 0;
  padding: 0;
}
.hb-news-stack {
  display: flex;
  flex-direction: column;
  gap: 14px;
}
.hb-news {
  display: flex;
  flex-direction: column;
  gap: 10px;
  color: var(--ink, #13262b);
  text-decoration: none;
}
.hb-news img {
  display: block;
  width: 100%;
  height: 190px;
  object-fit: cover;
  border-radius: 16px;
  background: #eef3f2;
}
.hb-news-stack .hb-news {
  display: grid;
  grid-template-columns: 128px minmax(0, 1fr);
  align-items: start;
  gap: 14px;
  padding: 10px;
  border-radius: 16px;
  background: var(--card);
}
.hb-news-stack .hb-news img {
  height: 96px;
  border-radius: 12px;
}
.hb-news-body {
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.hb-news-body time {
  font-size: 13px;
  font-weight: 700;
  color: color-mix(in oklab, var(--c) 70%, black);
}
.hb-news-body strong {
  font-family: var(--display);
  font-size: 18px;
  font-weight: 700;
  line-height: 1.25;
}
.hb-news-row {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 20px;
}
.hb-more,
.hb-needs,
.hb-hoy {
  padding-block: 28px 8px;
}
.hb-needs h2 {
  margin: 0 0 14px;
}
.hb-pills {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
}
.hb-pill {
  display: flex;
  align-items: center;
  gap: 14px;
  min-height: 72px;
  height: 100%;
  box-sizing: border-box;
  padding: 12px 18px 12px 12px;
  background: #fff;
  border: 2px solid var(--c);
  border-radius: 999px;
  color: var(--ink, #13262b);
  text-decoration: none;
}
.hb-pill-icon {
  flex-shrink: 0;
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  border-radius: 999px;
  background: color-mix(in oklab, var(--c) 20%, white);
}
.hb-pill-icon .icon {
  width: 22px;
  height: 22px;
}
.hb-pill-label {
  flex-grow: 1;
  font-weight: 700;
  line-height: 1.2;
}
.hb-pill-all {
  grid-column: span 2;
}
.hb-pill-dark {
  justify-content: space-between;
  padding-inline: 24px;
  background: var(--theme-deep, var(--deep, #13262b));
  border-color: transparent;
  color: #fff;
}
.hb-hoy-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
  align-items: start;
}
.hb-library {
  margin-top: 36px;
  padding-block: 36px 44px;
  background: color-mix(in oklab, var(--theme-paper, #f5f3ee) 70%, white);
}
.hb-books {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 20px;
}
.hb-book {
  display: flex;
  flex-direction: column;
  gap: 8px;
  color: var(--ink, #13262b);
  text-decoration: none;
}
.hb-book-cover {
  position: relative;
  display: block;
  aspect-ratio: 3 / 4;
  overflow: hidden;
  border-radius: 6px 14px 14px 6px;
  border-left: 8px solid var(--c);
  background: #fff;
  box-shadow: 0 10px 24px -12px rgb(19 38 43 / 0.5);
}
.hb-book-cover img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: top;
}
.hb-book-title {
  display: block;
  padding: 22px 18px;
  font-family: var(--display);
  font-size: 18px;
  font-weight: 800;
  line-height: 1.15;
}
.hb-book-kind {
  position: absolute;
  right: 10px;
  bottom: 10px;
  padding: 3px 8px;
  border-radius: 6px;
  background: #13262b;
  color: #fff;
  font-size: 12px;
  font-weight: 800;
}
.hb-book strong {
  line-height: 1.25;
}
.hb-book small {
  color: #51656a;
}
@media (max-width: 1100px) {
  .quickbar {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
  .hb-pills {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .hb-books {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}
@media (max-width: 900px) {
  .hb-top {
    grid-template-columns: minmax(0, 1fr);
  }
  .hb-lead,
  .hb-side-news {
    grid-column: 1 / -1;
  }
  .hb-hoy-grid {
    grid-template-columns: minmax(0, 1fr);
  }
  .hb-news-row {
    grid-template-columns: minmax(0, 1fr);
  }
}
@media (max-width: 640px) {
  .quickbar-item {
    flex-direction: column;
    align-items: flex-start;
    gap: 4px;
    min-height: 84px;
    padding: 10px;
  }
  .quickbar-icon {
    width: 32px;
    height: 32px;
    border-radius: 10px;
  }
  .quickbar-text strong {
    font-size: 14px;
  }
  .quickbar-text span {
    display: none;
  }
  .hb-top {
    padding-top: 16px;
  }
  .hb-lead,
  .hb-top-full .hb-lead {
    min-height: 320px;
  }
  .hb-lead-card {
    left: 12px;
    right: 12px;
    bottom: 12px;
    padding: 12px 14px;
  }
  .hb-lead-card .news-summary {
    display: none;
  }
  .hb-pills {
    grid-template-columns: minmax(0, 1fr);
  }
  .hb-pill {
    min-height: 56px;
  }
  .hb-pill-all {
    grid-column: auto;
  }
  .hb-books {
    display: flex;
    gap: 14px;
    overflow-x: auto;
    scroll-snap-type: x mandatory;
    padding-bottom: 8px;
  }
  .hb-books > li {
    flex: 0 0 140px;
    scroll-snap-align: start;
  }
}
@media (prefers-reduced-motion: reduce) {
  .quickbar-item {
    transition: none;
  }
}
/* Íconos de las píldoras con tamaño fijo (la flecha crecía con la píldora). */
.hb-pill > .icon,
.hb-pill .external .icon {
  flex-shrink: 0;
  width: 18px;
  height: 18px;
}
.hb-pill-dark > .icon {
  width: 22px;
  height: 22px;
}
/* «Más noticias»: se reparte con las que haya (1 a 3). */
.hb-news-row {
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 280px), 1fr));
}

/* ── CMS-050 r4 · Franja de accesos: dos ubicaciones para elegir ─────────────
   Arriba (a): banda verde profunda a lo ancho; los seis accesos se alinean
   con el contenido (.wrap) y su borde inferior ES la barra de colores del
   sitio (la barra de la cabecera se oculta para que no haya dos con cortes
   distintos). Abajo (b): bloque «Accesos directos» dentro de la página. */
.quickbar {
  display: block;
}
.quickbar-grid {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
}
.quickbar-arriba {
  background: var(--theme-deep, var(--deep, #13262b));
}
.quickbar-arriba .quickbar-item {
  min-height: 68px;
  padding: 10px 14px;
  background: transparent;
  border-bottom: 6px solid var(--c);
  color: #fff;
}
.quickbar-arriba .quickbar-item:hover {
  background: rgb(255 255 255 / 0.08);
}
.quickbar-arriba .quickbar-item + .quickbar-item {
  border-left: 1px solid rgb(255 255 255 / 0.14);
}
.quickbar-arriba .quickbar-icon {
  background: rgb(255 255 255 / 0.12);
  color: #fff;
}
.quickbar-arriba .quickbar-text span {
  color: rgb(255 255 255 / 0.82);
}
body:has(.quickbar-arriba) .site-header > .civic-bar {
  display: none;
}
.quickbar-abajo {
  padding-block: 28px 8px;
}
.quickbar-abajo h2 {
  margin: 0 0 14px;
  font-family: var(--display);
}
.quickbar-abajo .quickbar-grid {
  gap: 12px;
}
.quickbar-abajo .quickbar-item {
  border-radius: 16px;
  border-bottom: 0;
  border-top: 5px solid var(--c);
  background: #fff;
  box-shadow: 0 1px 2px rgb(16 39 46 / 0.06);
}
.quickbar-abajo .quickbar-icon {
  background: color-mix(in oklab, var(--c) 18%, white);
  color: color-mix(in oklab, var(--c) 80%, black);
}
/* Noticia grande con «hoy» al lado (lienzo B). */
.hb-aside {
  grid-column: span 4;
  display: flex;
  flex-direction: column;
  gap: 16px;
}
.hb-lead-empty {
  grid-column: span 8;
}
.hb-more {
  padding-top: 20px;
}
/* Temas con noticias, para explorar. */
.hb-topics {
  padding-block: 32px 8px;
}
.hb-topic-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
}
.hb-topic {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-height: 72px;
  justify-content: center;
  padding: 12px 18px;
  border-radius: 16px;
  border-left: 6px solid var(--c);
  background: #fff;
  color: var(--ink, #13262b);
  text-decoration: none;
}
.hb-topic strong {
  font-family: var(--display);
  font-size: 18px;
}
.hb-topic span {
  font-size: 14px;
  color: #51656a;
}
@media (max-width: 1100px) {
  .quickbar-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
  .hb-topic-list {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}
@media (max-width: 900px) {
  .hb-aside,
  .hb-lead-empty {
    grid-column: 1 / -1;
  }
}
@media (max-width: 640px) {
  .quickbar-arriba .wrap {
    width: 100%;
  }
  .quickbar-arriba .quickbar-item + .quickbar-item {
    border-left: 0;
  }
  .quickbar-abajo .quickbar-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .hb-topic-list {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
  }
  .hb-topic {
    min-height: 60px;
    padding: 10px 12px;
  }
}
/* «hoy»: al lado de la noticia en escritorio; en celular, después de las
   demás noticias (Lumen r4). Uno de los dos siempre está oculto. */
.hb-aside-bottom {
  display: none;
}
@media (max-width: 900px) {
  .hb-aside-top {
    display: none;
  }
  .hb-aside-bottom {
    display: flex;
    padding-top: 20px;
  }
}

/* ── CMS-050 r5 · Documentos destacados en lista (Palena) ─────────────────── */
.doc-shelf {
  margin-block: 8px 40px;
  padding: clamp(18px, 3vw, 32px);
  border-radius: 22px;
  background: color-mix(in oklab, var(--theme-deep, var(--deep, #163d24)) 92%, black);
  color: #fff;
}
.doc-shelf-head {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-bottom: 18px;
}
.doc-shelf-head h2 {
  margin: 0;
  color: #fff;
  font-family: var(--display);
}
.doc-shelf-head p {
  margin: 4px 0 0;
  color: rgb(255 255 255 / 0.8);
}
.doc-shelf-icon {
  display: grid;
  place-items: center;
  width: 48px;
  height: 48px;
  border-radius: 14px;
  background: var(--theme-mark, #f2c230);
  color: var(--theme-deep, #163d24);
}
.doc-shelf-icon .icon {
  width: 24px;
  height: 24px;
}
.doc-shelf-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}
.doc-row {
  display: grid;
  grid-template-columns: 72px minmax(0, 1fr) 40px;
  align-items: center;
  gap: 16px;
  height: 100%;
  box-sizing: border-box;
  padding: 10px 14px 10px 10px;
  border-radius: 16px;
  border-left: 6px solid var(--c);
  background: #fff;
  color: var(--ink, #13262b);
  text-decoration: none;
}
.doc-row-sheet {
  display: grid;
  place-items: center;
  width: 72px;
  height: 92px;
  overflow: hidden;
  border-radius: 6px;
  background: #f3f6f1;
  box-shadow: 0 4px 12px -6px rgb(19 38 43 / 0.45);
}
.doc-row-sheet img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: top;
}
.doc-row-sheet .icon {
  width: 28px;
  height: 28px;
}
.doc-row-text {
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.doc-row-text strong {
  font-family: var(--display);
  font-size: 18px;
  line-height: 1.2;
}
.doc-row-text small {
  color: #51656a;
}
.doc-row-go {
  display: grid;
  place-items: center;
  width: 40px;
  height: 40px;
  border-radius: 999px;
  background: color-mix(in oklab, var(--c) 18%, white);
}
.doc-row-go .icon {
  width: 20px;
  height: 20px;
}
.doc-shelf-all {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 44px;
  margin-top: 18px;
  padding: 0 18px;
  border-radius: 999px;
  background: var(--theme-mark, #f2c230);
  color: #1c2b16;
  font-weight: 700;
  text-decoration: none;
}
.doc-shelf-all .icon {
  width: 18px;
  height: 18px;
}
@media (max-width: 760px) {
  .doc-shelf-list {
    grid-template-columns: minmax(0, 1fr);
  }
  .doc-row {
    grid-template-columns: 60px minmax(0, 1fr) 36px;
    gap: 12px;
  }
  .doc-row-sheet {
    width: 60px;
    height: 78px;
  }
}

/* CMS-050 r6 · «Más noticias» con fondo blanco propio (Francisco: «que se vea
   que vuelve ahí»): cada noticia es una tarjeta, destino de la vuelta. */
.hb-news-row .hb-news {
  height: 100%;
  box-sizing: border-box;
  padding: 10px 10px 14px;
  border-radius: 18px;
  background: var(--card, #fff);
  box-shadow: 0 1px 2px rgb(16 39 46 / 0.06);
}
.hb-news-row .hb-news img {
  border-radius: 12px;
}
.hb-news-row .hb-news-body {
  padding-inline: 4px;
}

/* Portada · 4 noticias (Francisco, 12-11: «¿Por qué queda el espacio vacío?»).
   La grande y tres chicas; si el sitio tiene menos noticias, la fila se reparte
   entre las que hay y nunca deja columnas vacías. En celular ya van una bajo
   otra. */
@media (min-width: 701px) {
  .news-cards:has(> li:only-child) {
    grid-template-columns: minmax(0, 1fr);
  }
  .news-cards:has(> li:nth-child(2):last-child) {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}
@media (min-width: 901px) {
  .hb-news-row:has(> :only-child) {
    grid-template-columns: minmax(0, 1fr);
  }
  .hb-news-row:has(> :nth-child(2):last-child) {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

/* CMS-064: bloque Destacado. */
.block-destacado > p {
  border: 1px dashed currentColor;
  border-radius: 12px;
  padding: 14px 16px;
  white-space: pre-line;
}

/* ── CMS-068 · Aviso de corte de la planta eléctrica (SEE) ─────────────────
   Va en el HTML del servidor, arriba de la cabecera: nunca aparece después ni
   mueve el contenido. Ámbar = corte programado; rojo = corte en curso. */
.aviso-planta {
  --ap-fondo: #fff4d6;
  --ap-borde: #d99a00;
  --ap-chip: #7a4b00;
  background: var(--ap-fondo);
  border-bottom: 3px solid var(--ap-borde);
  color: #1d2a2e;
}
.aviso-planta-curso {
  --ap-fondo: #fdecea;
  --ap-borde: #c62828;
  --ap-chip: #a4161a;
}
.aviso-planta-in {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 4px 12px;
  align-items: start;
  padding-block: 12px;
}
.aviso-planta-icono {
  display: grid;
  place-items: center;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: var(--ap-chip);
  color: #fff;
}
.aviso-planta-txt p {
  margin: 0;
  text-wrap: pretty;
}
.aviso-planta-titulo {
  font-size: 1rem;
  line-height: 1.35;
}
.aviso-planta-chip {
  display: inline-block;
  margin-right: 4px;
  padding: 1px 8px;
  border-radius: 999px;
  background: var(--ap-chip);
  color: #fff;
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  vertical-align: 0.1em;
}
.aviso-planta-texto {
  margin-top: 2px !important;
  font-size: 0.95rem;
  line-height: 1.45;
}
.aviso-planta-enlace {
  grid-column: 2;
  justify-self: start;
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  color: var(--ap-chip);
  font-weight: 700;
  text-decoration: underline;
  text-underline-offset: 3px;
}
.aviso-planta-enlace:focus-visible {
  outline: 3px solid var(--ap-chip);
  outline-offset: 2px;
  border-radius: 4px;
}
@media (min-width: 900px) {
  .aviso-planta-in {
    grid-template-columns: auto 1fr auto;
    align-items: center;
    gap: 16px;
  }
  .aviso-planta-enlace {
    grid-column: auto;
    white-space: nowrap;
  }
}
/* En curso: el ícono late suave; quieto si la persona pidió menos movimiento. */
@media (prefers-reduced-motion: no-preference) {
  .aviso-planta-curso .aviso-planta-icono {
    animation: aviso-planta-latido 2s ease-in-out infinite;
  }
}
@keyframes aviso-planta-latido {
  50% {
    box-shadow: 0 0 0 6px color-mix(in srgb, var(--ap-chip) 25%, transparent);
  }
}
@media print {
  .aviso-planta {
    display: none;
  }
}
