/* ========================================
   GALERÍA – Empresa Del Oeste EDO
   Colores sincronizados con index/styles.css
   ======================================== */

/* ── VARIABLES ── */
:root {
  --primary: #750c17;
  --secondary: #0047ab;
  --accent: #ff4d4d;
  --dark: #0a0e27;
  --darker: #050810;
  --light: #f8f9fa;
  --text: #e0e0e0;
  --border: #1a2540;
  --header-height: 95px;
  --gallery-gap: 14px;
}

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

html {
  scroll-behavior: smooth;
}

body {
  font-family: 'Inter', 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
  line-height: 1.6;
  color: var(--text);
  background: linear-gradient(135deg, var(--darker) 0%, var(--dark) 100%);
  min-height: 100vh;
  overflow-x: hidden;
}

/* ── SCROLLBAR ── */
::-webkit-scrollbar {
  width: 8px;
}
::-webkit-scrollbar-track {
  background: var(--darker);
}
::-webkit-scrollbar-thumb {
  background: linear-gradient(180deg, var(--primary), var(--secondary));
  border-radius: 4px;
}
::-webkit-scrollbar-thumb:hover {
  background: var(--accent);
}

/* ===================================================
   HEADER
   =================================================== */
header {
  background: linear-gradient(135deg, var(--primary) 0%, #5a0812 100%);
  padding: 1.2rem 2rem;
  box-shadow: 0 8px 32px rgba(117, 12, 23, 0.4), 0 2px 8px rgba(0, 0, 0, 0.2);
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: space-between;
  backdrop-filter: blur(10px);
  animation: slideDown 0.6s ease;
}

@keyframes slideDown {
  from { opacity: 0; transform: translateY(-100%); }
  to   { opacity: 1; transform: translateY(0); }
}

.logo {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.logo img {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--secondary), #003d8f);
  padding: 3px;
  transition: transform 0.3s ease;
}

.logo img:hover {
  transform: scale(1.1) rotate(2deg);
  box-shadow: 0 4px 12px rgba(255, 255, 255, 0.5);
}

.logo-text {
  color: #fff;
  font-weight: 900;
  font-size: 1.6rem;
  font-family: 'Bruno Ace SC', sans-serif;
  font-style: oblique;
  letter-spacing: 2.6px;
  text-transform: uppercase;
  background: linear-gradient(135deg, #fff, #e0e0e0);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.back-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.6rem 1.2rem;
  color: #fff;
  text-decoration: none;
  font-weight: 700;
  font-size: 0.9rem;
  letter-spacing: 0.5px;
  border: 2px solid rgba(255, 255, 255, 0.25);
  border-radius: 12px;
  background: linear-gradient(135deg, rgba(0, 71, 171, 0.25), rgba(255, 77, 77, 0.25));
  box-shadow: 0 8px 22px rgba(0, 0, 0, 0.3);
  transition: transform 0.2s ease, box-shadow 0.3s ease, border-color 0.2s ease;
}

.back-btn:hover {
  transform: translateY(-2px);
  border-color: var(--accent);
  box-shadow: 0 12px 28px rgba(255, 77, 77, 0.25);
}

/* ===================================================
   HERO SECTION
   =================================================== */
.gallery-hero {
  position: relative;
  height: 60vh;
  min-height: 400px;
  max-height: 600px;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-top: var(--header-height);
}

.hero-bg {
  position: absolute;
  inset: 0;
  z-index: 0;
}

.hero-bg img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  filter: brightness(0.4) saturate(1.2);
  transform: scale(1.1);
  transition: transform 0.1s linear;
}

.hero-overlay {
  position: absolute;
  inset: 0;
  z-index: 1;
  background: 
    linear-gradient(135deg, rgba(117, 12, 23, 0.55), rgba(0, 71, 171, 0.45)),
    linear-gradient(to bottom, transparent 50%, var(--darker) 100%);
}

.hero-content {
  position: relative;
  z-index: 2;
  text-align: center;
  padding: 2rem;
  animation: heroFadeIn 1s ease 0.3s both;
}

@keyframes heroFadeIn {
  from { opacity: 0; transform: translateY(30px); }
  to   { opacity: 1; transform: translateY(0); }
}

.hero-content h1 {
  font-family: 'Bruno Ace SC', sans-serif;
  font-style: oblique;
  font-size: clamp(2rem, 5vw, 3.5rem);
  font-weight: 900;
  color: #fff;
  text-transform: uppercase;
  letter-spacing: 3px;
  margin-bottom: 0.8rem;
  text-shadow: 0 4px 20px rgba(0, 0, 0, 0.5);
}

.hero-content h1 i {
  color: var(--accent);
  margin-right: 0.5rem;
  animation: iconPulse 2s ease-in-out infinite;
}

@keyframes iconPulse {
  0%, 100% { transform: scale(1); filter: drop-shadow(0 0 8px rgba(255, 77, 77, 0.6)); }
  50%      { transform: scale(1.1); filter: drop-shadow(0 0 16px rgba(255, 77, 77, 0.9)); }
}

.hero-content p {
  font-size: clamp(1rem, 2vw, 1.3rem);
  color: rgba(255, 255, 255, 0.85);
  font-weight: 300;
  letter-spacing: 1px;
  max-width: 600px;
  margin: 0 auto 2rem;
}

/* Stats */
.hero-stats {
  display: flex;
  justify-content: center;
  gap: 3rem;
  animation: heroFadeIn 1s ease 0.6s both;
}

.stat {
  display: flex;
  flex-direction: column;
  align-items: center;
}

.stat-number {
  font-family: 'Bruno Ace SC', sans-serif;
  font-size: 2.2rem;
  font-weight: 900;
  color: var(--accent);
  text-shadow: 0 0 20px rgba(255, 77, 77, 0.5);
}

.stat-label {
  font-size: 0.85rem;
  text-transform: uppercase;
  letter-spacing: 2px;
  color: rgba(255, 255, 255, 0.6);
  margin-top: 4px;
}

/* Scroll indicator */
.scroll-indicator {
  position: absolute;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 3;
  color: rgba(255, 255, 255, 0.5);
  font-size: 1.4rem;
  animation: bounce 2s ease-in-out infinite;
}

@keyframes bounce {
  0%, 100% { transform: translateX(-50%) translateY(0); }
  50%      { transform: translateX(-50%) translateY(10px); }
}

/* ===================================================
   FILTER SECTION
   =================================================== */
.filter-section {
  position: sticky;
  top: var(--header-height);
  z-index: 50;
  background: linear-gradient(135deg, rgba(0, 71, 171, 0.95), rgba(0, 61, 143, 0.95));
  backdrop-filter: blur(12px);
  border-bottom: 3px solid var(--accent);
  padding: 0.8rem 2rem;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
  opacity: 0;
  transform: translateY(-10px);
  transition: opacity 0.5s ease, transform 0.5s ease;
}

.filter-section.in-view {
  opacity: 1;
  transform: translateY(0);
}

.filter-bar {
  display: flex;
  justify-content: center;
  gap: 0.8rem;
  flex-wrap: wrap;
  max-width: 800px;
  margin: 0 auto;
}

.filter-btn {
  padding: 0.7rem 1.4rem;
  border: 2px solid rgba(255, 255, 255, 0.2);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.08);
  color: #fff;
  font-weight: 700;
  font-size: 0.85rem;
  text-transform: uppercase;
  letter-spacing: 0.8px;
  cursor: pointer;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
}

