/* Mobile-first: mọi rule gốc nhắm màn hình nhỏ, media query (min-width) mới mở rộng cho PC. */

:root {
  --bg: #0b0b14;
  --bg-elevated: #15151f;
  --text: #ece9f1;
  --text-dim: #a9a4b8;
  --accent: #9b6bff;
  --accent-2: #ff6fa0;
  --border: #2a2a38;
}

* { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: 'Lora', Georgia, serif;
  font-size: 17px;
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
}

a { color: inherit; }

h1, h2 {
  font-family: 'Playfair Display', Georgia, serif;
  font-weight: 700;
  line-height: 1.25;
}

#reading-progress {
  position: fixed;
  top: 0; left: 0;
  height: 3px; width: 0;
  background: linear-gradient(90deg, var(--accent), var(--accent-2));
  z-index: 100;
  transition: width 0.1s;
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  padding: 14px 20px;
  background: rgba(11, 11, 20, 0.9);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--border);
}
.brand {
  font-family: 'Playfair Display', Georgia, serif;
  font-weight: 700;
  font-size: 1.15rem;
  text-decoration: none;
  letter-spacing: 0.01em;
}

main {
  max-width: 720px;
  margin: 0 auto;
  padding: 20px 20px 48px;
}

.hero {
  padding: 28px 0 24px;
  text-align: center;
  border-bottom: 1px solid var(--border);
  margin-bottom: 28px;
}
.hero h1 {
  font-size: 1.8rem;
  margin: 0 0 10px;
  background: linear-gradient(90deg, var(--accent), var(--accent-2));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
.hero .tagline {
  color: var(--text-dim);
  font-size: 0.95rem;
  max-width: 520px;
  margin: 0 auto;
}

.story-list { list-style: none; padding: 0; margin: 0; }
.story-list li { margin-bottom: 16px; }
.empty-state { color: var(--text-dim); text-align: center; padding: 40px 0; }

.story-card {
  display: flex;
  flex-direction: column;
  text-decoration: none;
  color: inherit;
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: 14px;
  overflow: hidden;
  transition: border-color 0.15s, transform 0.15s;
}
.story-card:active { transform: scale(0.98); }
.story-cover {
  width: 100%;
  aspect-ratio: 1200 / 630;
  object-fit: cover;
  display: block;
}
.story-card-body { padding: 14px 16px 16px; }
.story-card-body strong {
  display: block;
  font-family: 'Playfair Display', Georgia, serif;
  font-size: 1.05rem;
  margin-bottom: 6px;
}
.story-card-body p { margin: 0; color: var(--text-dim); font-size: 0.92rem; line-height: 1.5; }

article h1 { font-size: 1.6rem; margin: 18px 0 4px; }
.chapter-cover {
  width: 100%;
  aspect-ratio: 1200 / 630;
  object-fit: cover;
  border-radius: 14px;
  margin-bottom: 4px;
}
.chapter-progress {
  color: var(--accent);
  font-size: 0.82rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  margin: 0 0 20px;
}

.chapter-body p {
  margin: 0 0 1.1em;
  font-size: 1.05rem;
}

.ad-slot {
  min-height: 90px;
  margin: 24px 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--bg-elevated);
  border: 1px dashed var(--border);
  border-radius: 10px;
  color: var(--text-dim);
  font-size: 0.78rem;
}
.ad-slot::before { content: "Ad slot"; }

.next-teaser {
  font-style: italic;
  color: var(--text-dim);
  border-left: 3px solid var(--accent);
  padding: 2px 0 2px 14px;
  margin: 28px 0;
}

.chapter-nav {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin: 28px 0 8px;
}
.chapter-nav a {
  text-decoration: none;
  padding: 14px 18px;
  border-radius: 10px;
  text-align: center;
  font-weight: 600;
}
.chapter-nav a:not(.next-chapter) {
  border: 1px solid var(--border);
  color: var(--text-dim);
}
.next-chapter {
  background: linear-gradient(90deg, var(--accent), var(--accent-2));
  color: #fff;
  order: -1;
}
.chapter-nav span {
  text-align: center;
  color: var(--text-dim);
  font-style: italic;
  padding: 8px 0;
}

.related-stories {
  margin-top: 48px;
  padding-top: 28px;
  border-top: 1px solid var(--border);
}
.related-stories h2 { font-size: 1.15rem; margin-bottom: 16px; }

.legal-body { color: var(--text-dim); line-height: 1.7; }
.legal-body p { margin: 0 0 1em; }
.legal-body a { color: var(--accent); }

.site-footer {
  margin-top: 48px;
  padding: 20px;
  border-top: 1px solid var(--border);
  font-size: 0.82rem;
  color: var(--text-dim);
  text-align: center;
}
.site-footer a { color: var(--text-dim); text-decoration: underline; }

/* ---- Tablet & up ---- */
@media (min-width: 640px) {
  main { padding: 32px 24px 64px; }
  .hero h1 { font-size: 2.3rem; }
  article h1 { font-size: 2rem; }
  .story-card { flex-direction: row; }
  .story-cover { width: 220px; aspect-ratio: 1200 / 630; flex-shrink: 0; }
  .story-card-body { padding: 16px 20px; align-self: center; }
  .chapter-nav { flex-direction: row; justify-content: space-between; }
  .chapter-nav a { flex: 0 0 auto; }
  .next-chapter { order: 0; }
}

/* ---- Desktop ---- */
@media (min-width: 1024px) {
  main { max-width: 760px; }
  .chapter-body p { font-size: 1.1rem; }
}
