/* ============================================================
   Scoop Analytics Ghost Theme — screen.css
   ============================================================ */

/* --- Tokens --- */
:root {
  --font-display:    "Plus Jakarta Sans", sans-serif;
  --font-body:       "Inter", ui-sans-serif, system-ui, sans-serif;

  --ink:             #1E0B2C;
  --ink-70:          rgba(30, 11, 44, 0.70);
  --ink-50:          rgba(30, 11, 44, 0.50);
  --ink-20:          rgba(30, 11, 44, 0.20);
  --ink-08:          rgba(30, 11, 44, 0.08);

  --canvas:          #F7F4FB;
  --surface:         #EDE8F5;
  --white:           #ffffff;
  --line:            rgba(30, 11, 44, 0.10);

  --indigo:          #5B4AE8;
  --indigo-dark:     #2E1FB5;
  --indigo-10:       rgba(91, 74, 232, 0.10);
  --pink:            #E3165B;
  --plum:            #1E0B2C;

  --radius-sm:       8px;
  --radius:          12px;
  --radius-lg:       16px;

  --shadow-card:     0 1px 2px rgba(30,11,44,0.04), 0 4px 16px rgba(30,11,44,0.06);
  --shadow-lift:     0 2px 8px rgba(30,11,44,0.06), 0 16px 40px rgba(30,11,44,0.12);

  --max:             1200px;
  --content-max:     720px;
  --transition:      0.18s ease;
}

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

html { scroll-behavior: smooth; }

body {
  background: var(--canvas);
  color: var(--ink);
  font-family: var(--font-body);
  font-size: 1rem;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

img { display: block; max-width: 100%; height: auto; }
a   { color: var(--indigo); text-decoration: none; }
a:hover { color: var(--indigo-dark); }

h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-display);
  font-weight: 700;
  letter-spacing: -0.02em;
  line-height: 1.15;
  color: var(--ink);
}

/* --- Layout wrapper --- */
.sc-wrap {
  max-width: var(--max);
  margin-inline: auto;
  padding-inline: clamp(1rem, 4vw, 2rem);
}

/* ============================================================
   HEADER
   ============================================================ */
.sc-header {
  background: var(--white);
  border-bottom: 1px solid var(--line);
  position: sticky;
  top: 0;
  z-index: 200;
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
}

.sc-header-inner {
  display: flex;
  align-items: center;
  gap: 2rem;
  height: 60px;
}

.sc-logo {
  display: flex;
  align-items: center;
  flex-shrink: 0;
  text-decoration: none;
}

.sc-logo-text {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1.05rem;
  color: var(--ink);
  letter-spacing: -0.01em;
}

.sc-logo img { height: 26px; width: auto; }

.sc-nav { flex: 1; }

.sc-nav ul {
  list-style: none;
  display: flex;
  gap: 1.5rem;
  align-items: center;
}

.sc-nav ul li a {
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--ink-70);
  text-decoration: none;
  transition: color var(--transition);
}

.sc-nav ul li a:hover { color: var(--ink); }

/* --- CTA button --- */
.sc-cta-btn {
  display: inline-flex;
  align-items: center;
  padding: 0.55rem 1.25rem;
  background: var(--indigo);
  color: var(--white);
  font-family: var(--font-body);
  font-size: 0.875rem;
  font-weight: 600;
  border-radius: 999px;
  text-decoration: none;
  white-space: nowrap;
  transition: background var(--transition), transform var(--transition), box-shadow var(--transition);
  box-shadow: 0 1px 2px rgba(91,74,232,0.2), 0 4px 12px rgba(91,74,232,0.15);
  flex-shrink: 0;
}

.sc-cta-btn:hover {
  background: var(--indigo-dark);
  color: var(--white);
  transform: translateY(-1px);
  box-shadow: 0 2px 4px rgba(91,74,232,0.25), 0 8px 20px rgba(91,74,232,0.2);
}

/* ============================================================
   EYEBROW
   ============================================================ */
