@import url('https://fonts.googleapis.com/css2?family=Playfair+Display:ital,wght@0,500;0,600;1,500&family=Inter:wght@400;500;600&display=swap');

:root {
  --cream: #faf7f0;
  --cream-2: #f2ede1;
  --moss: #5b6b4f;
  --moss-dark: #3f4b37;
  --gold: #b8965f;
  --ink: #2f2c26;
  --ink-soft: #6b6558;
  --white: #ffffff;
  --danger: #a4443a;
  --radius: 14px;
  --shadow: 0 6px 24px rgba(47, 44, 38, 0.08);
  --shadow-lg: 0 14px 40px rgba(47, 44, 38, 0.16);
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  background: var(--cream);
  color: var(--ink);
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3, .serif {
  font-family: 'Playfair Display', Georgia, serif;
  font-weight: 600;
  color: var(--moss-dark);
  margin: 0 0 0.3em;
}

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

.container {
  max-width: 1100px;
  margin: 0 auto;
  padding: 0 20px;
}

/* ---------- Top bar ---------- */
.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 18px 20px;
  border-bottom: 1px solid var(--cream-2);
  background: var(--white);
  position: sticky;
  top: 0;
  z-index: 20;
}
.topbar .brand {
  font-family: 'Playfair Display', serif;
  font-size: 1.25rem;
  color: var(--moss-dark);
  font-weight: 600;
}
.topbar .brand small {
  display: block;
  font-family: 'Inter', sans-serif;
  font-size: 0.7rem;
  color: var(--ink-soft);
  font-weight: 500;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}
.topbar form { margin: 0; }
.link-btn {
  background: none;
  border: none;
  color: var(--ink-soft);
  font-size: 0.85rem;
  cursor: pointer;
  padding: 8px;
}
.breadcrumb {
  font-size: 0.85rem;
  color: var(--ink-soft);
  margin: 20px 0 6px;
}
.breadcrumb a { color: var(--moss); }
.breadcrumb .sep { margin: 0 6px; opacity: 0.5; }

/* ---------- Hero ---------- */
.hero {
  text-align: center;
  padding: 56px 20px 40px;
}
.hero h1 {
  font-size: clamp(2.2rem, 6vw, 3.4rem);
  margin-bottom: 10px;
}
.hero .date {
  color: var(--gold);
  font-weight: 600;
  letter-spacing: 0.04em;
  font-size: 1.05rem;
  margin-bottom: 6px;
}
.hero .venue {
  color: var(--ink-soft);
  font-size: 0.95rem;
}
.hero .venue a { color: var(--moss); text-decoration: underline; text-underline-offset: 3px; }
.hero p.tagline {
  max-width: 560px;
  margin: 18px auto 0;
  color: var(--ink-soft);
  line-height: 1.6;
}

/* ---------- Card grid ---------- */
.grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 18px;
  margin: 22px 0;
}
.card {
  background: var(--white);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow);
  transition: transform 0.15s ease, box-shadow 0.15s ease;
  display: block;
}
.card:hover { transform: translateY(-3px); box-shadow: var(--shadow-lg); }
.card .cover {
  aspect-ratio: 4 / 3;
  background: var(--cream-2) url('data:image/svg+xml;utf8,') center/cover;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--gold);
  font-size: 2rem;
}
.card .cover img { width: 100%; height: 100%; object-fit: cover; display: block; }
.card .body { padding: 14px 16px; }
.card .body h3 { font-size: 1.1rem; margin-bottom: 3px; }
.card .body p { margin: 0; font-size: 0.8rem; color: var(--ink-soft); }

.add-card {
  border: 2px dashed #d8d0bd;
  border-radius: var(--radius);
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 140px;
  color: var(--ink-soft);
  cursor: pointer;
  background: transparent;
  font-size: 0.95rem;
  font-weight: 500;
  transition: border-color 0.15s ease, color 0.15s ease;
}
.add-card:hover { border-color: var(--gold); color: var(--gold); }

/* ---------- Section header ---------- */
.section-header { padding: 30px 0 6px; text-align: center; }
.section-header h1 { font-size: clamp(1.8rem, 5vw, 2.6rem); }
.section-header p { color: var(--ink-soft); max-width: 600px; margin: 6px auto 0; }
.section-meta { text-align: center; color: var(--ink-soft); font-size: 0.85rem; margin-bottom: 10px; }

