/* article_detail.css
   Uses your base tokens:
   --card-bg, --radius-xl, --border-subtle, --shadow-soft,
   --text-main, --text-muted, --accent, --accent-soft
*/

/* =========================
   MAIN / HEADER
   ========================= */

main {
  flex: 1;
}

.articles-header {
  margin-bottom: 1rem;
}

.articles-header h1 {
  margin: 0 0 0.35rem;
  font-size: 1.55rem;
  line-height: 1.2;
  color: var(--text-main, #111827);
}

.articles-header p {
  margin: 0;
  color: var(--text-muted, #6b7280);
  font-size: 0.92rem;
}

/* =========================
   LAYOUT (HERO + BODY)
   ========================= */

.article-layout {
  margin-top: 1.5rem;
}

.article-flex {
  display: flex;
  gap: 1.5rem;
  align-items: flex-start;
  flex-wrap: wrap; /* allows stacking */
}

.article-image {
  flex: 0 0 320px;
  max-width: 100%;
}

.article-image img {
  display: block;
  width: 100%;
  max-width: 520px;          /* hero cap */
  height: auto;
  margin: 0 auto;
  border-radius: 1rem;
  box-shadow: 0 4px 14px rgba(15, 23, 42, 0.18);
}

.article-text {
  flex: 1 1 260px;
  min-width: 260px;
}

.article-card {
  background: var(--card-bg, #ffffff);
  border-radius: var(--radius-xl, 18px);
  padding: 1rem 1rem 1.1rem;
  border: 1px solid var(--border-subtle, rgba(148, 163, 184, 0.35));
  box-shadow: var(--shadow-soft, 0 4px 18px rgba(15, 23, 42, 0.06));
}

/* X / Twitter embed: force center + cap width (Twitter injects inline styles) */
.article-embed {
  margin: 1.25rem 0;
  text-align: center;
}

.article-embed .twitter-tweet,
.article-embed twitterwidget {
  margin-left: auto !important;
  margin-right: auto !important;
}

/* Constrain width without breaking mobile */
.article-embed .twitter-tweet,
.article-embed twitterwidget {
  max-width: 520px !important;
  width: 100% !important;
}
/* =========================
   ARTICLE BODY TYPOGRAPHY
   ========================= */

.article-body {
  font-size: 0.95rem;
  line-height: 1.65;
  color: var(--text-main, #111827);
  overflow-wrap: anywhere; /* prevents layout blowout from long URLs */
}

.article-body p {
  margin: 0 0 0.9rem;
}

.article-body h2,
.article-body h3,
.article-body h4 {
  margin: 1.2rem 0 0.6rem;
  line-height: 1.25;
  color: var(--text-main, #111827);
}

.article-body h2 { font-size: 1.2rem; }
.article-body h3 { font-size: 1.05rem; }
.article-body h4 { font-size: 0.98rem; }

.article-body a {
  color: #2563eb;
  text-decoration: none;
}
.article-body a:hover {
  text-decoration: underline;
}

.article-body ul,
.article-body ol {
  margin: 0 0 0.95rem 1.25rem;
  padding: 0;
}

.article-body li {
  margin: 0.25rem 0;
}

.article-body blockquote {
  margin: 1rem 0;
  padding: 0.75rem 0.9rem;
  border-left: 4px solid rgba(37, 99, 235, 0.45);
  background: rgba(129, 140, 248, 0.08);
  border-radius: 0.75rem;
  color: rgba(17, 24, 39, 0.9);
}

.article-body hr {
  border: 0;
  border-top: 1px solid rgba(148, 163, 184, 0.4);
  margin: 1rem 0;
}

/* Inline code, pre blocks (if they appear) */
.article-body code {
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;
  font-size: 0.92em;
  background: rgba(148, 163, 184, 0.18);
  padding: 0.1rem 0.3rem;
  border-radius: 0.4rem;
}

.article-body pre {
  overflow: auto;
  padding: 0.9rem 1rem;
  border-radius: 0.9rem;
  background: rgba(15, 23, 42, 0.06);
  border: 1px solid rgba(148, 163, 184, 0.28);
}

/* =========================
   INLINE/BODY IMAGES
   ========================= */

/* Responsive + visually constrained; defeats pasted inline sizing */
.article-body img {
  display: block;
  width: 100% !important;
  max-width: 650px !important;   /* inline image cap */
  height: auto !important;
  margin: 1rem auto;
  border-radius: 0.75rem;
}

/* Optional: captions if you ever wrap with <figure><figcaption> */
.article-body figure {
  margin: 1rem 0;
}
.article-body figcaption {
  margin-top: 0.4rem;
  font-size: 0.85rem;
  color: var(--text-muted, #6b7280);
  text-align: center;
}

/* =========================
   MORE ARTICLES
   ========================= */

.article-more {
  margin-top: 2.5rem;
  padding-top: 1.75rem;
  border-top: 1px solid rgba(148, 163, 184, 0.4);
}

.article-more h2 {
  font-size: 1.3rem;
  margin: 0 0 1rem;
  color: var(--text-main, #111827);
}

.article-more-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(270px, 1fr));
  gap: 1rem;
}

.article-more-card {
  display: flex;
  gap: 0.8rem;
  align-items: flex-start;
  padding: 0.9rem 1rem;
  border-radius: 16px;
  background: #ffffff;
  border: 1px solid rgba(148, 163, 184, 0.3);
  box-shadow: 0 4px 14px rgba(15, 23, 42, 0.04);
  text-decoration: none;
  color: inherit;
  transition:
    transform 0.12s ease,
    box-shadow 0.12s ease,
    border-color 0.12s ease,
    background 0.12s ease;
}

.article-more-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(15, 23, 42, 0.09);
  border-color: rgba(37, 99, 235, 0.65);
  background:
    radial-gradient(circle at top left, rgba(129, 140, 248, 0.12), transparent 55%),
    #ffffff;
}

.article-thumb-wrapper {
  flex: 0 0 70px;
  height: 70px;
  border-radius: 14px;
  overflow: hidden;
  background: var(--accent-soft, rgba(129, 140, 248, 0.18));
  display: flex;
  align-items: center;
  justify-content: center;
}

.article-thumb {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.article-more-content {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  min-width: 0;
}

.article-more-meta-row {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  font-size: 0.78rem;
}

.article-more-date {
  color: var(--text-muted, #6b7280);
}

.article-topic-pill {
  padding: 0.12rem 0.5rem;
  border-radius: 999px;
  font-size: 0.72rem;
  font-weight: 500;
  background: var(--accent-soft, rgba(129, 140, 248, 0.18));
  color: var(--accent, #2563eb);
}

.article-more-card h3 {
  font-size: 0.98rem;
  margin: 0.05rem 0 0.1rem;
  color: var(--text-main, #111827);
}

.article-more-snippet {
  font-size: 0.86rem;
  color: var(--text-muted, #6b7280);
  margin: 0.1rem 0 0.4rem;
}

.article-more-link {
  font-size: 0.82rem;
  font-weight: 500;
  color: #2563eb;
  margin-top: auto;
}

.article-more-empty {
  font-size: 0.9rem;
  color: var(--text-muted, #6b7280);
}

/* Slightly bigger thumbnails on wider screens */
@media (min-width: 768px) {
  .article-thumb-wrapper {
    flex-basis: 82px;
    height: 82px;
  }

  .article-more-card {
    padding: 0.95rem 1.1rem;
  }
}

/* Mobile: stack hero and body */
@media (max-width: 768px) {
  .article-flex {
    flex-direction: column;
  }

  .article-image {
    flex: 1 1 auto;
  }

  .article-image img {
    max-width: 100%;
  }


    .article-embed blockquote.twitter-tweet {
    max-width: 480px;
  }
}  

/* HARD LOCK: prevent selecting anything on article detail page */
.article-page,
.article-page * {
  -webkit-user-select: none !important;
  user-select: none !important;
  -webkit-touch-callout: none !important; /* iOS */
}

/* Prevent the blue highlight drag behavior in some browsers */
.article-page *::selection {
  background: transparent !important;
}

/* End of article_detail.css */