/* Galería: enlazar después de main.css */

.nav-links a.active {
  color: var(--orange);
}

/* HERO GALERÍA */
.gallery-hero {
  padding-top: 80px;
  min-height: min(52vh, 520px);
  background: var(--dark2);
  display: flex;
  align-items: center;
  position: relative;
  overflow: hidden;
  border-bottom: 3px solid var(--orange);
}
.gallery-hero-media {
  position: absolute;
  inset: 0;
  z-index: 0;
  background: var(--dark2);
  overflow: hidden;
}
.gallery-hero-video {
  position: absolute;
  left: 50%;
  top: 50%;
  width: 100%;
  height: 100%;
  min-width: 100%;
  min-height: 100%;
  transform: translate(-50%, -50%) scale(1.03);
  object-fit: cover;
  object-position: center;
  pointer-events: none;
}
.gallery-hero-media::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(
    105deg,
    rgba(34, 52, 126, 0.92) 0%,
    rgba(34, 52, 126, 0.72) 42%,
    rgba(26, 40, 96, 0.45) 100%
  );
  pointer-events: none;
}
.gallery-hero-bg {
  position: absolute;
  inset: 0;
  z-index: 1;
  background-image: linear-gradient(rgba(232, 92, 13, 0.06) 1px, transparent 1px),
    linear-gradient(90deg, rgba(232, 92, 13, 0.06) 1px, transparent 1px);
  background-size: 60px 60px;
  pointer-events: none;
}
.gallery-hero-accent {
  position: absolute;
  right: -5%;
  top: 50%;
  transform: translateY(-50%);
  z-index: 1;
  width: 500px;
  height: 500px;
  background: radial-gradient(circle, rgba(34, 96, 168, 0.22) 0%, transparent 70%);
  border-radius: 50%;
  pointer-events: none;
}
.gallery-hero-content {
  position: relative;
  z-index: 2;
  padding: 4rem 8%;
}
.hero-breadcrumb {
  font-family: "Barlow Condensed", sans-serif;
  font-size: 0.75rem;
  letter-spacing: 3px;
  text-transform: uppercase;
  color: var(--gray);
  margin-bottom: 1rem;
}
.hero-breadcrumb a {
  color: var(--orange);
  text-decoration: none;
}
.hero-breadcrumb a:hover {
  text-decoration: underline;
}
.gallery-hero h1 {
  font-family: "Bebas Neue", sans-serif;
  font-size: clamp(3rem, 7vw, 6rem);
  letter-spacing: 2px;
  line-height: 0.95;
  color: var(--white);
  text-shadow: 0 2px 28px rgba(15, 22, 58, 0.55);
  font-weight: 700;
}
.gallery-hero h1 span {
  color: var(--orange);
}
.gallery-hero p {
  color: var(--gray-light);
  max-width: 560px;
  line-height: 1.7;
  margin-top: 1.2rem;
  font-size: 1rem;
  font-weight: 700;
}

/* FILTER BAR */
.filter-bar {
  padding: 2.5rem 8% 0;
  display: flex;
  gap: 0.75rem;
  flex-wrap: wrap;
  align-items: center;
}
.filter-label {
  font-family: "Barlow Condensed", sans-serif;
  font-size: 0.7rem;
  letter-spacing: 3px;
  text-transform: uppercase;
  color: var(--gray);
  margin-right: 0.5rem;
}
.filter-btn {
  font-family: "Barlow Condensed", sans-serif;
  font-size: 0.8rem;
  letter-spacing: 2px;
  text-transform: uppercase;
  background: var(--dark3);
  color: var(--gray-light);
  border: 1px solid rgba(255, 255, 255, 0.1);
  padding: 8px 20px;
  cursor: pointer;
  transition: all 0.2s;
}
.filter-btn:hover,
.filter-btn.active {
  background: var(--orange);
  color: var(--white);
  border-color: var(--orange);
}

/* GALLERY GRID */
.gallery-section {
  padding: 2.5rem 8% 6rem;
}
.gallery-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 2px;
  background: rgba(255, 255, 255, 0.04);
}

