:root {
  --font-sans: ui-sans-serif, system-ui, -apple-system, 'Helvetica Neue', Arial, sans-serif;
  --font-serif: 'Playfair Display', serif;
  --font-script: 'Great Vibes', cursive;

  --blush: #f4dcd7;
  --blush-deep: #efcec7;
  --blush-soft: #faeae6;
  --sage: #7a8a68;
  --sage-deep: #5e6f4f;
  --sage-soft: #b8c4a8;
  --gold: #b89a5e;
  --gold-deep: #9a8048;
  --cream: #f9f3e7;
  --ivory: #fdfaf3;
  --ink: #3a3a3a;
  --ink-soft: #585554;
  --muted: #8a8278;
  --border: #e6d8cf;
  --shadow: 0 6px 18px rgba(60, 50, 30, 0.08);
  --shadow-lg: 0 16px 40px rgba(60, 50, 30, 0.14);
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }

body {
  background: var(--ivory);
  color: var(--ink);
  font-family: var(--font-serif);
  font-size: 17px;
  line-height: 1.55;
  min-height: 100vh;
  -webkit-tap-highlight-color: transparent;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
}

/* Centered top branding */
.topbrand {
  width: 100%;
  text-align: center;
  padding: 48px 20px 18px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
}
.we-tagline {
  color: var(--sage-deep);
  font-family: var(--font-serif);
  font-style: italic;
  font-weight: 500;
  font-size: 20px;
  line-height: 1.3;
  margin: 0;
}
.monogram {
  font-family: var(--font-serif);
  font-weight: 600;
  font-size: 48px;
  color: var(--gold);
  letter-spacing: 0.06em;
  line-height: 1;
  margin: 0;
}
.monogram .amp { font-style: italic; font-weight: 500; padding: 0 6px; }
.event-date {
  font-family: var(--font-sans);
  font-size: 12px;
  letter-spacing: 0.4em;
  text-transform: uppercase;
  color: var(--ink-soft);
  margin: 0;
}

/* Main page wrapper */
.page {
  max-width: 1100px;
  width: 100%;
  margin: 0 auto;
  padding: 32px 24px 64px;
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 28px;
}

/* Footer */
.bottom {
  width: 100%;
  text-align: center;
  font-family: var(--font-serif);
  font-style: italic;
  font-size: 14px;
  color: var(--muted);
  padding: 28px 16px 36px;
}

/* Eyebrow + display heading */
.eyebrow {
  font-family: var(--font-sans);
  font-size: 12px;
  letter-spacing: 0.4em;
  text-transform: uppercase;
  color: var(--gold-deep);
  margin: 0;
}
.display-heading {
  font-family: var(--font-serif);
  font-weight: 600;
  font-size: 60px;
  line-height: 1.05;
  color: var(--ink);
  margin: 12px 0 14px;
  text-align: center;
}
.subtitle {
  font-family: var(--font-serif);
  font-style: italic;
  color: var(--muted);
  font-size: 19px;
  margin: 0 0 24px;
  text-align: center;
}

/* Page heading (table.html) */
.page-heading {
  text-align: center;
  padding: 8px 0 16px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
}

/* Gallery wall — heading in middle, cards around it */
.gallery-wall {
  width: 100%;
  display: grid;
  grid-template-columns: 1fr;
  gap: 24px;
  grid-auto-flow: dense;
  justify-items: center;
}
.gallery-wall[hidden] { display: none; }
.gallery-wall .card { width: 100%; }

.gallery-wall .center-block {
  text-align: center;
  padding: 28px 12px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 6px;
}
.gallery-wall .center-block .eyebrow { margin-bottom: 6px; }
.gallery-wall .center-block .subtitle { margin-bottom: 18px; }

@media (min-width: 640px) {
  .gallery-wall { grid-template-columns: repeat(2, 1fr); }
  .gallery-wall .center-block { grid-column: 1 / -1; }
}
@media (min-width: 900px) {
  .gallery-wall { grid-template-columns: repeat(3, 1fr); }
  .gallery-wall .center-block {
    grid-column: 2 / span 1;
    grid-row: 2;
    padding: 14px 10px;
  }
  .gallery-wall .center-block .display-heading { font-size: 46px; }
}
@media (min-width: 1200px) {
  .gallery-wall { grid-template-columns: repeat(4, 1fr); }
  .gallery-wall .center-block {
    grid-column: 2 / span 2;
    grid-row: 2;
  }
  .gallery-wall .center-block .display-heading { font-size: 54px; }
}

/* Upload CTA pill */
.upload-cta {
  display: inline-block;
  padding: 14px 34px;
  font-family: var(--font-sans);
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.32em;
  text-transform: uppercase;
  color: #fff;
  background: var(--gold);
  border: 1px solid var(--gold);
  border-radius: 999px;
  text-decoration: none;
  transition: background .2s ease, transform .15s ease, box-shadow .2s ease;
}
.upload-cta:hover { background: var(--gold-deep); border-color: var(--gold-deep); box-shadow: var(--shadow); }
.upload-cta:active { transform: translateY(1px); }

