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

:root {
  --bg-deep: #17121d;
  --bg-card: #231c2c;
  --bg-card-line: #362b42;
  --gold: #c9a24b;
  --rose: #b56780;
  --parchment: #f1e7d8;
  --muted: #a596ab;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  background: var(--bg-deep);
  color: var(--parchment);
  font-family: 'Work Sans', sans-serif;
  font-weight: 400;
  line-height: 1.55;
}

a { color: inherit; }

::selection { background: var(--rose); color: var(--bg-deep); }

@media (prefers-reduced-motion: reduce) {
  * { animation: none !important; transition: none !important; }
}

/* ---------- shared bits ---------- */

.field {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
  margin-bottom: 1.2rem;
}

.field label {
  font-size: 0.85rem;
  color: var(--muted);
}

.field input,
.field textarea {
  background: var(--bg-deep);
  border: 1px solid var(--bg-card-line);
  color: var(--parchment);
  padding: 0.65rem 0.8rem;
  border-radius: 3px;
  font-family: 'Work Sans', sans-serif;
  font-size: 0.95rem;
}

.field input:focus,
.field textarea:focus {
  outline: 2px solid var(--gold);
  outline-offset: 1px;
  border-color: var(--gold);
}

.field textarea { resize: vertical; min-height: 5rem; }

.btn {
  display: inline-block;
  background: var(--gold);
  color: #241a0e;
  border: none;
  padding: 0.7rem 1.4rem;
  font-family: 'Work Sans', sans-serif;
  font-weight: 500;
  font-size: 0.95rem;
  border-radius: 3px;
  cursor: pointer;
  transition: transform 0.15s ease, background 0.15s ease;
}

.btn:hover { background: #d9b25f; transform: translateY(-1px); }

.btn-ghost {
  background: transparent;
  color: var(--muted);
  border: 1px solid var(--bg-card-line);
}

.btn-ghost:hover { color: var(--parchment); border-color: var(--gold); background: transparent; }

.error-note {
  border: 1px solid var(--rose);
  color: #f0c9d2;
  background: rgba(181, 103, 128, 0.12);
  padding: 0.7rem 1rem;
  border-radius: 3px;
  font-size: 0.9rem;
  margin-bottom: 1.2rem;
}

/* ---------- login page ---------- */

.auth-shell {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 2rem 1.2rem;
}

.auth-card {
  width: 100%;
  max-width: 360px;
}

.auth-card h1 {
  font-family: 'Cormorant Garamond', serif;
  font-weight: 500;
  font-size: 2rem;
  margin: 0 0 0.3rem;
}

.auth-card p.sub {
  color: var(--muted);
  font-size: 0.9rem;
  margin: 0 0 2rem;
}

.auth-card form { margin-top: 0; }

.auth-card .btn { width: 100%; text-align: center; }

/* ---------- admin page ---------- */

.admin-shell {
  max-width: 760px;
  margin: 0 auto;
  padding: 3rem 1.4rem 5rem;
}

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

.admin-header h1 {
  font-family: 'Cormorant Garamond', serif;
  font-weight: 500;
  font-size: 2.1rem;
  margin: 0;
}

.admin-shell > p.sub {
  color: var(--muted);
  font-size: 0.9rem;
  margin: 0 0 2.4rem;
}

.logout-form { margin: 0; }
.logout-form button {
  background: none;
  border: none;
  color: var(--muted);
  font-size: 0.85rem;
  cursor: pointer;
  text-decoration: underline;
  padding: 0;
}
.logout-form button:hover { color: var(--parchment); }

.panel {
  background: var(--bg-card);
  border: 1px solid var(--bg-card-line);
  border-radius: 4px;
  padding: 1.6rem;
  margin-bottom: 2.6rem;
}

.panel h2 {
  font-family: 'Cormorant Garamond', serif;
  font-weight: 500;
  font-size: 1.4rem;
  margin: 0 0 1.2rem;
}

.field-row { display: flex; gap: 1rem; }
.field-row .field { flex: 1; }

.public-link {
  display: inline-block;
  margin-top: 0.4rem;
  font-size: 0.85rem;
  color: var(--gold);
}

.entries h2 {
  font-family: 'Cormorant Garamond', serif;
  font-weight: 500;
  font-size: 1.3rem;
  color: var(--muted);
  margin-bottom: 1rem;
}

.entry-row {
  display: flex;
  gap: 1rem;
  align-items: center;
  padding: 0.8rem 0;
  border-bottom: 1px solid var(--bg-card-line);
}

.entry-row img {
  width: 56px;
  height: 56px;
  object-fit: cover;
  border-radius: 3px;
  flex-shrink: 0;
}

.entry-row .entry-meta { flex: 1; min-width: 0; }
.entry-row .entry-meta .year {
  font-family: 'Cormorant Garamond', serif;
  color: var(--gold);
  font-size: 1.1rem;
  margin-right: 0.5rem;
}
.entry-row .entry-meta .title { font-weight: 500; }
.entry-row .entry-meta .desc {
  color: var(--muted);
  font-size: 0.85rem;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.entry-row form { margin: 0; }
.entry-row .delete-btn {
  background: none;
  border: 1px solid var(--bg-card-line);
  color: var(--muted);
  font-size: 0.8rem;
  padding: 0.4rem 0.7rem;
  border-radius: 3px;
  cursor: pointer;
}
.entry-row .delete-btn:hover { color: var(--rose); border-color: var(--rose); }

.empty-note { color: var(--muted); font-size: 0.9rem; }

/* ---------- public timeline ---------- */

.timeline-shell {
  max-width: 720px;
  margin: 0 auto;
  padding: 4.5rem 1.4rem 6rem;
}

.timeline-hero {
  text-align: center;
  margin-bottom: 4.5rem;
}

.timeline-hero h1 {
  font-family: 'Cormorant Garamond', serif;
  font-style: italic;
  font-weight: 500;
  font-size: 2.6rem;
  margin: 0 0 0.6rem;
}

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

.spine {
  position: relative;
  padding-left: 2.2rem;
  border-left: 1px solid var(--bg-card-line);
}

.moment {
  position: relative;
  margin-bottom: 3.4rem;
}

.moment:last-child { margin-bottom: 0; }

.moment::before {
  content: '';
  position: absolute;
  left: -2.42rem;
  top: 0.35rem;
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: var(--gold);
}

.moment .year {
  font-family: 'Cormorant Garamond', serif;
  font-size: 1.6rem;
  color: var(--gold);
  display: block;
  margin-bottom: 0.5rem;
}

.moment img {
  width: 100%;
  border-radius: 4px;
  display: block;
  margin-bottom: 0.9rem;
}

.moment h2 {
  font-family: 'Cormorant Garamond', serif;
  font-weight: 500;
  font-size: 1.5rem;
  margin: 0 0 0.4rem;
}

.moment p {
  margin: 0;
  color: var(--muted);
  font-size: 0.95rem;
  max-width: 62ch;
}

.timeline-empty {
  text-align: center;
  color: var(--muted);
  padding: 3rem 1rem;
}

@media (max-width: 560px) {
  .field-row { flex-direction: column; gap: 0; }
  .timeline-hero h1 { font-size: 2.1rem; }
}
