/* ─── Reset & Base ─────────────────────────────────────────────────────────── */

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

:root {
  --gold: #B89A6A;
  --gold-light: #D9C09A;
  --gold-dark: #8B7247;
  --cream: #F9F6F0;
  --white: #FFFFFF;
  --text: #1E1C1A;
  --text-muted: #8A8279;
  --border: #E8E0D2;
  --shadow: rgba(0, 0, 0, 0.08);
  --radius: 3px;
  --font-serif: 'Cormorant Garamond', Georgia, serif;
  --font-sans: 'DM Sans', system-ui, sans-serif;
}

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

/* Eliminate 300ms tap delay on all interactive elements */
a, button, [role="button"], .gallery-item, .drop-zone {
  touch-action: manipulation;
}

body {
  font-family: var(--font-sans);
  background: var(--cream);
  color: var(--text);
  min-height: 100vh;
  line-height: 1.6;
  font-weight: 300;
}

/* ─── Header ───────────────────────────────────────────────────────────────── */

.site-header {
  text-align: center;
  padding: 56px 24px 44px;
  background: var(--white);
  border-bottom: 1px solid var(--border);
  animation: fadeUp 0.9s ease both;
}

@keyframes fadeUp {
  from { opacity: 0; transform: translateY(14px); }
  to   { opacity: 1; transform: translateY(0); }
}

.site-header h1 {
  font-family: var(--font-serif);
  font-size: clamp(2.4rem, 6vw, 4rem);
  font-weight: 300;
  font-style: italic;
  color: var(--text);
  letter-spacing: 0.01em;
  line-height: 1.15;
}

.site-header .subtitle {
  font-family: var(--font-sans);
  font-size: 0.72rem;
  color: var(--text-muted);
  margin-top: 10px;
  letter-spacing: 0.28em;
  text-transform: uppercase;
  font-weight: 400;
}

/* Ornamental divider: fading line with diamond centre */
.gold-divider {
  display: block;
  position: relative;
  width: 200px;
  height: 1px;
  margin: 24px auto 0;
  background: linear-gradient(to right, transparent, var(--gold) 22%, var(--gold) 78%, transparent);
}

.gold-divider::after {
  content: '◇';
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  color: var(--gold);
  font-size: 8px;
  background: var(--white);
  padding: 0 7px;
  line-height: 1;
}

.header-nav {
  margin-top: 26px;
}

.btn-upload-nav {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  padding: 9px 28px;
  border: 1px solid var(--gold);
  color: var(--gold-dark);
  text-decoration: none;
  font-family: var(--font-sans);
  font-size: 0.7rem;
  font-weight: 400;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  transition: background 0.25s, color 0.25s;
}

.btn-upload-nav:hover {
  background: var(--gold);
  color: var(--white);
}

/* ─── Carousel ─────────────────────────────────────────────────────────────── */

.carousel-section {
  position: relative;
  width: 100%;
  background: #181614;
  overflow: hidden;
}

.carousel-track {
  position: relative;
  width: 100%;
  height: min(58vw, 500px);
}

.carousel-slide {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  transition: opacity 1s ease;
}

.carousel-slide.active {
  opacity: 1;
}

.carousel-slide img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
}

.carousel-empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  height: 100%;
  color: rgba(255,255,255,0.3);
  font-family: var(--font-serif);
  font-size: 1.1rem;
  font-style: italic;
  font-weight: 300;
  gap: 12px;
}

.carousel-empty svg {
  opacity: 0.2;
}

.carousel-dots {
  position: absolute;
  bottom: 20px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  gap: 10px;
}

.carousel-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: rgba(255,255,255,0.25);
  border: none;
  cursor: pointer;
  transition: background 0.25s, transform 0.25s;
  position: relative;
}

/* Expand touch target to 44px without changing visual size */
.carousel-dot::before {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 44px;
  height: 44px;
}

.carousel-dot.active {
  background: var(--gold);
  transform: scale(1.4);
}

/* ─── Gallery Grid ─────────────────────────────────────────────────────────── */

.gallery-section {
  max-width: 1280px;
  margin: 0 auto;
  padding: 52px 20px 80px;
}

.gallery-header {
  text-align: center;
  margin-bottom: 36px;
}

.gallery-header h2 {
  font-family: var(--font-serif);
  font-size: clamp(1.4rem, 3vw, 2rem);
  font-weight: 300;
  font-style: italic;
  color: var(--text);
}

