/* ==========================================================
   Wedding Gallery — stylesheet
   Palette: ivory / charcoal / warm gold / dusty blush
   ========================================================== */

:root {
  --ivory: #faf6f0;
  --ivory-deep: #f2ebe1;
  --charcoal: #2b2622;
  --charcoal-soft: #56504a;
  --gold: #b8925a;
  --gold-soft: #d9bd94;
  --blush: #c9a3a0;
  --line: rgba(43, 38, 34, 0.12);
  --shadow: 0 20px 60px rgba(43, 38, 34, 0.18);

  --serif-display: 'Italiana', 'Cormorant Garamond', serif;
  --serif: 'Cormorant Garamond', Georgia, serif;
  --sans: 'Jost', 'Helvetica Neue', Arial, sans-serif;

  --nav-h: 76px;
}

* { box-sizing: border-box; }

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  background: var(--ivory);
  color: var(--charcoal);
  font-family: var(--serif);
  font-size: 18px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

img { max-width: 100%; display: block; }

a { color: inherit; text-decoration: none; }

button { font-family: inherit; }

/* ---------------- Nav ---------------- */

.site-nav {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 40;
  height: var(--nav-h);
  display: flex;
  align-items: center;
  background: linear-gradient(to bottom, rgba(250,246,240,0.9), rgba(250,246,240,0));
  backdrop-filter: blur(2px);
  pointer-events: none;
}

.site-nav__inner {
  width: 100%;
  max-width: 1400px;
  margin: 0 auto;
  padding: 0 clamp(20px, 5vw, 64px);
  display: flex;
  align-items: center;
  justify-content: space-between;
  pointer-events: none;
}

.site-nav__monogram {
  font-family: var(--serif-display);
  font-size: 22px;
  letter-spacing: 0.08em;
  color: var(--charcoal);
  pointer-events: auto;
}

.site-nav__links {
  display: flex;
  gap: clamp(16px, 3vw, 40px);
  pointer-events: auto;
}

.site-nav__links a {
  font-family: var(--sans);
  font-size: 12px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--charcoal-soft);
  padding-bottom: 4px;
  border-bottom: 1px solid transparent;
  transition: color 0.25s ease, border-color 0.25s ease;
}

.site-nav__links a:hover {
  color: var(--charcoal);
  border-color: var(--gold);
}

@media (max-width: 620px) {
  .site-nav__links { gap: 14px; }
  .site-nav__links a { font-size: 10px; letter-spacing: 0.1em; }
}

/* ---------------- Hero ---------------- */

.hero {
  position: relative;
  height: 100svh;
  min-height: 480px;
  width: 100%;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
}

.hero__img,
.hero__placeholder {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center 30%;
  transform: scale(1.04);
}

