/* ── CSS Custom Properties (matching ClosersLeague dark theme) ── */
:root {
  --bg: hsl(222, 47%, 11%);
  --fg: hsl(210, 40%, 98%);
  --bg-card: hsl(222, 47%, 14%);
  --border: hsl(217, 33%, 18%);
  --primary: hsl(217, 91%, 60%);
  --primary-dark: hsl(221, 83%, 53%);
  --muted: hsl(215, 16%, 47%);
  --radius: 0.75rem;
  --font-sans: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --font-display: 'Outfit', var(--font-sans);
  --max-w: 48rem;
  --header-h: 5rem;
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html { scroll-behavior: smooth; }

body {
  background-color: var(--bg);
  color: var(--fg);
  font-family: var(--font-sans);
  font-size: 1rem;
  line-height: 1.6;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  -webkit-font-smoothing: antialiased;
}

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

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

/* ── Header ── */
.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  height: var(--header-h);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 1.5rem;
  border-bottom: 1px solid rgba(255,255,255,0.06);
  background: rgba(13, 21, 38, 0.85);
  backdrop-filter: blur(12px);
}

.site-branding a {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  text-decoration: none;
  color: var(--fg);
}

.site-branding .logo-mark {
  width: 2rem;
  height: 2rem;
  border-radius: 0.5rem;
  background: linear-gradient(135deg, var(--primary) 0%, hsl(217, 91%, 40%) 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 12px hsla(217, 91%, 60%, 0.25);
}

.site-branding .logo-mark::after {
  content: '';
  display: block;
  width: 0.75rem;
  height: 0.75rem;
  background: var(--bg);
  border-radius: 0.2rem;
}

.site-branding .site-name {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1.25rem;
  letter-spacing: -0.025em;
}

.site-branding .site-name span { color: var(--primary); }

.header-nav,
.header-nav-mobile {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.header-nav__link {
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--muted);
  text-decoration: none;
  transition: color 0.15s;
}

.header-nav__link:hover { color: var(--fg); text-decoration: none; }

.header-nav__divider {
  width: 1px;
  height: 1rem;
  background: var(--border);
}

.header-nav-mobile { display: none; }

.btn-primary--sm {
  padding: 0.375rem 0.75rem;
  font-size: 0.8125rem;
}

.btn-primary {
  display: inline-flex;
  align-items: center;
  gap: 0.375rem;
  background: var(--primary);
  color: hsl(222, 47%, 11%) !important;
  font-weight: 600;
  font-size: 0.875rem;
  padding: 0.5rem 1rem;
  border-radius: 0.75rem;
  text-decoration: none !important;
  box-shadow: 0 4px 12px hsla(217, 91%, 60%, 0.3);
  transition: transform 0.15s, box-shadow 0.15s;
}

.btn-primary:hover {
  transform: translateY(-1px);
  box-shadow: 0 6px 16px hsla(217, 91%, 60%, 0.4);
}

/* ── Main Layout ── */
.site-content { flex: 1; }

.container {
  max-width: var(--max-w);
  margin: 0 auto;
  padding: 0 1.5rem;
}

.container--wide {
  max-width: 64rem;
}

/* ── Blog Archive ── */
.blog-hero {
  padding: 4rem 0 3rem;
  border-bottom: 1px solid var(--border);
}

.blog-hero__eyebrow {
  display: inline-block;
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--primary);
  margin-bottom: 0.75rem;
}

.blog-hero__title {
  font-family: var(--font-display);
  font-size: clamp(2rem, 5vw, 3rem);
  font-weight: 800;
  line-height: 1.1;
  margin-bottom: 0.875rem;
  letter-spacing: -0.03em;
}

.blog-hero__desc {
  color: var(--muted);
  font-size: 1.125rem;
  max-width: 36rem;
}

/* ── Post Grid ── */
.posts-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1.75rem;
  padding: 3rem 0;
}

@media (min-width: 640px) {
  .posts-grid { grid-template-columns: repeat(2, 1fr); }
}

