/* ============================================================
   PHOTOS — Galerie cinématique premium
   ============================================================ */

/* ── Hero ─────────────────────────────────────────────────── */
.ph-hero {
  position: relative;
  min-height: 85vh;
  background: var(--green);
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: calc(var(--nav-h) + 60px) 48px 80px;
  overflow: hidden;
}

/* Grain cinématique */
.ph-hero-grain {
  position: absolute;
  inset: 0;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noise'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noise)' opacity='0.07'/%3E%3C/svg%3E");
  opacity: 0.35;
  pointer-events: none;
  z-index: 0;
  animation: grainAnim 0.8s steps(2) infinite;
}
@keyframes grainAnim {
  0%   { transform: translate(0,0); }
  25%  { transform: translate(-1%,-1%); }
  50%  { transform: translate(1%,1%); }
  75%  { transform: translate(-1%,1%); }
  100% { transform: translate(1%,-1%); }
}

.ph-hero-content {
  position: relative;
  z-index: 1;
  max-width: 900px;
}

.ph-hero-eyebrow {
  font-size: 12px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: rgba(237,234,222,0.5);
  margin-bottom: 28px;
}

.ph-hero-title {
  font-family: var(--font-serif);
  font-size: clamp(72px, 10vw, 140px);
  font-weight: 400;
  color: var(--cream);
  line-height: 0.9;
  margin-bottom: 32px;
  display: flex;
  flex-direction: column;
}

.ph-line {
  display: block;
  overflow: hidden;
}
.ph-line-italic { font-style: italic; }

.ph-hero-sub {
  font-size: 13px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: rgba(237,234,222,0.4);
}

.ph-hero-scroll {
  position: absolute;
  right: 48px;
  bottom: 48px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  color: rgba(237,234,222,0.35);
  font-size: 10px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}
.ph-scroll-line {
  width: 1px;
  height: 48px;
  background: rgba(237,234,222,0.25);
  animation: scrollLine 2s ease-in-out infinite;
  transform-origin: top;
}
@keyframes scrollLine {
  0%,100% { scaleY: 1; opacity: 0.4; }
  50%      { opacity: 1; }
}

/* ── Filter Bar ───────────────────────────────────────────── */
.ph-filter-bar {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 28px 48px 0;
  border-bottom: 1px solid rgba(44,59,26,0.08);
  overflow-x: auto;
  scrollbar-width: none;
  -webkit-overflow-scrolling: touch;
}
.ph-filter-bar::-webkit-scrollbar { display: none; }
.ph-filter-btn {
  font-family: var(--font-sans);
  font-size: 11px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--text-muted);
  border: 1px solid rgba(44,59,26,0.15);
  background: transparent;
  padding: 9px 22px;
  border-radius: 100px;
  cursor: pointer;
  white-space: nowrap;
  transition: all 0.25s var(--ease-out);
}
.ph-filter-btn:hover { color: var(--green); border-color: rgba(44,59,26,0.4); }
.ph-filter-btn.active {
  background: var(--green);
  color: var(--cream);
  border-color: var(--green);
}

/* ── Masonry Grid ─────────────────────────────────────────── */
.ph-masonry-wrap {
  padding: 48px 48px 120px;
}
.ph-masonry {
  columns: 3;
  column-gap: 16px;
}

.ph-card {
  display: inline-block;
  width: 100%;
  margin-bottom: 16px;
  break-inside: avoid;
  cursor: pointer;
  position: relative;
  border-radius: 4px;
  overflow: hidden;
  opacity: 0;
  transform: translateY(24px);
  transition: opacity 0.6s var(--ease-out), transform 0.6s var(--ease-out);
  background: var(--cream-dark);
}
.ph-card.revealed {
  opacity: 1;
  transform: translateY(0);
}
.ph-card img {
  width: 100%;
  display: block;
  object-fit: cover;
  transition: transform 0.6s cubic-bezier(0.16, 1, 0.3, 1);
}
.ph-card:hover img { transform: scale(1.04); }

/* Overlay au hover */
.ph-card-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(to top, rgba(44,59,26,0.75) 0%, transparent 50%);
  opacity: 0;
  transition: opacity 0.35s;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  padding: 20px 18px;
}
.ph-card:hover .ph-card-overlay { opacity: 1; }
.ph-card-title {
  font-family: var(--font-serif);
  font-size: 18px;
  color: var(--cream);
  font-weight: 400;
  margin-bottom: 4px;
}
.ph-card-cat {
  font-size: 10px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: rgba(237,234,222,0.6);
}

