/* ═══════════════════════════════════════════════════════════
   JiwaBizId — Design System
   Mobile-first | Dark/Light mode auto (system preference)
   ═══════════════════════════════════════════════════════════ */

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700;800;900&family=Merriweather:ital,wght@0,400;0,700;1,400&family=JetBrains+Mono:wght@400;500&display=swap');

/* ── CSS Tokens — Light Mode (default) ───────────────────── */
:root {
  /* Brand */
  --brand: #6C5CE7;
  --brand-hover: #5A4BD1;
  --brand-light: #EDE9FE;
  --brand-glow: rgba(108, 92, 231, 0.2);

  /* Background */
  --bg-base: #FFFFFF;
  --bg-surface: #F8F8FC;
  --bg-elevated: #F2F2F8;
  --bg-overlay: rgba(255,255,255,0.85);

  /* Text */
  --text-primary: #1A1A2E;
  --text-secondary: #4A4A68;
  --text-muted: #8A8AA8;
  --text-inverse: #FFFFFF;

  /* Border */
  --border: #E4E4F0;
  --border-hover: #C8C8E0;
  --border-focus: var(--brand);

  /* Status */
  --success: #00B894;
  --warning: #FDCB6E;
  --error: #FF7675;
  --info: #74B9FF;

  /* Typography */
  --font-sans: 'Inter', system-ui, -apple-system, sans-serif;
  --font-serif: 'Merriweather', Georgia, 'Times New Roman', serif;
  --font-mono: 'JetBrains Mono', 'Fira Code', monospace;

  /* Font Sizes (fluid) */
  --text-xs:   0.75rem;    /* 12px */
  --text-sm:   0.875rem;   /* 14px */
  --text-base: 1rem;       /* 16px */
  --text-lg:   1.125rem;   /* 18px */
  --text-xl:   1.25rem;    /* 20px */
  --text-2xl:  1.5rem;     /* 24px */
  --text-3xl:  1.875rem;   /* 30px */
  --text-4xl:  2.25rem;    /* 36px */
  --text-5xl:  3rem;       /* 48px */

  /* Line Heights */
  --leading-tight:   1.25;
  --leading-snug:    1.375;
  --leading-normal:  1.5;
  --leading-relaxed: 1.625;
  --leading-article: 1.8;   /* Khusus body artikel */

  /* Spacing */
  --sp-1:  0.25rem;
  --sp-2:  0.5rem;
  --sp-3:  0.75rem;
  --sp-4:  1rem;
  --sp-5:  1.25rem;
  --sp-6:  1.5rem;
  --sp-8:  2rem;
  --sp-10: 2.5rem;
  --sp-12: 3rem;
  --sp-16: 4rem;
  --sp-20: 5rem;
  --sp-24: 6rem;

  /* Layout */
  --max-content: 720px;   /* Lebar max konten artikel */
  --max-page:    1200px;  /* Lebar max halaman */
  --nav-height:  56px;

  /* Border Radius */
  --r-sm:   6px;
  --r-md:   10px;
  --r-lg:   16px;
  --r-xl:   24px;
  --r-full: 9999px;

  /* Shadows */
  --shadow-xs:  0 1px 2px rgba(0,0,0,0.04);
  --shadow-sm:  0 1px 3px rgba(0,0,0,0.06), 0 1px 2px rgba(0,0,0,0.04);
  --shadow-md:  0 4px 12px rgba(0,0,0,0.08), 0 2px 4px rgba(0,0,0,0.04);
  --shadow-lg:  0 8px 24px rgba(0,0,0,0.10), 0 4px 8px rgba(0,0,0,0.04);
  --shadow-xl:  0 16px 48px rgba(0,0,0,0.12), 0 8px 16px rgba(0,0,0,0.06);
  --shadow-brand: 0 4px 20px rgba(108,92,231,0.25);

  /* Transitions */
  --t-fast:   150ms cubic-bezier(0.4, 0, 0.2, 1);
  --t-base:   250ms cubic-bezier(0.4, 0, 0.2, 1);
  --t-slow:   350ms cubic-bezier(0.4, 0, 0.2, 1);
  --t-spring: 400ms cubic-bezier(0.34, 1.56, 0.64, 1);

  /* Z-index */
  --z-base:    0;
  --z-raised:  10;
  --z-overlay: 100;
  --z-nav:     200;
  --z-modal:   300;
  --z-toast:   400;
  --z-top:     500;
}

