/* =========================
   Article styles (shared)
   ========================= */

:root {
  --article-max: 980px;
  --article-side: 20px;
  --article-top: 120px;               /* top padding to clear fixed header */
  --card-bg: rgba(15, 15, 20, 0.80);
  --card-bd: rgba(255, 255, 255, 0.10);
  --card-shadow: 0 15px 30px rgba(0,0,0,0.30);
  --chip-bd: rgba(255, 255, 255, 0.12);
  --ink: #ffffff;
  --muted: rgba(255, 255, 255, 0.7);
  --link: #1FB8FB;
  --link-underline: rgba(31,184,251,.35);
}

/* Shell & container */
.article-shell {
  position: relative;
  z-index: 2;
  max-width: var(--article-max);
  width: min(92vw, var(--article-max));
  margin: 0 auto;
  padding: var(--article-top) var(--article-side) 80px;
  color: var(--ink);
}

.article-container {
  background: var(--card-bg);
  -webkit-backdrop-filter: blur(8px);
  backdrop-filter: blur(8px);
  border: 1px solid var(--card-bd);
  border-radius: 12px;
  box-shadow: var(--card-shadow);
  padding: 32px;
}

/* Header */
.article-header {
  border-bottom: 1px solid var(--card-bd);
  margin-bottom: 24px;
  padding-bottom: 16px;
}

.article-title {
  /* roughly your 2rem, but responsive */
  font-size: clamp(1.7rem, 2.2vw + 1rem, 2.2rem);
  line-height: 1.3;
  margin: 0 0 10px;
}

.article-meta {
  font-size: 0.95rem;
  opacity: .7;
  display: flex;
  gap: 20px;
  flex-wrap: wrap;
}

/* Featured image */
.article-featured-image {
  margin: 22px 0 28px;
  border-radius: 10px;
  overflow: hidden;
}
.article-featured-image img {
  width: 100%;
  height: auto;
  display: block;
}

/* Content */
.article-content {
  line-height: 1.8;
  font-size: 1.05rem;
}

.article-content p { margin: 0 0 1.25rem; }

.article-content h1,
.article-content h2,
.article-content h3,
.article-content h4 {
  margin: 1.4rem 0 .8rem;
  line-height: 1.3;
}

.article-content h1 { font-size: clamp(1.6rem, 1.4rem + 1vw, 2rem); }
.article-content h2 { font-size: clamp(1.4rem, 1.2rem + .8vw, 1.6rem); }
.article-content h3 { font-size: clamp(1.2rem, 1.05rem + .6vw, 1.3rem); }

.article-content a {
  color: var(--link);
  text-decoration: none;
  border-bottom: 1px solid var(--link-underline);
  transition: color .2s ease, border-color .2s ease;
}
.article-content a:hover {
  color: #fff;
  border-bottom-color: var(--link);
}
.article-content a:focus-visible {
  outline: 2px solid var(--link);
  outline-offset: 2px;
  border-bottom-color: transparent;
}

/* Blockquotes */
.article-content blockquote {
  border-left: 3px solid var(--link);
  background: rgba(31,184,251,.10);
  padding: 10px 16px;
  border-radius: 0 6px 6px 0;
  margin: 1rem 0;
}

/* Code & preformatted */
.article-content code {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  background: rgba(0,0,0,.25);
  padding: 2px 5px;
  border-radius: 4px;
  font-size: 0.95em;
}

.article-content pre {
  background: rgba(0,0,0,.35);
  border: 1px solid var(--chip-bd);
  border-radius: 8px;
  padding: 14px;
  overflow: auto;
  -webkit-overflow-scrolling: touch;
  margin: 1rem 0 1.25rem;
}

/* Let highlight.js control token colors; keep our container bg */
.article-content pre code {
  background: none;      /* avoid double background */
  padding: 0;
  display: block;
}

/* Images in content */
.article-content img {
  max-width: 100%;
  height: auto;
  border-radius: 8px;
}

/* Lists */
.article-content ul,
.article-content ol {
  padding-left: 1.2rem;
  margin: 0 0 1.25rem;
}
.article-content li { margin: 0.25rem 0; }

/* Tables */
.article-content table {
  width: 100%;
  border-collapse: collapse;
  margin: 1rem 0 1.25rem;
  font-size: 0.98rem;
}
.article-content th,
.article-content td {
  padding: 10px 12px;
  border-bottom: 1px solid rgba(255,255,255,0.12);
  text-align: left;
}
.article-content thead th {
  background: rgba(255,255,255,0.06);
}

/* Figures & captions */
.article-content figure {
  margin: 1.25rem 0;
  text-align: center;
}
.article-content figcaption {
  font-size: 0.9rem;
  opacity: .75;
  margin-top: .5rem;
}

/* HR */
.article-content hr {
  border: 0;
  border-top: 1px solid rgba(255,255,255,0.12);
  margin: 2rem 0;
}

/* Footer / back links */
.article-footer {
  margin-top: 30px;
  padding-top: 18px;
  border-top: 1px solid var(--card-bd);
  display: flex;
  justify-content: space-between;
  gap: 12px;
}

.back-to {
  display: inline-block;
  padding: 10px 16px;
  border-radius: 8px;
  border: 1px solid rgba(31,184,251,.4);
  color: var(--link);
  background: rgba(31,184,251,.15);
  text-decoration: none;
  transition: transform .15s ease, background-color .2s ease, border-color .2s ease;
}
.back-to:hover {
  background: rgba(31,184,251,.25);
  transform: translateY(-1px);
}
.back-to:focus-visible {
  outline: 2px solid var(--link);
  outline-offset: 2px;
}

/* Reduced motion */
@media (prefers-reduced-motion: reduce) {
  .back-to { transition: none; }
}

/* -------------------------
   Responsive adjustments
   ------------------------- */
@media (max-width: 768px) {
  .article-shell { padding: 100px 16px 60px; }
  .article-container { padding: 22px; }
  .article-title { font-size: clamp(1.4rem, 1.1rem + 2.5vw, 1.6rem); }

  .article-footer {
    flex-direction: column;
    align-items: stretch;
  }
  .back-to {
    width: 100%;
    text-align: center;
  }
}

/* Optional: print-friendly tweaks */
@media print {
  .article-shell { padding: 0; width: 100%; }
  .article-container {
    background: #fff;
    color: #000;
    border: none;
    box-shadow: none;
  }
  .article-content a { color: #000; border-bottom: 1px solid #000; }
}
