/* ═══════════════════════════════════════════════════════════════
   NETTOWAKUDAYS — DARK THEME
   Mobile-first • Premium minimalis • Satu file untuk semua
   ═══════════════════════════════════════════════════════════════ */

/* ─── ROOT VARIABLES ─── */
:root {
  /* Palet utama */
  --bg-base:      #0d1117;
  --bg-surface:   #151b23;
  --bg-elevated:  #1c2330;
  --bg-hover:     #212936;
  --bg-inset:     #090c10;

  --text-primary: #e6edf3;
  --text-secondary: #8b949e;
  --text-muted:   #6e7681;
  --text-inverse: #0d1217;

  --accent:       #672ea0;
  --accent-hover: #643fb9;
  --accent-dim:   rgba(101, 46, 160, 0.15);
  --accent-glow:  rgba(109, 46, 160, 0.25);

  --border:       #30363d;
  --border-light: #21262d;

  /* Status */
  --error:        #f85149;
  --warning:      #d29922;
  --info:         #58a6ff;

  /* Dimensi */
  --radius-sm:   6px;
  --radius-md:   10px;
  --radius-lg:   14px;
  --radius-full: 9999px;

  --header-h:    64px;
  --sidebar-w:   300px;
  --max-width:   1200px;
  --space:       1.25rem;

  /* Tipografi */
  --font:        system-ui, -apple-system, 'Segoe UI', Roboto, 'Noto Sans', sans-serif;
  --font-mono:   'SF Mono', 'JetBrains Mono', 'Cascadia Code', monospace;

  /* Transisi */
  --ease-out:    cubic-bezier(0.16, 1, 0.3, 1);
  --ease-spring: cubic-bezier(0.34, 1.56, 0.64, 1);
}

/* ─── RESET ─── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body {
  background: var(--bg-base);
  color: var(--text-primary);
  font-family: var(--font);
  font-size: 16px;
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  min-height: 100vh;
  overflow-x: hidden;
}

/* ─── SELECTION ─── */
::selection { background: var(--accent-dim); color: var(--accent); }
::-moz-selection { background: var(--accent-dim); color: var(--accent); }

/* ─── SCROLLBAR ─── */
::-webkit-scrollbar { width: 8px; height: 8px; }
::-webkit-scrollbar-track { background: var(--bg-base); }
::-webkit-scrollbar-thumb {
  background: var(--border);
  border-radius: var(--radius-full);
}
::-webkit-scrollbar-thumb:hover { background: var(--text-muted); }

/* ─── TYPOGRAPHY ─── */
a { color: var(--accent); text-decoration: none; transition: color 0.2s var(--ease-out); }
a:hover { color: var(--accent-hover); }
img, video, iframe { max-width: 100%; height: auto; display: block; border-radius: var(--radius-md); }
button { cursor: pointer; font: inherit; border: none; background: none; color: inherit; }
input, textarea { font: inherit; background: none; border: none; outline: none; color: inherit; }
ul, ol { list-style: none; }

/* ─── APP SHELL ─── */
.app {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  opacity: 0;
  transition: opacity 0.4s ease;
}
.app.ready { opacity: 1; }

.container {
  width: 100%;
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 var(--space);
}

/* ═══════════════════════════════════════════════
   KOMPONEN: HEADER (sticky, glassmorphism)
   ═══════════════════════════════════════════════ */
.header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(13, 17, 23, 0.88);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border-light);
  height: var(--header-h);
  display: flex;
  align-items: center;
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  width: 100%;
}

.logo {
  font-family: 'Outfit', system-ui, sans-serif;
  font-size: 1.25rem;
  font-weight: 800;
  letter-spacing: -0.75px;
  white-space: nowrap;
  background: linear-gradient(115deg, #e6edf3 0%, #803fb9 50%, #632ea0 100%);
  background-size: 200% 200%;
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  animation: logoShimmer 4s ease-in-out infinite;
  transition: filter 0.3s var(--ease-out);
}
.logo:hover {
  filter: drop-shadow(0 0 12px var(--accent-glow));
}

@keyframes logoShimmer {
  0%, 100% { background-position: 0% 50%; }
  50% { background-position: 100% 50%; }
}

.search-box {
  display: flex;
  align-items: center;
  background: var(--bg-surface);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-full);
  padding: 0.4rem 0.4rem 0.4rem 1rem;
  width: 100%;
  max-width: 380px;
  transition: all 0.25s var(--ease-out);
}
.search-box:focus-within {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-dim);
  background: var(--bg-elevated);
}
.search-input {
  flex: 1;
  min-width: 0;
  font-size: 0.9rem;
  color: var(--text-primary);
}
.search-input::placeholder { color: var(--text-muted); }
.search-btn {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-secondary);
  font-size: 0.85rem;
  transition: all 0.2s var(--ease-out);
  flex-shrink: 0;
}
.search-btn:hover {
  background: var(--accent);
  color: #fff;
}

