/* ── Gallery Page ────────────────────────────────────────────── */

/* Hero */
.gal-hero {
  position: relative;
  background: linear-gradient(135deg, #0f1f3d 0%, #1b3a6b 100%);
  padding: 72px 0 56px;
  text-align: center;
  color: #fff;
  overflow: hidden;
}
.gal-hero::before {
  content: '';
  position: absolute;
  inset: 0;
  background: url("data:image/svg+xml,%3Csvg width='60' height='60' viewBox='0 0 60 60' xmlns='http://www.w3.org/2000/svg'%3E%3Cg fill='none' fill-rule='evenodd'%3E%3Cg fill='%23ffffff' fill-opacity='0.04'%3E%3Cpath d='M36 34v-4h-2v4h-4v2h4v4h2v-4h4v-2h-4zm0-30V0h-2v4h-4v2h4v4h2V6h4V4h-4zM6 34v-4H4v4H0v2h4v4h2v-4h4v-2H6zM6 4V0H4v4H0v2h4v4h2V6h4V4H6z'/%3E%3C/g%3E%3C/g%3E%3C/svg%3E");
}
.gal-hero-overlay {
  position: absolute;
  inset: 0;
  background: rgba(15,31,61,0.4);
}
.gal-hero .container {
  position: relative;
  z-index: 1;
}
.breadcrumb-bar {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  font-size: 0.82rem;
  color: rgba(255,255,255,0.6);
  margin-bottom: 18px;
}
.breadcrumb-bar a { color: rgba(255,255,255,0.6); text-decoration: none; }
.breadcrumb-bar a:hover { color: #fff; }
.breadcrumb-bar .fas { font-size: 0.62rem; }
.gal-hero h1 {
  font-family: 'Montserrat', sans-serif;
  font-size: clamp(1.9rem, 4.5vw, 2.8rem);
  font-weight: 800;
  margin: 0 0 14px;
  letter-spacing: -0.02em;
}
.gal-hero p {
  font-size: 1rem;
  color: rgba(255,255,255,0.78);
  max-width: 560px;
  margin: 0 auto;
  line-height: 1.65;
}

/* Section */
.gal-section {
  padding: 56px 0 64px;
  background: #f8fafc;
}

/* Loading */
.gal-loading {
  text-align: center;
  padding: 60px 0;
  color: #64748b;
}
.gal-spinner {
  width: 40px;
  height: 40px;
  border: 3px solid #e2e8f0;
  border-top-color: #1b3a6b;
  border-radius: 50%;
  animation: spin 0.75s linear infinite;
  margin: 0 auto 16px;
}
@keyframes spin { to { transform: rotate(360deg); } }
.gal-loading p { font-size: 0.9rem; margin: 0; }

/* Empty */
.gal-empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 80px 20px;
  color: #94a3b8;
  text-align: center;
}
.gal-empty .fas {
  font-size: 4rem;
  margin-bottom: 20px;
  opacity: 0.35;
}
.gal-empty h3 {
  font-family: 'Montserrat', sans-serif;
  font-size: 1.3rem;
  font-weight: 700;
  color: #475569;
  margin: 0 0 8px;
}
.gal-empty p { font-size: 0.92rem; margin: 0; }

/* Masonry grid */
.gal-grid {
  columns: 3;
  column-gap: 16px;
}
.gal-item {
  break-inside: avoid;
  margin-bottom: 16px;
  animation: galFadeUp 0.45s ease both;
}
@keyframes galFadeUp {
  from { opacity: 0; transform: translateY(18px); }
  to   { opacity: 1; transform: translateY(0); }
}
.gal-item-inner {
  position: relative;
  border-radius: 10px;
  overflow: hidden;
  cursor: pointer;
  box-shadow: 0 2px 8px rgba(0,0,0,0.08);
  transition: box-shadow 0.2s, transform 0.2s;
  background: #e2e8f0;
}
.gal-item-inner:hover {
  box-shadow: 0 10px 32px rgba(0,0,0,0.18);
  transform: translateY(-3px);
}
.gal-item-inner img {
  width: 100%;
  display: block;
  object-fit: cover;
}
.gal-item-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(to top, rgba(15,31,61,0.82) 0%, rgba(15,31,61,0) 55%);
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  padding: 14px;
  opacity: 0;
  transition: opacity 0.22s;
}
.gal-item-inner:hover .gal-item-overlay { opacity: 1; }
.gal-item-overlay > .fas {
  position: absolute;
  top: 12px;
  right: 14px;
  color: rgba(255,255,255,0.8);
  font-size: 1rem;
}
.gal-item-title {
  color: #fff;
  font-family: 'Montserrat', sans-serif;
  font-weight: 700;
  font-size: 0.88rem;
  margin: 0 0 4px;
  line-height: 1.3;
}
.gal-item-caption {
  color: rgba(255,255,255,0.75);
  font-size: 0.78rem;
  margin: 0;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* CTA Strip */
.gal-cta {
  background: linear-gradient(135deg, #0f1f3d 0%, #1b3a6b 100%);
  padding: 52px 0;
}
.gal-cta-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
}
.gal-cta-text h2 {
  font-family: 'Montserrat', sans-serif;
  font-size: clamp(1.3rem, 3vw, 1.9rem);
  font-weight: 800;
  color: #fff;
  margin: 0 0 8px;
}
.gal-cta-text p {
  color: rgba(255,255,255,0.75);
  font-size: 0.96rem;
  margin: 0;
}

/* ── Lightbox ──────────────────────────────────────────────── */
.gal-lightbox {
  position: fixed;
  inset: 0;
  background: rgba(5,10,25,0.95);
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  box-sizing: border-box;
}
.gal-lb-content {
  display: flex;
  flex-direction: column;
  align-items: center;
  max-width: 1000px;
  width: 100%;
  gap: 16px;
}
.gal-lb-content img {
  max-width: 100%;
  max-height: 72vh;
  object-fit: contain;
  border-radius: 8px;
  box-shadow: 0 16px 60px rgba(0,0,0,0.6);
}
.gal-lb-info { text-align: center; }
.gal-lb-title {
  font-family: 'Montserrat', sans-serif;
  font-size: 1rem;
  font-weight: 700;
  color: #fff;
  margin: 0 0 6px;
}
.gal-lb-cap {
  font-size: 0.88rem;
  color: rgba(255,255,255,0.65);
  margin: 0 0 8px;
}
.gal-lb-count {
  font-size: 0.75rem;
  color: rgba(255,255,255,0.38);
  margin: 0;
  letter-spacing: 0.04em;
}
.gal-lb-close {
  position: fixed;
  top: 18px;
  right: 22px;
  background: rgba(255,255,255,0.12);
  border: none;
  color: #fff;
  font-size: 1.2rem;
  width: 42px;
  height: 42px;
  border-radius: 50%;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.15s;
  z-index: 10001;
}
.gal-lb-close:hover { background: rgba(255,255,255,0.24); }
.gal-lb-nav {
  position: fixed;
  top: 50%;
  transform: translateY(-50%);
  background: rgba(255,255,255,0.12);
  border: none;
  color: #fff;
  font-size: 1.2rem;
  width: 48px;
  height: 48px;
  border-radius: 50%;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.15s;
  z-index: 10001;
}
.gal-lb-nav:hover { background: rgba(255,255,255,0.24); }
.gal-lb-prev { left: 14px; }
.gal-lb-next { right: 14px; }

/* ── Responsive ────────────────────────────────────────────── */

/* Touch devices: always show the title overlay (no hover) */
@media (hover: none) {
  .gal-item-overlay {
    opacity: 1;
    background: linear-gradient(to top, rgba(15,31,61,0.75) 0%, rgba(15,31,61,0) 60%);
  }
  .gal-item-overlay > .fas { display: none; }
  .gal-item-inner:hover { transform: none; box-shadow: 0 2px 8px rgba(0,0,0,0.08); }
}

@media (max-width: 1024px) {
  .gal-grid { columns: 3; }
}

@media (max-width: 768px) {
  .gal-hero { padding: 52px 0 40px; }
  .gal-section { padding: 36px 0 44px; }

  .gal-grid { columns: 2; column-gap: 10px; }
  .gal-item { margin-bottom: 10px; }

  .gal-cta { padding: 40px 0; }
  .gal-cta-inner { flex-direction: column; text-align: center; gap: 20px; }
  .gal-cta-text h2 { font-size: 1.4rem; }

  /* Lightbox — full-screen on mobile */
  .gal-lightbox { padding: 0; align-items: flex-start; }
  .gal-lb-content {
    width: 100%;
    height: 100dvh;
    max-width: 100%;
    gap: 0;
    justify-content: center;
  }
  .gal-lb-content img {
    width: 100%;
    max-height: 68vh;
    border-radius: 0;
    box-shadow: none;
  }
  .gal-lb-info {
    padding: 12px 16px;
    background: rgba(5,10,25,0.9);
    width: 100%;
    box-sizing: border-box;
  }
  .gal-lb-close {
    top: 10px;
    right: 10px;
    width: 44px;
    height: 44px;
    font-size: 1.1rem;
    background: rgba(0,0,0,0.5);
  }
  .gal-lb-nav {
    width: 44px;
    height: 44px;
    font-size: 1rem;
    background: rgba(0,0,0,0.45);
  }
  .gal-lb-prev { left: 6px; }
  .gal-lb-next { right: 6px; }
}

@media (max-width: 480px) {
  .gal-hero { padding: 44px 0 32px; }
  .gal-section { padding: 28px 0 36px; }

  .gal-grid { columns: 2; column-gap: 8px; }
  .gal-item { margin-bottom: 8px; }

  /* Hide side nav on very small screens — use swipe instead */
  .gal-lb-nav { display: none; }
  .gal-lb-content img { max-height: 65vh; }
}

@media (max-width: 380px) {
  .gal-grid { columns: 1; }
}