.subsection-label {
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--ink-soft);
  margin: 30px 0 10px;
  font-weight: 600;
}

.gallery-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 10px;
  margin: 30px 0 10px;
}
.gallery-header .subsection-label { margin: 0; }

/* ---------- Upload widget ---------- */
.uploader {
  background: var(--white);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 22px;
  margin: 24px 0;
}
.dropzone {
  border: 2px dashed #cfc6ac;
  border-radius: 12px;
  padding: 30px 16px;
  text-align: center;
  color: var(--ink-soft);
  transition: border-color 0.15s ease, background 0.15s ease;
  cursor: pointer;
}
.dropzone.dragover { border-color: var(--gold); background: #fbf6ea; }
.dropzone .icon { font-size: 1.8rem; margin-bottom: 6px; }
.dropzone strong { color: var(--moss-dark); }
.dropzone small { display: block; margin-top: 6px; color: var(--ink-soft); font-size: 0.78rem; }

.uploader input[type="file"] { display: none; }
.name-row {
  margin-top: 14px;
  display: flex;
  gap: 10px;
  align-items: center;
  flex-wrap: wrap;
}
.name-row label { font-size: 0.85rem; color: var(--ink-soft); }
.name-row input[type="text"] {
  flex: 1;
  min-width: 160px;
  padding: 9px 12px;
  border: 1px solid #ddd4bd;
  border-radius: 8px;
  font-size: 0.9rem;
  font-family: inherit;
}

.btn {
  display: inline-block;
  background: var(--moss);
  color: var(--white);
  border: none;
  padding: 11px 20px;
  border-radius: 999px;
  font-size: 0.9rem;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.15s ease;
}
.btn:hover { background: var(--moss-dark); }
.btn.secondary { background: transparent; color: var(--moss); border: 1.5px solid var(--moss); }
.btn.secondary:hover { background: var(--moss); color: var(--white); }
.btn.small { padding: 7px 14px; font-size: 0.8rem; }

.progress-wrap { margin-top: 14px; display: none; }
.progress-wrap.active { display: block; }
.progress-bar-track {
  height: 8px;
  border-radius: 5px;
  background: var(--cream-2);
  overflow: hidden;
}
.progress-bar-fill {
  height: 100%;
  width: 0%;
  background: var(--gold);
  transition: width 0.2s ease;
}
.progress-label { font-size: 0.78rem; color: var(--ink-soft); margin-top: 6px; }
.upload-errors {
  margin-top: 12px;
  background: #fbeceb;
  border: 1px solid #eec9c5;
  border-radius: 8px;
  padding: 10px 14px;
  font-size: 0.82rem;
  color: var(--danger);
  display: none;
}
.upload-errors.active { display: block; }
.upload-errors ul { margin: 4px 0 0; padding-left: 18px; }

/* ---------- Gallery ---------- */
.gallery {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  gap: 10px;
  margin: 20px 0 40px;
}
.tile {
  position: relative;
  aspect-ratio: 1 / 1;
  border-radius: 10px;
  overflow: hidden;
  background: var(--cream-2);
  cursor: pointer;
  display: block;
}
.tile:focus-visible { outline: 3px solid var(--gold); outline-offset: 2px; }
.tile img { width: 100%; height: 100%; object-fit: cover; display: block; }
.tile .badge {
  position: absolute;
  top: 6px;
  right: 6px;
  background: rgba(47,44,38,0.65);
  color: #fff;
  font-size: 0.68rem;
  padding: 3px 7px;
  border-radius: 999px;
}
.tile .play {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.8rem;
  color: #fff;
  text-shadow: 0 2px 6px rgba(0,0,0,0.5);
}
.tile.pdf-tile { display: flex; flex-direction: column; align-items: center; justify-content: center; padding: 10px; text-align: center; }
.tile.pdf-tile .icon { font-size: 2rem; color: var(--gold); }
.tile.pdf-tile .fname { font-size: 0.68rem; color: var(--ink-soft); margin-top: 6px; word-break: break-word; line-height: 1.3; max-height: 2.6em; overflow: hidden; }
.tile .by { position: absolute; bottom: 0; left: 0; right: 0; background: linear-gradient(transparent, rgba(0,0,0,0.55)); color: #fff; font-size: 0.65rem; padding: 12px 6px 5px; opacity: 0; transition: opacity 0.15s ease; }
.tile:hover .by { opacity: 1; }

.tile .dl-btn {
  position: absolute;
  top: 6px;
  left: 6px;
  width: 26px;
  height: 26px;
  border-radius: 50%;
  background: rgba(47,44,38,0.65);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.85rem;
  opacity: 0;
  transition: opacity 0.15s ease, background 0.15s ease;
}
.tile .dl-btn:hover { background: var(--moss); }
.tile:hover .dl-btn, .tile:focus-within .dl-btn { opacity: 1; }
@media (hover: none) {
  .tile .dl-btn { opacity: 1; } /* always show on touch devices, no hover state */
}

.empty-state {
  text-align: center;
  padding: 40px 20px;
  color: var(--ink-soft);
  font-size: 0.9rem;
}

/* ---------- Forms / modal ---------- */
.inline-form {
  background: var(--white);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 18px;
  margin: 14px 0 24px;
  display: none;
}
.inline-form.active { display: block; }
.inline-form h3 { font-size: 1rem; margin-bottom: 10px; }
.inline-form input[type="text"], .inline-form textarea {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid #ddd4bd;
  border-radius: 8px;
  font-family: inherit;
  font-size: 0.9rem;
  margin-bottom: 10px;
}
.inline-form textarea { resize: vertical; min-height: 60px; }
.inline-form .actions { display: flex; gap: 10px; }

.error-banner {
  background: #fbeceb;
  border: 1px solid #eec9c5;
  color: var(--danger);
  padding: 10px 16px;
  border-radius: 8px;
  font-size: 0.85rem;
  max-width: 1100px;
  margin: 16px auto 0;
}

/* ---------- Login ---------- */
.login-wrap {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
}
.login-card {
  background: var(--white);
  border-radius: var(--radius);
  box-shadow: var(--shadow-lg);
  padding: 40px 34px;
  max-width: 380px;
  width: 100%;
  text-align: center;
}
.login-card h1 { font-size: 1.8rem; }
.login-card .date { color: var(--gold); font-weight: 600; margin-bottom: 4px; }
.login-card .venue { color: var(--ink-soft); font-size: 0.85rem; margin-bottom: 20px; }
.login-card input[type="password"] {
  width: 100%;
  padding: 12px 14px;
  border: 1px solid #ddd4bd;
  border-radius: 8px;
  font-size: 1rem;
  margin-bottom: 14px;
  text-align: center;
}
.login-card .btn { width: 100%; padding: 12px; }
.login-card .error { color: var(--danger); font-size: 0.85rem; margin-bottom: 12px; }

/* ---------- Lightbox ---------- */
.lightbox {
  position: fixed;
  inset: 0;
  background: rgba(20, 18, 14, 0.92);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 100;
  padding: 24px;
}
.lightbox.active { display: flex; }
.lightbox .content { max-width: 92vw; max-height: 88vh; text-align: center; }
.lightbox img, .lightbox video { max-width: 92vw; max-height: 80vh; border-radius: 8px; }
.lightbox .caption { color: #f0ece0; font-size: 0.85rem; margin-top: 12px; }
.lightbox .dl-link {
  display: inline-block;
  margin-top: 10px;
  color: #f0ece0;
  border: 1px solid rgba(240,236,224,0.5);
  border-radius: 999px;
  padding: 7px 16px;
  font-size: 0.8rem;
  text-decoration: none;
}
.lightbox .dl-link:hover { background: rgba(240,236,224,0.12); }
.lightbox .close {
  position: absolute;
  top: 18px;
  right: 24px;
  color: #fff;
  font-size: 2rem;
  cursor: pointer;
  background: none;
  border: none;
  line-height: 1;
}

footer.site-footer {
  text-align: center;
  color: var(--ink-soft);
  font-size: 0.78rem;
  padding: 30px 20px 50px;
}

@media (max-width: 480px) {
  .hero { padding: 40px 16px 28px; }
  .uploader { padding: 16px; }
}
