/* ============================================================
   Tech Stream — base stylesheet
   ============================================================ */

:root {
  --bg:            #0d0f14;
  --bg-alt:        #12151d;
  --surface:       #181c26;
  --surface-2:     #1f2532;
  --border:        #2a3140;
  --text:          #e6e9ef;
  --text-muted:    #9aa3b2;
  --text-dim:      #6b7280;
  --accent:        #00ffff;      /* teal / cyan */
  --accent-2:      #008b99;
  --accent-soft:   rgba(0, 255, 255, 0.14);
  --green:         #2ecc71;
  /* Per-category accent colors (shared by cards + filter underlines) */
  --cat-hardware:    #2ecc71;
  --cat-software:    #ff7675;
  --cat-personal:    #ff6b9d;
  --cat-overclocking: #ffb020;
  --cat-video:       #a78bfa;
  --cat-3dprinting:  #5aa9ff;
  --radius:        12px;
  --radius-sm:     8px;
  --maxw:          100%;
  --font:          "Liberation Sans", system-ui, -apple-system, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  --mono:          ui-monospace, "Cascadia Code", "SF Mono", Consolas, monospace;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  font-size: 17px;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
}

img { max-width: 100%; height: auto; }

a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }

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

/* Shared full-width layout band used by the shell and full-bleed sections,
   so their left edges line up. */
.layout-col {
  width: 100%;
  margin: 0 auto;
}

