/* ── Article Page ──────────────────────────────────── */

/* Hero: banner height, NOT a cover — reader must see article start */
.article-hero {
  position: relative; width: 100%; height: 380px;
  background: #0a0a0a;
  display: flex; align-items: flex-end; overflow: hidden;
}
.article-hero-img {
  position: absolute; inset: 0;
}
.article-hero-img img {
  width: 100%; height: 100%; object-fit: cover; opacity: .72;
}
html[data-theme="light"] .article-hero-img img { opacity: .4; }

/* Left-anchored scrim so text has clean dark field regardless of photo content */
.article-hero-overlay {
  position: absolute; inset: 0;
  background:
    linear-gradient(to right,  rgba(0,0,0,.88) 0%, rgba(0,0,0,.62) 42%, rgba(0,0,0,.12) 75%, transparent 100%),
    linear-gradient(to top,    rgba(0,0,0,.82) 0%, rgba(0,0,0,.3) 40%, transparent 70%);
}
.article-hero-content {
  position: relative; z-index: 2;
  width: 100%; max-width: 1240px; margin: 0 auto;
  padding: 0 32px 32px;
}
.article-eyebrow {
  display: flex; align-items: center; gap: 10px;
  font-size: .72rem; font-weight: 800; letter-spacing: .12em;
  text-transform: uppercase; color: rgba(255,255,255,.65);
  margin-bottom: 10px;
}
.article-eyebrow a { color: var(--brand); }
.article-eyebrow a:hover { opacity: .8; }
.article-eyebrow-sep { opacity: .35; }
.article-hero h1 {
  font-family: Georgia, serif;
  font-size: clamp(1.55rem, 3vw, 2.35rem);
  font-weight: 700; line-height: 1.17;
  color: #fff;
  text-shadow: 0 2px 18px rgba(0,0,0,.75), 0 1px 4px rgba(0,0,0,.5);
  max-width: 660px;
  margin: 0;
}

/* ── Meta bar: bridges hero to content, persists author info ── */
.article-meta-bar {
  background: var(--bg-surface);
  border-bottom: 1px solid var(--border);
}
.article-meta-bar-inner {
  max-width: 1240px; margin: 0 auto;
  padding: 14px 32px;
  display: flex; align-items: center; gap: 14px;
}
.byline-avatar {
  width: 38px; height: 38px; border-radius: 50%;
  border: 1px solid var(--border);
  background: var(--bg-card);
  display: flex; align-items: center; justify-content: center;
  font-size: .78rem; font-weight: 800; color: var(--text-2);
  text-transform: uppercase; flex-shrink: 0; overflow: hidden;
}
.byline-avatar img { width: 100%; height: 100%; object-fit: cover; }
.byline-info { flex: 1; min-width: 0; }
.byline-name  { font-size: .92rem; font-weight: 700; color: var(--text-1); }
.byline-date  { font-size: .8rem; color: var(--text-3); margin-top: 1px; }
.meta-bar-tags { display: flex; gap: 6px; flex-wrap: wrap; }
.meta-bar-tag {
  padding: 3px 9px; border: 1px solid var(--border);
  font-size: .72rem; font-weight: 700; color: var(--text-3);
  text-transform: uppercase; letter-spacing: .05em;
}

/* ── Article two-column layout ─────────────────────── */
.article-layout {
  max-width: 1240px; margin: 0 auto;
  padding: 40px 32px 60px;
  display: grid;
  grid-template-columns: 1fr 300px;
  gap: 48px;
  align-items: start;
}
.article-main { min-width: 0; }

/* ── Article body ──────────────────────────────────── */
.article-body {
  font-size: 1.08rem;
  line-height: 1.88;
  color: var(--text-2);
  max-width: 680px;
}

/* Lead paragraph — larger, sets the entry point */
.article-body > p:first-of-type {
  font-size: 1.2rem;
  line-height: 1.75;
  color: var(--text-1);
  font-weight: 400;
  margin-bottom: 1.6em;
}

.article-body h1,
.article-body h2,
.article-body h3,
.article-body h4 {
  font-family: Georgia, serif;
  color: var(--text-1);
  font-weight: 700;
  line-height: 1.25;
  margin: 2.2em 0 .65em;
}
.article-body h2 { font-size: 1.42rem; border-top: 1px solid var(--border); padding-top: 1.6em; }
.article-body h3 { font-size: 1.18rem; }
.article-body h4 { font-size: 1.08rem; text-transform: uppercase; letter-spacing: .04em; color: var(--text-2); }
.article-body p  { margin-bottom: 1.4em; }
.article-body a  { color: var(--brand); text-decoration: underline; text-underline-offset: 3px; }
.article-body a:hover { opacity: .8; }
.article-body ul,
.article-body ol  { margin: 0 0 1.4em 1.6em; }
.article-body li  { margin-bottom: .5em; }

/* Pull quote */
.article-body blockquote {
  border-left: 3px solid var(--brand);
  margin: 2em 0;
  padding: 14px 22px;
  background: var(--brand-dim);
  color: var(--text-1);
  font-size: 1.12rem;
  font-style: italic;
  line-height: 1.6;
}
.article-body blockquote p { margin: 0; }

