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

:root {
  --cream:     #faf7f2;
  --paper:     #f4ede0;
  --warm:      #e8dcc8;
  --ink:       #27190e;
  --ink-mid:   #5c4a36;
  --ink-soft:  #9a876e;
  --border:    #ddd0bc;
  --rose:      #b8685c;
  --rose-pale: #e8a598;
  --blue:      #5a7ea0;
  --white:     #ffffff;
  --card:      #fffdf9;
  --ok:        #5a8a68;
  --bad:       #a85050;
  --shadow:    0 2px 16px rgba(39,25,14,0.08);
  --radius:    14px;
}

body {
  font-family: 'Lato', sans-serif;
  background: var(--cream);
  color: var(--ink);
  line-height: 1.65;
  min-height: 100vh;
}
a { color: inherit; text-decoration: none; }
img { max-width: 100%; display: block; }

/* ── Navbar ─────────────────────────────────────────── */
.navbar {
  position: sticky; top: 0; z-index: 200;
  background: rgba(250,247,242,0.93);
  backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--border);
  height: 58px;
  display: flex; align-items: center; justify-content: space-between;
  padding: 0 2rem;
}
.nav-brand { display: flex; align-items: center; gap: 8px; }
.brand-heart { color: var(--rose); font-size: 1.2rem; }
.brand-name {
  font-family: 'Playfair Display', serif;
  font-size: 1.25rem; font-weight: 700; letter-spacing: 0.01em;
}
.nav-links { display: flex; align-items: center; gap: 1.4rem; }
.nav-link { font-size: 0.875rem; color: var(--ink-mid); transition: color 0.2s; }
.nav-link:hover { color: var(--ink); }
.nav-cta {
  background: var(--ink); color: var(--cream);
  padding: 6px 18px; border-radius: 20px; font-weight: 700;
  transition: background 0.2s;
}
.nav-cta:hover { background: var(--rose); }
.nav-out { color: var(--ink-soft); }

.site-main { min-height: calc(100vh - 58px); }

