/* ═══════════════════════════════════════════════════════════════════════════
   Red Team KB — Custom theme matching intrusionsec.com
   Dark background, red accents, monospace tech aesthetic
   ═══════════════════════════════════════════════════════════════════════════ */

:root {
  --isec-bg-primary: #0a0a0a;
  --isec-bg-secondary: #111111;
  --isec-bg-card: #161616;
  --isec-bg-card-hover: #1c1c1c;
  --isec-red: #c62828;
  --isec-red-bright: #e53935;
  --isec-red-glow: rgba(198, 40, 40, 0.3);
  --isec-red-dim: rgba(198, 40, 40, 0.15);
  --isec-text: #c8c8c8;
  --isec-text-muted: #808080;
  --isec-border: #2a2a2a;
  --isec-border-red: rgba(198, 40, 40, 0.4);
  --isec-font-mono: 'JetBrains Mono', 'Fira Code', 'SF Mono', 'Consolas', monospace;
}

/* ── Base overrides ──────────────────────────────────────────────────────── */

[data-md-color-scheme="slate"] {
  --md-default-bg-color: var(--isec-bg-primary);
  --md-default-fg-color: var(--isec-text);
  --md-primary-fg-color: var(--isec-red);
  --md-primary-bg-color: var(--isec-bg-primary);
  --md-accent-fg-color: var(--isec-red-bright);
  --md-typeset-a-color: var(--isec-red-bright);
  --md-code-bg-color: var(--isec-bg-secondary);
  --md-footer-bg-color: var(--isec-bg-secondary);
  --md-footer-bg-color--dark: #080808;
}

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  background: var(--isec-bg-primary);
}

/* ── Header / Navigation ─────────────────────────────────────────────────── */

.md-header {
  background: var(--isec-bg-primary) !important;
  border-bottom: 1px solid var(--isec-border);
  box-shadow: none;
}

.md-header__title {
  font-family: var(--isec-font-mono);
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  font-size: 0.85rem;
}

.md-tabs {
  background: var(--isec-bg-secondary) !important;
  border-bottom: 1px solid var(--isec-border);
}

.md-tabs__link {
  font-family: var(--isec-font-mono) !important;
  font-size: 0.72rem !important;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  opacity: 0.6;
  transition: opacity 0.2s, color 0.2s;
}

.md-tabs__link:hover,
.md-tabs__link--active {
  opacity: 1;
  color: var(--isec-red-bright) !important;
}

/* ── Sidebar ─────────────────────────────────────────────────────────────── */

.md-sidebar {
  background: var(--isec-bg-primary);
}

.md-nav__link {
  font-family: var(--isec-font-mono);
  font-size: 0.78rem;
  letter-spacing: 0.02em;
}

.md-nav__link:hover {
  color: var(--isec-red-bright) !important;
}

.md-nav__link--active {
  color: var(--isec-red-bright) !important;
  font-weight: 600;
}

.md-nav__item--nested > .md-nav__link {
  text-transform: uppercase;
  font-size: 0.72rem;
  letter-spacing: 0.06em;
  color: var(--isec-text-muted);
}

/* ── Content area ────────────────────────────────────────────────────────── */

.md-content {
  background: var(--isec-bg-primary);
}

.md-typeset h1 {
  font-family: var(--isec-font-mono);
  font-weight: 800;
  letter-spacing: -0.02em;
  color: #ffffff;
  border-bottom: 2px solid var(--isec-red);
  padding-bottom: 0.4em;
}

.md-typeset h2 {
  font-family: var(--isec-font-mono);
  font-weight: 700;
  color: var(--isec-red-bright);
  font-size: 1.2rem;
  letter-spacing: 0.02em;
}

.md-typeset h2::before {
  content: "// ";
  color: var(--isec-red);
  opacity: 0.6;
}

.md-typeset h3 {
  font-family: var(--isec-font-mono);
  font-weight: 600;
  text-transform: uppercase;
  font-size: 0.85rem;
  letter-spacing: 0.08em;
  color: var(--isec-text);
}

/* ── Links ───────────────────────────────────────────────────────────────── */

.md-typeset a {
  color: var(--isec-red-bright);
  text-decoration: none;
  border-bottom: 1px solid transparent;
  transition: border-color 0.2s;
}

.md-typeset a:hover {
  color: #ff5252;
  border-bottom-color: var(--isec-red-bright);
}

/* ── Tables ──────────────────────────────────────────────────────────────── */

.md-typeset table:not([class]) {
  border: 1px solid var(--isec-border);
  border-radius: 4px;
  overflow: hidden;
  font-size: 0.82rem;
}

.md-typeset table:not([class]) thead {
  background: var(--isec-bg-secondary);
  border-bottom: 2px solid var(--isec-red);
}

.md-typeset table:not([class]) th {
  font-family: var(--isec-font-mono);
  text-transform: uppercase;
  font-size: 0.72rem;
  letter-spacing: 0.08em;
  color: var(--isec-red-bright);
  padding: 0.8em 1em;
  font-weight: 600;
}

.md-typeset table:not([class]) td {
  padding: 0.6em 1em;
  border-top: 1px solid var(--isec-border);
}

.md-typeset table:not([class]) tr:hover td {
  background: var(--isec-bg-card-hover);
}

/* ── Cards for category index pages ──────────────────────────────────────── */

.md-typeset ul:not([class]) li {
  margin-bottom: 0.3em;
}

/* ── Search ──────────────────────────────────────────────────────────────── */