.hero__placeholder {
  background: linear-gradient(160deg, #e7dccb, #cdb99f 55%, #b8925a);
}

.hero__scrim {
  position: absolute;
  inset: 0;
  background:
    linear-gradient(to bottom, rgba(20,16,12,0.35) 0%, rgba(20,16,12,0.12) 30%, rgba(20,16,12,0.15) 60%, rgba(20,16,12,0.55) 100%);
}

.hero__content {
  position: relative;
  z-index: 2;
  text-align: center;
  color: #fff;
  padding: 0 20px;
}

.hero__eyebrow {
  font-family: var(--sans);
  font-size: 12px;
  letter-spacing: 0.35em;
  text-transform: uppercase;
  opacity: 0.85;
  margin: 0 0 18px;
}

.hero__names {
  margin: 0;
  font-family: var(--serif-display);
  font-weight: 400;
  font-size: clamp(48px, 11vw, 128px);
  line-height: 1;
  letter-spacing: 0.02em;
  text-shadow: 0 4px 30px rgba(0,0,0,0.25);
}

.hero__names span { display: inline-block; }

.hero__amp {
  font-family: var(--serif);
  font-style: italic;
  font-size: 0.55em;
  margin: 0 0.15em;
  opacity: 0.9;
  vertical-align: 0.08em;
}

.hero__date {
  margin: 26px 0 6px;
  font-family: var(--sans);
  font-size: clamp(13px, 1.6vw, 16px);
  letter-spacing: 0.4em;
  text-transform: uppercase;
}

.hero__sub {
  margin: 0;
  font-family: var(--serif);
  font-style: italic;
  font-size: clamp(15px, 2vw, 19px);
  opacity: 0.85;
}

.hero__scroll {
  position: absolute;
  bottom: clamp(20px, 4vh, 40px);
  left: 50%;
  transform: translateX(-50%);
  z-index: 2;
  width: 1px;
  height: 56px;
  display: flex;
  justify-content: center;
}

.hero__scroll-line {
  width: 1px;
  height: 100%;
  background: rgba(255,255,255,0.85);
  transform-origin: top;
  animation: scrollPulse 2.2s ease-in-out infinite;
}

@keyframes scrollPulse {
  0%   { transform: scaleY(0); opacity: 0; }
  35%  { transform: scaleY(1); opacity: 1; }
  70%  { transform: scaleY(1); opacity: 1; }
  100% { transform: scaleY(0); opacity: 0; transform-origin: bottom; }
}

/* ---------------- Gallery sections ---------------- */

main { position: relative; z-index: 1; background: var(--ivory); }

.gallery-section {
  padding: clamp(70px, 12vh, 140px) clamp(20px, 6vw, 72px) clamp(40px, 8vh, 90px);
  max-width: 1500px;
  margin: 0 auto;
}

.gallery-section__head {
  text-align: center;
  max-width: 640px;
  margin: 0 auto clamp(40px, 6vh, 72px);
}

.gallery-section__index {
  display: block;
  font-family: var(--sans);
  font-size: 12px;
  letter-spacing: 0.3em;
  color: var(--gold);
  margin-bottom: 14px;
}

.gallery-section__title {
  font-family: var(--serif-display);
  font-weight: 400;
  font-size: clamp(32px, 5vw, 56px);
  margin: 0 0 14px;
  letter-spacing: 0.01em;
}

.gallery-section__blurb {
  font-family: var(--serif);
  font-style: italic;
  color: var(--charcoal-soft);
  font-size: clamp(16px, 2vw, 20px);
  margin: 0;
}

.gallery-section__blurb::before,
.gallery-section__blurb::after {
  content: '—';
  color: var(--gold-soft);
  margin: 0 12px;
}

.gallery-section__empty {
  text-align: center;
  font-family: var(--sans);
  font-size: 13px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--charcoal-soft);
  opacity: 0.6;
  padding: 40px 0;
}

.empty-state {
  text-align: center;
  padding: 120px 20px;
  font-family: var(--sans);
  color: var(--charcoal-soft);
}

/* ---------------- Grid / thumbnails ---------------- */

.grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: clamp(10px, 1.6vw, 22px);
}

.grid__item {
  position: relative;
  border: none;
  padding: 0;
  margin: 0;
  aspect-ratio: 4 / 5;
  border-radius: 4px;
  overflow: hidden;
  cursor: zoom-in;
  background: var(--ivory-deep);
  box-shadow: 0 1px 2px rgba(43,38,34,0.06);
  opacity: 0;
  transform: translateY(28px);
  animation: none;
}

.grid__item.is-visible {
  animation: riseIn 0.7s cubic-bezier(.2,.7,.3,1) forwards;
  animation-delay: calc(var(--i, 0) * 0.05s);
}

@keyframes riseIn {
  to { opacity: 1; transform: translateY(0); }
}

.grid__item img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.7s cubic-bezier(.2,.7,.3,1), filter 0.5s ease;
}

.grid__item::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(to top, rgba(20,16,12,0.35), rgba(20,16,12,0) 45%);
  opacity: 0;
  transition: opacity 0.4s ease;
}

