/* Offline article reader — a news-reader overlay shared by index.html and press.html.
   Renders the locally-archived content (data/articles-content.js) so an article stays
   readable even if the original and web.archive.org are both unavailable. */

.reader-overlay {
  position: fixed;
  inset: 0;
  background: rgba(20, 28, 36, 0.72);
  z-index: 2000;
  display: none;
  opacity: 0;
  transition: opacity .2s ease;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
}
.reader-overlay.is-open { display: block; opacity: 1; }
body.reader-locked { overflow: hidden; }

.reader-modal {
  background: #fff;
  max-width: 760px;
  margin: 40px auto;
  border-radius: 12px;
  box-shadow: 0 20px 60px rgba(0,0,0,.4);
  position: relative;
  overflow: hidden;
}
@media (max-width: 800px) { .reader-modal { margin: 0; border-radius: 0; min-height: 100vh; } }

/* Sticky top bar with outlet + close */
.reader-bar {
  position: sticky;
  top: 0;
  z-index: 3;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 20px;
  background: #fff;
  border-bottom: 1px solid #ecf0f1;
}
.reader-bar .reader-outlet-logo {
  height: 26px; width: auto; max-width: 140px; object-fit: contain;
}
.reader-bar .reader-outlet-name { font-family: 'Montserrat', sans-serif; font-weight: 700; color: #2C3E50; font-size: 16px; }
.reader-bar .reader-spacer { flex: 1; }
.reader-close {
  border: none; background: #f1f3f5; color: #555; width: 36px; height: 36px;
  border-radius: 50%; font-size: 18px; cursor: pointer; line-height: 1; transition: background .15s;
}
.reader-close:hover { background: #e2e6ea; color: #000; }

.reader-body { padding: 26px 36px 40px; }
@media (max-width: 800px) { .reader-body { padding: 20px 18px 32px; } }

.reader-badges { margin-bottom: 14px; }
.reader-badge {
  display: inline-block; font-size: 11px; font-weight: 700; padding: 3px 9px;
  border-radius: 4px; margin-right: 6px; text-transform: uppercase; letter-spacing: .03em; color: #fff;
}
.reader-badge--startup { background: #18BC9C; }
.reader-badge--business { background: #2980B9; }
.reader-badge--study { background: #8E44AD; }
.reader-badge--award { background: #E67E22; }
.reader-badge--scope { background: #ecf0f1; color: #7f8c8d; }

.reader-title {
  font-family: 'Montserrat', sans-serif;
  font-size: 30px; line-height: 1.25; color: #1a242f; margin: 0 0 14px;
}
@media (max-width: 800px) { .reader-title { font-size: 24px; } }

.reader-meta {
  display: flex; flex-wrap: wrap; align-items: center; gap: 6px 10px;
  font-size: 14px; color: #7f8c8d; border-bottom: 1px solid #eee;
  padding-bottom: 16px; margin-bottom: 22px;
}
.reader-meta .reader-source { font-weight: 700; color: #34495E; }
.reader-meta .reader-sep { color: #ccc; }

.reader-hero { width: 100%; border-radius: 8px; margin: 0 0 8px; display: block; background: #f0f2f3; }
.reader-figure { margin: 22px 0; }
.reader-figure img { width: 100%; border-radius: 8px; display: block; background: #f0f2f3; }
.reader-figcaption, .reader-hero-caption { font-size: 13px; font-style: italic; color: #95a5a6; text-align: center; margin-top: 8px; }

.reader-content p { font-size: 18px; line-height: 1.72; color: #2d3a45; margin: 0 0 18px; }
.reader-content p:first-of-type { font-size: 19px; }

.reader-note {
  background: #fff8e1; border: 1px solid #ffe6a8; color: #8a6d3b;
  padding: 10px 14px; border-radius: 6px; font-size: 14px; margin-bottom: 22px;
}

/* Footer actions — original first (prioritized), then archives */
.reader-actions {
  position: sticky; bottom: 0;
  display: flex; flex-wrap: wrap; gap: 10px; align-items: center;
  padding: 14px 36px; background: #fafbfc; border-top: 1px solid #ecf0f1;
}
@media (max-width: 800px) { .reader-actions { padding: 12px 18px; } }
.reader-actions .btn { margin: 0; font-size: 14px; }
.reader-actions .reader-spacer { flex: 1; }
.reader-btn-primary {
  background: #18BC9C; color: #fff; border: none; padding: 9px 18px; border-radius: 6px;
  font-weight: 700; text-decoration: none; display: inline-flex; align-items: center; gap: 7px;
}
.reader-btn-primary:hover, .reader-btn-primary:focus { background: #15a589; color: #fff; text-decoration: none; }
.reader-btn-ghost {
  background: #fff; color: #34495E; border: 1px solid #ccd2d8; padding: 8px 16px; border-radius: 6px;
  text-decoration: none; display: inline-flex; align-items: center; gap: 7px;
}
.reader-btn-ghost:hover, .reader-btn-ghost:focus { border-color: #18BC9C; color: #18BC9C; text-decoration: none; }