@media (min-width: 900px) {
  .posts-grid.container--wide { grid-template-columns: repeat(3, 1fr); }
}

/* ── Post Card ── */
.post-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  transition: border-color 0.15s, transform 0.15s;
  display: flex;
  flex-direction: column;
}

.post-card:hover {
  border-color: hsl(217, 91%, 30%);
  transform: translateY(-2px);
}

.post-card__thumb {
  aspect-ratio: 16/9;
  overflow: hidden;
  background: hsl(222, 47%, 16%);
}

.post-card__thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.3s;
}

.post-card:hover .post-card__thumb img { transform: scale(1.04); }

.post-card__body {
  padding: 1.25rem;
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.post-card__cats {
  display: flex;
  flex-wrap: wrap;
  gap: 0.375rem;
}

.post-card__cat {
  font-size: 0.7rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--primary);
  background: hsla(217, 91%, 60%, 0.12);
  padding: 0.15rem 0.5rem;
  border-radius: 9999px;
}

.post-card__title {
  font-family: var(--font-display);
  font-size: 1.125rem;
  font-weight: 700;
  line-height: 1.3;
  letter-spacing: -0.01em;
}

.post-card__title a { color: var(--fg); text-decoration: none; }
.post-card__title a:hover { color: var(--primary); }

.post-card__excerpt {
  color: var(--muted);
  font-size: 0.9rem;
  line-height: 1.55;
  flex: 1;
}

.post-card__meta {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.8125rem;
  color: var(--muted);
  margin-top: 0.25rem;
}

.post-card__read {
  margin-left: auto;
  color: var(--primary);
  font-size: 0.8125rem;
  font-weight: 500;
  text-decoration: none;
  white-space: nowrap;
}

.post-card__read:hover { text-decoration: underline; }

/* ── No Posts ── */
.no-posts {
  text-align: center;
  padding: 4rem 0;
  color: var(--muted);
}

/* ── Single Post ── */
.post-single { padding: 3.5rem 0 5rem; }

.post-single__back {
  display: inline-flex;
  align-items: center;
  gap: 0.375rem;
  color: var(--muted);
  font-size: 0.875rem;
  text-decoration: none;
  margin-bottom: 2rem;
  transition: color 0.15s;
}

.post-single__back:hover { color: var(--fg); }

.post-single__tags,
.post-single__cats {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
  margin-bottom: 1rem;
}

.post-single__tag,
.post-single__cat {
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--primary);
}

.post-single__title {
  font-family: var(--font-display);
  font-size: clamp(1.75rem, 4vw, 2.75rem);
  font-weight: 800;
  line-height: 1.1;
  letter-spacing: -0.03em;
  margin-bottom: 1rem;
}

.post-single__meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem 1rem;
  color: var(--muted);
  font-size: 0.875rem;
  margin-bottom: 2rem;
  padding-bottom: 2rem;
  border-bottom: 1px solid var(--border);
}

.post-single__featured {
  border-radius: var(--radius);
  overflow: hidden;
  margin-bottom: 2.5rem;
  aspect-ratio: 16/9;
  background: hsl(222, 47%, 16%);
}

.post-single__featured img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

/* ── Post Content (Prose) ── */
.post-content {
  color: hsl(210, 30%, 82%);
  line-height: 1.8;
  font-size: 1.0625rem;
}

.post-content h1,
.post-content h2,
.post-content h3,
.post-content h4,
.post-content h5,
.post-content h6 {
  font-family: var(--font-display);
  color: var(--fg);
  line-height: 1.25;
  letter-spacing: -0.02em;
  margin: 2rem 0 0.75rem;
}

.post-content h2 { font-size: 1.625rem; font-weight: 700; }
.post-content h3 { font-size: 1.25rem; font-weight: 700; }
.post-content h4 { font-size: 1.125rem; font-weight: 600; }

.post-content p { margin-bottom: 1.25rem; }

.post-content a { color: var(--primary); }
.post-content a:hover { text-decoration: underline; }

