

/* ── Gallery item ── */
.gallery-item {
  position: relative;
  overflow: hidden;
  border-radius: 0.5rem;
  background: var(--border-solid);
  aspect-ratio: 1/1;
  cursor: pointer;
}
.gallery-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: transform 0.5s;
}
.gallery-item:hover .gallery-img { transform: scale(1.1); }

/* Item overlay label */
.gallery-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(to top, rgba(0, 0, 0, 0.7) 0%, transparent 50%);
  opacity: 0;
  transition: opacity 0.3s;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  padding: 0.75rem;
}
.gallery-item:hover .gallery-overlay { opacity: 1; }
.gallery-label {
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--white);
  margin: 0;
}
.gallery-cat {
  font-size: 0.65rem;
  color: rgba(255, 255, 255, 0.6);
  margin: 0;
}

/* ── Horizontal scroll gallery ── */
.gallery-wrapper   { position: relative; }
.gallery-scroll-box {
  overflow-x: auto;
  overflow-y: hidden;
  scrollbar-width: none;
  -webkit-overflow-scrolling: touch;
}
.gallery-scroll-box::-webkit-scrollbar { display: none; }

.gallery-scroll-box .gallery-scroll-inner {
  display: flex;
  flex-direction: column;
  gap: 8px;
  width: max-content;
}
.gallery-scroll-box .gallery-scroll-inner .gallery-scroll-row {
  display: flex;
  gap: 8px;
}
.gallery-scroll-box .gallery-scroll-inner .gallery-scroll-row .gallery-item {
  width: 220px;
  height: 220px;
  flex-shrink: 0;
  aspect-ratio: unset;
}

/* Gallery prev/next arrows */
.gallery-arrow {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: var(--white);
  border: 1.5px solid var(--border);
  box-shadow: var(--shadow-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  color: var(--primary);
  font-size: 1rem;
  transition: var(--transition);
  z-index: 10;
}
#galleryPrev { left: -2.25rem; }
#galleryNext { right: -2.25rem; }
.gallery-arrow:hover {
  background: var(--accent);
  color: var(--white);
  border-color: var(--accent);
  box-shadow: 0 6px 20px rgba(230, 126, 34, 0.35);
  transform: translateY(-50%) scale(1.08);
}




/* Fixed 3-column grid — cards span to fill orphaned slots */
.photo-card-grid {
  width: 100%;
  margin: 2rem 0;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1rem;
}

/* 1 card → spans all 3 columns */
.photo-card:only-child {
  grid-column: 1 / -1;
}

/* Last card that is the sole item in its row of a 2-card grid → 50/50 */
/* 2 cards total: each takes 1.5 cols by spanning cols 1-2 and 2-3 */
.photo-card:first-child:nth-last-child(2),
.photo-card:first-child:nth-last-child(2) ~ .photo-card {
  grid-column: span 1;
  /* Override: make 2-card grid behave as 2-col */
}
/* Simpler approach for 2 cards: restate as 2-col grid at the parent */
.photo-card-grid:has(> .photo-card:first-child:nth-last-child(2)) {
  grid-template-columns: repeat(2, 1fr);
}

/* Orphan on last row: if total count mod 3 = 1, last card spans all 3 */
.photo-card:nth-child(3n+1):last-child {
  grid-column: 1 / -1;
}

/* Orphan on last row: if total count mod 3 = 2, last 2 cards each span 1.5 */


/* ── Base card ── */
.photo-card {
  position: relative;
  overflow: hidden;
  cursor: zoom-in;
  border-radius: var(--radius);
  background: var(--border-solid);
  display: flex;
  flex-direction: column;
  transition: transform 0.22s ease, box-shadow 0.22s ease;
}

/* Card shell only when a title body is present */
.photo-card:has(.photo-card-body) {
  border: 1px solid var(--border-solid);
  background: var(--white);
  box-shadow: var(--shadow-sm);
}
.photo-card:has(.photo-card-body):hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow-md);
}

/* Image — 4/3 ratio */
.photo-card img {
  width: 100%;
  aspect-ratio: 4 / 3;
  object-fit: cover;
  display: block;
  transition: transform 0.4s ease;
  flex-shrink: 0;
}
.photo-card:hover img { transform: scale(1.04); }

