/* =========================================================
   PHOTO GALLERY + ALBUM PAGES
   Uses the DBIM tokens from style.css. Lightbox: gallery.js
   ========================================================= */
.album-count {
  margin: 0 0 1.6rem;
  color: var(--dbim-text-secondary, #3D4043);
  font-size: var(--dbim-fs-p2, 1.4rem);
}
.album-empty {
  padding: 2.4rem;
  text-align: center;
  background: var(--dbim-section-bg, #FFF9EE);
  border: 1px dashed var(--dbim-columbia-blue, #DDA73A);
  border-radius: 8px;
}
.album-back { margin: 3.2rem 0 0; }
.album-back a {
  color: var(--dbim-text-accent, #7A5200);
  font-weight: 600;
}

/* ---------- Gallery index: album cards ---------- */
.album-index,
.album-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 24rem), 1fr));
  gap: 2rem;
  margin: 0;
  padding: 0;
  list-style: none;
}
.album-card {
  display: flex;
  flex-direction: column;
  height: 100%;
  overflow: hidden;
  background: var(--dbim-white, #fff);
  border: 1px solid var(--dbim-azureish-white, #F4D390);
  border-radius: 10px;
  color: var(--dbim-dark-text, #22242A);
  text-decoration: none;
  transition: box-shadow .2s, border-color .2s;
}
.album-card:hover {
  border-color: var(--dbim-columbia-blue, #DDA73A);
  box-shadow: 0 4px 14px rgba(var(--dbim-shadow-rgb, 93, 62, 0), .15);
}
.album-card-cover {
  display: block;
  aspect-ratio: 4 / 3;
  overflow: hidden;
  background: var(--dbim-section-bg, #FFF9EE);
}
.album-card-cover img,
.album-photo img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform .3s;
}
.album-card:hover .album-card-cover img,
.album-photo-link:hover img { transform: scale(1.04); }
.album-card-placeholder {
  display: block;
  width: 100%;
  height: 100%;
  background: repeating-linear-gradient(45deg, var(--dbim-section-bg-strong, #FFF7E6) 0 12px, var(--dbim-white, #fff) 12px 24px);
}
.album-card-body {
  display: flex;
  flex: 1;
  flex-direction: column;
  gap: .4rem;
  padding: 1.2rem 1.4rem 1.4rem;
}
.album-card-title {
  font-size: var(--dbim-fs-p1, 1.6rem);
  font-weight: 600;
  line-height: 1.35;
}
.album-card:hover .album-card-title { color: var(--dbim-text-accent, #7A5200); }
.album-card-count {
  margin-top: auto;
  color: var(--dbim-text-muted, #4A4A4A);
  font-size: var(--dbim-fs-caption, 1.3rem);
}

/* ---------- Album page: photo grid ---------- */
.album-photo {
  display: flex;
  flex-direction: column;
  height: 100%;
  margin: 0;
  overflow: hidden;
  background: var(--dbim-white, #fff);
  border: 1px solid var(--dbim-azureish-white, #F4D390);
  border-radius: 10px;
}
.album-photo-link {
  display: block;
  aspect-ratio: 4 / 3;
  overflow: hidden;
  background: var(--dbim-section-bg, #FFF9EE);
  cursor: zoom-in;
}
.album-photo figcaption {
  padding: 1rem 1.2rem 1.2rem;
  color: var(--dbim-dark-text, #22242A);
  font-size: var(--dbim-fs-p2, 1.4rem);
  line-height: 1.45;
}

/* Keyboard focus */
.album-card:focus-visible,
.album-photo-link:focus-visible,
.lightbox button:focus-visible {
  outline: 3px solid var(--dbim-info-blue, #0D6EFD);
  outline-offset: 2px;
}

/* ---------- Lightbox ---------- */
.lightbox {
  width: 100vw;
  max-width: 100vw;
  height: 100vh;
  max-height: 100vh;
  margin: 0;
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--dbim-white, #fff);
}
.lightbox::backdrop { background: rgba(10, 6, 0, .92); }
.lightbox-inner {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 1.2rem;
  width: 100%;
  height: 100%;
  padding: 6rem 7rem 3rem;
}
.lightbox-img {
  display: block;
  max-width: 100%;
  max-height: calc(100vh - 17rem);
  object-fit: contain;
  border-radius: 4px;
  box-shadow: 0 8px 30px rgba(0, 0, 0, .5);
}
.lightbox-caption {
  max-width: 80rem;
  margin: 0;
  font-size: var(--dbim-fs-p1, 1.6rem);
  line-height: 1.45;
  text-align: center;
}
.lightbox-counter {
  position: absolute;
  top: 2rem;
  left: 2.4rem;
  font-size: var(--dbim-fs-p2, 1.4rem);
  opacity: .85;
}
.lightbox button {
  position: absolute;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 4.8rem;
  height: 4.8rem;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: rgba(255, 255, 255, .12);
  color: var(--dbim-white, #fff);
  font-size: 2.8rem;
  line-height: 1;
  cursor: pointer;
}
.lightbox button:hover { background: var(--dbim-powder-blue, #916100); }
.lightbox-close { top: 1.2rem; right: 1.6rem; }
.lightbox-prev,
.lightbox-next { top: 50%; transform: translateY(-50%); }
.lightbox-prev { left: 1.2rem; }
.lightbox-next { right: 1.2rem; }
.lightbox[data-single] .lightbox-prev,
.lightbox[data-single] .lightbox-next { display: none; }

@media (max-width: 767.5px) {
  .album-index,
  .album-grid { gap: 1.4rem; }
  .lightbox-inner { padding: 6rem 1.2rem 8rem; }
  .lightbox-img { max-height: calc(100vh - 20rem); }
  .lightbox-prev,
  .lightbox-next { top: auto; bottom: 1.6rem; transform: none; }
  .lightbox-prev { left: calc(50% - 6rem); }
  .lightbox-next { right: calc(50% - 6rem); }
}
@media (prefers-reduced-motion: reduce) {
  .album-card,
  .album-card-cover img,
  .album-photo img { transition: none; }
  .album-card:hover .album-card-cover img,
  .album-photo-link:hover img { transform: none; }
}

/* ---------- Video gallery (videolist.htm and video_*.htm) ---------- */
/* Play badge on video album covers */
.album-card-cover--video { position: relative; }
.album-card-cover--video::after {
  content: "";
  position: absolute;
  top: 50%;
  left: 50%;
  width: 5.6rem;
  height: 5.6rem;
  border-radius: 50%;
  background: rgba(0, 0, 0, .55) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath fill='%23fff' d='M8 5v14l11-7z'/%3E%3C/svg%3E") center / 2.8rem no-repeat;
  transform: translate(-50%, -50%);
  transition: background-color .2s;
}
.album-card:hover .album-card-cover--video::after { background-color: rgba(0, 0, 0, .75); }

/* Video cards: the browser's own player, no lightbox needed */
.album-video video {
  display: block;
  width: 100%;
  height: auto;
  aspect-ratio: 4 / 3;
  object-fit: contain;
  background: #000;
}
.album-video figcaption { display: flex; flex-direction: column; gap: .6rem; }
.album-video-download {
  align-self: flex-start;
  color: var(--dbim-text-accent, #7A5200);
  font-size: var(--dbim-fs-caption, 1.3rem);
  font-weight: 600;
}
@media (prefers-reduced-motion: reduce) {
  .album-card-cover--video::after { transition: none; }
}

/* ---------- Video gallery search ---------- */
.gallery-search { max-width: 48rem; margin: 0 0 1.2rem; }
.gallery-search label { display: block; margin-bottom: .6rem; font-weight: 600; }
.gallery-search-box {
  display: flex;
  align-items: stretch;
  height: 48px;
  background: var(--dbim-white, #fff);
  border: 1px solid var(--dbim-grey-01, #c6c6c6);
  border-bottom: 3px solid var(--dbim-wintergreen-dream, #5D3E00);
  border-radius: 12px 12px 0 0;
  overflow: hidden;
}
.gallery-search-box input { flex: 1 1 auto; min-width: 0; padding: 0 1.4rem; border: 0; background: transparent; font-size: 16px; }
.gallery-search-box input:focus { outline: none; }
.gallery-search-box:focus-within { outline: 3px solid var(--dbim-info-blue, #0D6EFD); outline-offset: 2px; }
.gallery-search-box button {
  flex: 0 0 auto;
  padding: 0 1.4rem;
  border: 0;
  border-left: 1px solid var(--dbim-grey-01, #c6c6c6);
  background: var(--dbim-white, #fff);
  color: var(--dbim-text-accent, #7A5200);
  font-weight: 600;
  cursor: pointer;
}
.gallery-search-box button[hidden] { display: none; }
#galleryList > li[hidden] { display: none !important; }
