/* ==========================================================================
   Plitvice — La Sinfonía Verde del Agua y los Lagos
   Sistema de Diseño: Naturaleza & Esmeralda
   ========================================================================== */



:root {
  --bg-dark: #041410;
  --bg-surface: #0a211b;
  --bg-card: #102d25;
  --text-main: #f0f7f4;
  --text-muted: #a3c2b8;
  
  --accent-emerald: #2ec4b6;
  --accent-mint: #80ed99;
  --accent-gold: #e2b97c;
  
  --font-serif: 'Cormorant Garamond', Georgia, serif;
  --font-sans: 'Plus Jakarta Sans', system-ui, -apple-system, sans-serif;
  
  --radius-lg: 16px;
  --radius-md: 10px;
  --radius-sm: 6px;
  
  --shadow-main: 0 10px 30px rgba(0, 0, 0, 0.4);
  --shadow-glow: 0 0 20px rgba(46, 196, 182, 0.25);
  
  --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

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

html {
  scroll-behavior: smooth;
  scrollbar-gutter: stable;
  background-color: var(--bg-dark);
  color: var(--text-main);
  font-family: var(--font-sans);
  font-size: 16px;
  line-height: 1.6;
}

body {
  overflow-x: hidden;
  background: radial-gradient(circle at 50% 0%, #0d352b 0%, #041410 70%);
  min-height: 100vh;
}

/* --------------------------------------------------------------------------
   HERO HEADER
   -------------------------------------------------------------------------- */
.hero {
  position: relative;
  padding: 5rem 1.5rem 4rem;
  text-align: center;
  max-width: 1000px;
  margin: 0 auto;
}

.hero-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.4rem 1rem;
  background: rgba(46, 196, 182, 0.12);
  border: 1px solid rgba(46, 196, 182, 0.3);
  border-radius: 50px;
  color: var(--accent-emerald);
  font-size: 0.875rem;
  font-weight: 600;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  margin-bottom: 1.5rem;
}

.hero-title {
  font-family: var(--font-serif);
  font-size: clamp(3.5rem, 8vw, 6.5rem);
  font-weight: 700;
  letter-spacing: 0.08em;
  line-height: 1;
  background: linear-gradient(135deg, #ffffff 30%, var(--accent-emerald) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  margin-bottom: 1rem;
  text-shadow: 0 10px 40px rgba(0,0,0,0.5);
}

.hero-subtitle {
  font-size: clamp(1.1rem, 2vw, 1.35rem);
  color: var(--text-muted);
  max-width: 800px;
  margin: 0 auto 3rem;
  font-weight: 400;
  text-wrap: balance;
}

.hero-stats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 1.5rem;
  margin-top: 2rem;
}

.stat-item {
  background: rgba(10, 33, 27, 0.6);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: var(--radius-md);
  padding: 1.25rem 1rem;
  transition: var(--transition);
}

.stat-item:hover {
  border-color: rgba(46, 196, 182, 0.4);
  transform: translateY(-3px);
  box-shadow: var(--shadow-glow);
}

.stat-number {
  font-family: var(--font-serif);
  font-size: 2.25rem;
  font-weight: 700;
  color: var(--accent-emerald);
  line-height: 1.1;
}

.stat-label {
  font-size: 0.8rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-top: 0.25rem;
}

/* --------------------------------------------------------------------------
   STORY SECTION
   -------------------------------------------------------------------------- */
.story-section {
  max-width: 1000px;
  margin: 0 auto 4rem;
  padding: 0 1.5rem;
}

.story-card {
  background: var(--bg-surface);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: var(--radius-lg);
  padding: 2.5rem;
  box-shadow: var(--shadow-main);
}

.story-title {
  font-family: var(--font-serif);
  font-size: 2.2rem;
  color: var(--accent-gold);
  margin-bottom: 1.5rem;
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.story-text {
  color: var(--text-main);
  font-size: 1.05rem;
  margin-bottom: 1.25rem;
  opacity: 0.95;
}

.story-highlights {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 1.5rem;
  margin-top: 2rem;
}

.highlight-box {
  background: var(--bg-card);
  border-left: 3px solid var(--accent-emerald);
  padding: 1.25rem;
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
}

.highlight-box h4 {
  font-size: 1.1rem;
  color: var(--accent-emerald);
  margin-bottom: 0.5rem;
}

.highlight-box p {
  font-size: 0.9rem;
  color: var(--text-muted);
}

/* --------------------------------------------------------------------------
   FILTROS DE GALERÍA
   -------------------------------------------------------------------------- */
.filters-container {
  position: sticky;
  top: 1rem;
  z-index: 100;
  max-width: 1000px;
  margin: 0 auto 3rem;
  padding: 0 1.5rem;
}

.filters-wrapper {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.75rem;
  background: rgba(4, 20, 16, 0.85);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid rgba(255, 255, 255, 0.1);
  padding: 0.75rem 1rem;
  border-radius: 50px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
}

.filter-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.5rem 1.25rem;
  background: transparent;
  border: 1px solid transparent;
  border-radius: 30px;
  color: var(--text-muted);
  font-family: var(--font-sans);
  font-size: 0.9rem;
  font-weight: 500;
  cursor: pointer;
  transition: var(--transition);
}

.filter-btn:hover {
  color: var(--text-main);
  background: rgba(255, 255, 255, 0.05);
}

.filter-btn.active {
  background: var(--accent-emerald);
  color: #041410;
  font-weight: 700;
  box-shadow: 0 0 15px rgba(46, 196, 182, 0.4);
}

.filter-count {
  font-size: 0.75rem;
  padding: 0.15rem 0.45rem;
  border-radius: 20px;
  background: rgba(255, 255, 255, 0.15);
}

.filter-btn.active .filter-count {
  background: rgba(4, 20, 16, 0.2);
  color: #041410;
}

/* --------------------------------------------------------------------------
   GALERÍA MASONRY
   -------------------------------------------------------------------------- */
.gallery-container {
  max-width: 1400px;
  margin: 0 auto;
  padding: 0 1.5rem 5rem;
}

.gallery-grid {
  column-count: 3;
  column-gap: 1.5rem;
}

@media (max-width: 1024px) {
  .gallery-grid {
    column-count: 2;
  }
}

@media (max-width: 640px) {
  .gallery-grid {
    column-count: 1;
  }
}

.gallery-item {
  break-inside: avoid;
  margin-bottom: 1.5rem;
  background: var(--bg-surface);
  border-radius: var(--radius-md);
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.08);
  cursor: pointer;
  transition: var(--transition);
}

