/* ============================================================
   styles_articles.css
   Article-specific styles for individually authored pages.
   Extends styles_static.css — always load AFTER it:
     <link rel="stylesheet" href="/styles_static.css?v=2.1">
     <link rel="stylesheet" href="/styles_articles.css?v=1.0">
   ============================================================ */

/* ── ARTICLE LAYOUT ──────────────────────────────────────────
   Articles use a two-column layout: narrow left sidebar (info
   box + floating images) and a wider right content column.
   On mobile both collapse to single column.
   ---------------------------------------------------------- */
.article-container {
  display: grid;
  grid-template-columns: 1fr;
  gap: 32px;
  align-items: start;
  width: 100%;
  max-width: 1100px;
  margin: 0 auto;
}

.article-container:has(> .article-sidebar) {
  grid-template-columns: 280px 1fr;
}

.article-sidebar {
  grid-column: 1;
  position: sticky;
  top: calc(var(--pa-head-h) + 70px);
}

.article-body {
  grid-column: 2;
  min-width: 0;
}

/* ── ARTICLE TYPOGRAPHY ──────────────────────────────────────
   Slightly larger body text than metric pages, better for
   long-form reading. Uses same font token as site.
   ---------------------------------------------------------- */
.article-body p {
  font-size: 15px;
  line-height: 1.75;
  color: #222;
  margin: 0 0 18px;
}

.article-body h1 {
  font-size: 28px;
  font-weight: 700;
  color: #111;
  margin: 0 0 8px;
  line-height: 1.2;
  display: flex;
  align-items: center;
  gap: 12px;
}

.article-body h1 .article-flag {
  max-height: 32px;
  width: auto;
  flex-shrink: 0;
}

.article-body h2 {
  font-size: 20px;
  font-weight: 600;
  color: #111;
  margin: 32px 0 12px;
  padding-bottom: 8px;
  border-bottom: 1px solid #e2e2e2;
  scroll-margin-top: calc(var(--pa-head-h) + 20px);
}

.article-body h3 {
  font-size: 16px;
  font-weight: 600;
  color: #333;
  margin: 22px 0 8px;
}

