/* ===== Active Directory Pentest Notes – stylesheet ===== */
:root {
  --bg: #0d1117;
  --bg-elev: #161b22;
  --bg-elev2: #1c2230;
  --border: #2a3140;
  --text: #e6edf3;
  --text-dim: #9aa7b4;
  --text-faint: #6b7684;
  --accent: #58a6ff;
  --accent2: #7c5cff;
  --accent-grad: linear-gradient(120deg, #58a6ff, #7c5cff 60%, #d451ff);
  --code-bg: #0b0f16;
  --quote-bg: #131a24;
  --warn: #f0b429;
  --sidebar-w: 300px;
  --rail-w: 220px;
  --radius: 12px;
  --mono: "JetBrains Mono", "SF Mono", ui-monospace, Menlo, Consolas, monospace;
  --sans: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}
[data-theme="light"] {
  --bg: #ffffff;
  --bg-elev: #f6f8fa;
  --bg-elev2: #eef1f5;
  --border: #d8dee4;
  --text: #1f2328;
  --text-dim: #57606a;
  --text-faint: #8b949e;
  --accent: #0969da;
  --accent2: #6639ba;
  --code-bg: #f6f8fa;
  --quote-bg: #f2f6fc;
}
* { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: 20px; }
body {
  margin: 0; background: var(--bg); color: var(--text);
  font-family: var(--sans); line-height: 1.65; font-size: 16px;
  -webkit-font-smoothing: antialiased;
}
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }

.layout { display: flex; min-height: 100vh; }

/* ===== Sidebar ===== */
.side-nav {
  width: var(--sidebar-w); flex: 0 0 var(--sidebar-w);
  background: var(--bg-elev); border-right: 1px solid var(--border);
  padding: 18px 14px 40px; position: sticky; top: 0; height: 100vh;
  overflow-y: auto; overscroll-behavior: contain;
}
.brand { display: flex; align-items: center; gap: 12px; padding: 6px 8px 16px;
  color: var(--text) !important; text-decoration: none !important; }
.brand-mark {
  width: 40px; height: 40px; border-radius: 10px; display: grid; place-items: center;
  font-weight: 800; font-size: 16px; color: #fff; background: var(--accent-grad);
  letter-spacing: .5px; box-shadow: 0 4px 14px rgba(124,92,255,.35);
}
.brand-txt { font-weight: 700; font-size: 15px; line-height: 1.25; }
.brand-txt small { color: var(--text-faint); font-weight: 500; font-size: 11px; letter-spacing: .3px; }

.nav-search { position: relative; margin: 4px 4px 14px; }
#navSearch {
  width: 100%; padding: 9px 12px; border-radius: 9px; border: 1px solid var(--border);
  background: var(--bg); color: var(--text); font-size: 13.5px; outline: none;
}
#navSearch:focus { border-color: var(--accent); box-shadow: 0 0 0 3px rgba(88,166,255,.15); }
.search-results {
  position: absolute; top: 44px; left: 0; right: 0; z-index: 30;
  background: var(--bg-elev2); border: 1px solid var(--border); border-radius: 10px;
  max-height: 320px; overflow-y: auto; display: none; box-shadow: 0 12px 30px rgba(0,0,0,.4);
}
.search-results.show { display: block; }
.search-results a { display: block; padding: 9px 12px; color: var(--text); border-bottom: 1px solid var(--border); }
.search-results a:last-child { border-bottom: 0; }
.search-results a:hover { background: var(--bg); text-decoration: none; }
.search-results a { padding: 8px 12px; }
.search-results .sr-t { display: block; font-size: 13.5px; font-weight: 600; }
.search-results .sr-snip { display: block; font-size: 11.5px; color: var(--text-dim); margin: 2px 0 3px; line-height: 1.45; }
.search-results .sr-s { display: block; font-size: 10.5px; color: var(--text-faint); text-transform: uppercase; letter-spacing: .4px; }
.search-results .sr-empty { padding: 12px; color: var(--text-faint); font-size: 13px; }
.search-results mark, .sr-snip mark { background: rgba(88,166,255,.28); color: inherit; border-radius: 3px; padding: 0 1px; }