.filter-btn:hover {
  background: rgba(255, 77, 77, 0.15);
  border-color: var(--accent);
  transform: translateY(-2px);
  box-shadow: 0 6px 16px rgba(255, 77, 77, 0.2);
}

.filter-btn.active {
  background: linear-gradient(135deg, rgba(255, 77, 77, 0.25), rgba(117, 12, 23, 0.35));
  border-color: var(--accent);
  box-shadow: 0 0 14px rgba(255, 77, 77, 0.3), 0 8px 20px rgba(0, 0, 0, 0.2);
  color: #fff;
}

.filter-btn.active i {
  color: var(--accent);
}

/* ===================================================
   GALLERY GRID (Masonry-like with CSS Grid)
   =================================================== */
.gallery-main {
  max-width: 1400px;
  margin: 0 auto;
  padding: 3rem 2rem 4rem;
  opacity: 0;
  transform: translateY(20px);
  transition: opacity 0.6s ease, transform 0.6s ease;
}

.gallery-main.in-view {
  opacity: 1;
  transform: translateY(0);
}

.gallery-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  grid-auto-rows: 280px;
  gap: var(--gallery-gap);
  grid-auto-flow: dense;
}

/* Size modifiers for masonry effect */
.gallery-item--large {
  grid-column: span 2;
  grid-row: span 2;
}

