body, html {
  overflow-x: hidden !important;
 
}


/* Sección de noticias */
.news-section {
  background-color: #ffffff;
}
.news-card {
  transition: transform 0.3s ease, box-shadow 0.3s ease;
}
.news-card:hover {
  transform: translateY(-8px);
  box-shadow: 0 8px 25px rgba(255, 255, 255, 0.1);
}
.card-img-overlay {
  background: linear-gradient(to top, rgba(0,0,0,0.8), rgba(0,0,0,0.2));
  transition: background 0.3s ease;
}
.card-img-overlay:hover {
  background: linear-gradient(to top, rgba(0,0,0,0.9), rgba(0,0,0,0.3));
}



/* ===== Navbar transparente con cambio al hacer scroll ===== */

#mainNav {
  transition: all 0.4s ease;
  background: transparent;
  box-shadow: none;
}

#mainNav .nav-link {
  color: white;
  font-weight: 500;
  transition: color 0.3s ease;
}

/* Cuando la navbar cambia de estado (después de hacer scroll) */
#mainNav.scrolled {
  background-color: rgba(0, 0, 0, 0.85); /* fondo oscuro al bajar */
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.3);
}

#mainNav.scrolled .nav-link {
  color: #f5f5f5;
}

#mainNav .nav-link:hover {
  color: #ffc107; /* color dorado sutil al pasar el mouse */
}

/* ==== Color del texto del logo (Ayuntamiento) ==== */
#mainNav .navbar-brand {
  color: #fff !important; /* blanco siempre */
  font-weight: 700;
  letter-spacing: 1px;
  transition: color 0.3s ease;
}

/* Si quieres que cambie al bajar (cuando navbar tiene fondo oscuro o claro) */
#mainNav.scrolled .navbar-brand {
  color: #ffc107 !important; /* dorado */
}

/* ==== MENÚ MÓVIL TIPO OVERLAY ==== */
.mobile-menu {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.95);
  color: white;
  z-index: 999;
  display: none;
  flex-direction: column;
  opacity: 0;
  transition: opacity 0.4s ease;
}

.mobile-menu.show {
  display: flex;
  opacity: 1;
}

.mobile-menu .menu-link {
  color: #fff;
  font-size: 1.8rem;
  text-transform: uppercase;
  margin: 15px 0;
  text-decoration: none;
  font-weight: 600;
  transition: color 0.3s ease;
}

.mobile-menu .menu-link:hover {
  color: #ffc107;
}

#closeMenu {
  font-weight: 600;
  border-radius: 30px;
}

/* Solo mostrar overlay en pantallas pequeñas */
@media (min-width: 992px) {
  .mobile-menu { display: none !important; }
}


/* ==== Línea decorativa debajo del texto "Ayuntamiento" ==== */
.navbar-brand {
  position: relative;
  display: inline-block;
  padding-bottom: 5px;
}

.brand-line {
  position: absolute;
  bottom: -5px;      /* distancia entre el texto y la línea */
  left: 0;
  width: 100%;
  height: 3px;
  background: linear-gradient(to right, #ffc107, #ffda6b);
  border-radius: 2px;
  content: "";
  opacity: 0.9;
  transform: scaleX(0.8);
  transform-origin: center;
  transition: transform 0.3s ease, opacity 0.3s ease;
}

.navbar-brand:hover .brand-line {
  transform: scaleX(1);
  opacity: 1;
}



/* ==== Línea blanca decorativa debajo del navbar ==== */
#mainNav::after {
  content: "";
  position: absolute;
  bottom: 0;
  left: 10%;              /* deja margen lateral */
  width: 80%;             /* ocupa el 80% del ancho */
  height: 2px;
  background-color: rgba(255, 255, 255, 0.8); /* blanca con ligera transparencia */
  border-radius: 2px;
  transition: opacity 0.3s ease, transform 0.3s ease;
  opacity: 1;
  transform: scaleX(1);
}

/* Cuando haces scroll: oculta la línea */
#mainNav.scrolled::after {
  opacity: 0;
  transform: scaleX(0.8);
}

