/* ==========================================================================
   BCCL Theme — global (site-wide) styles
   Loaded on every page. Design tokens + reset + header/footer/nav/buttons.
   Page-specific styling (the landing sections) lives in badcredit.css.
   ========================================================================== */

:root {
  /* Blue palette overhaul — sourced from the "Clear & Credible" reference
     design (light, banking-grade, conversion-first). Hex rather than
     oklch here since these are taken directly from that design's exact
     values; color-mix(in oklab, ...) works fine regardless of the source
     notation. */
  --radius: 0.875rem;

  --background: #fbfdff;
  --foreground: oklch(0.18 0.03 250);          /* #07121e — unchanged, not part of the blue swap */
  --surface: #eef3f8;
  --surface-elevated: #e7eef4;
  --ink: oklch(0.18 0.03 250);
  --ink-muted: #51677b;

  --card: #fbfdff;
  --card-foreground: oklch(0.18 0.03 250);

  --primary: #1478D4;
  --primary-foreground: #ffffff;
  --primary-glow: #5cc0ff;

  --secondary: #eef3f8;
  --muted: #eef3f8;
  --muted-foreground: #51677b;
  --accent: #1478D4;
  --destructive: oklch(0.62 0.22 27);
  --border: #d8e3ee;
  --input: #d8e3ee;
  --ring: #1478D4;

  --font-display: "Space Grotesk", ui-sans-serif, system-ui, sans-serif;
  --font-sans: "Inter", ui-sans-serif, system-ui, sans-serif;

  --gradient-hero:
    radial-gradient(ellipse at 20% 20%, rgb(20 120 212 / 0.12), transparent 60%),
    radial-gradient(ellipse at 80% 60%, rgb(92 192 255 / 0.10), transparent 55%),
    linear-gradient(180deg, #f4f9fe, #fbfdff);
  --gradient-primary: linear-gradient(135deg, #1478D4, #5cc0ff);
  --shadow-glow: 0 20px 60px -20px rgb(14 99 184 / 0.30);
  --shadow-card: 0 10px 40px -20px oklch(0 0 0 / 0.08);

  --maxw: 80rem;
  --maxw-narrow: 56rem; /* max-w-4xl for FAQ */
}

*, *::before, *::after { box-sizing: border-box; }

html { scroll-behavior: smooth; }

/* !important throughout this block: pages still flagged as Elementor-built
   (_elementor_edit_mode) get their old Elementor Site Kit CSS auto-enqueued
   regardless of the active theme template — and Elementor's own global
   typography/color rules ship with !important, so ordinary specificity
   can't win against them. Drop these once every page is off Elementor. */
body {
  margin: 0;
  background-color: var(--background);
  color: var(--foreground) !important;
  font-family: var(--font-sans) !important;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

/* `body *` rather than relying on inheritance from body: Elementor's kit CSS
   declares font-family directly on tags like p/span/div, and a directly
   matching declaration always beats an inherited value regardless of
   !important — so body's own !important never reaches those descendants
   on its own. */
body * { font-family: var(--font-sans) !important; }

h1, h2, h3, h4, h5, h6 { font-family: var(--font-display) !important; letter-spacing: -0.02em; margin: 0; }
/* Same reasoning as `body *` above — without this, a span/em inside a
   heading (e.g. .text-gradient) matches `body *` directly and wins over
   the plain heading selector, since inheritance from the heading loses to
   any directly-matching rule. */
h1 *, h2 *, h3 *, h4 *, h5 *, h6 * { font-family: var(--font-display) !important; }
p { margin: 0; }
a { text-decoration: none; color: inherit !important; }
img { display: block; max-width: 100%; }

.container {
  max-width: var(--maxw);
  margin-inline: auto;
  padding-inline: 1rem;
}
@media (min-width: 640px) { .container { padding-inline: 1.5rem; } }
@media (min-width: 1024px) { .container { padding-inline: 2rem; } }

/* Buttons (shared) */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 0.5rem;
  border-radius: 9999px; font-weight: 600; cursor: pointer;
  border: 1px solid transparent;
  transition: transform 0.15s ease, background-color 0.15s ease, color 0.15s ease;
}
.btn svg { width: 1rem; height: 1rem; }
.btn--primary { background: var(--primary); color: var(--primary-foreground) !important; box-shadow: var(--shadow-glow); }
.btn--primary:hover { transform: translateY(-2px); }
.btn--ghost {
  background: color-mix(in oklab, var(--surface) 60%, transparent);
  color: var(--foreground) !important; border-color: var(--border); backdrop-filter: blur(8px);
}
.btn--ghost:hover { background: var(--surface); }
.btn--secondary { background: var(--background); color: var(--foreground) !important; }
.btn--secondary:hover { background: var(--surface); }
.btn--sm { padding: 0.625rem 1.25rem; font-size: 0.875rem; }
.btn--md { padding: 0.75rem 1.5rem; font-size: 0.875rem; }
.btn--lg { padding: 1rem 1.75rem; font-size: 1rem; }
.icon-primary { color: var(--primary); }
.bccl-icon { display: inline-block; vertical-align: middle; }

/* ---- Header / nav ---- */
.site-header {
  position: sticky; top: 0; z-index: 50;
  border-bottom: 1px solid color-mix(in oklab, var(--border) 60%, transparent);
  background: color-mix(in oklab, var(--background) 80%, transparent);
  backdrop-filter: blur(12px);
}
.site-header__inner { display: flex; align-items: center; justify-content: space-between; padding-block: 1rem; }
.logo { display: inline-flex; align-items: center; font-family: var(--font-display); font-size: 1.125rem; font-weight: 700; letter-spacing: -0.02em; }
.logo__accent { color: var(--primary); }

.nav-links { display: none; align-items: center; gap: 2rem; list-style: none; margin: 0; padding: 0; }
.nav-links li { list-style: none; position: relative; }
.nav-links a { font-size: 0.875rem; font-weight: 500; color: var(--ink-muted) !important; transition: color 0.15s ease; }
.nav-links a:hover { color: var(--foreground) !important; }
.nav-links .current-menu-item > a { color: var(--primary) !important; }
.nav-links .menu-item-has-children > a::after { content: '\25BE'; margin-left: 0.35em; font-size: 1.1em; display: inline-block; vertical-align: -0.05em; }

/* Dropdown submenu (desktop) */
.nav-links .sub-menu {
  position: absolute;
  top: 100%;
  left: 50%;
  z-index: 50;
  min-width: 14rem;
  margin: 1rem 0 0;
  padding: 0.5rem;
  list-style: none;
  border-radius: 0.75rem;
  border: 1px solid var(--border);
  background: var(--background);
  box-shadow: var(--shadow-card);
  opacity: 0;
  visibility: hidden;
  transform: translateX(-50%) translateY(-0.25rem);
  transition: opacity 0.15s ease, transform 0.15s ease, visibility 0.15s;
}
.nav-links li:hover > .sub-menu,
.nav-links li:focus-within > .sub-menu { opacity: 1; visibility: visible; transform: translateX(-50%) translateY(0); }
.nav-links .sub-menu a { display: block; padding: 0.5rem 0.75rem; border-radius: 0.5rem; white-space: nowrap; }
.nav-links .sub-menu a:hover { background: var(--surface); }

.nav-actions { display: none; align-items: center; gap: 1rem; }

/* Custom nav search — replaces the Ivory Search plugin's injected form
   (now deactivated), which needed a growing pile of !important overrides
   to look and behave consistently since it was never actually part of
   this theme's design system. */
.nav-search { position: relative; display: flex; align-items: center; }
.nav-search__toggle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2rem;
  height: 2rem;
  padding: 0;
  border: none;
  background: none;
  color: var(--ink-muted);
  cursor: pointer;
}
.nav-search__toggle:hover,
.nav-search.is-open .nav-search__toggle { color: var(--primary); }
.nav-search__toggle svg { width: 1.125rem; height: 1.125rem; }

.nav-search__form {
  display: none;
  position: absolute;
  top: 100%;
  right: 0;
  z-index: 50;
  margin-top: 1rem;
  align-items: center;
  gap: 0.25rem;
  background: var(--background);
  border: 1px solid var(--border);
  border-radius: 9999px;
  padding: 0.25rem 0.25rem 0.25rem 0.875rem;
  box-shadow: var(--shadow-card);
}
.nav-search.is-open .nav-search__form { display: flex; }
.nav-search__input {
  width: 11rem;
  border: none;
  outline: none;
  background: none;
  font-size: 0.875rem;
  color: var(--foreground);
}
.nav-search__input::placeholder { color: var(--ink-muted); }
.nav-search__submit,
.nav-search__close {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 1.75rem;
  height: 1.75rem;
  flex-shrink: 0;
  padding: 0;
  border: none;
  border-radius: 9999px;
  cursor: pointer;
}
.nav-search__submit { background: var(--primary); color: var(--primary-foreground) !important; }
.nav-search__submit svg { width: 0.9375rem; height: 0.9375rem; }
.nav-search__close { background: none; color: var(--ink-muted) !important; }
.nav-search__close:hover { color: var(--foreground) !important; }
.nav-search__close svg { width: 1rem; height: 1rem; }
.nav-phone { display: inline-flex; align-items: center; gap: 0.5rem; font-size: 0.875rem; font-weight: 600; }
/* Icon-only on narrow screens — the number doesn't fit on one line and
   wraps awkwardly. Mainly matters for the minimal header (PPC pages),
   which shows the phone link at every width; the normal header already
   hides it below desktop width via .nav-actions. */
@media (max-width: 480px) {
  .nav-phone__text { display: none; }
}

/* !important throughout: Elementor's global Site Kit CSS (still loaded
   sitewide while Elementor remains active) styles bare <button> elements
   with its own default background/padding/focus colors — including a
   fairly large default padding, which is why this needed !important on
   padding too, not just color. Same root cause as the earlier
   body/nav-link/button color overrides — safe to drop once every page is
   off Elementor and the plugin removed. */
.nav-toggle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  position: relative;
  width: 2.25rem;
  height: 2.25rem;
  padding: 0 !important;
  border: none !important;
  border-radius: 0.5rem !important;
  background: var(--primary) !important;
  color: var(--primary-foreground) !important;
  cursor: pointer;
  appearance: none;
  -webkit-appearance: none;
  -webkit-tap-highlight-color: transparent;
}
.nav-toggle:focus,
.nav-toggle:active,
.nav-toggle:focus-visible,
.nav-toggle:hover { background: var(--primary) !important; color: var(--primary-foreground) !important; outline: none; }
.nav-toggle__icon { position: absolute; top: 50%; left: 50%; transform: translate(-50%, -50%); }
.nav-toggle__icon--close { display: none; }
.nav-toggle[aria-expanded="true"] .nav-toggle__icon--open { display: none; }
.nav-toggle[aria-expanded="true"] .nav-toggle__icon--close { display: block; }

