@import url('https://fonts.googleapis.com/css2?family=Playfair+Display:ital,wght@1,700&display=swap');

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html, body {
  height: 100%;
  width: 100%;
  font-family: Arial, sans-serif;
  background-image: url("imagenes/textura.jpg");
  background-size: cover;
  background-repeat: repeat;
  background-attachment: fixed;
  background-position: top left;
  overflow: hidden;
}

.main-layout {
  display: flex;
  flex-direction: column;
  height: 100vh;
  overflow: hidden;
}

/* BLOQUES */
.bloque {
  flex: 1;
  display: flex;
  flex-direction: column;
  padding: 10px 40px 5px 40px;
  min-height: 0;
  position: relative;
}

.bloque h1 {
  font-size: 1.72vw;
  font-family: 'Playfair Display', serif;
  font-weight: bold;
  font-style: italic;
  color: #0d865f;
  text-shadow: 0 2px 3px rgba(0,0,0,0.2);
  margin-bottom: 8px;
  flex-shrink: 0;
}

.separador {
  width: 100%;
  height: 1px;
  background: linear-gradient(to right, transparent, #0d865f, transparent);
  flex-shrink: 0;
}

/* GRID */
.grid {
  display: grid;
  grid-template-columns: repeat(15, 1fr);
  gap: 6px;
  min-height: 0;
  overflow: hidden;
}

.grid img {
  width: 100%;
  aspect-ratio: 1 / 1;
  object-fit: cover;
  border-radius: 6px;
  cursor: pointer;
  transition: transform 0.2s, box-shadow 0.2s;
  box-shadow: 0 2px 6px rgba(0,0,0,0.15);
  display: block;
}

.grid img.ultima-vista {
  border: 5px solid #40e0d0;
  animation: colorBorde 3s ease-in-out infinite;
}

@keyframes colorBorde {
  0%   { border-color: #40e0d0; box-shadow: 0 0 10px rgba(64, 224, 208, 0.7); }
  33%  { border-color: #90ee90; box-shadow: 0 0 10px rgba(144, 238, 144, 0.7); }
  66%  { border-color: #ff9999; box-shadow: 0 0 10px rgba(255, 153, 153, 0.7); }
  100% { border-color: #40e0d0; box-shadow: 0 0 10px rgba(64, 224, 208, 0.7); }
}

.grid img:hover {
  transform: scale(1.04);
  box-shadow: 0 4px 12px rgba(0,0,0,0.3);
}

.sin-fotos {
  font-size: 0.85vw;
  color: #888;
  font-style: italic;
}

/* PAGINACION */
.paginacion {
  position: absolute;
  bottom: 28px;
  right: 40px;
  display: flex;
  gap: 5px;
}

.pag-btn {
  position: static;
  background: rgba(13, 134, 95, 0.15);
  color: #0d865f;
  border: 1px solid #0d865f;
  border-radius: 4px;
  padding: 2px 8px;
  font-size: 0.75vw;
  cursor: pointer;
  transition: background 0.2s;
  box-shadow: none;
}

.pag-btn:hover {
  background: rgba(13, 134, 95, 0.3);
}

.pag-btn.activa {
  background: #0d865f;
  color: white;
}

/* LIGHTBOX */
#lightbox {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgb(60, 60, 60);
  z-index: 1000;
  justify-content: center;
  align-items: center;
  border: 10px solid #085a40;
}

#lb-img {
  max-width: 85vw;
  max-height: 85vh;
  border-radius: 6px;
  box-shadow: 0 0 40px rgba(0,0,0,0.8);
}

#lb-prev, #lb-next {
  position: fixed;
  top: 50%;
  transform: translateY(-50%);
  background: rgba(255,255,255,0.15);
  color: white;
  border: none;
  font-size: 2.5rem;
  padding: 10px 18px;
  cursor: pointer;
  border-radius: 4px;
  transition: background 0.2s;
  z-index: 1001;
  box-shadow: none;
}

#lb-prev { left: 20px; }
#lb-next { right: 20px; }

#lb-prev:hover, #lb-next:hover {
  background: rgba(255,255,255,0.3);
}

#lb-close {
  position: fixed;
  top: 15px;
  right: 20px;
  background: rgba(255,255,255,0.15);
  color: white;
  border: none;
  font-size: 1.2rem;
  padding: 6px 12px;
  cursor: pointer;
  border-radius: 4px;
  transition: background 0.2s;
  z-index: 1001;
  box-shadow: none;
}

#lb-close:hover {
  background: rgba(255,255,255,0.3);
}

/* FOOTER Y BOTON */
footer {
  padding: 0 0 20px 0;
  text-align: center;
  flex-shrink: 0;
}

footer p {
  font-size: 16px;
  font-family: Arial, sans-serif;
  color: #2e2b2b;
}

.btn-inicio {
  position: fixed;
  bottom: 20px;
  right: 25px;
  padding: 8px 18px;
  background-color: #0d865f;
  color: white;
  border: none;
  border-radius: 5px;
  font-size: 0.9rem;
  box-shadow: 0 2px 5px rgba(0,0,0,0.4);
  cursor: pointer;
}