/* Empty hero */
.empty-hero {
  text-align: center;
  padding: 60px 20px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 6px;
}
.empty-hero[hidden] { display: none; }

/* Cards */
.card {
  display: block;
  background: var(--ivory);
  border: 1px solid var(--border);
  border-radius: 14px;
  overflow: hidden;
  text-decoration: none;
  color: inherit;
  box-shadow: var(--shadow);
  transition: transform .25s ease, box-shadow .25s ease;
}
.card:hover { transform: translateY(-3px); box-shadow: var(--shadow-lg); }
.card-thumb {
  width: 100%;
  aspect-ratio: 4 / 3;
  background-size: cover;
  background-position: center;
  background-color: var(--blush-soft);
}
.card-body { padding: 16px 16px 20px; text-align: center; }
.card-title {
  font-family: var(--font-serif);
  font-weight: 600;
  font-size: 22px;
  color: var(--sage-deep);
}
.card-sub {
  font-family: var(--font-serif);
  font-style: italic;
  color: var(--muted);
  font-size: 15px;
  margin-top: 4px;
}

/* --- Upload page hero / form --- */
.hero-section {
  position: relative;
  width: 100%;
  min-height: 400px;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  color: #fff;
  padding: 64px 28px;
  border-radius: 18px;
}
.hero-section[hidden] { display: none; }
.hero-bg {
  position: absolute; inset: 0;
  background:
    linear-gradient(180deg, rgba(94, 111, 79, 0.55) 0%, rgba(94, 111, 79, 0.7) 100%),
    radial-gradient(120% 80% at 50% 20%, #9aaa86 0%, #6e7e5d 60%, #4f5d42 100%);
  z-index: 0;
}
.hero-inner {
  position: relative;
  z-index: 1;
  max-width: 560px;
  width: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
}
.form-error {
  margin: 12px 0 0;
  color: #ffd9d9;
  background: rgba(120, 0, 0, 0.35);
  border: 1px solid rgba(255, 180, 180, 0.4);
  padding: 8px 12px;
  border-radius: 6px;
  font-size: 14px;
  text-align: center;
}
.script-lead {
  font-family: var(--font-serif);
  font-style: italic;
  font-weight: 500;
  font-size: 24px;
  color: #fff;
  margin: 0;
  text-shadow: 0 1px 4px rgba(0,0,0,0.2);
}
.script-display {
  font-family: var(--font-script);
  font-weight: 400;
  font-size: 112px;
  line-height: 1;
  letter-spacing: 0;
  color: #fff;
  margin: 0 0 8px;
  text-shadow: 0 2px 12px rgba(0,0,0,0.18);
}
.hero-tagline {
  font-family: var(--font-serif);
  font-style: italic;
  font-size: 18px;
  color: #fff;
  opacity: 0.96;
  margin: 0 0 16px;
}
#table-form {
  display: flex;
  gap: 10px;
  margin: 8px auto 0;
  max-width: 420px;
  width: 100%;
  justify-content: center;
}
#table-form input {
  flex: 1;
  padding: 14px 18px;
  font-size: 16px;
  font-family: var(--font-serif);
  border: 1px solid rgba(255,255,255,0.6);
  background: rgba(255,255,255,0.95);
  color: var(--ink);
  border-radius: 999px;
  outline: none;
  text-align: center;
}
#table-form input:focus { box-shadow: 0 0 0 4px rgba(184, 154, 94, 0.45); }
#table-form button {
  padding: 14px 28px;
  font-family: var(--font-sans);
  font-size: 12px;
  font-weight: 600;
  background: var(--gold);
  color: #fff;
  border: 1px solid var(--gold);
  border-radius: 999px;
  cursor: pointer;
  letter-spacing: 0.32em;
  text-transform: uppercase;
  transition: background .2s ease, transform .15s ease;
}
#table-form button:hover { background: var(--gold-deep); border-color: var(--gold-deep); }
#table-form button:active { transform: translateY(1px); }

/* Upload panel (after table # is set) */
.panel {
  width: 100%;
  max-width: 720px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 18px;
}
.panel[hidden] { display: none; }
.panel-head {
  text-align: center;
  padding: 8px 0 16px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
}
.panel-title {
  font-family: var(--font-script);
  font-weight: 400;
  font-size: 76px;
  line-height: 1;
  letter-spacing: 0;
  color: var(--sage-deep);
  margin: 4px 0 8px;
}

.link {
  background: none;
  border: none;
  color: var(--gold-deep);
  font-family: var(--font-sans);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.28em;
  text-transform: uppercase;
  cursor: pointer;
  padding: 0;
}
.link:hover { color: var(--sage-deep); }

.upload-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  width: 100%;
  padding: 18px 22px;
  font-family: var(--font-sans);
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.3em;
  text-transform: uppercase;
  background: var(--gold);
  color: #fff;
  border: 1px solid var(--gold);
  border-radius: 999px;
  cursor: pointer;
  transition: background .2s ease, transform .15s ease, box-shadow .2s ease;
}
.upload-btn:hover { background: var(--gold-deep); border-color: var(--gold-deep); box-shadow: var(--shadow); }
.upload-btn:active { transform: translateY(1px); }
.upload-btn:disabled { opacity: 0.5; cursor: not-allowed; }
.upload-icon { color: rgba(255,255,255,0.85); font-size: 14px; }

