body {
  font-family: Arial, sans-serif;
  margin: 0;
  padding: 0;
  background: #f4f4f9;
}

.grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr); /* siempre 3 columnas */
  gap: 25px;
  max-width: 1000px;
  margin: auto;
  margin-bottom: 60px;
}

.grid a {
  justify-self: center; /* centra todas las tarjetas */
  width: 100%;
  max-width: 300px; /* tamaño controlado */
}

.grid a:nth-last-child(2) {
  grid-column: 1; /* penúltima en la primera columna */
  transform: translateX(+150px); /* ajusta el valor para más o menos movimiento */
}
.grid a:last-child {
  grid-column: 2; /* última en la segunda columna */
  transform: translateX(+150px); /* ajusta el valor para más o menos movimiento */
}


.card {
  background: #fff;
  border-radius: 20px;
  overflow: hidden;
  box-shadow: 0 6px 12px rgba(0,0,0,0.25);
  cursor: pointer;
  text-align: center;
  transition: transform 0.3s;
  text-decoration: none; /* elimina subrayado del link */
  color: inherit;        /* hereda color del texto */
  font-family: Arial, Helvetica, sans-serif;
}
.card:hover {
  transform: scale(1.05);
}
.image-container {
  position: relative;
  width: 100%;
  height: 280px;
  overflow: hidden;
}
.image-container img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  position: absolute;
  top: 0;
  left: 0;
  transition: opacity 0.5s;
}
.image-container img.hover {
  opacity: 0;
}
.card:hover .image-container img.hover {
  opacity: 1;
}
.card:hover .image-container img.default {
  opacity: 0;
}
/* Texto debajo de las imágenes */
.card p {
  margin: 20px 0 10px;     /* más espacio arriba y abajo */
  font-size: 24px;         /* letras más grandes */
  font-weight: 600;        /* semi-negrita para mejor contraste */
  color: #333;             /* gris oscuro agradable */
  font-family: "Arial", sans-serif;
  letter-spacing: 0.5px;   /* un poco de separación entre letras */
  text-decoration: none;   /* asegura que no haya subrayado */
}



/* HEADER */
.header-titulo {
  position: relative;
  height: 250px;
  overflow: hidden;
  display: flex;
  justify-content: center;
  align-items: center;
}

/* Capa oscura encima para resaltar el texto */
.header-titulo::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0,0,0,0.45);
  z-index: 1;
}

/* Carrusel de imágenes */
.header-titulo .imagenes-fondo {
  display: flex;
  width: calc(200%);        /* ancho doble por duplicación */
  height: 100%;
  animation: mover 30s linear infinite; /* velocidad y loop */
}

.header-titulo .imagenes-fondo img {
  flex: 1 0 auto;
  object-fit: cover;
  height: 100%;
  width: 20%;               /* cada imagen ocupa el 20% */
}

/* Animación */
@keyframes mover {
  from {
    transform: translateX(0);
  }
  to {
    transform: translateX(-50%); /* se mueve la mitad (5 imágenes) */
  }
}

/* Texto fijo en el centro exacto con estilo anterior */
.header-titulo h1 {
  position: absolute;            /* lo sacamos del flujo para centrarlo */
  top: 50%;                      /* centro vertical */
  left: 50%;                     /* centro horizontal */
  transform: translate(-50%, -90%);
  color: #fff;
  font-size: 68px;               /* tamaño grande como pediste */
  font-weight: 900;
  text-align: center;
  z-index: 2;
  text-shadow: 4px 4px 12px rgba(0,0,0,0.9); /* sombra fuerte */
  letter-spacing: 3px;           /* espacio entre letras */
  text-transform: uppercase;     /* mayúsculas */
  white-space: nowrap;           /* siempre en una sola línea */
}






    /* NAVBAR */
nav {
  background: #031C9E;
  color: white;
  padding: 20px;              /* más alto */
  display: flex;
  justify-content: center;
}

nav a {
  color: white;
  margin: 0 20px;             /* más espacio entre enlaces */
  text-decoration: none;
  font-weight: bold;
  font-size: 20px;            /* letras más grandes */
  transition: color 0.3s, transform 0.2s;
}

nav a:hover {
  text-decoration: underline;
  transform: scale(1.1);      /* efecto ligero al pasar el mouse */
}
/* CONTENEDOR PRINCIPAL */
.container {
  max-width: 1000px;
  margin: 30px auto;
  background: white;
  padding: 20px;
  border-radius: 15px;
  box-shadow: 0px 4px 10px rgba(0,0,0,0.1);
}
.titulo {
  text-align: center;
  font-size: 28px;
  margin-bottom: 20px;
}
.contenido {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 20px;
  flex-wrap: wrap;
}
.descripcion {
  flex: 1;
  font-size: 18px;
}
.imagen {
  flex: 1;
  text-align: center;
}
.imagen img {
  max-width: 100%;
  border-radius: 10px;
}

/* CONTADOR */
.contador {
  text-align: center;
  margin-top: 30px;
}
#visitas-num {
  font-size: 28px;
  font-weight: bold;
  color: #222;
}
.contador-texto {
  font-size: 14px;
  color: #555;
}

/* FOOTER */
footer {
  background: #222;
  color: white;
  padding: 30px 20px 10px;
}

.footer-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 20px;
  margin-bottom: 20px;
}

.footer-col h3 {
  margin-bottom: 10px;
  font-size: 18px;
  border-bottom: 2px solid #444;
  padding-bottom: 5px;
}

.footer-col p, .footer-col a {
  font-size: 14px;
  color: #ddd;
  text-decoration: none;
  margin: 5px 0;
  display: block;
}

.footer-col a:hover {
  color: #0dc143;
}

/* ICONOS REDES */
.social-icons {
  display: flex;
  gap: 10px;
  margin-top: 10px;
}

.social-icons img {
  width: 28px;
  height: 28px;
  cursor: pointer;
  transition: transform 0.2s;
}

.social-icons img:hover {
  transform: scale(1.2);
}

.footer-bottom {
  text-align: center;
  font-size: 13px;
  color: #aaa;
  border-top: 1px solid #444;
  padding-top: 10px;
}
