:root {
  --bg: #FBF6F0;
  --card: #FFFDFB;
  --surface-alt: #F3ECE3;
  --border-color: #E3D8CB;
  --accent: #AD6A72;
  --accent-dark: #8B4F58;
  --accent-soft: #F3E1E1;
  --sage: #7C8863;
  --sage-soft: #E7EBDD;
  --gold: #C9A66B;
  --text: #2B2622;
  --muted: #8C8072;
  --danger: #B33A2E;
  --danger-border: #E3A3A3;
  --danger-soft: #FBE9E9;
  --font-display: 'Cormorant Garamond', Georgia, 'Times New Roman', serif;
  --font-body: 'Jost', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: var(--font-body);
  background: var(--bg);
  color: var(--text);
}

a { color: var(--accent-dark); }
a:hover { color: var(--accent); }

header {
  text-align: center;
  padding: 40px 16px 24px;
}

.brand-mark {
  color: var(--accent);
  margin-bottom: 8px;
}

.brand-mark svg { display: block; margin: 0 auto; }

header h1 {
  margin: 0 0 4px;
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 2.1rem;
}

.gold-divider {
  width: 40px;
  height: 1px;
  background: var(--gold);
  margin: 14px auto;
}

header p { margin: 0; color: var(--muted); font-size: 0.95rem; }

.welcome-message {
  font-family: var(--font-display);
  font-style: italic;
  font-size: 1.15rem;
  color: var(--text);
  margin: 0 0 14px;
  line-height: 1.4;
}

main {
  max-width: 960px;
  margin: 0 auto;
  padding: 16px;
}

.upload-form {
  background: var(--card);
  border-radius: 20px;
  padding: 22px 20px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  box-shadow: 0 1px 3px rgba(45,38,33,0.06), 0 8px 24px rgba(45,38,33,0.05);
}

.upload-form label {
  font-weight: 500;
  font-size: 0.85rem;
  margin-top: 10px;
}

.upload-form label .optional {
  font-weight: 400;
  color: var(--muted);
  font-size: 0.8rem;
}

.upload-form input[type="text"],
.upload-form input[type="email"],
.upload-form input[type="password"],
.upload-form input[type="date"],
.upload-form textarea {
  border: 1px solid var(--border-color);
  border-radius: 10px;
  padding: 10px 13px;
  font-size: 0.95rem;
  font-family: inherit;
  background: var(--surface-alt);
  resize: vertical;
  width: 100%;
}

.upload-form input[type="text"]:focus,
.upload-form input[type="email"]:focus,
.upload-form input[type="password"]:focus,
.upload-form input[type="date"]:focus,
.upload-form textarea:focus {
  outline: 2px solid var(--accent);
  background: var(--card);
}

.drop-zone {
  border: 1.5px dashed var(--accent);
  border-radius: 16px;
  padding: 28px 16px;
  text-align: center;
  background: var(--accent-soft);
  cursor: pointer;
  transition: background 0.15s;
  margin-top: 16px;
}

.drop-zone.dragover {
  background: #EFC9CE;
}

.drop-zone p {
  margin: 0 0 16px;
  color: var(--muted);
  font-size: 0.9rem;
  line-height: 1.5;
}

button {
  font-family: var(--font-body);
}

button, .drop-zone button {
  background: var(--accent);
  color: white;
  border: none;
  padding: 12px 24px;
  border-radius: 999px;
  font-size: 0.95rem;
  font-weight: 500;
  cursor: pointer;
}

button:hover { background: var(--accent-dark); }