/* ── Dark Mode (auto, mengikuti sistem) ──────────────────── */
@media (prefers-color-scheme: dark) {
  :root {
    --brand: #A78BFA;
    --brand-hover: #8B6FF0;
    --brand-light: #2D2648;
    --brand-glow: rgba(167, 139, 250, 0.2);

    --bg-base: #0F0F1A;
    --bg-surface: #1A1A2E;
    --bg-elevated: #252540;
    --bg-overlay: rgba(15,15,26,0.90);

    --text-primary: #E8E8F4;
    --text-secondary: #B0B0CC;
    --text-muted: #6868A0;
    --text-inverse: #0F0F1A;

    --border: #2D2D50;
    --border-hover: #4A4A70;

    --shadow-xs:  0 1px 2px rgba(0,0,0,0.25);
    --shadow-sm:  0 1px 3px rgba(0,0,0,0.35), 0 1px 2px rgba(0,0,0,0.25);
    --shadow-md:  0 4px 12px rgba(0,0,0,0.4),  0 2px 4px rgba(0,0,0,0.25);
    --shadow-lg:  0 8px 24px rgba(0,0,0,0.5),  0 4px 8px rgba(0,0,0,0.3);
    --shadow-xl:  0 16px 48px rgba(0,0,0,0.6), 0 8px 16px rgba(0,0,0,0.4);
    --shadow-brand: 0 4px 20px rgba(167,139,250,0.3);
  }
}

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

html {
  font-size: 16px;
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
  scrollbar-width: thin;
  scrollbar-color: var(--border) transparent;
}

body {
  font-family: var(--font-sans);
  font-size: var(--text-base);
  line-height: var(--leading-normal);
  color: var(--text-primary);
  background-color: var(--bg-base);
  transition: background-color var(--t-slow), color var(--t-slow);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

img, video {
  max-width: 100%;
  height: auto;
  display: block;
}

a {
  color: var(--brand);
  text-decoration: none;
  transition: color var(--t-fast);
}

a:hover { color: var(--brand-hover); }

button {
  cursor: pointer;
  font-family: inherit;
  border: none;
  background: none;
}

input, textarea, select {
  font-family: inherit;
  font-size: inherit;
}

/* ── Layout Utilities ────────────────────────────────────── */
.container {
  width: 100%;
  max-width: var(--max-page);
  margin-inline: auto;
  padding-inline: var(--sp-4);
}

@media (min-width: 640px)  { .container { padding-inline: var(--sp-6); } }
@media (min-width: 1024px) { .container { padding-inline: var(--sp-8); } }

.content-width {
  width: 100%;
  max-width: var(--max-content);
  margin-inline: auto;
}

/* ── Navigation ──────────────────────────────────────────── */
.nav {
  position: sticky;
  top: 0;
  z-index: var(--z-nav);
  height: var(--nav-height);
  background: var(--bg-overlay);
  backdrop-filter: blur(16px) saturate(180%);
  -webkit-backdrop-filter: blur(16px) saturate(180%);
  border-bottom: 1px solid var(--border);
  transition: background var(--t-base), border-color var(--t-base);
}

.nav__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 100%;
  gap: var(--sp-4);
}

.nav__logo {
  display: flex;
  align-items: center;
  gap: var(--sp-2);
  font-weight: 800;
  font-size: var(--text-xl);
  color: var(--text-primary);
  text-decoration: none;
  letter-spacing: -0.02em;
  flex-shrink: 0;
}

.nav__logo-mark {
  width: 32px;
  height: 32px;
  background: linear-gradient(135deg, var(--brand), #A78BFA);
  border-radius: var(--r-md);
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  font-weight: 900;
  font-size: var(--text-lg);
  box-shadow: var(--shadow-brand);
}

.nav__links {
  display: none;
  align-items: center;
  gap: var(--sp-1);
  list-style: none;
}

@media (min-width: 768px) {
  .nav__links { display: flex; }
}

.nav__link {
  padding: var(--sp-2) var(--sp-3);
  border-radius: var(--r-md);
  font-size: var(--text-sm);
  font-weight: 500;
  color: var(--text-secondary);
  transition: color var(--t-fast), background var(--t-fast);
  white-space: nowrap;
}

.nav__link:hover {
  color: var(--text-primary);
  background: var(--bg-elevated);
}

.nav__link.active {
  color: var(--brand);
  background: var(--brand-light);
}

.nav__actions {
  display: flex;
  align-items: center;
  gap: var(--sp-2);
}

.nav__search-btn {
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--r-md);
  color: var(--text-secondary);
  transition: color var(--t-fast), background var(--t-fast);
}

