:root {
  --bg: #08080a;
  --bg2: #0d0d10;
  --bg3: #111116;
  --accent: #1864ff;
  --white: #f4f4f5;
  --dim: #71717a;
  --border: rgba(255, 255, 255, .07);
  --font-serif: 'Instrument Serif', serif;
  --font-sans: 'Inter', sans-serif;
  --font-mono: 'Space Mono', monospace;
}

*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  scroll-behavior: smooth;
  overflow-x: hidden;
}

body {
  background:
    radial-gradient(circle at top right, rgba(24, 100, 255, .12), transparent 24%),
    linear-gradient(180deg, #08080a 0%, #09090c 52%, #08080a 100%);
  color: var(--white);
  font-family: var(--font-sans);
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}

::selection {
  background: rgba(24, 100, 255, .22);
  color: var(--white);
}

img {
  display: block;
  max-width: 100%;
}

a {
  color: inherit;
  text-decoration: none;
}

/* Navbar base -> assets/css/components.css (fonte unica; glass via theme-language.css) */

main {
  width: min(1180px, calc(100% - 48px));
  margin: 0 auto;
  padding: 148px 0 96px;
}

.article-shell {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 300px;
  gap: 28px;
  align-items: start;
}

.article-main,
.article-sidebar,
.related-posts {
  background: linear-gradient(180deg, rgba(17, 17, 22, .92), rgba(13, 13, 16, .98));
  border: 1px solid var(--border);
  border-radius: 28px;
  box-shadow: 0 24px 80px rgba(0, 0, 0, .22);
}

.article-main {
  overflow: hidden;
}

.article-hero {
  padding: 40px 40px 28px;
}

.article-tag,
.section-tag,
.side-label {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-family: var(--font-mono);
  font-size: .72rem;
  letter-spacing: .14em;
  text-transform: uppercase;
  color: var(--accent);
}

.article-tag::before,
.section-tag::before {
  content: '';
  width: 20px;
  height: 1px;
  background: var(--accent);
}

.article-hero h1 {
  font-family: var(--font-serif);
  font-size: clamp(2.7rem, 5vw, 5rem);
  line-height: .97;
  letter-spacing: -.03em;
  margin: 16px 0 18px;
  max-width: 13ch;
}

.article-lead {
  color: #a1a1aa;
  font-size: 1.04rem;
  line-height: 1.8;
  max-width: 760px;
}

.article-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 10px 18px;
  margin-top: 24px;
  color: #8f8f96;
  font-family: var(--font-mono);
  font-size: .74rem;
  letter-spacing: .08em;
  text-transform: uppercase;
}

.article-cover {
  aspect-ratio: 2.08 / 1;
  overflow: hidden;
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
}

.article-cover img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.article-body {
  padding: 34px 40px 42px;
}

.article-body p,
.article-body li,
.article-sidebar p,
.related-post p {
  color: var(--dim);
  line-height: 1.82;
  font-size: .98rem;
}

.article-body p + p,
.article-body h2 + p,
.article-body ul,
.article-body ol,
.article-body blockquote,
.article-body .insight-box {
  margin-top: 16px;
}

.article-body section + section {
  margin-top: 34px;
}

.article-body h2 {
  font-family: var(--font-serif);
  font-size: clamp(1.9rem, 3vw, 2.8rem);
  line-height: 1.02;
  letter-spacing: -.02em;
  margin-bottom: 12px;
}

.article-body ul,
.article-body ol {
  padding-left: 20px;
}

.article-body li + li {
  margin-top: 8px;
}

.article-body strong {
  color: var(--white);
  font-weight: 600;
}

.article-body blockquote {
  padding: 18px 20px;
  border-left: 2px solid var(--accent);
  background: rgba(255, 255, 255, .03);
  border-radius: 0 16px 16px 0;
}

.insight-box {
  padding: 22px;
  background: linear-gradient(180deg, rgba(24, 100, 255, .1), rgba(24, 100, 255, .04));
  border: 1px solid rgba(24, 100, 255, .18);
  border-radius: 20px;
}

.insight-box strong {
  display: block;
  margin-bottom: 10px;
}

.article-sidebar {
  padding: 24px;
  position: sticky;
  top: 108px;
}

.side-label {
  margin-bottom: 18px;
}

.sidebar-group + .sidebar-group {
  margin-top: 22px;
  padding-top: 22px;
  border-top: 1px solid rgba(255, 255, 255, .06);
}

.sidebar-group h3 {
  font-size: .82rem;
  text-transform: uppercase;
  letter-spacing: .08em;
  color: #d4d4d8;
  margin-bottom: 10px;
}

.sidebar-list {
  list-style: none;
  display: grid;
  gap: 10px;
}

.sidebar-list li {
  padding-left: 14px;
  position: relative;
  color: var(--dim);
  line-height: 1.65;
}

