/* ===== Sección Pueblo ===== */
.pueblo-section {
  position: relative;
  height: 70vh;
  background: url('../images/pueblo.png') center center / cover no-repeat fixed;
  display: flex;
  justify-content: center;
  align-items: center;
  text-align: center;
  color: white;
  overflow: hidden;
}


.pueblo-section .overlay {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.55);
  z-index: 1;
}

.pueblo-section .container {
  position: relative;
  z-index: 2;
  animation: fadeInUp 1.2s ease;
}

@keyframes fadeInUp {
  from { opacity: 0; transform: translateY(30px); }
  to { opacity: 1; transform: translateY(0); }
}

@media (max-width: 768px) {
  .pueblo-section {
    height: 50vh;
    background-attachment: scroll;
  }
  .pueblo-section h2 { font-size: 1.5rem; }
  .pueblo-section p { font-size: 1rem; }
}

/* ===== GRID DE NOTICIAS ===== */
/* ===== GRID DE NOTICIAS (ARREGLO FINAL) ===== */

.parent {
  display: grid;
  grid-template-columns: repeat(8, 1fr);
  grid-template-rows: repeat(6, 160px); /* ALTURA DEFINIDA */
  gap: 12px;
  margin-top: 30px;
}


/* =======================
   ARREGLO SUPERPOSICIÓN
   ======================= */
@media (max-width: 768px) {
  .parent {
    display: grid;
    grid-template-columns: 1fr !important;
    grid-auto-rows: auto !important;
    gap: 18px !important;
  }

  /* desactivar las posiciones del grid */
  .parent .news-item {
    grid-area: unset !important;
    height: auto !important;
    min-height: 260px;
  }

  /* asegurar que la imagen encaje */
  .news-img {
    width: 100%;
    height: 240px;
    object-fit: cover;
  }
}


/* GRID AREAS */
.div1 { grid-area: 1 / 1 / 5 / 5; }
.div2 { grid-area: 1 / 5 / 3 / 7; }
.div3 { grid-area: 1 / 7 / 3 / 9; }
.div4 { grid-area: 3 / 5 / 5 / 7; }
.div5 { grid-area: 3 / 7 / 5 / 9; }
.div6 { grid-area: 5 / 1 / 7 / 3; }
.div7 { grid-area: 5 / 3 / 7 / 5; }
.div8 { grid-area: 5 / 5 / 7 / 7; }
.div9 { grid-area: 5 / 7 / 7 / 9; }

/* CONTENEDOR DE NOTICIA */
.news-item {
  position: relative;
  overflow: hidden;
  border-radius: 14px;
  height: 100%;
  min-height: 280px;
  transition: transform 0.4s ease, box-shadow 0.4s ease;
}

.news-item:hover {
  transform: translateY(-4px);
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.35);
}

/* IMAGEN - NORMALIZACIÓN TOTAL */
.news-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center center;
  display: block;
  transition: transform 0.5s ease;
}

.news-item:hover .news-img {
  transform: scale(1.06);
}

/* FIX PARA VERTICALES EN LA PRINCIPAL */
/* Recorte real para verticales */
.div1 {
  position: relative;
}

.div1 .news-img {
  width: 100%;
  height: 100%;
  object-fit: cover;       /* recorta inteligentemente */
  object-position: 50% 20%; /* muestra rostro / zona superior */
}


/* OVERLAY */
.news-overlay {
  position: relative;
  width: 100%;
  height: 100%;
}

.news-overlay::before {
  content: "";
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.45);
  z-index: 1;
  transition: background 0.3s ease;
}

.news-item:hover .news-overlay::before {
  background: rgba(0, 0, 0, 0.65);
}

/* CONTENIDO */
.news-content {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  z-index: 2;
  padding: 22px 18px;
  background: linear-gradient(to top, rgba(0, 0, 0, 0.85), transparent);
  color: #fff;
}

.news-date {
  display: block;
  margin-bottom: 6px;
  color: #ffc107;
  font-size: 0.9rem;
  font-weight: 600;
}

.news-content h5 {
  font-weight: 700;
  font-size: 1.3rem;
  line-height: 1.25;
  margin-bottom: 6px;
}

.news-content p {
  font-size: 0.95rem;
  color: rgba(255, 255, 255, 0.9);
  margin-bottom: 12px;
}

/* BOTÓN */
.btn-dorado {
  display: inline-block;
  font-size: 0.9rem;
  color: #fff;
  border: 1px solid #ffc107;
  background: rgba(248, 207, 84, 0.815);
  border-radius: 30px;
  padding: 7px 18px;
  font-weight: 500;
  text-decoration: none;
  transition: all 0.3s ease;
}

.btn-dorado:hover {
  background: #ffc107;
  color: #000;
  transform: translateY(-2px);
}

/* RESPONSIVE */
@media (max-width: 992px) {
  .parent {
    grid-template-columns: repeat(2, 1fr);
    grid-auto-rows: minmax(260px, auto);
    gap: 10px;
  }
  .news-item { grid-area: unset !important; }
}

