/* ==========================================================================
   article.css — Long-Form Article Styling
   Ramayana: Beyond What We Were Told
   ========================================================================== */

/* --------------------------------------------------------------------------
   Article Hero
   -------------------------------------------------------------------------- */
.article-hero {
  position: relative;
  padding: var(--space-24) 0 var(--space-16);
  background: var(--bg-deep);
  overflow: hidden;
}

.article-hero--with-image {
  background-size: cover;
  background-position: center;
}

.article-hero--with-image::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(15,23,42,0.82) 0%, rgba(15,23,42,0.88) 100%);
  pointer-events: none;
}

html[data-theme="dark"] .article-hero--with-image::after {
  background: linear-gradient(180deg, rgba(2,6,18,0.85) 0%, rgba(2,6,18,0.92) 100%);
}

.article-hero--with-image .article-hero-content h1,
.article-hero--with-image .article-hero-content p,
.article-hero--with-image .article-hero-content .breadcrumbs,
.article-hero--with-image .article-hero-content .breadcrumbs a,
.article-hero--with-image .article-hero-content .article-meta {
  color: #F1F5F9;
}

.article-hero--with-image .article-hero-content .breadcrumbs,
.article-hero--with-image .article-hero-content .breadcrumbs a {
  color: rgba(241,245,249,0.7);
}

.article-hero--with-image .article-hero-content .breadcrumbs a:hover {
  color: #FFFFFF;
}

.article-hero--with-image::before {
  display: none;
}

.article-hero--with-image .article-hero-content {
  position: relative;
  z-index: 1;
}

.article-hero::before {
  content: '';
  position: absolute;
  inset: 0;
  background:
    radial-gradient(
      ellipse at 50% 100%,
      rgba(37, 99, 235, 0.04) 0%,
      transparent 60%
    );
  pointer-events: none;
}

html[data-theme="dark"] .article-hero::before {
  background:
    radial-gradient(
      ellipse at 50% 100%,
      rgba(96, 165, 250, 0.06) 0%,
      transparent 60%
    );
}

.article-hero::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 50%;
  transform: translateX(-50%);
  width: min(600px, 80%);
  height: 1px;
  background: linear-gradient(
    90deg,
    transparent,
    var(--gold-dim) 20%,
    var(--gold) 50%,
    var(--gold-dim) 80%,
    transparent
  );
}

.article-hero-content {
  position: relative;
  max-width: var(--content-max-width);
  margin: 0 auto;
  padding: 0 var(--space-6);
}

/* --------------------------------------------------------------------------
   Breadcrumbs
   -------------------------------------------------------------------------- */
.breadcrumbs {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--space-1);
  font-size: var(--text-sm);
  color: var(--text-tertiary);
  margin-bottom: var(--space-6);
}

.breadcrumbs a {
  color: var(--text-tertiary);
  transition: var(--transition-colors);
}

.breadcrumbs a:hover {
  color: var(--gold);
}

.breadcrumbs .separator {
  margin: 0 var(--space-1);
  opacity: 0.5;
}

.breadcrumbs .current {
  color: var(--text-secondary);
}

/* --------------------------------------------------------------------------
   Article Meta
   -------------------------------------------------------------------------- */
.article-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--space-4);
  margin-bottom: var(--space-6);
  font-size: var(--text-sm);
  color: var(--text-tertiary);
}

.article-meta .divider {
  width: 3px;
  height: 3px;
  border-radius: 50%;
  background: var(--text-tertiary);
  opacity: 0.5;
}

.reading-time {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
}

.reading-time svg {
  width: 14px;
  height: 14px;
}

/* --------------------------------------------------------------------------
   Article Title Area
   -------------------------------------------------------------------------- */
.article-hero h1 {
  font-family: var(--font-heading);
  font-size: clamp(var(--text-3xl), 5vw, var(--text-5xl));
  font-weight: var(--weight-bold);
  color: var(--text-primary);
  line-height: var(--leading-tight);
  margin-bottom: var(--space-4);
}

.article-hero .lead {
  font-size: var(--text-lg);
  color: var(--text-secondary);
  line-height: var(--leading-relaxed);
  max-width: 640px;
}

/* --------------------------------------------------------------------------
   Article Body
   -------------------------------------------------------------------------- */
