/* ── Reset & Base ──────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
[hidden] { display: none !important; }

:root {
  --bg: #ffffff;
  --text: #1a1a1a;
  --text-muted: #666;
  --accent: #333;
  --border: #e0e0e0;
  --card-bg: #f9f9f9;
  --btn-bg: #1a1a1a;
  --btn-text: #fff;
  --btn-hover: #333;
  --error: #c0392b;
  --success: #27ae60;
  --radius: 8px;
  --transition: 0.3s ease;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
}

/* ── Public Gallery Page ───────────────────────────────────── */
.gallery-page {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  padding: 2rem 1rem;
  gap: 1.5rem;
}

header h1 {
  font-size: clamp(1.5rem, 4vw, 2.5rem);
  font-weight: 300;
  letter-spacing: 0.05em;
  text-align: center;
  color: var(--text);
}

.gallery-container {
  display: flex;
  align-items: center;
  gap: 1rem;
  width: 100%;
  max-width: 1100px;
}

.photo-strip {
  display: flex;
  gap: 1rem;
  flex: 1;
  overflow: hidden;
}

/* Desktop: 3 photos */
.photo-strip .photo-slide {
  flex: 1;
  aspect-ratio: 4/3;
  border-radius: var(--radius);
  overflow: hidden;
  background: var(--border);
  transition: transform var(--transition), box-shadow var(--transition);
}

.photo-strip .photo-slide img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: transform var(--transition);
}

.photo-strip .photo-slide:hover img {
  transform: scale(1.02);
}

/* Centre photo gets slight emphasis */
.photo-strip .photo-slide.centre {
  box-shadow: 0 4px 20px rgba(0,0,0,0.12);
  transform: scale(1.03);
}

/* Placeholder tiles while loading */
.photo-placeholder {
  flex: 1;
  aspect-ratio: 4/3;
  border-radius: var(--radius);
  background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
  background-size: 200% 100%;
  animation: shimmer 1.4s infinite;
}

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

.nav-btn {
  background: var(--btn-bg);
  color: var(--btn-text);
  border: none;
  border-radius: 50%;
  width: 44px;
  height: 44px;
  font-size: 1.2rem;
  cursor: pointer;
  flex-shrink: 0;
  transition: background var(--transition), transform var(--transition);
  display: flex;
  align-items: center;
  justify-content: center;
}

.nav-btn:hover { background: var(--btn-hover); transform: scale(1.08); }
.nav-btn:disabled { opacity: 0.3; cursor: default; transform: none; }

.caption-bar {
  min-height: 1.5rem;
  text-align: center;
}

.caption-bar p {
  color: var(--text-muted);
  font-size: 0.95rem;
  font-style: italic;
  transition: opacity 0.3s;
}

/* ── Mobile: 1 photo ───────────────────────────────────────── */
@media (max-width: 767px) {
  .photo-strip .photo-slide:not(.centre) {
    display: none;
  }
  .photo-strip .photo-slide.centre {
    transform: none;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
  }
  .photo-placeholder:not(:first-child) {
    display: none;
  }
}

/* ── Admin Login ───────────────────────────────────────────── */
.admin-login {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  background: var(--bg);
  padding: 1rem;
}

.login-card {
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 2.5rem 2rem;
  width: 100%;
  max-width: 380px;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.login-card h2 {
  font-size: 1.3rem;
  font-weight: 500;
  margin-bottom: 0.5rem;
  text-align: center;
}

.login-card label {
  font-size: 0.85rem;
  color: var(--text-muted);
  margin-bottom: -0.25rem;
}

.login-card input {
  padding: 0.65rem 0.85rem;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  font-size: 1rem;
  outline: none;
  transition: border-color var(--transition);
}

.login-card input:focus { border-color: var(--accent); }

.login-card button {
  margin-top: 0.5rem;
  padding: 0.75rem;
  background: var(--btn-bg);
  color: var(--btn-text);
  border: none;
  border-radius: var(--radius);
  font-size: 1rem;
  cursor: pointer;
  transition: background var(--transition);
}

.login-card button:hover { background: var(--btn-hover); }

/* ── Admin Dashboard ───────────────────────────────────────── */
.admin-dashboard {
  max-width: 900px;
  margin: 0 auto;
  padding: 2rem 1rem;
}

.admin-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 2rem;
  flex-wrap: wrap;
  gap: 1rem;
}

.admin-header h1 { font-size: 1.5rem; font-weight: 500; }

.admin-actions { display: flex; gap: 0.75rem; }

