/* ===================== GALLERY SECTION ===================== */
.gallery-section {
  padding: 70px 0 90px;
  overflow: visible;
}

/* Wrapper column gets extra padding so scaled cards don't overlap */
.gallery-section .row {
  row-gap: 1.5rem;
}

/* ===================== GALLERY CARD ===================== */
.gallery-card {
  position: relative;
  border-radius: 18px;
  overflow: hidden;
  box-shadow: 0 6px 20px rgba(3,27,78,.12);
  cursor: pointer;
  background: #000;
  aspect-ratio: 4 / 3;
  transition: transform .5s cubic-bezier(.2,.8,.2,1), box-shadow .5s ease;
  transform-origin: center center;
  will-change: transform;
  isolation: isolate;
}

/* -------- HOVER: entire card zooms outward -------- */
.gallery-card:hover {
  transform: scale(1.08);
  box-shadow: 0 28px 60px rgba(3,27,78,.35);
  z-index: 10;
}

/* ===================== IMAGE ===================== */
.gallery-card img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: transform .8s cubic-bezier(.2,.8,.2,1), filter .6s ease;
  filter: grayscale(0%);
  will-change: transform, filter;
}

/* -------- HOVER: image zooms further inside card -------- */
.gallery-card:hover img {
  transform: scale(1.22);
  filter: grayscale(100%);
}

/* -------- After 5s: color returns, still zoomed -------- */
.gallery-card.colored:hover img {
  filter: grayscale(0%);
}

/* ===================== OVERLAY (caption + desc) ===================== */
.gallery-card .gallery-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(
    to top,
    rgba(3,27,78,.94) 0%,
    rgba(3,27,78,.55) 40%,
    transparent 75%
  );
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  padding: 22px;
  opacity: 0;
  transform: translateY(12px);
  transition: opacity .35s ease .05s, transform .35s ease .05s;
  pointer-events: none;
  z-index: 2;
}
.gallery-card:hover .gallery-overlay {
  opacity: 1;
  transform: translateY(0);
}
.gallery-card .gallery-overlay h5 {
  color: #fff;
  font-weight: 700;
  font-size: 1.05rem;
  margin-bottom: 4px;
  line-height: 1.3;
}
.gallery-card .gallery-overlay p {
  color: rgba(255,255,255,.85);
  font-size: .85rem;
  margin: 0;
  line-height: 1.5;
}

/* ===================== DOWNLOAD BUTTON ===================== */
.gallery-card .download-btn {
  position: absolute;
  top: 14px;
  right: 14px;
  width: 42px;
  height: 42px;
  border-radius: 50%;
  background: rgba(255,255,255,.95);
  color: var(--blue-royal);
  border: none;
  display: grid;
  place-items: center;
  font-size: 1.1rem;
  cursor: pointer;
  text-decoration: none;
  box-shadow: 0 4px 12px rgba(0,0,0,.25);
  opacity: 0;
  transform: translateY(-8px);
  transition: opacity .3s ease, transform .3s ease, background .2s ease, color .2s ease;
  z-index: 3;
  pointer-events: auto;
}
.gallery-card:hover .download-btn {
  opacity: 1;
  transform: translateY(0);
}
.gallery-card .download-btn:hover {
  background: var(--accent-gold);
  color: var(--blue-deep);
  transform: translateY(-2px) scale(1.1);
}
.gallery-card .download-btn:focus-visible {
  outline: 3px solid var(--accent-gold);
  outline-offset: 2px;
}

/* ===================== MOBILE (touch — no hover) ===================== */
@media (max-width: 575px) {
  .gallery-section { padding: 40px 0 60px; }
  .gallery-card { aspect-ratio: 1 / 1; }

  /* show overlay + download always on mobile */
  .gallery-card .gallery-overlay,
  .gallery-card .download-btn {
    opacity: 1;
    transform: translateY(0);
  }

  /* disable hover effects on touch */
  .gallery-card:hover { transform: none; box-shadow: 0 6px 20px rgba(3,27,78,.12); }
  .gallery-card:hover img { transform: none; filter: none; }
}

/* ===================== REDUCED MOTION ===================== */
@media (prefers-reduced-motion: reduce) {
  .gallery-card,
  .gallery-card img,
  .gallery-card .gallery-overlay,
  .gallery-card .download-btn {
    transition-duration: .01ms !important;
  }
}