/* Force FooGallery lightbox to fill the real viewport on iOS */
.fg-lightbox,
.fg-lightbox .fg-lightbox-inner,
.fg-lightbox .fg-lightbox-content {
  top: 0 !important;
  left: 0 !important;
  right: 0 !important;
  bottom: 0 !important;
  margin: 0 !important;
  padding: 0 !important;
  height: 100dvh !important;
  width: 100vw !important;
}

/* Scale and center the image properly */
.fg-lightbox .fg-lightbox-image {
  max-height: 100dvh !important;
  max-width: 100vw !important;
  object-fit: contain !important;
  margin: auto;
}

/* Force FooGallery caption spans onto separate lines */
.foogallery .fg-caption span {
  display: block;
  line-height: 1;
}

/* Optional styling */
.foogallery .fg-date { font-size: 0.9em; }
.foogallery .fg-title { font-weight: 200; }

.seo-caption {
  position: absolute;
  left: -9999px;
  height: 1px;
  width: 1px;
  overflow: hidden;
}

/* Disable FooGallery album "pile" stacking effect */
.foogallery-album-gallery-list .foogallery-pile {
  position: static !important;
  box-shadow: none !important;
  background: none !important;
}
.foogallery-album-gallery-list .foogallery-pile::before,
.foogallery-album-gallery-list .foogallery-pile::after {
  display: none !important;
  content: none !important;
}

/*** FooGallery spacing tweaks ***/
.fg-default.fg-gutter-5 { margin-top: 5px; margin-bottom: 5px; }

/* FooGallery captions */
@media (max-width: 768px){
  .foogallery .fg-caption-title { font: 400 12px Roboto, system-ui, sans-serif; margin: 0 0 .1em; }
  .foogallery .fg-caption-desc  { font: 11px Roboto, system-ui, sans-serif; }
  .fg-default.fg-gutter-5 .fg-item { margin-bottom: 4px; }
}

@media (min-width: 1200px){
  .foogallery .fg-caption-title { font: 15px Roboto, system-ui, sans-serif; margin: .1em 0; }
  .foogallery .fg-caption-desc  { font: 300 15px Roboto, system-ui, sans-serif; }
  .foogallery .fg-caption { padding: .3em; padding-left: .4em; }
}

/* === FooGallery Album Title & Caption Refinement === */
.foogallery-album-gallery-list .foogallery-pile h3 {
  font-family: "Inter", "Helvetica Neue", Helvetica, Arial, sans-serif !important;
  font-weight: 500 !important;
  font-size: 1.25rem !important;
  line-height: 1.3;
  color: #222 !important;
  letter-spacing: -0.015em;
  margin-bottom: 0.3em;
}

.foogallery-album-gallery-list .foogallery-pile p {
  font-family: "Inter", "Helvetica Neue", Helvetica, Arial, sans-serif !important;
  font-weight: 400 !important;
  font-size: 0.95rem !important;
  line-height: 1.3;
  color: #666 !important;
  margin-top: 0;
}

.foogallery-album-gallery-list .fg-caption {
  background: rgba(255,255,255,0.85) !important;
  backdrop-filter: blur(3px);
  border-top: 1px solid rgba(0,0,0,0.08);
  padding: 0.75em 1em !important;
}

/* ================================
   FooGallery Albums — Layout + spacing
   ================================ */
.foogallery-album-gallery-list{
  display: flex !important;
  flex-wrap: wrap !important;
  gap: 18px !important;
}

/* If FooGallery sets "alignment-center", keep flex layout left-aligned */
.foogallery-album-gallery-list.alignment-center{
  justify-content: flex-start !important;
}

/* Remove float behavior (important for flex layouts) */
.foogallery-album-gallery-list li{
  float: none !important;
  flex: 0 0 calc(25% - 18px) !important;      /* 4 across desktop */
  max-width: calc(25% - 18px) !important;
}

.foogallery-album-gallery-list .foogallery-pile:hover {
  transform: translateY(-4px) !important;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
  box-shadow: 0 6px 16px rgba(0,0,0,0.12) !important;
}

/* Tablet: 3 across */
@media (max-width: 1024px){
  .foogallery-album-gallery-list{ gap: 14px !important; }
  .foogallery-album-gallery-list li{
    flex: 0 0 calc(33.333% - 14px) !important;
    max-width: calc(33.333% - 14px) !important;
  }
}

/* Mobile: 2 across + tighter spacing */
@media (max-width: 767px){
  .foogallery-album-gallery-list{ gap: 10px !important; }
  .foogallery-album-gallery-list li{
    flex: 0 0 calc(50% - 10px) !important;
    max-width: calc(50% - 10px) !important;
  }

  /* Tighter caption block so cards don’t get huge */
  .foogallery-album-gallery-list .fg-caption{
    padding: 0.55em 0.65em !important;
  }

  /* Slightly smaller title/subtitle on mobile */
  .foogallery-album-gallery-list .foogallery-pile h3{
    font-size: 1.02rem !important;
    line-height: 1.2 !important;
  }
  .foogallery-album-gallery-list .foogallery-pile p{
    font-size: 0.85rem !important;
    line-height: 1.2 !important;
  }
}

/* Hover zoom (safer selector than li:hover img) */
@media (hover:hover){
  .foogallery-album-gallery-list .foogallery-pile:hover img{
    transform: scale(1.02);
    transition: transform 0.25s ease;
  }
}