/* Unified Lemon article reading experience. Loaded after each article's legacy inline CSS. */
:root {
  --article-width: 1120px;
  --reading-width: 760px;
}

.article-page {
  min-height: 100vh;
  background:
    radial-gradient(760px 460px at 12% -8%, rgba(246, 211, 74, 0.075), transparent 72%),
    radial-gradient(680px 420px at 100% 20%, rgba(107, 220, 255, 0.045), transparent 72%),
    var(--lm-bg);
  color: var(--lm-text);
  font-family: var(--lm-font-sans);
  line-height: 1.82;
}

.article-page h1,
.article-page h2,
.article-page h3,
.article-page .brand {
  font-family: var(--lm-font-sans);
}

.article-page a {
  color: var(--lm-cyan);
  text-underline-offset: 0.24em;
}

.article-page .nav-wrap,
.article-page .article-wrap,
.article-page .footer-inner {
  width: min(var(--article-width), calc(100% - 40px));
  margin-inline: auto;
}

/* Reading progress */
.article-progress {
  position: fixed;
  top: 0;
  right: 0;
  left: 0;
  z-index: 100;
  height: 3px;
  transform: scaleX(0);
  transform-origin: left center;
  background: linear-gradient(90deg, var(--lm-lemon), var(--lm-cyan));
  box-shadow: 0 0 14px rgba(107, 220, 255, 0.32);
  pointer-events: none;
}

.reading-top {
  position: fixed;
  right: 22px;
  bottom: 22px;
  z-index: 30;
  display: grid;
  width: 44px;
  height: 44px;
  place-items: center;
  border: 1px solid var(--lm-line-strong);
  border-radius: 50%;
  background: rgba(15, 21, 30, 0.9);
  color: var(--lm-lemon);
  box-shadow: var(--lm-shadow);
  opacity: 0;
  transform: translateY(10px);
  pointer-events: none;
  cursor: pointer;
  transition: opacity 160ms ease, transform 160ms ease, border-color 160ms ease;
  -webkit-backdrop-filter: blur(14px);
  backdrop-filter: blur(14px);
}

.reading-top.is-visible {
  opacity: 1;
  transform: none;
  pointer-events: auto;
}

.reading-top:hover,
.reading-top:focus-visible {
  border-color: rgba(246, 211, 74, 0.5);
}

/* Header */
.article-page .site-header {
  position: sticky;
  top: 0;
  z-index: 40;
  border-bottom: 1px solid var(--lm-line);
  background: rgba(6, 8, 13, 0.80);
  -webkit-backdrop-filter: blur(20px) saturate(130%);
  backdrop-filter: blur(20px) saturate(130%);
}

.article-page .nav-wrap {
  display: flex;
  min-height: 72px;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
}

.article-page .brand {
  display: inline-flex;
  align-items: center;
  gap: 11px;
  color: var(--lm-text);
  font-weight: 700;
  text-decoration: none;
}

.article-page .brand img {
  width: 42px;
  height: 42px;
  border: 1px solid rgba(246, 211, 74, 0.3);
  border-radius: 12px;
  background: #f3edcf;
  box-shadow: 0 8px 28px -16px rgba(246, 211, 74, 0.78);
  object-fit: cover;
}

.article-page .brand span {
  display: grid;
  color: var(--lm-text);
  font-size: 0.98rem;
  line-height: 1.08;
}

.article-page .brand small {
  margin-top: 3px;
  color: var(--lm-lemon);
  font-family: var(--lm-font-mono);
  font-size: 0.62rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.article-page .nav-link {
  flex: 0 0 auto;
  padding: 9px 14px;
  border: 1px solid var(--lm-line-strong);
  border-radius: 999px;
  background: var(--lm-surface-soft);
  color: var(--lm-muted);
  font-size: 0.8rem;
  font-weight: 700;
  text-decoration: none;
}

.article-page .nav-link:hover,
.article-page .nav-link:focus-visible {
  border-color: rgba(246, 211, 74, 0.42);
  background: var(--lm-lemon-soft);
  color: var(--lm-lemon-bright);
}

/* Article hero */
.article-page .article-hero {
  position: relative;
  isolation: isolate;
  overflow: hidden;
  padding: clamp(64px, 8vw, 104px) 0 clamp(42px, 6vw, 72px);
  background: var(--lm-bg) url("../market-vlog-hero.webp") center / cover no-repeat;
  color: var(--lm-text);
}

.article-page .article-hero::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -2;
  background:
    linear-gradient(90deg, rgba(6, 8, 13, 0.98) 0%, rgba(6, 8, 13, 0.90) 48%, rgba(6, 8, 13, 0.56) 100%),
    radial-gradient(620px 360px at 14% 42%, rgba(246, 211, 74, 0.11), transparent 72%);
}