.nav__search-btn:hover {
  color: var(--text-primary);
  background: var(--bg-elevated);
}

.nav__hamburger {
  display: flex;
  flex-direction: column;
  gap: 5px;
  width: 36px;
  height: 36px;
  align-items: center;
  justify-content: center;
  border-radius: var(--r-md);
  color: var(--text-secondary);
  transition: background var(--t-fast);
}

.nav__hamburger:hover { background: var(--bg-elevated); }
.nav__hamburger span {
  display: block;
  width: 20px;
  height: 2px;
  background: currentColor;
  border-radius: 2px;
  transition: transform var(--t-base), opacity var(--t-fast);
}

@media (min-width: 768px) {
  .nav__hamburger { display: none; }
}

/* Mobile Menu */
.mobile-menu {
  position: fixed;
  inset: 0;
  z-index: var(--z-modal);
  display: flex;
  flex-direction: column;
  background: var(--bg-base);
  transform: translateX(-100%);
  transition: transform var(--t-slow);
  padding: calc(var(--sp-8) + env(safe-area-inset-top, 24px)) var(--sp-6) var(--sp-6);
  overflow-y: auto;
}

.mobile-menu.open {
  transform: translateX(0);
}

.mobile-menu__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: var(--sp-8);
}

.mobile-menu__nav {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: var(--sp-1);
}

.mobile-menu__link {
  display: block;
  padding: var(--sp-3) var(--sp-4);
  border-radius: var(--r-md);
  font-size: var(--text-lg);
  font-weight: 500;
  color: var(--text-primary);
  transition: background var(--t-fast), color var(--t-fast);
}

.mobile-menu__link:hover {
  background: var(--bg-surface);
  color: var(--brand);
}

/* ── Scroll Progress Bar ─────────────────────────────────── */
.scroll-progress {
  position: fixed;
  top: 0;
  left: 0;
  height: 3px;
  background: linear-gradient(90deg, var(--brand), #A78BFA);
  z-index: var(--z-top);
  transition: width 100ms linear;
  border-radius: 0 var(--r-full) var(--r-full) 0;
}

/* ── Hero / Featured Card ────────────────────────────────── */
.featured-card {
  position: relative;
  border-radius: var(--r-xl);
  overflow: hidden;
  background: var(--bg-surface);
  border: 1px solid var(--border);
  text-decoration: none;
  display: block;
  transition: transform var(--t-base), box-shadow var(--t-base);
}

.featured-card:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow-xl);
}

.featured-card__image {
  aspect-ratio: 16/9;
  overflow: hidden;
}

.featured-card__image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform var(--t-slow);
}

.featured-card:hover .featured-card__image img {
  transform: scale(1.04);
}

.featured-card__body {
  padding: var(--sp-6);
}

.featured-card__meta {
  display: flex;
  align-items: center;
  gap: var(--sp-3);
  margin-bottom: var(--sp-3);
  flex-wrap: wrap;
}

.featured-card__title {
  font-size: clamp(var(--text-xl), 3vw, var(--text-3xl));
  font-weight: 800;
  line-height: var(--leading-tight);
  color: var(--text-primary);
  margin-bottom: var(--sp-3);
  letter-spacing: -0.02em;
}

.featured-card__excerpt {
  font-size: var(--text-base);
  color: var(--text-secondary);
  line-height: var(--leading-relaxed);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* ── Post Cards ──────────────────────────────────────────── */
.post-card {
  display: flex;
  gap: var(--sp-4);
  padding: var(--sp-4);
  border-radius: var(--r-lg);
  background: var(--bg-base);
  border: 1px solid var(--border);
  text-decoration: none;
  transition: transform var(--t-base), box-shadow var(--t-base), border-color var(--t-base);
}

.post-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
  border-color: var(--border-hover);
}

.post-card__thumbnail {
  flex-shrink: 0;
  width: 100px;
  height: 70px;
  border-radius: var(--r-md);
  overflow: hidden;
  background: var(--bg-elevated);
}

