/* ===================================================
   InvestRules — Design System (Robinhood-inspired)
   =================================================== */

:root {
  /* --green:      #00c805; */
  /* --green-dark: #00a004; */
  /* --green-bg:   #f0fff0; */
  --green:      #D4F308;
  --green-dark: #FE3C00;
  --green-bg:   rgba(212, 243, 8, 0.08);
  --black:      #0d1117;
  --gray-90:    #1a1f27;
  --gray-70:    #4a5568;
  --gray-50:    #718096;
  --gray-30:    #a0aec0;
  --gray-10:    #edf2f7;
  --gray-05:    #f7fafc;
  --white:      #ffffff;
  --red:        #e53e3e;
  --orange:     #f6ad55;
  --blue:       #3182ce;

  --radius-sm:  6px;
  --radius-md:  12px;
  --radius-lg:  20px;
  --radius-xl:  28px;

  --shadow-sm:  0 1px 3px rgba(0,0,0,.08), 0 1px 2px rgba(0,0,0,.05);
  --shadow-md:  0 4px 16px rgba(0,0,0,.09), 0 2px 6px rgba(0,0,0,.06);
  --shadow-lg:  0 10px 40px rgba(0,0,0,.12), 0 4px 12px rgba(0,0,0,.07);

  --font-sans:  'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --transition: .18s ease;
}

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

html { scroll-behavior: smooth; -webkit-font-smoothing: antialiased; }

body {
  font-family: var(--font-sans);
  font-size: 16px;
  line-height: 1.65;
  color: var(--black);
  background: var(--white);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

main { flex: 1; }
img  { display: block; max-width: 100%; }
a    { color: inherit; text-decoration: none; }

/* ── Container ──────────────────────────────────────── */
.container {
  max-width: 1180px;
  margin: 0 auto;
  padding: 0 24px;
}

/* ── Typography ─────────────────────────────────────── */
h1, h2, h3, h4 {
  font-weight: 800;
  line-height: 1.2;
  letter-spacing: -.025em;
  color: var(--black);
}
h1 { font-size: clamp(2rem, 5vw, 3.25rem); }
h2 { font-size: clamp(1.5rem, 3vw, 2.25rem); }
h3 { font-size: 1.25rem; }
.article-body h3 { color: var(--green-dark); }
h4 { font-size: 1.05rem; }

p { color: var(--gray-70); margin-bottom: 1rem; }
p:last-child { margin-bottom: 0; }

/* ── Buttons ────────────────────────────────────────── */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-family: var(--font-sans);
  font-size: .95rem;
  font-weight: 700;
  padding: 12px 28px;
  border-radius: var(--radius-xl);
  border: 2px solid transparent;
  cursor: pointer;
  transition: background var(--transition), color var(--transition), transform var(--transition), box-shadow var(--transition);
  white-space: nowrap;
}
.btn-primary {
  background: var(--green);
  color: var(--black);
}
.btn-primary:hover {
  background: var(--green-dark);
  color: var(--white);
  box-shadow: 0 4px 20px rgba(254,60,0,.35);
}
.btn-outline {
  border-color: var(--gray-10);
  color: var(--gray-90);
  background: transparent;
}
.btn-outline:hover {
  background: var(--gray-05);
  border-color: var(--gray-30);
}
.btn-ghost {
  color: var(--green-dark);
  font-weight: 700;
  padding: 0;
}
.btn-ghost:hover { color: var(--green); }

/* ── Reading progress bar ────────────────────────────── */
#reading-progress {
  position: fixed;
  top: 0;
  left: 0;
  width: 0%;
  height: 3px;
  background: var(--green-dark);
  z-index: 9999;
  transition: width .1s linear;
  pointer-events: none;
}

/* ── Header / Nav ───────────────────────────────────── */
header {
  background: rgba(255,255,255,.95);
  border-bottom: 1px solid var(--gray-10);
}

header nav {
  display: flex;
  align-items: center;
  gap: 8px;
  height: 62px;
}

.logo {
  font-size: 1.35rem;
  font-weight: 900;
  letter-spacing: -.04em;
  color: var(--black);
  margin-right: 16px;
  flex-shrink: 0;
}
.logo span { color: var(--green-dark); }