.gallery-header p {
  font-size: 0.78rem;
  color: var(--text-muted);
  margin-top: 6px;
  letter-spacing: 0.1em;
}

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

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

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

.gallery-item {
  position: relative;
  aspect-ratio: 1;
  overflow: hidden;
  border-radius: var(--radius);
  cursor: pointer;
  background: var(--border);
  transition: opacity 0.35s ease, transform 0.4s ease, box-shadow 0.35s;
}

.gallery-item--entering {
  opacity: 0;
  transform: translateY(16px) scale(0.97);
}

.gallery-item:hover {
  transform: translateY(-3px);
  box-shadow: 0 14px 36px rgba(0,0,0,0.13);
}

.gallery-sentinel {
  grid-column: 1 / -1;
  height: 1px;
}

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

.gallery-item:hover img {
  transform: scale(1.04);
}

.gallery-item img[data-loading="true"] {
  opacity: 0;
}

.gallery-item .img-overlay {
  position: absolute;
  inset: 0;
  background: rgba(0,0,0,0);
  transition: background 0.25s;
}

.gallery-item:hover .img-overlay {
  background: rgba(0,0,0,0.08);
}

.gallery-skeleton {
  background: linear-gradient(90deg, #ede6da 25%, #f4efe5 50%, #ede6da 75%);
  background-size: 200% 100%;
  animation: shimmer 1.5s infinite;
  border-radius: var(--radius);
  aspect-ratio: 1;
}

@keyframes shimmer {
  0%   { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}

.gallery-empty {
  grid-column: 1 / -1;
  text-align: center;
  padding: 80px 20px;
  color: var(--text-muted);
}

.gallery-empty h3 {
  font-family: var(--font-serif);
  font-size: 1.4rem;
  font-weight: 300;
  font-style: italic;
  margin-bottom: 8px;
  color: var(--text);
}

/* ─── Lightbox ─────────────────────────────────────────────────────────────── */

.lightbox {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(10, 9, 8, 0.96);
  z-index: 1000;
  align-items: center;
  justify-content: center;
  padding: 16px;
}

.lightbox.open {
  display: flex;
}

.lightbox-inner {
  position: relative;
  max-width: min(90vw, 1100px);
  max-height: 90vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 20px;
}

.lightbox-img-wrap {
  display: flex;
  align-items: center;
  justify-content: center;
  max-height: calc(90vh - 80px);
}

.lightbox img {
  max-width: 100%;
  max-height: calc(90vh - 80px);
  object-fit: contain;
  border-radius: 2px;
  box-shadow: 0 24px 80px rgba(0,0,0,0.6);
}

.lightbox-actions {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  justify-content: center;
}

.btn-lightbox {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 9px 24px;
  background: transparent;
  font-family: var(--font-sans);
  font-size: 0.72rem;
  font-weight: 400;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  cursor: pointer;
  border: 1px solid transparent;
  transition: background 0.2s, color 0.2s, border-color 0.2s;
  text-decoration: none;
}

.btn-save {
  border-color: var(--gold);
  color: var(--gold-light);
}

.btn-save:hover {
  background: var(--gold);
  color: var(--white);
}

.btn-close-lb {
  border-color: rgba(255,255,255,0.2);
  color: rgba(255,255,255,0.55);
}

.btn-close-lb:hover {
  border-color: rgba(255,255,255,0.45);
  color: rgba(255,255,255,0.85);
}

.lightbox-close {
  position: absolute;
  top: -44px;
  right: 0;
  background: none;
  border: none;
  color: rgba(255,255,255,0.45);
  font-size: 1.6rem;
  cursor: pointer;
  line-height: 1;
  padding: 4px;
  font-weight: 300;
  transition: color 0.15s;
}

.lightbox-close:hover {
  color: rgba(255,255,255,0.9);
}

/* ─── Upload Page ──────────────────────────────────────────────────────────── */

.upload-page {
  max-width: 600px;
  margin: 0 auto;
  padding: 52px 20px 80px;
}

.upload-page h2 {
  font-family: var(--font-serif);
  font-size: clamp(1.6rem, 4vw, 2.4rem);
  font-weight: 300;
  font-style: italic;
  text-align: center;
  margin-bottom: 8px;
}

.upload-page .upload-sub {
  text-align: center;
  color: var(--text-muted);
  font-size: 0.82rem;
  letter-spacing: 0.07em;
  margin-bottom: 36px;
}

.drop-zone {
  border: 1px dashed var(--gold-light);
  padding: 52px 24px;
  text-align: center;
  cursor: pointer;
  background: var(--white);
  transition: background 0.2s, border-color 0.2s;
  position: relative;
}

.drop-zone.drag-over {
  background: #FDFAF5;
  border-color: var(--gold);
}

.drop-zone input[type="file"] {
  position: absolute;
  inset: 0;
  opacity: 0;
  cursor: pointer;
  width: 100%;
  height: 100%;
}

.drop-zone-icon {
  font-size: 2.2rem;
  margin-bottom: 14px;
  line-height: 1;
}

.drop-zone-text {
  font-family: var(--font-serif);
  font-size: 1.1rem;
  font-weight: 300;
  font-style: italic;
  color: var(--text);
  margin-bottom: 6px;
}

.drop-zone-sub {
  font-size: 0.78rem;
  color: var(--text-muted);
  letter-spacing: 0.05em;
}

.previews {
  margin-top: 24px;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(100px, 1fr));
  gap: 8px;
}

.preview-item {
  position: relative;
  aspect-ratio: 1;
  border-radius: var(--radius);
  overflow: hidden;
  background: var(--border);
}

.preview-item img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.preview-item .preview-status {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  background: rgba(0,0,0,0.5);
  color: white;
  font-size: 0.68rem;
  letter-spacing: 0.05em;
  text-align: center;
  gap: 4px;
  opacity: 0;
  transition: opacity 0.2s;
}

.preview-item.uploading .preview-status,
.preview-item.done .preview-status,
.preview-item.error .preview-status {
  opacity: 1;
}

.preview-item.done .preview-status {
  background: rgba(65, 130, 75, 0.72);
}

.preview-item.error .preview-status {
  background: rgba(155, 55, 55, 0.72);
}

.progress-bar-wrap {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: rgba(255,255,255,0.15);
}

.progress-bar {
  height: 100%;
  background: var(--gold);
  width: 0%;
  transition: width 0.2s;
}

.upload-actions {
  margin-top: 28px;
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
}

.btn-primary {
  flex: 1;
  min-width: 140px;
  min-height: 44px;
  padding: 13px 24px;
  background: var(--gold);
  color: var(--white);
  border: 1px solid var(--gold);
  font-family: var(--font-sans);
  font-size: 0.72rem;
  font-weight: 400;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  cursor: pointer;
  transition: background 0.2s, border-color 0.2s;
}

.btn-primary:hover:not(:disabled) {
  background: var(--gold-dark);
  border-color: var(--gold-dark);
}

.btn-primary:disabled {
  opacity: 0.38;
  cursor: not-allowed;
}

.btn-secondary {
  min-height: 44px;
  padding: 13px 24px;
  background: transparent;
  color: var(--text-muted);
  border: 1px solid var(--border);
  font-family: var(--font-sans);
  font-size: 0.72rem;
  font-weight: 400;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  cursor: pointer;
  transition: border-color 0.2s, color 0.2s;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
}

.btn-secondary:hover {
  border-color: var(--gold);
  color: var(--gold-dark);
}

.upload-status-msg {
  margin-top: 16px;
  text-align: center;
  font-size: 0.85rem;
  color: var(--text-muted);
  min-height: 24px;
  letter-spacing: 0.04em;
}

/* ─── Footer ───────────────────────────────────────────────────────────────── */

.site-footer {
  text-align: center;
  padding: 28px 16px;
  font-size: 0.75rem;
  color: var(--text-muted);
  border-top: 1px solid var(--border);
  background: var(--white);
  letter-spacing: 0.12em;
}

/* ─── Gallery loading indicator ───────────────────────────────────────────── */

/* Shown on first load instead of skeleton grid — disappears once photos render */
.gallery-loading {
  grid-column: 1 / -1;
  height: 1px;
  width: 100px;
  margin: 60px auto;
  background: linear-gradient(90deg, transparent, var(--gold), transparent);
  background-size: 200% 100%;
  animation: shimmer 1.4s ease infinite;
  border-radius: 1px;
}

/* ─── Utilities ────────────────────────────────────────────────────────────── */

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}

/* ─── Reduced motion ───────────────────────────────────────────────────────── */

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    transition-duration: 0.01ms !important;
  }
}