.gallery-item--medium {
  grid-row: span 1;
}

.gallery-item--small {
  grid-row: span 1;
}

/* ── ITEM STYLES ── */
.gallery-item {
  position: relative;
  border-radius: 16px;
  overflow: hidden;
  cursor: pointer;
  opacity: 0;
  transform: translateY(30px) scale(0.95);
  transition: opacity 0.5s ease, transform 0.5s ease;
}

.gallery-item--visible {
  opacity: 1;
  transform: translateY(0) scale(1);
}

.gallery-item__inner {
  width: 100%;
  height: 100%;
  position: relative;
  overflow: hidden;
  border-radius: 16px;
  border: 2px solid var(--border);
  transition: border-color 0.4s ease, box-shadow 0.4s ease;
}

.gallery-item:hover .gallery-item__inner {
  border-color: var(--accent);
  box-shadow: 
    0 20px 50px rgba(0, 0, 0, 0.5),
    0 0 30px rgba(255, 77, 77, 0.15),
    0 0 60px rgba(0, 71, 171, 0.1);
}

.gallery-item__inner img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  filter: brightness(0.85) saturate(1.1);
  transition: transform 0.6s cubic-bezier(0.4, 0, 0.2, 1), filter 0.4s ease;
}

.gallery-item:hover .gallery-item__inner img {
  transform: scale(1.08);
  filter: brightness(0.5) saturate(1.3);
}

/* Overlay */
.gallery-item__overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(
    to top,
    rgba(5, 8, 16, 0.95) 0%,
    rgba(117, 12, 23, 0.3) 50%,
    transparent 100%
  );
  display: flex;
  align-items: flex-end;
  padding: 1.5rem;
  opacity: 0;
  transition: opacity 0.4s ease;
}

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

.gallery-item__info {
  transform: translateY(15px);
  transition: transform 0.4s cubic-bezier(0.4, 0, 0.2, 1);
  width: 100%;
}

.gallery-item:hover .gallery-item__info {
  transform: translateY(0);
}

.gallery-item__category {
  display: inline-block;
  padding: 0.3rem 0.8rem;
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 1.5px;
  color: #fff;
  background: linear-gradient(135deg, rgba(255, 77, 77, 0.4), rgba(0, 71, 171, 0.4));
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.15);
  margin-bottom: 0.6rem;
  font-weight: 600;
}

.gallery-item__title {
  font-family: 'Bruno Ace SC', sans-serif;
  font-size: 1.1rem;
  color: #fff;
  margin-bottom: 0.4rem;
  text-shadow: 0 2px 8px rgba(0, 0, 0, 0.5);
}

