/* ==========================================================================
   Hearts & Minds - Light & Clean Interactive Photo Gallery Lightbox Viewer
   ========================================================================== */

/* --- Gallery Grid Cards & Hover Effects --- */
.news-gallery-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 1.25rem;
}

.gallery-thumb-item {
  position: relative;
  border-radius: 14px;
  overflow: hidden;
  aspect-ratio: 4/3;
  background: #f1f5f9;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.05);
  cursor: pointer;
  border: 2px solid transparent;
  padding: 0;
  margin: 0;
  display: block;
  width: 100%;
  text-align: left;
  outline: none;
  transition: transform 0.28s cubic-bezier(0.34, 1.56, 0.64, 1), box-shadow 0.28s ease, border-color 0.2s ease;
}

.gallery-thumb-item:hover {
  transform: translateY(-4px) scale(1.02);
  box-shadow: 0 12px 24px rgba(0, 0, 0, 0.1);
  border-color: var(--color-teal, #14b8a6);
}

.gallery-thumb-item:focus-visible {
  border-color: var(--color-primary-red, #e11d48);
  box-shadow: 0 0 0 4px rgba(225, 29, 72, 0.35);
  transform: scale(1.02);
}

.gallery-thumb-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: transform 0.4s ease;
}

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

/* Hover Overlay (No numbering text, clean centered zoom icon) */
.gallery-thumb-overlay {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.2);
  opacity: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: opacity 0.25s ease, background-color 0.25s ease;
  pointer-events: none;
}

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

.gallery-thumb-zoom-icon {
  width: 42px;
  height: 42px;
  background: #ffffff;
  color: #1e293b;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.18);
  transform: scale(0.8);
  transition: transform 0.28s cubic-bezier(0.34, 1.56, 0.64, 1);
}

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


/* --- Fullscreen Lightbox Modal (Light Theme) --- */
.hm-lightbox,
.hm-lightbox *,
.hm-lightbox *::before,
.hm-lightbox *::after {
  box-sizing: border-box;
}

.hm-lightbox {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  width: 100vw;
  height: 100vh;
  max-width: 100vw;
  max-height: 100vh;
  z-index: 2147483647;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  opacity: 0;
  visibility: hidden;
  overflow: hidden;
  transition: opacity 0.3s cubic-bezier(0.16, 1, 0.3, 1), visibility 0.3s ease;
  user-select: none;
  touch-action: pan-y pinch-zoom;
}

.hm-lightbox.is-open {
  opacity: 1;
  visibility: visible;
}

/* Crisp Clean Frosted Light Backdrop */
.hm-lightbox-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(248, 250, 252, 0.94);
  backdrop-filter: blur(24px);
  -webkit-backdrop-filter: blur(24px);
  z-index: 1;
}

/* --- Header / Top Controls Bar (Light Theme) --- */
.hm-lightbox-header {
  position: relative;
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1.25rem 2rem;
  background: linear-gradient(to bottom, rgba(248, 250, 252, 0.8) 0%, transparent 100%);
}

.hm-lightbox-counter {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  background: #ffffff;
  color: #334155;
  font-weight: 700;
  font-size: 0.92rem;
  padding: 0.45rem 1.15rem;
  border-radius: 999px;
  border: 1px solid #e2e8f0;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.05);
}