.md-search__form {
  background: var(--isec-bg-secondary) !important;
  border: 1px solid var(--isec-border);
  border-radius: 4px;
}

.md-search__form:hover,
.md-search__form:focus-within {
  border-color: var(--isec-red) !important;
  box-shadow: 0 0 10px var(--isec-red-glow);
}

.md-search__input {
  font-family: var(--isec-font-mono) !important;
  font-size: 0.85rem;
}

.md-search-result__link:hover {
  background: var(--isec-bg-card-hover) !important;
}

.md-search-result__meta {
  color: var(--isec-red) !important;
}

/* ── Code blocks ─────────────────────────────────────────────────────────── */

.md-typeset code {
  background: var(--isec-bg-secondary);
  border: 1px solid var(--isec-border);
  color: var(--isec-red-bright);
  font-size: 0.82em;
  padding: 0.1em 0.4em;
  border-radius: 3px;
}

.md-typeset pre > code {
  border: 1px solid var(--isec-border);
  border-left: 3px solid var(--isec-red);
}

/* ── Blockquotes (used as breadcrumbs on subcategory pages) ──────────────── */

.md-typeset blockquote {
  border-left: 3px solid var(--isec-red);
  background: var(--isec-bg-card);
  padding: 0.6em 1em;
  color: var(--isec-text-muted);
  font-family: var(--isec-font-mono);
  font-size: 0.8rem;
}

/* ── Footer ──────────────────────────────────────────────────────────────── */

.md-footer {
  border-top: 1px solid var(--isec-border);
}

.md-footer-meta {
  background: var(--isec-bg-primary) !important;
}

/* ── Category filter chips (homepage) ────────────────────────────────────── */

.category-filters {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5em;
  margin: 1.5em 0;
}

.category-chip {
  font-family: var(--isec-font-mono);
  font-size: 0.72rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  padding: 0.4em 1em;
  border: 1px solid var(--isec-border);
  border-radius: 2px;
  background: var(--isec-bg-card);
  color: var(--isec-text-muted);
  cursor: pointer;
  transition: all 0.2s;
  text-decoration: none;
}

.category-chip:hover {
  border-color: var(--isec-red);
  color: var(--isec-red-bright);
  background: var(--isec-red-dim);
  box-shadow: 0 0 8px var(--isec-red-glow);
}

.category-chip.active {
  border-color: var(--isec-red);
  color: var(--isec-red-bright);
  background: var(--isec-red-dim);
}

/* ── Category cards (homepage grid) ──────────────────────────────────────── */

.category-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 1em;
  margin: 1.5em 0;
}

.category-card {
  background: var(--isec-bg-card);
  border: 1px solid var(--isec-border);
  border-left: 3px solid var(--isec-red);
  border-radius: 3px;
  padding: 1.2em;
  transition: all 0.25s ease;
  text-decoration: none;
  color: inherit;
  display: block;
}

.category-card:hover {
  border-color: var(--isec-red);
  background: var(--isec-bg-card-hover);
  box-shadow: 0 0 15px var(--isec-red-glow);
  transform: translateY(-2px);
  color: inherit;
}

.category-card h3 {
  font-family: var(--isec-font-mono);
  font-size: 0.82rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: #ffffff;
  margin: 0 0 0.3em 0;
}

.category-card h3::before {
  content: none;
}

.category-card .count {
  font-family: var(--isec-font-mono);
  font-size: 0.72rem;
  color: var(--isec-red);
}

.category-card .subcats {
  font-size: 0.75rem;
  color: var(--isec-text-muted);
  margin-top: 0.5em;
  line-height: 1.5;
}

/* ── Stats bar ───────────────────────────────────────────────────────────── */

.stats-bar {
  display: flex;
  gap: 2em;
  padding: 1em 0;
  margin: 1em 0;
  border-top: 1px solid var(--isec-border);
  border-bottom: 1px solid var(--isec-border);
}

.stat-item {
  font-family: var(--isec-font-mono);
}

.stat-value {
  font-size: 1.5rem;
  font-weight: 800;
  color: var(--isec-red-bright);
}

.stat-label {
  font-size: 0.68rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--isec-text-muted);
}

/* ── Scrollbar ───────────────────────────────────────────────────────────── */

::-webkit-scrollbar {
  width: 6px;
}

::-webkit-scrollbar-track {
  background: var(--isec-bg-primary);
}

::-webkit-scrollbar-thumb {
  background: var(--isec-border);
  border-radius: 3px;
}

::-webkit-scrollbar-thumb:hover {
  background: var(--isec-red);
}

/* ── Resource list filter (subcategory pages) ────────────────────────────── */

.resource-filter {
  font-family: var(--isec-font-mono);
  font-size: 0.82rem;
  padding: 0.5em 1em;
  background: var(--isec-bg-secondary);
  border: 1px solid var(--isec-border);
  border-radius: 3px;
  color: var(--isec-text);
  width: 100%;
  margin-bottom: 1em;
  outline: none;
  transition: border-color 0.2s;
}

.resource-filter:focus {
  border-color: var(--isec-red);
  box-shadow: 0 0 8px var(--isec-red-glow);
}

.resource-filter::placeholder {
  color: var(--isec-text-muted);
}

/* ── Responsive ──────────────────────────────────────────────────────────── */

@media (max-width: 768px) {
  .category-grid {
    grid-template-columns: 1fr;
  }
  .stats-bar {
    flex-wrap: wrap;
    gap: 1em;
  }
}