.gallery-item__desc {
  font-size: 0.85rem;
  color: rgba(255, 255, 255, 0.7);
  line-height: 1.5;
  margin-bottom: 0.8rem;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.gallery-item__view {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.8rem;
  color: var(--accent);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 1px;
}

.gallery-item__view i {
  transition: transform 0.3s ease;
}

.gallery-item:hover .gallery-item__view i {
  transform: scale(1.2);
}

/* Animated shimmer over cards */
.gallery-item__inner::before {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(
    90deg,
    transparent,
    rgba(255, 77, 77, 0.08),
    transparent
  );
  transition: left 0.6s ease;
  z-index: 1;
  pointer-events: none;
}

.gallery-item:hover .gallery-item__inner::before {
  left: 100%;
}

/* ===================================================
   LIGHTBOX
   =================================================== */
.lightbox {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.4s ease, visibility 0.4s ease;
}

.lightbox.active {
  opacity: 1;
  visibility: visible;
}

.lightbox-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(5, 8, 16, 0.92);
  backdrop-filter: blur(20px);
}

.lightbox-close {
  position: absolute;
  top: 20px;
  right: 24px;
  z-index: 1002;
  width: 48px;
  height: 48px;
  border-radius: 50%;
  border: 2px solid rgba(255, 255, 255, 0.2);
  background: rgba(255, 77, 77, 0.15);
  color: #fff;
  font-size: 1.3rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.3s ease;
}

.lightbox-close:hover {
  background: var(--accent);
  border-color: var(--accent);
  transform: rotate(90deg) scale(1.1);
  box-shadow: 0 0 20px rgba(255, 77, 77, 0.5);
}

.lightbox-nav {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  z-index: 1002;
  width: 52px;
  height: 52px;
  border-radius: 50%;
  border: 2px solid rgba(255, 255, 255, 0.2);
  background: rgba(0, 71, 171, 0.2);
  color: #fff;
  font-size: 1.2rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.3s ease;
}

.lightbox-prev { left: 20px; }
.lightbox-next { right: 20px; }

.lightbox-nav:hover {
  background: var(--accent);
  border-color: var(--accent);
  box-shadow: 0 0 20px rgba(255, 77, 77, 0.4);
  transform: translateY(-50%) scale(1.1);
}

.lightbox-content {
  position: relative;
  z-index: 1001;
  max-width: 85vw;
  max-height: 85vh;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.lightbox-content img {
  max-width: 100%;
  max-height: 70vh;
  object-fit: contain;
  border-radius: 12px;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.6), 0 0 40px rgba(117, 12, 23, 0.2);
  animation: lightboxZoomIn 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

@keyframes lightboxZoomIn {
  from { opacity: 0; transform: scale(0.85); }
  to   { opacity: 1; transform: scale(1); }
}

.lightbox-info {
  text-align: center;
  margin-top: 1.2rem;
  animation: lightboxFadeUp 0.5s ease 0.2s both;
}

@keyframes lightboxFadeUp {
  from { opacity: 0; transform: translateY(10px); }
  to   { opacity: 1; transform: translateY(0); }
}

.lightbox-info h3 {
  font-family: 'Bruno Ace SC', sans-serif;
  font-size: 1.3rem;
  color: #fff;
  margin-bottom: 0.4rem;
  text-shadow: 0 2px 10px rgba(0, 0, 0, 0.5);
}

.lightbox-info p {
  font-size: 0.95rem;
  color: rgba(255, 255, 255, 0.7);
  max-width: 500px;
}

.lightbox-counter {
  display: inline-block;
  margin-top: 0.8rem;
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--accent);
  padding: 0.3rem 1rem;
  border: 1px solid rgba(255, 77, 77, 0.3);
  border-radius: 999px;
  background: rgba(255, 77, 77, 0.1);
  letter-spacing: 2px;
}

/* ===================================================
   FOOTER
   =================================================== */