.mobile-menu {
  display: none;
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  z-index: 40;
  max-height: calc(100vh - 100%);
  overflow-y: auto;
  height: 0;
  transition: height 0.3s ease;
  border-top: 1px solid color-mix(in oklab, var(--border) 60%, transparent);
  background: var(--surface);
  box-shadow: var(--shadow-card);
}
.mobile-menu.is-open { display: block; height: auto; }
.mobile-menu__inner { display: flex; flex-direction: column; gap: 0.25rem; padding: 0.75rem 1rem; }
.mobile-menu ul { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 0.25rem; }
.mobile-menu a { border-radius: 0.375rem; padding: 0.5rem 0.75rem; font-size: 0.875rem; color: var(--ink-muted); display: block; }
.mobile-menu a:hover { background: var(--surface-elevated); color: var(--foreground); }
.mobile-menu .sub-menu { padding-left: 1rem; margin-top: 0.25rem; }
.mobile-menu .sub-menu a { font-size: 0.8125rem; }
.mobile-menu .btn--primary { padding: 0.5rem 1rem; }
.mobile-search {
  display: flex;
  align-items: center;
  gap: 0.375rem;
  margin-top: 0.5rem;
  background: var(--background);
  border: 1px solid var(--border);
  border-radius: 9999px;
  padding: 0.375rem 0.375rem 0.375rem 1rem;
}
.mobile-search__input { flex: 1; min-width: 0; border: none; outline: none; background: none; font-size: 0.875rem; color: var(--foreground); }
.mobile-search__input::placeholder { color: var(--ink-muted); }
.mobile-search__submit {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2rem;
  height: 2rem;
  flex-shrink: 0;
  padding: 0;
  border: none;
  border-radius: 9999px;
  background: var(--primary);
  color: var(--primary-foreground) !important;
  cursor: pointer;
}
.mobile-search__submit svg { width: 1rem; height: 1rem; }