.nav-links {
  display: flex;
  list-style: none;
  gap: 2px;
  flex: 1;
}
.nav-links a {
  display: block;
  padding: 7px 14px;
  font-size: .9rem;
  font-weight: 600;
  color: var(--gray-70);
  border-radius: var(--radius-md);
  transition: background var(--transition), color var(--transition);
}
.nav-links a:hover,
.nav-links a.active {
  background: var(--gray-10);
  color: var(--black);
}

.nav-cta {
  margin-left: auto;
  flex-shrink: 0;
}
.nav-cta .btn { padding: 8px 20px; font-size: .88rem; }

.nav-hamburger {
  display: none;
  margin-left: auto;
  background: none;
  border: none;
  cursor: pointer;
  font-size: 1.25rem;
  color: var(--black);
  padding: 8px;
  z-index: 600;
  position: relative;
}

/* ── Hero ───────────────────────────────────────────── */
.hero {
  padding: 80px 0 72px;
  background: var(--white);
}
.hero-inner {
  max-width: 780px;
}
.hero-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: var(--green-bg);
  color: var(--green-dark);
  font-size: .8rem;
  font-weight: 700;
  padding: 5px 12px;
  border-radius: 99px;
  margin-bottom: 24px;
  letter-spacing: .03em;
  text-transform: uppercase;
}
.hero h1 { margin-bottom: 20px; }
.hero h1 .highlight { color: var(--green-dark); }
.hero-sub {
  font-size: 1.2rem;
  color: var(--gray-50);
  margin-bottom: 36px;
  max-width: 560px;
  line-height: 1.7;
}
.hero-actions {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
}
.hero-stats {
  display: flex;
  gap: 40px;
  margin-top: 56px;
  padding-top: 40px;
  border-top: 1px solid var(--gray-10);
  flex-wrap: wrap;
}
.stat-item {}
.stat-num {
  font-size: 1.75rem;
  font-weight: 900;
  color: var(--black);
  letter-spacing: -.04em;
}
.stat-num.green { color: var(--green-dark); }
.stat-label {
  font-size: .82rem;
  color: var(--gray-50);
  font-weight: 500;
  margin-top: 2px;
}

/* ── Section Labels ─────────────────────────────────── */
.section-label {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: .78rem;
  font-weight: 800;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: var(--green-dark);
  margin-bottom: 16px;
}
.section-label::after {
  content: '';
  flex: 1;
  height: 1px;
  background: var(--gray-10);
  max-width: 60px;
}

/* ── Section ────────────────────────────────────────── */
.section {
  padding: 72px 0;
}
.section-sm {
  padding: 48px 0;
}
.section-gray { background: var(--gray-05); }
.section-dark {
  background: var(--black);
  color: var(--white);
}
.section-header {
  margin-bottom: 48px;
}
.section-header h2 { margin-bottom: 12px; }
.section-header p {
  font-size: 1.1rem;
  color: var(--gray-50);
  max-width: 560px;
}
.section-dark .section-header p { color: rgba(255,255,255,.5); }

/* ── Cards ──────────────────────────────────────────── */
.card {
  background: var(--white);
  border: 1px solid var(--gray-10);
  border-radius: var(--radius-lg);
  padding: 28px;
  transition: box-shadow var(--transition), border-color var(--transition);
}
.card:hover {
  box-shadow: var(--shadow-md);
  border-color: var(--gray-30);
}

/* Article card */
.article-card {
  background: var(--white);
  border: 1px solid var(--gray-10);
  border-radius: var(--radius-lg);
  padding: 24px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  transition: box-shadow var(--transition), border-color var(--transition);
  text-decoration: none;
  color: inherit;
}
.article-card:hover {
  box-shadow: var(--shadow-md);
  border-color: rgba(0,200,5,.25);
}

.article-card-img {
  margin: -24px -24px 16px;
  height: 180px;
  overflow: hidden;
  border-radius: var(--radius-lg) var(--radius-lg) 0 0;
}
.article-card-img img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: transform .35s ease;
}
.article-card:hover .article-card-img img {
  transform: scale(1.04);
}