.article-page .article-hero::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  background-image:
    linear-gradient(rgba(107, 220, 255, 0.032) 1px, transparent 1px),
    linear-gradient(90deg, rgba(107, 220, 255, 0.032) 1px, transparent 1px);
  background-size: 64px 64px;
  mask-image: linear-gradient(90deg, #000, transparent 76%);
}

.article-page .article-hero .article-wrap {
  position: relative;
}

.article-page .article-hero p {
  margin: 0 0 16px;
  color: var(--lm-lemon);
  font-family: var(--lm-font-mono);
  font-size: 0.76rem;
  font-weight: 700;
  letter-spacing: 0.10em;
  text-transform: uppercase;
}

.article-page .article-hero h1 {
  max-width: 17ch;
  margin: 0;
  color: var(--lm-text);
  font-size: clamp(2.65rem, 6.2vw, 5rem);
  font-weight: 650;
  line-height: 1.05;
  letter-spacing: -0.052em;
  overflow-wrap: anywhere;
}

.article-page .meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 26px;
  color: var(--lm-text-soft);
  font-size: 0.76rem;
  font-weight: 600;
}

.article-page .meta span,
.article-page .meta a {
  padding: 6px 11px;
  border: 1px solid var(--lm-line-strong);
  border-radius: 999px;
  background: rgba(8, 12, 18, 0.6);
  color: var(--lm-text-soft);
  text-decoration: none;
  -webkit-backdrop-filter: blur(10px);
  backdrop-filter: blur(10px);
}

.article-page .meta a {
  border-color: rgba(246, 211, 74, 0.34);
  color: var(--lm-lemon-bright);
}

.article-page .meta a:hover,
.article-page .meta a:focus-visible {
  border-color: var(--lm-lemon);
  background: var(--lm-lemon-soft);
}

/* Reading layout */
.article-page main {
  padding: clamp(36px, 5vw, 64px) 0 90px;
}

.article-page .content-layout {
  display: grid;
  grid-template-columns: minmax(0, var(--reading-width)) minmax(220px, 280px);
  gap: clamp(24px, 4vw, 44px);
  align-items: start;
  justify-content: space-between;
}

.article-page article {
  min-width: 0;
  padding: clamp(26px, 4.5vw, 50px);
  border: 1px solid var(--lm-line);
  border-radius: var(--lm-radius-lg);
  background: rgba(15, 21, 30, 0.80);
  color: var(--lm-text-soft);
  box-shadow: var(--lm-shadow);
  -webkit-backdrop-filter: blur(14px) saturate(112%);
  backdrop-filter: blur(14px) saturate(112%);
}

.article-page article > :first-child {
  margin-top: 0;
}

.article-page article p {
  margin: 0 0 1.18em;
  color: var(--lm-text-soft);
  font-size: clamp(1rem, 1.3vw, 1.075rem);
  line-height: 1.92;
}

.article-page article .lead {
  color: var(--lm-text);
  font-size: clamp(1.08rem, 1.5vw, 1.18rem);
  font-weight: 650;
  line-height: 1.9;
}

.article-page article h2 {
  position: relative;
  margin: 2.4em 0 0.8em;
  padding-left: 17px;
  color: var(--lm-text);
  font-size: clamp(1.35rem, 2.4vw, 1.7rem);
  font-weight: 650;
  line-height: 1.36;
  letter-spacing: -0.025em;
  scroll-margin-top: 96px;
}

.article-page article h2::before {
  content: "";
  position: absolute;
  top: 0.15em;
  bottom: 0.15em;
  left: 0;
  width: 4px;
  border-radius: 999px;
  background: linear-gradient(var(--lm-lemon), var(--lm-cyan));
}

.article-page article h3 {
  margin: 1.8em 0 0.7em;
  color: var(--lm-text);
}

.article-page article strong {
  color: var(--lm-text);
}

.article-page article a {
  color: var(--lm-cyan);
}

.article-page article a:hover,
.article-page article a:focus-visible {
  color: var(--lm-lemon-bright);
}

