/* ================================================================
   GhostPilot AI - shared blog styles
   Loaded by /blog/index.html and every /blog/<slug>/index.html.
   Tailwind CDN is loaded alongside; these styles cover:
     - background (blobs, grid)
     - nav + footer glass
     - long-form article typography (prose)
     - post card grid
   ================================================================ */

:root { color-scheme: dark; }

html { scroll-behavior: smooth; }

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  background: #050507;
  color: #e4e4e7;
  -webkit-font-smoothing: antialiased;
}

/* ── background layer ── */
.grid-overlay {
  background-image:
    linear-gradient(rgba(255,255,255,0.03) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255,255,255,0.03) 1px, transparent 1px);
  background-size: 52px 52px;
  mask-image: radial-gradient(circle at center, black 40%, transparent 90%);
}
.blob { position: fixed; border-radius: 999px; filter: blur(80px); pointer-events: none; z-index: 0; }
.blob-a { width:26rem; height:26rem; left:-6rem; top:-5rem;
  background:radial-gradient(circle, rgba(124,58,237,.45), rgba(124,58,237,0));
  animation: driftA 18s ease-in-out infinite alternate; }
.blob-b { width:22rem; height:22rem; right:-4rem; top:22%;
  background:radial-gradient(circle, rgba(96,165,250,.22), rgba(96,165,250,0));
  animation: driftB 22s ease-in-out infinite alternate; }
.blob-c { width:20rem; height:20rem; right:18%; bottom:-7rem;
  background:radial-gradient(circle, rgba(167,139,250,.3), rgba(167,139,250,0));
  animation: driftC 20s ease-in-out infinite alternate; }
@keyframes driftA { 0%{transform:translate3d(0,0,0) scale(.94)} 100%{transform:translate3d(70px,50px,0) scale(1.1)} }
@keyframes driftB { 0%{transform:translate3d(0,0,0) scale(.96)} 100%{transform:translate3d(-70px,40px,0) scale(1.06)} }
@keyframes driftC { 0%{transform:translate3d(0,0,0) scale(.92)} 100%{transform:translate3d(-40px,-50px,0) scale(1.08)} }

/* ── glass surfaces ── */
.glass      { background: rgba(255,255,255,.06); border: 1px solid rgba(255,255,255,.16);
  backdrop-filter: blur(20px); -webkit-backdrop-filter: blur(20px); }
.glass-soft { background: rgba(255,255,255,.045); border: 1px solid rgba(255,255,255,.14);
  backdrop-filter: blur(20px); -webkit-backdrop-filter: blur(20px); }

/* ── nav ── */
.blog-nav {
  background: rgba(10,10,16,.6);
  border: 1px solid rgba(255,255,255,.14);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
}

/* ── buttons ── */
.btn-lift { transition: transform .25s ease, box-shadow .25s ease, background-color .25s ease; }
.btn-lift:hover { transform: scale(1.03); }

/* ════════════════════════════════════════════════════════════════
   POST CARD GRID (blog index)
   ════════════════════════════════════════════════════════════════ */

