/* ============================================================
   ARTICLES — News & Learn pages
   Bloomberg / BBC inspired layout
   ============================================================ */

/* ── Page container ──────────────────────────────────────────── */
.articles-page,
.article-page {
  padding: 24px 0 60px;
}

/* ── Index header ────────────────────────────────────────────── */
.articles-header {
  margin-bottom: 18px;
  padding-bottom: 12px;
  border-bottom: 3px solid var(--color-text);
}
.articles-header h1 {
  font-size: 2rem;
  font-weight: 700;
  margin: 0;
  color: var(--color-text);
  text-transform: uppercase;
  letter-spacing: 0.02em;
}

/* ── Category filter pills ───────────────────────────────────── */
.articles-filters {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 28px;
  padding-bottom: 18px;
  border-bottom: 1px solid var(--color-neutral-200);
}
.articles-pill {
  display: inline-block;
  padding: 7px 18px;
  border-radius: 3px;
  font-size: 0.92rem;
  font-weight: 600;
  color: var(--color-neutral-500);
  background: transparent;
  border: 1px solid var(--color-neutral-200);
  text-decoration: none;
  transition: all 0.15s ease;
}
.articles-pill:hover {
  color: var(--color-text);
  border-color: var(--color-text);
}
.articles-pill--active {
  color: #fff;
  background: #1a1a1a;
  border-color: #1a1a1a;
}
body.dark-mode .articles-pill--active {
  background: var(--color-primary);
  border-color: var(--color-primary);
}
.articles-pill--active:hover {
  color: #fff;
}

/* ═══════════════════════════════════════════════════════════════
   HERO SECTION: featured left + 3 secondary stacked right
   ═══════════════════════════════════════════════════════════════ */
.news-hero-section {
  display: grid;
  grid-template-columns: 1.6fr 1fr;
  gap: 28px;
  margin-bottom: 32px;
  padding-bottom: 28px;
  border-bottom: 1px solid var(--color-neutral-200);
}

