/* =========================================
   /pages/galeria.css
   Estructura:
   1) Variables + Reset + Base
   2) Topbar (igual libros) + botón MERCH
   3) Navbar (igual libros)
   4) Main (espaciado de la página)
   5) Galería (thumbnails)
   6) Modal (visor con marca de agua + navegación)
   7) Footer (igual libros)
   8) Responsive
========================================= */

/* 1) Variables + Reset + Base */
:root {
  --tono1: #4F7302;
  --tono2: #462207;
  --tono3: #EAE8E8;
  --tono4: #F2811D;
  --tono5: #BF2604;
  --tono6: #0D8FA1;
  --tono7: #FED246;
}

* { margin: 0; padding: 0; box-sizing: border-box; }

body {
  font-family: 'Comic Neue', sans-serif;
  background: linear-gradient(to bottom, var(--tono3), var(--tono1));
  color: var(--tono2);
  font-size: 1.1rem;
}

/* 2) Topbar (igual libros) + botón MERCH */
.topbar { background: var(--tono6); }
.topbar .topbar-inner {
  display: flex; align-items: center; justify-content: space-between;
  gap: 12px; padding: 10px 20px;
}

.social-icons a {
  color: #fff; margin: 0 8px; font-size: 18px; transition: .3s;
}
.social-icons a:hover { color: var(--tono7); }

.btn-merch {
  background: linear-gradient(180deg, #FFBE75, #F2811D);
  color: #fff; padding: 10px 18px; border-radius: 14px; font-weight: 900;
  text-decoration: none; letter-spacing: .3px;
  box-shadow: 0 8px 20px rgba(242,129,29,.33), inset 0 -2px 0 rgba(0,0,0,.08);
  border: 2px solid rgba(0,0,0,.06);
}

/* 3) Navbar (igual libros) */
.navbar {
  background: var(--tono7);
  display: flex; justify-content: space-between; align-items: center;
  padding: 15px 40px; flex-wrap: wrap;
}
.navbar h1 {
  display: flex; align-items: center; gap: 10px;
  font-size: 2.0rem; color: var(--tono5);
}
.logo-kiwi { width: 32px; height: 32px; display: inline-block; }
.navbar ul { list-style: none; display: flex; gap: 20px; flex-wrap: wrap; }
.navbar a {
  text-decoration: none; color: var(--tono2); font-weight: bold;
  display: flex; align-items: center; gap: 6px; font-size: 1.05rem;
  transition: .3s;
}
.navbar a:hover { color: var(--tono6); }
.navbar a.active { filter: saturate(1.15); }

/* 4) Main */
.page-galeria main { padding: 24px 16px 48px; }

/* 5) Galería (thumbnails) */
.gl-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
  gap: 14px;
}

.gl-thumb {
  position: relative; display: block;
  background: #f0f0f0; border-radius: 12px; overflow: hidden;
  border: 1px solid #e8e8e8;
  box-shadow: 0 6px 16px rgba(0,0,0,.06);
  transition: transform .15s ease, box-shadow .15s ease;
}
.gl-thumb:hover {
  transform: translateY(-2px);
  box-shadow: 0 10px 24px rgba(0,0,0,.08);
}
.gl-thumb img {
  width: 100%; height: 100%; display: block;
  object-fit: cover; aspect-ratio: 1/1; /* miniaturas cuadradas */
}

/* 6) Modal (visor) */
.gl-modal {
  position: fixed; inset: 0;
  background: rgba(0,0,0,.9);
  display: none; align-items: center; justify-content: center;
  z-index: 9999; padding: 24px;
}
.gl-modal[aria-hidden="false"] { display: flex; }

.gl-stage {
  position: relative;
  max-width: 92vw; max-height: 88vh; width: 100%; height: 100%;
  display: flex; align-items: center; justify-content: center; overflow: hidden;
  border-radius: 14px; background: #111;
  border: 1px solid rgba(255,255,255,.08);
  box-shadow: 0 12px 40px rgba(0,0,0,.6);
}
.gl-stage img {
  max-width: 100%; max-height: 100%; object-fit: contain; /* imagen entera y visible */
  display: block; user-select: none; -webkit-user-drag: none;
}

/* Marca de agua diagonal */
.gl-watermark {
  position: absolute; inset: 0; display: grid; place-items: center;
  pointer-events: none;
  font-family: 'Comic Neue', system-ui, -apple-system, Segoe UI, Roboto, Helvetica, Arial, sans-serif;
  font-weight: 700;
  font-size: clamp(1.4rem, 6vw, 3rem);
  color: rgba(255,255,255,.18);
  text-transform: uppercase; letter-spacing: .35rem;
  transform: rotate(-25deg);
  mix-blend-mode: overlay; text-align: center;
  padding: 24px; line-height: 1.2;
}

/* Controles del visor */
.gl-close {
  position: absolute; top: 18px; right: 18px;
  background: rgba(0,0,0,.6); color: #fff;
  border: 1px solid rgba(255,255,255,.25);
  border-radius: 999px; width: 44px; height: 44px;
  display: grid; place-items: center; cursor: pointer; font-size: 1.1rem;
}
.gl-close:hover { background: rgba(0,0,0,.7); }

.gl-nav {
  position: absolute; top: 50%; transform: translateY(-50%);
  background: rgba(0,0,0,.5); color: #fff;
  border: 1px solid rgba(255,255,255,.25);
  width: 44px; height: 60px; display: grid; place-items: center;
  cursor: pointer; border-radius: 10px;
}
.gl-prev { left: 18px; }
.gl-next { right: 18px; }
.gl-first { left: 18px; top: auto; bottom: 24px; transform: none; height: 44px; }
.gl-last  { right: 18px; top: auto; bottom: 24px; transform: none; height: 44px; }

.gl-nav:hover { background: rgba(0,0,0,.6); }

/* 7) Footer (igual libros) */
footer { background: var(--tono2); color: var(--tono3); padding: 20px 40px; }
footer .footer-content {
  display: flex; flex-direction: row; justify-content: space-between;
  align-items: center; gap: 20px; flex-wrap: wrap;
}
.footer-left p { margin: 0; }
.footer-center { text-align: center; }
.footer-nav a {
  margin: 0 10px; color: var(--tono3); text-decoration: none;
  display: inline-flex; align-items: center; gap: 5px;
}
.footer-nav a:hover { color: var(--tono7); }
.footer-social a { margin: 0 6px; color: var(--tono3); font-size: 18px; }
.footer-social a:hover { color: var(--tono4); }

/* 8) Responsive */
@media (max-width: 900px) {
  .gl-grid { grid-template-columns: repeat(auto-fill, minmax(120px, 1fr)); }
}

@media (max-width: 768px) {
  .navbar { flex-direction: column; gap: 10px; padding: 12px 16px; }
  .navbar h1 { font-size: 1.6rem; }
  .navbar a { font-size: 1rem; }
  .gl-grid  { grid-template-columns: repeat(auto-fill, minmax(110px, 1fr)); gap: 12px; }
  .gl-nav   { width: 40px; height: 52px; }
  .gl-first, .gl-last { height: 40px; }
  .gl-close { width: 40px; height: 40px; }
}

@media (max-width: 480px) {
  .gl-grid { grid-template-columns: repeat(auto-fill, minmax(100px, 1fr)); gap: 10px; }
}
