/*
 * Spam-RBL.fr theme, on top of stock Bootstrap 5.3.
 * Colors are defined once as tokens and redefined for dark mode.
 */

:root,
[data-bs-theme="light"] {
  --rbl-brand: #2b59c3;
  --rbl-brand-rgb: 43, 89, 195;
  --rbl-brand-hover: #234aa3;
  --rbl-accent: #e4572e;
  --rbl-nav-bg: #0f1b33;
  --rbl-hero-from: #0f1b33;
  --rbl-hero-to: #1d3b7a;
  --rbl-surface: #ffffff;
  --rbl-surface-alt: #f4f6fb;
  --rbl-border: #e3e7ef;
  --rbl-code-bg: #0f172a;
  --rbl-code-fg: #e2e8f0;

  --bs-primary: var(--rbl-brand);
  --bs-primary-rgb: var(--rbl-brand-rgb);
  --bs-link-color: var(--rbl-brand);
  --bs-link-color-rgb: var(--rbl-brand-rgb);
  --bs-link-hover-color: var(--rbl-brand-hover);
  --bs-body-bg: var(--rbl-surface-alt);
  --bs-body-color: #1f2937;
  --bs-border-color: var(--rbl-border);
  --bs-border-radius: .5rem;
  --bs-border-radius-lg: .75rem;
  --bs-body-font-family: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", "Noto Sans", Arial, sans-serif;
  --bs-font-monospace: ui-monospace, SFMono-Regular, "JetBrains Mono", Menlo, Consolas, monospace;
}

[data-bs-theme="dark"] {
  --rbl-brand: #7aa2ff;
  --rbl-brand-rgb: 122, 162, 255;
  --rbl-brand-hover: #a5c0ff;
  --rbl-accent: #ff7a52;
  --rbl-nav-bg: #0a1222;
  --rbl-hero-from: #0a1222;
  --rbl-hero-to: #172c5c;
  --rbl-surface: #161d2b;
  --rbl-surface-alt: #0e1420;
  --rbl-border: #273248;
  --rbl-code-bg: #0a0f1a;
  --rbl-code-fg: #e2e8f0;

  --bs-body-bg: var(--rbl-surface-alt);
  --bs-body-color: #d6dce8;
  --bs-border-color: var(--rbl-border);
}

body {
  background-color: var(--bs-body-bg);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  -webkit-font-smoothing: antialiased;
}

main {
  flex: 1 0 auto;
}

/* Buttons follow the brand token in both themes */
.btn-primary {
  --bs-btn-bg: var(--rbl-brand);
  --bs-btn-border-color: var(--rbl-brand);
  --bs-btn-hover-bg: var(--rbl-brand-hover);
  --bs-btn-hover-border-color: var(--rbl-brand-hover);
  --bs-btn-active-bg: var(--rbl-brand-hover);
  --bs-btn-active-border-color: var(--rbl-brand-hover);
  --bs-btn-focus-shadow-rgb: var(--rbl-brand-rgb);
}

[data-bs-theme="dark"] .btn-primary {
  --bs-btn-color: #0a1222;
  --bs-btn-hover-color: #0a1222;
  --bs-btn-active-color: #0a1222;
}

/* Navigation */
.navbar-rbl {
  background-color: var(--rbl-nav-bg);
  box-shadow: 0 1px 0 rgba(255, 255, 255, .06);
}

.navbar-rbl .navbar-brand {
  font-weight: 700;
  letter-spacing: -.01em;
}

.navbar-rbl .navbar-brand span {
  color: var(--rbl-accent);
}

.navbar-rbl .nav-link {
  border-radius: .375rem;
  padding-inline: .75rem !important;
}

.navbar-rbl .nav-link.active {
  background-color: rgba(255, 255, 255, .1);
}

.navbar-rbl .form-control {
  background-color: rgba(255, 255, 255, .08);
  border-color: rgba(255, 255, 255, .15);
  color: #fff;
  min-width: 10rem;
}

.navbar-rbl .form-control::placeholder {
  color: rgba(255, 255, 255, .55);
}

/* Home hero */
.hero {
  background: linear-gradient(135deg, var(--rbl-hero-from), var(--rbl-hero-to));
  color: #fff;
  padding: 4rem 0;
  margin-top: -1.5rem;
  margin-bottom: 3rem;
}

.hero h1 {
  font-weight: 800;
  letter-spacing: -.02em;
  font-size: clamp(2rem, 4vw + 1rem, 3.25rem);
  line-height: 1.1;
}

.hero h1 span {
  color: var(--rbl-accent);
}

.hero .lead {
  color: rgba(255, 255, 255, .8);
  max-width: 36rem;
}

.hero .form-control {
  border: 0;
}

.hero img {
  max-height: 260px;
  filter: drop-shadow(0 1rem 2rem rgba(0, 0, 0, .35));
}

.feature-card {
  background-color: var(--rbl-surface);
  border: 1px solid var(--rbl-border);
  border-radius: var(--bs-border-radius-lg);
  padding: 1.75rem;
  height: 100%;
  display: flex;
  flex-direction: column;
}

.feature-card h2 {
  font-size: 1.25rem;
  font-weight: 700;
}

.feature-card .icon {
  width: 2.75rem;
  height: 2.75rem;
  border-radius: .625rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background-color: rgba(var(--rbl-brand-rgb), .12);
  color: var(--rbl-brand);
  margin-bottom: 1rem;
}

.feature-card .btn {
  margin-top: auto;
  align-self: flex-start;
}

/* Content pages: the page body sits in a card */
.page {
  background-color: var(--rbl-surface);
  border: 1px solid var(--rbl-border);
  border-radius: var(--bs-border-radius-lg);
  padding: clamp(1.25rem, 3vw, 2.5rem);
  max-width: 960px;
}

.page h1 {
  font-size: 1.6rem;
  font-weight: 700;
  letter-spacing: -.01em;
  margin-top: 2.5rem;
  margin-bottom: 1rem;
  padding-bottom: .5rem;
  border-bottom: 1px solid var(--rbl-border);
}

.page h1:first-child {
  margin-top: 0;
}

.page h2 {
  font-size: 1.2rem;
  font-weight: 600;
  margin-top: 1.75rem;
  margin-bottom: .75rem;
}

.page p,
.page li {
  line-height: 1.7;
}

/* Alerts: lighter surface with a colored edge */
.alert {
  border-width: 0 0 0 4px;
  border-left-color: var(--bs-alert-color);
}

.alert p:last-child,
.alert ul:last-child {
  margin-bottom: 0;
}

/* Code */
pre {
  background-color: var(--rbl-code-bg) !important;
  color: var(--rbl-code-fg) !important;
  border-radius: var(--bs-border-radius);
  padding: 1rem 1.25rem;
  font-size: .85rem;
  overflow-x: auto;
}

pre code {
  color: inherit;
}

:not(pre) > code {
  background-color: rgba(var(--rbl-brand-rgb), .1);
  color: var(--rbl-brand);
  padding: .1rem .35rem;
  border-radius: .25rem;
}

.table {
  --bs-table-bg: transparent;
}

/* Footer */
.site-footer {
  border-top: 1px solid var(--rbl-border);
  background-color: var(--rbl-surface);
  color: var(--bs-secondary-color);
  font-size: .8rem;
  padding: 2rem 0;
  margin-top: 3rem;
}

.site-footer p {
  margin: 0 0 .25rem;
}