/* Grain sur chaque card (cinématique) */
.ph-card::after {
  content: '';
  position: absolute;
  inset: 0;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 200 200' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='0.05'/%3E%3C/svg%3E");
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.35s;
  z-index: 2;
}
.ph-card:hover::after { opacity: 1; }

/* ── Lightbox ─────────────────────────────────────────────── */
.ph-lightbox {
  position: fixed;
  inset: 0;
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.4s var(--ease-out);
}
.ph-lightbox.open {
  opacity: 1;
  pointer-events: all;
}
.ph-lb-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(8,13,5,0.95);
  backdrop-filter: blur(12px);
  cursor: zoom-out;
}
.ph-lb-inner {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: center;
  gap: 0;
  max-width: 90vw;
  max-height: 90vh;
}
.ph-lb-img-wrap {
  position: relative;
  max-height: 90vh;
  max-width: 80vw;
  overflow: hidden;
  border-radius: 4px;
}
.ph-lb-img {
  max-height: 90vh;
  max-width: 80vw;
  width: auto;
  height: auto;
  object-fit: contain;
  display: block;
  transition: opacity 0.3s, transform 0.3s cubic-bezier(0.16,1,0.3,1);
}
.ph-lb-grain {
  position: absolute;
  inset: 0;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 200 200' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='0.06'/%3E%3C/svg%3E");
  pointer-events: none;
  animation: grainAnim 0.7s steps(2) infinite;
}

/* Nav buttons */
.ph-lb-prev, .ph-lb-next {
  position: fixed;
  top: 50%;
  transform: translateY(-50%);
  width: 52px; height: 52px;
  background: rgba(237,234,222,0.08);
  border: 1px solid rgba(237,234,222,0.15);
  border-radius: 50%;
  color: rgba(237,234,222,0.8);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: background 0.25s, color 0.25s;
  z-index: 2;
}
.ph-lb-prev { left: 24px; }
.ph-lb-next { right: 24px; }
.ph-lb-prev:hover, .ph-lb-next:hover {
  background: rgba(237,234,222,0.18);
  color: white;
}
.ph-lb-close {
  position: fixed;
  top: 24px; right: 24px;
  width: 44px; height: 44px;
  background: rgba(237,234,222,0.08);
  border: 1px solid rgba(237,234,222,0.15);
  border-radius: 50%;
  color: rgba(237,234,222,0.7);
  font-size: 16px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.25s, color 0.25s;
  z-index: 2;
}
.ph-lb-close:hover { background: rgba(237,234,222,0.18); color: white; }
.ph-lb-meta {
  position: fixed;
  bottom: 28px;
  left: 50%;
  transform: translateX(-50%);
  text-align: center;
  z-index: 2;
}
.ph-lb-title {
  font-family: var(--font-serif);
  font-size: 20px;
  color: rgba(237,234,222,0.85);
  font-weight: 400;
  margin-bottom: 4px;
}
.ph-lb-cat {
  font-size: 10px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: rgba(237,234,222,0.4);
  margin-bottom: 8px;
}
.ph-lb-counter {
  font-size: 11px;
  color: rgba(237,234,222,0.3);
  letter-spacing: 0.1em;
}

/* Loading state */
.ph-lb-img.loading { opacity: 0.3; }

/* ── Responsive Photos ─────────────────────────────────────── */
@media (max-width: 1024px) {
  .ph-masonry { columns: 2; }
  .ph-masonry-wrap { padding: 36px 32px 80px; }
}
@media (max-width: 768px) {
  .ph-hero { padding: calc(var(--nav-h) + 40px) 20px 60px; min-height: 70vh; }
  .ph-hero-title { font-size: clamp(56px, 15vw, 100px); }
  .ph-hero-scroll { right: 20px; bottom: 24px; }
  .ph-filter-bar { padding: 20px 20px 0; }
  .ph-masonry { columns: 2; }
  .ph-masonry-wrap { padding: 24px 16px 80px; }
  .ph-lb-prev { left: 8px; }
  .ph-lb-next { right: 8px; }
  .ph-lb-img-wrap { max-width: 94vw; }
  .ph-lb-img { max-width: 94vw; }
}
@media (max-width: 480px) {
  .ph-masonry { columns: 1; }
  .ph-masonry-wrap { padding: 20px 12px 60px; }
}
