@import url('https://fonts.googleapis.com/css2?family=Great+Vibes&family=Cormorant+Garamond:ital,wght@0,400;0,600;1,400&display=swap');

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --gold:        #C8A96E;
  --gold-dark:   #9E7D3F;
  --gold-light:  #EDD9A3;
  --purple:      #9876C8;
  --purple-dark: #6A4FA0;
  --cream:       #FDF6EC;
  --parchment:   #F5EAD5;
  --dark:        #4A3828;
  --mid:         #8B7355;
  --light:       #F0E2C8;
  --radius:      12px;
  --gap:         16px;
}

html { font-size: 16px; }
body {
  font-family: 'Cormorant Garamond', Georgia, serif;
  background: var(--cream);
  background-image:
    radial-gradient(ellipse at top left, rgba(200,169,110,0.08) 0%, transparent 60%),
    radial-gradient(ellipse at bottom right, rgba(152,118,200,0.08) 0%, transparent 60%);
  color: var(--dark);
  min-height: 100vh;
}

/* ── Layout ── */
.page      { max-width: 480px; margin: 0 auto; padding: 24px var(--gap) 48px; }
.page-wide { max-width: 960px; margin: 0 auto; padding: 24px var(--gap) 48px; }

/* ── Gold divider line ── */
.page::before {
  content: '';
  display: block;
  height: 2px;
  background: linear-gradient(to right, transparent, var(--gold), transparent);
  margin-bottom: 32px;
}

/* ── Header ── */
.site-header { text-align: center; margin-bottom: 32px; }
.site-header h1 {
  font-family: 'Great Vibes', cursive;
  font-size: 2.8rem;
  font-weight: 400;
  background: linear-gradient(135deg, var(--purple) 0%, var(--gold-dark) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  line-height: 1.2;
}
.site-header p {
  font-family: 'Cormorant Garamond', serif;
  font-style: italic;
  color: var(--mid);
  margin-top: 8px;
  font-size: 1rem;
}

/* ── Upload area ── */
.upload-area {
  border: 2px dashed var(--gold-light);
  border-radius: var(--radius);
  padding: 32px var(--gap);
  text-align: center;
  background: var(--parchment);
  cursor: pointer;
  transition: border-color 0.2s, background 0.2s;
  display: block;
}
.upload-area:hover, .upload-area.drag-over {
  border-color: var(--gold);
  background: #EFE3C8;
}
.upload-area svg { color: var(--gold); margin-bottom: 12px; }
.upload-area p { color: var(--mid); font-size: 1rem; font-style: italic; }
.upload-area strong { color: var(--gold-dark); font-style: normal; }
#file-input { display: none; }

/* ── Buttons ── */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 44px;
  min-width: 44px;
  padding: 10px 24px;
  border: none;
  border-radius: var(--radius);
  font-family: 'Cormorant Garamond', serif;
  font-size: 1.05rem;
  font-weight: 600;
  letter-spacing: 0.03em;
  cursor: pointer;
  transition: opacity 0.2s, transform 0.1s;
  text-decoration: none;
}
.btn:active { transform: scale(0.97); }
.btn-primary {
  background: linear-gradient(135deg, var(--purple-dark), var(--gold-dark));
  color: white;
}
.btn-primary:hover { opacity: 0.9; }
.btn-secondary {
  background: var(--parchment);
  color: var(--gold-dark);
  border: 1.5px solid var(--gold);
}
.btn-sm { padding: 6px 14px; font-size: 0.95rem; min-height: 36px; }
.btn:disabled { opacity: 0.5; cursor: not-allowed; }
.btn-full { width: 100%; }

