/* =========================================================
   lm-article.css — Two-column article layout + visual blocks
   Uses existing design tokens from style.css
   All classes prefixed lm-
   ========================================================= */

/* ── Two-column grid ── */
.lm-article-layout {
  padding: 3.5rem 20px 5rem;
}

.lm-article-grid {
  display: grid;
  grid-template-columns: 1fr 300px;
  gap: 3.5rem;
  max-width: var(--max-width);
  margin: 0 auto;
  align-items: start;
}

.lm-article-main {
  min-width: 0;
}

/* ── Sticky sidebar ── */
.lm-article-sidebar {
  position: relative;
}

.lm-sidebar-inner {
  position: sticky;
  top: 100px;
  display: flex;
  flex-direction: column;
  gap: 2rem;
}

/* ── Table of contents ── */
.lm-toc {
  background: var(--grey);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 1.5rem;
}

.lm-toc-title {
  font-size: 0.8rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
  margin: 0 0 1rem;
}

.lm-toc-list {
  list-style: none;
  padding: 0;
  margin: 0;
  counter-reset: toc;
}

.lm-toc-list li {
  counter-increment: toc;
  margin-bottom: 0;
}

.lm-toc-link {
  display: block;
  padding: 0.45rem 0;
  font-size: 0.82rem;
  line-height: 1.4;
  color: var(--muted);
  text-decoration: none;
  border-left: 2px solid transparent;
  padding-left: 0.875rem;
  transition: color 0.15s, border-color 0.15s;
}

.lm-toc-link:hover {
  color: var(--dark);
  text-decoration: none;
}

.lm-toc-link.active {
  color: var(--teal);
  border-left-color: var(--teal);
  font-weight: 600;
}

/* ── Sidebar CTA ── */
.lm-sidebar-cta {
  background: linear-gradient(135deg, var(--teal-light) 0%, rgba(214,228,245,0.35) 100%);
  border: 1px solid rgba(13,148,136,0.25);
  border-radius: var(--radius-lg);
  padding: 1.5rem;
  text-align: center;
}

.lm-sidebar-cta strong {
  display: block;
  font-size: 0.95rem;
  font-weight: 800;
  color: var(--dark);
  margin-bottom: 0.35rem;
}

.lm-sidebar-cta p {
  font-size: 0.82rem;
  color: var(--muted);
  line-height: 1.55;
  margin-bottom: 1rem;
}

/* =========================================================
   Visual blocks — embedded in article content
   ========================================================= */

/* ── Pull quote ── */
.lm-pullquote {
  border-left: 4px solid var(--teal);
  background: var(--grey);
  padding: 1.75rem 2rem;
  margin: 2.5rem 0;
  border-radius: 0 var(--radius-lg) var(--radius-lg) 0;
  position: relative;
}

.lm-pullquote p {
  font-size: 1.15rem;
  font-weight: 600;
  font-style: italic;
  line-height: 1.65;
  color: var(--dark);
  margin: 0;
}

.lm-pullquote cite {
  display: block;
  font-size: 0.82rem;
  font-style: normal;
  color: var(--muted);
  margin-top: 0.75rem;
  font-weight: 500;
}

/* ── Fact card ── */
.lm-factcard {
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 1.5rem 1.75rem;
  margin: 2rem 0;
  box-shadow: 0 2px 8px rgba(0,0,0,0.05);
  border-top: 3px solid var(--teal);
}

.lm-factcard-label {
  display: inline-block;
  font-size: 0.68rem;
  font-weight: 800;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--teal);
  margin-bottom: 0.5rem;
}

.lm-factcard-value {
  font-size: 1.8rem;
  font-weight: 800;
  color: var(--dark);
  line-height: 1.15;
  margin-bottom: 0.4rem;
}

.lm-factcard p {
  font-size: 0.88rem;
  color: var(--muted);
  line-height: 1.6;
  margin: 0;
}

/* Fact card pair (two side by side) */
.lm-factcard-pair {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
  margin: 2rem 0;
}

.lm-factcard-pair .lm-factcard {
  margin: 0;
}

/* ── Stat row ── */
.lm-statrow {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1rem;
  margin: 2.5rem 0;
  padding: 1.75rem;
  background: var(--dark);
  border-radius: var(--radius-lg);
  text-align: center;
}

.lm-statrow-item {
  padding: 0.5rem;
}

.lm-statrow-value {
  font-size: 1.75rem;
  font-weight: 800;
  color: var(--teal);
  line-height: 1.15;
}

.lm-statrow-label {
  font-size: 0.78rem;
  color: rgba(255,255,255,0.6);
  margin-top: 0.25rem;
  line-height: 1.35;
}

/* ── Tip box ── */
.lm-tipbox {
  display: flex;
  gap: 1rem;
  background: var(--teal-light);
  border: 1px solid rgba(13,148,136,0.25);
  border-radius: var(--radius-lg);
  padding: 1.5rem 1.625rem;
  margin: 2rem 0;
}

