/* ============== SOCIAL TAG, BLOG STYLES ============== */
/* Dark theme matching the homepage. blog.css loads AFTER styles.css */
/* so the homepage nav + footer classes work unchanged.              */

@import url('https://fonts.googleapis.com/css2?family=Instrument+Serif:ital@0;1&family=Geist:wght@300;400;500;600;700;800&family=Caveat:wght@700&display=swap');

* { margin: 0; padding: 0; box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  background: #0a0a0a;
  color: #f4f1ea;
  font-family: 'Geist', system-ui, sans-serif;
  -webkit-font-smoothing: antialiased;
  line-height: 1.5;
}
a { color: inherit; text-decoration: none; }

/* The article shell sits in cream/light footer wrap like homepage. */
body.blogs-page-listing { background: #0a0a0a; }

/* ============ LISTING PAGE ============ */
.blogs-wrap {
  max-width: 1280px;
  margin: 0 auto;
  padding: 0 48px 120px;
  background: #0a0a0a;
}
.blogs-head {
  margin: 140px 0 64px;
  display: grid;
  grid-template-columns: 1fr;
  gap: 24px;
}
.blogs-eyebrow {
  display: flex; align-items: center; gap: 14px;
  font-family: 'Geist', sans-serif; font-size: 12px; font-weight: 500;
  letter-spacing: 0.22em; text-transform: uppercase; color: #b8b3a5;
}
.blogs-eyebrow .num { color: #f4f1ea; font-family: 'JetBrains Mono', monospace; }
.blogs-eyebrow .line { flex: 1; max-width: 80px; height: 1px; background: rgba(244,241,234,0.18); }
.blogs-head h1 {
  font-family: 'Instrument Serif', serif;
  font-size: clamp(52px, 7vw, 92px);
  line-height: 1; letter-spacing: -0.02em; font-weight: 400;
  text-wrap: pretty;
  color: #f4f1ea;
}
.blogs-head h1 .it { font-style: italic; }
.blogs-head .sub {
  max-width: 640px;
  font-size: 18px; line-height: 1.55; color: #b8b3a5; font-weight: 300;
}

/* ============ ARTICLE PAGE ============ */

/* Dark hero band at top of every article */
.article-hero {
  position: relative;
  padding: 260px 0 100px;
  background: #0a0a0a;
  border-bottom: 1px solid rgba(244,241,234,0.06);
  overflow: hidden;
}
.article-hero::before {
  content: '';
  position: absolute; inset: 0;
  background:
    radial-gradient(60% 50% at 80% 20%, rgba(244,241,234,0.04), transparent 70%),
    radial-gradient(50% 40% at 10% 80%, rgba(244,241,234,0.03), transparent 70%);
  pointer-events: none;
}
.article-hero-inner {
  position: relative;
  z-index: 1;
  max-width: 1100px;
  margin: 0 auto;
  padding: 0 48px;
}
.article-back-link {
  display: inline-flex; align-items: center; gap: 8px;
  font-family: 'Geist', sans-serif; font-size: 13px; font-weight: 500;
  color: #b8b3a5;
  margin-bottom: 36px;
  transition: color .2s ease, transform .25s ease;
}
.article-back-link:hover { color: #f4f1ea; transform: translateX(-3px); }

.article-wrap {
  max-width: 760px;
  margin: 0;
  margin-left: max(48px, calc((100vw - 1100px) / 2));
  padding: 160px 32px 60px 0;
  background: #0a0a0a;
}

/* Eyebrow */
.article-eyebrow {
  display: flex; align-items: center; gap: 14px;
  margin: 0 0 28px;
  font-family: 'Geist', sans-serif; font-size: 12px; font-weight: 500;
  letter-spacing: 0.22em; text-transform: uppercase; color: #b8b3a5;
}
.article-eyebrow .num {
  color: #f4f1ea;
  font-family: 'JetBrains Mono', monospace;
}
.article-eyebrow .line { flex: 1; max-width: 60px; height: 1px; background: rgba(244,241,234,0.18); }

/* Title */
.article-title {
  font-family: 'Instrument Serif', serif;
  font-size: clamp(44px, 6vw, 80px);
  line-height: 1.02; letter-spacing: -0.02em; font-weight: 400;
  text-wrap: pretty;
  margin-bottom: 36px;
  color: #f4f1ea;
}
.article-title .it { font-style: italic; }
.article-title .accent { font-style: italic; color: #f4f1ea; }

/* Meta strip */
.article-meta {
  display: flex;
  align-items: baseline;
  gap: 14px;
  padding: 18px 0;
  border-top: 1px solid rgba(244,241,234,0.08);
  border-bottom: 1px solid rgba(244,241,234,0.08);
  font-family: 'Geist', sans-serif;
  font-size: 13px;
  color: #c8c4ba;
  letter-spacing: 0.02em;
}
.article-meta time { color: #f4f1ea; font-weight: 500; }
.article-meta .meta-dot { color: #5a5751; }
.article-meta .meta-read { color: #c8c4ba; }

/* Cover image card */
.article-cover {
  margin: 56px auto 0;
  max-width: 1100px;
  aspect-ratio: 16 / 9;
  border-radius: 22px;
  position: relative;
  overflow: hidden;
  display: flex; align-items: flex-end;
  padding: 28px;
  /* plain black backdrop, no coloured border/edge */
  background: #0a0a0a;
  box-shadow: 0 24px 60px rgba(0,0,0,0.4);
  transition: box-shadow .4s ease, transform .4s ease;
}
/* Subtle cream "shine" + lift on hover instead of a static boundary. */
.article-cover:hover {
  transform: translateY(-3px);
  box-shadow:
    0 0 0 1px rgba(244,241,234,0.45),
    0 0 44px rgba(244,241,234,0.22),
    0 30px 80px rgba(0,0,0,0.5);
}
.article-cover .cover-tag {
  font-family: 'Geist', sans-serif; font-size: 11px;
  letter-spacing: 0.2em; text-transform: uppercase;
  color: rgba(244,241,234,0.6);
}
.article-cover img {
  position: absolute; inset: 0;
  width: 100%; height: 100%;
  object-fit: cover; display: block;
}

/* Reading area lives on dark bg, cream text */
.article-body {
  font-family: 'Geist', sans-serif;
  color: #d8d3c5;
  padding-top: 72px;
}
.article-lede {
  font-family: 'Instrument Serif', serif;
  font-size: clamp(22px, 2.2vw, 28px); line-height: 1.35; letter-spacing: -0.005em;
  margin-bottom: 56px;
  color: #f4f1ea;
  text-wrap: pretty;
}
.article-lede .it { font-style: italic; color: #f4f1ea; }

.article-body h2 {
  font-family: 'Instrument Serif', serif;
  font-size: clamp(28px, 3vw, 38px); line-height: 1.15; letter-spacing: -0.01em; font-weight: 400;
  margin: 64px 0 22px;
  text-wrap: pretty;
  color: #f4f1ea;
}
.article-body h2 .it { font-style: italic; color: #f4f1ea; }

.article-body p {
  font-size: 18px; line-height: 1.75; color: #c8c4ba;
  margin-bottom: 22px;
  font-weight: 300;
}
.article-body p strong { font-weight: 500; color: #f4f1ea; }
.article-body p em { font-style: italic; color: #e2dccb; }

.article-body ul,
.article-body ol {
  list-style: none;
  margin: 0 0 28px;
  padding: 0;
  display: flex; flex-direction: column; gap: 10px;
}
.article-body ul li,
.article-body ol li {
  position: relative;
  padding-left: 24px;
  font-size: 17px; line-height: 1.65; color: #c8c4ba;
  font-weight: 300;
}
.article-body ul li::before {
  content: '';
  position: absolute;
  left: 6px; top: 12px;
  width: 6px; height: 6px;
  background: #f4f1ea;
  border-radius: 50%;
}
.article-body ol { counter-reset: oli; }
.article-body ol li {
  counter-increment: oli;
}
.article-body ol li::before {
  content: counter(oli) '.';
  position: absolute;
  left: 0; top: 0;
  font-family: 'Instrument Serif', serif;
  font-style: italic;
  font-size: 16px;
  color: #f4f1ea;
}
.article-body ul li em,
.article-body ol li em {
  font-style: italic; color: #f4f1ea; font-weight: 400;
}

.article-body a {
  color: #f4f1ea !important;
  text-decoration: underline !important;
  text-underline-offset: 3px !important;
  text-decoration-color: rgba(244,241,234,0.35) !important;
  transition: text-decoration-color .2s ease;
}
.article-body a:hover { text-decoration-color: #f4f1ea !important; }

.article-body blockquote {
  margin: 48px 0;
  padding: 28px 32px;
  border-left: 2px solid #f4f1ea;
  background: rgba(244,241,234,0.04);
  border-radius: 0 16px 16px 0;
  font-family: 'Instrument Serif', serif;
  font-size: clamp(22px, 2.2vw, 26px); line-height: 1.4; font-style: italic;
  color: #f4f1ea;
}

/* ============ TOOL CARDS (in AI-tools blogs) ============ */
.article-body .tool {
  margin: 18px 0 36px;
  padding: 24px 28px;
  border: 1px solid rgba(244,241,234,0.1);
  border-radius: 18px;
  background: #161310;
  transition: border-color .25s ease, transform .35s cubic-bezier(.2,.8,.2,1);
}
.article-body .tool:hover {
  border-color: rgba(244,241,234,0.22);
  transform: translateY(-2px);
}
.article-body .tool .tool-head {
  display: flex; align-items: baseline; gap: 14px; flex-wrap: wrap;
  margin-bottom: 14px;
}
.article-body .tool .tool-num {
  font-family: 'Instrument Serif', serif;
  font-style: italic;
  font-size: 22px;
  color: #f4f1ea;
  line-height: 1;
}
.article-body .tool h2 {
  margin: 0 !important;
  font-size: 26px !important;
  line-height: 1.2 !important;
  color: #f4f1ea;
}
.article-body .tool .best-for {
  margin-top: 14px;
  padding-top: 14px;
  border-top: 1px dashed rgba(244,241,234,0.14);
  font-size: 14px; color: #b8b3a5;
}
.article-body .tool .best-for strong {
  font-family: 'Geist', sans-serif; font-weight: 600;
  letter-spacing: 0.08em; text-transform: uppercase;
  font-size: 10px; color: #807c72;
  display: block; margin-bottom: 6px;
}
.article-body .tool a.visit {
  display: inline-flex; align-items: center; gap: 6px;
  margin-left: auto;
  font-size: 13px; font-weight: 500;
  color: #f4f1ea !important;
  text-decoration: underline !important;
  text-underline-offset: 3px !important;
  text-decoration-color: rgba(244,241,234,0.4) !important;
  transition: text-decoration-color .2s ease;
}
.article-body .tool a.visit:hover { text-decoration-color: #f4f1ea !important; }

.article-body .tool-category {
  margin: 72px 0 8px;
  display: flex; align-items: center; gap: 14px;
  font-family: 'Geist', sans-serif;
  font-size: 12px; font-weight: 500;
  letter-spacing: 0.22em; text-transform: uppercase;
  color: #b8b3a5;
}
.article-body .tool-category::before {
  content: ''; width: 8px; height: 8px; background: #f4f1ea; border-radius: 50%;
  flex-shrink: 0;
}
.article-body .tool-category .line { flex: 1; height: 1px; background: rgba(244,241,234,0.14); }

/* ============ OUTRO ============ */
.article-outro {
  max-width: 1100px;
  margin: 96px auto 0;
  padding: 64px 48px;
  border-top: 1px solid rgba(244,241,234,0.1);
  display: grid; grid-template-columns: 1fr auto; gap: 32px; align-items: center;
}
.article-outro h3 {
  font-family: 'Instrument Serif', serif;
  font-size: clamp(28px, 3vw, 40px); line-height: 1.1; letter-spacing: -0.01em; font-weight: 400;
  max-width: 560px;
  color: #f4f1ea;
}
.article-outro h3 .it { font-style: italic; }
.article-outro .actions { display: flex; gap: 12px; flex-wrap: wrap; }
.article-outro .btn {
  display: inline-flex; align-items: center; gap: 10px;
  padding: 16px 26px;
  font-family: 'Geist', sans-serif; font-size: 13px; font-weight: 500;
  letter-spacing: 0.14em; text-transform: uppercase;
  border-radius: 999px;
  transition: transform .25s ease, background .25s ease, color .25s ease, border-color .25s ease, box-shadow .35s ease;
}
.article-outro .btn.primary {
  background: #f4f1ea; color: #0a0a0a;
  box-shadow: 0 12px 32px rgba(244,241,234,0.18);
}
.article-outro .btn.primary:hover { background: #fff; transform: translateY(-2px); box-shadow: 0 16px 40px rgba(244,241,234,0.28); }
.article-outro .btn.ghost {
  border: 1px solid rgba(244,241,234,0.25);
  color: #f4f1ea;
}
.article-outro .btn.ghost:hover {
  background: rgba(244,241,234,0.08);
  border-color: rgba(244,241,234,0.5);
  transform: translateY(-2px);
}
.article-outro .btn .arr { font-family: 'Instrument Serif', serif; font-size: 16px; }

/* Article-wide responsive */
@media (max-width: 900px) {
  .article-hero { padding: 140px 0 60px; }
  .article-hero-inner { padding: 0 22px; }
  .blogs-wrap { padding: 0 22px 80px; }
  .article-wrap {
    padding: 120px 22px 60px;
    margin-left: 0;
    max-width: 100%;
  }
  .article-cover { margin: 36px 22px 0; }
  .article-outro { grid-template-columns: 1fr; padding: 48px 22px; }
  .article-body h2 { margin: 48px 0 16px; }
  .article-body p { font-size: 17px; }
}
@media (max-width: 480px) {
  .blogs-wrap { padding: 0 16px 60px; }
  .blogs-head h1 { font-size: clamp(40px, 11vw, 60px); }
  .blogs-head .sub { font-size: 16px; }
  .article-wrap { padding: 100px 16px 48px; }
  .article-title { font-size: clamp(32px, 9vw, 48px); }
  .article-meta { gap: 8px; font-size: 12px; flex-wrap: wrap; }
  .article-cover { margin: 28px 16px 0; aspect-ratio: 4 / 3; border-radius: 18px; }
  .article-cover .cover-tag { font-size: 11px; padding: 6px 12px; }
  .article-lede { font-size: 18px; line-height: 1.55; }
  .article-body h2 { font-size: 26px; margin: 36px 0 12px; }
  .article-body p { font-size: 16px; }
  .article-body ul li, .article-body ol li { font-size: 16px; }
  .article-body blockquote { font-size: 19px; padding: 16px 0 16px 18px; }
  .article-body .tool { padding: 20px 18px; }
  .article-body .tool h2 { font-size: 22px; }
  .article-outro { padding: 36px 16px; }
}

/* ============ READING RAIL (right side, fixed) ============ */
.reading-rail {
  position: fixed;
  top: 140px;
  bottom: 40px;
  right: max(28px, calc((100vw - 1320px) / 2));
  z-index: 40;
  width: 240px;
  display: flex;
  flex-direction: column;
  gap: 22px;
  pointer-events: none;
  overflow: hidden;
  scrollbar-width: none;
  transition: opacity .35s ease, transform .35s ease;
}
.reading-rail > * { pointer-events: auto; }
.reading-rail::-webkit-scrollbar { width: 0; }
.reading-rail.rail-hidden {
  opacity: 0;
  pointer-events: none;
  transform: translateY(-6px);
}

/* TOC: scrollable, takes the leftover height */
.rail-toc {
  flex: 1 1 auto;
  min-height: 0;
  overflow-y: auto;
  scrollbar-width: none;
  padding-right: 4px;
  /* Fade-out mask at the bottom so cut TOC items don't look hard-cropped */
  -webkit-mask-image: linear-gradient(180deg, #000 0, #000 calc(100% - 24px), transparent 100%);
          mask-image: linear-gradient(180deg, #000 0, #000 calc(100% - 24px), transparent 100%);
}
.rail-toc::-webkit-scrollbar { width: 0; }

/* TOC */
.rail-toc-label,
.rail-share-label {
  font-family: 'Geist', sans-serif;
  font-size: 13px;
  font-weight: 600;
  color: #f4f1ea;
  margin-bottom: 16px;
  letter-spacing: 0.01em;
}
.rail-toc-list {
  list-style: none;
  margin: 0;
  padding: 4px 0 4px 18px;
  position: relative;
  border-left: 1px solid rgba(244,241,234,0.14);
}
.rail-toc-item {
  margin: 0;
  padding: 7px 0;
  position: relative;
}
.rail-toc-item a {
  display: block;
  font-family: 'Geist', sans-serif;
  font-size: 13px;
  line-height: 1.45;
  color: #807c72;
  text-decoration: none;
  transition: color .2s ease;
}
.rail-toc-item a:hover { color: #c8c4ba; }
.rail-toc-item.active a { color: #f4f1ea; font-weight: 600; }
.rail-toc-item.active::before {
  content: '';
  position: absolute;
  left: -22.5px;
  top: 50%;
  width: 9px;
  height: 9px;
  background: #f4f1ea;
  border-radius: 50%;
  transform: translateY(-50%);
  box-shadow: 0 0 0 4px rgba(244,241,234,0.12);
}
/* Quiet tick for visited (read) items */
.rail-toc-item.read::before {
  content: '';
  position: absolute;
  left: -21px;
  top: 50%;
  width: 6px;
  height: 6px;
  background: rgba(244,241,234,0.35);
  border-radius: 50%;
  transform: translateY(-50%);
}
.rail-toc-item.read.active::before {
  /* active takes precedence */
  background: #f4f1ea;
  width: 9px;
  height: 9px;
  left: -22.5px;
  box-shadow: 0 0 0 4px rgba(244,241,234,0.12);
}

/* Share section */
.rail-share {
  flex-shrink: 0;
  padding-top: 18px;
  border-top: 1px solid rgba(244,241,234,0.12);
}
.rail-share-row {
  display: flex;
  flex-direction: row;
  gap: 10px;
}
.rail-btn {
  width: 38px;
  height: 38px;
  border-radius: 10px;
  background: rgba(244,241,234,0.06);
  border: 1px solid rgba(244,241,234,0.14);
  color: #b8b3a5;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: background .25s ease, color .25s ease, border-color .25s ease, transform .25s ease;
}
.rail-btn:hover {
  background: #f4f1ea;
  color: #0a0a0a;
  border-color: #f4f1ea;
  transform: translateY(-2px);
}
.rail-btn svg { width: 16px; height: 16px; }
.rail-copied {
  margin-top: 10px;
  font-family: 'Geist', sans-serif;
  font-size: 11px;
  letter-spacing: 0.08em;
  color: #b8b3a5;
  height: 14px;
}

@media (max-width: 1180px) {
  .reading-rail { display: none; }
}

/* ============ NAV: translucent on article pages ============ */
/* When reading a blog, soften the nav pill so the article shows through */
body.article-page .nav-pill {
  background: rgba(10,10,10,0.28) !important;
  backdrop-filter: blur(22px) saturate(160%) !important;
  -webkit-backdrop-filter: blur(22px) saturate(160%) !important;
  border: 1px solid rgba(244,241,234,0.10);
}
body.article-page .nav.scrolled .nav-pill {
  background: rgba(10,10,10,0.55) !important;
  border-color: rgba(244,241,234,0.14);
  box-shadow: 0 12px 40px rgba(0,0,0,0.45);
}

/* Smooth fade-in once user scrolls past the hero */
body.article-page .reading-rail.visible { opacity: 1; }