.grid__item::before {
  content: '\002B';
  position: absolute;
  right: 14px;
  bottom: 12px;
  z-index: 2;
  color: #fff;
  font-size: 22px;
  font-family: var(--sans);
  font-weight: 300;
  opacity: 0;
  transform: scale(0.6);
  transition: opacity 0.35s ease, transform 0.35s ease;
}

.grid__item:hover img,
.grid__item:focus-visible img {
  transform: scale(1.06);
}

.grid__item:hover::after,
.grid__item:focus-visible::after,
.grid__item:hover::before,
.grid__item:focus-visible::before {
  opacity: 1;
  transform: none;
}

.grid__item:focus-visible {
  outline: 2px solid var(--gold);
  outline-offset: 3px;
}

@media (max-width: 560px) {
  .grid { grid-template-columns: repeat(2, 1fr); gap: 8px; }
  .grid__item { aspect-ratio: 3 / 4; border-radius: 2px; }
  .grid__item::before { display: none; }
}

/* ---------------- Footer ---------------- */

.site-footer {
  text-align: center;
  padding: 70px 20px 60px;
  background: var(--ivory-deep);
  border-top: 1px solid var(--line);
}

.site-footer__names {
  font-family: var(--serif-display);
  font-size: clamp(24px, 4vw, 34px);
  margin: 0 0 8px;
  letter-spacing: 0.04em;
}

.site-footer__date {
  font-family: var(--sans);
  font-size: 12px;
  letter-spacing: 0.3em;
  text-transform: uppercase;
  color: var(--charcoal-soft);
  margin: 0;
}

/* ---------------- Lightbox (scroll-through viewer) ---------------- */

.lightbox {
  position: fixed;
  inset: 0;
  z-index: 100;
  background: rgba(15, 12, 10, 0.97);
  visibility: hidden;
  opacity: 0;
  transition: opacity 0.35s ease, visibility 0s linear 0.35s;
}

.lightbox.is-open {
  visibility: visible;
  opacity: 1;
  transition: opacity 0.35s ease;
}

.lightbox__scroller {
  height: 100%;
  overflow-y: auto;
  overflow-x: hidden;
  scroll-snap-type: y proximity;
  -webkit-overflow-scrolling: touch;
  padding: 64px 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: clamp(16px, 3vh, 40px);
}

.lightbox__scroller::-webkit-scrollbar { width: 8px; }
.lightbox__scroller::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.18); border-radius: 4px; }

.lightbox__slide {
  scroll-snap-align: center;
  max-width: min(94vw, 1200px);
  max-height: 88vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0 16px;
}

.lightbox__slide img {
  max-width: 100%;
  max-height: 88vh;
  width: auto;
  height: auto;
  object-fit: contain;
  border-radius: 2px;
  box-shadow: 0 30px 80px rgba(0,0,0,0.5);
  opacity: 0;
  transform: translateY(16px);
  transition: opacity 0.5s ease, transform 0.5s ease;
}

.lightbox__slide img.is-loaded {
  opacity: 1;
  transform: translateY(0);
}

.lightbox__close {
  position: fixed;
  top: 18px;
  right: clamp(16px, 3vw, 36px);
  z-index: 110;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  border: 1px solid rgba(255,255,255,0.25);
  background: rgba(255,255,255,0.06);
  color: #f4efe8;
  font-size: 26px;
  line-height: 1;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.25s ease, transform 0.25s ease;
}

.lightbox__close:hover { background: rgba(255,255,255,0.16); transform: rotate(90deg); }

.lightbox__caption {
  position: fixed;
  top: 24px;
  left: clamp(16px, 3vw, 36px);
  z-index: 110;
  margin: 0;
  color: #f4efe8;
  font-family: var(--sans);
  font-size: 12px;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  opacity: 0.75;
}

body.lightbox-open { overflow: hidden; }

@media (max-width: 620px) {
  .lightbox__scroller { padding: 88px 0 40px; gap: 20px; }
  .lightbox__slide { max-height: 80vh; }
  .lightbox__slide img { max-height: 80vh; }
}