.gallery-item:hover {
  transform: translateY(-5px);
  border-color: var(--accent-emerald);
  box-shadow: var(--shadow-glow);
}

.gallery-img-wrapper {
  position: relative;
  width: 100%;
  overflow: hidden;
  background: #081a15;
}

.gallery-img-wrapper img {
  display: block;
  width: 100%;
  height: auto;
  transition: transform 0.6s cubic-bezier(0.25, 1, 0.5, 1);
}

.gallery-item:hover .gallery-img-wrapper img {
  transform: scale(1.05);
}

.gallery-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(to top, rgba(4, 20, 16, 0.95) 0%, transparent 60%);
  opacity: 0;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  padding: 1.25rem;
  transition: opacity 0.3s ease;
}

.gallery-item:hover .gallery-overlay {
  opacity: 1;
}

.gallery-category-badge {
  align-self: flex-start;
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--accent-emerald);
  margin-bottom: 0.25rem;
}

.gallery-title {
  font-family: var(--font-serif);
  font-size: 1.25rem;
  color: #fff;
  line-height: 1.2;
}

/* --------------------------------------------------------------------------
   VISOR LIGHTBOX MODAL
   -------------------------------------------------------------------------- */
/* --------------------------------------------------------------------------
   VISOR LIGHTBOX MODAL — Imagen maximizada a pantalla completa (estilo Zadar)
   El cuerpo ocupa el 100% del visor; contador, flechas y leyenda flotan
   sobre la foto con degradados que garantizan la legibilidad del texto.
   -------------------------------------------------------------------------- */
.lightbox {
  position: fixed;
  inset: 0;
  z-index: 9999;
  background: rgba(3, 12, 10, 0.97);
  backdrop-filter: blur(20px);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease;
}

.lightbox.active {
  opacity: 1;
  pointer-events: auto;
}

/* Cuerpo a pantalla completa: ningún padding que reste espacio a la foto */
.lightbox-body {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
}

.lightbox-img-container {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* La foto crece hasta el límite real del visor. 100dvh contempla las
   barras dinámicas de los navegadores móviles. Nunca se recorta: contain. */
.lightbox-img {
  max-width: 100%;
  max-height: 100vh;
  max-height: 100dvh;
  width: auto;
  height: auto;
  object-fit: contain;
  border-radius: 2px;
  box-shadow: 0 25px 70px rgba(0, 0, 0, 0.9);
  transition: opacity 0.3s ease;
  cursor: pointer;
}

/* Barra superior flotante: contador + acciones */
.lightbox-header {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.9rem 1.25rem;
  background: linear-gradient(to bottom, rgba(4, 20, 16, 0.85), transparent);
  z-index: 10;
}

.lightbox-counter {
  font-family: var(--font-serif);
  font-size: 1.1rem;
  color: var(--accent-emerald);
  font-weight: 700;
  text-shadow: 0 1px 8px rgba(0, 0, 0, 0.8);
}

.lightbox-actions {
  display: flex;
  gap: 0.6rem;
}

.lightbox-icon-btn,
.lightbox-close {
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.15);
  color: #fff;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  font-size: 1.2rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: var(--transition);
  backdrop-filter: blur(8px);
}

.lightbox-icon-btn:hover,
.lightbox-close:hover {
  background: var(--accent-emerald);
  color: #041410;
  border-color: var(--accent-emerald);
}

.lightbox-close:hover {
  transform: rotate(90deg);
}