.lm-tipbox-icon {
  flex-shrink: 0;
  width: 28px;
  height: 28px;
  background: var(--teal);
  color: var(--white);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.85rem;
  font-weight: 800;
  margin-top: 0.1rem;
}

.lm-tipbox-body strong {
  display: block;
  font-size: 0.92rem;
  font-weight: 800;
  color: var(--dark);
  margin-bottom: 0.3rem;
}

.lm-tipbox-body p {
  font-size: 0.88rem;
  color: #2d3748;
  line-height: 1.65;
  margin: 0;
}

/* ── Warning box ── */
.lm-warningbox {
  display: flex;
  gap: 1rem;
  background: #FFF7ED;
  border: 1px solid #FDBA74;
  border-radius: var(--radius-lg);
  padding: 1.5rem 1.625rem;
  margin: 2rem 0;
}

.lm-warningbox-icon {
  flex-shrink: 0;
  width: 28px;
  height: 28px;
  background: #F97316;
  color: var(--white);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.85rem;
  font-weight: 800;
  margin-top: 0.1rem;
}

.lm-warningbox-body strong {
  display: block;
  font-size: 0.92rem;
  font-weight: 800;
  color: var(--dark);
  margin-bottom: 0.3rem;
}

.lm-warningbox-body p {
  font-size: 0.88rem;
  color: #2d3748;
  line-height: 1.65;
  margin: 0;
}

/* ── Inline CTA block ── */
.lm-ctablock {
  background: linear-gradient(135deg, #0F1C2E 0%, #1A3A5C 100%);
  border-radius: var(--radius-lg);
  padding: 2rem 2.25rem;
  margin: 2.5rem 0;
  text-align: center;
}

.lm-ctablock strong {
  display: block;
  font-size: 1.15rem;
  font-weight: 800;
  color: var(--white);
  margin-bottom: 0.5rem;
}

.lm-ctablock p {
  font-size: 0.9rem;
  color: rgba(255,255,255,0.65);
  line-height: 1.6;
  margin-bottom: 1.25rem;
  max-width: 480px;
  margin-left: auto;
  margin-right: auto;
}

.lm-ctablock .btn {
  display: inline-block;
}

/* ── Image with attribution ── */
.lm-image {
  margin: 2rem 0;
  border-radius: var(--radius-lg);
  overflow: hidden;
  background: var(--grey);
}

.lm-image img {
  width: 100%;
  height: auto;
  display: block;
}

.lm-image-credit {
  font-size: 0.72rem;
  color: var(--muted);
  padding: 0.5rem 0.875rem;
  text-align: right;
}

.lm-image-credit a {
  color: var(--muted);
  text-decoration: underline;
}

/* =========================================================
   Responsive
   ========================================================= */
@media (max-width: 900px) {
  .lm-article-grid {
    grid-template-columns: 1fr;
    gap: 0;
  }

  .lm-article-sidebar {
    display: none;
  }

  .lm-article-layout {
    padding: 2rem 20px 3rem;
  }

  .lm-factcard-pair {
    grid-template-columns: 1fr;
  }

  .lm-statrow {
    grid-template-columns: 1fr;
    gap: 0.75rem;
  }

  .lm-statrow-item + .lm-statrow-item {
    border-top: 1px solid rgba(255,255,255,0.1);
    padding-top: 0.75rem;
  }
}

/* ── Article tables ── */
.article-content table {
  width: 100%;
  border-collapse: collapse;
  margin: 2rem 0;
  font-size: 0.9rem;
  line-height: 1.55;
  border-radius: var(--radius-lg);
  overflow: hidden;
  border: 1px solid var(--border);
}

.article-content thead {
  background: var(--dark);
  color: var(--white);
}

.article-content th {
  padding: 0.85rem 1rem;
  font-weight: 700;
  font-size: 0.82rem;
  letter-spacing: 0.03em;
  text-align: left;
  white-space: nowrap;
}

.article-content td {
  padding: 0.75rem 1rem;
  border-top: 1px solid var(--border);
  color: var(--text);
}

.article-content tbody tr:nth-child(even) {
  background: var(--grey);
}

.article-content tbody tr:hover {
  background: var(--teal-light);
}

.article-content caption {
  font-size: 0.82rem;
  color: var(--muted);
  padding: 0.5rem 0;
  text-align: left;
  caption-side: bottom;
}

/* Table responsive wrapper */
.article-content .table-wrap {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  margin: 2rem 0;
}

.article-content .table-wrap table {
  margin: 0;
}

@media (max-width: 600px) {
  .article-content table {
    font-size: 0.82rem;
  }

  .article-content th,
  .article-content td {
    padding: 0.6rem 0.75rem;
  }

  .lm-pullquote {
    padding: 1.25rem 1.375rem;
  }

  .lm-pullquote p {
    font-size: 1.05rem;
  }
}