.post-content strong, .post-content b { color: var(--fg); font-weight: 600; }
.post-content em, .post-content i { font-style: italic; }

.post-content ul, .post-content ol {
  padding-left: 1.5rem;
  margin-bottom: 1.25rem;
}

.post-content li { margin-bottom: 0.375rem; }

.post-content blockquote {
  border-left: 3px solid var(--primary);
  padding: 0.75rem 1.25rem;
  margin: 1.5rem 0;
  background: hsla(217, 91%, 60%, 0.06);
  border-radius: 0 var(--radius) var(--radius) 0;
  font-style: italic;
  color: hsl(210, 30%, 75%);
}

.post-content pre {
  background: hsl(222, 47%, 8%);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.25rem;
  overflow-x: auto;
  margin-bottom: 1.25rem;
}

.post-content code {
  font-family: Menlo, 'Courier New', monospace;
  font-size: 0.875em;
  color: hsl(217, 91%, 75%);
  background: hsla(217, 91%, 60%, 0.1);
  padding: 0.1em 0.35em;
  border-radius: 0.3rem;
}

.post-content pre code {
  background: none;
  padding: 0;
  color: hsl(210, 30%, 80%);
}

.post-content img {
  border-radius: var(--radius);
  margin: 1.5rem 0;
}

.post-content hr {
  border: none;
  border-top: 1px solid var(--border);
  margin: 2.5rem 0;
}

.post-content table {
  width: 100%;
  border-collapse: collapse;
  margin-bottom: 1.25rem;
  font-size: 0.9375rem;
}

.post-content th, .post-content td {
  padding: 0.625rem 0.875rem;
  border: 1px solid var(--border);
  text-align: left;
}

.post-content th {
  background: var(--bg-card);
  font-weight: 600;
  color: var(--fg);
}

/* ── Post CTA ── */
.post-cta {
  border-top: 1px solid var(--border);
  margin-top: 4rem;
  padding-top: 2.5rem;
  display: flex;
  flex-direction: column;
  gap: 1rem;
  align-items: flex-start;
}

.post-cta__text {
  font-size: 1.125rem;
  font-weight: 600;
  font-family: var(--font-display);
}

.post-cta__sub {
  color: var(--muted);
  font-size: 0.9375rem;
  max-width: 36rem;
}

/* ── Pagination ── */
.pagination {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 0.5rem;
  padding: 1rem 0 3rem;
}

.pagination a,
.pagination .current {
  padding: 0.5rem 0.875rem;
  border-radius: 0.5rem;
  font-size: 0.875rem;
  font-weight: 500;
  border: 1px solid var(--border);
  text-decoration: none;
  color: var(--muted);
  transition: all 0.15s;
}

.pagination a:hover {
  border-color: var(--primary);
  color: var(--primary);
  text-decoration: none;
}

.pagination .current {
  background: var(--primary);
  color: hsl(222, 47%, 11%);
  border-color: var(--primary);
}

/* ── Footer ── */
.site-footer {
  border-top: 1px solid rgba(255,255,255,0.06);
  background: rgba(13, 21, 38, 0.6);
  padding: 2rem 1.5rem;
}

.site-footer__inner {
  max-width: var(--max-w);
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1rem;
}

@media (min-width: 600px) {
  .site-footer__inner {
    flex-direction: row;
    justify-content: space-between;
  }
}

.site-footer__copy {
  font-size: 0.875rem;
  color: var(--muted);
}

.site-footer__links {
  display: flex;
  align-items: center;
  gap: 1rem;
  flex-wrap: wrap;
}

.site-footer__links a {
  font-size: 0.875rem;
  color: var(--muted);
  text-decoration: none;
  transition: color 0.15s;
}

.site-footer__links a:hover { color: var(--fg); }

.site-footer__sep {
  color: var(--border);
  user-select: none;
}

/* ── Responsive ── */
@media (max-width: 767px) {
  .header-nav { display: none; }
  .header-nav-mobile { display: flex; }
}

@media (min-width: 768px) {
  .header-nav-mobile { display: none; }
}
