/* ActiveSOC Blog — dark theme, continuous with blackhillsinfosec.com.
   BRAND TOKENS: the :root block below is the ONLY place hex colors may
   appear in this file. To track a future brand repalette, edit only this. */

@font-face { font-family: "Bebas Neue"; src: url("/fonts/bebas-neue.woff2") format("woff2"); font-weight: 400; font-display: swap; }
@font-face { font-family: "Source Sans 3"; src: url("/fonts/source-sans-3.woff2") format("woff2"); font-weight: 200 900; font-style: normal; font-display: swap; }
@font-face { font-family: "Source Sans 3"; src: url("/fonts/source-sans-3-italic.woff2") format("woff2"); font-weight: 200 900; font-style: italic; font-display: swap; }
@font-face { font-family: "JetBrains Mono"; src: url("/fonts/jetbrains-mono.woff2") format("woff2"); font-weight: 100 800; font-display: swap; }

:root {
  /* Animated hex background (hex-background.js reads these) */
  --site-bg-style: hex;
  --hex-stroke-color: #405959;
  --hex-fill-color: #40c7c3;
  --hex-highlight-color: #8cd9d6;
  --hex-secondary-color: #468cc1;
  --hex-stroke-alpha: 0.11;
  --hex-fill-alpha: 0.028;
  --hex-highlight-alpha: 0.14;
  --hex-secondary-mix: 0.06;
  --hex-highlight-radius: 200;
  --hex-binary-alpha: 0.5;
  --hex-life-intensity: 0.35;
  --hex-life-duration: 20;
  --hex-life-birth: 2;
  --hex-life-survive: 34;

  --page-bg: #182525;
  --surface-bg: #243333;
  --surface-hover: #2b3d3d;
  --code-bg: #121d1d;
  --text: #e9ecec;
  --muted: #b2bdbd;
  --heading: #f7f8f8;
  --border: #405959;
  --accent: #40c7c3;
  --accent-alt: #468cc1;
  --link: #7dd4d1;
  --link-hover: #aee0de;

  --font-display: "Bebas Neue", "Segoe UI", sans-serif;
  --font-body: "Source Sans 3", "Segoe UI", sans-serif;
  --font-mono: "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, monospace;

  --measure: 68ch;
  --radius: 8px;
}

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}

/* ---------- base ---------- */
* { box-sizing: border-box; }
html { color-scheme: dark; }
body {
  margin: 0;
  background: var(--page-bg);
  color: var(--text);
  font-family: var(--font-body);
  font-size: 1.125rem;
  line-height: 1.7;
}
h1, h2, h3, h4 { color: var(--heading); line-height: 1.25; font-weight: 700; }
a { color: var(--link); text-decoration-thickness: 1px; text-underline-offset: 3px; }
a:hover { color: var(--link-hover); }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

main { max-width: 64rem; margin: 0 auto; padding: 2.5rem 1.5rem 5rem; }

/* Content sits above the fixed hex canvas (z-index: 0) */
#hex-bg-canvas {
  position: fixed; inset: 0; width: 100%; height: 100%;
  z-index: 0; pointer-events: none;
}
.masthead, main, .site-footer { position: relative; z-index: 1; }

/* ---------- masthead ---------- */
.masthead { border-bottom: 1px solid var(--border); position: relative; overflow: hidden; }
.masthead-inner {
  max-width: 64rem; margin: 0 auto; padding: 1.1rem 1.5rem;
  display: flex; align-items: center; gap: 2rem;
}
.wordmark { display: flex; align-items: center; gap: .65rem; text-decoration: none; }
.masthead-logo { height: 26px; width: auto; display: block; }
.wordmark-name { font-family: var(--font-display); font-size: 1.6rem; letter-spacing: .12em; color: var(--heading); }
#site-nav { margin-left: auto; display: flex; gap: 1.4rem; }
#site-nav a { color: var(--muted); text-decoration: none; font-size: .85rem; text-transform: uppercase; letter-spacing: .08em; }
#site-nav a:hover { color: var(--link-hover); }
.nav-toggle { display: none; }

