/* ==========================================================================
   Gem Arcade Games — Editorial / long-form article styles
   ========================================================================== */

/* --------------------------------------------------------------------------
   1. Article shell
   -------------------------------------------------------------------------- */
.article-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 300px;
  gap: var(--s-6);
  align-items: start;
  padding-block: var(--s-5) var(--s-7);
}
.article-aside {
  display: grid;
  gap: var(--s-4);
  position: sticky;
  top: calc(var(--header-h) + 16px);
}

.article-header { padding-block: var(--s-5) var(--s-4); }
.article-header h1 { margin-bottom: var(--s-3); max-width: 24ch; }
.article-kicker {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: var(--t-xs);
  font-weight: 800;
  letter-spacing: .14em;
  text-transform: uppercase;
  color: var(--gem-emerald);
  margin-bottom: var(--s-3);
}
.article-dek {
  font-size: var(--t-md);
  color: var(--text-muted);
  max-width: 68ch;
  margin-bottom: var(--s-4);
}
.article-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--s-2) var(--s-4);
  font-size: var(--t-sm);
  color: var(--text-dim);
  padding-block: var(--s-3);
  border-top: 1px solid var(--line-soft);
  border-bottom: 1px solid var(--line-soft);
}
.article-meta__item { display: inline-flex; align-items: center; gap: 7px; }
.article-meta svg { width: 15px; height: 15px; color: var(--text-dim); }
.article-meta a { color: var(--text-muted); font-weight: 600; }

/* --------------------------------------------------------------------------
   2. Reading typography
   -------------------------------------------------------------------------- */
.article-body {
  font-size: 1.075rem;
  line-height: 1.78;
  color: #dbe2f5;
  max-width: 74ch;
}
.article-body > * { max-width: 100%; }

.article-body h2 {
  margin-top: var(--s-7);
  margin-bottom: var(--s-3);
  padding-top: var(--s-4);
  border-top: 1px solid var(--line-soft);
  scroll-margin-top: calc(var(--header-h) + 20px);
}
.article-body h3 {
  margin-top: var(--s-5);
  margin-bottom: var(--s-2);
  color: #f4f7ff;
  scroll-margin-top: calc(var(--header-h) + 20px);
}
.article-body h4 {
  margin-top: var(--s-4);
  margin-bottom: var(--s-2);
  color: var(--gem-cyan);
  font-size: 1.02rem;
  letter-spacing: 0;
}
.article-body p { margin-bottom: var(--s-4); }
.article-body ul, .article-body ol { margin-bottom: var(--s-4); padding-left: 1.4em; }
.article-body li { margin-bottom: .55em; }
.article-body li > ul, .article-body li > ol { margin-top: .45em; margin-bottom: .25em; }

.article-body a { font-weight: 600; text-decoration: underline; text-decoration-thickness: 1px; }
.article-body a:hover { color: var(--gem-emerald); }

.article-body blockquote {
  margin: var(--s-5) 0;
  padding: var(--s-4) var(--s-5);
  border-left: 3px solid var(--gem-violet);
  background: rgba(157,130,255,.08);
  border-radius: 0 var(--r-md) var(--r-md) 0;
  color: #eaeefb;
  font-size: 1.06rem;
}
.article-body blockquote > :last-child { margin-bottom: 0; }
.article-body blockquote cite {
  display: block;
  margin-top: var(--s-2);
  font-size: var(--t-sm);
  font-style: normal;
  color: var(--text-dim);
}

.article-body figure {
  margin: var(--s-6) 0;
}
.article-body figure img,
.article-body figure svg {
  width: 100%;
  border-radius: var(--r-md);
  border: 1px solid var(--line);
}
.article-body figcaption {
  margin-top: 10px;
  font-size: var(--t-sm);
  color: var(--text-dim);
  text-align: center;
  line-height: 1.55;
}

.article-body pre {
  margin: var(--s-5) 0;
  padding: var(--s-4);
  background: var(--bg-deep);
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  overflow-x: auto;
  font-size: .86rem;
  line-height: 1.7;
  -webkit-overflow-scrolling: touch;
}
.article-body pre code {
  background: none;
  border: 0;
  padding: 0;
  color: #cfe3ff;
}

/* Drop the first-paragraph lead-in */
.article-body > p:first-of-type {
  font-size: 1.14rem;
  color: #eef2ff;
  line-height: 1.72;
}

/* --------------------------------------------------------------------------
   3. Table of contents
   -------------------------------------------------------------------------- */