/* Main featured article */
.news-hero {
  display: flex;
  flex-direction: column;
  text-decoration: none;
  color: inherit;
}
.news-hero-img {
  width: 100%;
  aspect-ratio: 16 / 9;
  overflow: hidden;
  background: var(--color-neutral-50);
  border-radius: 4px;
  margin-bottom: 16px;
}
.news-hero-img img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.3s ease;
}
.news-hero:hover .news-hero-img img {
  transform: scale(1.03);
}
.news-hero-img-placeholder {
  width: 100%;
  height: 100%;
  background: linear-gradient(135deg, var(--color-neutral-200) 0%, var(--color-neutral-50) 100%);
}
.news-hero-body {
  display: flex;
  flex-direction: column;
}
.news-hero-cat {
  display: inline-block;
  font-size: 0.82rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--color-primary);
  margin-bottom: 8px;
}
.news-hero-title {
  font-size: 2.2rem;
  font-weight: 700;
  line-height: 1.2;
  margin: 0 0 10px;
  color: var(--color-text);
}
.news-hero:hover .news-hero-title {
  color: var(--color-primary);
}
.news-hero-excerpt {
  font-size: 1.15rem;
  color: var(--color-neutral-500);
  line-height: 1.55;
  margin: 0;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.news-hero-meta {
  font-size: 0.85rem;
  color: var(--color-neutral-400);
  display: flex;
  gap: 6px;
  margin-top: 12px;
}

/* Secondary articles stacked on right */
.news-hero-secondary {
  display: flex;
  flex-direction: column;
  gap: 0;
}
.news-hero-side {
  display: grid;
  grid-template-columns: 120px 1fr;
  gap: 14px;
  padding: 14px 0;
  border-bottom: 1px solid var(--color-neutral-200);
  text-decoration: none;
  color: inherit;
}
.news-hero-side:first-child {
  padding-top: 0;
}
.news-hero-side:last-child {
  border-bottom: none;
}
.news-hero-side-img {
  width: 120px;
  aspect-ratio: 16 / 10;
  overflow: hidden;
  border-radius: 4px;
  background: var(--color-neutral-50);
}
.news-hero-side-img img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.3s ease;
}
.news-hero-side:hover .news-hero-side-img img {
  transform: scale(1.05);
}
.news-hero-side-placeholder {
  width: 100%;
  height: 100%;
  background: linear-gradient(135deg, var(--color-neutral-200) 0%, var(--color-neutral-50) 100%);
}
.news-hero-side-body {
  display: flex;
  flex-direction: column;
  justify-content: center;
}
.news-hero-side-cat {
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--color-primary);
  margin-bottom: 4px;
}
.news-hero-side-title {
  font-size: 1.1rem;
  font-weight: 600;
  line-height: 1.3;
  margin: 0;
  color: var(--color-text);
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.news-hero-side:hover .news-hero-side-title {
  color: var(--color-primary);
}
.news-hero-side-meta {
  font-size: 0.75rem;
  color: var(--color-neutral-400);
  margin-top: 5px;
}

/* ═══════════════════════════════════════════════════════════════
   TWO-COLUMN GRID + SIDEBAR
   ═══════════════════════════════════════════════════════════════ */
.news-layout {
  display: grid;
  grid-template-columns: 1fr 280px;
  gap: 32px;
}

/* Article grid — two columns */
.news-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 24px;
}
.news-grid-card {
  display: flex;
  flex-direction: column;
  text-decoration: none;
  color: inherit;
  padding-bottom: 20px;
  border-bottom: 1px solid var(--color-neutral-200);
}
.news-grid-card:hover .news-grid-card-title {
  color: var(--color-primary);
}
.news-grid-card-img {
  width: 100%;
  aspect-ratio: 16 / 9;
  overflow: hidden;
  border-radius: 4px;
  background: var(--color-neutral-50);
  margin-bottom: 12px;
}
.news-grid-card-img img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.3s ease;
}
.news-grid-card:hover .news-grid-card-img img {
  transform: scale(1.04);
}
.news-grid-card-placeholder {
  width: 100%;
  height: 100%;
  background: linear-gradient(135deg, var(--color-neutral-200) 0%, var(--color-neutral-50) 100%);
}
.news-grid-card-body {
  display: flex;
  flex-direction: column;
}
.news-grid-card-cat {
  font-size: 0.78rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--color-primary);
  margin-bottom: 6px;
}
.news-grid-card-title {
  font-size: 1.25rem;
  font-weight: 600;
  line-height: 1.3;
  margin: 0 0 8px;
  color: var(--color-text);
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
  transition: color 0.15s;
}
.news-grid-card-excerpt {
  font-size: 1.05rem;
  color: var(--color-neutral-500);
  line-height: 1.5;
  margin: 0;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.news-grid-card-meta {
  font-size: 0.8rem;
  color: var(--color-neutral-400);
  display: flex;
  gap: 5px;
  margin-top: 8px;
}

/* ── Sidebar (shared between index & article) ────────────────── */
.news-sidebar,
.article-sidebar {
  border-left: 1px solid var(--color-neutral-200);
  padding-left: 24px;
}
.news-sidebar-section {
  margin-bottom: 28px;
}
.news-sidebar-title {
  font-size: 0.88rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--color-text);
  margin: 0 0 14px;
  padding-bottom: 10px;
  border-bottom: 2px solid var(--color-text);
}
.news-sidebar-list {
  list-style: none;
  padding: 0;
  margin: 0;
}
.news-sidebar-list li {
  margin-bottom: 10px;
}
.news-sidebar-list a {
  font-size: 0.95rem;
  color: var(--color-neutral-500);
  text-decoration: none;
  transition: color 0.15s;
}
.news-sidebar-list a:hover,
.news-sidebar-list a.active {
  color: var(--color-primary);
  font-weight: 600;
}

