/* ==========================================================================
   INSTASHIELD - GALLERY PAGE STYLESHEET
   css/gallery.css
   ========================================================================== */

/* GALLERY HERO (DARK THEME - SAME AS HOME & ABOUT) */
.gallery-hero {
  position: relative;
  min-height: 440px;
  padding: 180px 0 80px;
  text-align: center;
  background: radial-gradient(ellipse 70% 60% at 50% 30%, rgba(49, 199, 232, 0.18), transparent 70%),
              radial-gradient(ellipse 50% 50% at 85% 65%, rgba(8, 118, 185, 0.15), transparent 60%),
              linear-gradient(135deg, var(--midnight) 0%, var(--navy) 50%, var(--midnight) 100%);
  color: var(--white);
  overflow: hidden;
}

.gallery-hero .wrap {
  position: relative;
  z-index: 2;
  max-width: 850px;
}

.gallery-hero .eyebrow {
  color: var(--cyan);
}

.gallery-hero h1 {
  font-size: clamp(38px, 5vw, 60px);
  color: #ffffff;
  margin: 10px 0 16px;
}

.gallery-hero p.sub {
  font-size: clamp(16px, 1.8vw, 20px);
  color: #cfe3ee;
  max-width: 680px;
  margin: 0 auto;
  line-height: 1.6;
}

/* GALLERY MAIN SECTION (LIGHT THEME LIKE .how & .corporate-sec) */
.gallery-section {
  position: relative;
  padding: 80px 0 120px;
  background: linear-gradient(180deg, var(--ice) 0%, #ffffff 100%);
  color: var(--navy);
  margin-top: -40px;
  border-radius: 54px 54px 0 0;
  z-index: 3;
}

/* FILTER TABS */
.gallery-filter-wrap {
  display: flex;
  justify-content: center;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 48px;
}

.filter-btn {
  background: #ffffff;
  border: 1px solid rgba(8, 118, 185, 0.2);
  color: #456780;
  font-size: 14.5px;
  font-weight: 700;
  padding: 12px 24px;
  border-radius: 20px;
  cursor: pointer;
  transition: all 0.25s ease;
  font-family: inherit;
  box-shadow: 0 4px 15px rgba(6, 43, 73, 0.05);
}

.filter-btn:hover {
  color: var(--blue);
  border-color: var(--blue);
  transform: translateY(-2px);
}

.filter-btn.active {
  background: linear-gradient(100deg, var(--blue), var(--cyan));
  color: #ffffff;
  border-color: transparent;
  box-shadow: 0 8px 24px rgba(49, 199, 232, 0.35);
}

/* GALLERY GRID */
.gallery-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(340px, 1fr));
  gap: 30px;
}

/* GALLERY CARD */
.gallery-item {
  background: #ffffff;
  border: 1px solid rgba(8, 118, 185, 0.16);
  border-radius: 24px;
  overflow: hidden;
  box-shadow: 0 12px 30px rgba(6, 43, 73, 0.07);
  transition: transform 0.35s cubic-bezier(0.16, 1, 0.3, 1), box-shadow 0.35s ease, border-color 0.35s ease;
  cursor: pointer;
  display: flex;
  flex-direction: column;
}

.gallery-item:hover {
  transform: translateY(-8px);
  border-color: var(--cyan);
  box-shadow: 0 20px 45px rgba(8, 118, 185, 0.18), 0 0 20px rgba(49, 199, 232, 0.2);
}

/* CARD IMAGE / VISUAL FRAME */
.gallery-thumb-wrap {
  position: relative;
  height: 240px;
  background: linear-gradient(135deg, #092c48 0%, #031826 100%);
  display: grid;
  place-items: center;
  overflow: hidden;
}

.gallery-thumb-wrap::before {
  content: "";
  position: absolute;
  inset: 0;
  background: var(--bg-img, none) center/cover no-repeat;
  transition: transform 0.4s ease;
}

.gallery-real-img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.4s cubic-bezier(0.16, 1, 0.3, 1);
  z-index: 1;
}

.gallery-item:hover .gallery-thumb-wrap::before,
.gallery-item:hover .gallery-real-img {
  transform: scale(1.08);
}

/* STYLIZED FALLBACK VISUAL WHEN NO PHOTO */
.gallery-visual-icon {
  position: relative;
  z-index: 2;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  color: var(--cyan);
}

.gallery-visual-icon svg {
  width: 48px;
  height: 48px;
  filter: drop-shadow(0 0 12px rgba(49, 199, 232, 0.6));
}

.gallery-thumb-overlay {
  position: absolute;
  inset: 0;
  background: rgba(3, 21, 34, 0.4);
  display: grid;
  place-items: center;
  opacity: 0;
  transition: opacity 0.3s ease;
  z-index: 3;
}

.gallery-item:hover .gallery-thumb-overlay {
  opacity: 1;
}

.zoom-badge {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.95);
  color: var(--blue);
  display: grid;
  place-items: center;
  font-size: 20px;
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.3);
  transform: scale(0.8);
  transition: transform 0.25s ease;
}