.article-toc {
  padding: var(--s-4) var(--s-5);
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  background: var(--surface);
  margin-bottom: var(--s-6);
}
.article-toc > h2 {
  font-size: var(--t-xs);
  font-weight: 800;
  letter-spacing: .13em;
  text-transform: uppercase;
  color: var(--text-dim);
  margin: 0 0 var(--s-3);
  border: 0;
  padding: 0;
}
.article-toc ol {
  list-style: none;
  counter-reset: toc;
  margin: 0;
  padding: 0;
  font-size: var(--t-sm);
}
.article-toc li {
  counter-increment: toc;
  margin-bottom: 7px;
  padding-left: 1.9em;
  position: relative;
}
.article-toc li::before {
  content: counter(toc, decimal-leading-zero);
  position: absolute;
  left: 0;
  color: var(--gem-cyan);
  font-weight: 800;
  font-variant-numeric: tabular-nums;
  font-size: .78rem;
  top: .15em;
}
.article-toc a { color: var(--text-muted); text-decoration: none; }
.article-toc a:hover { color: var(--gem-cyan); text-decoration: underline; }

.article-toc--sticky {
  position: sticky;
  top: calc(var(--header-h) + 16px);
  max-height: calc(100vh - var(--header-h) - 40px);
  overflow-y: auto;
}

/* --------------------------------------------------------------------------
   4. Key takeaways
   -------------------------------------------------------------------------- */
.takeaways {
  margin: var(--s-6) 0;
  padding: var(--s-5);
  border-radius: var(--r-lg);
  border: 1px solid rgba(51,227,164,.3);
  background:
    radial-gradient(420px 180px at 12% 0%, rgba(51,227,164,.13), transparent 70%),
    var(--surface);
}
.takeaways h2 {
  margin: 0 0 var(--s-3) !important;
  border: 0 !important;
  padding: 0 !important;
  font-size: 1.12rem;
  display: flex;
  align-items: center;
  gap: 10px;
}
.takeaways h2::before {
  content: "";
  width: 12px; height: 12px;
  transform: rotate(45deg);
  border-radius: 2px;
  background: var(--grad-gem);
  flex: none;
}
.takeaways ul { margin: 0; padding-left: 1.25em; }
.takeaways li { color: var(--text-muted); }
.takeaways li strong { color: #fff; }

/* --------------------------------------------------------------------------
   5. Author box
   -------------------------------------------------------------------------- */
.author-box {
  display: flex;
  gap: var(--s-4);
  align-items: flex-start;
  margin-top: var(--s-7);
  padding: var(--s-5);
  border-radius: var(--r-lg);
  border: 1px solid var(--line);
  background: var(--grad-surface);
}
.author-box__avatar {
  flex: none;
  width: 72px;
  height: 72px;
  border-radius: 50%;
  overflow: hidden;
  border: 2px solid rgba(69,201,255,.4);
  background: var(--surface-2);
}
.author-box__avatar img, .author-box__avatar svg { width: 100%; height: 100%; object-fit: cover; }
.author-box__name { margin: 0 0 2px; font-size: 1.08rem; }
.author-box__role {
  margin: 0 0 var(--s-2);
  font-size: var(--t-xs);
  font-weight: 700;
  letter-spacing: .06em;
  text-transform: uppercase;
  color: var(--gem-cyan);
}
.author-box p { margin: 0 0 var(--s-2); font-size: var(--t-sm); color: var(--text-muted); }
.author-box p:last-child { margin-bottom: 0; }

.author-card--lg {
  display: grid;
  grid-template-columns: 160px minmax(0,1fr);
  gap: var(--s-6);
  align-items: start;
}
.author-card--lg .author-portrait {
  width: 160px; height: 160px;
  border-radius: var(--r-lg);
  overflow: hidden;
  border: 1px solid var(--line);
  background: var(--surface-2);
}
@media (max-width: 559px) {
  .author-card--lg { grid-template-columns: 1fr; }
  .author-card--lg .author-portrait { width: 120px; height: 120px; }
  .author-box { flex-direction: column; }
}

/* --------------------------------------------------------------------------
   6. Inline game promo inside articles
   -------------------------------------------------------------------------- */
.inline-game-promo {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--s-4);
  margin: var(--s-6) 0;
  padding: var(--s-4);
  border-radius: var(--r-lg);
  border: 1px solid var(--line);
  background: var(--grad-surface);
}
.inline-game-promo__art {
  flex: none;
  width: 130px;
  aspect-ratio: 16/10;
  border-radius: var(--r-sm);
  overflow: hidden;
  border: 1px solid var(--line);
}
.inline-game-promo__art img, .inline-game-promo__art svg { width: 100%; height: 100%; object-fit: cover; }
.inline-game-promo__body { flex: 1 1 220px; min-width: 0; }
.inline-game-promo h4 {
  margin: 0 0 4px;
  font-size: 1.05rem;
  color: #fff;
}
.inline-game-promo p { margin: 0 0 10px; font-size: var(--t-sm); color: var(--text-muted); }
.inline-game-promo .btn { flex: none; }