/* Trending / Latest numbered list */
.news-sidebar-card {
  display: flex;
  gap: 12px;
  align-items: flex-start;
  padding: 10px 0;
  border-bottom: 1px solid var(--color-neutral-100);
  text-decoration: none;
  color: inherit;
}
.news-sidebar-card:last-child {
  border-bottom: none;
}
.news-sidebar-card:hover .news-sidebar-card-title {
  color: var(--color-primary);
}
.news-sidebar-card-num {
  font-size: 1.6rem;
  font-weight: 700;
  color: var(--color-neutral-200);
  line-height: 1;
  min-width: 24px;
  flex-shrink: 0;
}
.news-sidebar-card-title {
  font-size: 0.9rem;
  font-weight: 600;
  line-height: 1.35;
  color: var(--color-text);
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
  transition: color 0.15s;
}

/* Related articles in sidebar (article page) */
.news-sidebar-related {
  display: grid;
  grid-template-columns: 70px 1fr;
  gap: 10px;
  padding: 10px 0;
  border-bottom: 1px solid var(--color-neutral-100);
  text-decoration: none;
  color: inherit;
}
.news-sidebar-related:last-child {
  border-bottom: none;
}
.news-sidebar-related-img {
  width: 70px;
  aspect-ratio: 1;
  overflow: hidden;
  border-radius: 4px;
  background: var(--color-neutral-50);
}
.news-sidebar-related-img img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.news-sidebar-related-title {
  font-size: 0.88rem;
  font-weight: 600;
  line-height: 1.35;
  color: var(--color-text);
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
  align-self: center;
  transition: color 0.15s;
}
.news-sidebar-related:hover .news-sidebar-related-title {
  color: var(--color-primary);
}

/* ── Pagination ──────────────────────────────────────────────── */
.articles-pagination {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  margin-top: 36px;
  margin-bottom: 40px;
}
.articles-page-btn,
.articles-page-num {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 36px;
  height: 36px;
  padding: 0 12px;
  border-radius: 4px;
  font-size: 0.92rem;
  text-decoration: none;
  color: var(--color-neutral-500);
  border: 1px solid var(--color-neutral-200);
  background: var(--color-background);
  transition: all 0.15s ease;
}
.articles-page-btn:hover,
.articles-page-num:hover {
  color: var(--color-text);
  border-color: var(--color-text);
}
.articles-page-num--active {
  color: #fff;
  background: #1a1a1a;
  border-color: #1a1a1a;
}
body.dark-mode .articles-page-num--active {
  background: var(--color-primary);
  border-color: var(--color-primary);
}
.articles-page-ellipsis {
  padding: 0 4px;
  color: var(--color-neutral-400);
}
.articles-empty {
  text-align: center;
  padding: 60px 20px;
  color: var(--color-neutral-400);
  font-size: 1.1rem;
}

/* ═══════════════════════════════════════════════════════════════
   SINGLE ARTICLE PAGE
   ═══════════════════════════════════════════════════════════════ */
.article-breadcrumb {
  font-size: 0.9rem;
  color: var(--color-neutral-400);
  margin-bottom: 24px;
}
.article-breadcrumb a {
  color: var(--color-neutral-500);
  text-decoration: none;
}
.article-breadcrumb a:hover {
  color: var(--color-primary);
}
.article-breadcrumb span {
  margin: 0 6px;
}

/* Two-column layout: article + sidebar */
.article-layout {
  display: grid;
  grid-template-columns: 1fr 280px;
  gap: 36px;
}

