/* Estilos para títulos de sección con líneas */
.section-title-container {
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 2rem;
  width: 100%;
}

.section-title {
  text-align: center;
  font-weight: 700;
  font-size: 1.5rem;
  color: var(--primary-color);
  margin: 0 1rem;
  text-transform: uppercase;
}

.section-line {
  height: 2px;
  background-color: var(--green-municipal);
  flex-grow: 1;
  max-width: 25%;
}

/* ===================================
   OPTIMIZACIÓN PARA SERVICIOS EN MÓVILES
   =================================== */

.servicio-card {
  transition: transform 0.3s ease, box-shadow 0.3s ease;
  height: 100%;
}

.servicio-card:hover {
  transform: translateY(-3px);
  box-shadow: 0 8px 16px rgba(0, 0, 0, 0.12) !important;
}

.servicio-card .card-body {
  padding: 1rem;
  display: flex;
  flex-direction: column;
  height: 100%;
}

.servicio-title {
  font-size: 1rem;
  font-weight: 600;
  margin-bottom: 0.5rem;
  line-height: 1.3;
  color: var(--primary-color);
}

.servicio-description {
  font-size: 0.85rem;
  margin-bottom: 0.75rem;
  flex-grow: 1;
  color: #666;
}

.servicio-btn {
  font-size: 0.8rem;
  padding: 0.25rem 0.75rem;
  margin-top: auto;
}

/* ===================================
   OPTIMIZACIÓN PARA NOTICIAS EN MÓVILES - 2 POR FILA
   =================================== */

.noticia-card {
  transition: transform 0.3s ease, box-shadow 0.3s ease;
  height: 100%;
}

.noticia-card:hover {
  transform: translateY(-5px);
  box-shadow: 0 10px 20px rgba(0, 0, 0, 0.1) !important;
}

.noticia-card .card-img-top {
  height: 150px !important;
  object-fit: cover;
}

.noticia-card .card-body {
  padding: 1rem;
}

.noticia-title {
  font-size: 1rem;
  font-weight: 600;
  margin-bottom: 0.5rem;
  line-height: 1.3;
}

.noticia-description {
  font-size: 0.85rem;
  margin-bottom: 0.75rem;
}

.noticia-card .btn {
  font-size: 0.8rem;
  padding: 0.25rem 0.75rem;
}

/* ===================================
   MEDIA QUERIES PARA DISPOSITIVOS MÓVILES
   Servicios y Noticias: 2 por fila en móviles
   =================================== */

/* Tablets pequeños y móviles grandes (768px y menos) */
@media (max-width: 768px) {
  .section-title {
    font-size: 1.3rem;
  }
  
  .section-line {
    max-width: 20%;
  }
  
  .servicio-card .card-body {
    padding: 0.8rem;
  }
  
  .servicio-title {
    font-size: 0.95rem;
  }
  
  .servicio-description {
    font-size: 0.8rem;
  }
  
  /* Iconos más pequeños en tablets */
  .servicio-card .fa-3x {
    font-size: 2.5em !important;
  }
  
  /* Noticias en tablets - 2 por fila */
  .noticia-card .card-img-top {
    height: 140px !important;
  }
  
  .noticia-title {
    font-size: 0.95rem;
  }
  
  .noticia-description {
    font-size: 0.8rem;
  }
}

