/* ============================================================
   GALLERY STYLES — gallery.css
   Diadem Logistics International
   ------------------------------------------------------------
   Scoped with "gl-" prefixed classes to avoid collisions with
   your template's global styles. No font-family is set here —
   this inherits typography from your existing site template.
   ============================================================ */

:root {
  --gl-primary: #00A6DA;
  --gl-secondary: #571B8C;
  --gl-ink: #1B2430;
  --gl-ink-soft: #5B6472;
  --gl-border: #E2E7ED;
  --gl-bg: #F6F9FB;
  --gl-radius: 14px;
  --gl-transition: 220ms cubic-bezier(0.4, 0, 0.2, 1);
}

.gl-section, .gl-section * , .gl-section *::before, .gl-section *::after {
  box-sizing: border-box;
}

.gl-section {
  padding: 70px 20px 80px;
  background: var(--gl-bg);
}

.gl-container {
  max-width: 1200px;
  margin: 0 auto;
}

/* ---------------- Header ---------------- */
.gl-header {
  text-align: center;
  max-width: 620px;
  margin: 0 auto 40px;
}
.gl-eyebrow {
  display: inline-flex;
  align-items: center;
  padding: 6px 16px;
  border-radius: 999px;
  background: #E4F6FC;
  color: #00769E;
  font-size: 0.78rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}
.gl-title {
  margin: 14px 0 10px;
  font-size: clamp(1.6rem, 3vw, 2.1rem);
  font-weight: 800;
  color: var(--gl-ink);
}
.gl-subtitle {
  margin: 0;
  color: var(--gl-ink-soft);
  font-size: 0.98rem;
  line-height: 1.6;
}

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

.gl-item {
  position: relative;
  display: block;
  width: 100%;
  aspect-ratio: 4 / 3;
  overflow: hidden;
  border-radius: var(--gl-radius);
  border: none;
  padding: 0;
  cursor: pointer;
  background: #E9EDF1;
  box-shadow: 0 6px 18px rgba(27, 36, 48, 0.08);
  transition: box-shadow var(--gl-transition), transform var(--gl-transition);
}

.gl-item:hover,
.gl-item:focus-visible {
  box-shadow: 0 14px 30px rgba(27, 36, 48, 0.18);
  transform: translateY(-3px);
}

.gl-item:focus-visible {
  outline: 3px solid var(--gl-primary);
  outline-offset: 3px;
}

/* Uniform thumbnail crop regardless of the source image's own
   dimensions — every tile stays the same size/shape. */
.gl-item img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
  display: block;
  transition: transform 400ms ease;
}

.gl-item:hover img,
.gl-item:focus-visible img {
  transform: scale(1.06);
}

.gl-item__zoom {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(27, 36, 48, 0.35);
  color: #ffffff;
  opacity: 0;
  transition: opacity var(--gl-transition);
}

.gl-item:hover .gl-item__zoom,
.gl-item:focus-visible .gl-item__zoom {
  opacity: 1;
}

.gl-item__zoom svg {
  filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.4));
}

/* ---------------- Lightbox ---------------- */
.gl-lightbox {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(10, 12, 16, 0.94);
  padding: 24px;
  animation: gl-fade-in 200ms ease;
}

.gl-lightbox[hidden] {
  display: none;
}

@keyframes gl-fade-in {
  from { opacity: 0; }
  to { opacity: 1; }
}

.gl-lightbox__figure {
  margin: 0;
  max-width: 90vw;
  max-height: 82vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
}

/* Full, uncropped image in the lightbox — never cropped,
   regardless of the original image's dimensions. */
.gl-lightbox__image {
  max-width: 90vw;
  max-height: 78vh;
  width: auto;
  height: auto;
  object-fit: contain;
  border-radius: 8px;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
  animation: gl-scale-in 220ms cubic-bezier(0.34, 1.56, 0.64, 1);
}

@keyframes gl-scale-in {
  from { opacity: 0; transform: scale(0.94); }
  to { opacity: 1; transform: scale(1); }
}

.gl-lightbox__caption {
  color: rgba(255, 255, 255, 0.85);
  font-size: 0.92rem;
  text-align: center;
  max-width: 70ch;
}

.gl-lightbox__close {
  position: absolute;
  top: 20px;
  right: 20px;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  border: none;
  background: rgba(255, 255, 255, 0.12);
  color: #ffffff;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: background var(--gl-transition), transform var(--gl-transition);
}
.gl-lightbox__close:hover { background: rgba(255, 255, 255, 0.22); transform: scale(1.05); }
.gl-lightbox__close:focus-visible { outline: 3px solid var(--gl-primary); outline-offset: 2px; }

.gl-lightbox__nav {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 52px;
  height: 52px;
  border-radius: 50%;
  border: none;
  background: rgba(255, 255, 255, 0.12);
  color: #ffffff;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: background var(--gl-transition), transform var(--gl-transition);
}
.gl-lightbox__nav:hover { background: rgba(255, 255, 255, 0.22); }
.gl-lightbox__nav:active { transform: translateY(-50%) scale(0.94); }
.gl-lightbox__nav:focus-visible { outline: 3px solid var(--gl-primary); outline-offset: 2px; }

.gl-lightbox__prev { left: 20px; }
.gl-lightbox__next { right: 20px; }

.gl-lightbox__counter {
  position: absolute;
  bottom: 20px;
  left: 50%;
  transform: translateX(-50%);
  padding: 6px 16px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.12);
  color: #ffffff;
  font-size: 0.82rem;
  font-weight: 600;
  letter-spacing: 0.02em;
}

/* ---------------- Responsive ---------------- */
@media (max-width: 900px) {
  .gl-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 16px;
  }
}

@media (max-width: 560px) {
  .gl-section { padding: 50px 16px 60px; }
  .gl-grid {
    grid-template-columns: 1fr;
    gap: 14px;
  }
  .gl-item { aspect-ratio: 16 / 10; }

  .gl-lightbox { padding: 16px; }
  .gl-lightbox__nav {
    width: 42px;
    height: 42px;
  }
  .gl-lightbox__prev { left: 8px; }
  .gl-lightbox__next { right: 8px; }
  .gl-lightbox__close {
    top: 12px;
    right: 12px;
    width: 38px;
    height: 38px;
  }
  .gl-lightbox__image { max-height: 70vh; }
}

@media (prefers-reduced-motion: reduce) {
  .gl-item, .gl-item img, .gl-lightbox, .gl-lightbox__image, .gl-lightbox__nav, .gl-lightbox__close {
    animation-duration: 0.001ms !important;
    transition-duration: 0.001ms !important;
  }
}