.sc-eyebrow {
  display: inline-block;
  font-family: var(--font-body);
  font-size: 0.6875rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--indigo);
  text-decoration: none;
  margin-bottom: 0.75rem;
}

a.sc-eyebrow:hover { color: var(--indigo-dark); }

/* ============================================================
   BLOG HERO (index header)
   ============================================================ */
.sc-blog-hero {
  background: linear-gradient(145deg, var(--plum) 0%, #2A0E4A 55%, #1A0D5C 100%);
  padding: clamp(3rem, 8vw, 5.5rem) 0 clamp(2.5rem, 6vw, 4.5rem);
  margin-bottom: 3rem;
  margin-top: 0;
}

/* Space between header and first content when no hero */
.sc-wrap > .sc-featured-card:first-child {
  margin-top: 2.5rem;
}

.sc-blog-hero .sc-eyebrow { color: rgba(255,255,255,0.5); }

.sc-blog-hero-title {
  font-size: clamp(2rem, 5vw, 3.25rem);
  font-weight: 800;
  color: #ffffff;
  letter-spacing: -0.03em;
  line-height: 1.1;
  margin-bottom: 0.875rem;
}

.sc-blog-hero-sub {
  font-size: clamp(0.9375rem, 2vw, 1.0625rem);
  color: rgba(255,255,255,0.65);
  max-width: 520px;
  line-height: 1.65;
}

/* ============================================================
   FEATURED CARD
   ============================================================ */
.sc-featured-card {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0;
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-card);
  overflow: hidden;
  text-decoration: none;
  margin-bottom: 2rem;
  transition: box-shadow var(--transition), transform var(--transition);
}

.sc-featured-card:hover {
  box-shadow: var(--shadow-lift);
  transform: translateY(-2px);
}

.sc-featured-card-text {
  padding: clamp(1.75rem, 4vw, 2.5rem);
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.sc-featured-card-title {
  font-size: clamp(1.375rem, 2.5vw, 1.875rem);
  font-weight: 700;
  color: var(--ink);
  letter-spacing: -0.025em;
  line-height: 1.2;
  margin-bottom: 0.75rem;
  transition: color var(--transition);
}

.sc-featured-card:hover .sc-featured-card-title { color: var(--indigo); }

.sc-featured-card-excerpt {
  font-size: 0.9375rem;
  color: var(--ink-70);
  line-height: 1.65;
  margin-bottom: 1.25rem;
  flex: 1;
}

.sc-featured-card-meta {
  font-size: 0.8125rem;
  color: var(--ink-50);
  display: flex;
  align-items: center;
  gap: 0.375rem;
}

.sc-featured-card-image {
  overflow: hidden;
  aspect-ratio: 4 / 3;
}

.sc-featured-card-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.4s ease;
}

.sc-featured-card:hover .sc-featured-card-image img { transform: scale(1.04); }

/* ============================================================
   SECTION LABEL
   ============================================================ */
.sc-section-label {
  display: flex;
  align-items: center;
  gap: 1rem;
  margin-bottom: 1.5rem;
}

.sc-section-label span {
  font-family: var(--font-body);
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--ink-50);
  white-space: nowrap;
}

.sc-section-label::after {
  content: "";
  flex: 1;
  height: 1px;
  background: var(--line);
}

/* ============================================================
   CARD GRID
   ============================================================ */
.sc-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 340px), 1fr));
  gap: clamp(1rem, 2.5vw, 1.5rem);
  padding-bottom: 3rem;
}

/* ============================================================
   CARD
   ============================================================ */
.sc-card {
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow-card);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  transition: box-shadow var(--transition), transform var(--transition);
}

.sc-card:hover {
  box-shadow: var(--shadow-lift);
  transform: translateY(-2px);
}

.sc-card-thumb-link {
  display: block;
  overflow: hidden;
  aspect-ratio: 16 / 9;
  flex-shrink: 0;
}

