/* ============================================================
   photography.css  —  /static/css/photography.css
   ============================================================ */

:root {
  --ph-bg:        #e8e8e5;
  --ph-ink:       #111110;
  --ph-muted:     #666662;
  --ph-accent:    #3a3aff;
  --ph-border:    rgba(17,17,16,0.12);
  --ph-mono:      "Courier New", Courier, ui-monospace, monospace;
  --ph-lh:        1.5;
  --ph-t:         200ms ease;
}

/* ── Page ──────────────────────────────────────────────────── */
.ph-page {
  font-family: var(--ph-mono);
  color: var(--accentlight);
  padding-bottom: 6rem;
}

/* ── Header ────────────────────────────────────────────────── */
.ph-header {
  display: grid;
  grid-template-columns: 1fr 1fr;
  align-items: end;
  gap: 2rem;
  padding: 2rem 2.5rem 1.75rem;
  /* border-bottom: 1px solid var(--ph-border); */
  margin-bottom: 3rem;
}

.ph-header__tagline {
  font-size: 0.85rem;
  color: var(--ph-muted);
  line-height: var(--ph-lh);
}

/* ── Filter nav ────────────────────────────────────────────── */
.ph-filter {
  display: flex;
  flex-wrap: nowrap;
  gap: 0.5rem 1.5rem;
  justify-content: flex-end;
  overflow-x: auto;
}

.ph-filter__btn {
  background: none;
  border: none;
  padding: 0;
  font-family: var(--ph-mono);
  font-size: 0.85rem;
  color: var(--ph-muted);
  cursor: pointer;
  text-decoration: underline;
  text-decoration-color: transparent;
  text-underline-offset: 3px;
  transition: color var(--ph-t), text-decoration-color var(--ph-t);
}

.ph-filter__btn:hover,
.ph-filter__btn.is-active {
  color: var(--ph-ink);
  text-decoration-color: var(--ph-ink);
}

/* ── Main ──────────────────────────────────────────────────── */
.ph-main {
  padding: 0 2.5rem;
}

/* ── Collection ────────────────────────────────────────────── */
.ph-collection {
  margin-bottom: 5rem;
}

.ph-collection[hidden] {
  display: none;
}

.ph-collection__intro {
  display: grid;
  grid-template-columns: 1fr 1fr;
  align-items: baseline;
  gap: 1rem;
  margin-bottom: 1.5rem;
  padding-bottom: 0.75rem;
  border-bottom: 1px solid var(--ph-border);
}

.ph-collection__title {
  font-size: 0.85rem;
  font-weight: normal;
  margin: 0;
  letter-spacing: 0.02em;
}

.ph-collection__desc {
  font-size: 0.8rem;
  color: var(--ph-muted);
  margin: 0;
  line-height: var(--ph-lh);
}

/* ── Grid ──────────────────────────────────────────────────── */
.ph-grid {
  display: grid;
  grid-template-columns: repeat(12, 1fr);
  gap: 0.75rem;
  align-items: start;
}

.ph-grid__item { margin: 0; }

/* Portrait — narrower, staggered */
.ph-grid__item--portrait:nth-child(4n+1) { grid-column: span 5; }
.ph-grid__item--portrait:nth-child(4n+2) { grid-column: span 5; margin-top: 2.5rem; }
.ph-grid__item--portrait:nth-child(4n+3) { grid-column: span 4; }
.ph-grid__item--portrait:nth-child(4n+4) { grid-column: span 6; margin-top: 1rem; }

/* Landscape — wider */
.ph-grid__item--landscape:nth-child(3n+1) { grid-column: span 7; }
.ph-grid__item--landscape:nth-child(3n+2) { grid-column: span 5; margin-top: 2rem; }
.ph-grid__item--landscape:nth-child(3n+3) { grid-column: span 12; margin-top: 0.5rem; }

/* ── Photo button ──────────────────────────────────────────── */
.ph-grid__btn {
  display: block;
  width: 100%;
  background: none;
  border: none;
  padding: 0;
  cursor: zoom-in;
}

.ph-grid__img {
  display: block;
  width: 100%;
  height: auto;
  transition: opacity var(--ph-t);
}

.ph-grid__btn:hover .ph-grid__img { opacity: 0.88; }