/* ===== SUBMENÚS MODERNOS Y SUAVES ===== */

.dropdown-menu {
  background: rgba(0, 0, 0, 0.85);
  backdrop-filter: blur(6px);
  border: none;
  border-radius: 0.75rem;
  padding: 0.6rem 0;
  min-width: 200px;
  opacity: 0;
  visibility: hidden;
  transform: translateY(10px);
  transition: all 0.35s ease;
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.4);
}

/* Mostrar animado */
.nav-item.dropdown:hover .dropdown-menu {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

/* ===== Items dentro del submenú ===== */
.dropdown-item {
  color: #fff;
  font-weight: 500;
  padding: 0.6rem 1rem;
  transition: all 0.25s ease;
}

.dropdown-item:hover {
  background: linear-gradient(to right, #ffc107, #ffda6b);
  color: #000;
  padding-left: 1.3rem;
}

/* ===== Mostrar solo en escritorio al pasar el ratón ===== */
@media (min-width: 992px) {
  .dropdown-menu {
    display: block;
    position: absolute;
  }
  .nav-item.dropdown:hover .dropdown-menu {
    display: block;
  }
}

/* ===== Pequeña flecha dorada debajo del enlace activo ===== */
.nav-item.dropdown > .nav-link::after {
  content: "";
  display: inline-block;
  margin-left: 6px;
  border: solid #ffc107;
  border-width: 0 2px 2px 0;
  padding: 3px;
  transform: rotate(45deg);
  transition: transform 0.3s ease;
}

.nav-item.dropdown:hover > .nav-link::after {
  transform: rotate(225deg);
}


/* ==== MENÚ MÓVIL ANIMADO Y MODERNO ==== */

.mobile-menu {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.92);
  backdrop-filter: blur(8px);
  color: white;
  z-index: 999;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  opacity: 0;
  visibility: hidden;
  transform: scale(1.05);
  transition: opacity 0.5s ease, transform 0.5s ease, visibility 0.5s ease;
}

.mobile-menu.show {
  opacity: 1;
  visibility: visible;
  transform: scale(1);
}

.menu-link {
  color: #fff;
  font-size: 2rem;
  text-transform: uppercase;
  text-decoration: none;
  font-weight: 600;
  margin: 15px 0;
  opacity: 0;
  transform: translateY(20px);
  transition: all 0.4s ease;
}

.mobile-menu.show .menu-link {
  opacity: 1;
  transform: translateY(0);
}

/* Efecto de entrada secuencial para los enlaces */
.mobile-menu.show .menu-link:nth-child(1) { transition-delay: 0.1s; }
.mobile-menu.show .menu-link:nth-child(2) { transition-delay: 0.2s; }
.mobile-menu.show .menu-link:nth-child(3) { transition-delay: 0.3s; }
.mobile-menu.show .menu-link:nth-child(4) { transition-delay: 0.4s; }
.mobile-menu.show .menu-link:nth-child(5) { transition-delay: 0.5s; }

#closeMenu {
  margin-top: 30px;
  font-weight: 600;
  border-radius: 30px;
  opacity: 0;
  transform: translateY(10px);
  transition: all 0.5s ease 0.6s;
}

.mobile-menu.show #closeMenu {
  opacity: 1;
  transform: translateY(0);
}

/* Efecto hover en móvil */
.menu-link:hover {
  color: #ffc107;
  letter-spacing: 2px;
  transition: all 0.3s ease;
}


/* ===== SUBMENÚS DENTRO DEL MENÚ MÓVIL ===== */
.mobile-dropdown {
  width: 100%;
  text-align: center;
}

/* Botón principal de submenú */
.dropdown-toggle-mobile {
  background: none;
  border: none;
  color: #fff;
  font-size: 1.6rem;
  text-transform: uppercase;
  font-weight: 600;
  margin: 10px 0;
  cursor: pointer;
  transition: color 0.3s ease, transform 0.3s ease;
}

.dropdown-toggle-mobile:hover {
  color: #ffc107;
  transform: translateX(4px);
}