.progress-list {
  margin-top: 16px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.progress-item {
  background: var(--card);
  border-radius: 10px;
  padding: 10px 14px;
  font-size: 0.85rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
}

.progress-item .bar {
  flex: 1;
  height: 6px;
  background: var(--surface-alt);
  border-radius: 3px;
  overflow: hidden;
}

.progress-item .bar-fill {
  height: 100%;
  background: var(--accent);
  width: 0%;
  transition: width 0.1s;
}

.progress-item.error { color: var(--danger); }
.progress-item.done { color: #3E7A4E; }

section h2 {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 1.55rem;
  margin: 36px 0 0;
}

section h2::after {
  content: '';
  display: block;
  width: 32px;
  height: 1px;
  background: var(--gold);
  margin: 10px 0 16px;
}

.gallery-heading-row {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 10px;
}

.gallery-heading-row h2 { margin: 36px 0 0; }

.gallery-heading-row .download-btn {
  padding: 9px 18px;
  font-size: 0.85rem;
  margin-top: 36px;
}

.download-all-buttons {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.download-btn.secondary {
  background: transparent;
  color: var(--accent-dark);
  border: 1px solid var(--accent);
}

.download-btn.secondary:hover {
  background: var(--accent-soft);
}

.download-all-note {
  font-size: 0.78rem;
  color: var(--muted);
  margin: 0 0 12px;
  line-height: 1.5;
}

.entries {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.entry-card {
  background: var(--card);
  border-radius: 18px;
  padding: 18px 20px;
  box-shadow: 0 1px 2px rgba(45,38,33,0.05), 0 6px 16px rgba(45,38,33,0.04);
}

.entry-header {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 4px;
}

.entry-name {
  font-weight: 600;
  color: var(--accent-dark);
}

.entry-date {
  font-size: 0.78rem;
  color: var(--muted);
}

.entry-note {
  margin: 4px 0 12px;
  color: var(--text);
  font-style: italic;
  white-space: pre-wrap;
}

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

.photo-item {
  position: relative;
}

.gallery img,
.gallery video {
  width: 100%;
  height: 150px;
  object-fit: cover;
  border-radius: 12px;
  cursor: pointer;
  background: #2C2724;
  display: block;
}

.video-badge {
  position: absolute;
  top: 6px;
  left: 6px;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: rgba(35,30,27,0.55);
  color: white;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.7rem;
  pointer-events: none;
}

.photo-download {
  position: absolute;
  bottom: 6px;
  right: 6px;
  width: 30px;
  height: 30px;
  border-radius: 50%;
  background: rgba(35,30,27,0.55);
  color: white;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.95rem;
  text-decoration: none;
  line-height: 1;
}

.photo-download:hover {
  background: rgba(35,30,27,0.75);
}

.lightbox {
  position: fixed;
  inset: 0;
  background: rgba(24,20,18,0.9);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  z-index: 10;
}

#lightbox-close.lightbox-close {
  position: fixed !important;
  top: 16px !important;
  top: max(16px, env(safe-area-inset-top)) !important;
  right: 16px !important;
  right: max(16px, env(safe-area-inset-right)) !important;
  left: auto !important;
  bottom: auto !important;
  margin: 0 !important;
  width: 40px;
  height: 40px;
  padding: 0;
  border-radius: 50%;
  border: none;
  background: rgba(35,30,27,0.55);
  color: white;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  z-index: 2147483647;
}

.lightbox-close:hover {
  background: rgba(35,30,27,0.75);
}

.hidden { display: none; }

.not-found-msg {
  text-align: center;
  color: var(--muted);
  font-size: 1.05rem;
  margin-top: 60px;
}

.lightbox-inner {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 14px;
  max-width: 100%;
  max-height: 100%;
}

.lightbox img,
.lightbox video {
  max-width: 100%;
  max-height: 80vh;
  border-radius: 10px;
}

.download-btn {
  background: var(--accent);
  color: white;
  border: none;
  padding: 10px 22px;
  border-radius: 999px;
  font-size: 0.95rem;
  font-weight: 500;
  cursor: pointer;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.download-btn:hover {
  background: var(--accent-dark);
}

.download-btn.photo-download,
.download-btn.photo-download:hover {
  background: rgba(35,30,27,0.55);
  padding: 0;
}

.download-btn.photo-download:hover {
  background: rgba(35,30,27,0.75);
}