/* ---------- post index ---------- */
.post-entry {
  position: relative;
  margin: 1.5rem 0; padding: 1.5rem 1.8rem 1.7rem;
  background: color-mix(in srgb, var(--surface-bg) 78%, transparent);
  border: 1px solid var(--border);
  border-left: 3px solid var(--accent-alt);
  border-radius: var(--radius);
  transition: border-color .15s ease, background .15s ease;
}
.post-entry:hover {
  border-left-color: var(--accent);
  background: color-mix(in srgb, var(--surface-bg) 92%, transparent);
}
.read-post {
  position: absolute; right: 1.4rem; bottom: 1.2rem;
  font-family: var(--font-display); font-size: .95rem; letter-spacing: .14em;
  text-transform: uppercase; text-decoration: none; color: var(--accent);
  opacity: 0; transform: translateX(-4px);
  transition: opacity .15s ease, transform .15s ease;
}
.post-entry:hover .read-post, .post-entry:focus-within .read-post {
  opacity: 1; transform: translateX(0);
}
.read-post:hover { color: var(--link-hover); }
@media (hover: none) { .read-post { opacity: 1; transform: none; } }
.eyebrow {
  font-family: var(--font-display); font-size: .95rem; letter-spacing: .16em;
  text-transform: uppercase; color: var(--accent); margin: 0 0 .3rem;
}
.eyebrow a { color: inherit; text-decoration: none; }
.eyebrow a:hover { color: var(--link-hover); }
.entry-title { font-size: 1.6rem; margin: 0 0 .35rem; }
.entry-title a { color: var(--heading); text-decoration: none; }
.entry-title a:hover { color: var(--link-hover); }
.byline { color: var(--muted); font-size: .9rem; margin: 0 0 .6rem; }
.byline a { color: inherit; }
.entry-excerpt { margin: 0; color: var(--text); }
.empty { color: var(--muted); text-align: center; padding: 4rem 0; }

.pagination { display: flex; justify-content: space-between; align-items: center; padding: 2rem 0; color: var(--muted); font-size: .95rem; }

/* ---------- post page ---------- */
.post-header { margin-bottom: 2rem; }
.post-header h1 { font-size: 2.1rem; margin: .2rem 0 .5rem; }
.feature img { width: 100%; border-radius: var(--radius); border: 1px solid var(--border); }
.post-body h2 { margin-top: 2.6rem; font-size: 1.5rem; }
.post-body h3 { margin-top: 2rem; font-size: 1.2rem; }
.post-body img.post-img { max-width: 100%; border-radius: var(--radius); border: 1px solid var(--border); }
.post-body figure { margin: 2rem 0; }
.post-body figcaption { color: var(--muted); font-size: .9rem; margin-top: .5rem; text-align: center; }
.post-body blockquote {
  margin: 1.6rem 0; padding: .2rem 1.25rem;
  border-left: 3px solid var(--accent); color: var(--muted);
}
.post-body table { border-collapse: collapse; width: 100%; margin: 1.6rem 0; font-size: .95rem; display: block; overflow-x: auto; }
.post-body th, .post-body td { border: 1px solid var(--border); padding: .5rem .8rem; text-align: left; }
.post-body th { background: var(--surface-bg); color: var(--heading); }
.post-body hr { border: 0; border-top: 1px solid var(--border); margin: 2.5rem 0; }

