/* ============================================================
   LOVIE PROJECT STUDIO — Article Page Styles
   Extends styles.css — do not import standalone
   ============================================================ */


/* ── Article page body override ──────────────────────────── */
.article-page {
  background: var(--paper);
}


/* ============================================================
   ARTICLE HERO  (60–70vh cinematic)
============================================================ */
.article-hero {
  position: relative;
  width: 100%;
  height: clamp(400px, 65vh, 720px);
  display: flex;
  align-items: flex-end;
  overflow: hidden;
  margin-top: var(--nav-height);
}

.article-hero-image-wrap {
  position: absolute;
  inset: 0;
}

.article-hero-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center 35%;
  filter: saturate(0.65) contrast(1.08);
}

.article-hero-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(
    to top,
    rgba(10, 9, 8, 0.96) 0%,
    rgba(10, 9, 8, 0.6)  50%,
    rgba(10, 9, 8, 0.15) 100%
  );
}

.article-hero-content {
  position: relative;
  z-index: 1;
  width: 100%;
  max-width: 860px;
  padding: 0 clamp(1.5rem, 5vw, 4rem) clamp(2rem, 5vh, 3.5rem);
}

.article-hero-breadcrumb {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  margin-bottom: 1rem;
  font-family: var(--font-ui);
  font-size: 0.72rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.35);
}

.article-hero-breadcrumb a {
  color: rgba(255, 255, 255, 0.45);
  transition: color 0.15s;
}

.article-hero-breadcrumb a:hover {
  color: var(--gold-light);
}

.article-hero-tags {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
  margin-bottom: 1rem;
}

.article-hero-title {
  font-family: var(--font-display);
  font-size: clamp(2.2rem, 5vw, 4rem);
  font-weight: 700;
  line-height: 1.07;
  color: var(--white);
  letter-spacing: -0.02em;
  margin-bottom: 1.25rem;
}

.article-hero-title em {
  font-style: italic;
  font-weight: 400;
  color: var(--gold-light);
}

.article-hero-meta {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.article-meta-item {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  font-family: var(--font-ui);
  font-size: 0.78rem;
  color: rgba(255, 255, 255, 0.5);
}

.article-meta-item a {
  color: rgba(255, 255, 255, 0.65);
  text-decoration: underline;
  text-decoration-color: rgba(255, 255, 255, 0.2);
  transition: color 0.15s;
}

.article-meta-item a:hover {
  color: var(--gold-light);
}

.meta-icon {
  width: 14px;
  height: 14px;
  flex-shrink: 0;
}

.article-meta-divider {
  color: rgba(255, 255, 255, 0.2);
  font-size: 0.9rem;
}


/* ============================================================
   ARTICLE LAYOUT  (sticky sidebar + body)
============================================================ */
.article-layout {
  display: grid;
  grid-template-columns: 220px 1fr;
  grid-template-areas: "sidebar body";
  max-width: 1100px;
  margin-inline: auto;
  padding: var(--space-xl) var(--space-lg) var(--space-2xl);
  gap: var(--space-xl);
  align-items: start;
}


/* ── Sidebar ──────────────────────────────────────────────── */
.article-sidebar {
  grid-area: sidebar;
  position: sticky;
  top: calc(var(--nav-height) + 2rem);
  display: flex;
  flex-direction: column;
  gap: var(--space-xl);
}

/* Table of Contents */
.toc {
  border-left: 2px solid var(--paper-mid);
  padding-left: 1rem;
}

.toc-label {
  font-family: var(--font-ui);
  font-size: 0.65rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--ink-muted);
  margin-bottom: 0.75rem;
}

.toc-list {
  list-style: none;
  counter-reset: toc-counter;
  display: flex;
  flex-direction: column;
  gap: 0.1rem;
}

.toc-list li {
  counter-increment: toc-counter;
}

.toc-link {
  display: flex;
  align-items: baseline;
  gap: 0.5rem;
  font-family: var(--font-ui);
  font-size: 0.8rem;
  color: var(--ink-muted);
  line-height: 1.5;
  padding: 0.3rem 0;
  transition: color 0.15s;
  text-decoration: none;
}

.toc-link::before {
  content: counter(toc-counter, decimal-leading-zero);
  font-size: 0.62rem;
  font-weight: 600;
  color: var(--paper-mid);
  flex-shrink: 0;
  transition: color 0.15s;
}

.toc-link:hover,
.toc-link.is-active {
  color: var(--ink);
}

