:root {
  --rd-navy:    #042b56;
  --rd-accent:  #4aa8ff;
  --rd-white:   #ffffff;
  --rd-muted:   #5a7a9a;
  --rd-border:  #e5e9f0;
  --rd-page-bg: #f5f7fa;
  --rd-card-bg: #ffffff;
  --rd-navbar-h: 72px;   /* adjust if your navbar is taller/shorter */
}

*, *::before, *::after { box-sizing: border-box; }
a { text-decoration: none; color: inherit; transition: color .2s; }

/* ─── PAGE SHELL ───────────────────────────────────── */
.rd-page {
  background: var(--rd-page-bg);
  color: var(--rd-navy);
  font-family: 'DM Sans', sans-serif;
  -webkit-font-smoothing: antialiased;
  min-height: 100vh;
}

/* ─── BANNER ───────────────────────────────────────── */
.rd-banner {
  position: relative;
  overflow: hidden;
  padding: 68px 40px 60px;
  background: linear-gradient(135deg, #010d1f 0%, #021830 40%, #042d5a 75%, #063a72 100%);
}

.rd-banner::before {
  content: '';
  position: absolute;
  inset: 0;
  pointer-events: none;
  background-image:
    linear-gradient(rgba(255,255,255,0.018) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255,255,255,0.018) 1px, transparent 1px);
  background-size: 60px 60px;
}

.rd-banner::after {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(100,180,255,0.5), transparent);
}

.rd-banner-particles {
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: 0;
}

.rd-banner-particles span {
  position: absolute;
  border-radius: 50%;
  background: rgba(100,180,255,0.35);
  animation: rdFloat linear infinite;
}

@keyframes rdFloat {
  0%   { transform: translateY(0) translateX(0); opacity: 0; }
  10%  { opacity: 1; }
  90%  { opacity: 0.35; }
  100% { transform: translateY(-110px) translateX(35px); opacity: 0; }
}

.rd-banner-inner {
  position: relative;
  max-width: 900px;
  margin: 0 auto;
  animation: rdFadeUp .6s ease .05s both;
}

@keyframes rdFadeUp {
  from { opacity: 0; transform: translateY(22px); }
  to   { opacity: 1; transform: translateY(0); }
}

.rd-back {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  color: rgba(200,216,235,0.7);
  font-size: 13px;
  font-weight: 600;
  margin-bottom: 22px;
  transition: color .2s;
}
.rd-back:hover { color: var(--rd-accent); }

.rd-banner-title {
  font-size: clamp(24px, 3.5vw, 42px);
  font-weight: 600;
  color: var(--rd-white);
  line-height: 1.28;
  margin: 0 0 20px;
  letter-spacing: -.4px;
}

.rd-banner-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
  font-size: 13px;
  color: rgba(200,216,235,0.75);
  margin-bottom: 14px;
}
.rd-banner-meta span { display: inline-flex; align-items: center; gap: 6px; }

.rd-banner-tags { display: flex; flex-wrap: wrap; gap: 7px; margin-top: 6px; }
.rd-tag {
  display: inline-block;
  font-size: 12px; font-weight: 600;
  padding: 4px 12px;
  border-radius: 999px;
  background: rgba(74,168,255,0.15);
  color: #90cdf4;
  border: 1px solid rgba(74,168,255,0.28);
}

/* ─── CONTENT WRAPPER (constrains everything below banner) ── */
.rd-content-wrap {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 24px 80px;
}

/* ─── COVER IMAGE ───────────────────────────────────── */
.rd-cover-wrap {
  margin-top: -36px;          /* pulls up over the banner bottom edge */
  margin-bottom: 36px;
  border-radius: 16px;
  overflow: hidden;
  box-shadow: 0 8px 40px rgba(4,43,86,0.18);
  border: 1px solid var(--rd-border);
  position: relative;
  z-index: 2;
}

.rd-cover-img {
  width: 100%;
  aspect-ratio: 1200 / 630;
  object-fit: contain;
  background: #f1f5f9;
  display: block;
  transition: transform .5s ease;
}
.rd-cover-wrap:hover .rd-cover-img { transform: scale(1.02); }

/* ─── BODY FLEX (TOC + MAIN) ────────────────────────── */
.rd-body {
  display: flex;
  gap: 32px;
  align-items: flex-start;
}

