/* ============================================================
   PHIMP — Francesca & Lorenzo Wedding Gallery
   Mobile-first stylesheet
   ============================================================ */

*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

:root {
  --gold:       #c9a96e;
  --gold-light: #e8d5b0;
  --dark:       #1a1a2e;
  --dark2:      #16213e;
  --text:       #f0ede8;
  --text-muted: #a8a09a;
  --radius:     8px;
  --transition: 0.25s ease;
}

html {
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
}

body {
  background-color: var(--dark);
  color: var(--text);
  font-family: 'Lato', sans-serif;
  font-weight: 300;
  min-height: 100vh;
  line-height: 1.6;
}

/* ============================================================
   HERO
   ============================================================ */
.hero {
  background: linear-gradient(160deg, var(--dark2) 0%, #0f3460 100%);
  padding: 3rem 1.25rem 2rem;
  text-align: center;
  position: relative;
  overflow: hidden;
}

.hero::before {
  content: '';
  position: absolute;
  inset: 0;
  background: radial-gradient(ellipse at 50% 0%, rgba(201,169,110,0.15) 0%, transparent 70%);
  pointer-events: none;
}

.hero-inner {
  position: relative;
  z-index: 1;
}

.hero-date {
  font-size: 0.8rem;
  letter-spacing: 0.25em;
  text-transform: uppercase;
  color: var(--gold);
  margin-bottom: 0.75rem;
}

.hero-title {
  font-family: 'Cormorant Garamond', serif;
  font-size: clamp(2.4rem, 8vw, 5rem);
  font-weight: 400;
  line-height: 1.1;
  color: var(--text);
  letter-spacing: 0.02em;
}

.amp {
  color: var(--gold);
  font-style: italic;
}

.hero-subtitle {
  margin-top: 0.75rem;
  font-size: 0.9rem;
  letter-spacing: 0.1em;
  color: var(--text-muted);
  text-transform: uppercase;
}

.hero-divider {
  margin: 1.75rem auto 0;
  width: 60px;
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--gold), transparent);
}

/* ============================================================
   CONTAINER & GRID
   ============================================================ */
.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 1.5rem 0.75rem 3rem;
}

.photo-count {
  font-size: 0.78rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--text-muted);
  margin-bottom: 1.25rem;
  text-align: center;
}

/* Mobile: 2 columns */
.grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 6px;
}

/* Tablet: 3 columns */
@media (min-width: 600px) {
  .grid { grid-template-columns: repeat(3, 1fr); gap: 8px; }
}

/* Desktop: 4 columns */
@media (min-width: 900px) {
  .grid { grid-template-columns: repeat(4, 1fr); gap: 10px; }
}

/* Wide: 5 columns */
@media (min-width: 1200px) {
  .grid { grid-template-columns: repeat(5, 1fr); gap: 12px; }
}

.grid-item {
  aspect-ratio: 1 / 1;
  border: none;
  cursor: pointer;
  border-radius: var(--radius);
  overflow: hidden;
  transition: transform var(--transition), opacity var(--transition);
  background-color: var(--dark2);
  -webkit-tap-highlight-color: transparent;
  padding: 0;
  display: block;
}

.grid-item img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: opacity 0.3s ease;
}

.grid-item:hover,
.grid-item:focus-visible {
  transform: scale(1.03);
  opacity: 0.9;
  outline: 2px solid var(--gold);
  outline-offset: 2px;
  z-index: 2;
}

/* ============================================================
   EMPTY STATE
   ============================================================ */
.empty-state {
  text-align: center;
  padding: 4rem 1rem;
}

.empty-icon {
  font-size: 3rem;
  margin-bottom: 1rem;
  opacity: 0.6;
}

.empty-state p {
  font-family: 'Cormorant Garamond', serif;
  font-size: 1.4rem;
  color: var(--text-muted);
  font-style: italic;
}

/* ============================================================
   FOOTER
   ============================================================ */
.site-footer {
  text-align: center;
  padding: 1.5rem 1rem;
  color: var(--text-muted);
  font-family: 'Cormorant Garamond', serif;
  font-style: italic;
  font-size: 1rem;
  border-top: 1px solid rgba(201,169,110,0.15);
}

.gestione-link {
  display: inline-block;
  margin-top: 0.75rem;
  font-family: 'Lato', sans-serif;
  font-style: normal;
  font-size: 0.7rem;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: var(--text-muted);
  text-decoration: none;
  opacity: 0.4;
}

.gestione-link:hover { opacity: 0.9; color: var(--gold); }

/* ============================================================
   LIGHTBOX
   ============================================================ */
.lightbox {
  position: fixed;
  inset: 0;
  background: #0a0a14;
  z-index: 1000;
}

.lightbox[hidden] { display: none; }

/* Top bar */
.lb-topbar {
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 58px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 0.75rem;
  z-index: 10;
  background: linear-gradient(to bottom, rgba(10,10,20,0.9), transparent);
}

.lb-close,
.lb-share,
.lb-download {
  background: rgba(255,255,255,0.12);
  border: 1px solid rgba(255,255,255,0.2);
  color: var(--text);
  cursor: pointer;
  border-radius: 50%;
  width: 44px; height: 44px;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
  -webkit-tap-highlight-color: transparent;
  text-decoration: none;
}

.lb-close { font-size: 1.6rem; line-height: 1; }

.lb-close:hover, .lb-share:hover, .lb-download:hover { background: rgba(201,169,110,0.3); }

.lb-actions {
  display: flex;
  gap: 0.5rem;
  flex-shrink: 0;
}

.lb-counter {
  flex: 1;
  text-align: center;
  font-size: 0.85rem;
  letter-spacing: 0.1em;
  color: var(--text-muted);
  pointer-events: none;
}

/* Image area */
.lb-img-wrap {
  position: absolute;
  top: 58px; left: 0; right: 0; bottom: 0;
  display: flex;
  align-items: center;
  justify-content: center;
}

.lb-img {
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
  display: block;
  user-select: none;
  -webkit-user-drag: none;
}

/* Prev / Next */
.lb-prev,
.lb-next {
  position: absolute;
  top: 50%; transform: translateY(-50%);
  background: rgba(255,255,255,0.10);
  border: 1px solid rgba(255,255,255,0.18);
  color: var(--text);
  cursor: pointer;
  border-radius: 50%;
  width: 44px; height: 44px;
  font-size: 1.8rem;
  display: flex; align-items: center; justify-content: center;
  z-index: 10;
  -webkit-tap-highlight-color: transparent;
}

.lb-prev { left: 0.5rem; }
.lb-next { right: 0.5rem; }

.lb-prev:hover, .lb-next:hover { background: rgba(201,169,110,0.25); }
.lb-prev:active { transform: translateY(-50%) scale(0.9); }
.lb-next:active { transform: translateY(-50%) scale(0.9); }

/* Safe-area (notched phones) */
@supports (padding-top: env(safe-area-inset-top)) {
  .hero { padding-top: calc(3rem + env(safe-area-inset-top)); }
  .lb-topbar {
    height: calc(58px + env(safe-area-inset-top));
    padding-top: env(safe-area-inset-top);
    padding-left:  calc(0.75rem + env(safe-area-inset-left));
    padding-right: calc(0.75rem + env(safe-area-inset-right));
  }
  .lb-img-wrap { top: calc(58px + env(safe-area-inset-top)); }
}

@media (min-width: 600px) {
  .lb-prev { left: 1.25rem; }
  .lb-next { right: 1.25rem; }
  .lb-prev, .lb-next { width: 52px; height: 52px; font-size: 2rem; }
}