/* ── Upload queue ── */
.upload-queue { margin-top: 24px; display: flex; flex-direction: column; gap: 12px; }
.upload-item {
  background: white;
  border: 1px solid var(--gold-light);
  border-radius: var(--radius);
  padding: 12px 14px;
}
.upload-item-name { font-size: 0.95rem; font-weight: 600; margin-bottom: 6px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.progress-bar-track { height: 5px; background: var(--light); border-radius: 3px; overflow: hidden; }
.progress-bar-fill { height: 100%; background: linear-gradient(to right, var(--purple), var(--gold)); border-radius: 3px; transition: width 0.2s; width: 0; }
.upload-item-status { font-size: 0.85rem; margin-top: 4px; font-style: italic; }
.status-uploading { color: var(--mid); }
.status-done { color: #4a7a5a; }
.status-error { color: #c04040; }

/* ── Photo grid ── */
.section-title {
  font-family: 'Great Vibes', cursive;
  font-size: 1.6rem;
  font-weight: 400;
  color: var(--gold-dark);
  margin: 32px 0 16px;
  text-align: center;
}
.photo-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 10px; }
.photo-card {
  position: relative;
  aspect-ratio: 1;
  border-radius: 8px;
  overflow: hidden;
  background: var(--light);
  box-shadow: 0 1px 6px rgba(74,56,40,0.10);
}
.photo-card img { width: 100%; height: 100%; object-fit: cover; display: block; }
.photo-card .download-btn {
  position: absolute;
  bottom: 6px; right: 6px;
  background: rgba(255,255,255,0.92);
  border: 1px solid var(--gold-light);
  border-radius: 6px;
  padding: 4px 8px;
  font-size: 0.8rem;
  cursor: pointer;
  font-weight: 600;
  color: var(--gold-dark);
  min-height: 28px;
  min-width: 44px;
  text-align: center;
  text-decoration: none;
  display: flex;
  align-items: center;
  justify-content: center;
}
.photo-card .download-btn:hover { background: white; }

/* ── Auth form ── */
.auth-form {
  background: white;
  border: 1px solid var(--gold-light);
  border-radius: var(--radius);
  padding: 32px 24px;
  box-shadow: 0 2px 20px rgba(74,56,40,0.08);
}
.auth-form h2 {
  font-family: 'Great Vibes', cursive;
  font-size: 1.8rem;
  font-weight: 400;
  color: var(--gold-dark);
  margin-bottom: 20px;
}
.form-group { margin-bottom: 16px; }
.form-group label {
  display: block;
  font-size: 0.9rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  margin-bottom: 6px;
  color: var(--mid);
}
.form-group input {
  width: 100%;
  padding: 10px 14px;
  border: 1.5px solid var(--gold-light);
  border-radius: 8px;
  font-family: 'Cormorant Garamond', serif;
  font-size: 1rem;
  background: var(--cream);
  outline: none;
  transition: border-color 0.2s;
  color: var(--dark);
}
.form-group input:focus { border-color: var(--gold); }
.auth-error { color: #c04040; font-size: 0.9rem; font-style: italic; margin-top: 8px; display: none; }

/* ── Gallery header ── */
.gallery-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 24px;
  flex-wrap: wrap;
  gap: 12px;
  padding-bottom: 16px;
  border-bottom: 1px solid var(--gold-light);
}
.gallery-count { color: var(--mid); font-size: 0.95rem; font-style: italic; }

/* ── Pagination ── */
.pagination { display: flex; justify-content: center; gap: 8px; margin-top: 32px; }

/* ── Notices ── */
.notice {
  background: var(--parchment);
  border: 1.5px solid var(--gold-light);
  border-radius: var(--radius);
  padding: 24px;
  text-align: center;
  position: relative;
}
.notice::before, .notice::after {
  content: '❧';
  color: var(--gold);
  font-size: 1.2rem;
  display: block;
  margin-bottom: 8px;
}
.notice::after { margin-top: 8px; margin-bottom: 0; transform: scaleX(-1); display: block; }
.notice-title {
  font-family: 'Great Vibes', cursive;
  font-size: 1.6rem;
  font-weight: 400;
  color: var(--gold-dark);
  margin-bottom: 8px;
}
.notice p { font-style: italic; color: var(--mid); line-height: 1.6; }

/* ── Loading ── */
.loading { text-align: center; padding: 40px 0; color: var(--mid); font-style: italic; }
.spinner {
  display: inline-block;
  width: 32px; height: 32px;
  border: 2px solid var(--gold-light);
  border-top-color: var(--gold);
  border-radius: 50%;
  animation: spin 0.9s linear infinite;
  margin-bottom: 12px;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ── Responsive ── */
@media (max-width: 480px) {
  .photo-grid { grid-template-columns: repeat(auto-fill, minmax(100px, 1fr)); }
  .site-header h1 { font-size: 2.2rem; }
}
