/* Reset y box-sizing */
*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

/* Body y fuente Lato */
body {
  font-family: 'Lato', sans-serif;
  background-color: #000;
  color: white;
  line-height: 1.5;
  overflow-x: hidden;
}

/* Fuentes */
h1 {
  font-size: 1.5em;
  font-weight: 300;
}

h2 {
  font-size: 1.2em;
  font-weight: 300;
}

h3 {
  font-size: 0.8em;
  font-weight: 400;
}
p {
  font-size: 0.9em;
  font-weight: 400;
}

a {
  font-size: 0.8em;
  font-weight: 400;
  text-decoration: none;
  cursor: pointer;
  transition: color 0.1s ease;
}

/* Header */
header {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 80px;
  z-index: 1000;
  background-color: black;
  display: flex;
  align-items: center;
  justify-content: center;
  visibility: visible; 
}

header .container {
  width: auto;
  height: 80px;
  margin: auto;
  padding: 10px;
  display: flex;
  align-items: center;
  position: relative;
  justify-content: center;

}

.logo {
  height: 50px;
  width: auto;
  padding-right: 20px;
  border-right: 1px solid white;
}

.logo img {
  height: 50px;
  width: auto;
}

.nav {
  display: flex;
  align-items: left;
  justify-content: left;
  flex-direction: column;
  padding-left: 20px;
  gap: 5px;
}

.nav a {
  color: white;
  text-align: left;
}

.nav a:hover,
.nav a.activo {
  color: #6999a3;
}

/* GALERÍA */
#galeria {
  position: relative;
  width: 100vw;
  height: auto;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  padding-top: 100px;
}

#galeria h1 {
  text-align: center;
  margin: 40px auto 20px auto;
}

#galeria h2 {
  margin: 40px 0 20px 0;
}

#galeria hr {
  width: 220px;
  height: 1px;             
  background-color: white; 
  margin: auto; 
  border: none;
}

.botonesgaleria {
  width: 100%;
  height: auto;
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 10px;
  align-items: center;
  justify-content: center;
  margin: 20px auto;
}

.botonesgaleria a {
  color: white;
}

.botonesgaleria a:hover {
  color: #85abb4ff;
}

.container-galeria {
  position: relative;
  width: 100%;
  height: auto;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-top: 40px;
}

.galeria-grid {
  columns: 4;
  column-gap: 20px;
  max-width: 1200px;
  margin: 20px;
}

@media (max-width: 768px) {
  .galeria-grid {
    columns: 2;
  }
}

.galeria-item {
  break-inside: avoid;
  display: inline-block;
  background-color: black;
  width: 100%;
}

.galeria-item img {
  width: 100%;
  height: auto;
  display: block;
  cursor: pointer;
  opacity: 100%;
  border: 2px solid black;
}

.galeria-item img:hover {
  border: 2px solid #6999a3;
}

.overlay {
  position: fixed;
  top: 0; left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0,0,0,0.95);
  display: none;
  justify-content: center;
  align-items: center;
  flex-direction: column;
  z-index: 1001;
  padding:10px 20px 20px 20px;
  box-sizing: border-box;
}

.overlay img {
  max-width: auto;
  max-height: 90vh;
  object-fit: contain;
  margin: 0;
}

.caption {
  position: absolute;
  bottom: 0px; 
  left: 50%;
  transform: translateX(-50%);
  color: white;
  font-size: 0.8em;
  text-align: center;
  padding: 15px 15px;
  width: 100%;
  height: 50px;
  z-index: 1002;
  background-color: black;
}

.flecha {
  color: white;
  font-size: 2em;
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  cursor: pointer;
  padding: 5px 10px;
  z-index: 1001;
  background-color: black;
}

.flecha:hover {
  color: #85abb4ff;
}

.flecha.izquierda {
  left: 2%;
}

.flecha.derecha {
  right: 2%;
}

@media (max-width: 768px) {
  .overlay img {
    max-width: 100vw;
    max-height: 100vh;
  }
}

/* BOTON ARRIBA */
.boton-arriba {
  position: fixed; 
  bottom: 20px; 
  left: 0;
  width: 100%;
  text-align: center;
  z-index: 999; 
  pointer-events: none; 
}

.boton-arriba a {
  display: inline-block;
  width: auto; 
  color: white;
  font-size: 2em;
  padding: 4px 14px;
  background-color: black; 
  pointer-events: auto; 
  transition: all 0.3s ease;
}

.boton-arriba a:hover {
  color: #85abb4ff;  
}

/* MODAL */
.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.8);
  display: none;
  justify-content: center;
  align-items: center;
  z-index: 1000;
  opacity: 0;
  transition: opacity 0.3s ease;
}

.modal-overlay.activo {
  display: flex;
  opacity: 1;
}

.modal-contenido {
  position: relative;
  max-width: 75%;
  max-height: 80vh;
  background-color: black;
  padding: 40px;
  overflow-y: auto;
  animation: aparecer 0.3s ease;
  scrollbar-width: none; /* Para Firefox */
  -ms-overflow-style: none; /* Para IE y Edge */
}

.modal-contenido::-webkit-scrollbar {
  display: none; /* Para Chrome, Safari y Opera */
}

.modal-contenido h3 {
  margin-bottom: 20px;
  color: #6999a3;
}

.modal-contenido p {
  text-align: justify;
  margin-bottom: 10px;
}

.hrcontenido {
  width: 100%;
  height: 1px;             
  background-color: white; 
  margin: 20px auto; 
  border: none;
}

@keyframes aparecer {
  from { transform: scale(0.9); opacity: 0; }
  to { transform: scale(1); opacity: 1; }
}

.cerrar-modal {
  position: absolute;
  top: 25px;
  right: 40px;
  background: transparent;
  border: none;
  color: white;
  font-size: 1.5em;
  cursor: pointer;
  transition: color 0.1s ease;
}

.cerrar-modal:hover {
  color: #6999a3;
}


.modal-interno {
  display: none;
}

.modal-interno.activo {
  display: block;
}

@media (max-width: 768px) {
  .modal-contenido {
    min-width: 90%;
    padding: 10px;
  }
  .cerrar-modal {
    font-size: 1.2em;
    top: 5px;
    right: 8px;
  }
}


/* MODAL VIDEO */
.video-modal {
  display: none;
  position: fixed;
  z-index: 1100;
  left: 0;
  top: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.8);
}

.video-modal-content {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 90%;
  max-width: 800px;
}

.video-modal-content iframe {
  width: 100%;
  height: 450px;
}

.close-video-modal {
  position: absolute;
  top: -40px;
  right: 0;
  color: white;
  font-size: 1.5em;
  font-weight: bold;
  cursor: pointer;
  padding: 2px 10px;
  background-color: black;
}

.close-video-modal:hover {
  color: #6999a3;
}


@media (max-width: 768px) {
  .video-modal-content iframe {
    height: 250px;
  }
}