/* ===== Fondo más oscuro del menú móvil ===== */
.mobile-menu {
  background: rgba(0, 0, 0, 0.97);
  backdrop-filter: blur(10px);
  transition: background 0.4s ease;
}

/* ===== Animación elegante de submenús ===== */
.mobile-submenu {
  max-height: 0;
  overflow: hidden;
  opacity: 0;
  transform: translateY(-8px);
  display: flex;
  flex-direction: column;
  gap: 6px;
  transition: max-height 0.7s ease, opacity 0.7s ease, transform 0.7s ease;
}

.mobile-submenu.show {
  max-height: 500px;
  opacity: 1;
  transform: translateY(0);
}

/* ===== Enlaces del submenú ===== */
.submenu-link {
  font-size: 1rem;
  color: #ffc107; /* dorado elegante */
  text-decoration: none;
  margin: 5px 0;
  transition: color 0.3s ease, transform 0.3s ease;
}

.submenu-link:hover {
  color: #fff; /* blanco al pasar */
  transform: translateX(6px);
}

/* ===== Marca y menú más pequeños en móviles ===== */
@media (max-width: 576px) {
  #mainNav .navbar-brand {
    font-size: 0.8rem;
    font-weight: 600;
    line-height: 1.1;
    max-width: 65vw;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .brand-line { display: none; }

  .mobile-menu .menu-link {
    font-size: 1.1rem;
    margin: 8px 0;
    letter-spacing: 0.5px;
  }

  .mobile-menu .submenu-link {
    font-size: 0.95rem;
  }

  #closeMenu {
    font-size: 0.85rem;
    padding: 6px 18px;
  }
}


/* ===== Hamburguesa blanca siempre ===== */
.navbar-toggler {
  border: none;               /* sin borde feo */
}

.navbar-toggler-icon {
  background-image: url("data:image/svg+xml;charset=utf8,%3Csvg viewBox='0 0 30 30' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath stroke='rgba(255, 255, 255, 1)' stroke-width='2' stroke-linecap='round' stroke-miterlimit='10' d='M4 7h22M4 15h22M4 23h22'/%3E%3C/svg%3E");
  filter: drop-shadow(0 0 3px rgba(0,0,0,.4)); /* un pelín de glow */
}

/* cuando la barra ya está scrolleada y se pone oscura, también blanco */
#mainNav.scrolled .navbar-toggler-icon {
  background-image: url("data:image/svg+xml;charset=utf8,%3Csvg viewBox='0 0 30 30' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath stroke='rgba(255, 255, 255, 1)' stroke-width='2' stroke-linecap='round' stroke-miterlimit='10' d='M4 7h22M4 15h22M4 23h22'/%3E%3C/svg%3E");
}

/* El menú móvil NO debe estar centrado: si no “baila” */
#mobileMenu{
  justify-content: flex-start !important;
  padding: 90px 16px 24px;  /* ajusta si tu navbar es más baja/alta */
  height: 100dvh;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
}

/* Submenús: que empujen SOLO un poco y luego tengan scroll */
#mobileMenu .mobile-submenu{
  max-height: 0;
  overflow: hidden;
  opacity: 0;
  transform: translateY(-6px);
  transition: max-height .35s ease, opacity .25s ease, transform .25s ease;
}

#mobileMenu .mobile-submenu.show{
  opacity: 1;
  transform: translateY(0);

  /* AQUÍ está la magia: empuja poco */
  max-height: 175px;        /* prueba 180/220/260 según te guste */
  overflow-y: auto;

  overscroll-behavior: contain;
  -webkit-overflow-scrolling: touch;

  padding: 6px 0;           /* opcional */
}

/* Indicador visual de “hay más” (fade abajo) */
#mobileMenu .mobile-submenu.show::after{
  content: "";
  position: sticky;
  bottom: 0;
  display: block;
  height: 22px;
  background: linear-gradient(to bottom, rgba(0,0,0,0), rgba(0,0,0,0.97));
  pointer-events: none;
}

/* Que el botón Cerrar SIEMPRE quede visible abajo */
#closeMenu{
  position: sticky;
  bottom: 16px;
  margin-top: 18px;
  z-index: 10001;
}