.post-card__thumbnail img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform var(--t-slow);
}

.post-card:hover .post-card__thumbnail img {
  transform: scale(1.05);
}

.post-card__body {
  flex: 1;
  min-width: 0;
}

.post-card__title {
  font-size: var(--text-base);
  font-weight: 700;
  color: var(--text-primary);
  line-height: var(--leading-snug);
  margin-bottom: var(--sp-2);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.post-card__meta {
  display: flex;
  align-items: center;
  gap: var(--sp-2);
  flex-wrap: wrap;
}

/* Grid variant (homepage sections) */
.post-grid-card {
  border-radius: var(--r-lg);
  overflow: hidden;
  background: var(--bg-base);
  border: 1px solid var(--border);
  text-decoration: none;
  display: flex;
  flex-direction: column;
  transition: transform var(--t-base), box-shadow var(--t-base);
}

.post-grid-card:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow-lg);
}

.post-grid-card__image {
  aspect-ratio: 16/9;
  overflow: hidden;
  background: var(--bg-elevated);
}

.post-grid-card__image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform var(--t-slow);
}

.post-grid-card:hover .post-grid-card__image img {
  transform: scale(1.04);
}

.post-grid-card__body {
  padding: var(--sp-4) var(--sp-5);
  flex: 1;
  display: flex;
  flex-direction: column;
}

.post-grid-card__title {
  font-size: var(--text-base);
  font-weight: 700;
  color: var(--text-primary);
  line-height: var(--leading-snug);
  margin-bottom: var(--sp-2);
  flex: 1;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
  transition: color var(--t-fast);
}

.post-grid-card:hover .post-grid-card__title {
  color: var(--brand);
  text-decoration: underline;
}

.post-grid-card__meta {
  display: flex;
  align-items: center;
  gap: var(--sp-2);
  margin-top: var(--sp-3);
  flex-wrap: wrap;
}

/* ── Category Badge ──────────────────────────────────────── */
.badge-category {
  display: inline-flex;
  align-items: center;
  padding: var(--sp-1) var(--sp-3);
  border-radius: var(--r-full);
  font-size: var(--text-xs);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  background: var(--brand-light);
  color: var(--brand);
  text-decoration: none;
  transition: background var(--t-fast), color var(--t-fast);
  white-space: nowrap;
}

.badge-category:hover {
  background: var(--brand);
  color: var(--text-inverse);
}

/* ── Tag Badge ───────────────────────────────────────────── */
.badge-tag {
  display: inline-flex;
  align-items: center;
  gap: var(--sp-1);
  padding: var(--sp-1) var(--sp-2);
  border-radius: var(--r-sm);
  font-size: var(--text-xs);
  font-weight: 500;
  background: var(--bg-elevated);
  color: var(--text-secondary);
  border: 1px solid var(--border);
  text-decoration: none;
  transition: all var(--t-fast);
  white-space: nowrap;
}

.badge-tag:hover {
  background: var(--brand-light);
  color: var(--brand);
  border-color: var(--brand-light);
  transform: scale(1.05);
}

/* Auto-linked tags in article */
.auto-tag-link {
  color: var(--brand);
  text-decoration: underline;
  text-decoration-style: dotted;
  text-decoration-color: var(--brand);
  text-underline-offset: 3px;
  cursor: pointer;
  transition: color var(--t-fast);
  position: relative;
}

.auto-tag-link:hover {
  color: var(--brand-hover);
  text-decoration-style: solid;
}

/* ── Meta Info (author, date, reading time) ──────────────── */
.meta-info {
  display: flex;
  align-items: center;
  gap: var(--sp-3);
  font-size: var(--text-xs);
  color: var(--text-muted);
  flex-wrap: wrap;
}

.meta-info__dot {
  width: 3px;
  height: 3px;
  border-radius: 50%;
  background: var(--text-muted);
  flex-shrink: 0;
}

/* ── Article Body ────────────────────────────────────────── */
.article {
  padding-block: var(--sp-12);
}

.article__header {
  margin-bottom: var(--sp-8);
}

.article__breadcrumb {
  display: flex;
  align-items: center;
  gap: var(--sp-2);
  font-size: var(--text-sm);
  color: var(--text-muted);
  margin-bottom: var(--sp-4);
  flex-wrap: wrap;
}

