/* ═══════════════════════════════════════════════════════════
   0p5cur — Dark Cyber Theme
   ═══════════════════════════════════════════════════════════ */

:root {
  --bg:          #0a0e1a;
  --bg2:         #0d1320;
  --bg3:         #111827;
  --bg4:         #1a2235;
  --border:      #1e2d4a;
  --border2:     #2a3f5f;
  --green:       #00ff88;
  --green2:      #00cc6a;
  --cyan:        #00d4ff;
  --cyan2:       #00aacc;
  --purple:      #8b5cf6;
  --red:         #ff4757;
  --orange:      #ffa502;
  --yellow:      #ffd32a;
  --text:        #e2e8f0;
  --text2:       #94a3b8;
  --text3:       #64748b;
  --font:        'JetBrains Mono', 'Fira Code', 'Cascadia Code', monospace;
  --font-sans:   'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  --radius:      8px;
  --radius2:     12px;
  --shadow:      0 4px 24px rgba(0,0,0,.4);
  --glow-green:  0 0 20px rgba(0,255,136,.15);
  --glow-cyan:   0 0 20px rgba(0,212,255,.15);
  --transition:  0.2s ease;
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; font-size: 16px; }
body {
  font-family: var(--font-sans);
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
}

::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: var(--bg2); }
::-webkit-scrollbar-thumb { background: var(--border2); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: var(--green); }
::selection { background: rgba(0,255,136,.2); color: var(--green); }
a { color: var(--cyan); text-decoration: none; transition: color var(--transition); }
a:hover { color: var(--green); }

/* ─── NAV ───────────────────────────────────────────────── */
.nav {
  position: sticky; top: 0; z-index: 100;
  background: rgba(10,14,26,.95);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
  height: 60px;
}
.nav-inner {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 2rem;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 1.75rem;
}
.nav-brand {
  display: flex; align-items: center;
  font-family: var(--font);
  font-size: 1.05rem; font-weight: 700;
  color: var(--text); text-decoration: none;
  white-space: nowrap; flex-shrink: 0;
}
.nav-brand .bracket { color: var(--green); }
.nav-brand .at { color: var(--cyan); }
.nav-links { display: flex; align-items: center; gap: 1rem; flex-shrink: 0; }
.nav-links a {
  color: var(--text2); font-size: .875rem; font-weight: 500;
  padding: .25rem .5rem; border-radius: var(--radius);
  transition: all var(--transition); white-space: nowrap;
}
.nav-links a:hover { color: var(--green); background: rgba(0,255,136,.08); }
.nav-links a.active { color: var(--green); }

/* Nav inline search */
.nav-search { position: relative; flex: 0 0 340px; }
.nav-search input {
  width: 100%;
  background: var(--bg3);
  border: 1px solid var(--border);
  color: var(--text);
  padding: .38rem .85rem .38rem 2rem;
  border-radius: 20px;
  font-size: .8rem; outline: none;
  transition: border-color var(--transition), box-shadow var(--transition);
  font-family: var(--font-sans);
}
.nav-search input::placeholder { color: var(--text3); }
.nav-search input:focus { border-color: var(--green); box-shadow: 0 0 0 3px rgba(0,255,136,.08); }
.nav-search .nav-search-icon {
  position: absolute; left: .65rem; top: 50%;
  transform: translateY(-50%);
  color: var(--text3); pointer-events: none;
}

/* ─── FILTERS (category + difficulty chips only, no search) ── */
.filters {
  padding: .65rem 2rem;
  background: var(--bg2);
  border-bottom: 1px solid var(--border);
}
.filters-inner {
  max-width: 1200px;
  margin: 0 auto;
  display: flex;
  flex-wrap: wrap;
  gap: .5rem;
  align-items: center;
}
.filter-chips { display: flex; flex-wrap: wrap; gap: .4rem; }
.chip {
  padding: .25rem .65rem; border-radius: 20px; font-size: .72rem; font-weight: 600;
  border: 1px solid var(--border); background: var(--bg3); color: var(--text2);
  cursor: pointer; transition: all var(--transition); white-space: nowrap;
}
.chip:hover { border-color: var(--green); color: var(--green); }
.chip.active { background: rgba(0,255,136,.1); border-color: var(--green); color: var(--green); }

/* ─── HERO ──────────────────────────────────────────────── */
.hero {
  min-height: calc(100vh - 60px);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 4rem 2rem 3rem;
  position: relative; overflow: hidden;
}
.hero::before {
  content: ''; position: absolute; inset: 0;
  background: radial-gradient(ellipse 80% 50% at 50% 50%, rgba(0,255,136,.06) 0%, transparent 70%);
  pointer-events: none;
}
.hero-terminal {
  display: inline-flex; align-items: center; gap: .5rem;
  background: var(--bg3); border: 1px solid var(--border);
  border-radius: 20px; padding: .35rem 1rem;
  font-family: var(--font); font-size: .8rem; color: var(--green);
  margin-bottom: 2rem;
}
.hero-terminal .dot { width: 6px; height: 6px; border-radius: 50%; background: var(--green); animation: pulse 2s infinite; }
@keyframes pulse { 0%,100%{opacity:1} 50%{opacity:.3} }
.hero h1 { font-size: clamp(2rem, 5vw, 3.5rem); font-weight: 800; line-height: 1.2; margin-bottom: 1rem; letter-spacing: -.02em; }
.hero h1 .highlight { color: var(--green); }
.hero p { font-size: 1.125rem; color: var(--text2); max-width: 600px; margin: 0 auto 2.5rem; }