/* ═══════════════════════════════════════════════
   KOMPONEN: BANNER
   ═══════════════════════════════════════════════ */
.banner {
  position: relative;
  width: 100%;
  max-width: 900px;
  margin: 1.5rem auto 0;
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.5);
}

.banner-img {
  width: 100%;
  height: auto;
  min-height: 200px;
  max-height: 340px;
  object-fit: cover;
  display: block;
  background: var(--bg-elevated);
}

.banner-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(
    to top,
    rgba(13, 17, 23, 0.97) 0%,
    rgba(13, 17, 23, 0.6) 50%,
    transparent 100%
  );
  display: flex;
  align-items: flex-end;
  padding: 1.5rem;
}

.banner-title {
  font-size: 1.6rem;
  font-weight: 800;
  letter-spacing: -0.3px;
  color: var(--text-primary);
  background: rgba(21, 27, 35, 0.8);
  backdrop-filter: blur(6px);
  padding: 0.5rem 1.2rem;
  border-radius: var(--radius-md);
  border: 1px solid var(--border);
  line-height: 1.3;
}

/* ═══════════════════════════════════════════════
   LAYOUT UTAMA
   ═══════════════════════════════════════════════ */
.layout {
  display: flex;
  flex: 1;
  gap: 2.5rem;
  padding: 1.5rem var(--space) 2.5rem;
  width: 100%;
  max-width: var(--max-width);
  margin: 0 auto;
}

.content-area {
  flex: 1;
  min-width: 0;
}

/* ─── SIDEBAR ─── */
.sidebar {
  width: var(--sidebar-w);
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
  position: sticky;
  top: calc(var(--header-h) + 1.5rem);
  height: fit-content;
  max-height: calc(100vh - var(--header-h) - 3rem);
  overflow-y: auto;
}

.widget {
  background: var(--bg-surface);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-md);
  padding: 1.25rem;
}

.widget-title {
  font-size: 0.85rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--text-secondary);
  margin-bottom: 0.75rem;
  padding-bottom: 0.6rem;
  border-bottom: 1px solid var(--border-light);
  display: flex;
  align-items: center;
  gap: 0.4rem;
}

.widget-text {
  color: var(--text-secondary);
  font-size: 0.9rem;
  line-height: 1.7;
}

/* ─── WIDGET: statistic counter ─── */
.widget-stat {
  display: flex;
  align-items: baseline;
  gap: 0.4rem;
  margin-top: 0.9rem;
  padding: 0.7rem 1rem;
  background: var(--bg-elevated);
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-light);
}
.stat-num {
  font-size: 1.4rem;
  font-weight: 800;
  color: var(--accent);
  line-height: 1;
}
.stat-label {
  font-size: 0.8rem;
  color: var(--text-muted);
}

/* ─── WIDGET: tag cloud ─── */
.tag-cloud {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
}
.tag-chip {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  background: var(--bg-elevated);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-full);
  padding: 0.25rem 0.7rem;
  font-size: 0.78rem;
  font-weight: 500;
  color: var(--text-secondary);
  cursor: pointer;
  transition: all 0.2s var(--ease-out);
}
.tag-chip:hover {
  border-color: var(--accent);
  color: var(--accent);
  background: var(--accent-dim);
  transform: translateY(-1px);
}
.tag-count {
  font-size: 0.7rem;
  color: var(--text-muted);
  background: var(--bg-hover);
  padding: 0 0.35rem;
  border-radius: var(--radius-full);
  line-height: 1.4;
}
.tag-chip:hover .tag-count {
  color: var(--accent-hover);
  background: var(--accent-dim);
}

/* ─── CHAT BOX (desktop) ─── */
.chat-frame {
  width: 100%;
  height: 380px;
  overflow: hidden;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-light);
  background: var(--bg-inset);
}
.chat-frame iframe {
  width: 100% !important;
  height: 100% !important;
  border: none;
}