.article-card-meta {
  display: flex;
  align-items: center;
  gap: 8px;
}
.category-chip {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: .75rem;
  font-weight: 700;
  padding: 3px 10px;
  border-radius: 99px;
  background: var(--green-bg);
  color: var(--green-dark);
  text-transform: uppercase;
  letter-spacing: .04em;
}
.read-time {
  font-size: .78rem;
  color: var(--gray-30);
  font-weight: 500;
}
.article-card h3 {
  font-size: 1.05rem;
  line-height: 1.35;
  color: var(--black);
}
.article-card p {
  font-size: .88rem;
  color: var(--gray-50);
  line-height: 1.55;
  margin: 0;
}
.article-card-footer {
  margin-top: auto;
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: .83rem;
  font-weight: 700;
  color: var(--green-dark);
}

/* ── Category cards ─────────────────────────────────── */
.cat-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
}
.cat-card {
  display: flex;
  flex-direction: column;
  gap: 14px;
  padding: 28px 24px;
  border-radius: var(--radius-lg);
  border: 1px solid var(--gray-10);
  background: var(--white);
  text-decoration: none;
  color: inherit;
  transition: box-shadow var(--transition), border-color var(--transition);
  cursor: pointer;
}
.cat-card:hover {
  box-shadow: var(--shadow-md);
  border-color: rgba(254,60,0,.3);
}
.cat-icon {
  width: 48px;
  height: 48px;
  background: var(--green);
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--black);
  font-size: 1.25rem;
  flex-shrink: 0;
}
.cat-card h3 {
  font-size: 1.1rem;
  color: var(--black);
}
.cat-card p {
  font-size: .85rem;
  color: var(--gray-50);
  margin: 0;
}
.cat-count {
  font-size: .78rem;
  font-weight: 700;
  color: var(--green-dark);
  margin-top: auto;
}

/* ── Article grid ───────────────────────────────────── */
.articles-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;
}
.articles-grid-2 {
  grid-template-columns: repeat(2, 1fr);
}

/* ── Featured article ───────────────────────────────── */
.featured-article {
  background: var(--black);
  border-radius: var(--radius-xl);
  padding: 48px;
  color: var(--white);
  position: relative;
  overflow: hidden;
  text-decoration: none;
  display: block;
}
.featured-article::before {
  content: '';
  position: absolute;
  top: -80px; right: -80px;
  width: 320px; height: 320px;
  background: radial-gradient(circle, rgba(212,243,8,.2) 0%, transparent 70%);
  pointer-events: none;
}
.featured-article .category-chip {
  background: rgba(212,243,8,.15);
  color: var(--green);
  margin-bottom: 16px;
}
.featured-article h2 {
  font-size: clamp(1.4rem, 3vw, 2rem);
  color: var(--white);
  margin-bottom: 16px;
  max-width: 600px;
}
.featured-article p {
  font-size: 1rem;
  color: rgba(255,255,255,.6);
  max-width: 560px;
  margin-bottom: 28px;
}
.featured-article .btn-primary {
  background: var(--green);
}

/* ── Rule callout block ─────────────────────────────── */
.rule-highlight {
  background: var(--green-bg);
  border-left: 4px solid var(--green);
  border-radius: 0 var(--radius-md) var(--radius-md) 0;
  padding: 20px 24px;
  margin: 32px 0;
}
.rule-highlight strong {
  display: block;
  font-size: 1.1rem;
  color: var(--black);
  margin-bottom: 6px;
}
.rule-highlight p {
  font-size: .93rem;
  color: var(--gray-70);
  margin: 0;
}

/* ── Article content page ───────────────────────────── */
.article-header {
  max-width: 784px;
  margin: 0 auto 40px;
  padding-top: 40px;
}
.article-header .category-chip { margin-bottom: 16px; }
.article-header h1 {
  font-size: clamp(1.8rem, 4vw, 2.6rem);
  margin-bottom: 20px;
}
.article-headline {
  font-size: 1.2rem;
  color: var(--gray-50);
  line-height: 1.6;
  margin-bottom: 24px;
  font-weight: 400;
}
.article-byline {
  display: flex;
  align-items: center;
  gap: 12px;
  padding-top: 20px;
  border-top: 1px solid var(--gray-10);
}
.author-avatar {
  width: 36px; height: 36px;
  background: var(--green);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: .8rem;
  font-weight: 800;
  color: var(--black);
  flex-shrink: 0;
}
.byline-text { font-size: .85rem; color: var(--gray-50); }
.byline-text strong { color: var(--black); display: block; font-size: .9rem; }

