/* === VARIABLES GLOBALES === */
/* Aquí guardamos todos los colores y medidas que usamos en todo el sitio */
:root {
  /* Colores principales */
  --primary: #7a0f2b;        /* El rojo guinda característico */
  --primary-dark: #5e0b20;   /* Guinda más oscuro para hovers */
  --bg: #d8dee2;             /* Fondo general */
  --text: #1f2937;           /* Color del texto normal */
  --muted: #6b7280;          /* Texto gris/apagado */
  --card: #ffffff;           /* Fondo de las tarjetas */
  --radius: 18px;            /* Radio de bordes redondeados */
  --shadow: 0 12px 28px rgba(0,0,0,.08);  /* Sombra suave */
  
  /* Colores específicos del footer */
  --tf-bg: #7a0f2b;          
  --tf-bg-dark: #5e0b20;     
  --tf-text: #f8e9ed;        /* Texto claro para el footer */
  --tf-muted: #f0cdd6;       /* Texto secundario del footer */
}

/* === RESET Y BASE === */
/* Aseguramos que todo tenga el mismo tamaño calculado */
* {
  box-sizing: border-box;
}

/* Estilos base del documento */
html, body {
  margin: 0;
  padding: 0;
  /*font-family: Inter, system-ui, sans-serif;
  color: var(--text);
  background: linear-gradient(180deg, #f9fafb 0%, #f3f4f6 100%);*/
}

/* Contenedor principal - limita el ancho y centra todo */
/*.container {
  max-width: 1200px;
  margin: auto;
  padding: 0 16px;
}*/

/* === HEADER === */
/* La barra superior donde van los logos */
.topbar {
  background: #fff;
  border-bottom: 1px solid #eee;
}

/* Contenedor de los logos - espaciados con flexbox */
/*.brand {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 10px 0;
}

.brand .brand-logo {
  height: 48px;
  width: auto;
  display: block;
  object-fit: contain;
}*/

/* Este espaciador empuja los logos a los extremos */
/*.spacer {
  flex-grow: 1;
}
*/
/* === NAVBAR === */
/* El menú que se despliega */
/*.dropdown {
  position: absolute;
  top: 100%;
  left: 0;
  background: var(--primary);
  border-radius: 10px;
  list-style: none;
  padding: 8px;
  margin-top: 6px;
  box-shadow: var(--shadow);
  

  opacity: 0;
  transform: translateY(-10px);
  transition: opacity .25s, transform .25s;
  pointer-events: none; 
}*/


/* Links dentro del dropdown */
.dropdown-link {
  display: block;
  color: #fff;
  padding: 10px 14px;
  border-radius: 8px;
  text-decoration: none;
  font-weight: 600;
  transition: background .2s, transform .2s;
}

/* Se mueve a la derecha al hacer hover */
.dropdown-link:hover {
  background: var(--primary-dark);
  transform: translateX(6px);
}

/* === BREADCRUMB === */
/* Migajas de pan para navegación (tipo: Inicio > Quiénes somos) */
.breadcrumb {
  font-size: 14px;
  color: var(--muted);
  padding: 12px 0;
}

/* === LAYOUT PRINCIPAL === */
/* Grid de dos columnas: sidebar + contenido */
.layout {
  display: grid;
  grid-template-columns: 260px 1fr;  /* Sidebar fijo de 260px, el resto para contenido */
  gap: 22px;
  margin: 20px 0 40px;
}

.content {
  display: flex;
  flex-direction: column;
  gap: 22px;
}

/* Títulos responsivos que se adaptan al tamaño */
h2 {
  margin: 0 0 10px;
  font-size: clamp(22px, 3vw, 30px);
}

/* Tarjetas blancas con sombra */
.card {
  background: #fff;
  border: 1px solid #eee;
  border-radius: var(--radius);
  padding: 22px;
  box-shadow: var(--shadow);
}

/* Grid de 2 columnas para tarjetas */
.grid-2 {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 22px;
}

/* === NAVEGACIÓN LATERAL === */
/* El índice que está a la izquierda en "Quiénes somos" */
.fancy-nav {
  position: sticky;
  top: 84px;  /* Se queda pegado pero un poco abajo del navbar */
  align-self: start;
  background: #fff;
  border: 1px solid #eee;
  border-radius: 16px;
  padding: 14px;
  box-shadow: 0 10px 26px rgba(17,17,17,.06);
}

/* Título del índice lateral */
.side-title {
  margin: 4px 10px 10px;
  font-size: 14px;
  letter-spacing: .3px;
  text-transform: uppercase;
  color: var(--muted);
  font-weight: 800;
}