/* ===== Dedicated search page ===== */
.search-page { padding: 8px 6vw 80px; max-width: 900px; margin: 0 auto; }
.ftbar { position: sticky; top: 0; background: var(--bg); padding: 14px 0 12px; z-index: 5; }
#ftInput {
  width: 100%; padding: 16px 20px; font-size: 18px; border-radius: 14px;
  border: 1px solid var(--border); background: var(--bg-elev); color: var(--text); outline: none;
}
#ftInput:focus { border-color: var(--accent); box-shadow: 0 0 0 4px rgba(88,166,255,.15); }
.ft-hint { color: var(--text-faint); font-size: 12.5px; margin-top: 8px; }
.ft-hint code { background: var(--bg-elev2); padding: 1px 5px; border-radius: 4px; }
.ft-meta { color: var(--text-dim); font-size: 13.5px; margin: 6px 2px 14px; }
.ft-meta b { color: var(--accent); }
.ft-results { display: flex; flex-direction: column; gap: 12px; }
.ft-empty { color: var(--text-faint); padding: 30px 0; text-align: center; font-size: 15px; }
.ft-card {
  display: block; padding: 16px 18px; border: 1px solid var(--border); border-radius: 12px;
  background: var(--bg-elev); color: var(--text) !important; transition: .15s;
}
.ft-card:hover { text-decoration: none; border-color: var(--accent); transform: translateY(-2px);
  box-shadow: 0 8px 22px rgba(0,0,0,.3); }
.ft-card-top { display: flex; align-items: center; gap: 8px; margin-bottom: 6px; }
.ft-badge { font-size: 11px; font-weight: 700; color: var(--accent); background: var(--bg-elev2);
  border: 1px solid var(--border); padding: 2px 9px; border-radius: 999px; }
.ft-lvl { font-size: 10.5px; text-transform: uppercase; letter-spacing: .6px; color: var(--text-faint); }
.ft-title { font-size: 16px; font-weight: 700; margin-bottom: 5px; }
.ft-snip { font-size: 13.5px; color: var(--text-dim); line-height: 1.6; }
.ft-card mark, .ft-title mark { background: rgba(240,180,41,.32); color: inherit; border-radius: 3px; padding: 0 2px; }

/* Highlight-on-arrival */
mark.hit { background: #ffd84d; color: #1a1a1a; border-radius: 3px; padding: 0 2px; box-shadow: 0 0 0 2px rgba(255,216,77,.4); }
.hl-pill {
  position: fixed; bottom: 22px; left: 50%; transform: translateX(-50%); z-index: 60;
  background: var(--accent); color: #fff; border: 0; border-radius: 999px; padding: 9px 18px;
  font-size: 13px; font-weight: 600; cursor: pointer; box-shadow: 0 8px 24px rgba(88,166,255,.4);
  font-family: var(--sans);
}
.hl-pill:hover { filter: brightness(1.08); }

.nav-home { display: block; padding: 8px 12px; margin: 0 4px 6px; border-radius: 8px;
  color: var(--text-dim); font-size: 14px; }
.nav-home:hover { background: var(--bg-elev2); text-decoration: none; color: var(--text); }

.nav-group { margin: 2px 4px; }
.nav-group-btn {
  width: 100%; display: flex; align-items: center; justify-content: space-between;
  gap: 8px; background: none; border: 0; color: var(--text); cursor: pointer;
  padding: 8px 12px; border-radius: 8px; font-size: 14px; font-weight: 600;
  text-align: left; font-family: inherit;
}
.nav-group-btn:hover { background: var(--bg-elev2); }
.nav-group-btn .chev { color: var(--text-faint); transition: transform .18s; font-size: 11px; }
.nav-group.open .nav-group-btn .chev { transform: rotate(90deg); }
.nav-sublist {
  list-style: none; margin: 2px 0 6px; padding: 0 0 0 8px;
  max-height: 0; overflow: hidden; transition: max-height .25s ease;
}
.nav-group.open .nav-sublist { max-height: 2000px; }
.nav-sublist li a {
  display: block; padding: 5px 10px 5px 16px; font-size: 13px; color: var(--text-dim);
  border-left: 2px solid var(--border); margin-left: 6px; border-radius: 0 6px 6px 0;
}
.nav-sublist li a:hover { color: var(--text); background: var(--bg-elev2);
  border-left-color: var(--accent); text-decoration: none; }

/* ===== Content ===== */
.content { flex: 1 1 auto; min-width: 0; padding: 0; }

/* Hero (index) */
.hero { padding: 70px 8vw 40px; text-align: center; position: relative; overflow: hidden; }
.hero::before {
  content: ""; position: absolute; inset: -40% 0 auto 0; height: 400px;
  background: radial-gradient(60% 60% at 50% 0%, rgba(124,92,255,.18), transparent 70%);
  pointer-events: none;
}
.hero-badge { display: inline-block; font-size: 12px; letter-spacing: 1.5px; text-transform: uppercase;
  color: var(--accent); border: 1px solid var(--border); padding: 5px 14px; border-radius: 999px;
  background: var(--bg-elev); }
.hero h1 { font-size: clamp(32px, 5vw, 54px); margin: 20px 0 10px; line-height: 1.1; letter-spacing: -1px; }
.grad { background: var(--accent-grad); -webkit-background-clip: text; background-clip: text; color: transparent; }
.hero-sub { color: var(--text-dim); max-width: 620px; margin: 0 auto; font-size: 17px; }
.stats { display: flex; gap: 40px; justify-content: center; margin-top: 34px; }
.stat b { display: block; font-size: 30px; background: var(--accent-grad); -webkit-background-clip: text;
  background-clip: text; color: transparent; }
.stat span { color: var(--text-faint); font-size: 13px; }

/* Cards */
.cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 18px; padding: 20px 6vw 60px; max-width: 1200px; margin: 0 auto; }
.card { display: flex; gap: 16px; padding: 22px; border: 1px solid var(--border);
  border-radius: var(--radius); background: var(--bg-elev); transition: .2s; color: var(--text) !important; }