.hm-lightbox-counter .current-idx {
  color: var(--color-teal, #0d9488);
  font-weight: 800;
}

.hm-lightbox-actions {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.hm-lightbox-btn {
  background: #ffffff;
  color: #334155;
  border: 1px solid #e2e8f0;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  outline: none;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.06);
  transition: background 0.2s ease, transform 0.2s cubic-bezier(0.34, 1.56, 0.64, 1), border-color 0.2s ease, color 0.2s ease;
}

.hm-lightbox-btn:hover {
  background: #f1f5f9;
  color: #0f172a;
  transform: scale(1.08);
  border-color: #cbd5e1;
}

.hm-lightbox-btn:active {
  transform: scale(0.95);
}

.hm-lightbox-btn:focus-visible {
  box-shadow: 0 0 0 3px #14b8a6;
}

.hm-lightbox-close-btn:hover {
  background: #e11d48;
  color: #ffffff;
  border-color: #e11d48;
}


/* --- Main Image Stage & Nav Controls (Light Theme) --- */
.hm-lightbox-stage {
  position: relative;
  z-index: 5;
  flex: 1 1 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 1.5rem;
  min-height: 0;
}

/* Nav Arrows (Floating White Pill Buttons) */
.hm-lightbox-nav-btn {
  position: relative;
  z-index: 10;
  background: #ffffff;
  color: #334155;
  border: 1px solid #e2e8f0;
  width: 56px;
  height: 56px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  outline: none;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.08), 0 2px 6px rgba(0, 0, 0, 0.04);
  transition: all 0.25s cubic-bezier(0.34, 1.56, 0.64, 1);
  flex-shrink: 0;
}

.hm-lightbox-nav-btn:hover {
  background: var(--color-teal, #0d9488);
  color: #ffffff;
  border-color: var(--color-teal, #0d9488);
  transform: scale(1.12);
  box-shadow: 0 10px 28px rgba(13, 148, 136, 0.3);
}

.hm-lightbox-nav-btn:active {
  transform: scale(0.92);
}

.hm-lightbox-nav-btn:focus-visible {
  box-shadow: 0 0 0 4px #14b8a6;
}

/* Central Figure & Active Image */
.hm-lightbox-figure-wrap {
  flex: 1 1 auto;
  height: 100%;
  max-height: calc(100vh - 180px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0 1rem;
  min-width: 0;
}

.hm-lightbox-figure {
  margin: 0;
  padding: 0;
  max-width: 100%;
  max-height: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}

.hm-lightbox-img-container {
  position: relative;
  max-width: 100%;
  max-height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
}

.hm-lightbox-img {
  max-width: 100%;
  max-height: calc(100vh - 200px);
  width: auto;
  height: auto;
  object-fit: contain;
  border-radius: 16px;
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.12), 0 4px 12px rgba(0, 0, 0, 0.05), 0 0 0 1px rgba(0, 0, 0, 0.04);
  transition: transform 0.35s cubic-bezier(0.16, 1, 0.3, 1), opacity 0.25s ease;
  opacity: 1;
}

.hm-lightbox-img.is-animating {
  opacity: 0;
  transform: scale(0.96);
}


/* --- Bottom Filmstrip Thumbnails Strip (Light Theme) --- */
.hm-lightbox-filmstrip-wrap {
  position: relative;
  z-index: 10;
  padding: 0.75rem 1.5rem 1.25rem;
  background: linear-gradient(to top, rgba(248, 250, 252, 0.95) 0%, transparent 100%);
  display: flex;
  justify-content: center;
  overflow: hidden;
}

.hm-lightbox-filmstrip {
  display: flex;
  gap: 0.65rem;
  overflow-x: auto;
  padding: 0.35rem 0.5rem;
  max-width: 100%;
  scrollbar-width: thin;
  scrollbar-color: rgba(0, 0, 0, 0.15) transparent;
}

.hm-lightbox-filmstrip::-webkit-scrollbar {
  height: 4px;
}

.hm-lightbox-filmstrip::-webkit-scrollbar-thumb {
  background: rgba(0, 0, 0, 0.15);
  border-radius: 4px;
}

.hm-filmstrip-item {
  width: 62px;
  height: 46px;
  flex-shrink: 0;
  border-radius: 8px;
  overflow: hidden;
  cursor: pointer;
  opacity: 0.55;
  border: 2px solid #e2e8f0;
  padding: 0;
  background: #ffffff;
  outline: none;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.04);
  transition: opacity 0.2s ease, transform 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease;
}

.hm-filmstrip-item:hover {
  opacity: 0.9;
  transform: translateY(-2px);
  border-color: #94a3b8;
}

.hm-filmstrip-item.is-active {
  opacity: 1;
  border-color: var(--color-teal, #0d9488);
  box-shadow: 0 0 0 2px rgba(13, 148, 136, 0.3), 0 4px 12px rgba(0, 0, 0, 0.08);
  transform: scale(1.08);
}

.hm-filmstrip-item img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}


/* --- Responsive Adjustments --- */
@media (max-width: 768px) {
  .hm-lightbox-header {
    padding: 0.75rem 1rem;
    gap: 0.5rem;
  }

  .hm-lightbox-counter {
    padding: 0.35rem 0.85rem;
    font-size: 0.82rem;
  }

  .hm-lightbox-actions {
    gap: 0.5rem;
  }

  .hm-lightbox-btn {
    width: 38px;
    height: 38px;
  }
  
  .hm-lightbox-stage {
    padding: 0 0.5rem;
  }

  .hm-lightbox-nav-btn {
    width: 40px;
    height: 40px;
  }

  .hm-lightbox-nav-btn svg {
    width: 22px;
    height: 22px;
  }

  .hm-lightbox-figure-wrap {
    padding: 0 0.25rem;
  }
  
  .hm-lightbox-img {
    max-height: calc(100vh - 165px);
    border-radius: 12px;
  }

  .hm-lightbox-filmstrip-wrap {
    padding: 0.5rem 1rem 1rem;
  }
  
  .hm-filmstrip-item {
    width: 46px;
    height: 34px;
  }
}