.toc-link:hover::before,
.toc-link.is-active::before {
  color: var(--gold);
}

.toc-link.is-active {
  font-weight: 600;
}

/* Share */
.sidebar-share {
  border-left: 2px solid var(--paper-mid);
  padding-left: 1rem;
}

.share-links {
  display: flex;
  gap: 0.75rem;
  margin-top: 0.5rem;
}

.share-link {
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--ink-muted);
  border: 1px solid var(--paper-mid);
  border-radius: 50%;
  transition: color 0.15s, border-color 0.15s, background 0.15s;
}

.share-link svg {
  width: 14px;
  height: 14px;
}

.share-link:hover {
  color: var(--gold);
  border-color: var(--gold);
  background: var(--gold-pale);
}


/* ── Article Body ─────────────────────────────────────────── */
.article-body {
  grid-area: body;
  min-width: 0; /* prevent grid blowout */
}


/* Historical context box */
.context-box {
  background: var(--gold-pale);
  border-left: 3px solid var(--gold);
  padding: 1.1rem 1.4rem;
  border-radius: 0 3px 3px 0;
  margin-bottom: var(--space-lg);
}

.context-box-eyebrow {
  font-family: var(--font-ui);
  font-size: 0.62rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--gold);
  margin-bottom: 0.5rem;
}

.context-box p {
  font-family: var(--font-body);
  font-size: 0.93rem;
  line-height: 1.7;
  color: var(--ink-soft);
}


/* Article text */
.article-lede {
  font-family: var(--font-body);
  font-size: 1.2rem;
  font-weight: 400;
  line-height: 1.8;
  color: var(--ink-soft);
  margin-bottom: var(--space-md);
}

.article-lede::first-letter {
  font-family: var(--font-display);
  font-size: 4.2rem;
  font-weight: 700;
  line-height: 0.8;
  float: left;
  margin: 0.1em 0.12em 0 0;
  color: var(--gold);
}

.article-body p {
  font-family: var(--font-body);
  font-size: 1.05rem;
  line-height: 1.85;
  color: var(--ink-soft);
  margin-bottom: var(--space-md);
  max-width: 68ch;
}

.article-body p + p {
  margin-top: 0;
}

/* Section headings */
.article-section-heading {
  font-family: var(--font-display);
  font-size: 1.6rem;
  font-weight: 700;
  color: var(--ink);
  letter-spacing: -0.01em;
  line-height: 1.2;
  margin: var(--space-xl) 0 var(--space-md);
  padding-top: var(--space-md);
  border-top: 1px solid var(--paper-mid);
  scroll-margin-top: calc(var(--nav-height) + 1.5rem);
}


/* Inline figures */
.article-figure {
  margin: var(--space-lg) 0 var(--space-xl);
  max-width: 100%;
}

.article-figure--right {
  float: right;
  max-width: 320px;
  margin: 0.3rem 0 var(--space-lg) var(--space-lg);
}

.article-img {
  width: 100%;
  height: auto;
  border-radius: 2px;
  display: block;
}

.article-caption {
  font-family: var(--font-ui);
  font-size: 0.75rem;
  color: var(--ink-muted);
  margin-top: 0.5rem;
  line-height: 1.5;
}

.caption-source {
  display: block;
  margin-top: 0.2rem;
  font-style: italic;
  color: rgba(90, 86, 80, 0.65);
}


/* Pull quotes */
.pull-quote {
  border: none;
  margin: var(--space-xl) 0;
  padding: var(--space-md) var(--space-lg);
  border-left: 4px solid var(--gold);
  background: var(--paper-warm);
  position: relative;
  clear: both;
}

.pull-quote::before {
  content: '\201C';
  font-family: var(--font-display);
  font-size: 5rem;
  line-height: 0.6;
  color: var(--gold);
  opacity: 0.25;
  position: absolute;
  top: 1rem;
  left: 1rem;
  pointer-events: none;
}

.pull-quote p {
  font-family: var(--font-display);
  font-size: 1.3rem;
  font-style: italic;
  font-weight: 400;
  color: var(--ink);
  line-height: 1.55;
  max-width: none !important;
  margin-bottom: var(--space-sm) !important;
  position: relative;
}

.pull-quote cite {
  font-family: var(--font-ui);
  font-size: 0.72rem;
  font-weight: 600;
  font-style: normal;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--ink-muted);
  display: block;
}