.card:hover { text-decoration: none; transform: translateY(-3px); border-color: var(--accent);
  box-shadow: 0 12px 30px rgba(0,0,0,.35); }
.card-icon { font-size: 30px; line-height: 1; }
.card-body h3 { margin: 0 0 6px; font-size: 18px; }
.card-body p { margin: 0 0 12px; color: var(--text-dim); font-size: 14px; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 12px; }
.chip { font-size: 11.5px; padding: 3px 9px; border-radius: 999px; background: var(--bg-elev2);
  color: var(--text-dim); border: 1px solid var(--border); }
.chip.more { color: var(--accent); }
.card-meta { font-size: 13px; color: var(--accent); font-weight: 600; }

.site-foot { text-align: center; color: var(--text-faint); padding: 30px; font-size: 13px;
  border-top: 1px solid var(--border); }

/* Section pages */
.page-head { padding: 40px 6vw 8px; max-width: 1180px; margin: 0 auto; }
.crumb { color: var(--text-faint); font-size: 13px; margin-bottom: 8px; }
.page-title { font-size: clamp(26px, 3.5vw, 40px); margin: 0 0 8px; letter-spacing: -.5px; }
.page-desc { color: var(--text-dim); font-size: 16px; margin: 0; max-width: 760px; }

.article-wrap { display: flex; gap: 30px; padding: 20px 6vw 80px; max-width: 1180px; margin: 0 auto; }
.article { flex: 1 1 auto; min-width: 0; }

/* right rail toc */
.toc-rail { flex: 0 0 var(--rail-w); width: var(--rail-w); position: sticky; top: 20px;
  align-self: flex-start; max-height: calc(100vh - 40px); overflow-y: auto; }
.toc-title { font-size: 12px; text-transform: uppercase; letter-spacing: 1px; color: var(--text-faint);
  margin-bottom: 10px; }
.toc-rail ul { list-style: none; margin: 0; padding: 0; border-left: 1px solid var(--border); }
.toc-rail li a { display: block; padding: 5px 12px; font-size: 13px; color: var(--text-dim);
  border-left: 2px solid transparent; margin-left: -1px; }
.toc-rail li a:hover, .toc-rail li a.active { color: var(--accent); border-left-color: var(--accent);
  text-decoration: none; }

/* ===== Article typography ===== */
.article h1, .article h2, .article h3, .article h4 { scroll-margin-top: 20px; line-height: 1.3; }
.article h2 { font-size: 26px; margin: 46px 0 14px; padding-bottom: 8px;
  border-bottom: 1px solid var(--border); }