.article-hero-full {
  width: 100%;
  max-height: 520px;
  overflow: hidden;
  margin-bottom: 48px;
}
.article-hero-full img {
  width: 100%;
  height: 520px;
  object-fit: cover;
  display: block;
}

.article-sidebar-below {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 24px;
  padding: 48px 0 56px;
  border-top: 1px solid var(--gray-10);
  margin-top: 56px;
}

.article-body {
  max-width: 784px;
  margin-left: auto;
  margin-right: auto;
  padding: 0 0 56px;
}

.article-body h2 {
  font-size: 1.4rem;
  margin: 36px 0 16px;
  color: var(--black);
}
.article-body h2:first-child { margin-top: 0; }
.article-body p {
  font-size: 1.05rem;
  line-height: 1.8;
  color: var(--gray-70);
  margin-bottom: 1.2rem;
}
.article-body ul, .article-body ol {
  padding-left: 1.6rem;
  margin-bottom: 1.2rem;
}
.article-body li {
  font-size: 1.05rem;
  color: var(--gray-70);
  margin-bottom: .5rem;
  line-height: 1.7;
}
.article-body strong { color: var(--black); font-weight: 700; }
.article-body em { font-style: italic; }
.article-body a { color: var(--green-dark); font-weight: 600; text-decoration: underline; }

/* Tables */
.article-body table {
  width: 100%;
  border-collapse: collapse;
  margin: 24px 0;
  font-size: .93rem;
  border-radius: var(--radius-md);
  overflow: hidden;
  border: 1px solid var(--gray-10);
}
.article-body thead { background: var(--black); }
.article-body thead th {
  color: white;
  padding: 12px 16px;
  text-align: left;
  font-weight: 700;
  font-size: .85rem;
  letter-spacing: .02em;
}
.article-body tbody tr:nth-child(even) { background: var(--gray-05); }
.article-body td {
  padding: 12px 16px;
  color: var(--gray-70);
  border-bottom: 1px solid var(--gray-10);
}
.article-body td strong { color: var(--black); }