/* ═══════════════════════════════════════════════
   KOMPONEN: ARTIKEL CARD
   ═══════════════════════════════════════════════ */
.article-card {
  background: var(--bg-surface);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-md);
  overflow: hidden;
  margin-bottom: 1rem;
  transition: all 0.25s var(--ease-out);
}
.article-card:hover {
  border-color: var(--accent);
  box-shadow: 0 4px 24px rgba(0, 0, 0, 0.3);
  transform: translateY(-1px);
}

.card-head {
  padding: 1.25rem 1.25rem 0;
}

.card-title {
  font-size: 1.15rem;
  font-weight: 650;
  line-height: 1.4;
  margin-bottom: 0.5rem;
}
.card-title a {
  color: var(--text-primary);
  display: block;
}
.card-title a:hover {
  color: var(--accent-hover);
}

.card-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  font-size: 0.8rem;
  color: var(--text-muted);
  margin-bottom: 0.75rem;
}
.card-meta span {
  display: flex;
  align-items: center;
  gap: 0.3rem;
}
.card-meta .dot {
  width: 3px;
  height: 3px;
  border-radius: 50%;
  background: var(--text-muted);
}

.card-thumb-wrap {
  margin: 0 1.25rem 0.75rem;
  border-radius: var(--radius-sm);
  overflow: hidden;
  position: relative;
  cursor: pointer;
}
.card-thumb {
  width: 100%;
  height: 200px;
  object-fit: cover;
  background: var(--bg-elevated);
  transition: transform 0.4s var(--ease-out);
}
.article-card:hover .card-thumb {
  transform: scale(1.02);
}

.card-excerpt {
  padding: 0 1.25rem 0.75rem;
  color: var(--text-secondary);
  font-size: 0.9rem;
  line-height: 1.7;
}
.card-excerpt-skeleton {
  display: -webkit-box;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.card-foot {
  padding: 0 1.25rem 1.25rem;
}

/* ─── BUTTONS ─── */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  background: var(--accent);
  color: #fff;
  padding: 0.55rem 1.2rem;
  border-radius: var(--radius-sm);
  font-weight: 550;
  font-size: 0.85rem;
  transition: all 0.2s var(--ease-out);
}
.btn:hover {
  background: var(--accent-hover);
  box-shadow: 0 4px 16px var(--accent-glow);
  transform: translateY(-1px);
}

.btn-ghost {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  background: var(--bg-elevated);
  color: var(--text-secondary);
  padding: 0.5rem 1rem;
  border-radius: var(--radius-sm);
  font-size: 0.85rem;
  transition: all 0.2s var(--ease-out);
}
.btn-ghost:hover {
  background: var(--accent-dim);
  color: var(--accent);
}

/* ═══════════════════════════════════════════════
   KOMPONEN: ARTIKEL FULL
   ═══════════════════════════════════════════════ */
.article-full {
  background: var(--bg-surface);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-md);
  overflow: hidden;
}

.full-head {
  padding: 1.5rem 1.5rem 1rem;
  border-bottom: 1px solid var(--border-light);
}

.full-title {
  font-size: 1.65rem;
  font-weight: 750;
  line-height: 1.35;
  letter-spacing: -0.3px;
}

.full-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  font-size: 0.85rem;
  color: var(--text-muted);
  margin-top: 0.75rem;
}

.full-thumb {
  width: 100%;
  max-height: 420px;
  object-fit: cover;
  background: var(--bg-elevated);
}

.full-body {
  padding: 1.5rem;
  color: var(--text-primary);
  line-height: 1.85;
  font-size: 1.05rem;
}

.full-body p { margin-bottom: 1.1rem; }
.full-body h2 { font-size: 1.4rem; font-weight: 700; margin: 2rem 0 0.75rem; padding-bottom: 0.4rem; border-bottom: 1px solid var(--border-light); }
.full-body h3 { font-size: 1.2rem; font-weight: 650; margin: 1.5rem 0 0.5rem; }
.full-body h4 { font-size: 1.05rem; font-weight: 600; margin: 1.25rem 0 0.5rem; }
.full-body ul, .full-body ol { margin-left: 1.5rem; margin-bottom: 1rem; }
.full-body li { margin-bottom: 0.3rem; }
.full-body ul li { list-style: disc; }
.full-body ol li { list-style: decimal; }
.full-body a { text-decoration: underline; text-underline-offset: 2px; }
.full-body a:hover { color: var(--accent-hover); }
.full-body strong { color: var(--text-primary); font-weight: 650; }

