/* =====================================================
    PAGE HEADER
===================================================== */
.page-header {
  padding-block: var(--sp-xl) var(--sp-lg);
  border-bottom: 1px solid var(--border);
  position: relative;
  overflow: hidden;
}

[data-theme="light"] .page-header {
  background: linear-gradient(150deg, var(--teal-pale) 0%, var(--bg) 60%);
}
[data-theme="dark"] .page-header {
  background: linear-gradient(150deg, var(--teal-dim) 0%, var(--bg) 60%);
}

.page-header::before {
  content: '';
  position: absolute;
  inset: 0;
  background-image: url("data:image/svg+xml,%3Csvg width='60' height='60' viewBox='0 0 60 60' xmlns='http://www.w3.org/2000/svg'%3E%3Ccircle cx='30' cy='30' r='1.5' fill='%232A8B84' fill-opacity='.1'/%3E%3C/svg%3E");
  pointer-events: none;
  opacity: .65;
}

.page-header-inner { position: relative; }

.breadcrumb {
  display: flex;
  align-items: center;
  gap: .4rem;
  margin-bottom: var(--sp-md);
  font-size: var(--t-xs);
  font-weight: 500;
  color: var(--text-muted);
}

.breadcrumb a { color: var(--text-soft); text-decoration: none; transition: color .15s; }
.breadcrumb a:hover { color: var(--teal); }
.breadcrumb-sep { color: var(--border-strong); font-size: .75em; user-select: none; }
.breadcrumb [aria-current="page"] { color: var(--teal-dark); }
[data-theme="dark"] .breadcrumb [aria-current="page"] { color: var(--teal); }

.page-kicker {
  display: inline-flex;
  align-items: center;
  gap: .5rem;
  font-size: var(--t-xs);
  font-weight: 600;
  letter-spacing: .07em;
  text-transform: uppercase;
  color: var(--accent-dark);
  background: var(--accent-dim);
  border: 1px solid var(--accent-border);
  padding: .3rem .85rem;
  border-radius: var(--r-pill);
  width: fit-content;
  margin-bottom: var(--sp-sm);
}
[data-theme="dark"] .page-kicker { color: var(--accent-dark); }

.page-title {
  font-family: var(--f-display);
  font-size: var(--t-2xl);
  font-weight: 400;
  line-height: 1.1;
  letter-spacing: -.02em;
  color: var(--text-primary);
}

.page-title em { font-style: italic; color: var(--teal); }

.page-subtitle {
  margin-top: var(--sp-sm);
  font-size: var(--t-md);
  color: var(--text-soft);
  max-width: 54ch;
  line-height: 1.65;
}

/* Count badge + hint */
.page-meta {
  margin-top: var(--sp-md);
  display: flex;
  align-items: center;
  gap: var(--sp-sm);
  flex-wrap: wrap;
}

.meta-badge {
  display: inline-flex;
  align-items: center;
  gap: .4rem;
  font-size: var(--t-xs);
  font-weight: 600;
  color: var(--icon-teal-fg);
  background: var(--icon-teal-bg);
  border: 1px solid var(--teal-border);
  padding: .3rem .75rem;
  border-radius: var(--r-pill);
}

.meta-note {
  font-size: var(--t-xs);
  color: var(--text-muted);
}

/* =====================================================
    GALLERY SECTION
===================================================== */
.gallery-section { padding-block: var(--sp-xl); }

/* Masonry-style grid using CSS columns */
.gallery-grid {
  columns: 2;
  column-gap: clamp(.5rem, 1.5vw, .875rem);
}

@media (min-width: 540px)  { .gallery-grid { columns: 2; } }
@media (min-width: 800px)  { .gallery-grid { columns: 3; } }
@media (min-width: 1040px) { .gallery-grid { columns: 4; } }

/* Each thumbnail item */
.gallery-item {
  display: block;
  break-inside: avoid;
  margin-bottom: clamp(.5rem, 1.5vw, .875rem);
  border-radius: var(--r-lg);
  overflow: hidden;
  border: 1px solid var(--border);
  cursor: pointer;
  position: relative;
  background: var(--bg-raised);
  aspect-ratio: 16 / 9;
}

.gallery-item img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: transform .25s ease, opacity .2s;
  opacity: 0;
}

/* Loaded state */
.gallery-item img.loaded { opacity: 1; }

.gallery-item:hover img { transform: scale(1.03); }

/* Darkening overlay on hover — intentionally dark in both themes
   since it overlays a photograph */
