/* ── Reset & Variables ───────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --cream:       #fdf8f2;
  --rose:        #8b6f7a;
  --rose-dark:   #7a5f6a;
  --rose-light:  #f5e6eb;
  --gold:        #c9945a;
  --gold-dark:   #b07a44;
  --dark:        #3d3333;
  --mid:         #7a6060;
  --border:      #e8d5c9;
  --card:        #ffffff;
  --shadow:      0 4px 20px rgba(61,51,51,.08);
  --shadow-lg:   0 10px 40px rgba(61,51,51,.15);
  --radius:      14px;
  --radius-sm:   8px;
  --ease:        .25s ease;
}

html { scroll-behavior: smooth; }

body {
  font-family: 'Segoe UI', system-ui, -apple-system, sans-serif;
  background: var(--cream);
  color: var(--dark);
  min-height: 100vh;
  line-height: 1.6;
}

.container { max-width: 1200px; margin: 0 auto; padding: 0 24px; }

a { color: var(--rose); text-decoration: none; }
a:hover { text-decoration: underline; }

/* ── Typography ──────────────────────────────────────── */
.serif { font-family: Georgia, 'Times New Roman', serif; }

/* ── Buttons ─────────────────────────────────────────── */
.btn {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 10px 22px; border-radius: 30px; border: 2px solid transparent;
  font-size: .9rem; font-weight: 600; cursor: pointer;
  transition: var(--ease); text-decoration: none; white-space: nowrap;
  line-height: 1.2;
}
.btn:hover { transform: translateY(-1px); text-decoration: none; }
.btn:active { transform: translateY(0); }