/* Sidebar (old sticky — kept for reference) */
.article-sidebar {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.sidebar-card {
  background: var(--white);
  border: 1px solid var(--gray-10);
  border-radius: var(--radius-lg);
  padding: 24px;
}
.sidebar-card h4 {
  font-size: .82rem;
  text-transform: uppercase;
  display: flex;
  align-items: center;
  gap: 8px;
  letter-spacing: .06em;
  color: var(--gray-30);
  margin-bottom: 16px;
}
.sidebar-links {
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.sidebar-link {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 10px 12px;
  border-radius: var(--radius-sm);
  font-size: .88rem;
  font-weight: 600;
  color: var(--gray-70);
  text-decoration: none;
  transition: background var(--transition), color var(--transition);
  line-height: 1.4;
}
.sidebar-link:hover { background: var(--gray-05); color: var(--black); }
.sidebar-link::before {
  content: '→';
  color: var(--green-dark);
  flex-shrink: 0;
  margin-top: 1px;
}

/* ── Category page ──────────────────────────────────── */
.cat-hero {
  padding: 64px 0 48px;
  border-bottom: 1px solid var(--gray-10);
}
.cat-hero-icon {
  width: 64px;
  height: 64px;
  background: var(--green);
  border-radius: var(--radius-lg);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--black);
  font-size: 1.75rem;
  margin-bottom: 20px;
}
.cat-hero h1 { font-size: clamp(1.8rem, 4vw, 2.6rem); margin-bottom: 12px; }
.cat-hero p { font-size: 1.1rem; color: var(--gray-50); max-width: 520px; }

/* ── Newsletter / CTA strip ─────────────────────────── */
.cta-strip {
  background: var(--black);
  color: var(--white);
  padding: 60px 0;
  text-align: center;
}
.cta-strip h2 {
  color: var(--white);
  margin-bottom: 12px;
  font-size: 2rem;
}
.cta-strip p {
  color: rgba(255,255,255,.55);
  font-size: 1rem;
  margin-bottom: 32px;
  max-width: 480px;
  margin-left: auto;
  margin-right: auto;
}
.cta-form {
  display: flex;
  gap: 8px;
  justify-content: center;
  flex-wrap: wrap;
}
.cta-form input[type=email] {
  padding: 12px 20px;
  border-radius: var(--radius-xl);
  border: 1.5px solid rgba(255,255,255,.15);
  background: rgba(255,255,255,.07);
  color: white;
  font-size: .95rem;
  width: 280px;
  outline: none;
  transition: border-color var(--transition);
}
.cta-form input[type=email]::placeholder { color: rgba(255,255,255,.35); }
.cta-form input[type=email]:focus { border-color: var(--green); }

/* ── Ticker strip ───────────────────────────────────── */
.ticker-strip {
  background: var(--black);
  color: var(--white);
  padding: 10px 0;
  font-size: .8rem;
  font-weight: 600;
  overflow: hidden;
  border-bottom: 1px solid rgba(255,255,255,.06);
}
.ticker-inner {
  display: flex;
  gap: 48px;
  animation: ticker-scroll 30s linear infinite;
  white-space: nowrap;
  width: max-content;
}
.ticker-item { display: flex; align-items: center; gap: 8px; }
.ticker-sym { color: rgba(255,255,255,.6); }
.ticker-val { color: white; }
.ticker-up { color: var(--green); }
.ticker-down { color: var(--red); }

@keyframes ticker-scroll {
  0%   { transform: translateX(0); }
  100% { transform: translateX(-50%); }
}

/* ── Rule number cards ───────────────────────────────── */
.rules-featured-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
}
.rule-num-card {
  background: var(--white);
  border: 1px solid var(--gray-10);
  border-radius: var(--radius-lg);
  padding: 28px 24px;
  text-decoration: none;
  display: flex;
  flex-direction: column;
  gap: 12px;
  transition: box-shadow var(--transition), border-color var(--transition);
}
.rule-num-card:hover {
  box-shadow: var(--shadow-md);
  border-color: rgba(254,60,0,.3);
}
.rule-fraction {
  font-size: 2rem;
  font-weight: 900;
  color: var(--green-dark);
  letter-spacing: -.04em;
  line-height: 1;
}
.rule-num-card h3 {
  font-size: 1rem;
  color: var(--black);
  line-height: 1.3;
}
.rule-num-card p {
  font-size: .83rem;
  color: var(--gray-50);
  margin: 0;
}

/* ── Breadcrumb ─────────────────────────────────────── */
.breadcrumb {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: .82rem;
  color: var(--gray-30);
  padding: 16px 0;
  flex-wrap: wrap;
}
.breadcrumb a { color: var(--gray-50); font-weight: 600; }
.breadcrumb a:hover { color: var(--black); }
.breadcrumb-sep { color: var(--gray-30); }

/* ── Footer ─────────────────────────────────────────── */
footer {
  background: var(--black);
  color: rgba(255,255,255,.55);
  padding: 56px 0 32px;
  margin-top: auto;
}
.footer-top {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr 1fr;
  gap: 40px;
  padding-bottom: 48px;
  border-bottom: 1px solid rgba(255,255,255,.07);
}
.footer-brand .logo {
  color: white;
  display: block;
  margin-bottom: 12px;
}
.footer-brand p {
  font-size: .88rem;
  color: rgba(255,255,255,.4);
  max-width: 260px;
  line-height: 1.7;
  margin: 0;
}
.footer-col h4 {
  color: rgba(255,255,255,.75);
  font-size: .85rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .08em;
  margin-bottom: 16px;
}
.footer-col a {
  display: block;
  color: rgba(255,255,255,.4);
  font-size: .88rem;
  margin-bottom: 9px;
  transition: color var(--transition);
}
.footer-col a:hover { color: white; }