/* Contenedor de los links */
.toc {
  display: grid;
  gap: 10px;
}

/* Cada link del índice */
.toc-link {
  display: flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  font-weight: 700;
  color: #334155;
  background: #fff;
  border: 1px solid #eef0f3;
  padding: 12px 14px;
  border-radius: 12px;
  transition: transform .18s, box-shadow .18s, border-color .18s, background .18s;
  position: relative;
  isolation: isolate;
}

/* El puntito redondo antes del texto */
.toc-link::before {
  content: "";
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--primary);
  box-shadow: 0 0 0 6px rgba(122,15,43,.14);  /* Resplandor alrededor */
}

/* Efectos al pasar el mouse */
.toc-link:hover {
  transform: translateX(3px);
  border-color: var(--primary);
  box-shadow: 0 10px 22px rgba(122,15,43,.12);
  background: linear-gradient(180deg, #fff, #faf6f7);
}

/* Cuando el link está activo (la sección visible) */
.toc-link.is-active {
  background: linear-gradient(180deg, #fff, #f9ecef);
  border-color: var(--primary);
  color: #1f2937;
  box-shadow: 0 10px 22px rgba(122,15,43,.18);
}

/* === ANIMACIONES DE TEXTO === */
/* Para que los párrafos aparezcan uno tras otro */
.text-animated p,
.text-animated ul {
  opacity: 0;
  transform: translateY(14px);
  animation: fadeSlideUp .7s ease forwards;
}

/* Delays escalonados para cada elemento */
.text-animated p:nth-child(1) { animation-delay: .2s; }
.text-animated p:nth-child(2) { animation-delay: .4s; }
.text-animated ul { animation-delay: .6s; }
.text-animated p:nth-child(4) { animation-delay: .8s; }
.text-animated p:nth-child(5) { animation-delay: 1s; }

/* Animación de aparecer desde abajo */
@keyframes fadeSlideUp {
  from {
    opacity: 0;
    transform: translateY(18px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* === EFECTOS HOVER EN TARJETAS === */
/* Fondo que aparece al pasar el mouse sobre párrafos y listas */
.card p,
.card li {
  position: relative;
  background-image: linear-gradient(120deg, rgba(122,15,43,.12), rgba(122,15,43,.12));
  background-size: 0% 100%;  /* Empieza sin fondo */
  background-repeat: no-repeat;
  border-radius: 6px;
  transition: background-size .35s, transform .15s;
}

.card p:hover,
.card li:hover {
  background-size: 100% 100%;  /* El fondo crece de izquierda a derecha */
  transform: translateY(-1px);
}

/* Línea que aparece bajo los títulos */
.card h2,
.card h3 {
  position: relative;
}

.card h2::after,
.card h3::after {
  content: "";
  position: absolute;
  left: 0;
  bottom: -6px;
  height: 3px;
  width: 100%;
  background: linear-gradient(90deg, var(--primary), rgba(122,15,43,.35));
  transform: scaleX(0);  /* Empieza sin tamaño */
  transform-origin: left;
  transition: transform .25s;
  border-radius: 3px;
}

.card h2:hover::after,
.card h3:hover::after {
  transform: scaleX(1);  /* Crece de izquierda a derecha */
}

/* === LISTAS ORDENADAS === */
/* Para que las listas tengan numeritos bonitos */
.card ol {
  counter-reset: item;  /* Reinicia el contador */
  list-style: none;
  padding-left: 0;
  margin-left: 0;
}

.card ol li {
  counter-increment: item;  /* Incrementa el contador */
  margin: 14px 0;
  padding-left: 42px;
  position: relative;
  line-height: 1.6;
  transition: transform .2s;
}

/* El círculo con el número */
.card ol li::before {
  content: counter(item);
  position: absolute;
  left: 0;
  top: 0;
  background: var(--primary);
  color: #fff;
  font-weight: 700;
  width: 28px;
  height: 28px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  font-size: 15px;
  box-shadow: 0 2px 6px rgba(0,0,0,.2);
  transition: transform .25s, background .25s;
}

.card ol li:hover::before {
  transform: scale(1.1);  /* Se hace más grande */
  background: var(--primary-dark);
}

.card ol li:hover {
  transform: translateY(-2px);  /* Se levanta tantito */
}

/* === EFECTOS REVEAL AL HACER SCROLL === */
/* Para que las cosas aparezcan cuando haces scroll */
.reveal-left {
  opacity: 0;
  transform: translateX(-18px);
}

.reveal-right {
  opacity: 0;
  transform: translateX(18px);
}

.reveal-up {
  opacity: 0;
  transform: translateY(16px);
}

/* Cuando se vuelven visibles */
.reveal-left.visible,
.reveal-right.visible,
.reveal-up.visible {
  opacity: 1;
  transform: none;
  transition: .6s ease;
}

/* === CHIPS (para principios o valores) === */
/* Las cajitas donde van los principios y valores */
.chips {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 14px;
  margin-top: 10px;
}

.chip {
  --ring: rgba(122,15,43,.18);
  background: #fff;
  border: 1px solid #eee;
  border-radius: 16px;
  padding: 12px 14px;
  color: #374151;
  box-shadow: 0 6px 16px rgba(0,0,0,.04);
  position: relative;
  isolation: isolate;
  cursor: default;
  transition: transform .18s ease, box-shadow .18s ease, border-color .18s ease;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

/* El puntito decorativo */
.chip::before {
  content: "";
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--primary);
  box-shadow: 0 0 0 6px var(--ring);  /* Resplandor */
  position: absolute;
  left: 10px;
  top: 12px;
}

/* Título del chip con espacio para el puntito */
.chip b {
  padding-left: 22px;
  font-weight: 800;
}

/* Descripción del chip */
.chip small {
  padding-left: 22px;
  color: #6b7280;
}

/* Hover sobre el chip */
.chip:hover {
  transform: translateY(-2px);
  border-color: var(--primary);
  box-shadow: 0 10px 22px rgba(122,15,43,.15);
}

/* Cuando está en foco (para accesibilidad) */
.chip:focus-visible {
  outline: none;
  box-shadow: 0 0 0 3px var(--ring);
}

/* === GRIDS PARA IMÁGENES DE PRINCIPIOS Y VALORES === */
.principles-grid,
.values-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 14px;
  margin-top: 10px;
}

.principle-img,
.value-img {
  width: 100%;
  height: auto;
  border-radius: 16px;
  box-shadow: 0 6px 16px rgba(0,0,0,.04);
  transition: transform .18s ease, box-shadow .18s ease;
  cursor: default;
  display: block;
}

.principle-img:hover,
.value-img:hover {
  transform: translateY(-2px);
  box-shadow: 0 10px 22px rgba(122,15,43,.15);
}

/* === FOOTER SIMPLE === */
.footer {
  background: #fff;
  border-top: 1px solid #eee;
  padding: 16px 0;
  text-align: center;
  color: var(--muted);
}

/* Botón flotante para subir */
.to-top {
  position: fixed;
  right: 16px;
  bottom: 16px;
  background: var(--primary);
  color: #fff;
  border: 0;
  padding: 12px 14px;
  border-radius: 12px;
  font-weight: 800;
  box-shadow: var(--shadow);
  display: none;  /* Oculto por defecto */
  cursor: pointer;
}

.to-top.show {
  display: block;
}

/* === FOOTER UNIDAD DE TRANSPARENCIA === */
/* El footer grande con fondo guinda */
.transp-footer {
  color: var(--tf-text);
  background: linear-gradient(180deg, var(--tf-bg), var(--tf-bg-dark));
  position: relative;
  margin-top: 40px;
  overflow: hidden;
}

/* Onda decorativa arriba del footer */
.tf-wave {
  position: absolute;
  inset: 0 auto auto 0;
  height: 24px;
  width: 100%;
  /* Varios círculos radiales para simular ondas */
  background: 
    radial-gradient(150px 24px at 60px 24px, rgba(255,255,255,.22), transparent 60%),
    radial-gradient(150px 24px at 220px 24px, rgba(255,255,255,.12), transparent 60%),
    radial-gradient(150px 24px at 380px 24px, rgba(255,255,255,.18), transparent 60%);
  opacity: .25;
}

/* Grid de columnas del footer */
.tf-grid {
  display: grid;
  grid-template-columns: 1.3fr 1fr 1fr .9fr;
  gap: 32px;
  padding: 42px 16px 28px;
}

/* Logos del ayuntamiento */
.tf-brand .tf-logos {
  display: flex;
  align-items: center;
  gap: 18px;
  justify-content: flex-start;
  margin-bottom: 14px;
}

.tf-logo {
  height: 75px;
  width: auto;
  object-fit: contain;
  display: block;
  filter: drop-shadow(0 1px 1px rgba(0,0,0,.25));
  transition: transform .2s ease;
}

.tf-logo:hover {
  transform: scale(1.05);
}

/* Dirección y contacto */
.tf-contact {
  font-style: normal;
  line-height: 1.6;
  opacity: .95;
}

.tf-contact span {
  color: var(--tf-muted);
}

/* Títulos de las columnas con línea decorativa */
.transp-footer h4 {
  margin: 4px 0 10px;
  font-size: 16px;
  font-weight: 800;
  letter-spacing: .2px;
  color: #fff;
  position: relative;
}

/* Línea bajo los títulos */
.transp-footer h4::after {
  content: "";
  position: absolute;
  left: 0;
  bottom: -6px;
  height: 3px;
  width: 36px;
  background: linear-gradient(90deg, #fff, rgba(255,255,255,.25));
  border-radius: 2px;
}

/* Enlaces del footer */
.tf-links {
  list-style: none;
  padding: 0;
  margin: 10px 0 0;
  display: grid;
  gap: 8px;
}

.tf-links a {
  color: var(--tf-text);
  text-decoration: none;
  opacity: .92;
  padding: 2px 0;
  display: inline-block;
  position: relative;
  transition: opacity .2s, transform .2s;
}

/* Línea que crece bajo los links al hacer hover */
.tf-links a::after {
  content: "";
  position: absolute;
  left: 0;
  bottom: -2px;
  height: 2px;
  width: 100%;
  background: linear-gradient(90deg, #fff, rgba(255,255,255,.25));
  transform: scaleX(0);
  transform-origin: left;
  transition: transform .25s;
}

.tf-links a:hover {
  opacity: 1;
  transform: translateX(3px);  /* Se mueve a la derecha */
}

.tf-links a:hover::after {
  transform: scaleX(1);
}

/* Columna de sellos institucionales */
.tf-seals {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-start;
  gap: 18px;
}

.tf-main-logo {
  width: 300px;
  height: auto;
  object-fit: contain;
  display: block;
  filter: drop-shadow(0 1px 1px rgba(0,0,0,.25));
}

/* Franja inferior del footer con patrón */
.tf-bottom {
  border-top: 1px solid rgba(255,255,255,.15);
  /* Patrón de rayitas diagonales */
  background: repeating-linear-gradient(135deg, rgba(255,255,255,.06) 0 8px, transparent 8px 16px);
}

.tf-bottom-wrap {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 16px;
}

.tf-bottom small {
  opacity: .9;
}

/* Botón para subir al inicio */
.tf-top {
  background: #fff;
  color: var(--tf-bg);
  border: 0;
  border-radius: 10px;
  padding: 8px 10px;
  font-weight: 800;
  cursor: pointer;
  box-shadow: 0 6px 18px rgba(0,0,0,.15);
  transition: transform .2s, box-shadow .2s;
}

.tf-top:hover {
  transform: translateY(-2px);
  box-shadow: 0 10px 24px rgba(0,0,0,.2);
}

/* Animación cuando carga el footer */
@keyframes tfFadeUp {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
  to {
    opacity: 1;
    transform: none;
  }
}

/* Cada columna aparece con un delay */
.transp-footer .tf-col {
  animation: tfFadeUp .45s ease both;
}

.transp-footer .tf-col:nth-child(1) { animation-delay: .05s; }
.transp-footer .tf-col:nth-child(2) { animation-delay: .10s; }
.transp-footer .tf-col:nth-child(3) { animation-delay: .15s; }
.transp-footer .tf-col:nth-child(4) { animation-delay: .20s; }

/* === RESPONSIVE === */
/* Tablets y pantallas medianas */
@media (max-width: 1100px) {
  .tf-grid {
    grid-template-columns: 1fr 1fr;  /* 2 columnas en vez de 4 */
    gap: 28px;
  }
  
  .tf-seals {
    justify-items: start;
  }
}

/* Tablets pequeñas */
@media (max-width: 980px) {
  .layout {
    grid-template-columns: 1fr;  /* Todo en una columna */
  }
  
  .grid-2 {
    grid-template-columns: 1fr;
  }
  
  /* El sidebar ya no es sticky */
  .fancy-nav {
    position: static;
  }
}

/* Celulares */
@media (max-width: 640px) {
  .tf-grid {
    grid-template-columns: 1fr;  /* Una columna para todo */
    gap: 22px;
  }
  
  /* Logos más pequeños */
  .tf-logo {
    height: 36px;
  }
  
  /* Footer apilado verticalmente */
  .tf-bottom-wrap {
    flex-direction: column;
    gap: 10px;
  }
  
  /* Imágenes de principios y valores más grandes en móvil */
  .principles-grid,
  .values-grid {
    grid-template-columns: 1fr;
  }
}