/* Theme variables are injected from config.js at runtime (see app.js). */
:root {
  --bg: #faf7f2;
  --surface: #ffffff;
  --text: #2b2b2b;
  --muted: #7a7368;
  --primary: #9aa884;
  --primary-dark: #76845f;
  --accent: #c9a24b;
  --font-head: 'Cormorant Garamond', 'Georgia', serif;
  --font-name: 'Pinyon Script', 'Cormorant Garamond', cursive;
  --radius: 16px;
  --shadow: 0 6px 24px rgba(0,0,0,.08);
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
/* The [hidden] attribute must always win over class display rules
   (e.g. the lightbox/queue use display:flex). */
[hidden] { display: none !important; }
html, body { margin: 0; padding: 0; }
body {
  background: var(--bg);
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

/* ---------- HERO ---------- */
.hero {
  position: relative;
  min-height: 42vh;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  background: linear-gradient(135deg, var(--primary), var(--primary-dark));
  background-size: cover;
  background-position: center;
  color: #fff;
  padding: 48px 20px;
}
.hero.has-image::after {
  content: "";
  position: absolute; inset: 0;
  background: rgba(0,0,0,.35);
}
.hero-overlay { position: relative; z-index: 1; }
.hero-welcome {
  text-transform: uppercase;
  letter-spacing: .25em;
  font-size: .8rem;
  margin: 0 0 12px;
  opacity: .9;
}
.hero-names {
  font-family: var(--font-name);
  font-size: clamp(3rem, 13vw, 6rem);
  font-weight: 400;
  line-height: 1.05;
  margin: 0;
  text-shadow: 0 2px 14px rgba(0,0,0,.3);
}
.hero-event {
  font-family: var(--font-head);
  font-size: 1.15rem;
  letter-spacing: .12em;
  text-transform: uppercase;
  margin: 10px 0 0;
  opacity: .95;
}
.hero-date { font-size: .95rem; margin: 10px 0 0; opacity: .9; letter-spacing: .05em; }
.hero-venue { font-size: .85rem; margin: 4px 0 0; opacity: .8; letter-spacing: .04em; }

/* ---------- LAYOUT ---------- */
.container { max-width: 920px; margin: 0 auto; padding: 0 16px; }
.card {
  background: var(--surface);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 24px;
}
.upload-card {
  margin-top: -36px;
  position: relative;
  z-index: 2;
  text-align: center;
}
.upload-prompt { color: var(--muted); margin: 0 0 18px; }

.guest-fields { display: flex; flex-direction: column; gap: 10px; margin-bottom: 16px; }
.field {
  width: 100%;
  padding: 12px 14px;
  border: 1px solid #e4ddd2;
  border-radius: 12px;
  font-size: 16px; /* prevents iOS zoom */
  background: #fdfcfa;
  color: var(--text);
}
.field:focus { outline: none; border-color: var(--primary); box-shadow: 0 0 0 3px rgba(154,168,132,.25); }

/* ---------- BUTTONS ---------- */
.btn {
  border: none;
  border-radius: 12px;
  padding: 14px 22px;
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  transition: transform .05s ease, background .15s ease;
}
.btn:active { transform: scale(.98); }
.btn-primary { background: var(--primary); color: #fff; }
.btn-primary:hover { background: var(--primary-dark); }
.btn-ghost { background: transparent; color: var(--muted); font-size: 1.3rem; padding: 6px 12px; }

/* ---------- UPLOAD QUEUE ---------- */
.queue { margin-top: 18px; display: flex; flex-direction: column; gap: 8px; text-align: left; }
.queue-item {
  display: flex; align-items: center; gap: 10px;
  font-size: .85rem; color: var(--muted);
  background: #fafafa; border-radius: 10px; padding: 8px 12px;
}
.queue-item .bar { flex: 1; height: 6px; background: #eee; border-radius: 3px; overflow: hidden; }
.queue-item .bar > span { display: block; height: 100%; width: 0; background: var(--primary); transition: width .2s ease; }
.queue-item.done { color: var(--primary-dark); }
.queue-item.error { color: #c0392b; }

/* ---------- GALLERY ---------- */
.gallery-section { margin: 36px 0; }
.gallery-head { display: flex; align-items: center; justify-content: space-between; }
.gallery-head h2 { font-family: var(--font-head); font-weight: 500; margin: 0; }
.gallery-empty { color: var(--muted); text-align: center; padding: 40px 0; }
.gallery {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(110px, 1fr));
  gap: 8px;
  margin-top: 16px;
}
.gallery figure {
  margin: 0; position: relative; aspect-ratio: 1; overflow: hidden;
  border-radius: 12px; background: #eee; cursor: pointer;
}
.gallery img { width: 100%; height: 100%; object-fit: cover; display: block; transition: transform .25s ease; }
.gallery figure:hover img { transform: scale(1.05); }
.gallery .tag {
  position: absolute; left: 0; right: 0; bottom: 0;
  font-size: .7rem; color: #fff; padding: 14px 8px 6px;
  background: linear-gradient(transparent, rgba(0,0,0,.6));
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}

/* ---------- LIGHTBOX ---------- */
.lightbox {
  position: fixed; inset: 0; z-index: 50;
  background: rgba(0,0,0,.92);
  display: flex; align-items: center; justify-content: center; flex-direction: column;
  padding: 20px;
}
.lightbox img { max-width: 100%; max-height: 80vh; object-fit: contain; border-radius: 6px; }
.lightbox-caption { color: #fff; margin-top: 14px; text-align: center; font-size: .95rem; opacity: .9; }
.lightbox-close {
  position: absolute; top: 16px; right: 16px;
  background: rgba(255,255,255,.15); color: #fff; border: none;
  width: 44px; height: 44px; border-radius: 50%; font-size: 1.2rem; cursor: pointer;
}

/* ---------- FOOTER ---------- */
.footer { text-align: center; padding: 32px 16px 48px; color: var(--muted); font-family: var(--font-head); }