.stats-bar { display: flex; justify-content: center; gap: 3rem; margin-bottom: 3rem; }
.stat { text-align: center; }
.stat-num { display: block; font-family: var(--font); font-size: 1.75rem; font-weight: 700; color: var(--green); }
.stat-label { font-size: .75rem; color: var(--text3); text-transform: uppercase; letter-spacing: .08em; }

/* Scroll down arrow */
.hero-scroll {
  position: absolute;
  bottom: 2rem; left: 50%;
  transform: translateX(-50%);
  display: flex; flex-direction: column; align-items: center; gap: .35rem;
  color: var(--text3); font-size: .7rem; text-transform: uppercase; letter-spacing: .1em;
  cursor: pointer; transition: color var(--transition);
  animation: bounce 2.5s ease-in-out infinite;
}
.hero-scroll:hover { color: var(--green); }
.hero-scroll svg { display: block; }
@keyframes bounce {
  0%, 100% { transform: translateX(-50%) translateY(0); }
  50%       { transform: translateX(-50%) translateY(6px); }
}

/* ─── BACK TO TOP (homepage) ────────────────────────────── */
.back-top-home {
  position: fixed; bottom: 2rem; right: 2rem;
  background: var(--bg3); border: 1px solid var(--border);
  color: var(--text2); border-radius: 50%;
  width: 42px; height: 42px;
  display: flex; align-items: center; justify-content: center;
  cursor: pointer; font-size: 1.1rem;
  opacity: 0; pointer-events: none;
  transition: all .25s;
  box-shadow: var(--shadow); z-index: 50;
}
.back-top-home.visible { opacity: 1; pointer-events: auto; }
.back-top-home:hover { border-color: var(--green); color: var(--green); transform: translateY(-2px); }
#go-bottom { bottom: 2rem; }
#back-top { bottom: 5rem; }
.main-content { max-width: 1400px; margin: 0 auto; padding: 2.5rem 2rem; }
.posts-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 1.5rem; }
.posts-header h2 { font-size: 1.1rem; color: var(--text2); font-weight: 500; }
.posts-header span { font-family: var(--font); color: var(--green); font-weight: 700; }

.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(340px, 1fr)); gap: 1.25rem; }

