:root {
  --bs-primary: #4d65f1;
  --bs-primary-rgb: 77, 101, 241;
  --bs-link-color: #4d65f1;
  --bs-link-color-rgb: 77, 101, 241;
  --bs-link-hover-color: #394fd1;
  --bs-link-hover-color-rgb: 57, 79, 209;
}

:root[data-bs-theme="dark"] {
  --bs-primary: #9aa8ff;
  --bs-primary-rgb: 154, 168, 255;
  --bs-link-color: #aab5ff;
  --bs-link-color-rgb: 170, 181, 255;
  --bs-link-hover-color: #c5ccff;
  --bs-link-hover-color-rgb: 197, 204, 255;
}

html {
  scroll-behavior: smooth;
}

a:focus-visible,
button:focus-visible {
  outline: 3px solid color-mix(in srgb, var(--bs-primary) 55%, transparent);
  outline-offset: 3px;
}

.site-header {
  z-index: 1020;
  background-color: var(--bs-body-bg);
}

.brand-mark {
  font-size: 1.4rem;
  font-weight: 800;
  letter-spacing: -0.075em;
  line-height: 1;
}

.brand-mark span {
  color: var(--bs-primary);
}

.site-header .nav-link {
  position: relative;
}

.site-header .nav-link:hover,
.site-header .nav-link.active {
  color: var(--bs-primary) !important;
}

.site-header .nav-link.active::after {
  position: absolute;
  right: 0;
  bottom: 0;
  left: 0;
  height: 2px;
  background: var(--bs-primary);
  content: "";
}

.theme-toggle {
  width: 38px;
  height: 38px;
}

.search-results {
  max-height: min(55vh, 480px);
  overflow-y: auto;
}

.search-result-title mark,
.article-prose mark {
  padding: 0.05em 0.15em;
  border-radius: 0.2em;
  background-color: color-mix(in srgb, var(--bs-primary) 22%, var(--bs-body-bg));
  color: var(--bs-body-color);
}

.section-eyebrow {
  color: var(--bs-primary);
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.rss-card {
  color: #fff;
  background-color: #4d65f1;
}

:root[data-bs-theme="dark"] .rss-card {
  background-color: #3448c5;
}

.rss-card p {
  color: rgb(255 255 255 / 80%);
}

.rss-card .bi-rss {
  color: #c5ccff;
}

.site-footer ul a:hover {
  color: var(--bs-primary) !important;
}

.article-title {
  max-width: 900px;
  margin-inline: auto;
  font-size: clamp(2rem, 4vw, 3.5rem);
  line-height: 1.12;
}

.article-meta {
  letter-spacing: 0.025em;
}

.article-hero img {
  object-position: center;
}

.article-prose {
  color: var(--bs-body-color);
  font-size: 1.08rem;
  line-height: 1.8;
}

.article-prose > * + * {
  margin-top: 1.35em;
}

.article-prose h2,
.article-prose h3,
.article-prose h4 {
  margin-top: 2em;
  margin-bottom: 0.65em;
  font-weight: 700;
  line-height: 1.25;
}

.article-prose h2 {
  font-size: clamp(1.5rem, 2.7vw, 2rem);
}

.article-prose h3 {
  font-size: 1.4rem;
}

.article-prose a {
  text-decoration-thickness: 1px;
  text-underline-offset: 0.18em;
}

.article-prose ul,
.article-prose ol {
  padding-left: 1.35rem;
}

.article-prose li + li {
  margin-top: 0.45rem;
}

.article-prose blockquote {
  padding: 1rem 1.25rem;
  margin: 1.5rem 0;
  border-left: 3px solid var(--bs-primary);
  background-color: var(--bs-tertiary-bg);
  color: var(--bs-body-color);
  font-style: italic;
}

.article-prose img {
  max-width: 100%;
  height: auto;
}

.article-prose table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.94rem;
}

.article-prose th,
.article-prose td {
  padding: 0.7rem;
  border: 1px solid var(--bs-border-color);
}

.article-prose th {
  background: var(--bs-tertiary-bg);
}

.article-prose pre {
  overflow-x: auto;
  padding: 1rem;
  border: 1px solid var(--bs-border-color);
  border-radius: var(--bs-border-radius);
}

.article-prose code {
  font-family: var(--bs-font-monospace);
  font-size: 0.88em;
}

.toc-container ul {
  padding-left: 1rem;
  margin-bottom: 0;
}

.toc-container li + li {
  margin-top: 0.55rem;
}

.reading-progress-bar {
  position: fixed;
  top: 0;
  left: 0;
  z-index: 1070;
  width: 0%;
  height: 3px;
  background-color: var(--bs-primary);
  transition: width 0.1s linear;
}

.line-clamp-2 {
  display: -webkit-box;
  overflow: hidden;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
  line-clamp: 2;
}

.max-w-prose {
  max-width: 760px;
}

.max-w-editorial {
  max-width: 980px;
}

@media (min-width: 576px) {
  .ratio-sm-4x3 {
    --bs-aspect-ratio: 75%;
  }
}

@media (min-width: 992px) {
  .ratio-lg-16x9 {
    --bs-aspect-ratio: 56.25%;
  }
}

@media (max-width: 575.98px) {
  .featured-strip-card {
    align-items: flex-start !important;
  }

  .article-prose {
    font-size: 1rem;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    transition-duration: 0.01ms !important;
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
  }
}