.ph-grid__caption {
  display: block;
  font-size: 0.5rem;
  color: var(--ph-muted);
  margin-top: 0.4rem;
  letter-spacing: 0.02em;
  text-align: right;
}

.ph-grid__empty {
  grid-column: 1 / -1;
  font-size: 0.8rem;
  color: var(--ph-muted);
  padding: 2rem 0;
}

/* ── Show more ─────────────────────────────────────────────── */
.ph-collection__footer { margin-top: 1.25rem; }

.ph-show-more {
  background: none;
  border: none;
  padding: 0;
  font-family: var(--ph-mono);
  font-size: 0.8rem;
  color: var(--ph-accent);
  cursor: pointer;
  text-decoration: underline;
  text-underline-offset: 3px;
}

/* ── Lightbox ──────────────────────────────────────────────── */
.ph-lightbox {
  position: fixed;
  inset: 0;
  z-index: 200;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 2rem;
  pointer-events: none;
  opacity: 0;
  transition: opacity 250ms ease;
}

.ph-lightbox:not([hidden]) {
  pointer-events: all;
  opacity: 1;
}

.ph-lightbox__backdrop {
  position: fixed;
  inset: 0;
  z-index: 190;
  background: rgba(232,232,229,0.96);
  opacity: 0;
  transition: opacity 250ms ease;
}

.ph-lightbox__backdrop:not([hidden]) { opacity: 1; }

.ph-lightbox__stage {
  position: relative;
  z-index: 210;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.75rem;
  max-width: min(90vw, 900px);
  max-height: 85vh;
}

.ph-lightbox__img {
  display: block;
  max-width: 100%;
  max-height: 78vh;
  object-fit: contain;
  box-shadow: 0 4px 40px rgba(0,0,0,0.12);
}

.ph-lightbox__caption {
  font-size: 0.75rem;
  color: var(--ph-muted);
  margin: 0;
  letter-spacing: 0.02em;
}

.ph-lightbox__close {
  position: fixed;
  top: 0.5rem;
  right: 1rem;
  z-index: 220;
  background: none;
  border: none;
  font-size: 1rem;
  color: var(--ph-muted);
  cursor: pointer;
  font-family: var(--ph-mono);
  transition: color var(--ph-t);
}

.ph-lightbox__close:hover { color: var(--ph-ink); }

.ph-lightbox__prev,
.ph-lightbox__next {
  position: fixed;
  top: 50%;
  transform: translateY(-50%);
  z-index: 220;
  background: none;
  border: none;
  font-size: 1.1rem;
  font-family: var(--ph-mono);
  color: var(--ph-muted);
  cursor: pointer;
  padding: 0.5rem 1rem;
  transition: color var(--ph-t);
}

.ph-lightbox__prev { left: 1rem; }
.ph-lightbox__next { right: 1rem; }
.ph-lightbox__prev:hover,
.ph-lightbox__next:hover { color: var(--ph-ink); }

.ph-lightbox__counter {
  position: fixed;
  bottom: 1.5rem;
  left: 50%;
  transform: translateX(-50%);
  font-size: 0.75rem;
  font-family: var(--ph-mono);
  color: var(--ph-muted);
  z-index: 220;
}

/* ── Responsive ────────────────────────────────────────────── */
@media (max-width: 900px) {
  .ph-header {
    grid-template-columns: 1fr;
    gap: 1rem;
    padding: 1.5rem;
  }

  .ph-filter { justify-content: flex-start; }
  .ph-main   { padding: 0 1.5rem; }

  .ph-collection__intro { grid-template-columns: 1fr; gap: 0.3rem; }

  .ph-grid { grid-template-columns: repeat(6, 1fr); }
  .ph-grid__item--portrait:nth-child(n)  { grid-column: span 3; margin-top: 0; }
  .ph-grid__item--landscape:nth-child(n) { grid-column: span 6; margin-top: 0; }
}

@media (max-width: 560px) {
  .ph-header { padding: 1rem; }
  .ph-main   { padding: 0 1rem; }

  .ph-grid { grid-template-columns: repeat(2, 1fr); gap: 0.5rem; }
  .ph-grid__item--portrait:nth-child(n),
  .ph-grid__item--landscape:nth-child(n) {
    grid-column: span 1;
    margin-top: 0;
  }

  .ph-lightbox__prev { left: 0.25rem; }
  .ph-lightbox__next { right: 0.25rem; }
}
