/* ===== GALLERY PAGE ===== */

.gallery-page {
  min-height: 100vh;
  padding: 170px 24px 110px;
  background: linear-gradient(180deg, #f8f9fb 0%, #eef0f5 100%);
}

.gallery-page-container {
  width: min(100%, 1480px);
  margin: 0 auto;
}

.gallery-page-header {
  max-width: 850px;
  margin: 0 auto 38px;
  text-align: center;
}

.gallery-page-header h1 {
  margin: 0;
  color: var(--title);
  font-family: var(--font-title);
  font-size: clamp(2.6rem, 6vw, 5.7rem);
  line-height: 0.9;
  letter-spacing: -2px;
  text-transform: uppercase;
}

.gallery-page-header p {
  max-width: 680px;
  margin: 18px auto 0;
  color: var(--text-soft);
  font-size: 1.05rem;
  line-height: 1.7;
}

/* ===== NAVBAR ===== */

body .navbar {
  background: rgba(255, 255, 255, 0.92);
  backdrop-filter: blur(14px);
  border-bottom: 1px solid rgba(0, 0, 0, 0.06);
}

/* ===== FILTERS ===== */

.gallery-filters {
  margin: 0 auto 44px;
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 10px;
}

.gallery-filter {
  padding: 9px 20px;
  border-radius: 999px;
  background: #fff;
  color: var(--primary);
  font-size: 0.8rem;
  font-weight: 800;
  cursor: pointer;
  border: 1.5px solid rgba(0, 0, 0, 0.08);
  transition: all 0.2s ease;
  letter-spacing: 0.3px;
}

.gallery-filter.active,
.gallery-filter:hover {
  background: var(--primary);
  color: #fff;
  border-color: var(--primary);
}

/* ===== GRID ===== */

.gallery-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;
}

/* ===== CARD ===== */

.gallery-card {
  position: relative;
  aspect-ratio: 3 / 4;
  height: auto;
  border-radius: 20px;
  overflow: hidden;
  cursor: pointer;
  background: #111;
  border: none;
  box-shadow: none;

  /* hover más fino */
  transition:
    transform 0.22s ease,
    filter 0.22s ease;
}

.gallery-card:hover {
  transform: translateY(-2px);
  box-shadow: none;
}


.gallery-card img,
.gallery-card video {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  display: block;
  object-fit: cover;
  object-position: center;

  transform: scale(1);
  transition:
    transform 0.45s ease,
    filter 0.45s ease;
}

.gallery-card:hover img,
.gallery-card:hover video {
  transform: scale(1.025);
  filter: brightness(0.94);
}

.gallery-card::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 1;
  pointer-events: none;
  background: linear-gradient(
    to top,
    rgba(0, 0, 8, 0.62) 0%,
    rgba(0, 0, 8, 0.28) 28%,
    rgba(0, 0, 8, 0.04) 58%,
    transparent 100%
  );
}

.gallery-card::after {
  display: none;
}

/* ===== CARD INFO — display:contents para que los hijos se posicionen solos ===== */

.gallery-card-info {
  display: contents;
}

/* ===== BADGE — compacto, top left ===== */

.gallery-badge {
  position: absolute;
  top: 14px;
  left: 14px;
  z-index: 5;

  display: inline-flex;
  align-items: center;
  gap: 5px;

  padding: 5px 10px;
  border-radius: 999px;

  background: rgba(0, 0, 0, 0.42);
  color: #fff;
  border: 1px solid rgba(255, 255, 255, 0.22);
  box-shadow: none;
  height: 28px;

  font-size: 0.58rem;
  font-weight: 800;
  letter-spacing: 1.3px;
  line-height: 1;
  text-transform: uppercase;
  white-space: nowrap;

  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
}

.gallery-badge::before {
  content: "";
  width: 5px;
  height: 5px;
  flex: 0 0 5px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.85);
}

.gallery-badge::after {
  display: none;
}

/* ===== TITLE — bottom left ===== */

.gallery-card-title {
  position: absolute;
  left: 22px;
  right: 74px;
  bottom: 22px;
  z-index: 4;

  margin: 0;
  color: #fff;
  font-family: var(--font-title);

  font-size: clamp(1.05rem, 1.38vw, 1.55rem);
  font-weight: 900;
  line-height: 1.05;
  letter-spacing: 0.2px;
  text-transform: uppercase;

  text-shadow: 0 2px 10px rgba(0, 0, 0, 0.55);
}

/* ===== EXPAND BUTTON ===== */

.gallery-open-icon {
  position: absolute;
  right: 16px;
  bottom: 18px;
  z-index: 5;

  width: 38px;
  height: 38px;

  display: grid;
  place-items: center;

  border-radius: 50%;
  background: rgba(0, 0, 0, 0.36);
  color: #fff;
  border: 1px solid rgba(255, 255, 255, 0.22);

  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);

  transition:
    transform 0.22s ease,
    background 0.22s ease,
    color 0.22s ease;
}


.gallery-open-icon:hover {
  transform: scale(1.1);
  background: #fff;
  color: var(--primary);
  border-color: transparent;
}

.gallery-open-icon svg {
  width: 15px;
  height: 15px;
}

/* ===== VIDEO LABEL ===== */

