/* ────────────────────────────────
   PeerLLM Blog Theme — Unified with PeerLLM.com
   ──────────────────────────────── */

:root {
  --bg: 220 39% 11%;
  --fg: 220 27% 98%;
  --muted: 220 32% 17%;
  --muted-fg: 220 20% 65%;
  --card: 220 32% 17%;
  --border: 220 32% 17%;
  --primary: 213 94% 68%;
  --secondary: 25 95% 53%;
  --ring: 213 94% 68%;
  --grad-hero: linear-gradient(135deg, hsl(213 94% 68%) 0%, hsl(25 95% 53%) 100%);
  --radius: 14px;
  --shadow-1: 0 1px 2px hsl(0 0% 0% / .15), 0 6px 24px hsl(0 0% 0% / .25);
  --shadow-2: 0 10px 30px hsl(213 94% 68% / .18);
  --space-5: 2rem;
  --space-6: 3rem;
  --max-w: 900px;
}

/* Base */
html, body {
  margin: 0;
  background: hsl(var(--bg));
  color: hsl(var(--fg));
  font-family: "Inter", system-ui, -apple-system, Segoe UI, Roboto, sans-serif;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

a {
  color: hsl(var(--primary));
  text-decoration: none;
  transition: color .2s ease;
}
a:hover {
  color: hsl(var(--secondary));
}

/* Header */
header {
  position: sticky;
  top: 0;
  background: hsl(var(--bg) / .8);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid hsl(var(--border) / .6);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1rem 2rem;
  z-index: 10;
}
header img { height: 2.5rem; }
header nav a {
  color: hsl(var(--fg));
  margin-left: 1.25rem;
  font-weight: 500;
  opacity: .9;
}
header nav a:hover { color: hsl(var(--primary)); }

/* Hero */
.hero {
  text-align: center;
  padding-block: var(--space-6);
  background: var(--grad-hero);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}
.hero h1 {
  font-weight: 800;
  letter-spacing: -0.02em;
  font-size: clamp(2rem, 2vw + 1.5rem, 3.5rem);
  line-height: 1.1;
}
.hero p {
  color: hsl(var(--muted-fg));
  max-width: 65ch;
  margin-inline: auto;
}

/* ────────────────────────────────
   Blog List
   ──────────────────────────────── */
.blog-list {
  max-width: var(--max-w);
  margin: 0 auto;
  padding: var(--space-6) 1rem;
  display: grid;
  gap: 1.5rem;
}

.post-item {
  background: hsl(var(--card));
  border: 1px solid hsl(var(--border) / .6);
  border-radius: 10px;
  padding: 1.5rem 1.75rem;
  box-shadow: 0 2px 10px hsl(0 0% 0% / 0.15);
  transition: transform 0.25s ease, box-shadow 0.25s ease;
}
.post-item:hover {
  transform: translateY(-4px);
  box-shadow: 0 6px 18px hsl(0 0% 0% / 0.3);
}

.post-title {
  font-size: clamp(1.00rem, 0.5vw + 1rem, 1.65rem);
  font-weight: 700;
  background: var(--grad-hero);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  line-height: 1.3;
}
.post-meta {
  color: hsl(var(--muted-fg));
  font-size: 0.9rem;
  margin-bottom: 0.5rem;
}
.post-excerpt {
  color: hsl(var(--muted-fg));
  margin-top: 0.75rem;
  line-height: 1.6;
  font-size: 0.95rem;
}

/* ────────────────────────────────
   Single Post Page
   ──────────────────────────────── */
.post {
  max-width: var(--max-w);
  margin: 0 auto;
  padding: var(--space-6) 1rem;
}

/* Scroll-Responsive Post Header */
.post-header {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  margin-bottom: 2rem;
  position: relative;
  transition: all 0.35s ease-in-out;
}

.post-header.shrink {
  transform: scale(0.9);
  opacity: 0.9;
  backdrop-filter: blur(10px);
  background: hsl(var(--bg) / 0.4);
  border-radius: var(--radius);
  padding: 0.5rem 1rem;
}

.post-title {
  font-size: clamp(2rem, 3vw, 3.2rem);
  font-weight: 800;
  background: var(--grad-hero);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  margin-bottom: 0.75rem;
  transition: font-size 0.3s ease, transform 0.3s ease;
}

.post-header.shrink .post-title {
  font-size: clamp(1.6rem, 2vw, 2rem);
  transform: translateY(-4px);
}

.post-meta {
  margin-top: 0.25rem;
  text-align: center;
}
.post-date {
  color: hsl(var(--muted-fg));
  font-size: 0.95rem;
  margin: 0;
}
.post-author {
  color: hsl(var(--muted-fg));
  font-size: 0.95rem;
  margin: 0.2rem 0 0;
  font-style: italic;
}

.post-content {
  color: hsl(var(--muted-fg));
  font-size: 1.05rem;
  line-height: 1.75;
}
.post-content pre {
  background: hsl(var(--muted));
  padding: 1rem;
  border-radius: var(--radius);
  overflow-x: auto;
  box-shadow: var(--shadow-2);
}
.post-footer {
  text-align: center;
  margin-top: var(--space-6);
}
.back-link {
  color: hsl(var(--primary));
  border-bottom: 1px dashed transparent;
}
.back-link:hover {
  color: hsl(var(--secondary));
  border-color: hsl(var(--secondary));
}

/* Footer */
footer {
  background: hsl(var(--card));
  border-top: 1px solid hsl(var(--border) / .6);
  text-align: center;
  padding: var(--space-5);
  color: hsl(var(--muted-fg));
  font-size: .9rem;
}

/* ────────────────────────────────
   Responsive Design (Mobile & Tablet)
   ──────────────────────────────── */

img, video {
  max-width: 100%;
  height: auto;
}

.container {
  max-width: var(--max-w);
  margin-inline: auto;
  padding-inline: 1.25rem;
}

/* Header Responsive */
@media (max-width: 880px) {
  header {
    flex-direction: column;
    align-items: center;
    text-align: center;
    padding: 1rem 1rem 0.75rem;
  }
  header img { height: 2.2rem; }
  header nav { margin-top: 0.75rem; }
  header nav a {
    display: inline-block;
    margin: 0.4rem 0.6rem;
    font-size: 0.95rem;
  }
}

/* Hero Section */
@media (max-width: 768px) {
  .hero { padding-block: 3rem; }
  .hero h1 { font-size: clamp(1.75rem, 6vw, 2.5rem); line-height: 1.2; }
  .hero p { font-size: 1rem; padding-inline: 1rem; }
}

/* Blog List */
@media (max-width: 768px) {
  .blog-list {
    grid-template-columns: 1fr;
    padding-inline: 1rem;
    gap: 1.5rem;
  }
  .post-item {
    padding: 1.25rem;
    margin-bottom: 1.25rem;
  }
  .post-title {
    font-size: 1.35rem;
    line-height: 1.3;
  }
  .post-excerpt {
    font-size: 0.95rem;
    line-height: 1.65;
  }
}

/* Single Post Page */
@media (max-width: 768px) {
  .post { padding-inline: 1rem; }
  .post-header { margin-bottom: 2rem; }
  .post-title { font-size: 1.75rem; }
  .post-date { font-size: 0.85rem; }
  .post-content { font-size: 1rem; }
  .post-content pre {
    padding: 0.75rem;
    font-size: 0.9rem;
  }
}

/* Footer Responsive */
@media (max-width: 768px) {
  footer {
    padding: 1.5rem;
    font-size: 0.85rem;
    line-height: 1.5;
  }
}

/* Tiny Devices */
@media (max-width: 400px) {
  header img { height: 2rem; }
  .hero h1 { font-size: 1.5rem; }
  .post-item { padding: 1.1rem; }
}