@media (max-width: 576px) {
  .parent {
    grid-template-columns: 1fr;
    grid-auto-rows: minmax(260px, auto);
  }
  .news-content { text-align: center; }
  .news-content h5 { font-size: 1.1rem; }
}


/*----------------------------------------------------------------------------------------------------------------------
*/
/* ===== GALERÍA DE IMÁGENES DEL AYUNTAMIENTO ===== */
#galeria-ayuntamiento {
  background: #ffffffc0;
}

#galeria-ayuntamiento .swiper {
  width: 95%; /* casi todo el ancho */
  margin: 0 auto;
  padding: 30px 0 50px;
}

#galeria-ayuntamiento .swiper-slide {
  height: 340px; /* más alto */
  overflow: hidden;
  border-radius: 12px;
  position: relative;
  transition: transform 0.3s ease;
}

#galeria-ayuntamiento .swiper-slide img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  filter: brightness(75%);
  transition: transform 0.4s ease, filter 0.4s ease;
}

#galeria-ayuntamiento .swiper-slide:hover img {
  transform: scale(1.08);
  filter: brightness(95%);
}

/* Caption sobre la imagen */
#galeria-ayuntamiento .slide-caption {
  position: absolute;
  bottom: 15px;
  left: 20px;
  color: #fff;
  z-index: 2;
  text-align: left;
  background: rgba(0, 0, 0, 0.45);
  padding: 10px 15px;
  border-radius: 8px;
  backdrop-filter: blur(4px);
}

#galeria-ayuntamiento .slide-caption .fecha {
  font-size: 0.85rem;
  color: #ffc107;
  display: block;
}

#galeria-ayuntamiento .slide-caption h5 {
  font-size: 1.1rem;
  margin: 4px 0 0;
  font-weight: 600;
}

/* Flechas de navegación */
#galeria-ayuntamiento .swiper-button-next,
#galeria-ayuntamiento .swiper-button-prev {
  color: #ffc107;
  transition: transform 0.3s ease;
}

#galeria-ayuntamiento .swiper-button-next:hover,
#galeria-ayuntamiento .swiper-button-prev:hover {
  transform: scale(1.2);
}

/* Responsivo */
@media (max-width: 992px) {
  #galeria-ayuntamiento .swiper-slide {
    height: 260px;
  }
}

@media (max-width: 576px) {
  #galeria-ayuntamiento .swiper {
    width: 100%;
  }
  #galeria-ayuntamiento .swiper-slide {
    height: 220px;
  }
  #galeria-ayuntamiento .slide-caption {
    bottom: 10px;
    left: 10px;
    padding: 6px 10px;
  }
  #galeria-ayuntamiento .slide-caption h5 {
    font-size: 0.9rem;
  }
}

/* ===== LIGHTBOX (imagen ampliada) ===== */
.lightbox {
  display: none;
  position: fixed;
  z-index: 2147483647; /* 🚀 valor máximo permitido */
  inset: 0;
  background: rgba(0, 0, 0, 0.92);
  justify-content: center;
  align-items: center;
  flex-direction: column;
  padding: 20px;
  backdrop-filter: blur(4px);
}

.lightbox.active {
  display: flex;
  animation: fadeIn 0.4s ease;
}

/* Imagen dentro del lightbox (ajustada para no quedar detrás del header) */
.lightbox-img {
  max-width: 85%;              /* un poco más compacta horizontalmente */
  max-height: 70vh;            /* 🔽 reduce altura visible */
  margin-top: 40px;            /* 🔝 separa del borde superior */
  border-radius: 12px;
  box-shadow: 0 0 35px rgba(0, 0, 0, 0.85);
  object-fit: contain;         /* mantiene proporción sin recortar */
  transition: transform 0.3s ease;
}

.lightbox.active .lightbox-img {
  transform: scale(1.03); /* efecto sutil al aparecer */
}


.lightbox-caption {
  margin-top: 15px;
  color: #fff;
  text-align: center;
  max-width: 80%;
  font-size: 1rem;
  line-height: 1.4;
}

.close-btn {
  position: absolute;
  top: 80px; /* 🔽 antes era 20px — bajamos la X para que no la tape el header */
  right: 30px;
  font-size: 2rem;
  color: #ffc107;
  cursor: pointer;
  transition: transform 0.3s ease, color 0.3s ease;
}

.close-btn:hover {
  transform: scale(1.2);
  color: #fff;
}

/* Cuando el lightbox está activo, bloquea el scroll de fondo */
body.lightbox-open {
  overflow: hidden;
}

/* 🚨 FIX: Forzar que los demás elementos queden detrás del lightbox */
body.lightbox-open header,
body.lightbox-open .news-section,
body.lightbox-open .pueblo-section {
  z-index: 0 !important;
  position: relative !important;
}

@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}


/* ===== Accesos rápidos ===== */
.quick-links-section {
  background: #fff;
  text-align: center;
}

.quick-links {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 30px;
  margin-top: 30px;
}

.ql-item {
  background: #f8f9fa;
  border-radius: 16px;
  padding: 25px 20px;
  width: 150px;
  cursor: pointer;
  transition: all 0.3s ease;
  box-shadow: 0 4px 12px rgba(0,0,0,0.05);
}