/* GALLERY CARD */
.gallery-card {
  position: relative;
  overflow: hidden;
  cursor: pointer;
  aspect-ratio: 4/3;
  background: var(--dark3);
  transition: transform 0.3s;
}
.gallery-card:hover {
  z-index: 2;
}
.gallery-card:nth-child(3n + 1) {
  grid-column: span 1;
}
.gallery-card.wide {
  grid-column: span 2;
  aspect-ratio: 16/7;
}
.gallery-card img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.5s ease, filter 0.4s ease;
  filter: brightness(0.8) saturate(0.9);
  display: block;
}
.gallery-card:hover img {
  transform: scale(1.06);
  filter: brightness(1) saturate(1.1);
}

.gallery-placeholder {
  width: 100%;
  height: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 1rem;
  background: var(--dark3);
  border: 1px dashed rgba(232, 92, 13, 0.3);
  transition: border-color 0.2s;
}
.gallery-card:hover .gallery-placeholder {
  border-color: var(--orange);
}
.placeholder-icon {
  font-size: 2.5rem;
  opacity: 0.4;
}
.placeholder-text {
  font-family: "Barlow Condensed", sans-serif;
  font-size: 0.75rem;
  letter-spacing: 2px;
  text-transform: uppercase;
  color: var(--gray);
  text-align: center;
  line-height: 1.5;
}

/* CARD OVERLAY */
.card-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(
    to top,
    rgba(34, 52, 126, 0.92) 0%,
    rgba(34, 52, 126, 0.2) 50%,
    transparent 100%
  );
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  padding: 1.5rem;
  opacity: 0;
  transition: opacity 0.35s ease;
}
.gallery-card:hover .card-overlay {
  opacity: 1;
}
.card-category {
  font-family: "Barlow Condensed", sans-serif;
  font-size: 0.65rem;
  letter-spacing: 3px;
  text-transform: uppercase;
  color: var(--orange);
  margin-bottom: 0.3rem;
}
.card-title {
  font-family: "Bebas Neue", sans-serif;
  font-size: 1.4rem;
  letter-spacing: 2px;
  color: var(--white);
}
.card-desc {
  font-size: 0.82rem;
  color: var(--gray-light);
  margin-top: 0.3rem;
  line-height: 1.4;
}
.card-zoom {
  position: absolute;
  top: 1rem;
  right: 1rem;
  width: 36px;
  height: 36px;
  background: var(--orange);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1rem;
}

/* EMPTY STATE */
.gallery-empty {
  display: none;
  text-align: center;
  padding: 5rem 2rem;
}
.gallery-empty.show {
  display: block;
}
.gallery-empty h3 {
  font-family: "Bebas Neue", sans-serif;
  font-size: 2rem;
  letter-spacing: 2px;
  color: var(--gray);
  margin-bottom: 0.5rem;
}
.gallery-empty p {
  color: var(--gray);
  font-size: 0.9rem;
}