.sidebar-list li::before {
  content: '';
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--accent);
  position: absolute;
  top: 10px;
  left: 0;
}

.sidebar-cta {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  padding: 12px 16px;
  border-radius: 999px;
  background: var(--accent);
  color: #fff;
  font-size: .84rem;
  margin-top: 14px;
}

.sidebar-cta:hover {
  background: #2d73ff;
}

.related-posts {
  margin-top: 28px;
  padding: 28px;
}

.related-head {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 18px;
}

.related-head h2 {
  font-family: var(--font-serif);
  font-size: clamp(1.8rem, 3vw, 2.6rem);
  line-height: 1;
}

.related-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
}

.related-post {
  border: 1px solid rgba(255, 255, 255, .07);
  border-radius: 22px;
  overflow: hidden;
  background: linear-gradient(180deg, rgba(255,255,255,.02), rgba(255,255,255,.015));
}

.related-post img {
  width: 100%;
  aspect-ratio: 1.45 / 1;
  object-fit: cover;
}

.related-post-body {
  padding: 18px;
}

.related-post-body span {
  display: inline-block;
  font-family: var(--font-mono);
  font-size: .7rem;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: #8f8f96;
  margin-bottom: 8px;
}

.related-post-body h3 {
  font-size: 1rem;
  line-height: 1.35;
  font-weight: 500;
  margin-bottom: 10px;
}

.related-post-link {
  color: #9bc4ff;
  font-size: .86rem;
}

/* Footer -> assets/css/components.css (fonte unica; classes .foot-* antigas removidas) */

@media (max-width: 1080px) {
  .article-shell {
    grid-template-columns: 1fr;
  }

  .article-sidebar {
    position: static;
  }

  .related-grid {
    grid-template-columns: 1fr 1fr;
  }
}

@media (max-width: 780px) {
  main {
    width: min(100% - 32px, 1180px);
    padding-top: 118px;
    padding-bottom: 72px;
  }

  .article-hero,
  .article-body,
  .article-sidebar,
  .related-posts {
    padding: 22px;
  }

  .related-grid {
    grid-template-columns: 1fr;
  }
}

/* ── Light-mode overrides ─────────────────────────────────────────────────────
   The blog re-declares a dark :root and hardcodes the page background, card
   surfaces, footer and several light-grey/blue text colors, so light mode was
   unreadable. Re-point them at the light palette. (--white = dark text in light.)
   ─────────────────────────────────────────────────────────────────────────── */
:root[data-theme="light"] body {
  background:
    radial-gradient(circle at top right, rgba(24, 100, 255, .10), transparent 24%),
    linear-gradient(180deg, #f6f8fc 0%, #eef2f7 52%, #f6f8fc 100%);
}
/* The big rounded panels (hero container, sidebar, articles section) used a dark
   gradient. Make them a light surface with a soft shadow; the white cards inside
   then stand out. */
:root[data-theme="light"] .article-main,
:root[data-theme="light"] .article-sidebar,
:root[data-theme="light"] .related-posts {
  background: var(--bg3);
  box-shadow: 0 24px 80px rgba(17, 24, 39, .08);
}
:root[data-theme="light"] .article-lead,
:root[data-theme="light"] .article-meta,
:root[data-theme="light"] .related-post-body span {
  color: var(--dim);
}
:root[data-theme="light"] .sidebar-group h3 {
  color: var(--white);
}
:root[data-theme="light"] .article-body blockquote {
  background: var(--bg3);
}
:root[data-theme="light"] .related-post {
  background: var(--bg2);
  border-color: var(--border);
}
:root[data-theme="light"] .sidebar-group + .sidebar-group {
  border-top-color: var(--border);
}
:root[data-theme="light"] .related-post-link {
  color: var(--accent);
}
:root[data-theme="light"] footer {
  background: var(--bg2);
}

/* ── Inline article images ──────────────────────────────────────────────── */
.article-figure {
  margin: 26px 0 8px;
  border-radius: 16px;
  overflow: hidden;
  border: 1px solid var(--border);
}

.article-figure img {
  width: 100%;
  display: block;
}

.article-figure figcaption,
.article-duo figcaption {
  padding: 10px 14px;
  font-family: var(--font-mono);
  font-size: .72rem;
  letter-spacing: .06em;
  text-transform: uppercase;
  color: #8f8f96;
  background: rgba(255, 255, 255, .02);
}

.article-duo {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin: 26px 0 8px;
}

.article-duo figure {
  border-radius: 14px;
  overflow: hidden;
  border: 1px solid var(--border);
}

.article-duo figure img {
  width: 100%;
  display: block;
}

.article-duo figcaption {
  font-size: .68rem;
}

@media (max-width: 560px) {
  .article-duo {
    grid-template-columns: 1fr;
  }
}

:root[data-theme="light"] .article-figure figcaption,
:root[data-theme="light"] .article-duo figcaption {
  background: var(--bg2);
  color: var(--dim);
}