.article__breadcrumb a {
  color: var(--text-muted);
  transition: color var(--t-fast);
}

.article__breadcrumb a:hover { color: var(--brand); }

.article__breadcrumb-sep {
  color: var(--border-hover);
  user-select: none;
}

.article__title {
  font-size: clamp(var(--text-2xl), 4vw, var(--text-4xl));
  font-weight: 900;
  line-height: var(--leading-tight);
  letter-spacing: -0.025em;
  color: var(--text-primary);
  margin-bottom: var(--sp-5);
}

.article__featured-image {
  border-radius: var(--r-xl);
  overflow: hidden;
  margin-block: var(--sp-8);
  background: var(--bg-elevated);
  aspect-ratio: 16/9;
}

.article__featured-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

/* Article Prose */
.prose {
  font-family: var(--font-serif);
  font-size: clamp(var(--text-base), 2vw, var(--text-lg));
  line-height: var(--leading-article);
  color: var(--text-primary);
}

.prose h1, .prose h2, .prose h3,
.prose h4, .prose h5, .prose h6 {
  font-family: var(--font-sans);
  font-weight: 800;
  line-height: var(--leading-tight);
  letter-spacing: -0.02em;
  color: var(--text-primary);
  margin-top: var(--sp-10);
  margin-bottom: var(--sp-4);
}

.prose h1 { font-size: var(--text-3xl); }
.prose h2 { font-size: var(--text-2xl); }
.prose h3 { font-size: var(--text-xl); }
.prose h4 { font-size: var(--text-lg); }

.prose p { margin-bottom: var(--sp-6); }

.prose a {
  color: var(--brand);
  text-decoration: underline;
  text-decoration-color: var(--brand-light);
  text-underline-offset: 3px;
}

.prose a:hover {
  text-decoration-color: var(--brand);
}

.prose strong { font-weight: 700; }

.prose em { font-style: italic; }

.prose blockquote {
  border-left: 4px solid var(--brand);
  padding-left: var(--sp-6);
  margin-block: var(--sp-8);
  color: var(--text-secondary);
  font-style: italic;
}

.prose ul, .prose ol {
  margin-bottom: var(--sp-6);
  padding-left: var(--sp-6);
}

.prose li { margin-bottom: var(--sp-2); }

.prose code {
  font-family: var(--font-mono);
  font-size: 0.875em;
  background: var(--bg-elevated);
  padding: 2px 6px;
  border-radius: var(--r-sm);
  color: var(--brand);
}

.prose pre {
  font-family: var(--font-mono);
  font-size: var(--text-sm);
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  padding: var(--sp-5);
  overflow-x: auto;
  margin-block: var(--sp-6);
  line-height: 1.7;
}

.prose pre code {
  background: none;
  padding: 0;
  color: var(--text-primary);
}

.prose hr {
  border: none;
  border-top: 1px solid var(--border);
  margin-block: var(--sp-10);
}

.prose table {
  width: 100%;
  border-collapse: collapse;
  margin-block: var(--sp-6);
  font-size: var(--text-sm);
  font-family: var(--font-sans);
}

.prose th, .prose td {
  padding: var(--sp-3) var(--sp-4);
  border: 1px solid var(--border);
  text-align: left;
}

.prose th {
  background: var(--bg-surface);
  font-weight: 600;
}

.prose img {
  border-radius: var(--r-lg);
  margin-block: var(--sp-6);
}

/* ── Share Bar ───────────────────────────────────────────── */
.share-bar {
  display: flex;
  align-items: center;
  gap: var(--sp-2);
  padding: var(--sp-4);
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  margin-block: var(--sp-6);
  flex-wrap: wrap;
}

.share-bar__label {
  font-size: var(--text-sm);
  font-weight: 600;
  color: var(--text-secondary);
  margin-right: var(--sp-2);
}

.share-btn {
  display: inline-flex;
  align-items: center;
  gap: var(--sp-2);
  padding: var(--sp-2) var(--sp-3);
  border-radius: var(--r-md);
  font-size: var(--text-sm);
  font-weight: 500;
  transition: all var(--t-fast);
  cursor: pointer;
  border: 1px solid var(--border);
  background: var(--bg-base);
  color: var(--text-secondary);
}