.btn-primary   { background: var(--rose); color: #fff; }
.btn-primary:hover { background: var(--rose-dark); }

.btn-outline   { background: transparent; color: var(--rose); border-color: var(--rose); }
.btn-outline:hover { background: var(--rose); color: #fff; }

.btn-gold      { background: var(--gold); color: #fff; border-color: var(--gold); }
.btn-gold:hover { background: var(--gold-dark); }

.btn-danger    { background: #d9534f; color: #fff; border-color: #d9534f; }
.btn-danger:hover { background: #c9302c; }

.btn-sm { padding: 6px 14px; font-size: .8rem; }

/* ── Site Header ─────────────────────────────────────── */
.site-header {
  background: #fff; border-bottom: 1px solid var(--border);
  position: sticky; top: 0; z-index: 200;
  box-shadow: 0 2px 12px rgba(0,0,0,.05);
}
.site-header .container {
  display: flex; align-items: center; justify-content: space-between;
  padding-top: 16px; padding-bottom: 16px; gap: 16px; flex-wrap: wrap;
}
.site-title {
  font-family: Georgia, serif; font-size: 1.7rem; font-style: italic;
  color: var(--rose); letter-spacing: -.5px;
}
.site-nav { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }

/* ── Alerts ──────────────────────────────────────────── */
.alert {
  padding: 13px 18px; border-radius: var(--radius-sm);
  font-size: .9rem; margin-bottom: 20px; border-left: 4px solid currentColor;
}
.alert-error   { background: #fef2f2; color: #b91c1c; }
.alert-success { background: #f0fdf4; color: #166534; }
.alert-info    { background: #eff6ff; color: #1e40af; }
.alert-warning { background: #fffbeb; color: #92400e; }

/* ── Gallery Page ────────────────────────────────────── */
.gallery-hero {
  text-align: center; padding: 48px 24px 24px;
}
.gallery-hero h2 {
  font-family: Georgia, serif; font-size: 1.1rem; font-style: italic;
  color: var(--mid); font-weight: normal; margin-bottom: 4px;
}
.gallery-hero .count { font-size: .85rem; color: #aaa; }

.gallery-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 24px; padding: 0 0 60px;
}

.gallery-item {
  background: var(--card); border-radius: var(--radius);
  overflow: hidden; box-shadow: var(--shadow);
  cursor: pointer; transition: var(--ease);
  display: flex; flex-direction: column;
}
.gallery-item:hover {
  box-shadow: var(--shadow-lg); transform: translateY(-5px);
}

.thumb-wrap {
  position: relative; aspect-ratio: 1 / 1; overflow: hidden;
  background: var(--border);
}
.thumb-wrap img {
  width: 100%; height: 100%; object-fit: cover;
  transition: transform .5s ease;
}
.gallery-item:hover .thumb-wrap img { transform: scale(1.06); }

.thumb-overlay {
  position: absolute; inset: 0;
  background: rgba(139,111,122,.4);
  display: flex; align-items: center; justify-content: center;
  opacity: 0; transition: var(--ease);
}
.gallery-item:hover .thumb-overlay { opacity: 1; }
.thumb-overlay svg { width: 40px; height: 40px; fill: #fff; filter: drop-shadow(0 2px 4px rgba(0,0,0,.4)); }

.gallery-caption {
  padding: 14px 16px; flex: 1;
}
.gallery-caption h3 {
  font-size: .95rem; font-weight: 600; color: var(--dark);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  margin-bottom: 3px;
}
.gallery-caption time { font-size: .78rem; color: var(--mid); }

.empty-state {
  text-align: center; padding: 80px 20px; color: var(--mid);
}
.empty-state .empty-icon { font-size: 4rem; margin-bottom: 16px; }
.empty-state h2 { font-family: Georgia, serif; margin-bottom: 10px; color: var(--rose); }
.empty-state p  { font-size: .95rem; }

/* ── Lightbox ────────────────────────────────────────── */
.lightbox {
  position: fixed; inset: 0; z-index: 1000;
  display: flex; align-items: center; justify-content: center;
}
.lb-overlay {
  position: absolute; inset: 0;
  background: rgba(15,8,12,.92); backdrop-filter: blur(6px);
}
.lb-box {
  position: relative; z-index: 1;
  display: flex; flex-direction: column; align-items: center;
  max-width: 94vw; max-height: 96vh; gap: 14px;
}
.lb-stage {
  display: flex; align-items: center; gap: 12px;
  max-width: 90vw;
}
.lb-img-wrap {
  max-width: 78vw; max-height: 72vh;
  display: flex; align-items: center; justify-content: center;
}
.lb-img-wrap img {
  max-width: 100%; max-height: 72vh; object-fit: contain;
  border-radius: 10px; box-shadow: 0 20px 60px rgba(0,0,0,.6);
}
.lb-nav {
  background: rgba(255,255,255,.12); color: #fff;
  border: 2px solid rgba(255,255,255,.25);
  width: 50px; height: 50px; border-radius: 50%; font-size: 1.8rem;
  cursor: pointer; display: flex; align-items: center; justify-content: center;
  transition: var(--ease); flex-shrink: 0; backdrop-filter: blur(4px);
}
.lb-nav:hover { background: rgba(255,255,255,.28); }

.lb-close {
  position: absolute; top: -14px; right: -14px;
  background: var(--rose); color: #fff; border: none;
  width: 38px; height: 38px; border-radius: 50%; font-size: 1.3rem;
  cursor: pointer; display: flex; align-items: center; justify-content: center;
  transition: var(--ease); z-index: 2;
}
.lb-close:hover { background: var(--rose-dark); }

.lb-footer {
  text-align: center; color: #fff;
}
.lb-footer h3 {
  font-family: Georgia, serif; font-size: 1.15rem; font-style: italic; margin-bottom: 4px;
}
.lb-footer p { font-size: .88rem; color: rgba(255,255,255,.7); margin-bottom: 10px; }
.lb-controls { display: flex; align-items: center; justify-content: center; gap: 16px; }
.lb-counter  { font-size: .82rem; color: rgba(255,255,255,.55); }

.lb-fs-btn {
  background: rgba(255,255,255,.12); color: #fff;
  border: 2px solid rgba(255,255,255,.25); border-radius: 8px;
  width: 36px; height: 36px; cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  transition: var(--ease); backdrop-filter: blur(4px);
}
.lb-fs-btn:hover { background: rgba(255,255,255,.28); border-color: rgba(255,255,255,.5); }

/* ── Fullscreen mode ─────────────────────────────────── */
.lightbox.is-fullscreen {
  background: #000;
}
.lightbox.is-fullscreen .lb-overlay {
  background: #000;
  backdrop-filter: none;
}

/* lb-box fills the entire screen */
.lightbox.is-fullscreen .lb-box {
  width: 100vw;
  height: 100vh;
  max-width: none;
  max-height: none;
  gap: 0;
  padding: 0;
  flex-direction: column;
  align-items: stretch;
}

/* Close button: top-right corner */
.lightbox.is-fullscreen .lb-close {
  position: absolute;
  top: 14px;
  right: 14px;
  z-index: 10;
  top: 14px;
  right: 14px;
}

/* Stage (prev | image | next) fills all space above the footer */
.lightbox.is-fullscreen .lb-stage {
  flex: 1;
  min-height: 0;
  width: 100%;
  max-width: none;
  gap: 0;
  align-items: stretch;
}

/* Nav buttons become full-height strips */
.lightbox.is-fullscreen .lb-nav {
  width: 56px;
  height: 100%;
  border-radius: 0;
  border: none;
  background: rgba(0,0,0,.18);
  flex-shrink: 0;
  font-size: 2.4rem;
}
.lightbox.is-fullscreen .lb-nav:hover {
  background: rgba(0,0,0,.45);
}

/* Image wrapper fills remaining width/height */
.lightbox.is-fullscreen .lb-img-wrap {
  flex: 1;
  min-width: 0;
  max-width: none;
  max-height: none;
  height: 100%;
  width: auto;
  padding: 6px;
}

/* Image fills available space, kept in proportion */
.lightbox.is-fullscreen .lb-img-wrap img {
  width: 100%;
  height: 100%;
  max-width: none;
  max-height: none;
  object-fit: contain;
  border-radius: 0;
  box-shadow: none;
}

/* Footer: compact strip at the bottom */
.lightbox.is-fullscreen .lb-footer {
  flex-shrink: 0;
  padding: 8px 16px 10px;
  background: linear-gradient(transparent, rgba(0,0,0,.8));
}
.lightbox.is-fullscreen .lb-footer h3 { font-size: 1rem; margin-bottom: 0; }
.lightbox.is-fullscreen .lb-footer p  { display: none; } /* hide description to save height */

/* Slideshow progress bar */
.lb-progress {
  width: 100%; height: 3px; background: rgba(255,255,255,.2);
  border-radius: 3px; overflow: hidden; margin-top: 6px;
}
.lb-progress-bar {
  height: 100%; background: var(--gold); width: 0%;
  transition: width linear;
}

/* ── Auth Forms ──────────────────────────────────────── */
.auth-page {
  min-height: 100vh; display: flex; flex-direction: column;
  align-items: center; justify-content: center; padding: 40px 20px;
  background: linear-gradient(135deg, #fdf8f2 0%, #f5e6eb 100%);
}
.auth-card {
  background: #fff; border-radius: var(--radius); padding: 44px;
  width: 100%; max-width: 420px; box-shadow: var(--shadow-lg);
}
.auth-logo {
  font-family: Georgia, serif; font-size: 1.5rem; font-style: italic;
  color: var(--rose); margin-bottom: 6px;
}
.auth-subtitle { color: var(--mid); font-size: .9rem; margin-bottom: 30px; }

.form-group { margin-bottom: 20px; }

label {
  display: block; font-size: .8rem; font-weight: 700;
  color: var(--mid); margin-bottom: 7px;
  text-transform: uppercase; letter-spacing: .6px;
}

input[type="email"],
input[type="password"],
input[type="text"],
input[type="number"],
textarea, select {
  width: 100%; padding: 12px 16px; border: 2px solid var(--border);
  border-radius: var(--radius-sm); font-size: 1rem; color: var(--dark);
  background: #fff; transition: var(--ease); outline: none; font-family: inherit;
}
input:focus, textarea:focus, select:focus {
  border-color: var(--rose);
  box-shadow: 0 0 0 4px rgba(139,111,122,.12);
}
textarea { resize: vertical; min-height: 80px; }

.otp-input {
  font-size: 2rem !important; letter-spacing: 12px; font-weight: 700;
  text-align: center; font-family: monospace !important;
}

.form-footer {
  text-align: center; margin-top: 16px; font-size: .88rem; color: var(--mid);
}
.form-footer a { color: var(--rose); font-weight: 600; }

/* ── Upload / Dashboard ──────────────────────────────── */
.dashboard-header {
  background: #fff; border-bottom: 1px solid var(--border);
  padding: 14px 0;
}
.page-title {
  font-family: Georgia, serif; font-size: 1.3rem; color: var(--rose);
  font-style: italic; margin-bottom: 4px;
}

.upload-section { padding: 32px 0; }

.upload-zone {
  border: 3px dashed var(--border); border-radius: var(--radius);
  padding: 48px 32px; text-align: center; cursor: pointer;
  transition: var(--ease); background: #fff; position: relative;
}
.upload-zone.drag-over {
  border-color: var(--rose); background: var(--rose-light);
}
.upload-zone:hover { border-color: var(--rose-dark); }
.upload-zone-icon { font-size: 3rem; margin-bottom: 12px; color: var(--border); }
.upload-zone p { color: var(--mid); font-size: .95rem; }
.upload-zone strong { color: var(--rose); }
.upload-zone input[type="file"] { display: none; }

.preview-box {
  display: none; margin-top: 16px;
  border-radius: var(--radius-sm); overflow: hidden;
  border: 2px solid var(--border); max-width: 320px; margin-left: auto; margin-right: auto;
}
.preview-box img { width: 100%; height: 220px; object-fit: cover; display: block; }

.upload-fields { margin-top: 20px; }

.manage-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 20px; margin-top: 20px;
}
.manage-item {
  background: #fff; border-radius: var(--radius);
  overflow: hidden; box-shadow: var(--shadow);
}
.manage-thumb { aspect-ratio: 1; overflow: hidden; }
.manage-thumb img { width: 100%; height: 100%; object-fit: cover; }
.manage-info { padding: 12px 14px; }
.manage-info h4 { font-size: .88rem; font-weight: 600; color: var(--dark); margin-bottom: 2px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.manage-info time { font-size: .75rem; color: var(--mid); display: block; margin-bottom: 10px; }

/* ── Setup Page ──────────────────────────────────────── */
.setup-badge {
  display: inline-block; background: var(--gold); color: #fff;
  font-size: .7rem; font-weight: 700; padding: 3px 10px; border-radius: 20px;
  text-transform: uppercase; letter-spacing: .5px; margin-bottom: 8px;
}
.setup-steps { display: flex; gap: 8px; margin-bottom: 32px; }
.setup-step {
  flex: 1; height: 4px; background: var(--border); border-radius: 4px;
}
.setup-step.done { background: var(--rose); }
.setup-step.active { background: var(--gold); }

/* ── Footer ──────────────────────────────────────────── */
.site-footer {
  background: #fff; border-top: 1px solid var(--border);
  text-align: center; padding: 20px;
  font-size: .8rem; color: #ccc;
  margin-top: auto;
}

/* ── Responsive ──────────────────────────────────────── */
@media (max-width: 600px) {
  .site-title { font-size: 1.3rem; }
  .gallery-grid { grid-template-columns: repeat(auto-fill, minmax(160px,1fr)); gap: 16px; }
  .auth-card { padding: 28px 20px; }
  .upload-zone { padding: 32px 16px; }
  .lb-img-wrap { max-width: 94vw; max-height: 60vh; }
  .lb-img-wrap img { max-height: 60vh; }
  .lb-nav { width: 38px; height: 38px; font-size: 1.4rem; }
  .manage-grid { grid-template-columns: repeat(auto-fill, minmax(150px,1fr)); }
}
