/* ============================================================
   Wexels — Shared Blog Styles (blog.php + post.php)
   ============================================================ */

@font-face {
  font-family: 'DepartureMono';
  src: url('https://cdn.jsdelivr.net/gh/rektdeckard/departure-mono@v1.500/public/assets/DepartureMono-Regular.woff2') format('woff2'),
       url('https://cdn.jsdelivr.net/gh/rektdeckard/departure-mono@v1.500/public/assets/DepartureMono-Regular.woff') format('woff');
  font-weight: 400; font-style: normal; font-display: swap;
}

/* ── reset + tokens ── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --bg:          #0A0E14;
  --bg-2:        #0F141C;
  --surface:     #131A24;
  --surface-2:   #192130;
  --line:        rgba(74,127,170,.15);
  --line-strong: rgba(74,127,170,.3);
  --accent:      #4A7FAA;
  --accent-hi:   #7BB3D8;
  --ink:         #E8EFF7;
  --ink-dim:     #9BA8B5;
  --ink-mute:    #5C6E7E;
  --font-title:  'DepartureMono', monospace;
  --font-body:   'Space Grotesk', sans-serif;
  --font-mono:   'JetBrains Mono', monospace;
  --r:           14px;
}

html { scroll-behavior: smooth; }

body {
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.65;
  min-height: 100vh;
}

a { color: var(--accent-hi); text-decoration: none; }
a:hover { text-decoration: underline; }
img { display: block; max-width: 100%; }

.container { width: 100%; max-width: 1240px; margin: 0 auto; padding: 0 32px; }
@media (max-width: 600px) { .container { padding: 0 16px; } }

/* ── nav ── */
.nav {
  position: fixed; top: 0; left: 0; right: 0; z-index: 200;
  padding: 0 32px; height: 70px;
  display: flex; align-items: center; justify-content: space-between;
  transition: background .3s, box-shadow .3s;
}
.nav.scrolled {
  background: rgba(10,14,20,.94);
  backdrop-filter: blur(14px);
  box-shadow: 0 1px 0 var(--line);
}
.logo { display: flex; align-items: center; gap: 10px; color: var(--ink); }
.logo img { height: 32px; width: auto; }
.logo-word { font-size: 20px; letter-spacing: -.01em; line-height: 1; }
.logo-word .lw-we  { font-family: 'Space Grotesk', sans-serif; font-weight: 700; }
.logo-word .lw-xels { font-family: var(--font-title); font-weight: 400; letter-spacing: -.02em; font-size: .92em; }

.nav-links {
  display: flex; gap: 28px;
  font-size: 14px; color: var(--ink-dim);
}
.nav-links a { color: inherit; transition: color .2s; }
.nav-links a:hover, .nav-links a.active { color: var(--ink); text-decoration: none; }
.nav-links a.active { color: var(--accent-hi); }