/* Standalone single photo card (not inside .photo-card-grid) — full width, full image, natural height */
:not(.photo-card-grid) > .photo-card img       { aspect-ratio: unset; object-fit: unset; width: 100%; height: auto; max-height: none; }
:not(.photo-card-grid) > .photo-card .photo-overlay { aspect-ratio: unset; height: 100%; }

/* Zoom overlay — sits over the image area only */
.photo-overlay {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  aspect-ratio: 4 / 3;
  background: rgba(0, 0, 0, 0);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.25s;
  pointer-events: none;
}
.photo-card:hover .photo-overlay { background: rgba(0, 0, 0, 0.22); }

.photo-overlay i {
  color: var(--white);
  font-size: 1.5rem;
  opacity: 0;
  transition: opacity 0.25s;
}
.photo-card:hover .photo-overlay i { opacity: 1; }

/* Title body — optional, title only, no description */
.photo-card-body {
  padding: 0.75rem 1rem 0.85rem;
  border-top: 1px solid var(--border-solid);
}
.photo-card-body h5 {
  font-size: var(--card-title-size);
  font-weight: 700;
  color: var(--primary);
  margin: 0;
  line-height: 1.35;
}




/* Full-width single photo */


/* ── Inline lightbox (article pages) ── */
.lightbox-overlay {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 9999;
  background: rgba(0, 0, 0, 0.96);
  backdrop-filter: blur(6px);
  flex-direction: column;
  align-items: stretch;
}
.lightbox-overlay.open { display: flex; }

.lightbox-topbar {
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.75rem 1rem;
  background: rgba(0, 0, 0, 0.5);
  z-index: 2;
}
.lightbox-label {
  font-size: 0.88rem;
  font-weight: 600;
  color: rgba(255, 255, 255, 0.85);
}
.lightbox-counter {
  font-size: 0.8rem;
  color: rgba(255, 255, 255, 0.5);
  min-width: 60px;
  text-align: right;
}
.lightbox-close {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  border: 1.5px solid rgba(255, 255, 255, 0.3);
  background: rgba(255, 255, 255, 0.08);
  color: var(--white);
  font-size: 1.2rem;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: background 0.2s;
}
.lightbox-close:hover { background: rgba(255, 255, 255, 0.22); }

/* Stage */
.lightbox-stage {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  padding: 0.5rem 3.5rem;
  min-height: 0;
  overflow: hidden;
}
.lightbox-img {
  max-width: 100%;
  max-height: 100%;
  width: auto;
  height: auto;
  object-fit: contain;
  border-radius: 4px;
  transition: opacity 0.18s ease;
  display: block;
}

/* Nav buttons */
.lightbox-nav {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 44px;
  height: 44px;
  border-radius: 50%;
  border: 1.5px solid rgba(255, 255, 255, 0.25);
  background: rgba(255, 255, 255, 0.08);
  color: var(--white);
  font-size: 1.6rem;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: background 0.2s;
  user-select: none;
}
.lightbox-nav:hover { background: rgba(255, 255, 255, 0.22); }
.lightbox-prev { left: 0.5rem; }
.lightbox-next { right: 0.5rem; }

/* Thumbnail strip */
.lightbox-thumbs {
  flex-shrink: 0;
  display: flex;
  gap: 6px;
  overflow-x: auto;
  padding: 0.75rem 1rem;
  background: rgba(0, 0, 0, 0.6);
  scrollbar-width: thin;
  scrollbar-color: rgba(255, 255, 255, 0.2) transparent;
}
.lightbox-thumbs::-webkit-scrollbar { height: 3px; }
.lightbox-thumbs::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.2);
  border-radius: 2px;
}
.lightbox-thumb {
  width: 56px;
  height: 56px;
  flex: 0 0 auto;
  object-fit: cover;
  border-radius: 5px;
  border: 2px solid transparent;
  opacity: 0.55;
  cursor: pointer;
  display: block;
  transition: opacity 0.2s, border-color 0.2s;
}
.lightbox-thumb.active {
  opacity: 1;
  border-color: var(--accent);
}
.lightbox-thumb:hover { opacity: 0.8; }


/* ── Full-page gallery lightbox (gallery.html) ── */

/* Gallery thumbstrip */