.sc-card-thumb {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.35s ease;
}

.sc-card:hover .sc-card-thumb { transform: scale(1.04); }

.sc-card-body {
  padding: 1.25rem 1.375rem 1.375rem;
  display: flex;
  flex-direction: column;
  flex: 1;
}

.sc-card-tag {
  display: inline-block;
  font-size: 0.6875rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.09em;
  color: var(--indigo);
  text-decoration: none;
  margin-bottom: 0.5rem;
  transition: color var(--transition);
}

.sc-card-tag:hover { color: var(--indigo-dark); }

.sc-card-title {
  font-family: var(--font-display);
  font-size: 1rem;
  font-weight: 600;
  letter-spacing: -0.01em;
  line-height: 1.35;
  color: var(--ink);
  margin-bottom: 0.5rem;
}

.sc-card-title a {
  color: inherit;
  text-decoration: none;
  transition: color var(--transition);
}

.sc-card-title a:hover { color: var(--indigo); }

.sc-card-excerpt {
  font-size: 0.875rem;
  color: var(--ink-70);
  line-height: 1.6;
  margin-bottom: 1rem;
  flex: 1;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.sc-card-meta {
  font-size: 0.75rem;
  color: var(--ink-50);
  display: flex;
  align-items: center;
  gap: 0.375rem;
  margin-top: auto;
}

.sc-mid-dot { opacity: 0.4; }

/* ============================================================
   PAGINATION
   ============================================================ */
.pagination {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 1rem;
  padding: 1.5rem 0 3rem;
  font-size: 0.875rem;
  color: var(--ink-50);
  font-family: var(--font-body);
}

.older-posts,
.newer-posts {
  background: var(--indigo);
  color: var(--white);
  padding: 0.5rem 1.25rem;
  border-radius: var(--radius-sm);
  font-weight: 600;
  font-size: 0.875rem;
  text-decoration: none;
  transition: background var(--transition);
}

.older-posts:hover,
.newer-posts:hover {
  background: var(--indigo-dark);
  color: var(--white);
}

/* ============================================================
   POST HEADER
   ============================================================ */
.sc-post-header {
  background: linear-gradient(145deg, var(--plum) 0%, #2A0E4A 55%, #1A0D5C 100%);
  padding: clamp(3rem, 7vw, 5rem) 0 clamp(2.5rem, 5vw, 4rem);
  margin-bottom: 2.5rem;
}

.sc-post-header .sc-eyebrow { color: rgba(255,255,255,0.5); }

.sc-post-header-inner { max-width: var(--content-max); }

.sc-post-title {
  font-size: clamp(1.875rem, 4.5vw, 3rem);
  font-weight: 800;
  color: #ffffff;
  letter-spacing: -0.03em;
  line-height: 1.1;
  margin-bottom: 1rem;
}

.sc-post-excerpt {
  font-size: clamp(1rem, 2vw, 1.125rem);
  color: rgba(255,255,255,0.72);
  line-height: 1.65;
  margin-bottom: 1.25rem;
  max-width: 600px;
}

.sc-post-meta {
  font-size: 0.875rem;
  color: rgba(255,255,255,0.5);
  display: flex;
  align-items: center;
  gap: 0.375rem;
  flex-wrap: wrap;
}

.sc-post-author { color: rgba(255,255,255,0.65); font-weight: 500; }

/* ============================================================
   POST HERO IMAGE
   ============================================================ */
.sc-post-hero-image {
  margin-bottom: 2.5rem;
}

.sc-post-hero-image img {
  width: 100%;
  max-height: 480px;
  object-fit: cover;
  border-radius: var(--radius-lg);
}

/* ============================================================
   POST LAYOUT (body + TOC)
   ============================================================ */
.sc-post-layout {
  display: grid;
  grid-template-columns: 1fr 240px;
  grid-template-areas: "body toc";
  gap: 4rem;
  align-items: start;
  padding-bottom: 4rem;
}

/* ============================================================
   TABLE OF CONTENTS
   ============================================================ */
.sc-toc {
  grid-area: toc;
  position: sticky;
  top: 80px;
  max-height: calc(100vh - 120px);
  overflow-y: auto;
  padding: 1.25rem;
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: var(--radius);
}

.sc-toc-label {
  font-size: 0.6875rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--ink-50);
  margin-bottom: 0.875rem;
}

.sc-toc-nav { display: flex; flex-direction: column; gap: 0; }

.sc-toc-nav a {
  display: block;
  font-size: 0.8125rem;
  color: var(--ink-70);
  text-decoration: none;
  padding: 0.3rem 0.5rem;
  border-left: 2px solid transparent;
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
  line-height: 1.45;
  transition: color var(--transition), border-color var(--transition), background var(--transition);
}

.sc-toc-nav a:hover {
  color: var(--indigo);
  border-left-color: var(--indigo);
  background: var(--indigo-10);
}

.sc-toc-nav a.sc-toc-active {
  color: var(--indigo);
  border-left-color: var(--indigo);
  font-weight: 500;
  background: var(--indigo-10);
}

.sc-toc-nav a.sc-toc-h3 { padding-left: 1.25rem; font-size: 0.75rem; }

/* ============================================================
   POST BODY
   ============================================================ */
.sc-post-body {
  grid-area: body;
  min-width: 0;
}

/* Ghost content styles */
.gh-content {
  font-family: var(--font-body);
  font-size: 1.0625rem;
  line-height: 1.78;
  color: var(--ink);
  max-width: var(--content-max);
}

.gh-content > * + * { margin-top: 1.5em; }

.gh-content h2 {
  font-size: 1.5rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  margin-top: 2.5em;
  margin-bottom: 0.5em;
  color: var(--ink);
  scroll-margin-top: 80px;
}

.gh-content h3 {
  font-size: 1.1875rem;
  font-weight: 600;
  margin-top: 2em;
  margin-bottom: 0.4em;
  scroll-margin-top: 80px;
}

.gh-content h4 {
  font-size: 1.0625rem;
  font-weight: 600;
  margin-top: 1.75em;
}

.gh-content p { margin-bottom: 0; }

.gh-content a {
  color: var(--indigo);
  text-decoration: underline;
  text-decoration-color: rgba(91,74,232,0.3);
  text-underline-offset: 3px;
  transition: text-decoration-color var(--transition);
}

.gh-content a:hover {
  color: var(--indigo-dark);
  text-decoration-color: var(--indigo-dark);
}

.gh-content strong { font-weight: 600; color: var(--ink); }

.gh-content blockquote {
  border-left: 3px solid var(--indigo);
  background: var(--surface);
  border-radius: 0 var(--radius) var(--radius) 0;
  padding: 1rem 1.5rem;
  font-style: normal;
  color: var(--ink);
  margin: 2rem 0;
}

.gh-content blockquote p { color: var(--ink-70); font-size: 1rem; }

.gh-content code {
  font-family: "SF Mono", "Fira Code", "Fira Mono", monospace;
  font-size: 0.875em;
  background: var(--surface);
  color: var(--pink);
  border-radius: 4px;
  padding: 0.15em 0.4em;
}

.gh-content pre {
  background: var(--plum);
  border-radius: var(--radius);
  padding: 1.375rem 1.5rem;
  overflow-x: auto;
  margin: 2rem 0;
}

.gh-content pre code {
  background: transparent;
  color: rgba(255,255,255,0.85);
  padding: 0;
  font-size: 0.9em;
  line-height: 1.6;
}

.gh-content img {
  border-radius: var(--radius);
  margin: 2rem auto;
  max-width: 100%;
}

.gh-content ul,
.gh-content ol {
  padding-left: 1.625rem;
}

.gh-content li + li { margin-top: 0.375em; }

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

.gh-content table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.9rem;
  margin: 2rem 0;
}