.post-card {
  display: flex;
  flex-direction: column;
  overflow: hidden;
  border-radius: 20px;
  background: rgba(255,255,255,.04);
  border: 1px solid rgba(255,255,255,.1);
  transition: border-color .3s ease, transform .3s ease, box-shadow .3s ease;
  text-decoration: none;
  color: inherit;
}
.post-card:hover {
  border-color: rgba(124,58,237,.5);
  transform: translateY(-4px);
  box-shadow: 0 20px 50px -20px rgba(124,58,237,.35);
}
.post-card-media {
  aspect-ratio: 16 / 9;
  background: linear-gradient(135deg, rgba(124,58,237,.25), rgba(37,99,235,.2));
  position: relative;
  overflow: hidden;
  border-bottom: 1px solid rgba(255,255,255,.08);
}
.post-card-media img {
  width: 100%; height: 100%; object-fit: cover; display: block;
  transition: transform .5s ease;
}
.post-card:hover .post-card-media img { transform: scale(1.04); }
.post-card-body { padding: 22px 22px 24px; display: flex; flex-direction: column; gap: 10px; flex: 1; }
.post-card-meta {
  font-size: 11px;
  color: #71717a;
  text-transform: uppercase;
  letter-spacing: .14em;
  font-weight: 600;
}
.post-card-title { font-size: 20px; font-weight: 600; color: #f4f4f5; line-height: 1.3; }
.post-card-excerpt { font-size: 14px; color: #a1a1aa; line-height: 1.6; flex: 1; }
.post-card-cta { font-size: 13px; color: #a78bfa; font-weight: 600; margin-top: 4px; }

/* Featured/hero post (first card larger) */
.post-card--featured {
  grid-column: 1 / -1;
  flex-direction: row;
}
.post-card--featured .post-card-media { aspect-ratio: auto; min-height: 280px; flex: 1.2; border-bottom: none; border-right: 1px solid rgba(255,255,255,.08); }
.post-card--featured .post-card-body { flex: 1; padding: 36px; justify-content: center; gap: 14px; }
.post-card--featured .post-card-title { font-size: 30px; line-height: 1.2; }
.post-card--featured .post-card-excerpt { font-size: 15px; }
@media (max-width: 720px) {
  .post-card--featured { flex-direction: column; }
  .post-card--featured .post-card-media { aspect-ratio: 16 / 9; min-height: 0; border-right: none; border-bottom: 1px solid rgba(255,255,255,.08); }
  .post-card--featured .post-card-body { padding: 22px; }
  .post-card--featured .post-card-title { font-size: 22px; }
}

/* ════════════════════════════════════════════════════════════════
   LONG-FORM PROSE (post body)
   Target reading width ~70ch; tuned for 1500–3000 words.
   ════════════════════════════════════════════════════════════════ */

.prose {
  max-width: 72ch;
  margin: 0 auto;
  color: #d4d4d8;
  font-size: 17px;
  line-height: 1.75;
}
.prose > * + * { margin-top: 1.15em; }

.prose h1 {
  font-size: clamp(2rem, 5vw, 2.8rem);
  line-height: 1.15;
  font-weight: 700;
  color: #ffffff;
  letter-spacing: -0.01em;
  margin-top: 0;
}
.prose h2 {
  font-size: clamp(1.5rem, 3vw, 1.9rem);
  line-height: 1.25;
  font-weight: 600;
  color: #ffffff;
  letter-spacing: -0.01em;
  margin-top: 2em;
  padding-top: .2em;
}
.prose h3 {
  font-size: 1.25rem;
  font-weight: 600;
  color: #ffffff;
  margin-top: 1.6em;
}
.prose h4 {
  font-size: 1.05rem;
  font-weight: 600;
  color: #e4e4e7;
  margin-top: 1.4em;
}

.prose p { color: #d4d4d8; }
.prose strong { color: #ffffff; font-weight: 600; }
.prose em { color: #e4e4e7; }
.prose a {
  color: #a78bfa;
  text-decoration: underline;
  text-decoration-color: rgba(167,139,250,.35);
  text-underline-offset: 3px;
  transition: color .15s, text-decoration-color .15s;
}
.prose a:hover { color: #c4b5fd; text-decoration-color: rgba(196,181,253,.8); }

.prose ul, .prose ol { padding-left: 1.25em; }
.prose ul { list-style: disc; }
.prose ol { list-style: decimal; }
.prose li { margin: .4em 0; color: #d4d4d8; }
.prose li::marker { color: #7c3aed; }

.prose blockquote {
  margin: 1.6em 0;
  padding: 1em 1.25em;
  border-left: 3px solid #7c3aed;
  background: rgba(124,58,237,.06);
  border-radius: 0 10px 10px 0;
  color: #e4e4e7;
  font-style: italic;
}
.prose blockquote p { color: #e4e4e7; }

.prose code {
  font-family: "JetBrains Mono", ui-monospace, "SF Mono", Menlo, Consolas, monospace;
  font-size: .9em;
  background: rgba(124,58,237,.12);
  color: #e0d7ff;
  padding: 2px 6px;
  border-radius: 5px;
  border: 1px solid rgba(124,58,237,.18);
}
.prose pre {
  font-family: "JetBrains Mono", ui-monospace, "SF Mono", Menlo, Consolas, monospace;
  font-size: .92em;
  background: rgba(0,0,0,.5);
  color: #e4e4e7;
  padding: 1.1em 1.3em;
  border-radius: 10px;
  border: 1px solid rgba(255,255,255,.08);
  overflow-x: auto;
  line-height: 1.65;
}
.prose pre code { background: none; color: inherit; padding: 0; border: none; font-size: inherit; }

.prose hr { border: 0; height: 1px; background: rgba(255,255,255,.08); margin: 2.5em 0; }

.prose img, .prose figure img, .prose video {
  width: 100%;
  border-radius: 12px;
  border: 1px solid rgba(255,255,255,.08);
  display: block;
}
.prose figure { margin: 1.8em 0; }
.prose figcaption {
  margin-top: .7em;
  text-align: center;
  font-size: 13px;
  color: #71717a;
}

.prose table {
  width: 100%;
  border-collapse: collapse;
  font-size: .95em;
  margin: 1.5em 0;
  overflow: hidden;
  border-radius: 10px;
  border: 1px solid rgba(255,255,255,.1);
}
.prose thead { background: rgba(124,58,237,.1); }
.prose th, .prose td {
  padding: .7em 1em;
  text-align: left;
  border-bottom: 1px solid rgba(255,255,255,.06);
}
.prose th { color: #ffffff; font-weight: 600; }
.prose tbody tr:last-child td { border-bottom: none; }

/* Post header ("kicker" + title + meta block) */
.post-header {
  max-width: 72ch;
  margin: 0 auto 2.2em;
  text-align: left;
}
.post-kicker {
  display: inline-block;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: .18em;
  text-transform: uppercase;
  color: #a78bfa;
  margin-bottom: .75em;
}
.post-title {
  font-size: clamp(2rem, 5.5vw, 3rem);
  line-height: 1.1;
  font-weight: 700;
  color: #ffffff;
  letter-spacing: -0.015em;
  margin: 0 0 .6em;
}
.post-subtitle {
  font-size: clamp(1.05rem, 2.2vw, 1.2rem);
  color: #a1a1aa;
  line-height: 1.5;
  margin: 0 0 1em;
}
.post-meta {
  font-size: 13px;
  color: #71717a;
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}
.post-meta > * + *::before {
  content: "•";
  margin-right: 10px;
  color: #3f3f46;
}

.post-hero-image {
  max-width: 1000px;
  margin: 0 auto 3em;
  border-radius: 16px;
  overflow: hidden;
  border: 1px solid rgba(255,255,255,.08);
}
.post-hero-image img { width: 100%; display: block; }

/* Inline CTA - drop anywhere inside .prose */
.prose .inline-cta {
  margin: 2em 0;
  padding: 1.5em 1.75em;
  border-radius: 14px;
  background: linear-gradient(120deg, rgba(124,58,237,.12), rgba(37,99,235,.08));
  border: 1px solid rgba(124,58,237,.3);
}
.prose .inline-cta p { margin: 0 0 .8em; color: #e4e4e7; }
.prose .inline-cta .btn {
  display: inline-block;
  padding: .6em 1.2em;
  background: #7c3aed;
  color: #ffffff;
  text-decoration: none;
  font-weight: 600;
  border-radius: 999px;
  box-shadow: 0 0 22px rgba(124,58,237,.45);
}
.prose .inline-cta .btn:hover { text-decoration: none; }

/* Bottom CTA after article */
.post-bottom-cta {
  max-width: 72ch;
  margin: 3em auto 0;
  padding: 2em;
  border-radius: 18px;
  background: linear-gradient(120deg, rgba(124,58,237,.95), rgba(76,29,149,.9), rgba(37,99,235,.82));
  text-align: center;
}
.post-bottom-cta h3 { color: #ffffff; font-size: 1.4rem; font-weight: 700; margin: 0 0 .4em; }
.post-bottom-cta p { color: rgba(255,255,255,.85); margin: 0 0 1.2em; }
.post-bottom-cta .btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: .8em 1.6em;
  background: #ffffff;
  color: #050507;
  text-decoration: none;
  font-weight: 700;
  border-radius: 999px;
}

/* Back-to-blog link */
.back-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: #a1a1aa;
  text-decoration: none;
  font-size: 14px;
  margin-bottom: 2em;
  transition: color .15s;
}
.back-link:hover { color: #a78bfa; }

/* Mobile tweaks */
@media (max-width: 640px) {
  .prose { font-size: 16px; }
  .post-hero-image { border-radius: 12px; margin-bottom: 2em; }
}
