:root {
  --page-blue: #6096ba;
  --page-blue-dark: #274c77;
  --page-ink: #274c77;
  --page-muted: #8b8c89;
  --page-bg: #e7ecef;
  --page-surface: rgba(255,255,255,0.92);
  --page-border: rgba(39,76,119,0.10);
  --page-shadow: 0 24px 60px rgba(39,76,119,0.08);
  --page-radius: 24px;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: 'Inter', sans-serif;
  color: var(--page-ink);
  background: radial-gradient(circle at top left, rgba(96,150,186,0.08), transparent 28%), var(--page-bg);
  line-height: 1.65;
}

html { scroll-behavior: smooth; }
a { color: inherit; text-decoration: none; }
img { max-width: 100%; display: block; }

.wrap { max-width: 1180px; margin: 0 auto; padding: 0 24px; }

.page-hero { padding: 64px 0 42px; }
.page-hero-inner { background: var(--page-surface); border: 1px solid rgba(255,255,255,0.8); border-radius: var(--page-radius); box-shadow: var(--page-shadow); backdrop-filter: blur(20px); padding: 40px; }
.page-hero p { margin: 16px 0 0; color: var(--page-muted); max-width: 760px; }
.page-hero .hero-meta { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 24px; }
.page-hero .hero-chip { display: inline-flex; align-items: center; gap: 8px; padding: 10px 14px; border-radius: 999px; background: rgba(96,150,186,0.1); color: var(--page-blue); font-size: 13px; font-weight: 700; }
.page-hero h1 { margin: 0; font-family: 'Space Grotesk', sans-serif; font-size: clamp(38px, 4vw, 56px); line-height: 1.02; letter-spacing: -0.03em; }
.page-hero .hero-subtitle { font-size: 17px; color: var(--page-muted); max-width: 760px; }

.breadcrumbs { display: flex; flex-wrap: wrap; gap: 8px; font-size: 13px; color: var(--page-muted); margin-bottom: 14px; }
.breadcrumbs a { color: var(--page-blue); }
.breadcrumbs span.separator::after { content: '/'; margin: 0 6px; color: var(--page-muted); }

.page-grid { display: grid; grid-template-columns: minmax(0, 1.1fr) 300px; gap: 30px; padding: 20px 0 60px; }
.page-main { display: grid; gap: 28px; }
.page-sidebar { position: sticky; top: 96px; align-self: start; }
.page-sidebar-inner { background: var(--page-surface); border: 1px solid rgba(255,255,255,0.8); border-radius: var(--page-radius); box-shadow: var(--page-shadow); padding: 24px; }
.page-sidebar h2 { margin: 0 0 18px; font-size: 18px; }
.toc-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
.toc-list a { display: inline-flex; align-items: center; gap: 10px; color: var(--page-ink); font-size: 14px; transition: color 0.2s ease; }
.toc-list a:hover { color: var(--page-blue); }
.toc-list a::before { content: '•'; color: var(--page-blue); font-size: 14px; }

.section-card { background: var(--page-surface); border: 1px solid rgba(255,255,255,0.82); border-radius: var(--page-radius); box-shadow: var(--page-shadow); padding: 32px; }
.section-card h2, .section-card h3 { margin: 0 0 16px; font-family: 'Space Grotesk', sans-serif; }
.section-card h2 { font-size: clamp(26px, 3vw, 34px); }
.section-card h3 { font-size: clamp(20px, 2.2vw, 24px); }
.section-card p, .section-card li, .section-card dd { color: var(--page-muted); }
.section-card ul, .section-card ol { margin: 0; padding-left: 24px; color: var(--page-muted); }
.section-card li { margin-bottom: 12px; }
.section-card dl { margin: 0; }
.section-card dt { font-weight: 700; margin-top: 18px; }
.section-card dd { margin: 6px 0 0 0; }
.section-card .section-meta { display: flex; justify-content: space-between; align-items: flex-start; gap: 16px; flex-wrap: wrap; margin-bottom: 26px; }
.section-card .section-meta span { color: var(--page-muted); font-size: 14px; }
.section-card .section-header { display: flex; justify-content: space-between; align-items: center; gap: 12px; }
.section-anchor { position: relative; top: -90px; visibility: hidden; }
.section-title { display: flex; align-items: center; gap: 12px; }
.section-title .section-icon { display: inline-flex; width: 40px; height: 40px; align-items: center; justify-content: center; border-radius: 14px; background: rgba(42,109,244,0.08); color: var(--page-blue); font-size: 18px; }
.copy-link-btn { background: transparent; border: none; color: var(--page-blue); cursor: pointer; font-size: 13px; padding: 8px 10px; border-radius: 12px; transition: background 0.2s ease; }
.copy-link-btn:hover { background: rgba(42,109,244,0.08); }