/* ── Alerts ─────────────────────────────────────────── */
.alert {
  padding: 12px 18px; border-radius: 10px;
  margin-bottom: 1.5rem; font-size: 0.9rem;
}
.alert-error  { background: #fdf0f0; border: 1px solid #f0cece; color: #7a2828; }
.alert-success{ background: #f0fdf5; border: 1px solid #b8dfc8; color: #1f5a38; }

/* ── Buttons ─────────────────────────────────────────── */
.btn-primary {
  display: inline-block; cursor: pointer;
  background: var(--ink); color: var(--cream);
  border: none; border-radius: 24px;
  padding: 12px 30px; font-family: 'Lato', sans-serif;
  font-size: 0.9rem; font-weight: 700; letter-spacing: 0.03em;
  transition: background 0.2s, transform 0.15s;
}
.btn-primary:hover { background: var(--rose); transform: translateY(-1px); }
.btn-primary.small { padding: 8px 22px; font-size: 0.85rem; }
.btn-primary.full  { width: 100%; text-align: center; }

.btn-ghost {
  display: inline-block; cursor: pointer;
  background: transparent; color: var(--ink-mid);
  border: 1px solid var(--border); border-radius: 24px;
  padding: 11px 26px; font-family: 'Lato', sans-serif; font-size: 0.9rem;
  transition: border-color 0.2s, color 0.2s;
}
.btn-ghost:hover { border-color: var(--ink-mid); color: var(--ink); }

.btn-danger {
  display: inline-block; cursor: pointer;
  background: transparent; color: var(--bad);
  border: 1px solid var(--bad); border-radius: 20px;
  padding: 8px 20px; font-family: 'Lato', sans-serif; font-size: 0.85rem;
  transition: all 0.2s;
}
.btn-danger:hover { background: var(--bad); color: #fff; }

/* ── Forms ───────────────────────────────────────────── */
.field { display: flex; flex-direction: column; gap: 6px; margin-bottom: 1.25rem; }
.field label {
  font-size: 0.75rem; font-weight: 700; text-transform: uppercase;
  letter-spacing: 0.07em; color: var(--ink-mid);
}
.field input[type="text"],
.field input[type="password"],
.field textarea {
  width: 100%; background: var(--white);
  border: 1px solid var(--border); border-radius: 10px;
  padding: 12px 16px; color: var(--ink);
  font-family: 'Lato', sans-serif; font-size: 0.95rem;
  transition: border-color 0.2s, box-shadow 0.2s; resize: vertical;
}
.field input:focus,
.field textarea:focus {
  outline: none; border-color: var(--rose-pale);
  box-shadow: 0 0 0 3px rgba(184,104,92,0.12);
}
.optional { font-weight: 400; text-transform: none; letter-spacing: 0; color: var(--ink-soft); }

/* ── LOGIN ───────────────────────────────────────────── */
.login-body { overflow: hidden; }
.login-wrap { display: grid; grid-template-columns: 1fr 1fr; min-height: 100vh; }

.login-side-art {
  position: relative; overflow: hidden;
  background: linear-gradient(150deg, #1e1208 0%, #3d2510 50%, #5c3820 100%);
  display: flex; align-items: center; justify-content: center;
}
.art-bg {
  position: absolute; inset: 0;
  background-image:
    radial-gradient(circle at 20% 80%, rgba(184,104,92,0.18) 0%, transparent 50%),
    radial-gradient(circle at 80% 20%, rgba(90,126,160,0.12) 0%, transparent 50%),
    repeating-linear-gradient(45deg, transparent, transparent 60px, rgba(255,255,255,0.015) 60px, rgba(255,255,255,0.015) 61px);
}
.art-content { position: relative; text-align: center; padding: 3rem; }
.art-quote {
  font-family: 'Playfair Display', serif;
  font-style: italic; font-size: 1.45rem; line-height: 1.7;
  color: rgba(250,247,242,0.9); max-width: 340px;
}

.login-side-form {
  background: var(--cream);
  display: flex; align-items: center; justify-content: center; padding: 3rem;
}
.login-box { width: 100%; max-width: 380px; }
.login-logo { text-align: center; margin-bottom: 2.5rem; }
.logo-heart { font-size: 2.2rem; display: block; margin-bottom: 0.4rem; }
.login-logo h1 {
  font-family: 'Playfair Display', serif;
  font-size: 2.2rem; font-weight: 700; margin-bottom: 0.3rem;
}
.login-logo p { color: var(--ink-soft); font-size: 0.9rem; }
.login-hint {
  margin-top: 2rem; text-align: center;
  font-size: 0.78rem; color: var(--ink-soft); line-height: 1.8;
}

/* ── FEED ────────────────────────────────────────────── */
.feed-page { max-width: 920px; margin: 0 auto; padding: 3rem 1.5rem; }
.feed-hero { text-align: center; margin-bottom: 3rem; }
.feed-title {
  font-family: 'Playfair Display', serif;
  font-size: 3rem; font-weight: 700; letter-spacing: -0.02em; margin-bottom: 0.3rem;
}
.feed-sub { color: var(--ink-soft); font-size: 0.9rem; }

.empty-state {
  text-align: center; padding: 4rem;
  border: 2px dashed var(--border); border-radius: var(--radius);
}
.empty-icon { font-size: 2rem; color: var(--rose-pale); margin-bottom: 1rem; }
.empty-state a { color: var(--rose); text-decoration: underline; }

.posts-grid { display: grid; gap: 1.5rem; }

.post-card {
  background: var(--card); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 1.75rem;
  display: flex; flex-direction: column; gap: 1rem;
  transition: transform 0.2s, box-shadow 0.2s;
}
.post-card:hover { transform: translateY(-2px); box-shadow: var(--shadow); }

.card-top { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.author-chip {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 4px 12px; border-radius: 20px; border: 1px solid;
  font-size: 0.8rem; font-weight: 700;
}
.author-dot { width: 8px; height: 8px; border-radius: 50%; flex-shrink: 0; }
.mood-chip { font-size: 1.1rem; background: var(--paper); padding: 3px 10px; border-radius: 12px; }
.mood-chip.large { font-size: 1.35rem; }

.card-link { display: block; }
.card-title {
  font-family: 'Playfair Display', serif;
  font-size: 1.5rem; font-weight: 700; margin-bottom: 0.5rem;
  transition: color 0.2s;
}
.post-card:hover .card-title { color: var(--rose); }
.card-excerpt { color: var(--ink-mid); font-size: 0.9rem; line-height: 1.7; }

.card-thumbs { display: flex; gap: 8px; flex-wrap: wrap; }
.thumb { width: 80px; height: 80px; object-fit: cover; border-radius: 10px; }
.thumb-more {
  width: 80px; height: 80px; border-radius: 10px;
  background: var(--paper); display: flex; align-items: center; justify-content: center;
  font-size: 0.85rem; color: var(--ink-mid); font-weight: 700;
}

.card-footer {
  display: flex; justify-content: space-between; align-items: center;
  font-size: 0.8rem; color: var(--ink-soft);
  padding-top: 0.75rem; border-top: 1px solid var(--border);
}
.card-meta-r { display: flex; gap: 10px; align-items: center; }

/* ── WRITE ───────────────────────────────────────────── */
.write-page { max-width: 700px; margin: 0 auto; padding: 3rem 1.5rem; }
.write-header { margin-bottom: 2.5rem; }
.write-header h1 { font-family: 'Playfair Display', serif; font-size: 2.2rem; font-weight: 700; }
.write-header p { color: var(--ink-soft); margin-top: 0.2rem; }

.mood-row { display: flex; flex-wrap: wrap; gap: 8px; }
.mood-opt { cursor: pointer; }
.mood-opt input { display: none; }
.mood-em {
  display: block; font-size: 1.6rem; padding: 6px;
  border-radius: 8px; border: 2px solid transparent;
  transition: all 0.15s;
}
.mood-em:hover { background: var(--paper); }
.mood-opt input:checked + .mood-em { border-color: var(--rose); background: var(--paper); }

.drop-zone {
  border: 2px dashed var(--border); border-radius: 12px;
  padding: 2rem; cursor: pointer; transition: border-color 0.2s;
  position: relative;
}
.drop-zone:hover, .drop-zone.over { border-color: var(--rose-pale); }
.file-hidden { position: absolute; inset: 0; opacity: 0; cursor: pointer; width: 100%; height: 100%; }
.drop-inner { text-align: center; pointer-events: none; }
.drop-icon { font-size: 2rem; display: block; margin-bottom: 0.5rem; }
.drop-inner p { color: var(--ink-mid); font-size: 0.9rem; }
.drop-hint { font-size: 0.8rem; color: var(--ink-soft); margin-top: 0.25rem; }
.photo-previews { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 1rem; pointer-events: none; }
.photo-previews img { width: 80px; height: 80px; object-fit: cover; border-radius: 8px; }

.form-actions { display: flex; gap: 1rem; justify-content: flex-end; margin-top: 2rem; }

/* ── POST PAGE ───────────────────────────────────────── */
.post-page { max-width: 780px; margin: 0 auto; padding: 3rem 1.5rem 5rem; }

.post-hero { margin-bottom: 2.5rem; }
.post-meta-bar { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-bottom: 1rem; }
.post-date { font-size: 0.8rem; color: var(--ink-soft); }
.post-title {
  font-family: 'Playfair Display', serif;
  font-size: 2.8rem; font-weight: 700; line-height: 1.15; letter-spacing: -0.02em;
}

.post-gallery {
  display: grid; gap: 8px; margin-bottom: 2.5rem;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
}
.gallery-img {
  width: 100%; height: 220px; object-fit: cover; border-radius: 10px;
  cursor: zoom-in; transition: transform 0.2s;
}
.gallery-img:hover { transform: scale(1.02); }

.post-body {
  font-family: 'Playfair Display', serif; font-size: 1.2rem;
  line-height: 1.9; color: var(--ink-mid); margin-bottom: 2.5rem;
}

.section { padding: 1.5rem 0; border-top: 1px solid var(--border); }
.section-label {
  font-size: 0.73rem; font-weight: 700; text-transform: uppercase;
  letter-spacing: 0.1em; color: var(--ink-soft); margin-bottom: 1rem;
}

.reaction-form { display: flex; gap: 8px; flex-wrap: wrap; }
.react-btn {
  background: var(--paper); border: 2px solid transparent; border-radius: 24px;
  padding: 6px 14px; cursor: pointer; font-size: 1rem;
  display: inline-flex; align-items: center; gap: 5px;
  font-family: 'Lato', sans-serif; transition: all 0.15s;
}
.react-btn:hover { background: var(--warm); }
.react-btn.active { border-color: var(--rose); background: #fff0ee; }
.react-cnt { font-size: 0.75rem; color: var(--ink-mid); }

.comment-list { display: flex; flex-direction: column; gap: 1rem; margin-bottom: 1.5rem; }
.comment {}
.comment-header {
  display: inline-flex; align-items: center; gap: 10px;
  padding: 4px 12px; border-radius: 16px; margin-bottom: 6px;
}
.comment-date { font-size: 0.75rem; color: var(--ink-soft); }
.comment-body { font-size: 0.95rem; color: var(--ink-mid); padding-left: 4px; line-height: 1.65; }

.comment-form textarea {
  width: 100%; border: 1px solid var(--border); border-radius: 10px;
  padding: 12px 16px; font-family: 'Lato', sans-serif; font-size: 0.9rem;
  color: var(--ink); resize: vertical; background: var(--white);
  transition: border-color 0.2s; margin-bottom: 10px;
}
.comment-form textarea:focus { outline: none; border-color: var(--rose-pale); }
.cf-footer { display: flex; justify-content: flex-end; }

.danger-zone { padding-top: 2rem; border-top: 1px solid var(--border); margin-top: 0.5rem; }

/* Lightbox */
.lightbox {
  display: none; position: fixed; inset: 0; z-index: 999;
  background: rgba(0,0,0,0.92);
  align-items: center; justify-content: center; cursor: zoom-out;
}
.lightbox.open { display: flex; }
.lightbox img { max-width: 92vw; max-height: 92vh; border-radius: 8px; object-fit: contain; }

/* ── SETTINGS ────────────────────────────────────────── */
.settings-page { max-width: 580px; margin: 0 auto; padding: 3rem 1.5rem; }
.settings-header { margin-bottom: 2.5rem; }
.settings-header h1 { font-family: 'Playfair Display', serif; font-size: 2.2rem; font-weight: 700; }
.settings-header p { color: var(--ink-soft); }

.settings-card {
  background: var(--card); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 1.75rem; margin-bottom: 1.5rem;
}
.settings-card h2 { font-family: 'Playfair Display', serif; font-size: 1.3rem; margin-bottom: 1.25rem; }
.settings-info p { margin-bottom: 0.5rem; font-size: 0.9rem; color: var(--ink-mid); }

.color-row { display: flex; align-items: center; gap: 14px; }
.color-preview {
  width: 46px; height: 46px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  color: #fff; font-weight: 700; font-size: 1.1rem;
}

/* ── Responsive ──────────────────────────────────────── */
@media (max-width: 680px) {
  .login-wrap { grid-template-columns: 1fr; }
  .login-side-art { display: none; }
  .feed-title, .post-title { font-size: 2rem; }
  .navbar { padding: 0 1rem; }
  .nav-links { gap: 0.9rem; }
}
