body {
  margin: 0;
}
body::before {
  content: '';
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none; /* Hace que la capa no interfiera */
  background-image: url('https://tuset.es/resources/images/noise.png'); /* Patrón de ruido generado */
  opacity: 0.3; /* Ajustar para suavizar el efecto */
  z-index: 9999; /* Asegura que esté por encima */
}

/* Reset básico y tipografía */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

.color-toggle {
  position: fixed;
  left: 20px;
  top: 50%;
  width: 20px;
  height: 20px;
  background-color: black;
  border-radius: 50%;
  z-index: 9999; /* Un número alto para asegurar que está encima de todo */
  cursor: pointer;
}

.frame-toggle {
  position: fixed;
  left: 20px;
  top: calc(50% + 32px);
  width: 20px;
  height: 20px;
  background-color: black;
  z-index: 9999;
  cursor: pointer;
}

.header-left, .header-center, .footer {
  position: fixed;
  width: 100%;
  text-align: center;
  font-family: 'Montserrat', sans-serif;  
}

.header-left {
  top: 0;
  left: 0;
  text-align: left;
  z-index: 999;
  width: 50px;
  z-index: 100;
}

.header-center {
  top: 0;
  left: 0;
  z-index: 99;
}

.footer {
  bottom: 0;
  left: 0;
}

.footer a {
  margin: 0 15px;
}

.header-center ul {
  display: flex;
  justify-content: center;
  list-style-type: none;
}

.header-center li {
  margin: 0 15px;
}



/* Grilla de imágenes */
.grid-imagenes {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 40px;
  margin: 90px 70px 40px 70px;
  z-index: 1;
  align-items: center;
}

.grid-imagenes img {
  width: 100%;
  transition: all 0.3s ease;
}

.grid-imagenes img:nth-child(odd) {
  transform: translateY(0px);
}

.grid-imagenes img:nth-child(even) {
  transform: translateY(0px);
}

.grid-imagenes img:nth-child(3n) {
  width: 100%;
}

.grid-imagenes img:nth-child(4n) {
  width: 100%;
}





/* Responsividad */
@media (max-width: 768px) {
  .grid-imagenes {
    grid-template-columns: 1fr;
  }
  .grid-imagenes img {
    margin-bottom: 20px;
  }
  .grid-imagenes img:nth-child(odd),
  .grid-imagenes img:nth-child(even) {
    transform: translateY(0);
  }
  .grid-imagenes img:nth-child(3n) {
    width: 100%;
  }
  .grid-imagenes img:nth-child(4n) {
    width: 100%;
  }
}

.arrow {
  position: absolute;
  width: 60px;  /* o el tamaño que prefieras */
  visibility: hidden;  /* inicialmente oculto */
  pointer-events: none;  /* para que no interfiera con otros eventos de clic */
}

.close {
  font-size: 96px; /* Hace el símbolo más grande */
  color: black; /* Cambia el color a blanco */
  position: absolute;
  top: 10px;
  right: 10px;
  cursor: pointer;
}

/* Si quieres que las arrow tengan alguna transparencia */
.arrow:hover {
  opacity: 0.8;
}

.hidden {
  display: none;
}


#cajaluz {
  -webkit-user-select: none;  /* Safari */
  -moz-user-select: none;     /* Firefox */
  -ms-user-select: none;      /* IE/Edge */
  user-select: none;          /* Chrome */
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(255, 255, 255, 1);
  text-align: center;
  z-index: 99;
}

#cajaluz:not(.hidden) {
  display: flex;
  align-items: center;
  justify-content: center;
}

#cajaluz-img {
  display: block;
  width: auto;
  max-width: 90vw;
  max-height: 90vh;
}

.control {
  position: absolute;
  top: 50%;
  font-size: 2em;
  color: white;
  cursor: pointer;
  z-index: 100;
}

#prev {
  left: 10px;
}

#next {
  right: 10px;
}

.dark-mode {
  background-color: black;
  color: white;
}

a {
  text-decoration: none;
  color: black;
}

.dark-mode a {
  color:white;
}

.dark-mode .close {
  color: white;
}

.dark-mode #cajaluz {
  background-color: rgba(0, 0, 0, 1); 
}

/* Cambiar el botón a blanco en modo oscuro */
.dark-mode .color-toggle {
  background-color: white;
}

.dark-mode .frame-toggle {
  background-color: white;
}

.framed-mode .frame-toggle {
  background-color: var(--frame-text-color);
}

/* Marco analógico con el número de la fotografía */
:root {
  --frame-width: 10px;
  --frame-text-color: #ff7a00;
}

.photo-frame {
  position: relative;
  display: block;
}

.photo-frame img {
  display: block;
  width: 100%;
}

.framed-mode .photo-frame img {
  box-sizing: border-box;
  border: var(--frame-width) solid black;
}

.dark-mode.framed-mode .photo-frame img {
  border-color: white;
}

.photo-title {
  display: none;
  position: absolute;
  color: var(--frame-text-color);
  opacity: 0.6;
  font-family: 'Montserrat', sans-serif;
  font-size: 10px;
  letter-spacing: 0.5px;
  white-space: nowrap;
  pointer-events: none;
}

.framed-mode .photo-title {
  display: block;
}

.photo-title-top {
  top: calc(var(--frame-width) / 2);
  transform: translate(-50%, -50%);
}

.photo-title-bottom {
  bottom: calc(var(--frame-width) / 2);
  transform: translate(-50%, 50%);
}

.photo-title-left {
  left: calc(var(--frame-width) / 2);
  transform: translate(-50%, -50%) rotate(-90deg);
}

.photo-title-right {
  right: calc(var(--frame-width) / 2);
  transform: translate(50%, -50%) rotate(90deg);
}


/*Algunas pruebas */

.container_001 {
    margin: 0 auto;
    margin-top: 35px;
    padding: 80px;
    width: 80%;
}

.normal_001 {
    font-family: montserrat;
    text-align: center;
}