.article-single {
  min-width: 0;
}
.article-single-header {
  margin-bottom: 28px;
}
.article-single-cats {
  display: flex;
  gap: 8px;
  margin-bottom: 12px;
}
.article-single-cat {
  font-size: 0.82rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--color-primary);
  text-decoration: none;
  padding: 4px 12px;
  border-radius: 3px;
  background: rgba(99, 102, 241, 0.08);
}
.article-single-cat:hover {
  background: rgba(99, 102, 241, 0.15);
}
.article-single-title {
  font-size: 2.6rem;
  font-weight: 700;
  line-height: 1.18;
  margin: 0 0 16px;
  color: var(--color-text);
}
.article-single-meta {
  font-size: 1.05rem;
  color: var(--color-neutral-400);
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.article-single-hero {
  border-radius: 6px;
  overflow: hidden;
  margin-bottom: 32px;
}
.article-single-hero img {
  width: 100%;
  display: block;
}

/* ── Article body — LARGE text ───────────────────────────────── */
.article-single-content {
  font-size: 1.35rem;
  line-height: 1.85;
  color: var(--color-text);
}
.article-single-content p {
  margin: 0 0 1.4em;
}
.article-single-content h2 {
  font-size: 1.9rem;
  font-weight: 700;
  margin: 1.8em 0 0.6em;
}
.article-single-content h3 {
  font-size: 1.55rem;
  font-weight: 600;
  margin: 1.5em 0 0.5em;
}
.article-single-content img {
  max-width: 100%;
  height: auto;
  border-radius: 6px;
  margin: 1em 0;
}
.article-single-content blockquote {
  border-left: 3px solid var(--color-primary);
  margin: 1.5em 0;
  padding: 0.5em 0 0.5em 1.2em;
  color: var(--color-neutral-500);
  font-style: italic;
  font-size: 1.15rem;
}
.article-single-content a {
  color: var(--color-primary);
  text-decoration: underline;
}
.article-single-content ul,
.article-single-content ol {
  margin: 0 0 1.3em;
  padding-left: 1.5em;
}
.article-single-content li {
  margin-bottom: 0.5em;
}
.article-single-content figure {
  margin: 1.5em 0;
}
.article-single-content figcaption {
  font-size: 0.9rem;
  color: var(--color-neutral-400);
  text-align: center;
  margin-top: 8px;
}

/* ── Tables inside article body ───────────────────────────────
   Without these, tables inherit the body's 1.35rem font into narrow
   cells and read as cramped + oversized. Scope everything to
   .article-single-content so we don't touch admin / site tables. */
.article-single-content {
  /* Let the browser scroll a wide table horizontally instead of
     breaking the page layout. */
  overflow-x: auto;
}
.article-single-content table {
  display: table;
  width: 100%;
  max-width: 100%;
  margin: 1.6em 0;
  border-collapse: collapse;
  font-size: 0.95rem;          /* ~15px — much saner than 1.35rem */
  line-height: 1.55;
  background: var(--color-background);
  border: 1px solid var(--color-neutral-200);
  border-radius: 8px;
  overflow: hidden;            /* clips the rounded corners onto cells */
}
.article-single-content thead {
  background: var(--color-background2, #f9fafb);
}
.article-single-content th,
.article-single-content td {
  padding: 10px 14px;
  text-align: left;
  vertical-align: top;
  border-bottom: 1px solid var(--color-neutral-200);
  word-break: break-word;
}
.article-single-content th {
  font-weight: 700;
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--color-neutral-600, #4b5563);
}
.article-single-content tbody tr:last-child td {
  border-bottom: none;
}
.article-single-content tbody tr:nth-child(even) {
  background: rgba(99, 102, 241, 0.025);
}
.article-single-content td p,
.article-single-content th p {
  margin: 0;                   /* tables shouldn't inherit the 1.4em paragraph gap */
  font-size: inherit;
  line-height: inherit;
}
/* Tables often live in a wrapping div/figure; make that scroll
   horizontally on narrow screens without shrinking the cells. */
.article-single-content .table-wrap,
.article-single-content figure.table,
.article-single-content .wp-block-table {
  overflow-x: auto;
  margin: 1.6em 0;
}
.article-single-content .table-wrap table,
.article-single-content figure.table table,
.article-single-content .wp-block-table table {
  margin: 0;
}

@media (max-width: 640px) {
  .article-single-content table {
    font-size: 0.86rem;
  }
  .article-single-content th,
  .article-single-content td {
    padding: 8px 10px;
  }
}

/* Dark mode */
html.dark-mode .article-single-content table {
  background: rgba(255, 255, 255, 0.02);
  border-color: rgba(255, 255, 255, 0.08);
}
html.dark-mode .article-single-content thead {
  background: rgba(255, 255, 255, 0.04);
}
html.dark-mode .article-single-content th,
html.dark-mode .article-single-content td {
  border-bottom-color: rgba(255, 255, 255, 0.06);
}
html.dark-mode .article-single-content tbody tr:nth-child(even) {
  background: rgba(99, 102, 241, 0.07);
}

/* ── Tags ────────────────────────────────────────────────────── */
.article-single-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 32px;
  padding-top: 24px;
  border-top: 1px solid var(--color-neutral-200);
}
.article-tag {
  font-size: 0.82rem;
  padding: 5px 14px;
  border-radius: 3px;
  background: var(--color-neutral-50);
  color: var(--color-neutral-500);
  border: 1px solid var(--color-neutral-200);
}

/* ── Back link ───────────────────────────────────────────────── */
.article-back {
  margin-top: 36px;
  padding-top: 16px;
}
.article-back a {
  color: var(--color-primary);
  text-decoration: none;
  font-size: 1rem;
  font-weight: 500;
}
.article-back a:hover {
  text-decoration: underline;
}

/* ═══════════════════════════════════════════════════════════════
   DARK MODE
   ═══════════════════════════════════════════════════════════════ */
body.dark-mode .articles-header {
  border-bottom-color: #ccc;
}
body.dark-mode .articles-pill {
  background: transparent;
  border-color: #444;
  color: #aaa;
}
body.dark-mode .articles-pill:hover {
  color: #fff;
  border-color: #fff;
}
body.dark-mode .news-hero-section {
  border-bottom-color: #333;
}
body.dark-mode .news-hero-side {
  border-bottom-color: #333;
}
body.dark-mode .news-grid-card {
  border-bottom-color: #333;
}
body.dark-mode .news-grid-card-placeholder,
body.dark-mode .news-hero-img-placeholder,
body.dark-mode .news-hero-side-placeholder {
  background: linear-gradient(135deg, #333 0%, #1a1a1a 100%);
}
body.dark-mode .articles-page-btn,
body.dark-mode .articles-page-num {
  background: transparent;
  border-color: #444;
  color: #aaa;
}
body.dark-mode .articles-page-btn:hover,
body.dark-mode .articles-page-num:hover {
  color: #fff;
  border-color: #fff;
}
body.dark-mode .articles-filters {
  border-bottom-color: #333;
}
body.dark-mode .news-sidebar,
body.dark-mode .article-sidebar {
  border-left-color: #333;
}
body.dark-mode .news-sidebar-title {
  border-bottom-color: #ccc;
}
body.dark-mode .news-sidebar-card {
  border-bottom-color: #2a2a2a;
}
body.dark-mode .news-sidebar-card-num {
  color: #444;
}
body.dark-mode .news-sidebar-related {
  border-bottom-color: #2a2a2a;
}
body.dark-mode .article-single-tags {
  border-top-color: #333;
}
body.dark-mode .article-tag {
  background: #2a2a2a;
  border-color: #444;
  color: #aaa;
}
body.dark-mode .article-single-cat {
  background: rgba(167, 139, 250, 0.12);
}
body.dark-mode .article-single-content blockquote {
  color: #999;
}

/* ═══════════════════════════════════════════════════════════════
   RESPONSIVE
   ═══════════════════════════════════════════════════════════════ */
@media (max-width: 1024px) {
  .news-layout {
    grid-template-columns: 1fr;
    gap: 28px;
  }
  .article-layout {
    grid-template-columns: 1fr;
    gap: 28px;
  }
  .news-sidebar,
  .article-sidebar {
    border-left: none;
    padding-left: 0;
    border-top: 1px solid var(--color-neutral-200);
    padding-top: 24px;
  }
  body.dark-mode .news-sidebar,
  body.dark-mode .article-sidebar {
    border-top-color: #333;
  }
}

@media (max-width: 768px) {
  .news-hero-section {
    grid-template-columns: 1fr;
    gap: 20px;
  }
  .news-hero-title {
    font-size: 1.5rem;
  }
  .news-hero-excerpt {
    font-size: 1rem;
  }
  .news-grid {
    grid-template-columns: 1fr;
    gap: 16px;
  }
  .articles-header h1 {
    font-size: 1.5rem;
  }
  .article-single-title {
    font-size: 1.8rem;
  }
  .article-single-content {
    font-size: 1.1rem;
  }
  /* Shrink bottom padding so the footer doesn't float in dead space on mobile
     (matches the responsive footer margin-top). */
  .articles-page,
  .article-page {
    padding-bottom: 20px;
  }
  /* Pagination has 36px top + 40px bottom on desktop; trim both on mobile
     so the last button isn't floating in a sea of whitespace. */
  .articles-pagination {
    margin-top: 20px;
    margin-bottom: 16px;
  }
}

@media (max-width: 480px) {
  .news-hero-side {
    grid-template-columns: 90px 1fr;
    gap: 10px;
  }
  .news-hero-side-img {
    width: 90px;
  }
  .news-hero-side-title {
    font-size: 0.9rem;
  }
}


/* ============================================================
   COMMENTS
   ============================================================ */

.article-comments {
  margin-top: 48px;
  padding-top: 32px;
  border-top: 1px solid var(--color-neutral-200);
}

.article-comments-title {
  font-size: 1.3rem;
  font-weight: 700;
  color: var(--color-text);
  margin: 0 0 24px;
  display: flex;
  align-items: center;
  gap: 10px;
}

.article-comments-count {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 24px;
  height: 24px;
  padding: 0 8px;
  background: var(--color-primary);
  color: #fff;
  border-radius: var(--radius-full);
  font-size: 0.72rem;
  font-weight: 700;
}

/* ── Comment form ─────────────────────────────────────────── */

.comment-form-wrapper {
  display: flex;
  gap: 14px;
  margin-bottom: 32px;
}

.comment-form-avatar {
  flex-shrink: 0;
  padding-top: 2px;
}

.comment-avatar {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  object-fit: cover;
}

.comment-form {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.comment-form textarea {
  width: 100%;
  padding: 12px 14px;
  border: 1px solid var(--color-neutral-300);
  border-radius: var(--radius-md);
  font-family: inherit;
  font-size: 0.88rem;
  font-weight: 500;
  color: var(--color-text);
  background: var(--color-background);
  resize: vertical;
  min-height: 80px;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
  box-sizing: border-box;
}

.comment-form textarea:focus {
  outline: none;
  border-color: var(--color-primary);
  box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.15);
}

.comment-form-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.comment-char-count {
  font-size: 0.72rem;
  color: var(--color-neutral-400);
}

.comment-submit-btn {
  padding: 8px 18px;
  border: none;
  border-radius: var(--radius-md);
  background: var(--color-primary);
  color: #fff;
  font-size: 0.8rem;
  font-weight: 700;
  font-family: inherit;
  cursor: pointer;
  transition: all 0.15s ease;
}

.comment-submit-btn:hover {
  background: var(--color-primary-hover);
  box-shadow: 0 4px 12px rgba(99, 102, 241, 0.3);
}

.comment-submit-btn:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

.comment-login-prompt {
  padding: 20px;
  text-align: center;
  background: var(--color-neutral-50);
  border-radius: var(--radius-md);
  margin-bottom: 24px;
  font-size: 0.88rem;
  color: var(--color-neutral-600);
}

.comment-login-link {
  color: var(--color-primary) !important;
  font-weight: 700;
  text-decoration: none;
  font-size: inherit !important;
}

.comment-login-link:hover {
  text-decoration: underline;
}

/* ── Comment list ─────────────────────────────────────────── */

.comment-list {
  display: flex;
  flex-direction: column;
  gap: 0;
}

.comment-item {
  display: flex;
  gap: 14px;
  padding: 18px 0;
  border-bottom: 1px solid var(--color-neutral-200);
}

.comment-item:last-child {
  border-bottom: none;
}

.comment-item-avatar {
  flex-shrink: 0;
  padding-top: 2px;
}

.comment-item-body {
  flex: 1;
  min-width: 0;
}

.comment-item-header {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 6px;
  flex-wrap: wrap;
}

.comment-author-name {
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--color-text);
}

.comment-time {
  font-size: 0.72rem;
  color: var(--color-neutral-400);
}

.comment-delete-btn {
  background: none;
  border: none;
  padding: 2px 6px;
  color: var(--color-neutral-400);
  cursor: pointer;
  font-size: 0.72rem;
  transition: color 0.15s ease;
  margin-left: auto;
}

.comment-delete-btn:hover {
  color: var(--color-danger);
}

.comment-text {
  font-size: 0.88rem;
  line-height: 1.6;
  color: var(--color-text);
  margin: 0;
  white-space: pre-wrap;
  word-wrap: break-word;
}

.comment-empty {
  padding: 32px 20px;
  text-align: center;
  color: var(--color-neutral-400);
  font-size: 0.88rem;
}

/* ── Dark mode comments ───────────────────────────────────── */

html.dark-mode .article-comments {
  border-top-color: rgba(255, 255, 255, 0.1);
}

html.dark-mode .comment-form textarea {
  background: #2a2a2a;
  border-color: rgba(255, 255, 255, 0.15);
  color: #e0e0e0;
}

html.dark-mode .comment-form textarea:focus {
  border-color: var(--color-primary);
  box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.25);
}