.gallery-item::after {
  content: '';
  position: absolute;
  inset: 0;
  background: rgba(30, 27, 24, 0);
  transition: background .2s;
  border-radius: var(--r-lg);
  pointer-events: none;
}

.gallery-item:hover::after,
.gallery-item:focus-visible::after {
  background: rgba(30, 27, 24, .18);
}

/* Zoom badge — needs to be visible against both light and dark photos,
   so we use a semi-opaque surface token rather than a hardcoded cream */
.gallery-item-zoom {
  position: absolute;
  bottom: .6rem;
  right: .6rem;
  width: 30px;
  height: 30px;
  border-radius: var(--r-md);
  background: var(--header-bg); /* uses the same backdrop-blur surface as the nav */
  border: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-primary);
  opacity: 0;
  transition: opacity .2s;
  pointer-events: none;
}

.gallery-item:hover .gallery-item-zoom,
.gallery-item:focus-visible .gallery-item-zoom {
  opacity: 1;
}

/* =====================================================
    LIGHTBOX
    The lightbox renders over a near-black scrim regardless
    of site theme — its internal colours are intentionally
    hardcoded rather than theme-token-driven.
===================================================== */
.lightbox {
  position: fixed;
  inset: 0;
  z-index: 1000;
  background: rgba(12, 10, 8, .94);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: var(--sp-md);
  opacity: 0;
  pointer-events: none;
  transition: opacity .2s;
}

.lightbox.is-open {
  opacity: 1;
  pointer-events: all;
}

@media (prefers-reduced-motion: reduce) {
  .lightbox { transition: none; }
}

.lightbox-inner {
  position: relative;
  max-width: min(900px, 96vw);
  max-height: 90vh;
  width: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  pointer-events: none;
}

/* Re-enable pointer events for interactive children */
.lightbox-img-wrap,
.lightbox-counter,
.lightbox-close {
  pointer-events: all;
}

.lightbox-img-wrap {
  overflow: hidden;
  box-shadow: var(--sh-lg);
  background: #1A1714;
  max-height: 80vh;
  display: flex;
  align-items: center;
  justify-content: center;
}

.lightbox-img-wrap img {
  max-width: 100%;
  max-height: 80vh;
  width: auto;
  height: auto;
  display: block;
  object-fit: contain;
}

.lightbox-counter {
  margin-top: var(--sp-sm);
  font-family: var(--f-body);
  font-size: var(--t-xs);
  font-weight: 500;
  color: rgba(255, 255, 255, .45);
  letter-spacing: .04em;
}

/* Prev / next navigation buttons */
.lightbox-btn {
  position: fixed;
  top: 50%;
  transform: translateY(-50%);
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: rgba(255, 255, 255, .08);
  border: 1.5px solid rgba(233, 99, 28, .5);
  color: rgba(233, 99, 28, .85);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background .15s, border-color .15s;
  z-index: 1001;
  pointer-events: all;
}

.lightbox-btn:hover {
  background: rgba(255, 255, 255, .14);
  border-color: rgba(233, 99, 28, .75);
}

.lightbox-btn svg { pointer-events: none; }

/* Always at least 26px from the screen edge */
.lightbox-prev { left:  max(26px, calc(50vw - 450px - 64px)); }
.lightbox-next { right: max(26px, calc(50vw - 450px - 64px)); }

@media (max-width: 560px) {
  .lightbox-btn  { width: 38px; height: 38px; }
  .lightbox-prev { left:  8px; }
  .lightbox-next { right: 8px; }
}

/* Close button */
.lightbox-close {
  position: absolute;
  top: -48px;
  right: 0;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: rgba(255, 255, 255, .08);
  border: 1.5px solid rgba(255, 255, 255, .18);
  color: rgba(255, 255, 255, .85);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background .15s, border-color .15s;
}

.lightbox-close:hover {
  background: rgba(255, 255, 255, .18);
  border-color: rgba(255, 255, 255, .35);
}

.lightbox-close svg { pointer-events: none; }

/* =====================================================
    CTA BAND
===================================================== */
.cta-band {
  background: var(--bg-raised);
  border-top: 1px solid var(--border);
  padding-block: var(--sp-lg);
}

.cta-band-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: var(--sp-md);
}

.cta-band-text {
  font-size: var(--t-base);
  color: var(--text-secondary);
  max-width: 48ch;
}

.cta-band-text strong {
  color: var(--text-primary);
  font-weight: 600;
}

.cta-band-actions {
  display: flex;
  gap: .65rem;
  flex-wrap: wrap;
}