/* Flechas superpuestas: no reservan margen lateral */
.lightbox-nav {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  background: rgba(10, 33, 27, 0.6);
  border: 1px solid rgba(255, 255, 255, 0.15);
  color: #fff;
  width: 52px;
  height: 52px;
  border-radius: 50%;
  font-size: 1.5rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: var(--transition);
  backdrop-filter: blur(8px);
  z-index: 10;
}

.lightbox-nav:hover {
  background: var(--accent-emerald);
  color: #041410;
  border-color: var(--accent-emerald);
}

.lightbox-prev { left: 1rem; }
.lightbox-next { right: 1rem; }

/* Leyenda flotante: permanece visible sin restar altura a la imagen.
   El degradado hace legible el texto sobre cualquier fotografía. */
.lightbox-caption {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  padding: 4rem 1.5rem 1.4rem;
  background: linear-gradient(to top, rgba(4, 20, 16, 0.92) 0%, rgba(4, 20, 16, 0.55) 55%, transparent 100%);
  text-align: center;
  z-index: 10;
  pointer-events: none;
  transition: transform 0.35s ease, opacity 0.35s ease;
}

.lightbox-caption-title {
  font-family: var(--font-serif);
  font-size: 1.5rem;
  color: var(--accent-gold);
  margin-bottom: 0.35rem;
  text-shadow: 0 2px 12px rgba(0, 0, 0, 0.85);
}

.lightbox-caption-desc {
  font-size: 0.95rem;
  color: var(--text-main);
  line-height: 1.6;
  max-width: 860px;
  margin: 0 auto;
  text-shadow: 0 1px 8px rgba(0, 0, 0, 0.85);
}

/* Modo "foto limpia": la leyenda se retira suavemente hacia abajo */
.lightbox.caption-hidden .lightbox-caption {
  transform: translateY(100%);
  opacity: 0;
}

.lightbox-spinner {
  position: absolute;
  top: calc(50% - 24px);
  left: calc(50% - 24px);
  width: 48px;
  height: 48px;
  border: 4px solid rgba(46, 196, 182, 0.2);
  border-top-color: var(--accent-emerald);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
  display: none;
}

/* Ajustes móviles del visor */
@media (max-width: 640px) {
  .lightbox-nav {
    width: 42px;
    height: 42px;
    font-size: 1.2rem;
  }
  .lightbox-prev { left: 0.5rem; }
  .lightbox-next { right: 0.5rem; }
  .lightbox-caption { padding: 3rem 1rem 1rem; }
  .lightbox-caption-title { font-size: 1.1rem; }
  .lightbox-caption-desc { font-size: 0.85rem; }
}

/* --------------------------------------------------------------------------
   BOTÓN VOLVER ARRIBA Y FOOTER
   -------------------------------------------------------------------------- */
.back-to-top {
  position: fixed;
  bottom: 2rem;
  right: 2rem;
  width: 48px;
  height: 48px;
  background: var(--accent-emerald);
  color: #041410;
  border: none;
  border-radius: 50%;
  font-size: 1.25rem;
  font-weight: 700;
  cursor: pointer;
  box-shadow: var(--shadow-glow);
  opacity: 0;
  pointer-events: none;
  transition: var(--transition);
  z-index: 90;
}

.back-to-top.visible {
  opacity: 1;
  pointer-events: auto;
}

.footer {
  text-align: center;
  padding: 3rem 1.5rem;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  color: var(--text-muted);
  font-size: 0.9rem;
  background: #020b08;
}

/* ==========================================================================
   MEJORAS DE EXCELENCIA
   ========================================================================== */

:root {
  color-scheme: dark;
}

/* Skip link accesible */
.skip-link {
  position: absolute;
  top: -100px;
  left: 1rem;
  z-index: 10000;
  padding: 0.75rem 1.25rem;
  background: var(--accent-emerald);
  color: #041410;
  font-weight: 700;
  border-radius: 0 0 var(--radius-md) var(--radius-md);
  text-decoration: none;
  transition: top 0.2s ease;
}

.skip-link:focus {
  top: 0;
}

/* Foco visible consistente */
:focus-visible {
  outline: 3px solid var(--accent-mint);
  outline-offset: 3px;
  border-radius: 4px;
}

.gallery-item:focus-visible {
  outline-offset: -3px;
}

#gallery-grid:focus {
  outline: none;
}

/* Estado vacío */
.gallery-empty {
  padding: 4rem 1.5rem;
  text-align: center;
  color: var(--text-muted);
  background: var(--bg-surface);
  border: 1px dashed rgba(255, 255, 255, 0.15);
  border-radius: var(--radius-lg);
}

/* Evitar scroll encadenado en lightbox */
.lightbox {
  overscroll-behavior: contain;
}

/* Mejora de legibilidad en leyenda */
.lightbox-caption-desc {
  text-wrap: pretty;
}

/* Respeta usuarios con movimiento reducido */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}

/* Mejora para alto contraste */
@media (prefers-contrast: more) {
  .filter-btn,
  .stat-item,
  .story-card,
  .gallery-item {
    border-color: rgba(255, 255, 255, 0.35);
  }
}