.btn { display: inline-flex; align-items: center; gap: 8px; padding: 10px 20px; border-radius: 10px; font-size: 14px; font-weight: 600; cursor: pointer; border: none; transition: all .2s; text-decoration: none; }
.btn i { transition: transform .2s; }
.btn:hover i { transform: translateX(4px); }
.btn-primary { background: var(--accent); color: var(--ink); }
.btn-primary:hover { background: var(--accent-hi); color: #0A0E14; text-decoration: none; }
.btn-ghost { background: transparent; border: 1px solid var(--line-strong); color: var(--ink-dim); }
.btn-ghost:hover { border-color: var(--accent); color: var(--ink); text-decoration: none; }

/* hamburger (mobile) */
.nav-burger { display: none; flex-direction: column; gap: 5px; background: none; border: none; cursor: pointer; padding: 4px; }
.nav-burger span { width: 22px; height: 2px; background: var(--ink-dim); border-radius: 2px; transition: all .2s; }
.nav-mobile { display: none; position: fixed; inset: 70px 0 0; background: rgba(10,14,20,.98); backdrop-filter: blur(16px); z-index: 190; padding: 32px; flex-direction: column; gap: 24px; }
.nav-mobile.open { display: flex; }
.nav-mobile a { font-size: 18px; color: var(--ink-dim); padding: 8px 0; border-bottom: 1px solid var(--line); }
.nav-mobile a.active { color: var(--accent-hi); }

@media (max-width: 900px) {
  .nav-links, .nav-cta { display: none; }
  .nav-burger { display: flex; }
}

/* ── footer ── */
.blog-footer {
  margin-top: 100px;
  border-top: 1px solid var(--line);
  padding: 48px 0 32px;
}
.blog-footer-inner {
  display: flex; align-items: center; justify-content: space-between;
  flex-wrap: wrap; gap: 16px;
}
.blog-footer-copy { font-size: 13px; color: var(--ink-mute); }

/* ── hero (archive) ── */
.cs-hero {
  padding: 160px 0 80px;
  position: relative; overflow: hidden;
}
.cs-hero-eyebrow {
  font-family: var(--font-mono); font-size: 11px;
  letter-spacing: .2em; text-transform: uppercase;
  color: var(--ink-mute); margin-bottom: 20px;
}
.cs-hero-title {
  font-family: var(--font-title);
  font-size: clamp(42px, 7vw, 82px);
  line-height: 1.05; letter-spacing: -.02em;
  color: var(--ink); margin-bottom: 20px;
}
.cs-hero-title span { color: var(--accent-hi); }
.cs-hero-sub {
  font-size: 18px; color: var(--ink-dim);
  max-width: 540px; line-height: 1.7;
  margin-bottom: 36px;
}

/* tag filter bar */
.cs-tag-bar {
  display: flex; align-items: center; gap: 8px; flex-wrap: wrap;
}
.cs-tag-pill {
  font-family: var(--font-mono); font-size: 11px;
  letter-spacing: .1em; text-transform: uppercase;
  padding: 5px 14px; border-radius: 999px;
  border: 1px solid var(--line);
  color: var(--ink-mute); background: transparent;
  cursor: pointer; transition: all .2s; text-decoration: none;
  display: inline-block;
}
.cs-tag-pill:hover { border-color: var(--line-strong); color: var(--ink); text-decoration: none; }
.cs-tag-pill.active {
  background: rgba(74,127,170,.12);
  border-color: var(--accent);
  color: var(--ink);
}
.cs-tag-pill.clear { color: #f87171; border-color: rgba(248,113,113,.3); }
.cs-tag-pill.clear:hover { background: rgba(248,113,113,.08); }

/* ── grid section ── */
.cs-section { padding: 0 0 80px; }

.cs-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 24px;
  margin-bottom: 56px;
}
@media (max-width: 1080px) { .cs-grid { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 640px)  { .cs-grid { grid-template-columns: 1fr; } }

/* ── card ── */
.cs-card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r);
  overflow: hidden;
  transition: border-color .25s, transform .25s;
  opacity: 0;
  transform: translateY(16px);
}
.cs-card.visible {
  animation: cs-in .45s ease forwards;
}
@keyframes cs-in {
  to { opacity: 1; transform: none; }
}
.cs-card:hover { border-color: var(--line-strong); transform: translateY(-4px); }
.cs-card a { display: block; color: inherit; text-decoration: none; }

.cs-cover {
  position: relative; height: 200px; overflow: hidden;
  background: linear-gradient(135deg, rgba(74,127,170,.12), rgba(46,74,107,.06));
}
.cs-cover img {
  width: 100%; height: 100%; object-fit: cover;
  transition: transform .4s ease;
  filter: brightness(.8) saturate(1.1);
}
.cs-card:hover .cs-cover img { transform: scale(1.04); }
.cs-cover-placeholder {
  width: 100%; height: 100%;
  display: flex; align-items: center; justify-content: center;
  font-size: 36px; color: var(--accent);
  opacity: .3;
}

.cs-type-badge {
  position: absolute; top: 14px; left: 14px;
  font-family: var(--font-mono); font-size: 10px;
  letter-spacing: .14em; text-transform: uppercase;
  padding: 4px 10px; border-radius: 6px;
  border: 1px solid; backdrop-filter: blur(6px);
}

.cs-card-body { padding: 20px; }

.cs-card-tags {
  display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 12px;
}
.cs-card-tag {
  font-family: var(--font-mono); font-size: 10px;
  letter-spacing: .08em; text-transform: uppercase;
  padding: 3px 9px; border-radius: 5px;
  border: 1px solid;
}

.cs-card-title {
  font-family: var(--font-title);
  font-size: 18px; line-height: 1.35; letter-spacing: -.01em;
  color: var(--ink); margin-bottom: 10px;
  transition: color .2s;
}
.cs-card:hover .cs-card-title { color: var(--accent-hi); }

.cs-card-excerpt {
  font-size: 14px; color: var(--ink-dim);
  line-height: 1.65; margin-bottom: 16px;
  display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical;
  overflow: hidden;
}

.cs-card-meta {
  display: flex; align-items: center; gap: 12px;
  font-family: var(--font-mono); font-size: 11px;
  color: var(--ink-mute); letter-spacing: .06em;
  border-top: 1px solid var(--line); padding-top: 12px;
}
.cs-card-meta i { color: var(--accent); font-size: 10px; }

/* ── empty state ── */
.cs-empty {
  text-align: center; padding: 80px 32px;
  color: var(--ink-mute); grid-column: 1 / -1;
}
.cs-empty i { font-size: 40px; margin-bottom: 20px; display: block; color: var(--accent); opacity: .3; }

