* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  font-family: "Montserrat", sans-serif !important;
}

body {
  line-height: 1.6;
  color: #333;
}

/* Hero */
header {
  position: relative; /* necesario para que ::before se posicione sobre el fondo */
  height: 100vh;
  background: url("gallery/bg.jpg") center/cover no-repeat;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  color: white;
  text-align: center;
  padding: 0 20px;
}

/* Overlay blanco semitransparente */
header::before {
  content: "";
  position: absolute;
  inset: 0; /* top:0; right:0; bottom:0; left:0 */
  background: rgba(255, 255, 255, 0.651); /* blanco con 40% de opacidad */
  z-index: 0; /* detrás del contenido */
}

/* Aseguramos que el contenido quede por encima del overlay */
header img.logo,
header button {
  position: relative;
  z-index: 1;
}

header h1 {
  font-size: 3rem;
  margin-bottom: 1rem;
  text-shadow: 2px 2px 5px rgba(0, 0, 0, 0.6);
}
.logo {
  width: 500px; /* ancho en desktop */
  height: auto; /* mantiene proporción */
  margin-bottom: 0rem;
}

@media (max-width: 768px) {
  .logo {
    width: 300px; /* más pequeño en tablet/móvil */
  }
}

@media (max-width: 480px) {
  .logo {
    width: 190px; /* en móviles muy pequeños */
  }
}

header button {
  padding: 1rem 2rem;
  font-size: 1.7rem;
  border: none;
  background: #7bafac;
  color: white;
  border-radius: 5px;
  cursor: pointer;
  transition: background 0.3s;
}

header button:hover {
  background: #a2674c;
}

/* Galería */
.gallery {
  padding: 2rem;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 1.5rem;
}

.card {
  background: white;
  border-radius: 10px;
  overflow: hidden;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
  cursor: pointer;
  transition: transform 0.2s;
}

.card:hover {
  transform: scale(1.03);
}

.card img {
  width: 100%;
  aspect-ratio: 1/1;
  object-fit: cover;
}

.card .info {
  padding: 1rem;
}

.card .info h3 {
  font-size: 1.1rem;
  margin-bottom: 0.5rem;
}

.card .info p {
  color: #666;
  font-weight: bold;
}

/* Modal */
.modal {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.7);
  justify-content: center;
  align-items: center;
  z-index: 1000;
}

.modal-content {
  background: white;
  max-width: 600px;
  width: 90%;
  border-radius: 10px;
  overflow: hidden;
  padding: 1rem;
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
}

/* Imagen dentro del modal */
.modal-content {
  max-width: 90%;
  width: 90vw;
  padding: 1rem;
  border-radius: 10px;
  background: white;
  display: flex;
  flex-direction: column;
  align-items: center;
  overflow: hidden; /* ya no necesitamos scroll interno */
}

.modal-content img {
  width: auto; /* se escala proporcionalmente */
  max-width: 100%; /* no más ancho que el modal */
  max-height: 70vh; /* nunca más alto que 70% de la ventana */
  object-fit: contain; /* mantiene proporción */
  margin-bottom: 1rem;
}

.modal-content h3,
.modal-content p {
  width: 100%;
  text-align: center;
  margin-bottom: 0.5rem;
}

/* Desktop: modal más ancho */
@media (min-width: 1024px) {
  .modal-content {
    max-width: 900px;
  }

  .modal-content img {
    max-height: 75vh; /* un poco más grande en desktop */
  }
}

/* Flechas del carrusel */
.carousel-btn {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  font-size: 2rem;
  background: rgba(0, 0, 0, 0.3);
  color: white;
  border: none;
  padding: 0.3rem 0.6rem;
  cursor: pointer;
  border-radius: 5px;
  z-index: 10;
}

#prevBtn {
  left: 10px;
}

#nextBtn {
  right: 10px;
}

.modal-content h3 {
  margin-bottom: 0.5rem;
}

.modal-content p {
  margin-bottom: 1rem;
}

.close-btn {
  position: absolute;
  top: 10px;
  right: 15px;
  font-size: 2rem; /* más grande */
  font-weight: bold;
  color: #d3d3d3; /* color de relleno */
  -webkit-text-stroke: 2px #ffffff; /* contorno negro */
  cursor: pointer;
  border-radius: 50%;
  padding: 5px 10px;
  transition: background 0.2s;
}

.close-btn:hover {
  background: rgba(0, 0, 0, 0.5);
}

/* Responsive */
@media (max-width: 600px) {
  header h1 {
    font-size: 2rem;
  }
  header button {
    font-size: 1rem;
  }
  .carousel-btn {
    font-size: 1.5rem;
    padding: 0.2rem 0.5rem;
  }
}