.ql-item i {
  font-size: 2rem;
  color: #007519c0;
  margin-bottom: 12px;
  transition: transform 0.3s ease, color 0.3s ease;
}

.ql-item h6 {
  font-weight: 600;
  color: #333;
  font-size: 1rem;
}

.ql-item:hover {
  background: #fff3cd;
  transform: translateY(-6px);
  box-shadow: 0 8px 20px rgba(0,0,0,0.15);
}

.ql-item:hover i {
  color: #000;
  transform: scale(1.2);
}

/* Responsivo */
@media (max-width: 992px) {
  .ql-item {
    width: 120px;
    padding: 20px 15px;
  }
}

@media (max-width: 576px) {
  .quick-links {
    gap: 18px;
  }
  .ql-item {
    width: 100px;
    padding: 15px 10px;
  }
  .ql-item i {
    font-size: 1.6rem;
  }
  .ql-item h6 {
    font-size: 0.85rem;
  }
}


/* ===== Misión, Visión y Valores ===== */
.mvv-section {
  background: #f8f9fa;
}

.mvv-card {
  background: #fff;
  transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.mvv-card:hover {
  transform: translateY(-5px);
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.1);
}

.mvv-icon i {
  color: #ffc107;
}


/* ===== FOOTER MODERNO ===== */
.footer-modern {
  background: linear-gradient(180deg, #111 0%, #000 100%);
  font-family: 'Poppins', sans-serif;
}

.footer-modern h5 {
  font-size: 1.1rem;
  letter-spacing: 0.5px;
}

.footer-modern ul li {
  margin: 6px 0;
}

.footer-modern ul li a:hover {
  color: #ffc107;
  text-decoration: underline;
}

/* Iconos sociales */
.social-icons {
  display: flex;
  justify-content: center;
  justify-content: flex-end;
  gap: 14px;
}

.social-link {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.1);
  color: #fff;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: all 0.3s ease;
  font-size: 1rem;
}

.social-link:hover {
  background: #ffc107;
  color: #000;
  transform: translateY(-3px);
}

/* Responsivo */
@media (max-width: 768px) {
  .social-icons {
    justify-content: center;
  }
}

/* ===== Franja institucional (logos del footer) ===== */
.footer-institucional {
  background: rgba(0, 0, 0, 0.8);
  padding-top: 15px;
  padding-bottom: 15px;
}

.footer-logos {
  display: flex;
  justify-content: center;
  align-items: center;
  flex-wrap: wrap;
  gap: 25px;
}

.footer-logo {
  height: 45px;
  width: auto;
  opacity: 0.9;
  filter: brightness(0.95);
  transition: all 0.3s ease;
}

.footer-logo:hover {
  transform: scale(1.08);
  opacity: 1;
  filter: brightness(1);
}

@media (max-width: 768px) {
  .footer-logo {
    height: 35px;
  }
}


/* ===== FIX DEFINITIVO PARA MÓVIL ===== */
@media (max-width: 768px) {

  .parent {
    grid-template-columns: 1fr !important;
    grid-auto-rows: auto !important; /* deja que crezcan */
    grid-template-rows: unset !important; /* 🔥 borra las filas fijas */
    gap: 20px !important;
  }

  /* Desactivamos todas las posiciones */
  .parent .news-item {
    grid-area: unset !important;
    height: auto !important;
    min-height: 100%;
  }

  /* Imagen uniforme */
  .news-img {
    width: 100%;
    height: 240px !important;
    object-fit: cover;
    object-position: center;
  }
}



/* ============================================
   FIX MÁXIMO: DESACTIVAR GRID MOSAICO EN TABLET
   ============================================ */
@media (max-width: 1200px) {

  .parent {
    display: grid;
    grid-template-columns: 1fr 1fr !important;
    grid-auto-rows: auto !important;
    grid-template-rows: unset !important;
    gap: 20px !important;
  }

  .parent .news-item {
    grid-area: unset !important;   /* ❗ Desactivamos posiciones */
    height: auto !important;
    min-height: 100%;
  }

  .news-img {
    width: 100%;
    height: 260px !important;
    object-fit: cover;
    object-position: center;
  }
}

/* ===== TELÉFONO ===== */
@media (max-width: 768px) {

  .parent {
    grid-template-columns: 1fr !important;
    gap: 18px !important;
  }

  .news-img {
    height: 240px !important;
  }
}


/* === Icono PDF en Index (Noticias Destacadas) === */
.pdf-badge-index {
  position: absolute;
  top: 12px;
  right: 12px;
  background: #e63946;
  color: #fff;
  padding: 6px 10px;
  border-radius: 6px;
  font-size: 0.9rem;
  font-weight: bold;
  z-index: 5;
  display: flex;
  align-items: center;
  gap: 4px;
  box-shadow: 0 2px 6px rgba(0,0,0,0.4);
  transition: transform 0.2s ease;
}

.pdf-badge-index i {
  font-size: 1rem;
}

.pdf-badge-index:hover {
  transform: scale(1.08);
}