/* ── pagination ── */
.cs-pagination {
  display: flex; align-items: center; justify-content: center; gap: 8px;
}
.cs-page-btn {
  display: flex; align-items: center; justify-content: center;
  min-width: 38px; height: 38px; padding: 0 12px;
  border-radius: 10px; border: 1px solid var(--line);
  background: transparent; color: var(--ink-dim);
  font-family: var(--font-mono); font-size: 13px;
  cursor: pointer; transition: all .2s; text-decoration: none;
}
.cs-page-btn:hover { border-color: var(--line-strong); color: var(--ink); text-decoration: none; }
.cs-page-btn.active { background: rgba(74,127,170,.12); border-color: var(--accent); color: var(--ink); }
.cs-page-btn.disabled { opacity: .3; cursor: default; pointer-events: none; }

/* ── single post ── */
.post-hero {
  padding-top: 120px;
  margin-bottom: 56px;
}
.post-cover {
  position: relative; border-radius: var(--r); overflow: hidden;
  height: clamp(260px, 42vw, 500px);
  margin-bottom: 48px;
  background: linear-gradient(135deg, rgba(74,127,170,.12), rgba(46,74,107,.06));
}
.post-cover img { width: 100%; height: 100%; object-fit: cover; filter: brightness(.75) saturate(1.1); }
.post-cover-placeholder {
  width: 100%; height: 100%;
  display: flex; align-items: center; justify-content: center;
  font-size: 56px; color: var(--accent); opacity: .2;
}
.post-cover-overlay {
  position: absolute; inset: 0;
  background: linear-gradient(to top, rgba(10,14,20,.7) 0%, transparent 60%);
}

.post-breadcrumb {
  font-family: var(--font-mono); font-size: 12px; letter-spacing: .1em;
  color: var(--ink-mute); margin-bottom: 24px;
  display: flex; align-items: center; gap: 8px;
}
.post-breadcrumb a { color: var(--ink-mute); transition: color .2s; }
.post-breadcrumb a:hover { color: var(--accent-hi); text-decoration: none; }

.post-title {
  font-family: var(--font-title);
  font-size: clamp(28px, 5vw, 52px);
  line-height: 1.15; letter-spacing: -.02em;
  color: var(--ink); margin-bottom: 24px;
}

.post-meta-row {
  display: flex; align-items: center; flex-wrap: wrap; gap: 12px;
  margin-bottom: 20px;
}
.post-tags {
  display: flex; flex-wrap: wrap; gap: 8px;
  margin-bottom: 40px;
}

/* ── prose ── */
.prose {
  max-width: 720px;
  font-family: var(--font-body);
  font-size: 17px; line-height: 1.85;
  color: var(--ink-dim);
}
.prose h1, .prose h2, .prose h3, .prose h4 {
  font-family: var(--font-title);
  color: var(--ink); letter-spacing: -.01em;
  margin: 2em 0 .75em;
}
.prose h1 { font-size: 2em; }
.prose h2 { font-size: 1.5em; padding-bottom: 10px; border-bottom: 1px solid var(--line); }
.prose h3 { font-size: 1.2em; }
.prose h4 { font-size: 1em; color: var(--accent-hi); }
.prose p { margin-bottom: 1.4em; }
.prose a { color: var(--accent-hi); text-decoration: underline; text-underline-offset: 3px; }
.prose strong { color: var(--ink); font-weight: 600; }
.prose em { color: var(--ink); }
.prose ul, .prose ol { padding-left: 1.5em; margin-bottom: 1.4em; }
.prose li { margin-bottom: .4em; }
.prose blockquote {
  border-left: 3px solid var(--accent);
  padding: 12px 20px; margin: 1.5em 0;
  background: rgba(74,127,170,.06); border-radius: 0 8px 8px 0;
  color: var(--ink-dim); font-style: italic;
}
.prose code {
  font-family: var(--font-mono); font-size: .85em;
  background: var(--surface-2); padding: 2px 7px;
  border-radius: 5px; color: var(--accent-hi);
}
.prose pre {
  background: var(--surface); border: 1px solid var(--line);
  border-radius: 10px; padding: 20px 24px; margin: 1.5em 0;
  overflow-x: auto; font-family: var(--font-mono); font-size: .88em;
  line-height: 1.7; color: var(--ink-dim);
}
.prose pre code { background: none; padding: 0; font-size: inherit; color: inherit; }
.prose hr { border: none; border-top: 1px solid var(--line); margin: 2.5em 0; }
.prose img { border-radius: 10px; margin: 1.5em 0; border: 1px solid var(--line); }

/* ── related posts ── */
.related-section { margin-top: 80px; padding-top: 48px; border-top: 1px solid var(--line); }
.related-label {
  font-family: var(--font-mono); font-size: 11px;
  letter-spacing: .18em; text-transform: uppercase;
  color: var(--ink-mute); margin-bottom: 24px;
}
.related-grid {
  display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px;
}
@media (max-width: 900px) { .related-grid { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 580px) { .related-grid { grid-template-columns: 1fr; } }
