/* Reset básico */
* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

/* Animaciones */
@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(30px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes gradientShift {
  0% {
    background-position: 0% 50%;
  }

  100% {
    background-position: 100% 50%;
  }
}

body {
  position: relative;
  font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
  background-image: url("../img/fondo.jpg");
  background-size: cover;
  background-repeat: no-repeat;
  background-position: center;
  color: #333;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  animation: fadeInUp 1s ease forwards;
  overflow-x: hidden;
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  background-size: 400% 400%;
  animation: gradientShift 12s ease infinite;
  z-index: -1;
  opacity: 0.6;
  filter: blur(4px);
  background-image: url("/img/fondo.jpg");
  background-repeat: no-repeat;
  background-size: cover;
  background-position: center;
}

/* Header */
header {
  background: rgba(255, 255, 255, 0.4);
  background-image: url("/img/fondo.jpg");
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;

  padding: 2rem 1rem;
  text-align: center;
  font-size: 2.8rem;
  font-weight: 700;
  color: #b35b77;
  letter-spacing: 2px;
  text-shadow: 0 0 8px rgba(255, 255, 255, 0.6);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
  backdrop-filter: blur(8px);
}

/* Main / Galería */
main {
  flex-grow: 1;
  padding: 2rem 1rem;
}

.galeria {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 2rem;
  max-width: 1200px;
  margin: 0 auto;
  animation: fadeInUp 1.2s ease forwards;
}

/* Cada imagen */
.imagen {
  background: rgba(255, 255, 255, 0.6);
  border-radius: 20px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.12);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  transition: transform 0.4s ease, box-shadow 0.4s ease;
  cursor: pointer;
  position: relative;
  backdrop-filter: blur(6px);
}

.imagen:hover {
  transform: translateY(-10px) scale(1.05);
  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.2);
}

/* Imagen */
.imagen img {
  width: 100%;
  height: 170px;
  object-fit: cover;
  border-bottom: 2px solid #f8cdda;
  transition: filter 0.3s ease;
  border-radius: 20px 20px 0 0;
}

.imagen:hover img {
  filter: brightness(0.9) saturate(1.1);
  animation: fadeInUp 0.6s ease;
}

/* Texto debajo */
.imagen p {
  margin: 1rem;
  font-weight: 600;
  font-size: 1.1rem;
  color: #6d6875;
  flex-grow: 1;
  text-align: center;
}

/* Botón */
.imagen button {
  background: linear-gradient(135deg, #ffc3a0, #ffafbd);
  border: none;
  color: white;
  font-weight: 700;
  padding: 0.7rem 1rem;
  margin: 0 1rem 1rem 1rem;
  border-radius: 12px;
  cursor: pointer;
  transition: all 0.3s ease;
  box-shadow: 0 4px 12px rgba(255, 173, 186, 0.5);
}

.imagen button:hover {
  background: linear-gradient(135deg, #b5ead7, #c7ceea);
  box-shadow: 0 6px 16px rgba(171, 231, 216, 0.6);
  transform: scale(1.05);
  color: #444;
}

/* Panel info */
#panel {
  background-color: rgba(255, 255, 255, 0.7);
  color: #555;
  font-size: 0.9rem;
  padding: 0.8rem 1rem;
  border-radius: 0 0 16px 16px;
  display: none;
  margin: 0 1rem 1rem 1rem;
  user-select: none;
  backdrop-filter: blur(4px);
}

/* Footer */
footer {
  background: rgba(255, 255, 255, 0.4);
  background-image: url("/img/fondo.jpg");
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;

  color: #555;
  text-align: center;
  padding: 1.2rem;
  font-size: 0.95rem;
  box-shadow: 0 -4px 12px rgba(0, 0, 0, 0.1);
  backdrop-filter: blur(6px);
}

/* Responsive ajustes */
@media (max-width: 500px) {
  header {
    font-size: 1.8rem;
    padding: 1.2rem;
  }

  .imagen img {
    height: 140px;
  }
}

/* Imagen giratoria */
.rotated {
  transform: rotateY(180deg);
  transition: transform 0.8s ease-in-out;
}

#image18 {
  transition: transform 0.8s ease-in-out;
}