/* LIGHTBOX */
.lightbox {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 9000;
  background: rgba(34, 52, 126, 0.96);
  backdrop-filter: blur(8px);
  align-items: center;
  justify-content: center;
  flex-direction: column;
}
.lightbox.open {
  display: flex;
}
.lightbox-close {
  position: absolute;
  top: 1.5rem;
  right: 1.5rem;
  width: 44px;
  height: 44px;
  background: var(--orange);
  border: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.2rem;
  color: var(--white);
  clip-path: polygon(0 0, calc(100% - 8px) 0, 100% 8px, 100% 100%, 8px 100%, 0 calc(100% - 8px));
  z-index: 9001;
}
.lightbox-img-wrap {
  max-width: 90vw;
  max-height: 78vh;
  display: flex;
  align-items: center;
  justify-content: center;
}
.lightbox img {
  max-width: 90vw;
  max-height: 78vh;
  object-fit: contain;
  display: block;
}
.lightbox-placeholder {
  width: min(80vw, 700px);
  height: min(60vh, 450px);
  background: var(--dark3);
  border: 1px dashed rgba(232, 92, 13, 0.4);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 1rem;
}
.lightbox-placeholder span {
  font-size: 3rem;
  opacity: 0.3;
}
.lightbox-placeholder p {
  font-family: "Barlow Condensed", sans-serif;
  font-size: 0.85rem;
  letter-spacing: 2px;
  text-transform: uppercase;
  color: var(--gray);
}
.lightbox-info {
  margin-top: 1.5rem;
  text-align: center;
}
.lightbox-cat {
  font-family: "Barlow Condensed", sans-serif;
  font-size: 0.7rem;
  letter-spacing: 3px;
  text-transform: uppercase;
  color: var(--orange);
  margin-bottom: 0.3rem;
}
.lightbox-title {
  font-family: "Bebas Neue", sans-serif;
  font-size: 1.8rem;
  letter-spacing: 2px;
  color: var(--white);
}
.lightbox-desc {
  font-size: 0.9rem;
  color: var(--gray-light);
  margin-top: 0.3rem;
}
.lightbox-nav {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  display: flex;
  justify-content: space-between;
  width: 100%;
  padding: 0 1rem;
  pointer-events: none;
}
.lightbox-nav button {
  pointer-events: all;
  width: 48px;
  height: 48px;
  background: rgba(232, 92, 13, 0.8);
  border: none;
  cursor: pointer;
  color: var(--white);
  font-size: 1.3rem;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.2s;
}
.lightbox-nav button:hover {
  background: var(--orange);
}
.lightbox-counter {
  position: absolute;
  top: 1.5rem;
  left: 50%;
  transform: translateX(-50%);
  font-family: "Barlow Condensed", sans-serif;
  font-size: 0.75rem;
  letter-spacing: 3px;
  text-transform: uppercase;
  color: var(--gray);
}

@media (max-width: 900px) {
  .gallery-card.wide {
    grid-column: span 1;
    aspect-ratio: 4/3;
  }
  .gallery-grid {
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
  }
  .filter-bar {
    padding: 2rem 6% 0;
  }
  .gallery-section {
    padding: 2rem 6% 4rem;
  }
  .gallery-hero-content {
    padding: 3rem 6%;
  }
}

@media (max-width: 560px) {
  .gallery-grid {
    grid-template-columns: 1fr 1fr;
    gap: 2px;
  }
  .gallery-card {
    aspect-ratio: 1/1;
  }
}

@media (prefers-reduced-motion: reduce) {
  .gallery-hero-video {
    display: none;
  }
  .gallery-hero-media {
    background: var(--dark2) url("../webp/galery_001.webp") center / cover no-repeat;
  }
}

/* Tema claro: bloques solo de galería/lightbox */
body.light-mode .gallery-hero {
  background: var(--dark2);
}
body.light-mode .gallery-hero-media {
  background-color: var(--dark2);
}
body.light-mode .gallery-hero-media::after {
  background: linear-gradient(
    105deg,
    rgba(244, 244, 240, 0.94) 0%,
    rgba(244, 244, 240, 0.78) 45%,
    rgba(232, 232, 228, 0.55) 100%
  );
}
body.light-mode .gallery-hero h1 {
  text-shadow: 0 1px 14px rgba(255, 255, 255, 0.35);
}
body.light-mode .gallery-hero p {
  text-shadow: 0 1px 10px rgba(255, 255, 255, 0.25);
}
body.light-mode .gallery-card {
  background: var(--dark3);
}
body.light-mode .gallery-placeholder {
  background: var(--dark3);
  border-color: rgba(232, 92, 13, 0.3);
}
body.light-mode .gallery-grid {
  background: rgba(0, 0, 0, 0.08);
}
body.light-mode .filter-btn {
  background: var(--dark3);
  color: #333;
}
body.light-mode .lightbox {
  background: rgba(240, 240, 240, 0.97);
}
body.light-mode .lightbox-placeholder {
  background: var(--dark3);
}
body.light-mode .lightbox-title {
  color: #1a1a1a;
}

/* FAB por debajo del lightbox (z-index lightbox 9000) */
.scroll-top-btn,
.whatsapp-float {
  z-index: 5000;
}