.share-btn:hover {
  transform: translateY(-1px);
  box-shadow: var(--shadow-sm);
}

.share-btn--whatsapp:hover { background: #25D366; color: white; border-color: #25D366; }
.share-btn--twitter:hover  { background: #1DA1F2; color: white; border-color: #1DA1F2; }
.share-btn--copy:hover     { background: var(--brand); color: white; border-color: var(--brand); }

/* ── Tags Section in Article ────────────────────────────── */
.article__tags {
  display: flex;
  align-items: center;
  gap: var(--sp-2);
  flex-wrap: wrap;
  padding-block: var(--sp-6);
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
  margin-block: var(--sp-8);
}

.article__tags-label {
  font-size: var(--text-sm);
  font-weight: 600;
  color: var(--text-muted);
}

/* ── Series Navigator ────────────────────────────────────── */
.series-box {
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--r-xl);
  padding: var(--sp-6);
  margin-block: var(--sp-8);
}

.series-box__title {
  font-size: var(--text-sm);
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  margin-bottom: var(--sp-2);
}

.series-box__name {
  font-size: var(--text-xl);
  font-weight: 800;
  color: var(--text-primary);
  font-family: var(--font-sans);
  margin-bottom: var(--sp-4);
}

.series-box__list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: var(--sp-1);
}

.series-box__item {
  display: flex;
  align-items: center;
  gap: var(--sp-3);
  padding: var(--sp-2) var(--sp-3);
  border-radius: var(--r-md);
  font-size: var(--text-sm);
  color: var(--text-secondary);
  text-decoration: none;
  transition: background var(--t-fast);
}

.series-box__item:hover {
  background: var(--bg-elevated);
  color: var(--text-primary);
}

.series-box__item.current {
  background: var(--brand-light);
  color: var(--brand);
  font-weight: 600;
}

.series-box__item-num {
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: var(--bg-elevated);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: var(--text-xs);
  font-weight: 700;
  flex-shrink: 0;
  font-family: var(--font-sans);
}

.series-box__item.current .series-box__item-num {
  background: var(--brand);
  color: white;
}

.series-box__item.done .series-box__item-num {
  background: var(--success);
  color: white;
}

/* ── Related Content ─────────────────────────────────────── */
.related-section {
  margin-block: var(--sp-12);
  padding-top: var(--sp-8);
  border-top: 1px solid var(--border);
}

.section-heading {
  font-size: var(--text-xl);
  font-weight: 800;
  color: var(--text-primary);
  margin-bottom: var(--sp-6);
  letter-spacing: -0.02em;
}

.related-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: var(--sp-4);
}

@media (min-width: 480px) {
  .related-grid { grid-template-columns: repeat(2, 1fr); }
}

@media (min-width: 768px) {
  .related-grid { grid-template-columns: repeat(3, 1fr); }
}

/* ── Ad Slots ────────────────────────────────────────────── */
.ad-slot {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  min-height: 90px;
  background: var(--bg-surface);
  border: 1px dashed var(--border);
  border-radius: var(--r-md);
  color: var(--text-muted);
  font-size: var(--text-xs);
  margin-block: var(--sp-6);
  overflow: hidden;
}

.ad-slot--sticky {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  z-index: var(--z-raised);
  border-radius: 0;
  border-inline: none;
  border-bottom: none;
  min-height: 50px;
  background: var(--bg-overlay);
  backdrop-filter: blur(8px);
}

/* ── Homepage Grid ───────────────────────────────────────── */
.posts-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: var(--sp-4);
}

@media (min-width: 480px) {
  .posts-grid { grid-template-columns: repeat(2, 1fr); }
}

@media (min-width: 768px) {
  .posts-grid { grid-template-columns: repeat(3, 1fr); }
}

@media (min-width: 1024px) {
  .posts-grid { grid-template-columns: repeat(4, 1fr); }
}

/* ── Popular Posts List ──────────────────────────────────── */
.popular-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: var(--sp-3);
}

.popular-list__item {
  display: flex;
  align-items: flex-start;
  gap: var(--sp-3);
  text-decoration: none;
  padding: var(--sp-3);
  border-radius: var(--r-md);
  transition: background var(--t-fast);
}

.popular-list__item:hover { background: var(--bg-surface); }