/* Alt pull quote — centered, no border */
.pull-quote--alt {
  border-left: none;
  text-align: center;
  background: transparent;
  padding: var(--space-lg) var(--space-xl);
  border-top: 1px solid var(--paper-mid);
  border-bottom: 1px solid var(--paper-mid);
}

.pull-quote--alt::before {
  left: 50%;
  transform: translateX(-50%);
  opacity: 0.12;
}

.pull-quote--alt p {
  font-size: 1.5rem;
  color: var(--ink);
}


/* Embedded video */
.article-video-wrap {
  margin: var(--space-xl) 0;
  clear: both;
}

.article-video-embed {
  position: relative;
  width: 100%;
  padding-top: 56.25%;
  background: var(--ink);
  border-radius: 3px;
  overflow: hidden;
}

.article-video-embed iframe {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  border: none;
}

/* Inline list (used in espionage / structured content) */
.article-list {
  margin: 0 0 var(--space-md) 0;
  padding-left: 0;
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  max-width: 64ch;
}

.article-list li {
  font-family: var(--font-body);
  font-size: 1.05rem;
  line-height: 1.7;
  color: var(--ink-soft);
  padding-left: 1.4rem;
  position: relative;
}

.article-list li::before {
  content: '—';
  position: absolute;
  left: 0;
  color: var(--gold);
  font-size: 0.85rem;
  top: 0.15em;
}

.article-video-caption {
  font-family: var(--font-ui) !important;
  font-size: 0.78rem !important;
  color: var(--ink-muted) !important;
  margin-top: 0.6rem !important;
  line-height: 1.5 !important;
  font-style: italic;
  max-width: none !important;
  margin-bottom: 0 !important;
}


/* Fact vs. Dramatization editorial note */
.editorial-note {
  margin-top: var(--space-xl);
  padding: 1.2rem 1.4rem;
  background: rgba(90, 86, 80, 0.07);
  border: 1px solid var(--paper-mid);
  border-radius: 3px;
  clear: both;
}

.editorial-note-header {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 0.75rem;
}

.editorial-note-icon {
  width: 18px;
  height: 18px;
  flex-shrink: 0;
  color: var(--ink-muted);
}

.editorial-note-header span {
  font-family: var(--font-ui);
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--ink-muted);
}

.editorial-note p {
  font-family: var(--font-ui) !important;
  font-size: 0.82rem !important;
  line-height: 1.7 !important;
  color: var(--ink-muted) !important;
  max-width: none !important;
  margin-bottom: 0 !important;
}

.editorial-note p em {
  font-style: italic;
}


/* ============================================================
   RELATED STORIES
============================================================ */
.related-stories {
  background: var(--paper-warm);
  border-top: 1px solid var(--paper-mid);
  padding: var(--space-xl) 0 var(--space-2xl);
}

.related-title {
  font-family: var(--font-display);
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--ink);
  margin-bottom: var(--space-lg);
  padding-bottom: var(--space-sm);
  border-bottom: 2px solid var(--ink);
}

.related-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--space-lg);
}


/* ============================================================
   TOC ACTIVE STATE (JS-driven via IntersectionObserver)
============================================================ */
.toc-link.is-active {
  color: var(--ink);
  font-weight: 600;
}

.toc-link.is-active::before {
  color: var(--gold);
}


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

/* Tablet: collapse sidebar above body */
@media (max-width: 900px) {
  .article-layout {
    grid-template-columns: 1fr;
    grid-template-areas:
      "sidebar"
      "body";
    padding: var(--space-lg);
  }

  .article-sidebar {
    position: static;
    flex-direction: row;
    flex-wrap: wrap;
    gap: var(--space-lg);
    padding: var(--space-md);
    background: var(--white);
    border-radius: 3px;
    border: 1px solid var(--paper-mid);
  }

  .toc,
  .sidebar-share {
    flex: 1;
    min-width: 160px;
  }

  .article-figure--right {
    float: none;
    max-width: 100%;
    margin: var(--space-lg) 0;
  }

  .related-grid {
    grid-template-columns: 1fr 1fr;
  }
}

/* Mobile */
@media (max-width: 600px) {
  .article-hero-title {
    font-size: 1.9rem;
  }

  .article-layout {
    padding: var(--space-md);
  }

  .pull-quote {
    padding: var(--space-sm) var(--space-md);
  }

  .pull-quote p {
    font-size: 1.1rem !important;
  }

  .pull-quote--alt p {
    font-size: 1.2rem !important;
  }

  .related-grid {
    grid-template-columns: 1fr;
  }
}