/* Móviles (576px y menos) */
@media (max-width: 576px) {
  .section-title {
    font-size: 1.1rem;
    margin: 0 0.5rem;
  }
  
  .section-line {
    max-width: 15%;
  }
  
  /* Servicios en móviles pequeños */
  .servicio-card {
    margin-bottom: 1rem;
  }
  
  .servicio-card .card-body {
    padding: 0.7rem;
  }
  
  .servicio-title {
    font-size: 0.9rem;
    margin-bottom: 0.4rem;
  }
  
  .servicio-description {
    font-size: 0.75rem;
    margin-bottom: 0.6rem;
    /* Limitar texto en móviles pequeños */
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
  }
  
  .servicio-btn {
    font-size: 0.75rem;
    padding: 0.2rem 0.6rem;
  }
  
  /* Iconos más pequeños en móviles */
  .servicio-card .fa-2x {
    font-size: 1.8em !important;
  }
  
  /* Noticias en móviles - OPTIMIZADAS PARA 2 POR FILA */
  .noticia-card {
    margin-bottom: 1rem;
  }
  
  .noticia-card .card-body {
    padding: 0.7rem;
  }
  
  .noticia-card .card-img-top {
    height: 120px !important; /* Más pequeñas para 2 por fila */
  }
  
  .noticia-title {
    font-size: 0.85rem;
    margin-bottom: 0.3rem;
    /* Limitar a 2 líneas para que se vean bien 2 por fila */
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    line-height: 1.2;
  }
  
  .noticia-description {
    font-size: 0.7rem;
    margin-bottom: 0.5rem;
    /* Limitar a 2 líneas en móviles para 2 por fila */
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    line-height: 1.3;
  }
  
  .noticia-card .btn {
    font-size: 0.7rem;
    padding: 0.2rem 0.5rem;
  }
  
  .noticia-card .badge {
    font-size: 0.65rem;
  }
  
  .noticia-card .small {
    font-size: 0.65rem !important;
  }
}

/* Móviles muy pequeños (480px y menos) */
@media (max-width: 480px) {
  .section-title {
    font-size: 1rem;
  }
  
  .servicio-card .card-body {
    padding: 0.6rem;
  }
  
  .servicio-title {
    font-size: 0.85rem;
  }
  
  .servicio-description {
    font-size: 0.7rem;
    -webkit-line-clamp: 2; /* Solo 2 líneas en pantallas muy pequeñas */
  }
  
  .servicio-btn {
    font-size: 0.7rem;
    padding: 0.15rem 0.5rem;
  }
  
  /* Iconos aún más pequeños */
  .servicio-card .fa-2x {
    font-size: 1.5em !important;
  }
  
  /* Noticias en pantallas muy pequeñas - 2 por fila optimizadas */
  .noticia-card .card-body {
    padding: 0.6rem;
  }
  
  .noticia-card .card-img-top {
    height: 100px !important; /* Aún más pequeñas para pantallas muy pequeñas */
  }
  
  .noticia-title {
    font-size: 0.8rem;
    -webkit-line-clamp: 2; /* Máximo 2 líneas */
  }
  
  .noticia-description {
    font-size: 0.65rem;
    -webkit-line-clamp: 2; /* Solo 2 líneas para que quepan bien */
  }
  
  .noticia-card .btn {
    font-size: 0.65rem;
    padding: 0.15rem 0.4rem;
  }
  
  .noticia-card .badge {
    font-size: 0.6rem;
  }
  
  /* Espaciado reducido */
  .py-5 {
    padding-top: 2rem !important;
    padding-bottom: 2rem !important;
  }
}

/* ===================================
   MEJORAS ADICIONALES PARA UX MÓVIL
   =================================== */

/* Mejorar toque en botones */
@media (max-width: 768px) {
  .btn {
    min-height: 44px; /* Tamaño mínimo recomendado para touch */
    display: flex;
    align-items: center;
    justify-content: center;
  }
  
  .servicio-btn,
  .noticia-card .btn {
    min-height: 38px; /* Botones pequeños pero tocables */
  }
}

/* Hover effects solo en dispositivos no táctiles */
@media (hover: hover) and (pointer: fine) {
  .servicio-card:hover,
  .noticia-card:hover {
    transform: translateY(-3px);
  }
}

/* Eliminar hover en dispositivos táctiles */
@media (hover: none) {
  .servicio-card:hover,
  .noticia-card:hover {
    transform: none;
  }
}