.popular-list__num {
  font-size: var(--text-xl);
  font-weight: 900;
  color: var(--border-hover);
  line-height: 1;
  width: 28px;
  flex-shrink: 0;
  font-variant-numeric: tabular-nums;
}

.popular-list__title {
  font-size: var(--text-sm);
  font-weight: 600;
  color: var(--text-primary);
  line-height: var(--leading-snug);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* ── Tag Cloud ───────────────────────────────────────────── */
.tag-cloud {
  display: flex;
  flex-wrap: wrap;
  gap: var(--sp-2);
}

/* ── Buttons ─────────────────────────────────────────────── */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--sp-2);
  padding: var(--sp-3) var(--sp-5);
  border-radius: var(--r-md);
  font-size: var(--text-sm);
  font-weight: 600;
  line-height: 1;
  cursor: pointer;
  border: 1px solid transparent;
  transition: all var(--t-fast);
  text-decoration: none;
  white-space: nowrap;
}

.btn--primary {
  background: var(--brand);
  color: white;
  border-color: var(--brand);
}

.btn--primary:hover {
  background: var(--brand-hover);
  border-color: var(--brand-hover);
  transform: translateY(-1px);
  box-shadow: var(--shadow-brand);
}

.btn--secondary {
  background: var(--bg-elevated);
  color: var(--text-primary);
  border-color: var(--border);
}

.btn--secondary:hover {
  background: var(--bg-surface);
  border-color: var(--border-hover);
}

.btn--ghost {
  background: transparent;
  color: var(--text-secondary);
}

.btn--ghost:hover {
  background: var(--bg-surface);
  color: var(--text-primary);
}

.btn--sm {
  padding: var(--sp-2) var(--sp-3);
  font-size: var(--text-xs);
}

.btn--lg {
  padding: var(--sp-4) var(--sp-6);
  font-size: var(--text-base);
}

/* ── Footer ──────────────────────────────────────────────── */
.footer {
  background: var(--bg-surface);
  border-top: 1px solid var(--border);
  padding-block: var(--sp-12) var(--sp-8);
  margin-top: var(--sp-16);
}

.footer__grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: var(--sp-8);
}

@media (min-width: 640px) {
  .footer__grid { grid-template-columns: repeat(2, 1fr); }
}

@media (min-width: 1024px) {
  .footer__grid { grid-template-columns: 2fr 1fr 1fr 1fr; }
}

.footer__brand-name {
  font-size: var(--text-xl);
  font-weight: 800;
  color: var(--text-primary);
  margin-bottom: var(--sp-2);
}

.footer__tagline {
  font-size: var(--text-sm);
  color: var(--text-muted);
  margin-bottom: var(--sp-4);
}

.footer__heading {
  font-size: var(--text-sm);
  font-weight: 700;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  margin-bottom: var(--sp-4);
}

.footer__links {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: var(--sp-2);
}

.footer__link {
  font-size: var(--text-sm);
  color: var(--text-muted);
  text-decoration: none;
  transition: color var(--t-fast);
}

.footer__link:hover { color: var(--brand); }

.footer__bottom {
  margin-top: var(--sp-8);
  padding-top: var(--sp-6);
  border-top: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--sp-4);
  flex-wrap: wrap;
}

.footer__copy {
  font-size: var(--text-xs);
  color: var(--text-muted);
}

/* ── Pagination ──────────────────────────────────────────── */
.pagination {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: var(--sp-2);
  margin-block: var(--sp-12);
  flex-wrap: wrap;
}

.pagination__btn {
  display: flex;
  align-items: center;
  justify-content: center;
  min-width: 36px;
  height: 36px;
  padding-inline: var(--sp-3);
  border-radius: var(--r-md);
  font-size: var(--text-sm);
  font-weight: 500;
  color: var(--text-secondary);
  border: 1px solid var(--border);
  background: var(--bg-base);
  text-decoration: none;
  transition: all var(--t-fast);
}

.pagination__btn:hover {
  border-color: var(--brand);
  color: var(--brand);
  background: var(--brand-light);
}

.pagination__btn.active {
  background: var(--brand);
  border-color: var(--brand);
  color: white;
}

.pagination__btn:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

/* ── Breadcrumb Schema ───────────────────────────────────── */
.breadcrumb {
  display: flex;
  align-items: center;
  gap: var(--sp-2);
  font-size: var(--text-sm);
  color: var(--text-muted);
  padding-block: var(--sp-4);
  flex-wrap: wrap;
}