.hint {
  color: var(--muted);
  text-align: center;
  margin: 4px 0 12px;
  font-style: italic;
  font-family: var(--font-serif);
  font-size: 16px;
}

/* Pending tray */
.pending-tray {
  width: 100%;
  background: var(--blush-soft);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 22px;
}
.pending-tray[hidden] { display: none; }
.pending-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 14px;
}
.pending-head strong {
  font-family: var(--font-serif);
  font-weight: 600;
  font-style: italic;
  font-size: 18px;
  color: var(--sage-deep);
}
.pending-list {
  list-style: none;
  padding: 0;
  margin: 0 0 18px;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(84px, 1fr));
  gap: 8px;
  justify-items: center;
}
.pending-item {
  position: relative;
  aspect-ratio: 1 / 1;
  width: 100%;
  border-radius: 10px;
  overflow: hidden;
  background: var(--blush-deep);
  border: 1px solid var(--border);
}
.pending-item img { width: 100%; height: 100%; object-fit: cover; display: block; }
.pending-item .remove {
  position: absolute;
  top: 5px; right: 5px;
  width: 22px; height: 22px;
  border-radius: 50%;
  background: rgba(58, 58, 58, 0.8);
  color: #fff;
  border: none;
  font-size: 14px;
  line-height: 1;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0;
}

/* Uploaded items list */
.upload-list {
  list-style: none;
  padding: 0;
  margin: 0;
  display: grid;
  gap: 10px;
  width: 100%;
}
.upload-item {
  display: flex;
  gap: 14px;
  background: var(--ivory);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 12px 14px;
  align-items: center;
}
.upload-item img {
  width: 56px; height: 56px; object-fit: cover; border-radius: 8px; background: var(--blush-soft);
}
.upload-item .meta { flex: 1; min-width: 0; text-align: left; }
.upload-item .name {
  font-family: var(--font-serif);
  font-weight: 600;
  font-size: 17px;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
  color: var(--ink);
}
.upload-item .status {
  font-family: var(--font-sans);
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.28em;
  text-transform: uppercase;
  color: var(--muted);
}
.upload-item.pending .status { color: var(--gold-deep); }
.upload-item.done .status { color: var(--sage-deep); }
.upload-item.error .status { color: #a4453c; }

/* Table photo grid */
.photo-grid {
  width: 100%;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
  gap: 12px;
  justify-items: center;
}
.photo { margin: 0; position: relative; width: 100%; }
.photo-delete {
  display: none;
  position: absolute;
  top: 6px;
  right: 6px;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  border: none;
  background: rgba(0, 0, 0, 0.65);
  color: #fff;
  font-size: 18px;
  line-height: 1;
  cursor: pointer;
  z-index: 2;
}
body.admin .photo-delete { display: block; }
.admin-banner {
  background: #2b2b2b;
  color: #fff;
  text-align: center;
  padding: 10px 12px;
  font-family: var(--font-sans);
  font-size: 12px;
  letter-spacing: 0.24em;
  text-transform: uppercase;
  width: 100%;
}
.admin-banner .link {
  background: none;
  border: none;
  color: #fff;
  text-decoration: underline;
  cursor: pointer;
  font: inherit;
  margin-left: 8px;
}
.photo img {
  width: 100%;
  aspect-ratio: 1 / 1;
  object-fit: cover;
  border-radius: 8px;
  cursor: pointer;
  background: var(--blush-soft);
  display: block;
  border: 1px solid var(--border);
  transition: transform .2s ease, box-shadow .2s ease;
}
.photo img:hover { transform: scale(1.02); box-shadow: var(--shadow); }

/* Back link */
.back-link {
  text-align: center;
  margin: 12px 0 0;
}
.back-link a {
  font-family: var(--font-sans);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.28em;
  text-transform: uppercase;
  color: var(--gold-deep);
  text-decoration: none;
}
.back-link a:hover { color: var(--sage-deep); }

/* Lightbox */
.lightbox {
  position: fixed; inset: 0;
  background: rgba(28, 28, 28, 0.94);
  display: flex; align-items: center; justify-content: center;
  z-index: 100;
  padding: 20px;
}
.lightbox[hidden] { display: none; }
.lightbox img {
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
  border-radius: 4px;
  box-shadow: 0 20px 60px rgba(0,0,0,0.6);
}

/* Responsive tweaks */
@media (max-width: 640px) {
  .topbrand { padding: 32px 20px 10px; gap: 10px; }
  .we-tagline { font-size: 18px; }
  .monogram { font-size: 40px; }
  .display-heading { font-size: 44px; }
  .panel-title { font-size: 58px; }
  .script-display { font-size: 84px; }
  .script-lead { font-size: 20px; }
  .page { padding: 22px 18px 40px; gap: 22px; }
  #table-form { flex-direction: column; }
  #table-form input, #table-form button { width: 100%; }
}