/* ─── CARD ──────────────────────────────────────────────── */
.card {
  background: var(--bg2); border: 1px solid var(--border);
  border-radius: var(--radius2); padding: 1.5rem;
  transition: all var(--transition); cursor: pointer;
  display: flex; flex-direction: column; gap: .75rem;
  position: relative; overflow: hidden;
}
.card::before {
  content: ''; position: absolute; inset: 0; opacity: 0;
  transition: opacity var(--transition);
  background: linear-gradient(135deg, rgba(0,255,136,.04) 0%, transparent 60%);
  border-radius: inherit;
}
.card:hover { border-color: var(--border2); transform: translateY(-2px); box-shadow: var(--shadow), var(--glow-green); }
.card:hover::before { opacity: 1; }
.card-header { display: flex; justify-content: space-between; align-items: flex-start; gap: .5rem; }
.card-category {
  font-size: .7rem; font-weight: 700; text-transform: uppercase; letter-spacing: .1em;
  padding: .2rem .6rem; border-radius: 4px;
  background: rgba(0,255,136,.1); color: var(--green); border: 1px solid rgba(0,255,136,.2);
}
.card-category.htb  { background: rgba(159,239,0,.1);  color: #9fef00; border-color: rgba(159,239,0,.2); }
.card-category.article { background: rgba(255,165,0,.1); color: #ffa500; border-color: rgba(255,165,0,.2); }
.card-category.ctf  { background: rgba(0,212,255,.1);  color: var(--cyan); border-color: rgba(0,212,255,.2); }
.card-category.thm  { background: rgba(255,68,68,.1);  color: #ff4444; border-color: rgba(255,68,68,.2); }
.card-category.pwn  { background: rgba(139,92,246,.1); color: var(--purple); border-color: rgba(139,92,246,.2); }
.card-diff { display: flex; align-items: center; gap: 4px; font-size: .7rem; font-weight: 600; }
.diff-easy   { color: #2ed573; }
.diff-medium { color: var(--orange); }
.diff-hard   { color: var(--red); }
.diff-insane { color: var(--purple); }
.card-title { font-size: 1.1rem; font-weight: 700; color: var(--text); line-height: 1.3; transition: color var(--transition); }
.card:hover .card-title { color: var(--green); }
.card-desc { font-size: .85rem; color: var(--text2); line-height: 1.5; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.card-tags { display: flex; flex-wrap: wrap; gap: .4rem; }
.tag {
  font-size: .7rem; padding: .15rem .5rem; border-radius: 4px;
  background: var(--bg4); color: var(--text3); border: 1px solid var(--border);
  font-family: var(--font); transition: all var(--transition);
}
.tag:hover { color: var(--cyan); border-color: var(--cyan); cursor: pointer; }
.card-footer { display: flex; justify-content: space-between; align-items: center; padding-top: .75rem; border-top: 1px solid var(--border); margin-top: auto; }
.card-date { font-size: .75rem; color: var(--text3); font-family: var(--font); }
.card-platform { font-size: .7rem; font-weight: 600; color: var(--text3); display: flex; align-items: center; gap: .3rem; }
.card-lock { font-size: .8rem; color: var(--orange); }
.card-stat { font-size: .72rem; color: var(--text3); display: flex; align-items: center; gap: .2rem; }
.read-more { font-size: .75rem; font-weight: 600; color: var(--cyan); display: flex; align-items: center; gap: .25rem; transition: gap var(--transition); }
.card:hover .read-more { gap: .5rem; color: var(--green); }

/* ─── PAGINATION ────────────────────────────────────────── */
.pagination { display: flex; justify-content: center; gap: .5rem; margin-top: 2.5rem; }
.page-btn { padding: .5rem .875rem; border-radius: var(--radius); background: var(--bg3); border: 1px solid var(--border); color: var(--text2); cursor: pointer; font-size: .875rem; transition: all var(--transition); }
.page-btn:hover { border-color: var(--green); color: var(--green); }
.page-btn.active { background: rgba(0,255,136,.1); border-color: var(--green); color: var(--green); }
.page-btn:disabled { opacity: .4; cursor: not-allowed; }

/* ─── EMPTY ─────────────────────────────────────────────── */
.empty { grid-column: 1/-1; text-align: center; padding: 5rem 2rem; color: var(--text3); }
.empty .icon { font-size: 3rem; margin-bottom: 1rem; display: block; }
.empty h3 { font-size: 1.25rem; color: var(--text2); margin-bottom: .5rem; }

/* ─── SIDEBAR ───────────────────────────────────────────── */
.layout {
  display: grid; grid-template-columns: 1fr 280px;
  gap: 2rem; max-width: 1400px; margin: 0 auto;
  padding: 2rem 2rem; align-items: start;
}
@media(max-width:900px){ .layout { grid-template-columns:1fr; } .sidebar { display:none; } }
.sidebar { position: sticky; top: 80px; display: flex; flex-direction: column; gap: 1.25rem; }
.sidebar-card { background: var(--bg2); border: 1px solid var(--border); border-radius: var(--radius2); padding: 1.25rem; }
.sidebar-title { font-size: .75rem; font-weight: 700; text-transform: uppercase; letter-spacing: .1em; color: var(--text3); margin-bottom: 1rem; display: flex; align-items: center; gap: .5rem; }
.sidebar-title::before { content: ''; display: block; width: 12px; height: 2px; background: var(--green); }
.tags-cloud { display: flex; flex-wrap: wrap; gap: .4rem; }
.tag-cloud-item { font-size: .75rem; padding: .25rem .6rem; border-radius: 4px; background: var(--bg3); border: 1px solid var(--border); color: var(--text3); cursor: pointer; transition: all var(--transition); font-family: var(--font); }
.tag-cloud-item:hover { border-color: var(--cyan); color: var(--cyan); }
.tag-cloud-item.active { background: rgba(0,212,255,.1); border-color: var(--cyan); color: var(--cyan); }
.tag-count { color: var(--text3); margin-left: .25rem; font-size: .65rem; }
.cat-list { display: flex; flex-direction: column; gap: .35rem; }
.cat-item { display: flex; justify-content: space-between; align-items: center; padding: .4rem .6rem; border-radius: var(--radius); cursor: pointer; transition: all var(--transition); font-size: .875rem; }
.cat-item:hover { background: var(--bg3); color: var(--green); }
.cat-item.active { background: rgba(0,255,136,.08); color: var(--green); }
.cat-count { font-family: var(--font); font-size: .7rem; background: var(--bg4); color: var(--text3); padding: .1rem .4rem; border-radius: 4px; }

/* Difficulty chips in sidebar */
.diff-chips-sidebar { display: flex; flex-direction: column; gap: .35rem; }
.diff-chips-sidebar .chip {
  width: 100%; text-align: left; border-radius: var(--radius); padding: .4rem .6rem; font-size: .8rem;
}

/* ═══════════════════════════════════════════════════════════
   POST PAGE
   ═══════════════════════════════════════════════════════════ */
.post-reading-bar {
  position: fixed; top: 0; left: 0; z-index: 200;
  height: 3px; background: linear-gradient(90deg, var(--green), var(--cyan));
  width: 0%; transition: width .1s linear; pointer-events: none;
}

.post-hero { padding: 3rem 2rem 2rem; max-width: 1200px; margin: 0 auto; }
.post-breadcrumb { font-size: .8rem; color: var(--text3); margin-bottom: 1.5rem; display: flex; align-items: center; gap: .5rem; }
.post-breadcrumb a { color: var(--text3); }
.post-breadcrumb a:hover { color: var(--green); }
.post-meta-top { display: flex; flex-wrap: wrap; gap: .75rem; align-items: center; margin-bottom: 1.25rem; }
.post-title { font-size: clamp(1.75rem, 4vw, 2.75rem); font-weight: 800; line-height: 1.2; letter-spacing: -.02em; margin-bottom: 1rem; }
.post-description { font-size: 1.1rem; color: var(--text2); margin-bottom: 1.5rem; line-height: 1.6; }
.post-info-bar {
  display: flex; flex-wrap: wrap; gap: 1.5rem;
  padding: 1rem 1.25rem; background: var(--bg2);
  border: 1px solid var(--border); border-radius: var(--radius2);
  margin-bottom: 2rem; font-size: .85rem;
}
.post-info-item { display: flex; align-items: center; gap: .4rem; color: var(--text2); }
.post-info-item strong { color: var(--text); }

/* ─── POST CONTENT LAYOUT (sticky TOC left) ─────────────── */
.post-content-layout {
  display: flex;
  gap: 0;
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 0 6rem;
  align-items: flex-start;
}

/* Left TOC sidebar */
.post-toc-sidebar {
  width: 260px;
  min-width: 260px;
  position: sticky;
  top: 72px; /* below navbar */
  max-height: calc(100vh - 90px);
  overflow-y: auto;
  padding: 0 1.5rem 2rem 2rem;
  flex-shrink: 0;
}
.post-toc-sidebar::-webkit-scrollbar { width: 3px; }
.post-toc-sidebar::-webkit-scrollbar-thumb { background: var(--border2); }

.toc-sticky {}
.toc-header {
  font-size: .7rem; font-weight: 700;
  text-transform: uppercase; letter-spacing: .1em;
  color: var(--green); margin-bottom: .75rem;
  display: flex; align-items: center; gap: .5rem;
  padding-bottom: .5rem;
  border-bottom: 1px solid var(--border);
}
.toc-header::before { content: ''; display: block; width: 10px; height: 2px; background: var(--green); }

.toc-list { list-style: none; display: flex; flex-direction: column; gap: 0; }
.toc-list li a {
  font-size: .8rem; color: var(--text3);
  display: block; padding: .25rem .5rem;
  transition: all var(--transition);
  border-radius: 4px;
  border-left: 2px solid transparent;
  line-height: 1.4;
}
.toc-list li a:hover { color: var(--text2); border-left-color: var(--border2); background: rgba(255,255,255,.02); }
.toc-list li.toc-h3 > a { padding-left: 1.25rem; font-size: .77rem; }
.toc-list li.toc-h4 > a { padding-left: 2rem; font-size: .74rem; }
.toc-list li.toc-active > a { color: var(--green); border-left-color: var(--green); background: rgba(0,255,136,.05); }

/* Main content */
.post-main {
  flex: 1;
  min-width: 0;
  padding: 0 2rem 0 1.5rem;
  border-left: 1px solid var(--border);
}

@media(max-width: 900px) {
  .post-content-layout { flex-direction: column; }
  .post-toc-sidebar { display: none !important; }
  .post-main { padding: 0 1rem; border-left: none; }
  .post-hero { padding: 1.5rem 1rem 1rem; }
  .nav-inner { padding: 0 .5rem; gap: .75rem; }
}

/* Share / nav */
.share-bar {
  display: flex; gap: .6rem; flex-wrap: wrap;
  margin-top: 2rem; padding-top: 1.5rem;
  border-top: 1px solid var(--border);
  align-items: center;
}
.share-bar-label { font-size: .72rem; font-weight: 700; color: var(--text3); text-transform: uppercase; letter-spacing: .1em; margin-right: .25rem; }
.share-btn {
  display: inline-flex; align-items: center; gap: .4rem;
  padding: .35rem .8rem; border-radius: 20px; font-size: .78rem; font-weight: 600;
  border: 1px solid var(--border); background: var(--bg3); color: var(--text2);
  cursor: pointer; transition: all var(--transition); text-decoration: none;
}
.share-btn:hover { transform: translateY(-1px); }
.share-btn.twitter  { --c: #1d9bf0; }
.share-btn.discord  { --c: #5865f2; }
.share-btn.whatsapp { --c: #25d366; }
.share-btn.linkedin { --c: #0077b5; }
.share-btn.telegram { --c: #229ED9; }
.share-btn.copy     { --c: var(--cyan); }
.share-btn:hover { border-color: var(--c); color: var(--c); box-shadow: 0 0 12px rgba(0,0,0,.2); }

/* Like button */
.like-btn {
  display: inline-flex; align-items: center; gap: .45rem;
  padding: .35rem .9rem; border-radius: 20px; font-size: .85rem; font-weight: 700;
  border: 1px solid var(--border); background: var(--bg3); color: var(--text2);
  cursor: pointer; transition: all .2s; user-select: none;
  margin-left: auto;
}
.like-btn:hover { border-color: var(--red); color: var(--red); transform: scale(1.04); }
.like-btn.liked { background: rgba(255,71,87,.1); border-color: var(--red); color: var(--red); }
.like-btn .heart { transition: transform .15s; font-size: 1rem; display: inline-block; }
.like-btn:active .heart { transform: scale(1.4); }
.like-btn.liked .heart { animation: heartpop .25s ease; }
@keyframes heartpop { 0%{transform:scale(1)} 50%{transform:scale(1.5)} 100%{transform:scale(1)} }

/* Views and likes in info bar */
.stat-pill {
  display: inline-flex; align-items: center; gap: .3rem;
  font-size: .78rem; color: var(--text3);
}
.post-nav { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; margin-top: 2rem; padding-top: 2rem; border-top: 1px solid var(--border); }
.post-nav-item { background: var(--bg2); border: 1px solid var(--border); border-radius: var(--radius2); padding: 1rem 1.25rem; display: flex; flex-direction: column; gap: .35rem; transition: all var(--transition); }
.post-nav-item:hover { border-color: var(--green); box-shadow: var(--glow-green); }
.post-nav-item.next { text-align: right; }
.post-nav-label { font-size: .7rem; color: var(--text3); text-transform: uppercase; letter-spacing: .08em; }
.post-nav-title { font-size: .9rem; font-weight: 600; color: var(--text); }

/* ─── BACK TO TOP ───────────────────────────────────────── */
.back-top {
  position: fixed; bottom: 2rem; right: 2rem;
  background: var(--bg3); border: 1px solid var(--border);
  color: var(--text2); border-radius: 50%;
  width: 42px; height: 42px;
  display: flex; align-items: center; justify-content: center;
  cursor: pointer; font-size: 1.1rem;
  opacity: 0; pointer-events: none;
  transition: opacity .3s, border-color .2s, color .2s, transform .2s;
  box-shadow: var(--shadow); z-index: 50;
}
.back-top.visible { opacity: 1; pointer-events: auto; }
.back-top:hover { border-color: var(--green); color: var(--green); transform: translateY(-2px); }

/* ─── PASSWORD LOCK OVERLAY ─────────────────────────────── */
#lock-overlay {
  position: fixed; inset: 0; z-index: 500;
  background: rgba(10,14,26,.97);
  backdrop-filter: blur(8px);
  display: flex; align-items: center; justify-content: center;
}
.lock-card {
  background: var(--bg2); border: 1px solid var(--border);
  border-radius: var(--radius2); padding: 2.5rem;
  width: 400px; max-width: 95vw;
  box-shadow: var(--shadow), 0 0 60px rgba(0,0,0,.5);
  text-align: center;
}
.lock-icon { font-size: 3rem; margin-bottom: 1rem; display: block; }
.lock-card h2 { font-size: 1.5rem; margin-bottom: .5rem; }
.lock-meta { display: flex; flex-wrap: wrap; gap: .5rem; justify-content: center; margin-bottom: 1.5rem; }

/* ─── MARKDOWN BODY ─────────────────────────────────────── */
.markdown-body { font-size: 1rem; line-height: 1.8; color: var(--text); }
.markdown-body h1,.markdown-body h2,.markdown-body h3,
.markdown-body h4,.markdown-body h5,.markdown-body h6 {
  font-weight: 700; line-height: 1.3; scroll-margin-top: 80px; position: relative;
}
.markdown-body h1 { font-size: 2rem; margin: 2.5rem 0 1rem; border-bottom: 2px solid var(--border); padding-bottom: .5rem; }
.markdown-body h2 { font-size: 1.5rem; margin: 2rem 0 .75rem; color: var(--green); }
.markdown-body h2::before { content: '## '; color: var(--border2); font-family: var(--font); font-size: .9em; }
.markdown-body h3 { font-size: 1.2rem; margin: 1.5rem 0 .6rem; color: var(--cyan); }
.markdown-body h3::before { content: '### '; color: var(--border2); font-family: var(--font); font-size: .85em; }
.markdown-body h4 { font-size: 1rem; margin: 1.25rem 0 .5rem; }
.markdown-body p { margin-bottom: 1.2rem; }
.markdown-body ul,.markdown-body ol { padding-left: 1.75rem; margin-bottom: 1.2rem; }
.markdown-body li { margin-bottom: .35rem; }
.markdown-body ul li::marker { color: var(--green); }
.markdown-body ol li::marker { color: var(--cyan); font-weight: 700; }
.markdown-body blockquote { border-left: 3px solid var(--cyan); background: rgba(0,212,255,.05); padding: .75rem 1.25rem; margin: 1.5rem 0; border-radius: 0 var(--radius) var(--radius) 0; color: var(--text2); font-style: italic; }
.markdown-body hr { border: none; height: 1px; background: linear-gradient(90deg, transparent, var(--border2), transparent); margin: 2rem 0; }
.markdown-body strong { color: var(--text); font-weight: 700; }
.markdown-body em { color: var(--text2); }
.markdown-body mark { background: rgba(255,211,42,.2); color: var(--yellow); padding: .1em .3em; border-radius: 3px; }
.markdown-body kbd { font-family: var(--font); font-size: .8em; background: var(--bg4); border: 1px solid var(--border2); border-bottom: 2px solid var(--border2); padding: .1em .4em; border-radius: 4px; }
.markdown-body a { color: var(--cyan); border-bottom: 1px solid rgba(0,212,255,.3); }
.markdown-body a:hover { color: var(--green); border-bottom-color: rgba(0,255,136,.3); }
.markdown-body :not(pre) > code { font-family: var(--font); font-size: .85em; background: var(--bg3); border: 1px solid var(--border); color: var(--green); padding: .15em .4em; border-radius: 4px; }

/* Code blocks */
.code-block { position: relative; margin: 1.5rem 0; border-radius: var(--radius2); overflow: hidden; border: 1px solid var(--border); background: var(--bg2); }
.code-header { display: flex; justify-content: space-between; align-items: center; padding: .5rem 1rem; background: var(--bg3); border-bottom: 1px solid var(--border); }
.code-lang { font-family: var(--font); font-size: .7rem; font-weight: 700; text-transform: uppercase; letter-spacing: .08em; color: var(--cyan); }
.copy-btn { display: flex; align-items: center; gap: .35rem; font-size: .7rem; font-weight: 600; color: var(--text3); background: none; border: 1px solid transparent; padding: .2rem .6rem; border-radius: 4px; cursor: pointer; transition: all var(--transition); font-family: var(--font); }
.copy-btn:hover { color: var(--green); border-color: rgba(0,255,136,.3); background: rgba(0,255,136,.05); }
.copy-btn.copied { color: var(--green); border-color: rgba(0,255,136,.4); }
.code-block pre { margin: 0; padding: 1.25rem; overflow-x: auto; background: transparent !important; font-family: var(--font); font-size: .875rem; line-height: 1.7; white-space: pre-wrap; word-break: break-all; overflow-wrap: anywhere; }
.code-block code { background: none !important; border: none !important; padding: 0 !important; white-space: pre-wrap; word-break: break-all; overflow-wrap: anywhere; }

/* Images */
.markdown-body img { max-width: 100%; border-radius: var(--radius2); border: 1px solid var(--border); margin: 1.5rem 0; display: block; cursor: zoom-in; }
.img-modal { position: fixed; inset: 0; z-index: 1000; background: rgba(0,0,0,.9); display: flex; align-items: center; justify-content: center; cursor: zoom-out; }
.img-modal img { max-width: 90vw; max-height: 90vh; border-radius: var(--radius2); }

/* Tables */
.markdown-body table { width: 100%; border-collapse: collapse; margin: 1.5rem 0; font-size: .9rem; border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; }
.markdown-body thead { background: var(--bg3); }
.markdown-body th { padding: .75rem 1rem; text-align: left; font-size: .75rem; text-transform: uppercase; letter-spacing: .06em; color: var(--text3); font-weight: 700; border-bottom: 1px solid var(--border); }
.markdown-body td { padding: .65rem 1rem; border-bottom: 1px solid var(--border); color: var(--text2); }
.markdown-body tr:last-child td { border-bottom: none; }
.markdown-body tr:hover td { background: rgba(255,255,255,.02); }
.markdown-body details { background: var(--bg2); border: 1px solid var(--border); border-radius: var(--radius); margin: 1rem 0; overflow: hidden; }
.markdown-body summary { padding: .75rem 1rem; cursor: pointer; font-weight: 600; color: var(--cyan); user-select: none; list-style: none; display: flex; align-items: center; gap: .5rem; }
.markdown-body summary::before { content: '▶'; font-size: .7rem; transition: transform .2s; }
.markdown-body details[open] summary::before { transform: rotate(90deg); }
.markdown-body details > *:not(summary) { padding: 0 1rem 1rem; }

/* ─── ADMIN ─────────────────────────────────────────────── */
.admin-layout { display: flex; min-height: 100vh; }
.admin-sidebar { width: 240px; min-width: 240px; background: var(--bg2); border-right: 1px solid var(--border); padding: 1.5rem 0; display: flex; flex-direction: column; }
.admin-logo { padding: 0 1.5rem 1.5rem; border-bottom: 1px solid var(--border); margin-bottom: 1rem; font-family: var(--font); font-size: 1rem; font-weight: 700; color: var(--green); }
.admin-logo span { color: var(--text3); font-weight: 400; font-size: .75rem; display: block; }
.admin-nav { flex: 1; }
.admin-nav a { display: flex; align-items: center; gap: .75rem; padding: .6rem 1.5rem; color: var(--text2); font-size: .875rem; transition: all var(--transition); }
.admin-nav a:hover, .admin-nav a.active { color: var(--green); background: rgba(0,255,136,.06); border-right: 2px solid var(--green); }
.admin-main { flex: 1; overflow: auto; }
.admin-header { padding: 1.25rem 2rem; border-bottom: 1px solid var(--border); display: flex; justify-content: space-between; align-items: center; background: var(--bg2); position: sticky; top: 0; z-index: 10; }
.admin-title { font-size: 1.1rem; font-weight: 700; }
.admin-content { padding: 2rem; }
.admin-table { width: 100%; border-collapse: collapse; font-size: .875rem; }
.admin-table th { text-align: left; padding: .65rem 1rem; font-size: .7rem; text-transform: uppercase; letter-spacing: .08em; color: var(--text3); border-bottom: 1px solid var(--border); background: var(--bg3); }
.admin-table td { padding: .75rem 1rem; border-bottom: 1px solid var(--border); color: var(--text2); vertical-align: middle; }
.admin-table tr:hover td { background: rgba(255,255,255,.02); }
.badge { display: inline-block; padding: .15rem .5rem; border-radius: 4px; font-size: .7rem; font-weight: 700; }
.badge-published { background: rgba(0,255,136,.1); color: var(--green); }
.badge-draft     { background: rgba(255,165,0,.1); color: var(--orange); }
.badge-protected { background: rgba(255,71,87,.1); color: var(--red); }

/* ─── BUTTONS ───────────────────────────────────────────── */
.btn { display: inline-flex; align-items: center; gap: .5rem; padding: .6rem 1.25rem; border-radius: var(--radius); font-size: .875rem; font-weight: 600; cursor: pointer; transition: all var(--transition); border: 1px solid transparent; text-decoration: none; }
.btn-primary { background: var(--green); color: var(--bg); border-color: var(--green); }
.btn-primary:hover { background: var(--green2); border-color: var(--green2); transform: translateY(-1px); box-shadow: 0 4px 16px rgba(0,255,136,.3); color: var(--bg); }
.btn-secondary { background: transparent; color: var(--text); border-color: var(--border); }
.btn-secondary:hover { border-color: var(--green); color: var(--green); }
.btn-danger { background: rgba(255,71,87,.1); color: var(--red); border-color: rgba(255,71,87,.3); }
.btn-danger:hover { background: rgba(255,71,87,.2); }
.btn-sm { padding: .35rem .75rem; font-size: .8rem; }

/* ─── FORMS ─────────────────────────────────────────────── */
.form-group { display: flex; flex-direction: column; gap: .4rem; }
.form-group label { font-size: .75rem; font-weight: 600; color: var(--text3); text-transform: uppercase; letter-spacing: .06em; }
.form-group input, .form-group select, .form-group textarea {
  background: var(--bg3); border: 1px solid var(--border);
  color: var(--text); padding: .5rem .75rem;
  border-radius: var(--radius); font-size: .875rem; outline: none;
  transition: border-color var(--transition), box-shadow var(--transition);
  font-family: var(--font-sans);
}
.form-group input:focus, .form-group select:focus, .form-group textarea:focus { border-color: var(--green); box-shadow: var(--glow-green); }
.form-group select option { background: var(--bg3); }

/* ─── LOGIN ─────────────────────────────────────────────── */
.login-page { min-height: 100vh; display: flex; align-items: center; justify-content: center; }
.login-card { background: var(--bg2); border: 1px solid var(--border); border-radius: var(--radius2); padding: 2.5rem; width: 380px; box-shadow: var(--shadow); }
.login-logo { font-family: var(--font); font-size: 1.4rem; font-weight: 700; color: var(--green); text-align: center; margin-bottom: 1.5rem; }
.login-logo span { color: var(--text3); font-size: .8rem; display: block; font-weight: 400; margin-top: .25rem; }
.login-error { background: rgba(255,71,87,.1); border: 1px solid rgba(255,71,87,.3); color: var(--red); padding: .65rem 1rem; border-radius: var(--radius); font-size: .85rem; margin-bottom: 1rem; }

/* ─── TOAST ─────────────────────────────────────────────── */
.toast-container { position: fixed; bottom: 1.5rem; right: 1.5rem; z-index: 9999; display: flex; flex-direction: column; gap: .5rem; }
.toast { background: var(--bg3); border: 1px solid var(--border); border-radius: var(--radius); padding: .75rem 1.25rem; font-size: .875rem; min-width: 250px; box-shadow: var(--shadow); animation: slideIn .2s ease; display: flex; align-items: center; gap: .6rem; }
@keyframes slideIn { from { transform: translateX(100%); opacity: 0; } to { transform: translateX(0); opacity: 1; } }
.toast.success { border-color: rgba(0,255,136,.4); color: var(--green); }
.toast.error   { border-color: rgba(255,71,87,.4); color: var(--red); }
.toast.info    { border-color: rgba(0,212,255,.4); color: var(--cyan); }

/* ─── MODAL ─────────────────────────────────────────────── */
.modal-overlay { position: fixed; inset: 0; z-index: 1000; background: rgba(0,0,0,.7); display: flex; align-items: center; justify-content: center; }
.modal { background: var(--bg2); border: 1px solid var(--border); border-radius: var(--radius2); padding: 2rem; width: 460px; max-width: 95vw; box-shadow: var(--shadow); }
.modal h3 { margin-bottom: 1.25rem; }
.modal-actions { display: flex; gap: .75rem; justify-content: flex-end; margin-top: 1.5rem; }

/* ─── FOOTER ────────────────────────────────────────────── */
.footer { padding: 2rem; border-top: 1px solid var(--border); text-align: center; color: var(--text3); font-size: .8rem; font-family: var(--font); }
.footer .green, .footer a.green { color: var(--green); }

/* ─── HLJS ──────────────────────────────────────────────── */
.hljs { background: transparent !important; }
.hljs-comment,.hljs-quote { color: #5c7099; font-style: italic; }
.hljs-keyword,.hljs-selector-tag,.hljs-literal { color: #ff79c6; }
.hljs-name,.hljs-attribute { color: #50fa7b; }
.hljs-variable,.hljs-template-variable { color: #8be9fd; }
.hljs-string,.hljs-doctag { color: #f1fa8c; }
.hljs-title,.hljs-section,.hljs-built_in { color: #50fa7b; }
.hljs-type,.hljs-symbol,.hljs-bullet,.hljs-addition { color: #bd93f9; }
.hljs-deletion,.hljs-number,.hljs-regexp { color: #ffb86c; }
.hljs-class .hljs-title { color: #8be9fd; }
.hljs-function { color: #50fa7b; }
.hljs-meta { color: #ff5555; }
.hljs-tag { color: #ff79c6; }

@media (max-width: 900px) {
  .markdown-body { overflow-x: hidden; max-width: 100%; }
  .markdown-body img { max-width: 100%; height: auto; }
  .markdown-body table { display: block; overflow-x: auto; }
  .markdown-body table { display: block; overflow-x: auto; width: max-content; max-width: 100%; }
  .markdown-body thead, .markdown-body tbody, .markdown-body tr { display: table; width: 100%; table-layout: fixed; }

}

/* ─── AUTHOR ────────────────────────────────────────────── */
.card-author { font-size:.72rem; color:var(--text3); margin-top:.4rem; padding-top:.4rem; border-top:1px solid var(--border); }
.card-author-link { color:var(--cyan); text-decoration:none; transition:color .2s; }
.card-author-link:hover { color:var(--green); }
.card-author-name { color:var(--text3); }

.post-author { display:inline-flex; align-items:center; gap:.35rem; font-size:.85rem; }
.post-author a { color:var(--cyan); font-weight:600; transition:color .2s; }
.post-author a:hover { color:var(--green); }
.post-author span { color:var(--text2); font-weight:600; }

/* ─── SEARCH DROPDOWN ────────────────────────────────────── */
.search-dropdown {
  position: absolute;
  top: calc(100% + 8px);
  left: -60px; right: 0;
  min-width: 420px;
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: var(--radius2);
  box-shadow: 0 12px 40px rgba(0,0,0,.55);
  z-index: 999;
  max-height: 75vh;
  overflow-y: auto;
  display: none;
}
.search-dropdown.open { display: block; }
.search-dropdown-item {
  display: flex;
  flex-direction: column;
  gap: .25rem;
  padding: .75rem 1rem;
  border-bottom: 1px solid var(--border);
  cursor: pointer;
  transition: background .15s;
  text-decoration: none;
}
.search-dropdown-item:last-child { border-bottom: none; }
.search-dropdown-item:hover { background: var(--bg3); }
.search-dropdown-title {
  font-size: .9rem;
  font-weight: 700;
  color: var(--green);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.search-dropdown-meta {
  display: flex;
  gap: .5rem;
  font-size: .72rem;
  color: var(--text3);
  align-items: center;
  flex-wrap: wrap;
}
.search-dropdown-tag {
  color: var(--text3);
  font-family: var(--font);
}
.search-dropdown-desc {
  font-size: .78rem;
  color: var(--text2);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.search-dropdown-snippet {
  font-size: .75rem;
  color: var(--text3);
  font-style: italic;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.search-dropdown-snippet mark,
.search-dropdown-title mark,
.search-dropdown-desc mark {
  background: rgba(0,255,136,.18);
  color: var(--green);
  border-radius: 2px;
  padding: 0 .15em;
  font-style: normal;
  font-weight: 700;
}
.search-dropdown-stats {
  display: flex;
  gap: .6rem;
  font-size: .7rem;
  color: var(--text3);
  margin-left: auto;
}
.search-dropdown-empty {
  padding: 1.25rem;
  text-align: center;
  color: var(--text3);
  font-size: .85rem;
}
.search-dropdown-footer {
  padding: .6rem 1rem;
  text-align: center;
  font-size: .75rem;
  color: var(--text3);
  border-top: 1px solid var(--border);
  cursor: pointer;
  transition: color .15s;
}
.search-dropdown-footer:hover { color: var(--green); }

/* Mobile dropdown */
@media (max-width: 900px) {
  .nav-search { flex: 1 1 auto; min-width: 0; }
  .search-dropdown {
    position: fixed;
    top: 52px;
    left: 0; right: 0;
    min-width: unset;
    border-radius: 0;
    max-height: 80vh;
    border-left: none;
    border-right: none;
  }
}
/* ─── MOBILE OVERFLOW FIX ───────────────────────────────── */
html, body {
  max-width: 100%;
}

@media (max-width: 600px) {
  .nav-search { flex: 1 1 auto; min-width: 0; max-width: 100%; }
  .nav-inner { flex-wrap: wrap; gap: .5rem; padding: .5rem; }
  .stats-bar { flex-wrap: wrap; gap: .5rem; }
  .card { min-width: 0; }
  .card-footer { flex-wrap: wrap; gap: .35rem; }
  .filter-chips { flex-wrap: wrap; }
  .grid { grid-template-columns: 1fr; }
  .layout { padding: 0 .75rem; }
  .hero { padding: 2rem 1rem 1.5rem; }
  .filters { padding: .5rem .75rem; }
  * { min-width: 0; }
  .footer { padding: 1rem; font-size: .75rem; }
  .layout { padding-bottom: 1.5rem; }
  .nav-search input { font-size: .75rem; padding: .3rem .7rem .3rem 1.75rem; }
  .nav-search { max-width: 160px; }
}