.breadcrumb__sep { color: var(--border-hover); }

.breadcrumb a {
  color: var(--text-muted);
  transition: color var(--t-fast);
}

.breadcrumb a:hover { color: var(--brand); }

.breadcrumb__current {
  color: var(--text-secondary);
  font-weight: 500;
}

/* ── Skeleton Loading ────────────────────────────────────── */
@keyframes shimmer {
  0%   { background-position: -200% 0; }
  100% { background-position:  200% 0; }
}

.skeleton {
  background: linear-gradient(
    90deg,
    var(--bg-elevated) 25%,
    var(--bg-surface) 50%,
    var(--bg-elevated) 75%
  );
  background-size: 200% 100%;
  animation: shimmer 1.5s infinite;
  border-radius: var(--r-md);
}

/* ── Search ──────────────────────────────────────────────── */
.search-box {
  position: relative;
  width: 100%;
  max-width: 600px;
  margin-inline: auto;
}

.search-box__input {
  width: 100%;
  height: 52px;
  padding: 0 var(--sp-5) 0 var(--sp-12);
  border: 2px solid var(--border);
  border-radius: var(--r-full);
  background: var(--bg-base);
  font-size: var(--text-base);
  color: var(--text-primary);
  outline: none;
  transition: border-color var(--t-fast), box-shadow var(--t-fast);
}

.search-box__input:focus {
  border-color: var(--brand);
  box-shadow: 0 0 0 4px var(--brand-glow);
}

.search-box__icon {
  position: absolute;
  left: var(--sp-4);
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-muted);
  pointer-events: none;
}

/* ── Section Header ──────────────────────────────────────── */
.section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: var(--sp-5);
  gap: var(--sp-4);
}

.section-header__title {
  font-size: var(--text-xl);
  font-weight: 800;
  color: var(--text-primary);
  letter-spacing: -0.02em;
}

.section-header__link {
  font-size: var(--text-sm);
  font-weight: 600;
  color: var(--brand);
  white-space: nowrap;
  flex-shrink: 0;
}

/* ── Horizontal Scroll (mobile category cards) ───────────── */
.h-scroll {
  display: flex;
  gap: var(--sp-4);
  overflow-x: auto;
  padding-bottom: var(--sp-2);
  scrollbar-width: none;
  -ms-overflow-style: none;
  scroll-snap-type: x mandatory;
}

.h-scroll::-webkit-scrollbar { display: none; }

.h-scroll > * {
  flex-shrink: 0;
  scroll-snap-align: start;
  width: min(280px, 75vw);
}

/* ── Admin Layout ────────────────────────────────────────── */
.admin-layout {
  display: grid;
  grid-template-columns: 1fr;
  min-height: 100vh;
}

@media (min-width: 1024px) {
  .admin-layout {
    grid-template-columns: 240px 1fr;
  }
}

.admin-sidebar {
  background: var(--bg-surface);
  border-right: 1px solid var(--border);
  padding: var(--sp-6);
  display: none;
}

@media (min-width: 1024px) {
  .admin-sidebar { display: block; }
}

.admin-content {
  padding: var(--sp-6);
  max-width: 100%;
  overflow-x: hidden;
}

/* ── Animations ──────────────────────────────────────────── */
@keyframes fadeIn {
  from { opacity: 0; transform: translateY(8px); }
  to   { opacity: 1; transform: translateY(0); }
}

@keyframes slideInLeft {
  from { opacity: 0; transform: translateX(-16px); }
  to   { opacity: 1; transform: translateX(0); }
}

@keyframes heartPop {
  0%   { transform: scale(1); }
  50%  { transform: scale(1.3); }
  100% { transform: scale(1); }
}

.animate-fade-in {
  animation: fadeIn var(--t-slow) both;
}

.animate-fade-in-delay {
  animation: fadeIn var(--t-slow) 100ms both;
}

/* ── Focus visible (accessibility) ──────────────────────── */
:focus-visible {
  outline: 2px solid var(--brand);
  outline-offset: 3px;
  border-radius: 3px;
}

/* ── Print ───────────────────────────────────────────────── */
@media print {
  .nav, .footer, .ad-slot, .share-bar, .related-section { display: none !important; }
  .prose { font-size: 12pt; line-height: 1.6; }
}
