/* Dasig Worldwide - Photo Overlays, Gallery Tiles & Accessible Lightbox */

/* 1. Subtle Photo Background Overlays */
.has-bg-overlay {
  position: relative;
  overflow: hidden;
}

.has-bg-overlay > .wrap {
  position: relative;
  z-index: 2;
}

.bg-overlay {
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: 1;
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
}

/* Specific section overlays with 10–18% opacity, soft gradients, and smooth blending */
.hero .bg-overlay {
  /* Lighter green tint so the photo shows through; darker on the left behind the headline */
  background-image: linear-gradient(90deg, rgba(11, 41, 34, 0.86) 0%, rgba(20, 61, 50, 0.66) 50%, rgba(20, 61, 50, 0.42) 100%),
                    url('/assets/photos/community-pantry-neighborhood-gathering.webp');
  opacity: 1;
}

/* Homepage main cover photo */
#home.hero .bg-overlay {
  background-image: linear-gradient(90deg, rgba(11, 41, 34, 0.86) 0%, rgba(20, 61, 50, 0.66) 50%, rgba(20, 61, 50, 0.42) 100%),
                    url('/assets/photos/home-cover-shoe-drive.webp');
  background-position: center 40%;
}

#about .bg-overlay {
  background-image: linear-gradient(135deg, rgba(248, 246, 239, 0.92) 0%, rgba(233, 238, 229, 0.88) 100%),
                    url('/assets/photos/community-pantry-volunteers-portrait.webp');
  opacity: 0.12;
}

#programs .bg-overlay {
  background-image: linear-gradient(180deg, rgba(233, 238, 229, 0.94) 0%, rgba(233, 238, 229, 0.88) 100%),
                    url('/assets/photos/community-pantry-fresh-greens.webp');
  opacity: 0.12;
}

#involved .bg-overlay {
  background-image: linear-gradient(120deg, rgba(248, 246, 239, 0.94) 0%, rgba(248, 246, 239, 0.88) 100%),
                    url('/assets/photos/community-pantry-beans-youth.webp');
  opacity: 0.12;
}

#support .bg-overlay {
  background-image: linear-gradient(90deg, rgba(11, 41, 34, 0.88) 0%, rgba(11, 41, 34, 0.68) 55%, rgba(11, 41, 34, 0.46) 100%),
                    url('/assets/photos/typhoon-odette-relief-team.webp');
  opacity: 1;
}

/* Keep text crisp over the brighter photo backgrounds */
.hero.has-bg-overlay h1,
.hero.has-bg-overlay h2,
.hero.has-bg-overlay p,
#support.has-bg-overlay h2,
#support.has-bg-overlay p,
#support.has-bg-overlay .eyebrow {
  text-shadow: 0 1px 12px rgba(11, 41, 34, 0.55);
}

/* 2. "See Photos" Tiles & Gallery Grid */
.gallery-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
  gap: 24px;
  margin-top: 30px;
}

.photo-tile {
  background: #ffffff;
  border: 3px solid #dfe3da;
  border-radius: 20px;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  text-decoration: none;
  color: inherit;
  transition: transform 0.2s cubic-bezier(0.16, 1, 0.3, 1), box-shadow 0.2s cubic-bezier(0.16, 1, 0.3, 1), border-color 0.2s;
  cursor: pointer;
  position: relative;
  box-shadow: 0 4px 16px rgba(11, 41, 34, 0.05);
}

.photo-tile:hover,
.photo-tile:focus-visible {
  transform: translateY(-4px);
  border-color: var(--gold);
  box-shadow: 0 14px 30px rgba(11, 41, 34, 0.12);
  outline: none;
}

.tile-cover-wrap {
  position: relative;
  width: 100%;
  aspect-ratio: 16 / 10;
  overflow: hidden;
  background: #e0e5de;
}

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

.photo-tile:hover .tile-cover {
  transform: scale(1.04);
}

.tile-badge-count {
  position: absolute;
  top: 12px;
  right: 12px;
  background: rgba(11, 41, 34, 0.88);
  backdrop-filter: blur(4px);
  color: var(--gold);
  font-size: 12px;
  font-weight: 800;
  padding: 5px 12px;
  border-radius: 999px;
  border: 1px solid rgba(229, 199, 128, 0.4);
  display: flex;
  align-items: center;
  gap: 5px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.25);
}

.tile-badge-cat {
  position: absolute;
  bottom: 12px;
  left: 12px;
  background: var(--green);
  color: #ffffff;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 1px;
  text-transform: uppercase;
  padding: 4px 10px;
  border-radius: 6px;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.3);
}

.tile-content {
  padding: 22px;
  display: flex;
  flex-direction: column;
  flex: 1;
  gap: 8px;
}

.tile-meta {
  font-size: 12px;
  font-weight: 800;
  color: #81601d;
  letter-spacing: 0.5px;
  text-transform: uppercase;
}

.tile-content h3 {
  margin: 2px 0 6px;
  font-size: 22px;
  line-height: 1.25;
  color: var(--green);
}

.tile-content p {
  margin: 0;
  font-size: 14.5px;
  color: var(--muted);
  line-height: 1.55;
}

.tile-thumbs {
  display: flex;
  gap: 8px;
  margin-top: 14px;
  flex-wrap: wrap;
}

.tile-thumb-item {
  width: 58px;
  height: 42px;
  border-radius: 6px;
  overflow: hidden;
  border: 1.5px solid #dfe3da;
  flex-shrink: 0;
  background: #e0e5de;
  transition: transform 0.15s, border-color 0.15s;
}

.photo-tile:hover .tile-thumb-item {
  border-color: #becac0;
}

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