html.dark-mode .comment-item {
  border-bottom-color: rgba(255, 255, 255, 0.08);
}

html.dark-mode .comment-login-prompt {
  background: rgba(255, 255, 255, 0.05);
  color: rgba(255, 255, 255, 0.6);
}

/* ── Article paywall ────────────────────────────────────────── */

.article-content--locked {
  position: relative;
  max-height: 900px;
  overflow: hidden;
}

.article-content--locked::after {
  content: "";
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 260px;
  background: linear-gradient(
    to bottom,
    rgba(255, 255, 255, 0) 0%,
    rgba(255, 255, 255, 0.7) 40%,
    rgba(255, 255, 255, 0.95) 70%,
    #fff 100%
  );
  pointer-events: none;
  z-index: 1;
}

html.dark-mode .article-content--locked::after {
  background: linear-gradient(
    to bottom,
    rgba(32, 32, 32, 0) 0%,
    rgba(32, 32, 32, 0.7) 40%,
    rgba(32, 32, 32, 0.95) 70%,
    #202020 100%
  );
}

.article-paywall {
  position: relative;
  z-index: 2;
  margin-top: -40px;
  padding: 0 0 40px;
}

.article-paywall-inner {
  text-align: center;
  max-width: 480px;
  margin: 0 auto;
  padding: 36px 32px;
  border-radius: 16px;
  background: var(--color-bg);
  border: 1px solid var(--color-neutral-200);
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.08);
}