.gallery-item:hover .zoom-badge {
  transform: scale(1);
}

/* CARD CONTENT */
.gallery-info {
  padding: 22px 24px;
  background: #ffffff;
  display: flex;
  flex-direction: column;
  flex: 1;
}

.gallery-category {
  font-size: 11.5px;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--blue);
  margin-bottom: 8px;
}

.gallery-title {
  font-size: 19px;
  font-weight: 800;
  color: var(--navy);
  margin-bottom: 8px;
  line-height: 1.35;
}

.gallery-desc {
  font-size: 13.5px;
  color: #55758c;
  line-height: 1.55;
}

/* ==========================================================================
   LIGHTBOX MODAL
   ========================================================================== */
.lightbox-overlay {
  position: fixed;
  inset: 0;
  background: rgba(2, 14, 23, 0.9);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  z-index: 10000;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.3s ease, visibility 0.3s ease;
}

.lightbox-overlay.active {
  opacity: 1;
  visibility: visible;
}

.lightbox-dialog {
  background: #ffffff;
  border-radius: 28px;
  max-width: 820px;
  width: 100%;
  overflow: hidden;
  box-shadow: 0 25px 80px rgba(0, 0, 0, 0.6);
  position: relative;
  transform: scale(0.95);
  transition: transform 0.3s ease;
  color: var(--navy);
}

.lightbox-overlay.active .lightbox-dialog {
  transform: scale(1);
}

.lightbox-close-btn {
  position: absolute;
  top: 18px;
  right: 18px;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: rgba(0, 0, 0, 0.5);
  color: #ffffff;
  border: 0;
  font-size: 24px;
  display: grid;
  place-items: center;
  cursor: pointer;
  z-index: 10;
  transition: background 0.2s, transform 0.2s;
}

.lightbox-close-btn:hover {
  background: #ff4757;
  transform: rotate(90deg);
}

.lightbox-img-area {
  height: 380px;
  background: radial-gradient(circle at 50% 50%, #0d3859 0%, #031522 100%);
  display: grid;
  place-items: center;
  position: relative;
  overflow: hidden;
}

.lightbox-img-area::before {
  content: "";
  position: absolute;
  inset: 0;
  background: var(--lb-img, none) center/cover no-repeat;
}

.lightbox-body {
  padding: 32px;
}

.lightbox-cat {
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--blue);
  margin-bottom: 8px;
}

.lightbox-title {
  font-size: 26px;
  font-weight: 800;
  color: var(--navy);
  margin-bottom: 12px;
}

.lightbox-desc {
  font-size: 15px;
  color: #486980;
  line-height: 1.65;
}

.lightbox-date {
  font-size: 12.5px;
  color: #7b9cb2;
  margin-top: 8px;
  display: flex;
  align-items: center;
  gap: 6px;
}

.lightbox-img-area img.lightbox-real-img {
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
  position: relative;
  z-index: 2;
  transition: opacity 0.3s ease;
}

.lightbox-fallback-icon {
  display: grid;
  place-items: center;
  position: relative;
  z-index: 1;
}

.gallery-date {
  font-size: 12px;
  color: #7b9cb2;
  margin-top: 6px;
  display: flex;
  align-items: center;
  gap: 5px;
}

.filter-count {
  font-size: 12px;
  font-weight: 600;
  opacity: 0.8;
  margin-left: 5px;
  display: inline-block;
}

/* EMPTY STATE (NO GALLERY PHOTOS IN DATABASE) */
.gallery-empty-box {
  background: #ffffff;
  border: 1px dashed rgba(8, 118, 185, 0.3);
  border-radius: 28px;
  padding: 60px 30px;
  text-align: center;
  max-width: 620px;
  margin: 40px auto 0;
  box-shadow: 0 10px 30px rgba(6, 43, 73, 0.05);
}

.gallery-empty-box .empty-icon-wrap {
  width: 72px;
  height: 72px;
  border-radius: 50%;
  background: rgba(49, 199, 232, 0.12);
  color: var(--blue);
  display: inline-grid;
  place-items: center;
  margin: 0 auto 20px;
}

.gallery-empty-box h3 {
  font-size: 22px;
  color: var(--navy);
  font-weight: 800;
  margin-bottom: 10px;
}

.gallery-empty-box p {
  color: #55758c;
  font-size: 15px;
  line-height: 1.6;
  margin-bottom: 24px;
}

.gallery-no-items {
  grid-column: 1 / -1;
  text-align: center;
  padding: 40px 20px;
  color: #55758c;
  font-size: 15px;
  background: #ffffff;
  border-radius: 20px;
  border: 1px dashed rgba(8, 118, 185, 0.2);
}

/* RESPONSIVE DESIGN */
@media (max-width: 900px) {
  .gallery-grid {
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  }

  .lightbox-img-area {
    height: 280px;
  }
}

@media (max-width: 640px) {
  .gallery-grid {
    grid-template-columns: 1fr;
  }

  .lightbox-body {
    padding: 24px;
  }

  .filter-btn {
    padding: 10px 18px;
    font-size: 13px;
  }
}