.full-body pre {
  background: var(--bg-inset);
  border: 1px solid var(--border-light);
  padding: 1rem 1.25rem;
  border-radius: var(--radius-sm);
  overflow-x: auto;
  font-family: var(--font-mono);
  font-size: 0.9rem;
  margin: 1.25rem 0;
  line-height: 1.6;
}
.full-body code {
  background: var(--bg-inset);
  padding: 0.15rem 0.45rem;
  border-radius: 4px;
  font-family: var(--font-mono);
  font-size: 0.9em;
}
.full-body pre code { background: none; padding: 0; border-radius: 0; }
.full-body blockquote {
  border-left: 3px solid var(--accent);
  padding: 0.5rem 0 0.5rem 1.25rem;
  margin: 1.25rem 0;
  color: var(--text-secondary);
  font-style: italic;
  background: var(--bg-elevated);
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
}
.full-body img, .full-body video, .full-body iframe {
  margin: 1.25rem auto;
  border-radius: var(--radius-md);
}
.full-body hr { border: none; border-top: 1px solid var(--border-light); margin: 2rem 0; }

/* ─── TABLE di dalam konten ─── */
.full-body table {
  width: 100%;
  border-collapse: collapse;
  margin: 1.25rem 0;
  font-size: 0.95rem;
  display: block;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}
.full-body table th,
.full-body table td {
  border: 1px solid var(--border);
  padding: 0.6rem 0.8rem;
  text-align: left;
  white-space: nowrap;
}
.full-body table th {
  background: var(--bg-elevated);
  font-weight: 650;
  color: var(--text-primary);
}
.full-body table td {
  color: var(--text-secondary);
}
.full-body table tr:nth-child(even) td {
  background: var(--bg-elevated);
}

/* ─── Overlap / overflow protection ─── */
.full-body * {
  max-width: 100%;
  overflow-wrap: break-word;
  word-wrap: break-word;
}
.full-body pre {
  white-space: pre;
  overflow-x: auto;
  max-width: 100%;
}
.full-body iframe {
  max-width: 100%;
}

/* ─── List style dalam konten ─── */
.full-body ul,
.full-body ol {
  padding-left: 1.5rem;
}

.full-share-top {
  padding: 0.75rem 0 0;
  display: flex;
  gap: 0.75rem;
}

/* ─── POST PAGE NAVIGATION ─── */
.post-pages {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  padding: 1.25rem 1.5rem;
  border-top: 1px solid var(--border-light);
  flex-wrap: wrap;
}
.post-pages .page-btn {
  flex-shrink: 0;
}
.post-pages span { flex: 1; } /* spacer */

.post-page-nums {
  display: flex;
  gap: 0.35rem;
  align-items: center;
}

.post-page-num {
  width: 34px;
  height: 34px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-light);
  background: var(--bg-surface);
  color: var(--text-secondary);
  font-size: 0.85rem;
  font-weight: 600;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s var(--ease-out);
  cursor: pointer;
}
.post-page-num:hover {
  border-color: var(--accent);
  color: var(--accent);
  background: var(--accent-dim);
}
.post-page-num.active {
  background: var(--accent);
  color: #fff;
  border-color: var(--accent);
  cursor: default;
}

.back-link {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  color: var(--text-muted);
  font-size: 0.85rem;
  transition: color 0.2s var(--ease-out);
  margin-bottom: 0.75rem;
  cursor: pointer;
}
.back-link:hover { color: var(--accent); }

/* ═══════════════════════════════════════════════
   PAGINATION
   ═══════════════════════════════════════════════ */
.pagination {
  display: flex;
  justify-content: center;
  padding-top: 0.5rem;
  padding-bottom: 1rem;
}

.page-btn {
  background: var(--bg-surface);
  color: var(--text-primary);
  border: 1px solid var(--border-light);
  padding: 0.6rem 1.5rem;
  border-radius: var(--radius-sm);
  font-weight: 500;
  font-size: 0.9rem;
  transition: all 0.2s var(--ease-out);
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
}
.page-btn:hover {
  background: var(--bg-elevated);
  border-color: var(--accent);
  color: var(--accent);
  transform: translateY(-1px);
}
.page-btn:disabled {
  opacity: 0.35;
  cursor: not-allowed;
  transform: none;
}