.article-page article ul,
.article-page article ol {
  margin: 0 0 1.4em;
  padding-left: 1.35em;
  color: var(--lm-text-soft);
}

.article-page article li {
  margin-bottom: 0.68em;
  padding-left: 0.18em;
}

.article-page article li::marker {
  color: var(--lm-lemon);
}

.article-page article img:not(.qr-card img) {
  height: auto;
  margin: 24px auto;
  border: 1px solid var(--lm-line);
  border-radius: 14px;
}

.article-page .archive-note {
  margin-bottom: 24px;
  padding: 13px 15px;
  border: 1px solid var(--lm-line);
  border-radius: 12px;
  background: var(--lm-surface-soft);
  color: var(--lm-muted);
  font-size: 0.82rem;
}

.article-page .quote-card,
.article-page .warning-card,
.article-page .pool-row {
  margin: 26px 0;
  padding: 18px 20px;
  border: 1px solid var(--lm-line);
  border-left-width: 4px;
  border-radius: 0 13px 13px 0;
  background: var(--lm-surface-soft);
  color: var(--lm-text);
  font-weight: 650;
}

.article-page .quote-card,
.article-page .pool-row {
  border-left-color: var(--lm-lemon);
  background: var(--lm-lemon-soft);
}

.article-page .warning-card {
  border-left-color: var(--lm-red);
  background: var(--lm-red-soft);
  color: var(--lm-text-soft);
}

/* Compatibility layer for the earliest article templates. */
.article-page .note-row,
.article-page .watch-row,
.article-page .event-row {
  padding: 14px 16px;
  border: 1px solid var(--lm-line);
  border-left: 4px solid var(--lm-lemon);
  border-radius: 0 12px 12px 0;
  background: var(--lm-surface-soft);
  color: var(--lm-text-soft);
}

.article-page .note-row strong,
.article-page .watch-row strong,
.article-page .event-row strong {
  color: var(--lm-text);
}

.article-page .stock-table {
  display: block;
  width: 100%;
  max-width: 100%;
  margin: 24px 0 30px;
  overflow-x: auto;
  border: 1px solid var(--lm-line);
  border-radius: 14px;
  background: rgba(3, 7, 12, 0.38);
  color: var(--lm-text-soft);
  font-family: var(--lm-font-mono);
  font-size: 0.78rem;
  scrollbar-color: #465162 var(--lm-bg-deep);
}

.article-page .stock-table thead,
.article-page .stock-table tbody {
  display: table;
  width: 100%;
  min-width: 620px;
}

.article-page .stock-table th,
.article-page .stock-table td {
  padding: 12px 14px;
  border: 0;
  border-bottom: 1px solid var(--lm-line);
  background: transparent;
  color: inherit;
  text-align: left;
  vertical-align: top;
}

.article-page .stock-table th {
  background: rgba(107, 220, 255, 0.055);
  color: var(--lm-muted);
}

.article-page .stock-table strong {
  color: var(--lm-green);
}

.article-page .stock-pool {
  display: grid;
  gap: 12px;
  margin: 24px 0;
}

.article-page .stock-pool .pool-row {
  margin: 0;
}

.article-page .event-list {
  padding-left: 1.25em;
}

.article-page .disclaimer {
  margin-top: 34px;
  padding: 18px;
  border: 1px solid rgba(246, 211, 74, 0.18);
  border-radius: 13px;
  background: rgba(246, 211, 74, 0.06);
  color: var(--lm-muted);
  font-size: 0.84rem;
}

/* Tables */
.article-page .table-wrap {
  max-width: 100%;
  margin: 24px 0 30px;
  overflow-x: auto;
  border: 1px solid var(--lm-line);
  border-radius: 14px;
  background: rgba(3, 7, 12, 0.38);
  scrollbar-color: #465162 var(--lm-bg-deep);
}

.article-page .table-wrap:focus-visible {
  outline: 2px solid var(--lm-cyan);
  outline-offset: 3px;
}

.article-page .data-table {
  width: 100%;
  min-width: 620px;
  margin: 0;
  border: 0;
  border-collapse: collapse;
  background: transparent;
  color: var(--lm-text-soft);
  font-family: var(--lm-font-mono);
  font-size: 0.78rem;
}

.article-page .data-table th,
.article-page .data-table td {
  padding: 12px 14px;
  border: 0;
  border-bottom: 1px solid var(--lm-line);
  background: transparent;
  color: inherit;
  text-align: left;
  vertical-align: top;
}

