/* === Reset & Base === */
*,
*::before,
*::after {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

:root {
  --bg: #FAF8F5;
  --bg-card: #FFFFFF;
  --text: #2C2C2C;
  --text-muted: #9B9285;
  --accent: #C4A882;
  --accent-light: #D9C9AD;
  --accent-faint: #EDE6DB;
  --caption-bg: rgba(20, 18, 15, 0.75);
  --max-width: 1400px;
  --radius: 8px;
  color-scheme: light;
}

html {
  background-color: var(--bg);
}

body {
  background:
    radial-gradient(ellipse at 20% 0%, rgba(196, 168, 130, 0.06) 0%, transparent 50%),
    radial-gradient(ellipse at 80% 0%, rgba(196, 168, 130, 0.04) 0%, transparent 50%),
    var(--bg);
  color: var(--text);
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  font-weight: 300;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* === Header === */
header {
  text-align: center;
  padding: 3.5rem 1.5rem 2.5rem;
}

.header-ornament {
  font-size: 1.2rem;
  color: var(--accent);
  margin-bottom: 1rem;
  opacity: 0.7;
}

header h1 {
  font-family: 'Cormorant Garamond', Georgia, serif;
  font-weight: 300;
  font-size: 3.6rem;
  letter-spacing: 0.06em;
  color: var(--text);
  line-height: 1.1;
}

@media (min-width: 640px) {
  header h1 {
    font-size: 4.2rem;
  }
}

header .subtitle {
  font-family: 'Cormorant Garamond', Georgia, serif;
  font-weight: 300;
  font-style: italic;
  font-size: 1.15rem;
  color: var(--text-muted);
  margin-top: 0.5rem;
  letter-spacing: 0.12em;
}

.header-rule {
  display: flex;
  align-items: center;
  justify-content: center;
  margin-top: 1.8rem;
}

.header-rule span {
  display: block;
  width: 80px;
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--accent), transparent);
}

/* === Gallery Grid === */
main {
  flex: 1;
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 1rem 1.5rem 4rem;
  width: 100%;
}

.gallery-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 20px;
}

@media (min-width: 640px) {
  .gallery-grid {
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 24px;
  }
}

@media (min-width: 1024px) {
  .gallery-grid {
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 28px;
  }
}

/* === Gallery Item === */
.gallery-item {
  cursor: pointer;
  overflow: hidden;
  border-radius: var(--radius);
  background: var(--bg-card);
  border: 1px solid var(--accent-faint);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.03);
  transition: transform 0.3s ease, box-shadow 0.3s ease, border-color 0.3s ease;
}

.gallery-item:hover {
  transform: translateY(-4px);
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.08), 0 4px 12px rgba(0, 0, 0, 0.04);
  border-color: var(--accent-light);
}

.gallery-item img {
  width: 100%;
  height: 320px;
  object-fit: cover;
  object-position: center;
  display: block;
}

@media (min-width: 640px) {
  .gallery-item img {
    height: 360px;
  }
}

@media (min-width: 1024px) {
  .gallery-item img {
    height: 400px;
  }
}

.gallery-item .item-info {
  padding: 0.9rem 1.1rem;
  border-top: 1px solid var(--accent-faint);
}

.gallery-item .item-title {
  font-family: 'Cormorant Garamond', Georgia, serif;
  font-weight: 500;
  font-size: 1.1rem;
  color: var(--text);
  letter-spacing: 0.01em;
}

.gallery-item .item-medium {
  font-family: 'Inter', sans-serif;
  font-weight: 300;
  font-size: 0.78rem;
  color: var(--text-muted);
  margin-top: 0.2rem;
  letter-spacing: 0.04em;
  text-transform: lowercase;
}

/* === Lightbox === */
.lightbox {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s ease;
}

.lightbox.active {
  opacity: 1;
  pointer-events: auto;
}

.lightbox-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(20, 18, 15, 0.9);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}

.lightbox-content {
  position: relative;
  max-width: 90vw;
  max-height: 90vh;
  z-index: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.lightbox-content img {
  max-width: 90vw;
  max-height: 80vh;
  object-fit: contain;
  border-radius: 4px;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.4);
}

.lightbox-caption {
  font-family: 'Cormorant Garamond', Georgia, serif;
  font-weight: 400;
  font-size: 1.2rem;
  color: rgba(255, 255, 255, 0.88);
  text-align: center;
  padding: 1.2rem 0 0;
  min-height: 1.5em;
  letter-spacing: 0.03em;
}

.lightbox-caption .caption-medium {
  font-family: 'Inter', sans-serif;
  font-weight: 300;
  font-size: 0.78rem;
  color: rgba(255, 255, 255, 0.45);
  display: block;
  margin-top: 0.25rem;
  letter-spacing: 0.06em;
  text-transform: lowercase;
}

/* Lightbox buttons */
.lightbox-close,
.lightbox-prev,
.lightbox-next {
  position: absolute;
  z-index: 2;
  background: none;
  border: none;
  color: rgba(255, 255, 255, 0.5);
  cursor: pointer;
  transition: color 0.2s ease, background 0.2s ease;
  font-family: sans-serif;
}

.lightbox-close:hover,
.lightbox-prev:hover,
.lightbox-next:hover {
  color: rgba(255, 255, 255, 0.95);
}

.lightbox-close {
  top: 1.5rem;
  right: 2rem;
  font-size: 1.8rem;
  line-height: 1;
  width: 48px;
  height: 48px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
}

.lightbox-close:hover {
  background: rgba(255, 255, 255, 0.08);
}

.lightbox-prev,
.lightbox-next {
  top: 50%;
  transform: translateY(-50%);
  font-size: 2.8rem;
  line-height: 1;
  width: 56px;
  height: 80px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 8px;
}

.lightbox-prev:hover,
.lightbox-next:hover {
  background: rgba(255, 255, 255, 0.06);
  transform: translateY(-50%);
}

.lightbox-prev {
  left: 1rem;
}

.lightbox-next {
  right: 1rem;
}

/* === Footer === */
footer {
  text-align: center;
  padding: 2rem 1.5rem 3rem;
}

.footer-ornament {
  font-size: 0.8rem;
  color: var(--accent);
  margin-bottom: 1rem;
  opacity: 0.5;
}

footer p {
  font-family: 'Cormorant Garamond', Georgia, serif;
  font-style: italic;
  font-size: 0.85rem;
  font-weight: 300;
  color: var(--text-muted);
  letter-spacing: 0.06em;
}

/* === Utilities === */
::selection {
  background: var(--accent-light);
  color: var(--text);
}

/* Fade-in animation on load */
@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(12px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.gallery-item {
  animation: fadeInUp 0.5s ease both;
}

.gallery-item:nth-child(1) { animation-delay: 0.05s; }
.gallery-item:nth-child(2) { animation-delay: 0.1s; }
.gallery-item:nth-child(3) { animation-delay: 0.15s; }
.gallery-item:nth-child(4) { animation-delay: 0.2s; }
.gallery-item:nth-child(5) { animation-delay: 0.25s; }
.gallery-item:nth-child(6) { animation-delay: 0.3s; }
.gallery-item:nth-child(7) { animation-delay: 0.35s; }
.gallery-item:nth-child(8) { animation-delay: 0.4s; }
.gallery-item:nth-child(9) { animation-delay: 0.45s; }
.gallery-item:nth-child(10) { animation-delay: 0.5s; }
.gallery-item:nth-child(11) { animation-delay: 0.55s; }
.gallery-item:nth-child(12) { animation-delay: 0.6s; }