html.dark-mode .article-paywall-inner {
  background: #2a2a2a;
  border-color: rgba(255, 255, 255, 0.1);
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
}

.article-paywall-badge {
  display: inline-block;
  padding: 4px 14px;
  border-radius: 999px;
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  background: linear-gradient(135deg, #6366f1, #7c3aed);
  color: white;
  margin-bottom: 16px;
}

.article-paywall-badge--plus {
  background: linear-gradient(135deg, #f472b6, #a78bfa);
}

.article-paywall-title {
  font-size: 1.45rem;
  font-weight: 800;
  margin: 0 0 10px;
  color: var(--color-text);
}

.article-paywall-copy {
  font-size: 1rem;
  color: var(--color-neutral-500);
  line-height: 1.6;
  margin: 0 0 22px;
}

.article-paywall-btn {
  display: inline-block;
  padding: 14px 32px;
  border-radius: 12px;
  background: linear-gradient(135deg, #6366f1 0%, #7c3aed 100%);
  color: white !important;
  font-weight: 700;
  font-size: 1rem;
  text-decoration: none;
  transition: all 0.18s ease;
  box-shadow: 0 8px 24px rgba(99, 102, 241, 0.3);
}

.article-paywall-btn:hover {
  transform: translateY(-1px);
  box-shadow: 0 12px 32px rgba(99, 102, 241, 0.4);
}

.article-paywall-login {
  margin: 14px 0 0;
  font-size: 0.92rem;
  color: var(--color-neutral-400);
}

.article-paywall-login a {
  color: var(--color-primary);
  font-weight: 600;
  text-decoration: none;
}

.article-paywall-login a:hover {
  text-decoration: underline;
}
