
/* =========================================================
   PrimeProblem — Article Page Styles
   Save as: /assets/css/article.css
   Responsive • Accessible • Premium Article Layout
========================================================= */

:root {
  --article-bg: #f6f8fc;
  --article-surface: #ffffff;
  --article-text: #182238;
  --article-muted: #69758b;
  --article-border: #e6eaf2;
  --article-primary: #5b50df;
  --article-primary-dark: #4338b8;
  --article-soft: #efedff;
  --article-radius: 22px;
  --article-shadow: 0 14px 42px rgba(23, 32, 54, .055);
}

* { box-sizing: border-box; }

html {
  scroll-behavior: smooth;
  scroll-padding-top: 24px;
}

body.article-page {
  margin: 0;
  background: var(--article-bg);
  color: var(--article-text);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system,
    BlinkMacSystemFont, "Segoe UI", sans-serif;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

.article-page a { color: inherit; text-decoration: none; }
.article-page button { font: inherit; }
.article-page img { max-width: 100%; height: auto; }

.article-page .container {
  width: min(1180px, calc(100% - 40px));
  margin-inline: auto;
}

/* =========================================================
   HEADER
========================================================= */

.article-page .site-header {
  position: relative;
  z-index: 20;
  background: rgba(255,255,255,.94);
  border-bottom: 1px solid rgba(225,230,240,.9);
  backdrop-filter: blur(14px);
}

.article-page .navbar {
  min-height: 82px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
}

.article-page .brand {
  display: inline-flex;
  align-items: center;
  gap: 11px;
  flex-shrink: 0;
  color: #172033;
  font-size: 1.08rem;
  font-weight: 850;
  letter-spacing: -.045em;
  line-height: 1.1;
}

.article-page .brand-mark {
  display: grid;
  place-items: center;
  width: 42px;
  height: 42px;
  border-radius: 13px;
  color: #fff;
  background: linear-gradient(145deg, #665cf1, #4237b8);
  box-shadow: 0 7px 17px rgba(91,80,223,.22);
  font-size: 1.35rem;
}

.article-page .brand-accent { color: var(--article-primary); }

.article-page .brand small {
  display: block;
  margin-top: 5px;
  color: #8a93a5;
  font-size: .57rem;
  font-weight: 800;
  letter-spacing: .17em;
}

.article-page .nav-links {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 29px;
}

.article-page .nav-links a {
  color: #68738a;
  font-size: .88rem;
  font-weight: 650;
  transition: color .18s ease;
}

.article-page .nav-links a:hover,
.article-page .nav-links a:focus-visible {
  color: var(--article-primary);
}

.article-page .button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  min-height: 43px;
  padding: 11px 16px;
  border: 1px solid transparent;
  border-radius: 11px;
  font-size: .84rem;
  font-weight: 800;
  line-height: 1.2;
  transition: transform .18s ease, background .18s ease,
    box-shadow .18s ease;
}

.article-page .button:hover { transform: translateY(-1px); }

.article-page .button-dark {
  color: #fff;
  background: #182238;
  box-shadow: 0 6px 15px rgba(24,34,56,.13);
}

.article-page .button-dark:hover { background: #2b3853; }
.article-page .nav-button { white-space: nowrap; }

/* =========================================================
   ARTICLE MAIN + BREADCRUMBS
========================================================= */

.article-page .article-main {
  min-height: 65vh;
  padding: 28px 0 76px;
}

.article-page .breadcrumbs {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px;
  margin: 0 0 20px;
  color: #939bad;
  font-size: .8rem;
}

.article-page .breadcrumbs a { color: #69758b; }

.article-page .breadcrumbs a:hover {
  color: var(--article-primary);
}

.article-page .back-link {
  display: inline-flex;
  margin: 0 0 22px;
  color: #657188;
  font-size: .88rem;
  font-weight: 750;
  transition: color .18s ease;
}

.article-page .back-link:hover {
  color: var(--article-primary);
}

.article-page .article-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 270px;
  align-items: start;
  gap: 25px;
}

.article-page .article-detail {
  min-width: 0;
  overflow: hidden;
  background: var(--article-surface);
  border: 1px solid var(--article-border);
  border-radius: var(--article-radius);
  box-shadow: var(--article-shadow);
}

.article-page .article-detail-head {
  padding: clamp(26px, 4.5vw, 52px)
    clamp(23px, 4.5vw, 55px) 27px;
}

.article-page .article-kicker-row {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 12px;
  margin-bottom: 19px;
}

.article-page .category-pill {
  display: inline-flex;
  align-items: center;
  padding: 7px 12px;
  border-radius: 999px;
  color: #5145cf;
  background: var(--article-soft);
  font-size: .73rem;
  font-weight: 850;
  letter-spacing: .025em;
}

.article-page .article-status-dot {
  color: #7d879a;
  font-size: .79rem;
}

.article-page .article-status-dot::before {
  content: "";
  display: inline-block;
  width: 6px;
  height: 6px;
  margin: 0 7px 1px 0;
  border-radius: 50%;
  background: #20b67a;
}

.article-page .article-detail-head h1 {
  margin: 0 0 19px;
  color: #151e32;
  font-size: clamp(2rem, 4.6vw, 3.35rem);
  font-weight: 850;
  letter-spacing: -.058em;
  line-height: 1.09;
  overflow-wrap: anywhere;
}

.article-page .article-lead {
  max-width: 760px;
  margin: 0;
  color: var(--article-muted);
  font-size: clamp(1rem, 1.6vw, 1.15rem);
  line-height: 1.8;
}

.article-page .article-byline {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 27px;
}

.article-page .author-avatar {
  display: grid;
  place-items: center;
  flex: 0 0 40px;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  color: #fff;
  background: linear-gradient(135deg, #6b5ff0, #9388ff);
  font-weight: 900;
}

.article-page .author-info,
.article-page .article-date {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.article-page .author-info strong,
.article-page .article-date strong {
  color: #2c3650;
  font-size: .78rem;
}

.article-page .author-info span,
.article-page .article-date span {
  color: #8b94a5;
  font-size: .72rem;
}

.article-page .byline-divider {
  width: 1px;
  height: 30px;
  margin: 0 4px;
  background: #e7eaf1;
}

.article-page .updated-note {
  margin: 14px 0 0;
  color: #8993a6;
  font-size: .75rem;
}

/* =========================================================
   ARTICLE ACTION BAR
========================================================= */

.article-page .article-tools {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 17px;
  padding: 14px clamp(23px, 4.5vw, 55px);
  border-top: 1px solid #edf0f5;
  border-bottom: 1px solid #edf0f5;
  color: #7e899c;
  font-size: .78rem;
}

.article-page .article-tools > span { margin-right: auto; }

.article-page .text-action {
  padding: 5px 0;
  border: 0;
  background: transparent;
  color: var(--article-primary);
  font-size: .78rem;
  font-weight: 800;
  cursor: pointer;
}

.article-page .text-action:hover {
  color: var(--article-primary-dark);
}

/* =========================================================
   READING AREA + TABLE OF CONTENTS
========================================================= */

.article-page .article-reading-grid {
  display: grid;
  grid-template-columns: 174px minmax(0, 1fr);
  align-items: start;
  gap: clamp(22px, 3.5vw, 40px);
  padding: 32px clamp(23px, 4.5vw, 55px) 45px;
}

.article-page .article-toc {
  position: sticky;
  top: 20px;
  align-self: start;
  padding: 17px 14px;
  border: 1px solid #e9edf5;
  border-radius: 15px;
  background: #f8f9fd;
}

.article-page .toc-heading {
  margin: 0 0 12px;
  color: #929bad;
  font-size: .65rem;
  font-weight: 900;
  letter-spacing: .13em;
}

.article-page .toc-list {
  display: grid;
  gap: 6px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.article-page .toc-list li a {
  display: block;
  padding: 5px 7px;
  border-left: 2px solid #e0e5ef;
  color: #68748a;
  font-size: .76rem;
  line-height: 1.5;
  overflow-wrap: anywhere;
  transition: color .16s ease, background .16s ease,
    border-color .16s ease;
}

.article-page .toc-list li a:hover,
.article-page .toc-list li a:focus-visible {
  border-left-color: var(--article-primary);
  background: #efedff;
  color: var(--article-primary-dark);
}

.article-page .toc-list .toc-level-h3 { padding-left: 10px; }

.article-page .toc-placeholder {
  margin: 0;
  color: #8993a5;
  font-size: .74rem;
  line-height: 1.6;
}

.article-page .toc-tip {
  margin-top: 16px;
  padding-top: 14px;
  border-top: 1px solid #e5e9f1;
}

.article-page .toc-tip strong {
  color: #3b465e;
  font-size: .76rem;
}

.article-page .toc-tip p {
  margin: 6px 0 0;
  color: #8791a3;
  font-size: .71rem;
  line-height: 1.65;
}

/* =========================================================
   ARTICLE TYPOGRAPHY
========================================================= */

.article-page .article-body {
  min-width: 0;
  color: #48546b;
  font-size: 1rem;
  line-height: 1.9;
  overflow-wrap: anywhere;
}

.article-page .article-body h1,
.article-page .article-body h2,
.article-page .article-body h3 {
  color: #1b2438;
  font-weight: 800;
  letter-spacing: -.03em;
  line-height: 1.32;
  scroll-margin-top: 24px;
}

.article-page .article-body h1 {
  margin: 0 0 17px;
  font-size: 1.9rem;
}

.article-page .article-body h2 {
  margin: 35px 0 13px;
  font-size: 1.48rem;
}

.article-page .article-body h3 {
  margin: 26px 0 10px;
  font-size: 1.16rem;
}

.article-page .article-body p { margin: 0 0 19px; }

.article-page .article-body strong {
  color: #2b354b;
  font-weight: 800;
}

.article-page .article-body a {
  color: var(--article-primary-dark);
  text-decoration: underline;
  text-decoration-color: #c6c1ff;
  text-underline-offset: 3px;
  overflow-wrap: anywhere;
}

.article-page .article-body a:hover {
  text-decoration-color: currentColor;
}

.article-page .article-body blockquote {
  margin: 24px 0;
  padding: 15px 19px;
  border-left: 4px solid #7569f4;
  border-radius: 0 12px 12px 0;
  background: #f6f5ff;
  color: #515b73;
}

.article-page .article-list {
  margin: 0 0 22px;
  padding-left: 24px;
}

.article-page .article-list li {
  margin: 7px 0;
  padding-left: 4px;
}

.article-page .inline-code {
  padding: 2px 5px;
  border: 1px solid #e4e7f0;
  border-radius: 5px;
  background: #f0f2f8;
  color: #5947c9;
  font-size: .87em;
  overflow-wrap: anywhere;
}

/* =========================================================
   CODE SNIPPETS
========================================================= */

.article-page .code-block {
  overflow: hidden;
  margin: 22px 0 26px;
  border: 1px solid #273248;
  border-radius: 13px;
  background: #101827;
}

.article-page .code-block-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 14px;
  background: #1a2537;
  color: #b4bfd2;
  font-size: .72rem;
}

.article-page .copy-code {
  padding: 6px 10px;
  border: 1px solid #45516a;
  border-radius: 7px;
  background: #2b3850;
  color: #f3f5fa;
  font-size: .72rem;
  font-weight: 800;
  cursor: pointer;
}

.article-page .copy-code:hover { background: #3a4863; }

.article-page .code-block pre {
  overflow-x: auto;
  margin: 0;
  padding: 19px;
  color: #e2e8f4;
  font: .84rem/1.75 ui-monospace, SFMono-Regular, Consolas,
    "Liberation Mono", monospace;
  tab-size: 4;
}

.article-page .code-block code { font: inherit; }

.article-page .article-end-note {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  margin-top: 35px;
  padding: 17px;
  border: 1px solid #dcefe6;
  border-radius: 13px;
  background: #f4fbf7;
}

.article-page .article-end-note > span {
  display: grid;
  place-items: center;
  flex: 0 0 24px;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: #d9f5e7;
  color: #148457;
  font-weight: 900;
}

.article-page .article-end-note p {
  margin: 0;
  color: #537364;
  font-size: .85rem;
  line-height: 1.65;
}

.article-page .article-content-empty {
  margin: 0 clamp(23px, 4.5vw, 55px) 45px;
  padding: 30px;
  border: 1px dashed #d9d9f4;
  border-radius: 15px;
  background: #fafaff;
}

.article-page .article-content-empty h2 {
  margin: 0 0 8px;
  color: #29334a;
  font-size: 1.2rem;
}

.article-page .article-content-empty p {
  margin: 0;
  color: #758097;
  line-height: 1.7;
}

/* =========================================================
   RIGHT SIDEBAR
========================================================= */

.article-page .article-sidebar {
  display: grid;
  gap: 17px;
}

.article-page .sidebar-card,
.article-page .sidebar-subscribe {
  padding: 21px;
  border: 1px solid #e6eaf2;
  border-radius: 18px;
  background: #fff;
  box-shadow: 0 10px 30px rgba(24, 32, 51, .035);
}

.article-page .sidebar-icon {
  display: grid;
  place-items: center;
  width: 39px;
  height: 39px;
  border-radius: 12px;
  background: #efedff;
  color: var(--article-primary);
  font-size: 1.2rem;
}

.article-page .sidebar-card h2,
.article-page .sidebar-subscribe h2 {
  margin: 15px 0 9px;
  color: #202a40;
  font-size: 1rem;
  letter-spacing: -.02em;
}

.article-page .sidebar-card p,
.article-page .sidebar-subscribe p {
  margin: 0 0 15px;
  color: #7c879b;
  font-size: .81rem;
  line-height: 1.7;
}

.article-page .sidebar-link {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-top: 13px;
  border-top: 1px solid #edf0f5;
  color: var(--article-primary);
  font-size: .81rem;
  font-weight: 850;
}

.article-page .sidebar-stat {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 0;
  border-bottom: 1px solid #eff1f6;
  font-size: .74rem;
}

.article-page .sidebar-stat:last-child {
  padding-bottom: 0;
  border-bottom: 0;
}

.article-page .sidebar-stat span { color: #8791a4; }

.article-page .sidebar-stat strong {
  max-width: 56%;
  color: #3a455c;
  text-align: right;
  overflow-wrap: anywhere;
}

.article-page .sidebar-subscribe {
  border: 0;
  background: linear-gradient(145deg, #27215f, #5145bd);
  color: #fff;
}

.article-page .subscribe-spark {
  color: #d6d0ff;
  font-size: 1.4rem;
}

.article-page .sidebar-subscribe h2 {
  margin-top: 12px;
  color: #fff;
}

.article-page .sidebar-subscribe p { color: #d0cdf4; }

.article-page .button-light {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 11px 14px;
  border-radius: 10px;
  background: #fff;
  color: #4035a8;
  font-size: .79rem;
  font-weight: 850;
}

.article-page .button-light:hover { background: #f0efff; }

/* =========================================================
   RELATED ARTICLES
========================================================= */

.article-page .related-articles { margin-top: 58px; }

.article-page .related-heading {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 20px;
}

.article-page .section-kicker {
  margin: 0 0 8px;
  color: #6b5ff0;
  font-size: .69rem;
  font-weight: 900;
  letter-spacing: .13em;
}

.article-page .related-heading h2 {
  margin: 0;
  color: #192238;
  font-size: clamp(1.55rem, 3vw, 2.1rem);
  letter-spacing: -.045em;
}

.article-page .view-all-link {
  color: var(--article-primary);
  font-size: .83rem;
  font-weight: 850;
  white-space: nowrap;
}

.article-page .view-all-link:hover {
  color: var(--article-primary-dark);
}

.article-page .related-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 17px;
}

.article-page .related-card {
  display: flex;
  flex-direction: column;
  min-width: 0;
  padding: 21px;
  border: 1px solid #e6eaf2;
  border-radius: 17px;
  background: #fff;
  transition: transform .18s ease, box-shadow .18s ease,
    border-color .18s ease;
}

.article-page .related-card:hover {
  transform: translateY(-3px);
  border-color: #d5d0ff;
  box-shadow: 0 14px 30px rgba(39, 33, 95, .07);
}

.article-page .related-category {
  align-self: flex-start;
  margin-bottom: 14px;
  padding: 5px 9px;
  border-radius: 999px;
  background: #f0efff;
  color: #5a4fd3;
  font-size: .67rem;
  font-weight: 850;
}

.article-page .related-card strong {
  color: #202a40;
  font-size: 1rem;
  line-height: 1.45;
}

.article-page .related-card p {
  margin: 10px 0;
  color: #7c879b;
  font-size: .79rem;
  line-height: 1.65;
}

.article-page .related-card small {
  margin-top: auto;
  padding-top: 17px;
  color: #929bad;
  font-size: .71rem;
}

.article-page .related-card small span { color: #5a4fd3; }

/* =========================================================
   404 / ERROR STATES
========================================================= */

.article-page .article-state {
  max-width: 680px;
  margin: 50px auto;
  padding: clamp(28px, 6vw, 60px);
  border: 1px solid #e6e9f2;
  border-radius: 23px;
  background: #fff;
  text-align: center;
  box-shadow: var(--article-shadow);
}

.article-page .state-icon {
  display: grid;
  place-items: center;
  width: 60px;
  height: 60px;
  margin: 0 auto 20px;
  border-radius: 18px;
  background: #efedff;
  color: var(--article-primary);
  font-size: 1.1rem;
  font-weight: 900;
}

.article-page .article-state h1 {
  margin: 0 0 12px;
  color: #182033;
  font-size: clamp(1.8rem, 4vw, 2.5rem);
  letter-spacing: -.045em;
}

.article-page .article-state > p:not(.section-kicker) {
  max-width: 480px;
  margin: 0 auto 24px;
  color: #778197;
  line-height: 1.8;
}

.article-page .article-state .button { display: inline-flex; }

/* =========================================================
   UPDATED PREMIUM MULTI-COLUMN FOOTER
========================================================= */

.article-page .site-footer {
  position: relative;
  margin-top: 0;
  overflow: hidden;
  background: #ffffff;
  border-top: 1px solid #e5e9f2;
}

/* Footer columns */
.article-page .footer-main {
  display: grid;
  grid-template-columns: minmax(240px, 1.6fr)
    repeat(3, minmax(130px, 1fr));
  gap: clamp(28px, 4vw, 58px);
  padding-top: 58px;
  padding-bottom: 48px;
}

/* Footer brand */
.article-page .footer-brand {
  min-width: 0;
  max-width: 330px;
}

.article-page .footer-logo {
  display: inline-flex;
  align-items: center;
  gap: 11px;
  color: #172033;
  font-size: 1.08rem;
  font-weight: 850;
  letter-spacing: -.045em;
  line-height: 1.1;
}

.article-page .footer-logo .brand-mark {
  display: grid;
  place-items: center;
  flex-shrink: 0;
  width: 42px;
  height: 42px;
  border-radius: 13px;
  color: #fff;
  background: linear-gradient(145deg, #665cf1, #4237b8);
  box-shadow: 0 7px 17px rgba(91, 80, 223, .22);
  font-size: 1.2rem;
}

.article-page .footer-logo .brand-accent {
  color: var(--article-primary);
}

.article-page .footer-logo small {
  display: block;
  margin-top: 5px;
  color: #8a93a5;
  font-size: .57rem;
  font-weight: 800;
  letter-spacing: .17em;
}

.article-page .footer-brand > p {
  max-width: 310px;
  margin: 20px 0 17px;
  color: #748097;
  font-size: .88rem;
  line-height: 1.85;
}

.article-page .footer-email {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  color: var(--article-primary);
  font-size: .84rem;
  font-weight: 800;
  transition: color .18s ease, gap .18s ease;
}

.article-page .footer-email:hover {
  gap: 13px;
  color: var(--article-primary-dark);
}

/* Footer navigation columns */
.article-page .footer-column {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 13px;
  min-width: 0;
}

.article-page .footer-column h3 {
  margin: 3px 0 7px;
  color: #202a40;
  font-size: .84rem;
  font-weight: 850;
  letter-spacing: -.01em;
}

.article-page .footer-column a {
  color: #788399;
  font-size: .81rem;
  line-height: 1.6;
  overflow-wrap: anywhere;
  transition: color .18s ease, transform .18s ease;
}

.article-page .footer-column a:hover {
  color: var(--article-primary);
  transform: translateX(2px);
}

/* Footer copyright row */
.article-page .footer-bottom {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 14px 24px;
  padding-top: 22px;
  padding-bottom: 22px;
  border-top: 1px solid #e8ebf2;
  color: #8993a5;
  font-size: .76rem;
  line-height: 1.7;
}

.article-page .footer-bottom > span {
  overflow-wrap: anywhere;
}

.article-page .footer-bottom > span:last-child {
  color: #778197;
}

/* Keyboard accessibility */
.article-page a:focus-visible,
.article-page button:focus-visible {
  outline: 3px solid rgba(91, 80, 223, .38);
  outline-offset: 3px;
}

.article-page .footer-logo:focus-visible,
.article-page .footer-email:focus-visible,
.article-page .footer-column a:focus-visible {
  outline: 3px solid rgba(91, 80, 223, .38);
  outline-offset: 4px;
  border-radius: 4px;
}

/* =========================================================
   TABLET
========================================================= */

@media (max-width: 1050px) {
  .article-page .article-layout {
    grid-template-columns: minmax(0, 1fr) 235px;
    gap: 18px;
  }

  .article-page .article-reading-grid {
    grid-template-columns: 145px minmax(0, 1fr);
    gap: 22px;
  }

  .article-page .sidebar-card,
  .article-page .sidebar-subscribe {
    padding: 18px;
  }

  .article-page .nav-links { gap: 19px; }
}

@media (max-width: 900px) {
  .article-page .footer-main {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 34px 25px;
    padding-top: 45px;
    padding-bottom: 38px;
  }

  .article-page .footer-brand {
    grid-column: 1 / -1;
    max-width: 470px;
  }

  .article-page .footer-brand > p { max-width: 420px; }
}

/* =========================================================
   SMALL TABLET
========================================================= */

@media (max-width: 800px) {
  .article-page .container {
    width: min(calc(100% - 32px), 700px);
  }

  .article-page .navbar {
    min-height: 72px;
    gap: 14px;
  }

  .article-page .nav-links { gap: 15px; }

  .article-page .nav-links a { font-size: .82rem; }

  .article-page .brand { font-size: 1rem; }

  .article-page .brand-mark {
    width: 38px;
    height: 38px;
  }

  .article-page .nav-button {
    min-height: 39px;
    padding: 9px 11px;
    font-size: .77rem;
  }

  .article-page .article-layout { grid-template-columns: 1fr; }

  .article-page .article-sidebar {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .article-page .sidebar-subscribe { grid-column: 1 / -1; }

  .article-page .article-reading-grid { grid-template-columns: 1fr; }

  .article-page .article-toc { position: static; }

  .article-page .related-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

/* =========================================================
   MOBILE
========================================================= */

@media (max-width: 560px) {
  .article-page .container { width: calc(100% - 28px); }

  .article-page .navbar {
    min-height: auto;
    padding-top: 14px;
    padding-bottom: 14px;
    flex-wrap: wrap;
  }

  .article-page .brand { gap: 9px; }

  .article-page .brand-mark {
    width: 36px;
    height: 36px;
    border-radius: 11px;
  }

  .article-page .brand small { font-size: .52rem; }

  .article-page .nav-links {
    order: 3;
    width: 100%;
    justify-content: flex-start;
    gap: 22px;
    padding-top: 7px;
  }

  .article-page .nav-button { margin-left: auto; }

  .article-page .article-main { padding: 19px 0 50px; }

  .article-page .article-detail { border-radius: 17px; }

  .article-page .article-detail-head { padding: 25px 20px 22px; }

  .article-page .article-detail-head h1 {
    font-size: clamp(1.85rem, 9vw, 2.35rem);
  }

  .article-page .article-byline { gap: 10px; }

  .article-page .byline-divider { display: none; }

  .article-page .article-tools {
    padding: 13px 20px;
    gap: 13px;
  }

  .article-page .article-reading-grid { padding: 23px 20px 30px; }

  .article-page .article-body {
    font-size: .96rem;
    line-height: 1.85;
  }

  .article-page .article-body h2 { font-size: 1.32rem; }

  .article-page .article-body h3 { font-size: 1.1rem; }

  .article-page .code-block pre {
    padding: 15px;
    font-size: .78rem;
  }

  .article-page .article-sidebar { grid-template-columns: 1fr; }

  .article-page .sidebar-subscribe { grid-column: auto; }

  .article-page .related-articles { margin-top: 42px; }

  .article-page .related-heading {
    align-items: flex-start;
    flex-direction: column;
  }

  .article-page .related-grid { grid-template-columns: 1fr; }

  .article-page .related-card { padding: 19px; }

  .article-page .article-state {
    margin: 25px auto;
    border-radius: 17px;
  }

  /* Updated footer mobile layout */
  .article-page .footer-main {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 33px 22px;
    padding-top: 36px;
    padding-bottom: 32px;
  }

  .article-page .footer-brand {
    grid-column: 1 / -1;
    max-width: 100%;
  }

  .article-page .footer-brand > p { font-size: .85rem; }

  .article-page .footer-column { gap: 12px; }

  .article-page .footer-column h3 { margin-bottom: 5px; }

  .article-page .footer-column a { font-size: .79rem; }

  .article-page .footer-bottom {
    align-items: flex-start;
    flex-direction: column;
    gap: 7px;
    padding-top: 18px;
    padding-bottom: 20px;
    font-size: .73rem;
  }
}

/* Very small screens */
@media (max-width: 350px) {
  .article-page .footer-main { grid-template-columns: 1fr; }

  .article-page .footer-brand { grid-column: auto; }
}

/* =========================================================
   REDUCED MOTION
========================================================= */

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }

  *,
  *::before,
  *::after {
    transition-duration: .01ms !important;
    animation-duration: .01ms !important;
    animation-iteration-count: 1 !important;
  }
}

/* =========================================================
   PRINT-FRIENDLY ARTICLE
========================================================= */

@media print {
  .article-page,
  body.article-page {
    background: #fff !important;
  }

  .article-page .site-header,
  .article-page .site-footer,
  .article-page .article-sidebar,
  .article-page .article-tools,
  .article-page .article-toc,
  .article-page .back-link,
  .article-page .breadcrumbs,
  .article-page .related-articles {
    display: none !important;
  }

  .article-page .article-main { padding: 0; }

  .article-page .article-layout,
  .article-page .article-reading-grid {
    display: block;
  }

  .article-page .article-detail {
    border: 0;
    box-shadow: none;
  }

  .article-page .article-detail-head,
  .article-page .article-reading-grid {
    padding: 0;
  }

  .article-page .article-body {
    color: #222;
    font-size: 11pt;
  }

  .article-page .code-block { break-inside: avoid; }
}


/* =====================================
   METAMOBS PREMIUM SPONSORED POSTER
===================================== */

.sponsor-poster {
    position: relative;
    width: 100%;
    max-width: 340px;
    margin: 28px auto;
    padding: 14px;
    background: linear-gradient(145deg, #ffffff, #f5f7ff);
    border: 1px solid #e5e9f2;
    border-radius: 18px;
    box-shadow:
        0 8px 25px rgba(15, 23, 42, 0.07),
        0 2px 6px rgba(15, 23, 42, 0.03);
    overflow: hidden;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    box-sizing: border-box;
}

/* Hover effect */
.sponsor-poster:hover {
    transform: translateY(-5px);
    box-shadow: 0 15px 35px rgba(15, 23, 42, 0.13);
}

/* Sponsored label */
.sponsor-label {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 7px;
    margin-bottom: 12px;
    color: #64748b;
    font-size: 10px;
    font-weight: 800;
    letter-spacing: 2px;
    text-transform: uppercase;
}

.sponsor-label::before,
.sponsor-label::after {
    content: "";
    width: 22px;
    height: 1px;
    background: #cbd5e1;
}

/* Poster link */
.sponsor-poster a {
    display: block;
    width: 100%;
    border-radius: 11px;
    overflow: hidden;
    background: #eef2ff;
    line-height: 0;
}

/* Poster image */
.sponsor-poster img {
    display: block;
    width: 100%;
    height: auto;
    aspect-ratio: 2 / 3;
    object-fit: contain;
    border-radius: 11px;
    transition: transform 0.45s ease;
}

/* Image hover */
.sponsor-poster:hover img {
    transform: scale(1.025);
}

/* Keyboard accessibility */
.sponsor-poster a:focus-visible {
    outline: 3px solid #635bff;
    outline-offset: 4px;
}

/* Tablet */
@media (max-width: 1024px) {
    .sponsor-poster {
        max-width: 300px;
    }
}

/* Mobile */
@media (max-width: 768px) {
    .sponsor-poster {
        max-width: 320px;
        margin: 22px auto;
        padding: 12px;
        border-radius: 15px;
    }

    .sponsor-poster:hover {
        transform: none;
    }

    .sponsor-poster img {
        border-radius: 9px;
    }
}

/* Small mobile */
@media (max-width: 380px) {
    .sponsor-poster {
        max-width: 100%;
        padding: 10px;
    }
}