.admin-actions button {
  padding: 0.6rem 1.2rem;
  border-radius: var(--radius);
  border: none;
  font-size: 0.9rem;
  cursor: pointer;
  transition: background var(--transition);
}

.admin-actions button:first-child {
  background: var(--btn-bg);
  color: var(--btn-text);
}

.admin-actions button:first-child:hover { background: var(--btn-hover); }

.btn-secondary {
  background: var(--card-bg) !important;
  color: var(--text) !important;
  border: 1px solid var(--border) !important;
}

.btn-secondary:hover { background: var(--border) !important; }

/* Photo list */
.photo-list { display: flex; flex-direction: column; gap: 1rem; }

.photo-item {
  display: flex;
  align-items: center;
  gap: 1rem;
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 0.85rem 1rem;
  flex-wrap: wrap;
}

.photo-item .thumb {
  width: 72px;
  height: 54px;
  object-fit: cover;
  border-radius: 4px;
  flex-shrink: 0;
  background: var(--border);
}

.photo-item .photo-info {
  flex: 1;
  min-width: 180px;
}

.photo-item .photo-info .filename {
  font-size: 0.9rem;
  font-weight: 500;
  margin-bottom: 0.2rem;
}

.photo-item .photo-info .uploaded {
  font-size: 0.78rem;
  color: var(--text-muted);
}

.photo-item .caption-group {
  display: flex;
  gap: 0.5rem;
  align-items: center;
  flex: 2;
  min-width: 200px;
}

.photo-item .caption-group input {
  flex: 1;
  padding: 0.45rem 0.7rem;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  font-size: 0.9rem;
  outline: none;
  transition: border-color var(--transition);
}

.photo-item .caption-group input:focus { border-color: var(--accent); }

.photo-item .caption-group button {
  padding: 0.45rem 0.8rem;
  background: var(--btn-bg);
  color: var(--btn-text);
  border: none;
  border-radius: var(--radius);
  cursor: pointer;
  font-size: 0.85rem;
  white-space: nowrap;
}

.photo-item .caption-group button:hover { background: var(--btn-hover); }

/* ── Pending guest uploads ─────────────────────────────────────────────── */
.pending-section {
  margin-bottom: 2rem;
  padding: 1.25rem;
  background: #fffbf0;
  border: 1px solid #f0e0a0;
  border-radius: var(--radius);
}

.section-title {
  font-size: 1rem;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 1rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

#gallery-section-title {
  background: none;
  border: none;
  padding: 0;
  margin-bottom: 1rem;
}

.badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: #e67e22;
  color: #fff;
  font-size: 0.75rem;
  font-weight: 700;
  border-radius: 999px;
  min-width: 1.4rem;
  height: 1.4rem;
  padding: 0 0.4rem;
}

.approve-btn {
  padding: 0.45rem 0.8rem;
  background: var(--success);
  color: #fff;
  border: none;
  border-radius: var(--radius);
  cursor: pointer;
  font-size: 0.85rem;
  white-space: nowrap;
  transition: background var(--transition);
}

.approve-btn:hover { background: #1e8449; }

/* ── Guest upload page extras ──────────────────────────────────────────── */
.guest-intro {
  font-size: 0.9rem;
  color: var(--text-muted);
  text-align: center;
  margin-bottom: 0.5rem;
}

.file-count {
  font-size: 0.85rem;
  color: var(--text-muted);
  text-align: center;
}

.delete-btn {
  padding: 0.45rem 0.8rem;
  background: transparent;
  color: var(--error);
  border: 1px solid var(--error);
  border-radius: var(--radius);
  cursor: pointer;
  font-size: 0.85rem;
  transition: background var(--transition), color var(--transition);
  white-space: nowrap;
}

.delete-btn:hover { background: var(--error); color: #fff; }

.empty-state {
  color: var(--text-muted);
  text-align: center;
  padding: 3rem 0;
  font-style: italic;
}

/* ── Shared messages ───────────────────────────────────────── */
.error-msg {
  background: #fdf0ef;
  color: var(--error);
  border: 1px solid #f5c6c2;
  border-radius: var(--radius);
  padding: 0.65rem 0.9rem;
  font-size: 0.9rem;
  margin-bottom: 0.5rem;
}

.success-msg {
  background: #eafaf1;
  color: var(--success);
  border: 1px solid #a9dfbf;
  border-radius: var(--radius);
  padding: 0.65rem 0.9rem;
  font-size: 0.9rem;
  margin-bottom: 0.5rem;
}