/* ---------- Buttons ---------- */
.btn {
  display: inline-block;
  padding: 10px 20px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text);
  font-weight: 600;
  font-size: 15px;
  transition: transform .08s ease, background .15s ease, border-color .15s ease;
}
.btn:hover { text-decoration: none; border-color: var(--accent); transform: translateY(-1px); }
.btn-twitch {
  background: var(--accent-2);
  border-color: var(--accent);
  color: #fff;
}
.btn-twitch:hover { background: #00b3c4; }
.btn-accent {
  background: var(--accent-2);
  border-color: var(--accent);
  color: #fff;
}
.btn-accent:hover { background: #00b3c4; }

/* ---------- Header ---------- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 20;
  backdrop-filter: blur(8px);
  background: rgba(13, 15, 20, 0.82);
  border-bottom: 1px solid var(--border);
}
.header-inner {
  display: flex;
  align-items: center;
  gap: 24px;
  padding: 14px 20px;
}
.brand { display: flex; align-items: center; gap: 10px; font-weight: 700; color: var(--text); flex: 1; }
.brand:hover { text-decoration: none; }
.brand-mark { color: var(--accent); font-size: 18px; }
.brand-name { font-size: 18px; letter-spacing: .3px; }

.header-social { display: flex; gap: 12px; align-items: center; }
.social-icon { color: var(--text-muted); font-size: 18px; }
.social-icon:hover { color: var(--accent); }
.social-icon.twitch { color: var(--accent); }

/* ---------- Shell + left sidebar ---------- */
.shell {
  display: flex;
  align-items: stretch;
}
.sidebar {
  width: 230px;
  flex: 0 0 230px;
  position: sticky;
  top: 0;
  height: 100vh;
  padding: 28px 18px 28px 0;   /* flush to the far-left edge of the layout */
  border-right: 1px solid var(--border);
  background: var(--bg-alt);
  overflow-y: auto;
}
.sidebar-nav { display: flex; flex-direction: column; gap: 2px; }
.nav-link {
  color: var(--text-muted);
  font-weight: 550;
  font-size: 15px;
  padding: 0px 14px;
  border-radius: var(--radius-sm);
  border-left: 2px solid transparent;
}
.nav-link:hover { color: var(--text); background: var(--surface); border-left-color: var(--accent); text-decoration: none; }
.nav-link.active { color: var(--text); background: var(--surface); border-left-color: var(--accent); font-weight: 650; }

.nav-group { display: flex; flex-direction: column; gap: 2px; }
/* Main & Links: match the card "Read More" CTA formatting (normal case,
   14px, weight 600, no letter-spacing). Colors stay cyan. */
.nav-group .nav-link {
  color: #00c0c0;
  font-size: 14px;
  font-weight: 600;
  text-transform: none;
  letter-spacing: normal;
}
.nav-group .nav-link:hover { color: #00ffff; text-decoration: none; }
.nav-group .nav-link.active,
.nav-group .nav-link.active:hover { color: #00ffff; text-decoration: none; }

/* Category filter links: match the Main/Links text formatting; colors stay per-category */
.nav-link[data-cat] {
  font-size: 14px;
  font-weight: 600;
  text-transform: none;
  letter-spacing: normal;
}
.nav-link[data-cat=hardware]    { color: var(--cat-hardware); }
.nav-link[data-cat=software]    { color: var(--cat-software); }
.nav-link[data-cat=personal]    { color: var(--cat-personal); }
.nav-link[data-cat=overclocking] { color: var(--cat-overclocking); }
.nav-link[data-cat=video]       { color: var(--cat-video); }
.nav-link[data-cat="3D Printing"] { color: var(--cat-3dprinting); }
.nav-link[data-cat]:hover,
.nav-link[data-cat].active { color: inherit; }

.nav-section-label {
  text-transform: uppercase;
  letter-spacing: 1.5px;
  font-size: 11px;
  font-weight: 700;
  color: var(--text-dim);
  padding: 12px 14px 2px;
  margin: 2px 0 0;
}

.main { flex: 1 1 auto; min-width: 0; }

/* ---------- Hero ---------- */
.hero {
  padding: 50px 0 36px;
  background:
    radial-gradient(120% 120% at 80% -10%, var(--accent-soft) 0%, transparent 55%),
    var(--bg);
  border-bottom: 1px solid var(--border);
  text-align: center;
}
/* Clicking anywhere in the hero navigates home (see handler in default.html). */
.hero-home { cursor: pointer; }
.hero-logo {
  display: block;
  width: 100%;
  max-width: 410px;
  height: auto;
  margin: 0 auto 14px;
}
.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}
.hero-eyebrow {
  text-transform: uppercase;
  letter-spacing: 3px;
  font-size: 13px;
  font-weight: 700;
  color: var(--accent);
  margin: 0 0 14px;
}
.hero-title {
  font-size: clamp(2.6rem, 7vw, 4.5rem);
  line-height: 1.05;
  margin: 0 0 18px;
  font-weight: 800;
  letter-spacing: -1px;
}
.hero-tagline {
  max-width: 620px;
  margin: 0 auto 18px;
  color: var(--text-muted);
  font-size: 1.15rem;
}
.hero-actions { display: flex; gap: 14px; justify-content: center; flex-wrap: wrap; }

/* ---------- Sections ---------- */
.section { padding: 56px 0; }
.section-alt { background: var(--bg-alt); border-top: 1px solid var(--border); border-bottom: 1px solid var(--border); }
.section-intro { text-align: center; padding-bottom: 20px; }
.section-title { font-size: 1.9rem; margin: 0 0 12px; font-weight: 750; letter-spacing: -.5px; }
.section-lead { color: var(--text-muted); max-width: 640px; margin: 0 0 30px; font-size: 1.05rem; }
.section-intro .section-lead { margin-left: auto; margin-right: auto; }

/* ---------- Post grid / cards ---------- */
.post-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 22px;
}
.post-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  transition: transform .12s ease, border-color .15s ease, box-shadow .15s ease;
}
.post-card:hover {
  transform: translateY(-3px);
  border-color: var(--accent);
  box-shadow: 0 10px 30px rgba(0,0,0,.35);
}
.post-card.cat-hardware    { border-top: 3px solid var(--cat-hardware); }
.post-card.cat-software    { border-top: 3px solid var(--cat-software); }
.post-card.cat-personal    { border-top: 3px solid var(--cat-personal); }
.post-card.cat-overclocking { border-top: 3px solid var(--cat-overclocking); }
.post-card.cat-video       { border-top: 3px solid var(--cat-video); }
/* "3D Printing" contains a space, so its class tokenizes to `cat-3D Printing` */
.post-card.cat-3D          { border-top: 3px solid var(--cat-3dprinting); }
/* Hover: outline the whole card in the post's category color */
.post-card.cat-hardware:hover     { border-color: var(--cat-hardware); }
.post-card.cat-software:hover     { border-color: var(--cat-software); }
.post-card.cat-personal:hover     { border-color: var(--cat-personal); }
.post-card.cat-overclocking:hover { border-color: var(--cat-overclocking); }
.post-card.cat-video:hover        { border-color: var(--cat-video); }
.post-card.cat-3D:hover           { border-color: var(--cat-3dprinting); }
.post-card-link { display: block; color: var(--text); }
.post-card-link:hover { text-decoration: none; }
.post-card-media img { width: 100%; display: block; aspect-ratio: 16/9; object-fit: cover; }
.post-card-body { padding: 18px 20px 22px; }
.post-card-meta {
  display: flex;
  align-items: center;
  gap: 12px;
  color: var(--text-dim);
  font-size: 13px;
  margin-bottom: 8px;
}
.post-card-cat {
  font-size: 14px;
  font-weight: 600;
  text-transform: none;
  letter-spacing: normal;
  color: var(--accent);
}
.post-card.cat-hardware .post-card-cat    { color: var(--cat-hardware); }
.post-card.cat-software .post-card-cat    { color: var(--cat-software); }
.post-card.cat-personal .post-card-cat    { color: var(--cat-personal); }
.post-card.cat-overclocking .post-card-cat { color: var(--cat-overclocking); }
.post-card.cat-video .post-card-cat       { color: var(--cat-video); }
.post-card.cat-3D .post-card-cat          { color: var(--cat-3dprinting); }
.post-card-title { font-size: 1.2rem; margin: 0 0 10px; line-height: 1.3; }
.post-card-excerpt { color: var(--text-muted); margin: 0 0 14px; font-size: .95rem; }
.post-card-cta { font-weight: 600; font-size: 14px; color: #00c0c0; transition: color .15s ease; }
.post-card:hover .post-card-cta,
.post-card-link:hover .post-card-cta { color: #00ffff; }

.empty-note { color: var(--text-dim); font-style: italic; }

/* ---------- Post list ---------- */
.post-list { display: flex; flex-direction: column; gap: 2px; }
.post-list-item {
  display: grid;
  grid-template-columns: 130px 1fr;
  gap: 20px;
  align-items: baseline;
  padding: 16px 18px;
  border-radius: var(--radius-sm);
  border: 1px solid transparent;
}
.post-list-item:hover { background: var(--surface); border-color: var(--border); }
.post-list-item time { color: var(--text-dim); font-size: 14px; white-space: nowrap; }
.post-list-link { color: var(--text); font-weight: 550; }
.post-list-link:hover { color: var(--accent); }

/* ---------- Post page ---------- */
.post-header { padding: 40px 0 20px; border-bottom: 1px solid var(--border); }
.breadcrumb { font-size: 14px; color: var(--text-dim); margin-bottom: 20px; display: flex; gap: 8px; flex-wrap: wrap; }
.breadcrumb .current { color: var(--text-muted); }
.post-title { font-size: clamp(2rem, 5vw, 3rem); margin: 0 0 16px; line-height: 1.1; letter-spacing: -.5px; }
.post-meta { color: var(--text-muted); margin: 0; display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }
.dot { color: var(--text-dim); }
.post-hero { margin: 26px 0 0; border-radius: var(--radius); overflow: hidden; border: 1px solid var(--border); }

.post-body { padding: 36px 20px; }
.video-embed {
  margin: 0 0 30px;
  padding: 0;
  max-width: 854px;
  overflow: hidden;
}
.video-embed-frame {
  display: block;
  width: 100%;
  aspect-ratio: 16 / 9;
  border: 0;
}
.video-placeholder { margin: 0; color: var(--text-muted); }

/* ---------- Photo gallery (built by the {%% gallery %} tag) ---------- */
.gallery {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 12px;
  margin: 0 0 30px;
}
.gallery-item {
  margin: 0;
  position: relative;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  overflow: hidden;
  background: var(--bg-alt);
  cursor: zoom-in;
  transition: transform .15s ease, border-color .15s ease;
}
.gallery-item:hover { transform: translateY(-2px); border-color: var(--accent); }
.gallery-item img {
  display: block;
  width: 100%;
  aspect-ratio: 4 / 3;
  object-fit: cover;
}
.gallery-item figcaption {
  position: absolute;
  inset: auto 0 0 0;
  padding: 20px 10px 8px;
  background: linear-gradient(to top, rgba(0,0,0,.78), rgba(0,0,0,0));
  font-size: 12.5px;
  color: #f3f4f6;
  line-height: 1.3;
  pointer-events: none;
}

/* Lightbox */
.gallery-lightbox {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: none;
  align-items: center;
  justify-content: center;
  background: rgba(4, 6, 10, 0.94);
  backdrop-filter: blur(6px);
  padding: 24px;
}
.gallery-lightbox.is-open { display: flex; }
.gallery-lightbox-stage {
  margin: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  max-width: 90vw;
  max-height: 92vh;
}
.gallery-lightbox-img {
  max-width: 90vw;
  max-height: 82vh;
  object-fit: contain;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: #000;
  box-shadow: 0 20px 60px rgba(0,0,0,.5);
}
.gallery-lightbox-cap {
  color: var(--text-muted);
  font-size: 14px;
  text-align: center;
  max-width: 70ch;
}
.gallery-lightbox-close,
.gallery-lightbox-nav {
  position: absolute;
  background: rgba(0,0,0,.4);
  border: 1px solid var(--border);
  color: #fff;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  font-size: 24px;
  line-height: 1;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: background .15s ease, border-color .15s ease;
  user-select: none;
}
.gallery-lightbox-close:hover,
.gallery-lightbox-nav:hover {
  background: rgba(0,255,255,.15);
  border-color: var(--accent);
}
.gallery-lightbox-close { top: 20px; right: 20px; }
.gallery-lightbox-prev { left: 20px; top: 50%; transform: translateY(-50%); }
.gallery-lightbox-next { right: 20px; top: 50%; transform: translateY(-50%); }
@media (max-width: 640px) {
  .gallery { grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 8px; }
  .gallery-item figcaption { font-size: 11.5px; }
  .gallery-lightbox-prev { left: 8px; }
  .gallery-lightbox-next { right: 8px; }
}

.post-footer { margin-top: 40px; padding-top: 24px; border-top: 1px solid var(--border); }
.post-tags { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.tag-label { color: var(--text-dim); font-weight: 600; font-size: 14px; }
.tag {
  display: inline-block;
  padding: 4px 12px;
  background: var(--accent-soft);
  color: var(--accent);
  border-radius: 999px;
  font-size: 13px;
  font-weight: 600;
}
.tag:hover { text-decoration: none; background: var(--accent); color: #fff; }

.post-share {
  margin-top: 24px;
  padding-top: 24px;
  border-top: 1px solid var(--border);
  display: flex;
  gap: 14px;
  align-items: center;
  flex-wrap: wrap;
}
.share-label { color: var(--text-muted); }

/* ---------- Prose (markdown content) ---------- */
.post-body h2, .post-body h3, .post-body h4 { line-height: 1.25; margin: 1.6em 0 .6em; letter-spacing: -.3px; }
.post-body p { margin: 0 0 1.1em; }
.post-body ul, .post-body ol { margin: 0 0 1.2em; padding-left: 1.4em; }
.post-body li { margin: .35em 0; }
.post-body blockquote {
  margin: 1.4em 0;
  padding: 4px 20px;
  border-left: 3px solid var(--accent);
  background: var(--surface);
  color: var(--text-muted);
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
}
.post-body code {
  font-family: var(--mono);
  font-size: .88em;
  background: var(--surface-2);
  padding: 2px 6px;
  border-radius: 5px;
  color: #7fe7ef;
}
.post-body pre {
  background: #0a0c11;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 18px 20px;
  overflow-x: auto;
  line-height: 1.5;
}
.post-body pre code { background: none; padding: 0; color: #e6e9ef; font-size: 13.5px; }
.post-body hr { border: none; border-top: 1px solid var(--border); margin: 2em 0; }
.post-body a { text-decoration: underline; text-underline-offset: 2px; }
.post-body table {
  width: 100%;
  border-collapse: collapse;
  margin: 1.4em 0;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
}
.post-body th, .post-body td {
  padding: 12px 16px;
  text-align: left;
  vertical-align: top;
  border-bottom: 1px solid var(--border);
}
.post-body thead th {
  background: var(--surface);
  font-weight: 600;
  font-size: .9em;
  letter-spacing: .2px;
  color: var(--text-muted);
  text-transform: uppercase;
  font-size: .78em;
}
.post-body tbody tr:last-child td { border-bottom: none; }
.post-body td img { width: 100%; height: auto; display: block; border-radius: var(--radius-sm); }

/* ---------- Page layout ---------- */
.page-header { padding: 48px 0 12px; }
.page-header h1 { font-size: clamp(2rem, 5vw, 3rem); margin: 0 0 10px; letter-spacing: -.5px; }
.page-subtitle { color: var(--text-muted); font-size: 1.1rem; margin: 0; }
.layout-page .container { padding-top: 20px; padding-bottom: 60px; }

/* ---------- Footer ---------- */
.site-footer {
  margin-top: 40px;
  background: var(--bg-alt);
  border-top: 1px solid var(--border);
  padding: 28px 0;
}
.footer-legal p { margin: 0; color: var(--text-muted); font-size: 14.5px; }
.footer-legal a { color: var(--text-muted); }
.footer-legal a:hover { color: var(--accent); }
.footer-small { font-size: 13px; color: var(--text-dim); }

/* ---------- Cookie consent banner ---------- */
.cookie-banner {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 1000;
  background: var(--surface);
  border-top: 1px solid var(--border);
  box-shadow: 0 -8px 24px rgba(0, 0, 0, 0.45);
  padding: 16px 0;
}
.cookie-banner-inner {
  width: 80%;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  flex-wrap: wrap;
}
.cookie-banner-text {
  margin: 0;
  color: var(--text);
  font-size: 15px;
  max-width: 60ch;
}
.cookie-banner-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}
.cookie-banner-link {
  margin-right: 4px;
  font-size: 14px;
}
@media (max-width: 640px) {
  .cookie-banner-inner { width: 100%; flex-direction: column; align-items: flex-start; }
  .cookie-banner-actions { width: 100%; justify-content: flex-end; }
}

/* ---------- Responsive ---------- */
@media (max-width: 900px) {
  .shell { flex-direction: column; }
  .sidebar {
    width: 100%;
    flex: none;
    position: static;
    height: auto;
    border-right: none;
    border-bottom: 1px solid var(--border);
    padding: 14px 18px;
  }
  .sidebar-nav { flex-direction: row; flex-wrap: wrap; gap: 6px; }
  .nav-link { padding: 8px 12px; border-left: none; border-bottom: 2px solid transparent; }
  .nav-link:hover { border-left: none; border-bottom-color: var(--accent); }
}
@media (max-width: 720px) {
  .post-list-item { grid-template-columns: 1fr; gap: 4px; }
}