/* 945px rather than the site's usual 768px breakpoint — specifically for
   the top nav switching between mobile hamburger and full desktop links,
   since the nav has more items than a typical 768px-wide layout can fit
   without wrapping. */
@media (min-width: 945px) {
  .nav-links, .nav-actions { display: flex; }
  .nav-toggle { display: none; }
}

/* ---- Footer ---- */
.site-footer {
  border-top: 1px solid color-mix(in oklab, var(--border) 60%, transparent);
  background: color-mix(in oklab, var(--surface) 40%, transparent);
}
.site-footer__inner {
  display: flex; flex-direction: column; align-items: center; justify-content: space-between;
  gap: 1rem; padding-block: 2rem;
}
.site-footer__legal { font-size: 0.75rem; color: var(--ink-muted); text-align: center; }
.site-footer__legal-links { display: inline-flex; gap: 0.35em; margin-left: 0.35em; }
.site-footer__legal-links a { color: var(--ink-muted) !important; text-decoration: underline; text-underline-offset: 2px; }
.site-footer__legal-links a:hover { color: var(--foreground) !important; }
@media (min-width: 640px) {
  .site-footer__inner { flex-direction: row; }
  .site-footer__legal { text-align: right; }
}

/* ---- Generic page (default template) ---- */
.page-default { padding-block: 4rem; }
.page-default .container { max-width: 46rem; }
.page-default h1 { font-size: clamp(2rem, 5vw, 3rem); margin-bottom: 1.5rem; }
.page-default .entry-content > * + * { margin-top: 1rem; }