/* ═══════════════════════════════════════════════
   STATE: LOADING, EMPTY, ERROR
   ═══════════════════════════════════════════════ */
.state-box {
  background: var(--bg-surface);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-md);
  padding: 3rem 1.5rem;
  text-align: center;
}

.spinner {
  width: 36px;
  height: 36px;
  border: 3px solid var(--bg-elevated);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
  margin: 0 auto 1rem;
}
@keyframes spin { to { transform: rotate(360deg); } }

.state-msg {
  color: var(--text-secondary);
  font-size: 0.95rem;
}
.state-msg strong {
  display: block;
  color: var(--text-primary);
  font-size: 1.1rem;
  margin-bottom: 0.4rem;
}

/* ═══════════════════════════════════════════════
   FLOATING CHAT (MOBILE)
   ═══════════════════════════════════════════════ */
.chat-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.85);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.25s ease, visibility 0.25s ease;
  padding: 1rem;
}
.chat-overlay.active {
  opacity: 1;
  visibility: visible;
}

.chat-modal {
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  width: 100%;
  max-width: 320px;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  box-shadow: 0 16px 48px rgba(0, 0, 0, 0.6);
  transform: scale(0.92) translateY(20px);
  transition: transform 0.3s var(--ease-spring);
}
.chat-overlay.active .chat-modal {
  transform: scale(1) translateY(0);
}

.chat-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.75rem 1rem;
  border-bottom: 1px solid var(--border-light);
  background: var(--bg-elevated);
}
.chat-head span {
  font-weight: 650;
  font-size: 0.9rem;
}

.chat-close {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-secondary);
  font-size: 1.3rem;
  transition: all 0.2s var(--ease-out);
}
.chat-close:hover {
  background: var(--bg-hover);
  color: var(--text-primary);
}

.chat-body {
  background: var(--bg-inset);
  height: 360px;
  display: flex;
  align-items: center;
  justify-content: center;
}
.chat-body iframe {
  width: 100% !important;
  height: 100% !important;
  border: none;
}

.chat-float {
  position: fixed;
  bottom: 1.5rem;
  right: 1.5rem;
  z-index: 999;
  width: 54px;
  height: 54px;
  border-radius: 50%;
  background: var(--accent);
  color: #fff;
  display: none;
  align-items: center;
  justify-content: center;
  font-size: 1.4rem;
  box-shadow: 0 4px 20px var(--accent-glow);
  transition: all 0.25s var(--ease-spring);
}
.chat-float:hover {
  transform: scale(1.08);
  box-shadow: 0 6px 28px var(--accent-glow);
}
.chat-float:active {
  transform: scale(0.95);
}

/* ═══════════════════════════════════════════════
   FOOTER
   ═══════════════════════════════════════════════ */
.footer {
  background: var(--bg-surface);
  border-top: 1px solid var(--border-light);
  padding: 1.5rem;
  text-align: center;
  color: var(--text-muted);
  font-size: 0.85rem;
  margin-top: auto;
}

/* ═══════════════════════════════════════════════
   SPOILER — +teks+ → efek partikel
   ═══════════════════════════════════════════════ */
.spoiler {
  position: relative;
  display: inline-block;
  cursor: pointer;
  border-radius: 4px;
  overflow: hidden;
  background: var(--bg-elevated);
  padding: 0 4px;
  vertical-align: middle;
  line-height: inherit;
  transition: background 0.3s ease;
}
.spoiler:hover {
  background: var(--bg-hover);
}

.spoiler-content {
  display: inline;
  filter: blur(5px);
  opacity: 0.35;
  transition: filter 0.45s ease, opacity 0.45s ease;
  user-select: none;
  -webkit-user-select: none;
}
.spoiler-content.revealed {
  filter: none;
  opacity: 1;
  user-select: auto;
  -webkit-user-select: auto;
}

.spoiler-overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  border-radius: 4px;
}