.gh-content th,
.gh-content td {
  text-align: left;
  padding: 0.75rem 1rem;
  border-bottom: 1px solid var(--line);
}

.gh-content th {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 0.8125rem;
  background: var(--surface);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--ink-70);
}

/* Ghost image width helpers */
.kg-width-wide {
  width: 120%;
  margin-left: -10%;
  max-width: none;
}

.kg-width-full {
  width: 100vw;
  margin-left: calc(50% - 50vw);
  max-width: none;
}

/* ============================================================
   POST END
   ============================================================ */
.sc-post-end {
  max-width: var(--content-max);
  display: flex;
  flex-direction: column;
  gap: 2rem;
  padding-bottom: 4rem;
  border-top: 1px solid var(--line);
  padding-top: 2rem;
  margin-top: -2rem;
}

/* Author card */
.sc-author-card {
  display: flex;
  align-items: flex-start;
  gap: 1rem;
  padding: 1.25rem;
  background: var(--surface);
  border-radius: var(--radius);
}

.sc-author-avatar {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  object-fit: cover;
  flex-shrink: 0;
}

.sc-author-name {
  font-family: var(--font-display);
  font-size: 0.9375rem;
  font-weight: 600;
  color: var(--ink);
  margin-bottom: 0.25rem;
}

.sc-author-bio {
  font-size: 0.875rem;
  color: var(--ink-70);
  line-height: 1.55;
}