.article-body {
  max-width: var(--content-max-width);
  margin: 0 auto;
  padding: var(--space-12) var(--space-6);
  font-size: var(--text-base);
  line-height: var(--leading-relaxed);
  color: var(--text-primary);
}

.article-body p {
  margin-bottom: var(--space-6);
}

.article-body p:last-child {
  margin-bottom: 0;
}

/* Headings */
.article-body h1 {
  font-family: var(--font-heading);
  font-size: var(--text-4xl);
  font-weight: var(--weight-bold);
  color: var(--text-primary);
  line-height: var(--leading-tight);
  margin-top: var(--space-16);
  margin-bottom: var(--space-6);
}

.article-body h2 {
  font-family: var(--font-heading);
  font-size: var(--text-2xl);
  font-weight: var(--weight-semibold);
  color: var(--accent);
  line-height: var(--leading-snug);
  margin-top: var(--space-12);
  margin-bottom: var(--space-4);
}

.article-body h3 {
  font-family: var(--font-heading);
  font-size: var(--text-xl);
  font-weight: var(--weight-semibold);
  color: var(--accent);
  line-height: var(--leading-snug);
  margin-top: var(--space-10);
  margin-bottom: var(--space-3);
}

.article-body h4 {
  font-family: var(--font-heading);
  font-size: var(--text-lg);
  font-weight: var(--weight-medium);
  color: var(--text-primary);
  line-height: var(--leading-snug);
  margin-top: var(--space-8);
  margin-bottom: var(--space-3);
}

/* Links within articles */
.article-body a:not([class]) {
  color: var(--gold);
  text-decoration: underline;
  text-decoration-color: var(--border-gold);
  text-underline-offset: 3px;
  transition: var(--transition-colors);
}

.article-body a:not([class]):hover {
  color: var(--gold-light);
  text-decoration-color: var(--gold);
}

/* Lists */
.article-body ul,
.article-body ol {
  margin-bottom: var(--space-6);
  padding-left: var(--space-6);
}

.article-body ul {
  list-style: disc;
}

.article-body ol {
  list-style: decimal;
}

.article-body li {
  margin-bottom: var(--space-2);
  line-height: var(--leading-relaxed);
  color: var(--text-secondary);
}

.article-body li::marker {
  color: var(--gold-dim);
}

/* Strong / Emphasis */
.article-body strong {
  font-weight: var(--weight-semibold);
  color: var(--text-primary);
}

.article-body em {
  font-style: italic;
}

/* --------------------------------------------------------------------------
   Section Divider
   -------------------------------------------------------------------------- */
.section-divider {
  position: relative;
  margin: var(--space-12) auto;
  width: min(400px, 60%);
  height: 1px;
  background: linear-gradient(
    90deg,
    transparent,
    var(--gold-dim) 30%,
    var(--gold) 50%,
    var(--gold-dim) 70%,
    transparent
  );
}

.section-divider::after {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%) rotate(45deg);
  width: 6px;
  height: 6px;
  background: var(--gold);
}

/* Three-dot divider variant */
.section-divider--dots {
  background: none;
  display: flex;
  justify-content: center;
  gap: var(--space-3);
  height: auto;
}

.section-divider--dots::before,
.section-divider--dots::after {
  content: '';
  width: 4px;
  height: 4px;
  border-radius: 50%;
  background: var(--gold-dim);
  position: static;
  transform: none;
}

.section-divider--dots span {
  display: block;
  width: 4px;
  height: 4px;
  border-radius: 50%;
  background: var(--gold);
}

/* --------------------------------------------------------------------------
   Blockquote
   -------------------------------------------------------------------------- */
.article-body blockquote {
  position: relative;
  margin: var(--space-8) 0;
  padding: var(--space-6) var(--space-6) var(--space-6) var(--space-8);
  border-left: 3px solid var(--gold-dim);
  background: var(--bg-surface);
  border-radius: 0 var(--radius-md) var(--radius-md) 0;
}

.article-body blockquote p {
  font-size: var(--text-base);
  font-style: italic;
  color: var(--text-secondary);
  line-height: var(--leading-relaxed);
}

.article-body blockquote cite {
  display: block;
  margin-top: var(--space-3);
  font-size: var(--text-sm);
  font-style: normal;
  color: var(--text-tertiary);
}

.article-body blockquote cite::before {
  content: '\2014 ';
}

/* --------------------------------------------------------------------------
   Tables
   -------------------------------------------------------------------------- */