/* --------------------------------------------------------------------------
   7. References / sources
   -------------------------------------------------------------------------- */
.references {
  margin-top: var(--s-6);
  padding: var(--s-4) var(--s-5);
  border-radius: var(--r-md);
  border: 1px solid var(--line);
  background: rgba(19,26,48,.55);
  font-size: var(--t-sm);
}
.references h2 {
  font-size: var(--t-xs) !important;
  letter-spacing: .13em;
  text-transform: uppercase;
  color: var(--text-dim);
  border: 0 !important;
  padding: 0 !important;
  margin: 0 0 var(--s-3) !important;
}
.references ol { padding-left: 1.3em; margin: 0; }
.references li { color: var(--text-muted); margin-bottom: .5em; }

/* --------------------------------------------------------------------------
   8. Prev / next + related
   -------------------------------------------------------------------------- */
.post-nav {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: var(--s-4);
  margin-top: var(--s-6);
}
.post-nav__item {
  position: relative;
  padding: var(--s-4);
  border-radius: var(--r-md);
  border: 1px solid var(--line);
  background: var(--surface);
}
.post-nav__item span {
  display: block;
  font-size: var(--t-xs);
  font-weight: 800;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: var(--text-dim);
  margin-bottom: 5px;
}
.post-nav__item a { color: #fff; font-weight: 700; font-size: var(--t-sm); }
.post-nav__item a::after { content: ""; position: absolute; inset: 0; }
.post-nav__item:hover { border-color: rgba(69,201,255,.4); }

/* --------------------------------------------------------------------------
   9. Guides hub cluster blocks
   -------------------------------------------------------------------------- */
.cluster {
  padding: var(--s-5);
  border-radius: var(--r-lg);
  border: 1px solid var(--line);
  background: var(--surface);
}
.cluster__head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: var(--s-3);
  margin-bottom: var(--s-3);
  padding-bottom: var(--s-3);
  border-bottom: 1px solid var(--line-soft);
}
.cluster__head h3 { margin: 0; font-size: 1.12rem; }
.cluster__head span { font-size: var(--t-xs); color: var(--text-dim); font-weight: 700; white-space: nowrap; }
.cluster ul { list-style: none; margin: 0; padding: 0; }
.cluster li {
  margin: 0;
  padding: 9px 0;
  border-bottom: 1px solid var(--line-soft);
  font-size: var(--t-sm);
}
.cluster li:last-child { border-bottom: 0; }
.cluster li a { color: var(--text-muted); font-weight: 600; }
.cluster li a:hover { color: var(--gem-cyan); }
.cluster li .pillar-flag {
  display: inline-block;
  margin-left: 6px;
  font-size: .62rem;
  font-weight: 800;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--gem-amber);
  vertical-align: 1px;
}

/* --------------------------------------------------------------------------
   10. Sidebar widgets
   -------------------------------------------------------------------------- */
.widget {
  padding: var(--s-4);
  border-radius: var(--r-md);
  border: 1px solid var(--line);
  background: var(--surface);
}
.widget h2, .widget h3 {
  font-size: var(--t-xs);
  font-weight: 800;
  letter-spacing: .13em;
  text-transform: uppercase;
  color: var(--text-dim);
  margin-bottom: var(--s-3);
}
.widget ul { list-style: none; margin: 0; padding: 0; font-size: var(--t-sm); }
.widget li { margin: 0; padding: 8px 0; border-bottom: 1px solid var(--line-soft); }
.widget li:last-child { border-bottom: 0; }
.widget a { color: var(--text-muted); font-weight: 600; }
.widget a:hover { color: var(--gem-cyan); }

/* --------------------------------------------------------------------------
   11. Legal / policy pages
   -------------------------------------------------------------------------- */
.legal-body {
  max-width: 76ch;
  font-size: 1.03rem;
  line-height: 1.75;
  color: #dbe2f5;
}
.legal-body h2 {
  margin-top: var(--s-6);
  padding-top: var(--s-4);
  border-top: 1px solid var(--line-soft);
  font-size: 1.32rem;
  scroll-margin-top: calc(var(--header-h) + 20px);
}
.legal-body h3 { margin-top: var(--s-5); font-size: 1.08rem; }
.legal-body ul { padding-left: 1.35em; }
.legal-updated {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 14px;
  border-radius: var(--r-pill);
  background: var(--surface-2);
  border: 1px solid var(--line);
  font-size: var(--t-xs);
  color: var(--text-muted);
  font-weight: 600;
  margin-bottom: var(--s-4);
}
