/* ===== Subpages: photography gallery, volunteering ===== */

/* ----- Back link ----- */
.subpage-back {
  display: inline-flex;
  align-items: center;
  gap: var(--space-sm);
  color: var(--text-secondary);
  font-size: 0.9375rem;
  font-weight: 500;
  margin-bottom: var(--space-2xl);
  transition: color var(--duration-fast);
}
.subpage-back:hover {
  color: var(--accent);
}

/* ----- Photography gallery ----- */
.gallery {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: var(--space-lg);
}

.gallery__item {
  position: relative;
  aspect-ratio: 4/3;
  background: var(--bg-elevated);
  border-radius: 12px;
  overflow: hidden;
  border: 1px solid var(--border);
  cursor: pointer;
  contain: layout paint;
  transform: translateZ(0);
}

.gallery__item img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: transform var(--duration-fast) var(--ease-out);
}

.gallery__item:hover img {
  transform: scale(1.02);
}

/* Gallery expand overlay - click outside to close */
.gallery-overlay {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: var(--space-xl);
  visibility: hidden;
  opacity: 0;
  transition: opacity var(--duration-normal) var(--ease-out);
}

.gallery-overlay.is-open,
.gallery-overlay.gallery-overlay--closing {
  visibility: visible;
}

.gallery-overlay.is-open {
  opacity: 1;
}

.gallery-overlay__backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.85);
  cursor: pointer;
}

.gallery-overlay__inner {
  position: relative;
  z-index: 1;
  max-width: min(90vw, 720px);
  max-height: min(85vh, 720px);
  border-radius: 12px;
  overflow: hidden;
  border: 1px solid var(--border);
  box-shadow: 0 24px 48px rgba(0, 0, 0, 0.5);
  pointer-events: auto;
}

.gallery-overlay__inner img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  display: block;
  max-width: min(90vw, 720px);
  max-height: min(85vh, 720px);
}

.gallery-empty {
  text-align: center;
  color: var(--text-muted);
  padding: var(--space-3xl);
  font-size: 1.0625rem;
}

/* ----- Volunteering / long-form ----- */
.section--volunteering .container {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
}

.section--volunteering .subpage-back {
  align-self: flex-start;
}

.volunteering-article {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  margin-inline: auto;
}

.volunteering-hero {
  margin-bottom: var(--space-2xl);
}

.volunteering-hero__images {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: var(--space-lg);
  margin-bottom: var(--space-xl);
}

.volunteering-hero__image {
  width: 100%;
  max-width: 320px;
  border-radius: 12px;
  overflow: hidden;
  border: 1px solid var(--border);
  background: var(--bg-elevated);
}

.volunteering-hero__image img {
  width: 100%;
  height: auto;
  display: block;
}

.volunteering-hero__fallback {
  display: none;
  min-height: 200px;
  align-items: center;
  justify-content: center;
  color: var(--text-muted);
  font-size: 0.9375rem;
}
.volunteering-hero__fallback.is-visible {
  display: flex;
}
.volunteering-hero__fallback code {
  font-size: 0.8125rem;
  color: var(--text-secondary);
}

.volunteering-content {
  max-width: 65ch;
  margin-inline: auto;
  text-align: center;
}

.volunteering-content p {
  margin: 0 0 var(--space-md);
  color: var(--text-secondary);
  line-height: 1.65;
}

.volunteering-content p:last-child {
  margin-bottom: 0;
}

.volunteering-content a {
  color: var(--accent);
}
.volunteering-content a:hover {
  text-decoration: underline;
}