/* ─── TOC SIDEBAR ───────────────────────────────────── */
.rd-toc {
  flex: 0 0 220px;
  position: sticky;
  top: calc(var(--rd-navbar-h) + 16px);
  max-height: calc(100vh - var(--rd-navbar-h) - 32px);
  overflow-y: auto;
  background: var(--rd-card-bg);
  border: 1px solid var(--rd-border);
  border-radius: 14px;
  padding: 20px;
  box-shadow: 0 2px 12px rgba(4,43,86,0.06);
  scrollbar-width: thin;
  scrollbar-color: #d0d7de transparent;
}
.rd-toc::-webkit-scrollbar { width: 3px; }
.rd-toc::-webkit-scrollbar-thumb { background: #d0d7de; border-radius: 10px; }

.rd-toc-label {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 1.8px;
  text-transform: uppercase;
  color: #118af2;
  display: flex;
  align-items: center;
  gap: 7px;
  padding-bottom: 12px;
  margin-bottom: 12px;
  border-bottom: 1px solid var(--rd-border);
}

.rd-toc ul {
  list-style: none;
  margin: 0; padding: 0;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.rd-toc li a {
  display: block;
  font-size: 13px;
  color: var(--rd-muted);
  padding: 6px 10px;
  border-radius: 7px;
  border-left: 2px solid transparent;
  line-height: 1.4;
  transition: background .15s, color .15s, border-color .15s;
}
.rd-toc li a:hover,
.rd-toc li a.active {
  background: rgba(74,168,255,0.08);
  color: var(--rd-navy);
  border-left-color: var(--rd-accent);
}

/* ─── MAIN COLUMN ───────────────────────────────────── */
.rd-main {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 28px;
}

/* ─── ARTICLE ───────────────────────────────────────── */
.rd-article {
  background: var(--rd-card-bg);
  border: 1px solid var(--rd-border);
  border-radius: 16px;
  padding: 40px 48px;
  box-shadow: 0 2px 12px rgba(4,43,86,0.05);
  font-size: 16px;
  line-height: 1.88;
  color: var(--rd-navy);
}

.rd-article h2,
.rd-article h3 {
  font-weight: 700;
  color: var(--rd-navy);
  line-height: 1.3;
  margin: 2.2rem 0 .9rem;
  position: relative;
  padding-bottom: 10px;
}
.rd-article h2 { font-size: 24px; }
.rd-article h3 { font-size: 20px; }

.rd-article h2::after,
.rd-article h3::after {
  content: '';
  position: absolute;
  left: 0; bottom: 0;
  width: 40px; height: 3px;
  background: var(--rd-accent);
  border-radius: 2px;
}

.rd-article p               { margin: 0 0 1.1rem; }
.rd-article ul,
.rd-article ol              { margin: 0 0 1.1rem; padding-left: 1.5rem; }
.rd-article li              { margin-bottom: .4rem; }
.rd-article a               { color: #1f5e9d; font-weight: 500; text-decoration: underline; text-decoration-color: rgba(74,168,255,.35); }
.rd-article a:hover         { color: var(--rd-accent); }
.rd-article blockquote      { margin: 1.5rem 0; padding: 16px 20px; background: rgba(74,168,255,.06); border-left: 4px solid var(--rd-accent); border-radius: 0 10px 10px 0; font-style: italic; color: #374e6a; }
.rd-article img             { max-width: 100%; border-radius: 10px; margin: 1rem 0; }
.rd-article code            { background: #f0f4f8; border: 1px solid var(--rd-border); border-radius: 5px; padding: 2px 7px; font-size: 14px; font-family: monospace; }
.rd-article pre             { background: #0f172a; color: #e2e8f0; border-radius: 10px; padding: 20px; overflow-x: auto; font-size: 14px; margin: 1rem 0; }

/* ─── AUTHOR BOX ────────────────────────────────────── */
.rd-author {
  background: var(--rd-card-bg);
  border: 1px solid var(--rd-border);
  border-left: 4px solid var(--rd-accent);
  border-radius: 16px;
  padding: 28px 32px;
  box-shadow: 0 2px 12px rgba(4,43,86,0.05);
  display: flex;
  gap: 20px;
  align-items: flex-start;
  transition: box-shadow .2s, transform .2s;
}
.rd-author:hover { box-shadow: 0 6px 24px rgba(4,43,86,.10); transform: translateY(-2px); }

.rd-author-img {
  width: 70px; height: 70px;
  border-radius: 12px;
  object-fit: cover;
  flex-shrink: 0;
  border: 2px solid var(--rd-border);
}
.rd-author-ph {
  width: 70px; height: 70px;
  border-radius: 12px;
  background: linear-gradient(135deg, #0B335A, #1f5e9d);
  color: #fff;
  font-size: 26px; font-weight: 700;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
}
.rd-author-info { flex: 1; }
.rd-author-label {
  font-size: 11px; font-weight: 700;
  letter-spacing: 1.6px; text-transform: uppercase;
  color: #118af2; margin-bottom: 5px;
}
.rd-author-name { font-size: 17px; font-weight: 700; color: var(--rd-navy); margin-bottom: 4px; }
.rd-author-pos  { font-size: 13px; color: var(--rd-muted); margin-bottom: 10px; display: flex; align-items: center; gap: 6px; }
.rd-author-bio  { font-size: 14px; line-height: 1.7; color: #374e6a; margin: 0; }
.rd-author-more {
  color: #1f5e9d; font-weight: 600; font-size: 13px; margin-left: 4px;
  display: inline-flex; align-items: center; gap: 4px; transition: gap .15s;
}
.rd-author-more:hover { gap: 8px; }

/* ─── COMMENTS ──────────────────────────────────────── */
.rd-comments {
  background: var(--rd-card-bg);
  border: 1px solid var(--rd-border);
  border-radius: 16px;
  padding: 32px 36px;
  box-shadow: 0 2px 12px rgba(4,43,86,0.05);
  display: flex;
  flex-direction: column;
  gap: 22px;
}

.rd-comments-heading {
  font-size: 18px; font-weight: 700; color: var(--rd-navy);
  margin: 0; display: flex; align-items: center; gap: 10px;
}
.rd-count-badge {
  display: inline-flex; align-items: center; justify-content: center;
  background: rgba(74,168,255,.12); color: #0369a1;
  border: 1px solid rgba(74,168,255,.22);
  border-radius: 999px; font-size: 13px; font-weight: 700;
  min-width: 26px; height: 26px; padding: 0 7px;
}

.rd-comments-list { display: flex; flex-direction: column; gap: 12px; }

.rd-comment {
  display: flex; gap: 14px; align-items: flex-start;
  padding: 16px 18px;
  border: 1px solid var(--rd-border);
  border-radius: 12px;
  background: #fafbfd;
  transition: box-shadow .18s;
}
.rd-comment:hover { box-shadow: 0 4px 14px rgba(4,43,86,.07); }

.rd-comment-avatar {
  width: 36px; height: 36px; border-radius: 8px;
  background: linear-gradient(135deg, #0B335A, #1f5e9d);
  color: #fff; font-size: 15px; font-weight: 700;
  display: flex; align-items: center; justify-content: center; flex-shrink: 0;
}
.rd-comment-body { flex: 1; min-width: 0; }
.rd-comment-header { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; margin-bottom: 6px; }
.rd-comment-name  { font-size: 14px; font-weight: 700; color: var(--rd-navy); }
.rd-comment-date  { font-size: 12px; color: #94a3b8; }
.rd-comment-text  { font-size: 14px; line-height: 1.7; color: #374e6a; margin: 0; }

.rd-no-comments { text-align: center; padding: 28px 20px; color: #94a3b8; }
.rd-no-comments i { font-size: 30px; display: block; margin-bottom: 10px; }
.rd-no-comments p { font-size: 15px; margin: 0; }

.rd-comments-pagination {
  display: flex; align-items: center; justify-content: center; gap: 6px; flex-wrap: wrap;
}
.rd-pg-btn {
  display: inline-flex; align-items: center; justify-content: center;
  min-width: 36px; height: 36px; padding: 0 10px;
  border-radius: 8px; border: 1.5px solid var(--rd-border);
  background: #fff; color: var(--rd-navy); font-size: 14px; font-weight: 600;
  text-decoration: none; transition: all .18s;
}
.rd-pg-btn:hover { background: var(--rd-navy); color: #fff; border-color: var(--rd-navy); }
.rd-pg-btn.active { background: var(--rd-navy); color: #fff; border-color: var(--rd-navy); }

/* ─── COMMENT FORM ──────────────────────────────────── */
.rd-form-wrap {
  border-top: 1px solid var(--rd-border);
  padding-top: 22px;
}
.rd-form-title {
  font-size: 15px; font-weight: 700; color: var(--rd-navy);
  margin-bottom: 16px; display: flex; align-items: center; gap: 8px;
}
.rd-form         { display: flex; flex-direction: column; gap: 12px; }
.rd-form-row     { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.rd-input,
.rd-textarea {
  width: 100%;
  padding: 11px 15px;
  border: 1.5px solid var(--rd-border);
  border-radius: 10px;
  font-size: 14px; font-family: inherit;
  color: var(--rd-navy);
  background: #fafbfd;
  outline: none;
  transition: border-color .2s, box-shadow .2s;
}
.rd-input:focus,
.rd-textarea:focus { border-color: var(--rd-navy); box-shadow: none; outline: none; background: #fff; }
.rd-textarea       { resize: vertical; min-height: 110px; }

.rd-submit-btn {
  align-self: flex-start;
  padding: 11px 28px;
  background: linear-gradient(90deg, #0B335A, #1f5e9d);
  color: #fff; border: none; border-radius: 999px;
  font-size: 14px; font-weight: 600; cursor: pointer;
  display: inline-flex; align-items: center; gap: 8px;
  box-shadow: 0 3px 12px rgba(11,51,90,.2);
  transition: opacity .2s, transform .2s, box-shadow .2s;
}
.rd-submit-btn:hover { opacity: .9; transform: translateY(-2px); box-shadow: 0 6px 20px rgba(11,51,90,.25); }

/* ─── ALERTS ────────────────────────────────────────── */
.rd-alert          { padding: 11px 16px; border-radius: 9px; font-size: 14px; font-weight: 600; margin-bottom: 10px; }
.rd-alert--success { background: #dbeafe; color: #042b56; border-left: 3px solid #4aa8ff; }
.rd-alert--error   { background: #fee2e2; color: #dc2626; }

/* ─── AUTHOR MODAL ──────────────────────────────────── */
.rd-modal-bg {
  display: none;
  position: fixed; inset: 0;
  background: rgba(0,0,0,0.30);
  backdrop-filter: blur(4px);
  z-index: 9999;
  align-items: center; justify-content: center;
}
.rd-modal-bg.open { display: flex; }

.rd-modal {
  background: var(--rd-card-bg);
  border-radius: 18px; padding: 40px 36px;
  max-width: 520px; width: 92%;
  max-height: 86vh; overflow-y: auto;
  box-shadow: 0 20px 60px rgba(4,43,86,.25);
  position: relative; text-align: center;
  animation: rdModalIn .32s ease both;
}
@keyframes rdModalIn {
  from { opacity: 0; transform: translateY(-20px) scale(.97); }
  to   { opacity: 1; transform: translateY(0) scale(1); }
}

.rd-modal-close {
  position: absolute; top: 14px; right: 14px;
  background: none; border: none; font-size: 16px; color: #94a3b8; cursor: pointer;
  width: 30px; height: 30px; border-radius: 8px;
  display: flex; align-items: center; justify-content: center;
  transition: background .15s, color .15s;
}
.rd-modal-close:hover { background: #fee2e2; color: #dc2626; }

.rd-modal-photo {
  width: 96px; height: 96px; border-radius: 14px; object-fit: cover;
  display: block; margin: 0 auto 16px; border: 3px solid var(--rd-border);
}
.rd-modal-ph {
  width: 96px; height: 96px; border-radius: 14px;
  background: linear-gradient(135deg, #0B335A, #1f5e9d);
  color: #fff; font-size: 36px; font-weight: 700;
  display: flex; align-items: center; justify-content: center;
  margin: 0 auto 16px;
}
.rd-modal-name { font-size: 20px; font-weight: 700; color: var(--rd-navy); margin: 0 0 6px; }
.rd-modal-pos  { font-size: 13px; color: var(--rd-muted); margin: 0 0 20px; }
.rd-modal-bio  { font-size: 15px; line-height: 1.75; color: #374e6a; text-align: left; margin: 0; }

/* ─── FLOATING SHARE ────────────────────────────────── */
.rd-share-wrap {
  position: fixed; bottom: 88px; right: 26px;
  display: flex; flex-direction: column; align-items: center; gap: 10px;
  z-index: 1000;
}
.rd-share-toggle {
  width: 50px; height: 50px; border-radius: 50%;
  background: linear-gradient(135deg, #0B335A, #1f5e9d);
  color: #fff; font-size: 17px; border: none; cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  box-shadow: 0 6px 20px rgba(4,43,86,.25);
  transition: transform .25s, box-shadow .2s;
}
.rd-share-toggle:hover { transform: scale(1.08); box-shadow: 0 10px 26px rgba(4,43,86,.3); }

.rd-share-panel {
  display: flex; flex-direction: column; gap: 9px;
  opacity: 0; transform: translateY(14px);
  pointer-events: none; transition: opacity .3s, transform .3s;
}
.share-wrapper.active .rd-share-panel { opacity: 1; transform: translateY(0); pointer-events: auto; }

.rd-share-panel a {
  width: 42px; height: 42px; border-radius: 50%;
  background: var(--rd-card-bg); color: var(--rd-navy); font-size: 16px;
  display: flex; align-items: center; justify-content: center;
  box-shadow: 0 3px 12px rgba(4,43,86,.13);
  transition: background .2s, color .2s, transform .2s;
}
.rd-share-panel a:hover { background: linear-gradient(135deg, #0B335A, #1f5e9d); color: #fff; transform: translateY(-3px); }

/* ─── INLINE PROMO BANNER ──────────────────────────── */
.rd-promo {
  display: flex;
  align-items: center;
  gap: 20px;
  background: #042b56;
  border-radius: 14px;
  padding: 18px 22px;
  margin: 36px 0;
  border: 1px solid rgba(255,255,255,0.08);
  box-shadow: 0 6px 24px rgba(11,51,90,0.28);
  text-decoration: none;
}
.rd-promo-logo {
  width: 64px;
  height: 64px;
  flex-shrink: 0;
  border-radius: 12px;
  background: transparent;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 8px 12px;
}
.rd-promo-logo img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  display: block;
}
.rd-promo-body {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  justify-content: center;
}
.rd-promo-title {
  font-size: 18px;
  font-weight: 600;
  color: #fff;
  margin: 0 0 5px;
  line-height: 1.35;
}
.rd-promo-sub {
  font-size: 14px;
  font-weight: 500;
  color: rgba(255,255,255,0.55);
  margin: 0;
  line-height: 1.5;
}
.rd-promo-sub a {
  color: #a8d8f8;
  text-decoration: none;
  font-weight: 600;
}
.rd-promo-divider {
  width: 2px;
  align-self: stretch;
  background: rgba(255,255,255,0.18);
  flex-shrink: 0;
  margin: 0 6px;
  border-radius: 1px;
}
.rd-promo-btn {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  background: transparent;
  color: #118af2;
  font-size: 15px;
  font-weight: 500;
  padding: 0;
  white-space: nowrap;
  flex-shrink: 0;
  transition: opacity .15s, gap .15s;
}
.rd-article .rd-promo-title { margin: 0 0 6px; }
.rd-article .rd-promo-sub   { margin: 0; }
.rd-article .rd-promo-btn,
.rd-article .rd-promo-btn:hover,
.rd-article .rd-promo-sub a,
.rd-article .rd-promo-sub a:hover {
  color: #118af2;
  text-decoration: none;
  font-weight: 700;
}
.rd-promo-btn-icon {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: #118af2;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  font-size: 16px;
  flex-shrink: 0;
  line-height: 1;
}
@media (max-width: 600px) {
  .rd-promo { flex-wrap: wrap; gap: 14px; }
  .rd-promo-btn { width: 100%; justify-content: center; }
}

/* ─── RESPONSIVE ────────────────────────────────────── */
@media (max-width: 1024px) {
  .rd-toc { flex: 0 0 190px; }
  .rd-article { padding: 32px 36px; }
}

@media (max-width: 860px) {
  .rd-banner      { padding: 52px 20px 48px; }
  .rd-content-wrap { padding: 0 16px 60px; }
  .rd-cover-wrap  { margin-top: -24px; margin-bottom: 24px; }
  .rd-body        { flex-direction: column; gap: 20px; }
  .rd-toc         { position: static; flex: none; max-height: none; width: 100%; }
  .rd-article     { padding: 24px 20px; font-size: 15px; }
  .rd-comments    { padding: 22px 18px; }
  .rd-author      { padding: 20px 18px; gap: 16px; }
  .rd-form-row    { grid-template-columns: 1fr; }
  .rd-share-wrap  { bottom: 20px; right: 16px; }
}

@media (max-width: 480px) {
  .rd-banner      { padding: 44px 16px 42px; }
  .rd-banner-title { font-size: clamp(20px, 6vw, 28px); }
  .rd-cover-wrap  { border-radius: 12px; margin-top: -18px; }
  .rd-article     { padding: 18px 14px; }
  .rd-author      { flex-direction: column; }
  .rd-modal       { padding: 28px 20px; }
}