.article-body .table-wrapper {
  overflow-x: auto;
  margin: var(--space-6) 0;
  border: 1px solid var(--border-default);
  border-radius: var(--radius-md);
}

.article-body table {
  width: 100%;
  font-size: var(--text-sm);
}

.article-body thead {
  background: var(--bg-surface);
}

.article-body th {
  padding: var(--space-3) var(--space-4);
  font-family: var(--font-heading);
  font-size: var(--text-xs);
  font-weight: var(--weight-semibold);
  letter-spacing: var(--tracking-wider);
  text-transform: uppercase;
  color: var(--gold);
  text-align: left;
  border-bottom: 1px solid var(--border-default);
}

.article-body td {
  padding: var(--space-3) var(--space-4);
  color: var(--text-secondary);
  border-bottom: 1px solid var(--border-subtle);
  vertical-align: top;
  line-height: var(--leading-relaxed);
}

.article-body tbody tr:last-child td {
  border-bottom: none;
}

.article-body tbody tr:hover {
  background: var(--bg-hover);
}

/* --------------------------------------------------------------------------
   Footnotes / Endnotes
   -------------------------------------------------------------------------- */
.footnotes {
  margin-top: var(--space-12);
  padding-top: var(--space-8);
  border-top: 1px solid var(--border-default);
}

.footnotes h3 {
  font-family: var(--font-heading);
  font-size: var(--text-sm);
  font-weight: var(--weight-semibold);
  letter-spacing: var(--tracking-widest);
  text-transform: uppercase;
  color: var(--gold);
  margin-bottom: var(--space-4);
}

.footnote-item {
  display: flex;
  gap: var(--space-3);
  margin-bottom: var(--space-3);
  font-size: var(--text-sm);
  color: var(--text-tertiary);
  line-height: var(--leading-relaxed);
}

.footnote-number {
  flex-shrink: 0;
  font-weight: var(--weight-semibold);
  color: var(--gold-dim);
  min-width: 1.5em;
}

.footnote-ref {
  font-size: 0.75em;
  vertical-align: super;
  color: var(--gold);
  cursor: pointer;
  padding: 0 2px;
  text-decoration: none;
  transition: var(--transition-colors);
}

.footnote-ref:hover {
  color: var(--gold-light);
}

/* --------------------------------------------------------------------------
   Evidence Section Layout
   -------------------------------------------------------------------------- */
.evidence-section {
  margin: var(--space-10) 0;
}

.evidence-section-title {
  font-family: var(--font-heading);
  font-size: var(--text-sm);
  font-weight: var(--weight-semibold);
  letter-spacing: var(--tracking-widest);
  text-transform: uppercase;
  color: var(--gold);
  margin-bottom: var(--space-4);
  padding-bottom: var(--space-2);
  border-bottom: 1px solid var(--border-subtle);
}

/* --------------------------------------------------------------------------
   Article Timeline
   -------------------------------------------------------------------------- */
.article-timeline {
  margin: var(--space-8) 0;
}

/* --------------------------------------------------------------------------
   Inline Code
   -------------------------------------------------------------------------- */
.article-body code {
  font-family: 'JetBrains Mono', 'Fira Code', monospace;
  font-size: 0.875em;
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  padding: 0.15em 0.4em;
}

/* --------------------------------------------------------------------------
   HR
   -------------------------------------------------------------------------- */
.article-body hr {
  border: none;
  margin: var(--space-10) auto;
  width: min(200px, 40%);
  height: 1px;
  background: var(--border-default);
}

/* --------------------------------------------------------------------------
   Images within articles
   -------------------------------------------------------------------------- */
.article-body figure {
  margin: var(--space-8) 0;
}

.article-body figcaption {
  margin-top: var(--space-2);
  font-size: var(--text-sm);
  color: var(--text-tertiary);
  text-align: center;
  font-style: italic;
}

.article-body img {
  border-radius: var(--radius-md);
}

/* --------------------------------------------------------------------------
   Drop Cap (first paragraph optional)
   -------------------------------------------------------------------------- */
.article-body .drop-cap::first-letter {
  font-family: var(--font-heading);
  font-size: 3.5em;
  float: left;
  line-height: 0.8;
  padding-right: var(--space-2);
  padding-top: var(--space-1);
  color: var(--gold);
}