/* ─── Spoiler preview (card, non-interaktif) ─── */
.spoiler.is-preview {
  cursor: default;
  pointer-events: none;
  background: var(--bg-elevated);
}
.spoiler.is-preview:hover {
  background: var(--bg-elevated);
}
.spoiler.is-preview::after {
  content: '';
  position: absolute;
  inset: 0;
  pointer-events: none;
  border-radius: 4px;
  background-image:
    radial-gradient(1.5px circle at 20% 30%, var(--accent) 50%, transparent 50%),
    radial-gradient(1.2px circle at 60% 15%, #58a6ff 50%, transparent 50%),
    radial-gradient(1px circle at 85% 45%, #bf4b8a 50%, transparent 50%),
    radial-gradient(1.4px circle at 40% 70%, #7ee787 50%, transparent 50%),
    radial-gradient(1.1px circle at 10% 80%, #d29922 50%, transparent 50%),
    radial-gradient(1.3px circle at 75% 80%, #79c0ff 50%, transparent 50%),
    radial-gradient(1px circle at 50% 50%, #ff7b72 50%, transparent 50%),
    radial-gradient(1.2px circle at 30% 40%, #a5d6ff 50%, transparent 50%);
  opacity: 0.7;
}

/* ═══════════════════════════════════════════════
   SCROLL ANIMATIONS — card fade in
   ═══════════════════════════════════════════════ */
.anim-fade {
  opacity: 0;
  transform: translateY(24px);
  transition: opacity 0.5s var(--ease-out), transform 0.5s var(--ease-out);
}
.anim-fade.visible {
  opacity: 1;
  transform: translateY(0);
}

/* ─── Page transition ─── */
#postContainer {
  transition: opacity 0.3s ease;
}

/* ═══════════════════════════════════════════════
   BACK-TO-TOP
   ═══════════════════════════════════════════════ */
.scroll-top {
  position: fixed;
  bottom: 5rem;
  right: 1.5rem;
  z-index: 998;
  width: 42px;
  height: 42px;
  border-radius: 50%;
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  color: var(--text-secondary);
  font-size: 1rem;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 16px rgba(0,0,0,0.35);
  transform: translateY(80px);
  opacity: 0;
  transition: all 0.3s var(--ease-spring);
  cursor: pointer;
  pointer-events: none;
}
.scroll-top.visible {
  transform: translateY(0);
  opacity: 1;
  pointer-events: auto;
}
.scroll-top:hover {
  background: var(--bg-hover);
  border-color: var(--accent);
  color: var(--accent);
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(0,0,0,0.4);
}

/* ═══════════════════════════════════════════════
   LIGHTBOX
   ═══════════════════════════════════════════════ */
.lightbox {
  position: fixed;
  inset: 0;
  z-index: 2000;
  background: rgba(0, 0, 0, 0.92);
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.25s ease, visibility 0.25s ease;
  padding: 1rem;
  user-select: none;
  -webkit-user-select: none;
}
.lightbox.active {
  opacity: 1;
  visibility: visible;
}

.lightbox-body {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: 100%;
  cursor: zoom-out;
}

.lightbox-img {
  max-width: 100%;
  max-height: 90vh;
  object-fit: contain;
  border-radius: var(--radius-sm);
  box-shadow: 0 8px 40px rgba(0, 0, 0, 0.6);
  opacity: 0;
  transform: scale(0.92);
  transition: opacity 0.3s var(--ease-out), transform 0.3s var(--ease-spring);
}
.lightbox.active .lightbox-img {
  opacity: 1;
  transform: scale(1);
}

.lightbox-close {
  position: fixed;
  top: 1rem;
  right: 1rem;
  z-index: 2001;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: rgba(0, 0, 0, 0.5);
  color: #fff;
  font-size: 1.5rem;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 1px solid rgba(255,255,255,0.15);
  transition: all 0.2s var(--ease-out);
  cursor: pointer;
}
.lightbox-close:hover {
  background: rgba(255,255,255,0.15);
  transform: scale(1.1);
}

.lightbox-prev,
.lightbox-next {
  position: fixed;
  top: 50%;
  transform: translateY(-50%);
  z-index: 2001;
  width: 44px;
  height: 64px;
  border-radius: var(--radius-sm);
  background: rgba(0, 0, 0, 0.45);
  color: #fff;
  font-size: 1.8rem;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 1px solid rgba(255,255,255,0.1);
  transition: all 0.2s var(--ease-out);
  cursor: pointer;
}
.lightbox-prev { left: 0.75rem; }
.lightbox-next { right: 0.75rem; }
.lightbox-prev:hover,
.lightbox-next:hover {
  background: rgba(255,255,255,0.15);
}

.lightbox-counter {
  position: fixed;
  bottom: 1.25rem;
  left: 50%;
  transform: translateX(-50%);
  z-index: 2001;
  color: rgba(255,255,255,0.6);
  font-size: 0.85rem;
  font-weight: 600;
  background: rgba(0, 0, 0, 0.5);
  padding: 0.35rem 0.8rem;
  border-radius: var(--radius-full);
  border: 1px solid rgba(255,255,255,0.1);
}

@media (max-width: 767px) {
  .lightbox {
    padding: 0;
  }
  .lightbox-close {
    top: 0.5rem;
    right: 0.5rem;
    width: 36px;
    height: 36px;
    font-size: 1.3rem;
  }
  .lightbox-prev,
  .lightbox-next {
    width: 36px;
    height: 50px;
    font-size: 1.4rem;
  }
  .lightbox-prev { left: 0.25rem; }
  .lightbox-next { right: 0.25rem; }
}

/* ═══════════════════════════════════════════════
   UTILITY
   ═══════════════════════════════════════════════ */
.hidden { display: none !important; }

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

/* ═══════════════════════════════════════════════════════════════
   RESPONSIF: TABLET (768px–1023px)
   ═══════════════════════════════════════════════════════════════ */
@media (max-width: 1023px) {
  .sidebar {
    display: none !important;
  }
  .chat-float {
    display: flex !important;
  }
  .banner-title {
    font-size: 1.3rem;
  }
  .banner-img {
    min-height: 160px;
    max-height: 260px;
  }
  .layout {
    padding: 1rem var(--space) 2rem;
  }
}

/* ═══════════════════════════════════════════════════════════════
   RESPONSIF: MOBILE (<768px)
   ═══════════════════════════════════════════════════════════════ */
@media (max-width: 767px) {
  :root {
    --header-h: 56px;
    --space: 1rem;
  }

  .header {
    height: var(--header-h);
  }
  .header-inner {
    gap: 0.6rem;
  }

  .logo {
    font-size: 1.1rem;
  }

  .search-box {
    max-width: 100%;
  }

  .banner {
    margin: 1rem auto 0;
    border-radius: 0;
  }
  .banner-title {
    font-size: 1.1rem;
    padding: 0.4rem 0.8rem;
  }
  .banner-overlay {
    padding: 1rem;
  }

  .layout {
    flex-direction: column;
    gap: 0;
    padding: 0.75rem 0 1.5rem;
  }
  .container {
    padding: 0 var(--space);
  }

  .article-card {
    border-radius: 0;
    border-left: none;
    border-right: none;
    margin-bottom: 0.75rem;
  }
  .card-head { padding: 1rem 1rem 0; }
  .card-title { font-size: 1.05rem; }
  .card-thumb-wrap { margin: 0 1rem 0.5rem; }
  .card-thumb { height: 160px; }
  .card-excerpt { padding: 0 1rem 0.5rem; font-size: 0.85rem; }
  .card-foot { padding: 0 1rem 1rem; }

  .article-full { border-radius: 0; border-left: none; border-right: none; }
  .full-head { padding: 1rem 1rem 0.75rem; }
  .full-title { font-size: 1.3rem; }
  .full-meta { font-size: 0.8rem; }
  .full-body { padding: 1rem; font-size: 0.95rem; }
  .post-pages {
    padding: 1rem;
    gap: 0.4rem;
    justify-content: center;
  }
  .post-pages .page-btn {
    font-size: 0.8rem;
    padding: 0.5rem 1rem;
  }
  .post-page-num {
    width: 30px;
    height: 30px;
    font-size: 0.8rem;
  }
  .full-share-top {
    padding: 0.5rem 0 0;
  }

  .chat-float {
    width: 48px;
    height: 48px;
    font-size: 1.2rem;
    bottom: 1rem;
    right: 1rem;
  }

  .chat-modal { max-width: 100%; margin: 0.5rem; border-radius: var(--radius-md); }
  .chat-body { height: 320px; }

  .pagination { padding-bottom: 0.5rem; }

  .state-box { border-radius: 0; border-left: none; border-right: none; }
}

/* ═══════════════════════════════════════════════════════════════
   RESPONSIF: DESKTOP (>=1024px)
   ═══════════════════════════════════════════════════════════════ */
@media (min-width: 1024px) {
  .chat-float { display: none !important; }
  .chat-overlay { display: none !important; }

  .banner-title { font-size: 1.8rem; }
  .full-title { font-size: 1.85rem; }
  .card-thumb { height: 220px; }
  .card-title { font-size: 1.25rem; }
}