footer {
  background: linear-gradient(135deg, var(--primary) 0%, #3a060b 100%);
  padding: 2.5rem 2rem;
  text-align: center;
  border-top: 3px solid var(--accent);
  opacity: 0;
  transform: translateY(20px);
  transition: opacity 0.6s ease, transform 0.6s ease;
}

footer.in-view {
  opacity: 1;
  transform: translateY(0);
}

.footer-content {
  max-width: 600px;
  margin: 0 auto;
}

.footer-logo {
  display: inline-flex;
  align-items: center;
  gap: 0.8rem;
  text-decoration: none;
  margin-bottom: 1rem;
  transition: transform 0.3s ease;
}

.footer-logo:hover {
  transform: scale(1.03);
}

.footer-logo img {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  border: 2px solid rgba(255, 255, 255, 0.15);
}

.footer-logo span {
  font-family: 'Bruno Ace SC', sans-serif;
  font-size: 1.1rem;
  color: #fff;
  text-transform: uppercase;
  letter-spacing: 2px;
}

footer p {
  color: rgba(255, 255, 255, 0.5);
  font-size: 0.85rem;
  margin-top: 0.8rem;
}

/* ===================================================
   RESPONSIVE
   =================================================== */
@media (max-width: 1024px) {
  .gallery-grid {
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    grid-auto-rows: 250px;
  }
  .gallery-item--large {
    grid-column: span 2;
    grid-row: span 2;
  }
}

@media (max-width: 768px) {
  :root {
    --header-height: 80px;
  }

  .logo-text {
    font-size: 1.1rem;
    letter-spacing: 1.5px;
  }

  .back-btn {
    font-size: 0.8rem;
    padding: 0.5rem 1rem;
  }

  .gallery-hero {
    height: 50vh;
    min-height: 320px;
  }

  .hero-stats {
    gap: 1.8rem;
  }

  .stat-number {
    font-size: 1.6rem;
  }

  .gallery-grid {
    grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
    grid-auto-rows: 220px;
  }

  .gallery-item--large {
    grid-column: span 1;
    grid-row: span 2;
  }

  .filter-bar {
    gap: 0.5rem;
  }

  .filter-btn {
    padding: 0.5rem 1rem;
    font-size: 0.75rem;
  }

  .lightbox-nav {
    width: 42px;
    height: 42px;
  }
  .lightbox-prev { left: 10px; }
  .lightbox-next { right: 10px; }
}

@media (max-width: 480px) {
  :root {
    --header-height: 70px;
  }

  .logo-text {
    font-size: 0.9rem;
    letter-spacing: 1px;
  }

  .back-btn span {
    display: none;
  }

  .gallery-hero {
    height: 45vh;
    min-height: 280px;
  }

  .hero-content h1 {
    font-size: 1.5rem;
  }

  .hero-stats {
    gap: 1.2rem;
  }

  .stat-number {
    font-size: 1.3rem;
  }

  .stat-label {
    font-size: 0.7rem;
    letter-spacing: 1px;
  }

  .gallery-grid {
    grid-template-columns: 1fr;
    grid-auto-rows: 200px;
  }

  .gallery-item--large {
    grid-column: span 1;
    grid-row: span 1;
  }

  .gallery-main {
    padding: 2rem 1rem;
  }

  .filter-btn {
    padding: 0.45rem 0.8rem;
    font-size: 0.7rem;
  }

  .lightbox-content {
    max-width: 95vw;
  }

  .lightbox-nav {
    width: 36px;
    height: 36px;
    font-size: 1rem;
  }
  .lightbox-prev { left: 6px; }
  .lightbox-next { right: 6px; }
}

/* ===================================================
   UTILITY ANIMATIONS
   =================================================== */
@keyframes fadeIn {
  from { opacity: 0; }
  to   { opacity: 1; }
}

/* Particle-like ambient glow behind the gallery */
.gallery-main::before {
  content: '';
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 600px;
  height: 600px;
  background: radial-gradient(circle, rgba(255, 77, 77, 0.04) 0%, transparent 70%);
  pointer-events: none;
  z-index: -1;
}

.gallery-main::after {
  content: '';
  position: fixed;
  top: 30%;
  right: 10%;
  width: 400px;
  height: 400px;
  background: radial-gradient(circle, rgba(0, 71, 171, 0.05) 0%, transparent 70%);
  pointer-events: none;
  z-index: -1;
}