/* ---------- code ---------- */
code {
  font-family: var(--font-mono); font-size: .88em;
}
:not(pre) > code {
  background: var(--surface-bg); border: 1px solid var(--border);
  border-radius: 4px; padding: .1em .35em;
}
.highlight {
  position: relative; margin: 1.8rem 0;
  background: var(--code-bg); border: 1px solid var(--border); border-radius: var(--radius);
}
.highlight pre {
  margin: 0; padding: 1.1rem 1.3rem; overflow-x: auto;
  font-family: var(--font-mono); font-size: .88rem; line-height: 1.65;
}
/* .wide fences render at the same width as all content — kept as a no-op class */
.copy-btn {
  position: absolute; top: .55rem; right: .55rem;
  font-family: var(--font-mono); font-size: .72rem;
  color: var(--muted); background: var(--surface-bg);
  border: 1px solid var(--border); border-radius: 4px; padding: .25rem .6rem;
  cursor: pointer; opacity: 0; transition: opacity .15s ease;
}
.highlight:hover .copy-btn, .copy-btn:focus-visible, .copy-btn.is-copied { opacity: 1; }
.copy-btn:hover { color: var(--text); border-color: var(--accent); }
@media (hover: none) { .copy-btn { opacity: .9; } }

/* ---------- lightbox (click-to-enlarge) ---------- */
.post-body img.zoomable { cursor: zoom-in; }
.lightbox {
  position: fixed; inset: 0; z-index: 10;
  display: none; flex-direction: column; align-items: center; justify-content: center;
  gap: .8rem; padding: 2rem;
  background: color-mix(in srgb, var(--page-bg) 92%, transparent);
  backdrop-filter: blur(3px);
  cursor: zoom-out;
}
.lightbox.open { display: flex; }
.lightbox img {
  max-width: 95vw; max-height: 88vh;
  border: 1px solid var(--border); border-radius: var(--radius);
  box-shadow: 0 12px 48px color-mix(in srgb, var(--code-bg) 80%, transparent);
}
.lightbox-caption { margin: 0; color: var(--muted); font-size: .9rem; text-align: center; }

/* ---------- author card ---------- */
.author-card {
  display: flex; gap: 1.1rem; align-items: flex-start;
  margin-top: 3rem; padding: 1.3rem; background: var(--surface-bg);
  border: 1px solid var(--border); border-radius: var(--radius);
}
.avatar { width: 56px; height: 56px; border-radius: 50%; object-fit: cover; }
.author-card p { margin: 0 0 .25rem; }
.author-name { color: var(--heading); font-weight: 700; }
.author-title { color: var(--accent); font-size: .85rem; }
.author-bio { color: var(--muted); font-size: .95rem; }

/* ---------- tag / archive / search ---------- */
.tag-cloud { display: flex; flex-wrap: wrap; gap: .6rem; padding: 0; list-style: none; }
.tag-cloud a {
  display: inline-block; padding: .3rem .8rem; text-decoration: none;
  background: var(--surface-bg); border: 1px solid var(--border); border-radius: 999px;
  color: var(--text); font-size: .9rem;
}
.tag-cloud a:hover { border-color: var(--accent); }
.tag-cloud .count { color: var(--muted); }
.archive-list { list-style: none; padding: 0; }
.archive-list li { padding: .55rem 0; border-bottom: 1px solid var(--border); display: flex; gap: 1rem; }
.archive-list time { color: var(--muted); font-family: var(--font-mono); font-size: .85rem; white-space: nowrap; }
.search-box {
  width: 100%; padding: .7rem 1rem; font: inherit;
  background: var(--surface-bg); color: var(--text);
  border: 1px solid var(--border); border-radius: var(--radius);
}
.search-box:focus { border-color: var(--accent); outline: none; }

/* ---------- footer ---------- */
.site-footer {
  border-top: 1px solid var(--border); margin-top: 3rem;
  padding: 2rem 1.5rem; text-align: center; color: var(--muted); font-size: .9rem;
}
.site-footer a { color: var(--link); }

/* ---------- responsive ---------- */
@media (max-width: 720px) {
  body { font-size: 1.05rem; }
  .masthead-inner { flex-wrap: wrap; gap: .8rem 2rem; }
  .nav-toggle {
    display: block; margin-left: auto; font-family: var(--font-display);
    letter-spacing: .1em; background: none; color: var(--text);
    border: 1px solid var(--border); border-radius: 4px; padding: .3rem .7rem; cursor: pointer;
  }
  #site-nav { display: none; width: 100%; flex-direction: column; gap: .7rem; padding-bottom: .5rem; }
  #site-nav.open { display: flex; }
}