.article h2::before { content: "#"; color: var(--accent); margin-right: 10px; opacity: .55; font-weight: 700; }
.article h3 { font-size: 20px; margin: 32px 0 10px; color: var(--text); }
.article h4 { font-size: 16.5px; margin: 24px 0 8px; color: var(--text-dim); }
.article p { margin: 12px 0; }
.article ul, .article ol { margin: 12px 0; padding-left: 26px; }
.article li { margin: 5px 0; }
.article hr { border: 0; border-top: 1px solid var(--border); margin: 28px 0; }
.article strong { color: var(--text); font-weight: 700; }

.article blockquote {
  margin: 16px 0; padding: 12px 18px; background: var(--quote-bg);
  border-left: 3px solid var(--accent2); border-radius: 0 8px 8px 0; color: var(--text-dim);
}
.article blockquote p { margin: 4px 0; }

/* code */
.article code { font-family: var(--mono); font-size: .88em; background: var(--bg-elev2);
  padding: 2px 6px; border-radius: 5px; color: #ffa657; }
.article pre { position: relative; background: var(--code-bg); border: 1px solid var(--border);
  border-radius: 10px; padding: 16px 16px; overflow-x: auto; margin: 16px 0; }
.article pre code { background: none; padding: 0; color: var(--text); font-size: 13px; line-height: 1.5; }
.copy-btn { position: absolute; top: 8px; right: 8px; background: var(--bg-elev2);
  border: 1px solid var(--border); color: var(--text-dim); border-radius: 6px; font-size: 11px;
  padding: 4px 9px; cursor: pointer; opacity: 0; transition: .15s; font-family: var(--sans); }
.article pre:hover .copy-btn { opacity: 1; }
.copy-btn:hover { color: var(--text); border-color: var(--accent); }
.copy-btn.done { color: #3fb950; border-color: #3fb950; }

/* tables */
.article table { border-collapse: collapse; margin: 18px 0; width: 100%; font-size: 14px; display: block; overflow-x: auto; }
.article th, .article td { border: 1px solid var(--border); padding: 8px 12px; text-align: left; }
.article th { background: var(--bg-elev2); font-weight: 700; }
.article tr:nth-child(even) td { background: var(--bg-elev); }

/* images */
.note-img { max-width: 100%; height: auto; border: 1px solid var(--border); border-radius: 10px;
  margin: 16px 0; cursor: zoom-in; background: #fff; display: block; }

/* ===== Floating controls ===== */
.theme-toggle, .totop {
  position: fixed; right: 22px; width: 46px; height: 46px; border-radius: 50%;
  border: 1px solid var(--border); background: var(--bg-elev); color: var(--text);
  font-size: 18px; cursor: pointer; box-shadow: 0 6px 18px rgba(0,0,0,.35); z-index: 40;
}
.theme-toggle { bottom: 22px; }
.totop { bottom: 78px; opacity: 0; pointer-events: none; transition: opacity .25s; font-size: 20px; }
.totop.show { opacity: 1; pointer-events: auto; }
.theme-toggle:hover, .totop:hover { border-color: var(--accent); }

.menu-toggle { display: none; position: fixed; top: 14px; left: 14px; z-index: 50;
  width: 44px; height: 44px; border-radius: 10px; border: 1px solid var(--border);
  background: var(--bg-elev); color: var(--text); font-size: 20px; cursor: pointer; }

/* ===== Lightbox ===== */
.lightbox { position: fixed; inset: 0; background: rgba(0,0,0,.88); display: none;
  place-items: center; z-index: 100; padding: 30px; cursor: zoom-out; }
.lightbox.show { display: grid; }
.lightbox img { max-width: 95vw; max-height: 92vh; border-radius: 8px; box-shadow: 0 20px 60px rgba(0,0,0,.6); }

/* ===== Responsive ===== */
@media (max-width: 1080px) { .toc-rail { display: none; } }
@media (max-width: 860px) {
  .menu-toggle { display: block; }
  .side-nav { position: fixed; left: 0; top: 0; z-index: 45; transform: translateX(-100%);
    transition: transform .25s ease; box-shadow: 0 0 40px rgba(0,0,0,.5); }
  .side-nav.open { transform: translateX(0); }
  .content { padding-top: 60px; }
  .hero { padding: 40px 6vw 30px; }
  .stats { gap: 26px; }
  .article-wrap, .page-head { padding-left: 5vw; padding-right: 5vw; }
}