.support-panel { background: linear-gradient(180deg, rgba(42,109,244,0.1), rgba(255,255,255,0.95)); border: 1px solid rgba(42,109,244,0.14); border-radius: var(--page-radius); box-shadow: var(--page-shadow); padding: 28px; display: grid; gap: 18px; }
.support-panel h3 { margin: 0; font-size: 24px; }
.support-panel p { margin: 0; color: var(--page-muted); }
.support-actions { display: flex; flex-wrap: wrap; gap: 14px; }
.support-actions a { white-space: nowrap; }

.page-footer { padding: 32px 0 40px; background: transparent; }
.page-footer-inner { display: grid; grid-template-columns: 1.4fr 1fr 1fr; gap: 24px; align-items: start; padding: 32px 0 0; border-top: 1px solid rgba(18,22,35,0.08); }
.page-footer h4 { margin: 0 0 14px; font-size: 16px; }
.page-footer a { display: block; color: var(--page-muted); margin-bottom: 10px; font-size: 14px; }
.page-footer a:hover { color: var(--page-blue); }
.page-footer .footer-brand { display: flex; align-items: center; gap: 12px; font-weight: 700; color: var(--page-ink); }
.page-footer .footer-brand img { height: 30px; }
.page-footer .footer-note { margin-top: 12px; color: var(--page-muted); font-size: 13px; }

.back-to-top { position: fixed; right: 22px; bottom: 22px; z-index: 90; display: none; width: 48px; height: 48px; border: none; border-radius: 50%; background: var(--page-blue); color: white; font-size: 18px; cursor: pointer; box-shadow: 0 18px 40px rgba(15,23,42,0.16); }

.print-hidden { display: none !important; }
@media print {
  body { background: white; color: black; }
  .page-sidebar, .top-nav, .support-panel, .back-to-top, .page-footer { display: none; }
  .wrap { padding: 0; max-width: 100%; }
  .section-card { border: none; box-shadow: none; background: transparent; padding: 0; }
  .breadcrumbs, .copy-link-btn { display: none; }
}

@media (max-width: 980px) {
  .page-grid { grid-template-columns: 1fr; }
  .page-sidebar { position: static; top: auto; }
}

@media (max-width: 720px) {
  .page-hero-inner { padding: 28px 20px; }
  .page-sidebar-inner { padding: 20px; }
  .section-card { padding: 24px; }
  .page-footer-inner { grid-template-columns: 1fr; }
}

/* Footer Credit Link (shared across all pages) */
.footer-credit-link {
  color: #D97706; /* Gold accent color */
  font-weight: 600;
  text-decoration: none;
  transition: color 0.2s ease, text-decoration 0.2s ease;
}
.footer-credit-link:hover {
  text-decoration: underline;
  color: #B45309;
}
[data-theme="dark"] .footer-credit-link {
  color: #F59E0B;
}
[data-theme="dark"] .footer-credit-link:hover {
  color: #D97706;
}

/* Mobile responsive: stack credit link on new line */
@media (max-width: 600px) {
  .footer-bottom,
  footer .wrap > div:last-child,
  footer > .wrap > div:last-child {
    display: flex;
    flex-direction: column;
    gap: 6px;
    align-items: center;
    text-align: center;
  }
  .footer-bottom .footer-credit-link,
  footer .footer-credit-link {
    display: block;
  }
  /* Hide the separator dot on mobile since we're stacking */
  .footer-credit-sep {
    display: none;
  }
}

/* Footer Contact & Social Links (shared across all pages) */
.footer-contact-links {
  display: flex;
  flex-direction: row;
  gap: 10px;
  flex-wrap: wrap;
}
.footer-contact-link {
  width: 40px;
  height: 40px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 10px;
  background: #e7ecef;
  border: 1px solid #e2e8f0;
  color: #0F766E; /* Teal default color */
  text-decoration: none;
  transition: color 0.2s ease, background 0.2s ease, border-color 0.2s ease, transform 0.2s ease;
}
.footer-contact-link:hover {
  color: #D97706; /* Gold on hover */
  background: rgba(217, 119, 6, 0.06);
  border-color: rgba(217, 119, 6, 0.2);
  transform: translateY(-1px);
}
/* Dark mode adjustments */
[data-theme="dark"] .footer-contact-link {
  color: #14B8A6; /* Teal for dark mode */
  background: rgba(20, 184, 166, 0.04);
  border-color: #2a2f3d;
}
[data-theme="dark"] .footer-contact-link:hover {
  color: #F59E0B; /* Gold for dark mode */
  background: rgba(245, 158, 11, 0.06);
  border-color: rgba(245, 158, 11, 0.2);
}