.article-body img {
  max-width: 100%; height: auto;
  border: 1px solid var(--border);
  margin: 1.6em 0;
  display: block;
}
.article-body table {
  width: 100%; border-collapse: collapse;
  margin: 1.6em 0; font-size: 1rem;
}
.article-body th {
  background: var(--bg-surface);
  color: var(--text-1); font-weight: 700;
  padding: 8px 12px; text-align: left;
  border: 1px solid var(--border);
  font-size: .84rem; text-transform: uppercase; letter-spacing: .06em;
}
.article-body td {
  padding: 8px 12px; border: 1px solid var(--border);
  color: var(--text-2);
}
.article-body tr:nth-child(even) td { background: rgba(255,255,255,.025); }
.article-body strong { color: var(--text-1); font-weight: 700; }
.article-body em    { color: var(--text-1); }
.article-body hr    { border: none; border-top: 1px solid var(--border); margin: 2.4em 0; }
.article-body pre,
.article-body code  {
  background: var(--bg-surface);
  border: 1px solid var(--border);
  font-size: .85em; padding: 2px 6px;
}
.article-body pre   { padding: 16px; overflow-x: auto; }

/* ── Related articles (bottom of main) ────────────── */
.related-section {
  margin-top: 48px; padding-top: 24px;
  border-top: 1px solid var(--border);
  max-width: 680px;
}
.related-hd {
  font-size: .72rem; font-weight: 800; text-transform: uppercase;
  letter-spacing: .12em; color: var(--text-3);
  margin-bottom: 16px;
}
.related-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1px; background: var(--border);
  border: 1px solid var(--border);
}

/* ── Sidebar ───────────────────────────────────────── */
.article-sidebar {
  display: flex; flex-direction: column; gap: 16px;
  position: sticky;
  top: calc(var(--ticker-h) + var(--topbar-h) + var(--header-h) + 20px);
}

/* Sticky featured image in sidebar keeps the visual alive while reading */
.sidebar-feat-img {
  width: 100%; border: 1px solid var(--border); overflow: hidden;
  aspect-ratio: 16/9;
}
.sidebar-feat-img img { width: 100%; height: 100%; object-fit: cover; display: block; }

.sidebar-widget {
  background: var(--bg-card);
  border: 1px solid var(--border);
  padding: 16px;
}
.widget-title {
  font-size: .68rem; font-weight: 800; text-transform: uppercase;
  letter-spacing: .1em; color: var(--text-3);
  margin-bottom: 12px; padding-bottom: 10px;
  border-bottom: 1px solid var(--border);
}
.widget-tools { display: flex; flex-direction: column; gap: 0; }
.widget-tool {
  display: flex; align-items: center; gap: 10px;
  padding: 10px 0; border-bottom: 1px solid var(--border);
  transition: opacity .12s;
}
.widget-tool:last-child { border-bottom: none; }
.widget-tool:hover { opacity: .75; }
.wt-icon { font-size: 1.1rem; flex-shrink: 0; }
.wt-name { font-size: .92rem; font-weight: 700; color: var(--text-1); }
.wt-desc { font-size: .8rem; color: var(--text-3); margin-top: 1px; }

/* ── Skeleton loader ───────────────────────────────── */
.article-skeleton { max-width: 840px; padding: 0 32px; margin: 0 auto; }
.sk-hero   { height: 380px; background: var(--bg-surface); }
.sk-meta   { height: 60px; background: var(--bg-surface); margin-bottom: 32px; }
.sk-line   { height: 14px; background: linear-gradient(90deg, var(--bg-surface) 0%, var(--bg-card) 50%, var(--bg-surface) 100%);
             background-size: 200%; animation: shimmer 1.4s infinite; margin-bottom: 12px; }
.sk-line.wide  { width: 100%; }
.sk-line.mid   { width: 70%; }
.sk-line.short { width: 40%; }
@keyframes shimmer { 0%{background-position:200% 0} 100%{background-position:-200% 0} }

/* ── Not found ─────────────────────────────────────── */
.article-not-found {
  max-width: 600px; margin: 80px auto; padding: 0 24px; text-align: center;
}
.article-not-found h2 { font-size: 1.4rem; color: var(--text-1); margin-bottom: 12px; }
.article-not-found p  { color: var(--text-2); margin-bottom: 20px; }

/* ── Responsive ────────────────────────────────────── */
@media (max-width: 1000px) {
  .article-layout { grid-template-columns: 1fr; gap: 32px; }
  .article-sidebar { position: static; }
  .sidebar-feat-img { display: none; }
}
@media (max-width: 700px) {
  .article-hero { height: 280px; }
  .article-hero-content,
  .article-meta-bar-inner,
  .article-layout { padding-left: 16px; padding-right: 16px; }
  .article-hero h1 { font-size: 1.35rem; }
  .related-grid { grid-template-columns: 1fr; }
  .article-body { font-size: 1.08rem; }
  .article-body > p:first-of-type { font-size: 1.08rem; }
}
