:root {
  --bg: #fdf8f4;
  --bg-alt: #ffffff;
  --ink: #2e2530;
  --ink-soft: #6b5f6d;
  --accent: #b5546f;
  --accent-soft: #f3dde3;
  --border: #ecdfe2;
  --radius: 14px;
  --shadow: 0 2px 10px rgba(60, 30, 40, 0.06);
}

* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  background: var(--bg);
  color: var(--ink);
  line-height: 1.6;
}

.wrap {
  max-width: 880px;
  margin: 0 auto;
  padding: 0 20px;
}

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

/* header */

.site-header {
  background: var(--bg-alt);
  border-bottom: 1px solid var(--border);
}
.site-header .wrap {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  padding-top: 18px;
  padding-bottom: 18px;
  gap: 12px;
}
.brand {
  font-weight: 700;
  font-size: 1.3rem;
  color: var(--ink);
}
.brand:hover { text-decoration: none; color: var(--accent); }
.site-header nav a {
  margin-left: 18px;
  color: var(--ink-soft);
  font-weight: 500;
}
.site-header nav a:first-child { margin-left: 0; }
.site-header nav a.active, .site-header nav a:hover {
  color: var(--accent);
  text-decoration: none;
}

main.wrap { padding: 40px 20px 80px; }

/* footer */
.site-footer {
  border-top: 1px solid var(--border);
  margin-top: 60px;
  padding: 24px 0;
  color: var(--ink-soft);
  font-size: 0.9rem;
}

/* hero */
.hero { margin-bottom: 50px; }
.hero h1 { font-size: 2.4rem; margin-bottom: 8px; }
.hero .tagline { color: var(--ink-soft); font-size: 1.15rem; margin: 0; }

/* sections */
.section { margin-bottom: 48px; }
.section-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  margin-bottom: 18px;
}
.section-head h2 { margin: 0; }
.empty { color: var(--ink-soft); font-style: italic; }

/* feed (fanfic updates) */
.feed { display: flex; flex-direction: column; gap: 22px; }
.feed-item {
  background: var(--bg-alt);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 18px 22px;
  box-shadow: var(--shadow);
}
.feed-item h2, .feed-item h3 { margin: 6px 0; }
.feed-item-meta {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  font-size: 0.85rem;
  color: var(--ink-soft);
}
.date { color: var(--ink-soft); }
.tag {
  background: var(--accent-soft);
  color: var(--accent);
  padding: 2px 10px;
  border-radius: 999px;
  font-weight: 600;
}
.status {
  padding: 2px 10px;
  border-radius: 999px;
  font-weight: 600;
  background: #eee;
}
.status-ongoing { background: #e4f2e6; color: #2f7a3d; }
.status-complete { background: #e4ecf7; color: #2f5b9a; }
.status-hiatus { background: #f7ecd8; color: #9a6a2f; }
.fandom { color: var(--ink-soft); margin: 2px 0 0; }

/* card grid (anime recs) */
.card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 20px;
}
.card {
  background: var(--bg-alt);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow);
  color: var(--ink);
  display: block;
}
.card:hover { text-decoration: none; box-shadow: 0 6px 18px rgba(60,30,40,0.12); }
.card-img { width: 100%; height: 260px; object-fit: cover; display: block; }
.card-body { padding: 14px 16px; }
.card-body h3 { margin: 0 0 6px; font-size: 1.05rem; }
.rating { font-weight: 700; color: var(--accent); }
.genres { color: var(--ink-soft); font-size: 0.85rem; margin: 6px 0 0; }

/* single post */
.post { max-width: 720px; }
.post h1 { margin-bottom: 6px; }
.post-body { margin-top: 24px; }
.post-body p { margin: 0 0 16px; }
.post-body h3, .post-body h4, .post-body h5 { margin-top: 28px; }
.post-body blockquote {
  margin: 0 0 16px;
  padding: 4px 18px;
  border-left: 3px solid var(--accent-soft);
  color: var(--ink-soft);
}
.post-cover { width: 100%; max-height: 380px; object-fit: cover; border-radius: var(--radius); margin-bottom: 18px; }

.btn, button, .link-btn {
  display: inline-block;
  background: var(--accent);
  color: #fff;
  padding: 10px 20px;
  border-radius: 999px;
  border: none;
  font-weight: 600;
  cursor: pointer;
  font-size: 0.95rem;
}
.btn:hover, button:hover { text-decoration: none; opacity: 0.9; }
.link-btn { background: none; color: var(--accent); padding: 0; font-weight: 500; }
.link-btn:hover { text-decoration: underline; }

/* admin */
.admin-header .wrap { padding-top: 14px; padding-bottom: 14px; }
.admin-header nav a { margin-left: 16px; font-size: 0.9rem; }

.flash {
  background: #e4f2e6;
  color: #2f7a3d;
  border: 1px solid #c3e3c9;
  border-radius: var(--radius);
  padding: 12px 18px;
  margin-bottom: 24px;
}
.error {
  background: #fbe4e4;
  color: #9a2f2f;
  border: 1px solid #f0c3c3;
  border-radius: var(--radius);
  padding: 12px 18px;
  margin-bottom: 18px;
}

.auth-box {
  max-width: 380px;
  margin: 40px auto;
  background: var(--bg-alt);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 28px;
  box-shadow: var(--shadow);
}
.auth-box h1 { font-size: 1.4rem; margin-top: 0; }

.content-form {
  max-width: 640px;
  background: var(--bg-alt);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 24px;
  box-shadow: var(--shadow);
}
.content-form label {
  display: block;
  margin-bottom: 18px;
  font-weight: 600;
}
.content-form .hint {
  font-weight: 400;
  color: var(--ink-soft);
  font-size: 0.82rem;
  display: block;
  margin-bottom: 4px;
}
.content-form input[type=text],
.content-form input[type=url],
.content-form input[type=date],
.content-form input[type=number],
.content-form input[type=password],
.content-form input[type=file],
.content-form select,
.content-form textarea,
.auth-box input {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: 8px;
  font-family: inherit;
  font-size: 1rem;
  margin-top: 6px;
  background: var(--bg);
  color: var(--ink);
}
.content-form textarea { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 0.92rem; }
.current-cover { display: block; margin-top: 10px; max-width: 160px; border-radius: 8px; }
.form-actions { display: flex; align-items: center; gap: 16px; margin-top: 8px; }

.admin-table { width: 100%; border-collapse: collapse; background: var(--bg-alt); border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; }
.admin-table td { padding: 12px 16px; border-bottom: 1px solid var(--border); vertical-align: top; }
.admin-table tr:last-child td { border-bottom: none; }
.admin-table .actions { display: flex; gap: 14px; align-items: center; white-space: nowrap; }
.admin-table form { margin: 0; display: inline; }

@media (max-width: 600px) {
  .site-header .wrap { flex-direction: column; align-items: flex-start; }
  .site-header nav a { margin-left: 0; margin-right: 16px; }
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #201a22;
    --bg-alt: #2a2230;
    --ink: #f0e8f0;
    --ink-soft: #b8a9b6;
    --accent: #e18aa4;
    --accent-soft: #3e2a34;
    --border: #3c3140;
    --shadow: 0 2px 10px rgba(0,0,0,0.3);
  }
}