/* Post CTA */
.sc-post-cta {
  background: linear-gradient(135deg, var(--plum) 0%, #2A0E4A 100%);
  border-radius: var(--radius-lg);
  padding: 2rem 2.25rem;
}

.sc-post-cta-title {
  font-size: 1.25rem;
  font-weight: 700;
  color: #ffffff;
  letter-spacing: -0.02em;
  margin-bottom: 0.5rem;
}

.sc-post-cta-sub {
  font-size: 0.9375rem;
  color: rgba(255,255,255,0.65);
  line-height: 1.6;
  margin-bottom: 1.25rem;
}

/* Back link */
.sc-back-link {
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--indigo);
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  transition: color var(--transition), gap var(--transition);
}

.sc-back-link:hover { color: var(--indigo-dark); gap: 0.4rem; }

/* ============================================================
   FOOTER
   ============================================================ */
.sc-footer {
  background: var(--plum);
  padding: 2rem 0;
  margin-top: auto;
}

.sc-footer-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 0.75rem;
}

.sc-footer-brand {
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  flex-shrink: 0;
}

.sc-footer-brand img {
  height: 22px;
  width: auto;
  max-width: 120px;
  display: block;
}

.sc-footer-brand:hover { opacity: 0.8; }

.sc-footer-copy {
  font-size: 0.8125rem;
  color: rgba(255,255,255,0.4);
}

/* ============================================================
   MAIN
   ============================================================ */
.sc-main { min-height: 60vh; }

/* ============================================================
   FOCUS RING
   ============================================================ */
*:focus-visible {
  outline: 2px solid var(--indigo);
  outline-offset: 3px;
  border-radius: 4px;
}

/* ============================================================
   RESPONSIVE
   ============================================================ */

/* Medium screens — hide TOC */
@media (max-width: 1024px) {
  .sc-post-layout {
    grid-template-columns: 1fr;
    grid-template-areas: "body";
    gap: 0;
  }
  .sc-toc { display: none; }
}

/* Tablet */
@media (max-width: 768px) {
  .sc-featured-card {
    grid-template-columns: 1fr;
    grid-template-rows: auto auto;
  }
  .sc-featured-card-image {
    order: -1;
    aspect-ratio: 16 / 9;
  }
  .sc-grid {
    grid-template-columns: 1fr;
  }
}

/* Mobile */
@media (max-width: 600px) {
  .sc-nav { display: none; }
  .sc-header-inner { gap: 1rem; }
  .sc-post-cta { padding: 1.5rem; }
  .sc-footer-inner { flex-direction: column; align-items: flex-start; }
}