.article-page .data-table thead th {
  background: rgba(107, 220, 255, 0.055);
  color: var(--lm-muted);
  font-size: 0.68rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.article-page .data-table tbody tr:last-child > * {
  border-bottom: 0;
}

.article-page .data-table tbody tr:hover > * {
  background: rgba(255, 255, 255, 0.025);
}

.article-page .data-table strong {
  color: var(--lm-green);
}

/* Sidebar */
.article-page .side-panel {
  position: sticky;
  top: 94px;
  display: grid;
  gap: 14px;
}

.article-page .side-panel section,
.article-page .qr-card,
.article-page .toc-card {
  padding: 18px;
  border: 1px solid var(--lm-line);
  border-radius: 15px;
  background: rgba(15, 21, 30, 0.78);
  box-shadow: none;
  -webkit-backdrop-filter: blur(12px);
  backdrop-filter: blur(12px);
}

.article-page .side-panel h2,
.article-page .qr-card h2,
.article-page .toc-card h2 {
  margin: 0 0 12px;
  padding: 0;
  color: var(--lm-muted);
  font-family: var(--lm-font-mono);
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.article-page .side-panel h2::before,
.article-page .qr-card h2::before,
.article-page .toc-card h2::before {
  display: none;
}

.article-page .toc-card a {
  display: block;
  padding: 9px 2px;
  border-top: 1px solid var(--lm-line);
  color: var(--lm-text-soft);
  font-size: 0.8rem;
  font-weight: 600;
  text-decoration: none;
  transition: color 150ms ease, padding-left 150ms ease;
}

.article-page .toc-card a:hover,
.article-page .toc-card a:focus-visible,
.article-page .toc-card a[aria-current="true"] {
  padding-left: 7px;
  color: var(--lm-lemon-bright);
}

.article-page .toc-card a[aria-current="true"] {
  border-left: 2px solid var(--lm-lemon);
}

.article-page .qr-card img {
  display: block;
  width: 100%;
  max-width: 220px;
  height: auto;
  margin: 0 auto;
  border: 0;
  border-radius: 10px;
  background: #fff;
}

.article-page .qr-placeholder {
  display: none;
  color: var(--lm-muted);
  font-size: 0.8rem;
}

.article-page .qr-card.missing img {
  display: none;
}

.article-page .qr-card.missing .qr-placeholder {
  display: block;
}

/* Footer */
.article-page .site-footer {
  padding: 30px 0 38px;
  border-top: 1px solid var(--lm-line);
  background: rgba(3, 5, 8, 0.74);
  color: var(--lm-muted);
  font-size: 0.75rem;
}

@media (max-width: 900px) {
  .article-page .content-layout {
    grid-template-columns: 1fr;
  }

  .article-page .side-panel {
    position: static;
    grid-template-columns: 1fr 220px;
  }

  .article-page .toc-card,
  .article-page .qr-card {
    min-width: 0;
  }
}

@media (max-width: 620px) {
  .article-page .nav-wrap,
  .article-page .article-wrap,
  .article-page .footer-inner {
    width: calc(100% - 32px);
  }

  .article-page .nav-wrap {
    min-height: 64px;
  }

  .article-page .brand img {
    width: 40px;
    height: 40px;
  }

  .article-page .brand span {
    font-size: 0.88rem;
  }

  .article-page .nav-link {
    padding: 8px 11px;
    font-size: 0.72rem;
  }

  .article-page .article-hero {
    padding: 48px 0 38px;
  }

  .article-page .article-hero h1 {
    max-width: none;
    font-size: clamp(2.35rem, 12vw, 3.5rem);
  }

  .article-page .meta {
    gap: 6px;
    margin-top: 22px;
  }

  .article-page .meta span,
  .article-page .meta a {
    padding: 5px 9px;
    font-size: 0.69rem;
  }

  .article-page main {
    padding: 26px 0 64px;
  }

  .article-page article {
    padding: 24px 20px;
    border-radius: 18px;
  }

  .article-page article p {
    font-size: 1rem;
    line-height: 1.88;
  }

  .article-page article h2 {
    margin-top: 2.1em;
    font-size: 1.35rem;
  }

  .article-page .side-panel {
    grid-template-columns: 1fr;
  }

  .article-page .qr-card img {
    max-width: 200px;
  }

  .reading-top {
    right: 14px;
    bottom: 14px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .article-progress {
    box-shadow: none;
  }

  .reading-top {
    transition: none;
  }
}