.article-body h4 {
  font-size: 14px;
  font-weight: 600;
  color: #444;
  margin: 16px 0 6px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.article-body li {
  font-size: 14px;
  line-height: 1.6;
  color: #333;
  margin-bottom: 6px;
}

.article-body ul, .article-body ol {
  padding-left: 20px;
  margin: 0 0 18px;
}

/* Chronology note — small grey text often used at section top */
.article-body p[style*="color: grey"],
.article-chrono-note {
  color: #888 !important;
  font-size: 13px !important;
  margin: -8px 0 16px;
}

/* ── IMAGES — FOUR LAYOUT MODES ─────────────────────────────
   .image-box            → right-aligned, floats beside text
   .image-box.wide       → full content width, centered
   .image-box.narrow     → smaller right-float (portraits)
   .image-box.verywide   → full bleed width, left-float clear
   ---------------------------------------------------------- */

/* Base image box */
.image-box {
  margin: 0 0 20px 24px;
  float: right;
  clear: right;
  width: 280px;
}

.image-box.narrow {
  width: 200px;
}

.image-box.wide {
  float: none;
  clear: both;
  width: 100%;
  margin: 20px 0;
}

.image-box.verywide {
  float: left;
  clear: left;
  width: 340px;
  margin: 0 24px 20px 0;
}

/* Clearfix after floated images */
.article-body .section-clear {
  clear: both;
}

.image-box .image-box-container {
  margin: 0;
}

.image-box figure {
  margin: 0;
}

.image-box img {
  width: 100%;
  height: auto;
  display: block;
  border: 1px solid #e8e8e8;
}

.image-box figcaption {
  margin-top: 6px;
  font-size: 11px;
  color: #888;
  text-align: center;
  line-height: 1.4;
  font-style: italic;
}

/* ── IFRAMES — TWO MODES ─────────────────────────────────────
   .iframe-container     → always-loaded data iframe
   .iframe-placeholder   → lazy-loaded atlas iframe (click to load)
   ---------------------------------------------------------- */
.iframe-container {
  width: 100%;
  margin: 24px 0 8px;
  border: 1px solid #e2e2e2;
  background: #f8f8f8;
  min-height: 420px;
  display: flex;
  align-items: stretch;
}

.iframe-container .iframe-phersu {
  width: 100%;
  min-height: 420px;
  border: none;
  display: block;
}

/* Lazy-load placeholder */
.iframe-placeholder {
  width: 100%;
  margin: 24px 0 8px;
  border: 1px solid #e2e2e2;
  background: #f3f4f6;
  min-height: 280px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.iframe-loader-box {
  text-align: center;
  padding: 32px;
}

.iframe-load-button {
  display: inline-block;
  padding: 10px 22px;
  background: transparent;
  color: var(--pa-url);
  border: 1px solid var(--pa-url);
  font-size: 13px;
  font-weight: 500;
  letter-spacing: 0.8px;
  cursor: pointer;
  transition: background 0.18s, color 0.18s;
  font-family: inherit;
}

.iframe-load-button:hover {
  background: var(--pa-url);
  color: #fff;
}

/* Caption below iframes */
.iframe-caption {
  text-align: center;
  font-size: 12px;
  color: #888;
  margin: 4px 0 20px;
  font-style: italic;
}

/* ── AUTHOR BOX ──────────────────────────────────────────────
   Shown at the bottom of articles before Sources.
   ---------------------------------------------------------- */
.author-box {
  display: flex;
  align-items: center;
  gap: 18px;
  padding: 20px;
  margin: 32px 0 28px;
  border: 1px solid #e2e2e2;
  background: #fafafa;
}

.author-photo {
  width: 64px;
  height: 64px;
  border-radius: 50%;
  object-fit: cover;
  flex-shrink: 0;
  border: 2px solid #e2e2e2;
}

.author-info {
  min-width: 0;
}

.author-name {
  font-size: 14px;
  font-weight: 600;
  margin: 0 0 4px;
  color: #111;
}

.author-name a {
  color: var(--pa-url);
  text-decoration: none;
}

.author-name a:hover {
  text-decoration: underline;
}

.author-bio {
  font-size: 13px;
  color: #555;
  margin: 0 0 4px;
  line-height: 1.4;
}

.author-date {
  font-size: 12px;
  color: #999;
  margin: 0;
}

/* ── SOURCES LIST ────────────────────────────────────────────
   <ul class="sources-list"> or bare <li> tags after Sources h2
   ---------------------------------------------------------- */
.article-body h2#Sources + hr + li,
.article-body h2[id*="Source"] ~ li,
.sources-list li {
  font-size: 13px;
  color: #444;
  line-height: 1.55;
  margin-bottom: 8px;
  list-style: disc;
}

.sources-list {
  padding-left: 18px;
  margin: 0 0 24px;
}

/* ── INTRO NOTE ──────────────────────────────────────────────
   Grey small text at the top of sections linking to chronology
   ---------------------------------------------------------- */
.article-intro-note {
  color: #888;
  font-size: 13px;
  margin: -4px 0 18px;
  font-style: italic;
}

/* ── CALLOUT / HIGHLIGHT BOX ─────────────────────────────────
   Optional highlighted text box for key facts or quotes
   ---------------------------------------------------------- */
.article-callout {
  border-left: 3px solid var(--pa-url);
  background: #f0f4fb;
  padding: 14px 18px;
  margin: 20px 0;
  font-size: 14px;
  color: #333;
  line-height: 1.6;
}

.article-callout strong {
  color: #111;
}

/* ── SECTION DIVIDER ─────────────────────────────────────────
   Used after clearfix to visually separate major sections
   ---------------------------------------------------------- */
.article-section-break {
  clear: both;
  border: none;
  border-top: 1px solid #e8e8e8;
  margin: 28px 0;
}

/* ── TIMELINE LIST ───────────────────────────────────────────
   Simple vertical list for chronology entries
   ---------------------------------------------------------- */
.timeline-list {
  list-style: none;
  padding: 0;
  margin: 0 0 24px;
}

.timeline-list li {
  padding: 10px 0 10px 18px;
  border-left: 2px solid #e2e2e2;
  margin-bottom: 0;
  font-size: 14px;
  color: #333;
  position: relative;
}

.timeline-list li::before {
  content: '';
  position: absolute;
  left: -5px;
  top: 16px;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--pa-url);
}

.timeline-date {
  font-weight: 600;
  color: #111;
  margin-right: 6px;
}

/* ── RESPONSIVE ──────────────────────────────────────────────
   Below 820px: single column, floats cleared
   ---------------------------------------------------------- */
@media (max-width: 820px) {
  .article-container {
    grid-template-columns: 1fr;
    gap: 0;
  }

  .article-sidebar {
    grid-column: 1;
    position: static;
    margin-bottom: 24px;
  }

  .article-body {
    grid-column: 1;
  }

  /* Clear all floats on mobile */
  .image-box,
  .image-box.narrow,
  .image-box.verywide {
    float: none;
    clear: both;
    width: 100%;
    margin: 16px 0;
  }

  .image-box.wide {
    margin: 16px 0;
  }

  .author-box {
    flex-direction: column;
    align-items: flex-start;
    gap: 12px;
  }

  .article-body h1 {
    font-size: 22px;
  }

  .article-body h2 {
    font-size: 18px;
  }
}

@media (max-width: 480px) {
  .iframe-container,
  .iframe-placeholder {
    min-height: 240px;
  }

  .iframe-container .iframe-phersu {
    min-height: 240px;
  }
}

/* ── PAYWALL ─────────────────────────────────────────────────
   #paywall-content is blurred for non-subscribers.
   #paywall-gate holds the subscription prompt.
   ---------------------------------------------------------- */
#paywall-content {
  display: block;
}

.paywall-box {
  text-align: center;
  padding: 36px 24px;
  margin: 0 0 28px;
  border: 1px solid #e2e2e2;
  background: #fafafa;
}

.paywall-title {
  font-size: 17px;
  font-weight: 600;
  color: #111;
  margin: 0 0 10px;
}

.paywall-sub {
  font-size: 13px;
  color: #666;
  line-height: 1.6;
  margin: 0 0 24px;
  max-width: 480px;
  margin-left: auto;
  margin-right: auto;
}

.paywall-actions {
  display: flex;
  gap: 12px;
  justify-content: center;
  flex-wrap: wrap;
}

.paywall-btn {
  display: inline-block;
  padding: 10px 24px;
  font-size: 13px;
  font-weight: 500;
  letter-spacing: 0.8px;
  text-decoration: none;
  border: 1px solid var(--pa-url);
  transition: background 0.18s, color 0.18s;
}

.paywall-btn--primary {
  background: var(--pa-url);
  color: #fff;
}

.paywall-btn--primary:hover {
  background: #283C70;
  border-color: #283C70;
  color: #fff;
}

.paywall-btn--secondary {
  background: transparent;
  color: var(--pa-url);
}

.paywall-btn--secondary:hover {
  background: var(--pa-url);
  color: #fff;
}

.article-container:not(:has(> .article-sidebar)) {
  grid-template-columns: 1fr !important;
}