.gallery-video-label {
  position: absolute;
  top: 14px;
  right: 14px;
  z-index: 5;

  display: inline-flex;
  align-items: center;
  gap: 5px;

  padding: 5px 10px;
  border-radius: 999px;

  background: rgba(0, 0, 0, 0.42);
  color: #fff;
  border: 1px solid rgba(255, 255, 255, 0.22);

  font-size: 0.57rem;
  font-weight: 800;
  letter-spacing: 1.2px;
  text-transform: uppercase;

  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
}

/* ===== MODAL ===== */

.gallery-modal {
  position: fixed;
  inset: 0;
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 9999;
  padding: 90px 24px 70px;
}

.gallery-modal.is-open {
  display: flex;
}

.gallery-modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(6, 6, 10, 0.84);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
}

.gallery-modal-content {
  position: relative;
  z-index: 2;
  width: min(100%, 1000px);
  height: min(80vh, 720px);
  display: flex;
  align-items: center;
  justify-content: center;
}

.gallery-modal-media {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
}

.gallery-modal-media img,
.gallery-modal-media video {
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
  border-radius: 16px;
  box-shadow: 0 24px 80px rgba(0,0,0,0.5);
}

/* ===== MODAL BUTTONS ===== */

.gallery-modal-close,
.gallery-modal-nav {
  position: absolute;
  z-index: 5;
  display: grid;
  place-items: center;
  border: none;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.95);
  color: #111;
  cursor: pointer;
  width: 48px;
  height: 48px;
  transition: all 0.2s ease;
  box-shadow: 0 4px 16px rgba(0,0,0,0.2);
}

.gallery-modal-close { top: -20px; right: -20px; }

.gallery-modal-nav {
  top: 50%;
  transform: translateY(-50%);
}

.gallery-modal-prev { left: -68px; }
.gallery-modal-next { right: -68px; }

.gallery-modal-close:hover,
.gallery-modal-nav:hover {
  background: var(--primary);
  color: #fff;
}

.gallery-modal-nav:hover {
  transform: translateY(-50%) scale(1.06);
}

/* ===== COUNTER ===== */

.gallery-modal-counter {
  position: absolute;
  bottom: -40px;
  left: 50%;
  transform: translateX(-50%);
  background: rgba(255,255,255,0.12);
  color: #fff;
  border: 1px solid rgba(255,255,255,0.18);
  padding: 6px 14px;
  border-radius: 999px;
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.5px;
  backdrop-filter: blur(10px);
}

.gallery-card {
  transition: transform 0.25s ease;
}

.gallery-card:hover {
  transform: translateY(-6px) scale(1.01);
}

.gallery-card:hover .gallery-open-icon {
  transform: scale(1.04);
  background: rgba(255, 255, 255, 0.92);
  color: var(--primary);
}

/* ===== CONTACT PAGE NAVBAR FIX ===== */

body .site-header {
  background: transparent;
}

body .navbar {
  background: rgba(255, 255, 255, 0.78);
  border: 1px solid rgba(20, 29, 148, 0.1);
  box-shadow: 0 18px 50px rgba(15, 23, 42, 0.08);
}

body .nav-link {
  color: var(--text);
  opacity: 0.82;
}

body .nav-link:hover,
body .nav-link.active {
  color: var(--primary);
  opacity: 1;
}

body .nav-toggle {
  color: var(--text);
  background: rgba(20, 29, 148, 0.08);
}

body .nav-menu.is-open {
  background: rgba(255, 255, 255, 0.78);
}

.contact-page-section {
  padding-top: 180px;
}

/* ===== RESPONSIVE ===== */

@media (max-width: 1100px) {
  .gallery-grid { grid-template-columns: repeat(2, 1fr); }
  .gallery-modal-prev { left: 14px; }
  .gallery-modal-next { right: 14px; }
}

@media (max-width: 700px) {
  .gallery-page { padding: 140px 16px 80px; }
  .gallery-grid { grid-template-columns: 1fr; gap: 16px; }
  .gallery-card { height: 310px; border-radius: 18px; }
  .gallery-card-title { font-size: clamp(1.35rem, 7vw, 2rem); }
  .gallery-modal-content { width: 100%; height: 74vh; }
  .gallery-modal-close { top: -54px; right: 4px; }
  .gallery-modal-prev { left: 6px; }
  .gallery-modal-next { right: 6px; }
}

@media (max-width: 430px) {
  .gallery-card { height: 275px; }
  .gallery-card-title { font-size: 1.4rem; }
}

@media (max-width: 700px) {
  .gallery-page {
    padding: 140px 14px 80px;
  }

  .gallery-grid {
    grid-template-columns: 1fr;
    gap: 18px;
    justify-items: center;
  }

  .gallery-card {
    width: min(100%, 360px);
    aspect-ratio: 3 / 4;
    height: auto;
    border-radius: 18px;
  }

  .gallery-card img,
  .gallery-card video {
    object-position: top center;
  }

  .gallery-modal-content {
    width: 100%;
    height: 74vh;
  }

  .gallery-modal-close {
    top: -54px;
    right: 4px;
  }

  .gallery-modal-prev {
    left: 6px;
  }

  .gallery-modal-next {
    right: 6px;
  }
}

@media (max-width: 430px) {
  .gallery-card {
    width: min(100%, 330px);
    aspect-ratio: 3 / 4;
    height: auto;
  }
}