.tile-action {
  margin-top: auto;
  padding-top: 18px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.tile-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: var(--gold);
  color: var(--deep);
  font-weight: 800;
  font-size: 14px;
  padding: 10px 18px;
  border-radius: 10px;
  border: 0;
  cursor: pointer;
  transition: background 0.15s;
}

.photo-tile:hover .tile-btn {
  background: #ebd292;
}

/* Quick link thumbnail enhancement on homepage */
.quick .quick-photo {
  position: relative;
  overflow: hidden;
}

.quick .quick-photo-thumb {
  width: 48px;
  height: 48px;
  border-radius: 12px;
  object-fit: cover;
  flex-shrink: 0;
  border: 2px solid var(--gold);
}

/* 3. Full-Screen Accessible Lightbox Dialog */
.lightbox-dialog {
  position: fixed;
  inset: 0;
  width: 100vw;
  height: 100vh;
  max-width: 100vw;
  max-height: 100vh;
  margin: 0;
  padding: 0;
  border: 0;
  background: rgba(11, 41, 34, 0.96);
  backdrop-filter: blur(12px);
  color: #ffffff;
  z-index: 1000;
  display: none;
  flex-direction: column;
  overflow: hidden;
}

.lightbox-dialog[open] {
  display: flex;
}

.lightbox-dialog::backdrop {
  background: transparent;
}

.lb-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 24px;
  background: rgba(20, 61, 50, 0.8);
  border-bottom: 1px solid rgba(229, 199, 128, 0.25);
  gap: 12px;
  flex-shrink: 0;
}

.lb-info {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}

.lb-event-tag {
  background: var(--gold);
  color: var(--deep);
  font-size: 11px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 1px;
  padding: 4px 10px;
  border-radius: 999px;
}

.lb-event-title {
  font-family: Georgia, serif;
  font-size: 16px;
  font-weight: 700;
  color: #f8f6ef;
}

.lb-counter {
  font-size: 13px;
  color: #a2b9ac;
  font-weight: 600;
}

.lb-close-btn {
  background: transparent;
  border: 2px solid #a2b9ac;
  color: #ffffff;
  font-size: 13px;
  font-weight: 800;
  padding: 8px 16px;
  border-radius: 999px;
  cursor: pointer;
  transition: all 0.15s;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  flex-shrink: 0;
}

.lb-close-btn:hover {
  background: var(--gold);
  color: var(--deep);
  border-color: var(--gold);
}

.lb-stage {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: space-between;
  position: relative;
  padding: 12px 20px;
  min-height: 0;
  gap: 16px;
}

.lb-nav-btn {
  background: rgba(20, 61, 50, 0.85);
  border: 2px solid rgba(229, 199, 128, 0.4);
  color: var(--gold);
  font-size: 28px;
  line-height: 1;
  width: 52px;
  height: 52px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.15s;
  flex-shrink: 0;
  z-index: 5;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.4);
}

.lb-nav-btn:hover {
  background: var(--gold);
  color: var(--deep);
  transform: scale(1.08);
}

.lb-figure {
  flex: 1;
  height: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  margin: 0;
  min-height: 0;
  position: relative;
}

.lb-img-wrap {
  display: flex;
  align-items: center;
  justify-content: center;
  max-height: calc(100vh - 240px);
  width: 100%;
}

.lb-img {
  max-width: 90vw;
  max-height: calc(100vh - 240px);
  width: auto;
  height: auto;
  object-fit: contain;
  border-radius: 10px;
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.6);
  display: block;
}

.lb-caption-bar {
  padding: 12px 24px 8px;
  background: rgba(11, 41, 34, 0.94);
  border-top: 1px solid rgba(255, 255, 255, 0.1);
  text-align: center;
  max-width: 900px;
  margin: 0 auto;
  width: 100%;
  flex-shrink: 0;
}

.lb-caption-title {
  font-family: Georgia, serif;
  font-size: 18px;
  margin: 0 0 4px;
  color: var(--gold);
}

.lb-caption-meta {
  font-size: 11.5px;
  color: #a2b9ac;
  letter-spacing: 0.5px;
  margin-bottom: 4px;
  font-weight: 700;
}

.lb-caption-text {
  font-size: 13.5px;
  color: #dce8df;
  margin: 0;
  line-height: 1.5;
}

.lb-thumb-strip {
  display: flex;
  gap: 8px;
  justify-content: center;
  padding: 10px 20px 14px;
  background: var(--deep);
  overflow-x: auto;
  max-width: 100%;
  flex-shrink: 0;
}

.lb-thumb-btn {
  border: 2px solid transparent;
  border-radius: 6px;
  overflow: hidden;
  padding: 0;
  background: #000000;
  cursor: pointer;
  width: 58px;
  height: 40px;
  flex-shrink: 0;
  opacity: 0.6;
  transition: all 0.15s;
}

.lb-thumb-btn.active,
.lb-thumb-btn:hover {
  border-color: var(--gold);
  opacity: 1;
  transform: scale(1.05);
}

.lb-thumb-btn img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

@media (max-width: 700px) {
  .gallery-grid {
    grid-template-columns: 1fr;
  }
  .lb-header {
    padding: 10px 14px;
  }
  .lb-event-title {
    font-size: 13px;
  }
  .lb-stage {
    padding: 8px 6px;
    gap: 8px;
  }
  .lb-nav-btn {
    width: 42px;
    height: 42px;
    font-size: 22px;
  }
  .lb-img {
    max-height: calc(100vh - 270px);
  }
  .lb-caption-title {
    font-size: 15px;
  }
  .lb-caption-text {
    font-size: 12px;
  }
}