.footer-bottom {
  padding-top: 28px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
  font-size: .82rem;
}
.footer-disclaimer {
  font-size: .78rem;
  color: rgba(255,255,255,.25);
  font-style: italic;
  max-width: 600px;
  line-height: 1.5;
  margin-top: 12px;
}

/* ── Utility ────────────────────────────────────────── */
.text-green { color: var(--green-dark); }
.text-muted { color: var(--gray-50); }
.mt-0 { margin-top: 0 !important; }
.mb-0 { margin-bottom: 0 !important; }
.mb-8 { margin-bottom: 8px; }
.flex { display: flex; }
.items-center { align-items: center; }
.gap-12 { gap: 12px; }
.justify-between { justify-content: space-between; }

/* ── Responsive ─────────────────────────────────────── */
@media (max-width: 1024px) {
  .cat-grid { grid-template-columns: repeat(2, 1fr); }
  .articles-grid { grid-template-columns: repeat(2, 1fr); }
  .rules-featured-grid { grid-template-columns: repeat(2, 1fr); }
  .article-sidebar-below { grid-template-columns: 1fr 1fr; }
  .footer-top { grid-template-columns: 1fr 1fr; }
}

@media (max-width: 640px) {
  .container { padding: 0 16px; }
  .hero { padding: 48px 0 40px; }
  .hero-stats { gap: 24px; }
  .cat-grid { grid-template-columns: 1fr 1fr; }
  .articles-grid { grid-template-columns: 1fr; }
  .articles-grid-2 { grid-template-columns: 1fr; }
  .rules-featured-grid { grid-template-columns: 1fr; }
  .article-sidebar-below { grid-template-columns: 1fr; }
  .article-hero-full { max-height: 280px; }
  .article-hero-full img { height: 280px; }
  .footer-top { grid-template-columns: 1fr; gap: 28px; }
  .footer-bottom { flex-direction: column; text-align: center; }
  .nav-links { display: none; }
  .nav-links.open {
    display: flex;
    flex-direction: column;
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background: #fff;
    z-index: 500;
    padding: 80px 32px 40px;
    gap: 4px;
  }
  .nav-links.open a {
    font-size: 1.4rem;
    font-weight: 700;
    padding: 14px 0;
    border-bottom: 1px solid var(--gray-10);
    border-radius: 0;
  }
  .nav-hamburger { display: flex; }
  .nav-cta { display: none; }
  .featured-article { padding: 28px; }

  /* Tables: scrollable on mobile */
  .table-scroll {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    margin: 24px 0;
  }
  .table-scroll table { margin: 0; width: max-content; min-width: 100%; }
  .article-body th,
  .article-body td { white-space: nowrap; padding: 10px 12px; font-size: .82rem; }
}

/* ── Back to top button ──────────────────────────────── */
#back-to-top {
  position: fixed;
  bottom: 28px;
  right: 24px;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: var(--green-dark);
  color: #fff;
  border: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
  box-shadow: 0 4px 16px rgba(0,0,0,.18);
  opacity: 0;
  transform: translateY(12px);
  transition: opacity .2s, transform .2s;
  pointer-events: none;
  z-index: 900;
}
#back-to-top.visible {
  opacity: 1;
  transform: translateY(0);
  pointer-events: auto;
}
#back-to-top:hover {
  background: #d43000;
}

/* ── Related articles ────────────────────────────────── */
.related-articles {
  background: var(--gray-05);
  border-top: 1px solid var(--gray-10);
  padding: 48px 0;
  margin-top: 48px;
}
.related-articles-title {
  font-size: 1.25rem;
  font-weight: 800;
  color: var(--black);
  text-align: center;
  margin-bottom: 32px;
  padding-bottom: 16px;
}
.related-articles-title::after {
  content: '';
  display: block;
  width: 40px;
  height: 3px;
  background: var(--green-dark);
  border-radius: 99px;
  margin: 10px auto 0;
}
.related-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;
}
@media (max-width: 768px) {
  .related-grid { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 480px) {
  .related-grid { grid-template-columns: 1fr; }
}
