/* corefi-site.css
 * Shared site shell loaded on every page via _templates/header.php.
 * Owns foundation overrides, design tokens, the semantic
 * header, skip link, primary nav (desktop + mobile drawer),
 * and the semantic footer.
 *
 * The LiteSpeed bundles are slated to go away in COR-20.
 */

/* ---- Foundation overrides ----
 * The7 puts `#page` into a CSS Grid with named template areas
 * (header / slider / title / fancyheader / elementor-header /
 * checkout / main / footer). The static export's <main> and
 * <footer> have no grid-area class, so they auto-place into
 * earlier rows than the menu's named area. Force block flow so
 * DOM order = render order.
 */
#page {
  display: block !important;
  grid-template-areas: none !important;
  grid-template-rows: none !important;
  grid-template-columns: none !important;
}

/* ---- Tokens ---- */
:root {
  --cf-ink: #071421;
  --cf-ink-soft: #385064;
  --cf-cyan: #23c7d9;
  --cf-green: #21d19f;
  --cf-gold: #c5a47e;
  --cf-gold-bright: #d4a843;
  --cf-cloud: #f5f8fb;
  --cf-border: rgba(10, 37, 64, 0.12);
  --cf-shadow-sm: 0 2px 12px rgba(7, 20, 33, 0.08);
  --cf-shadow-md: 0 8px 24px rgba(7, 20, 33, 0.12);

  /* ---- Typography scale (COR-515 / parent COR-514) ----
   * Stripe-feel: smaller body, tighter display, generous line-height.
   * Reference: stripe.com body ~14–15px, display ~64–80px hero with
   * -.025em letter-spacing, body line-height ~1.55–1.6.
   *
   * Ramp (px, with rem fallback for the static end of clamps):
   *   xs 12 / sm 14 / base 15 / md 16 / lg 17 / xl 21 / 2xl 28 /
   *   3xl 36 / 4xl 48 / 5xl 64
   *
   * Mappings:
   *   body                15 / 1.6
   *   small/meta          12–13 / 1.5
   *   h1 hero (clamped)   38 → 64
   *   h2 section          26 → 36
   *   h3 card             17 → 18
   *   eyebrow             11 / .16em tracking, uppercase
   *
   * Display letter-spacing relaxed from -.045em/-.075em (felt
   * cartoonish at large sizes) to -.022em/-.018em. Stripe sits
   * around -.02em on display.
   */
  --cf-fs-xs: 12px;
  --cf-fs-sm: 14px;
  --cf-fs-base: 15px;
  --cf-fs-md: 16px;
  --cf-fs-lg: 17px;
  --cf-fs-xl: 21px;
  --cf-fs-2xl: 28px;
  --cf-fs-3xl: 36px;
  --cf-fs-4xl: 48px;
  --cf-fs-5xl: 64px;

  --cf-lh-tight: 1.15;
  --cf-lh-snug: 1.3;
  --cf-lh-base: 1.6;
  --cf-lh-loose: 1.7;

  --cf-tracking-display: -0.022em;
  --cf-tracking-h2: -0.022em;
  --cf-tracking-h3: -0.015em;
  --cf-tracking-body: -0.003em;
  --cf-tracking-eyebrow: 0.16em;
}

/* ---- Header shell ---- */
.cf-site-header {
  position: sticky;
  top: 0;
  z-index: 1000;
  background: #fff;
  box-shadow: var(--cf-shadow-sm);
  font-family: "Inter", "Fira Sans", "Noto Sans", system-ui, sans-serif;
  margin-bottom: 28px;
}
.cf-site-header__inner {
  max-width: 1300px;
  margin: 0 auto;
  padding: 0 30px;
  min-height: 78px;
  display: flex;
  align-items: center;
  gap: 24px;
}
.cf-site-header__logo {
  display: inline-flex;
  align-items: center;
  flex-shrink: 0;
}
.cf-site-header__logo img {
  display: block;
  width: 172px;
  height: auto;
}

/* ---- Primary nav (desktop) ---- */
.cf-nav {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-left: auto;
}
.cf-nav__list {
  display: flex;
  align-items: center;
  list-style: none;
  margin: 0;
  padding: 0;
}
.cf-nav__list > li { position: relative; }
.cf-nav__link {
  display: inline-flex;
  align-items: center;
  padding: 8px 10px;
  color: var(--cf-ink);
  font-size: 15px;
  font-weight: 400;
  text-decoration: none;
  white-space: nowrap;
  transition: color .2s ease;
}
.cf-nav__link:hover,
.cf-nav__link.is-current {
  color: var(--cf-gold-bright);
}
.cf-nav__item--has-sub > .cf-nav__link::after {
  content: "";
  margin-left: 6px;
  border: 4px solid transparent;
  border-top-color: currentColor;
  transform: translateY(2px);
}

/* Submenus (hover-revealed on desktop) */
.cf-nav__sub {
  position: absolute;
  top: 100%;
  left: 0;
  min-width: 240px;
  margin: 0;
  padding: 8px 0;
  list-style: none;
  background: #fff;
  box-shadow: var(--cf-shadow-md);
  border-radius: 4px;
  display: none;
  z-index: 1100;
}
.cf-nav__item--has-sub:hover > .cf-nav__sub,
.cf-nav__item--has-sub:focus-within > .cf-nav__sub {
  display: block;
}
.cf-nav__sub li a {
  display: block;
  padding: 8px 20px;
  color: var(--cf-ink);
  font-size: 15px;
  text-decoration: none;
  white-space: nowrap;
}
.cf-nav__sub li a:hover {
  color: var(--cf-gold-bright);
  background: var(--cf-cloud);
}

/* ---- Header CTA ---- */
.cf-nav__cta {
  display: inline-flex;
  align-items: center;
  padding: 11px 18px;
  background: var(--cf-gold-bright);
  color: #fff;
  font-family: inherit;
  font-weight: 600;
  font-size: 14px;
  line-height: 1.2;
  border: 0;
  border-radius: 6px;
  text-decoration: none;
  white-space: nowrap;
  cursor: pointer;
  transition: background .2s ease, transform .15s ease;
}
.cf-nav__cta:hover {
  background: var(--cf-gold);
  transform: translateY(-1px);
}

/* ---- Mobile hamburger ---- */
.cf-nav-toggle {
  display: none;
  margin-left: auto;
  width: 44px;
  height: 44px;
  padding: 0;
  background: none;
  border: none;
  cursor: pointer;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  gap: 5px;
  z-index: 1600;
  position: relative;
}
.cf-nav-toggle span {
  display: block;
  width: 24px;
  height: 2px;
  background: var(--cf-ink);
  transition: transform .25s ease, opacity .2s ease;
}
.cf-nav-toggle[aria-expanded="true"] span:nth-child(1) {
  transform: translateY(7px) rotate(45deg);
}
.cf-nav-toggle[aria-expanded="true"] span:nth-child(2) { opacity: 0; }
.cf-nav-toggle[aria-expanded="true"] span:nth-child(3) {
  transform: translateY(-7px) rotate(-45deg);
}

/* Submenu toggle (mobile only) */
.cf-nav__sub-toggle {
  display: none;
  width: 44px;
  height: 44px;
  background: none;
  border: none;
  cursor: pointer;
  position: relative;
  flex-shrink: 0;
}
.cf-nav__sub-toggle::after {
  content: "";
  position: absolute;
  top: 50%; left: 50%;
  width: 8px; height: 8px;
  border-right: 2px solid var(--cf-ink);
  border-bottom: 2px solid var(--cf-ink);
  transform: translate(-50%, -75%) rotate(45deg);
  transition: transform .25s ease;
}
.cf-nav__item--has-sub.is-open > .cf-nav__sub-toggle::after {
  transform: translate(-50%, -25%) rotate(-135deg);
}

/* ---- Mobile breakpoint ---- */
/* Bumped to 1280px in COR-143: the seven new top-nav labels + the longer
   "See CoreFi in Action" CTA only fit cleanly above ~1280px viewport. Smaller
   desktops/tablets get the drawer instead of a clipped horizontal nav. */
@media (max-width: 1280px) {
  .cf-nav-toggle { display: inline-flex; }

  .cf-nav {
    position: fixed;
    inset: 0 0 0 auto;
    width: min(360px, 80vw);
    background: #fff;
    flex-direction: column;
    align-items: stretch;
    padding: 80px 0 40px;
    gap: 0;
    margin: 0;
    transform: translateX(100%);
    transition: transform .3s ease;
    overflow-y: auto;
    box-shadow: -4px 0 24px rgba(0, 0, 0, 0.12);
    z-index: 1500;
  }
  .cf-nav.is-open { transform: translateX(0); }

  .cf-nav__list {
    flex-direction: column;
    align-items: stretch;
    padding: 0 20px;
  }
  .cf-nav__list > li {
    border-bottom: 1px solid var(--cf-border);
    display: flex;
    flex-wrap: wrap;
    align-items: center;
  }
  .cf-nav__link {
    flex: 1;
    padding: 14px 0;
    font-size: 17px;
  }
  .cf-nav__item--has-sub > .cf-nav__link::after { display: none; }
  .cf-nav__sub-toggle { display: flex; align-items: center; justify-content: center; }

  .cf-nav__sub {
    position: static;
    flex-basis: 100%;
    box-shadow: none;
    border-radius: 0;
    padding: 0 0 12px 16px;
  }
  .cf-nav__item--has-sub.is-open > .cf-nav__sub { display: block; }

  .cf-nav__cta {
    margin: 24px 20px 0;
    justify-content: center;
  }

  body.cf-nav-open::after {
    content: "";
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.4);
    z-index: 1400;
  }
  body.cf-nav-open { overflow: hidden; }
}

/* ---- Site footer ---- */
.cf-site-footer {
  position: relative;
  background:
    radial-gradient(circle at 78% 18%, rgba(33,209,159,.28), transparent 26%),
    radial-gradient(circle at 18% 12%, rgba(35,199,217,.24), transparent 30%),
    linear-gradient(135deg, #071421 0%, #0b315d 58%, #06111f 100%);
  color: #fff;
  font-family: "Roboto", "Inter", system-ui, sans-serif;
  margin-top: 80px;
  overflow: hidden;
}
.cf-site-footer__inner {
  position: relative;
  z-index: 1;
  max-width: 1300px;
  margin: 0 auto;
  padding: 70px 30px 30px;
}
.cf-site-footer__cols {
  display: grid;
  /* brand + 4 nav columns (Solutions / Products / Resources / Company) since COR-371. */
  grid-template-columns: 1.4fr 1fr 1fr 1fr 1fr;
  gap: 40px;
  align-items: start;
}
.cf-site-footer__brand img {
  display: block;
  width: 180px;
  height: auto;
  margin-bottom: 16px;
}
.cf-site-footer__tagline {
  margin: 0 0 16px;
  font-size: 15px;
  line-height: 1.5;
  opacity: 0.9;
}
.cf-site-footer__address {
  margin: 0;
  font-style: normal;
  font-size: 13px;
  line-height: 1.6;
  opacity: 0.85;
}
.cf-site-footer__address-label {
  display: block;
  margin-bottom: 8px;
  font-size: 11px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  font-weight: 700;
  color: var(--cf-cyan);
  opacity: 0.95;
}
.cf-site-footer__offices {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  grid-template-columns: 1fr;
  gap: 4px;
}
.cf-site-footer__offices li {
  font-size: 13px;
  line-height: 1.5;
  opacity: 0.8;
}

.cf-footer-nav h4 {
  margin: 4px 0 0;
  padding: 0 0 6px;
  display: inline-block;
  color: #fff;
  font-size: 18px;
  font-weight: 600;
  text-transform: uppercase;
  line-height: 1.4;
  letter-spacing: 0.02em;
  border-bottom: 2px solid var(--cf-gold-bright);
}
.cf-footer-nav ul {
  list-style: none;
  margin: 20px 0 0;
  padding: 0;
}
.cf-footer-nav li { margin-bottom: 12px; }
.cf-footer-nav a {
  color: #fff;
  text-decoration: none;
  font-size: 15px;
  line-height: 1.6;
  opacity: 0.9;
  transition: opacity .2s ease;
}
.cf-footer-nav a:hover {
  opacity: 1;
  text-decoration: underline;
}

.cf-site-footer__rule {
  border: 0;
  border-top: 1px solid rgba(255, 255, 255, 0.12);
  margin: 50px 0 24px;
}

.cf-site-footer__bottom {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}
.cf-site-footer__copy {
  margin: 0;
  font-size: 13px;
  opacity: 0.6;
}
.cf-site-footer__legal {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  list-style: none;
  margin: 0;
  padding: 0;
}
.cf-site-footer__legal a {
  display: inline-block;
  padding: 6px 14px;
  border: 1px solid rgba(255, 255, 255, 0.25);
  border-radius: 4px;
  color: #fff;
  font-size: 12px;
  text-decoration: none;
  transition: border-color .2s ease, background .2s ease;
}
.cf-site-footer__legal a:hover {
  border-color: var(--cf-gold-bright);
  background: rgba(212, 168, 67, 0.08);
}

@media (max-width: 1020px) {
  .cf-site-footer__cols {
    grid-template-columns: 1fr 1fr;
    gap: 36px 32px;
  }
  .cf-site-footer__brand { grid-column: 1 / -1; }
}
@media (max-width: 600px) {
  .cf-site-footer__inner { padding: 50px 24px 24px; }
  .cf-site-footer__cols { grid-template-columns: 1fr; gap: 32px; }
  .cf-site-footer__bottom { justify-content: flex-start; }
}

/* ---- Typography overrides ----
 * Replace Poppins (set as the Elementor + the7 default in
 * corefi-framework.css) with Inter / Fira Sans / Noto Sans.
 * Variable overrides cover Elementor + the7 widget chains;
 * the body/* rule handles new pages and any descendant that
 * doesn't read those variables.
 */
:root {
  --e-global-typography-el_content_1-font-family: "Inter", "Fira Sans", "Noto Sans", system-ui, sans-serif;
  --e-global-typography-el_content_2-font-family: "Inter", "Fira Sans", "Noto Sans", system-ui, sans-serif;
  --e-global-typography-el_content_3-font-family: "Inter", "Fira Sans", "Noto Sans", system-ui, sans-serif;
  --e-global-typography-el_content_4-font-family: "Inter", "Fira Sans", "Noto Sans", system-ui, sans-serif;
  --e-global-typography-el_list_1-font-family: "Inter", "Fira Sans", "Noto Sans", system-ui, sans-serif;
  --e-global-typography-el_quote_1-font-family: "Inter", "Fira Sans", "Noto Sans", system-ui, sans-serif;
  --e-global-typography-el_title_1-font-family: "Inter", "Fira Sans", "Noto Sans", system-ui, sans-serif;
  --e-global-typography-el_title_2-font-family: "Inter", "Fira Sans", "Noto Sans", system-ui, sans-serif;
  --e-global-typography-el_title_3-font-family: "Inter", "Fira Sans", "Noto Sans", system-ui, sans-serif;
  --e-global-typography-el_title_4-font-family: "Inter", "Fira Sans", "Noto Sans", system-ui, sans-serif;
  --e-global-typography-el_title_5-font-family: "Inter", "Fira Sans", "Noto Sans", system-ui, sans-serif;
  --e-global-typography-el_title_6-font-family: "Inter", "Fira Sans", "Noto Sans", system-ui, sans-serif;
  --e-global-typography-primary-font-family: "Inter", "Fira Sans", "Noto Sans", system-ui, sans-serif;
  --the7-base-font-family: "Inter", "Fira Sans", "Noto Sans", system-ui, sans-serif;
  --the7-btn-l-font-family: "Inter", "Fira Sans", "Noto Sans", system-ui, sans-serif;
  --the7-btn-lg-font-family: "Inter", "Fira Sans", "Noto Sans", system-ui, sans-serif;
  --the7-btn-m-font-family: "Inter", "Fira Sans", "Noto Sans", system-ui, sans-serif;
  --the7-btn-s-font-family: "Inter", "Fira Sans", "Noto Sans", system-ui, sans-serif;
  --the7-btn-xl-font-family: "Inter", "Fira Sans", "Noto Sans", system-ui, sans-serif;
}
body,
body * {
  font-family: "Inter", "Fira Sans", "Noto Sans", system-ui, -apple-system, sans-serif;
}

/* ---- Typography scale overrides (COR-515) ----
 * The framework's `.elementor-element { --e-global-typography-…: …; }`
 * rule wins over `:root` because it is defined on a closer ancestor.
 * Redefine the same vars on `.elementor-element` (loaded after the
 * framework) to push smaller, Stripe-aligned values through every
 * Elementor + the7 widget chain. Sizes inherit downward.
 */
.elementor-element {
  --e-global-typography-el_title_1-font-size: 36px;
  --e-global-typography-el_title_1-line-height: 1.15em;
  --e-global-typography-el_title_2-font-size: 28px;
  --e-global-typography-el_title_2-line-height: 1.2em;
  --e-global-typography-el_title_3-font-size: 21px;
  --e-global-typography-el_title_3-line-height: 1.3em;
  --e-global-typography-el_title_4-font-size: 17px;
  --e-global-typography-el_title_4-line-height: 1.4em;
  --e-global-typography-el_title_5-font-size: 15px;
  --e-global-typography-el_title_5-line-height: 1.4em;
  --e-global-typography-el_title_6-font-size: 14px;
  --e-global-typography-el_title_6-line-height: 1.4em;
  --e-global-typography-el_content_1-font-size: 15px;
  --e-global-typography-el_content_1-line-height: 1.65em;
  --e-global-typography-el_content_2-font-size: 14px;
  --e-global-typography-el_content_2-line-height: 1.6em;
  --e-global-typography-el_content_3-font-size: 12px;
  --e-global-typography-el_content_3-line-height: 1.5em;
  --e-global-typography-el_content_4-font-size: 16px;
  --e-global-typography-el_content_4-line-height: 1.65em;
  --e-global-typography-el_list_1-font-size: 14px;
  --e-global-typography-el_list_1-line-height: 1.5em;
  --e-global-typography-el_quote_1-font-size: 17px;
  --e-global-typography-el_quote_1-line-height: 1.65em;
}

/* Baseline body sizing for non-Elementor pages (modern hand-written
 * .cf-* pages + articles). Matches the Stripe-ish 15px body. */
body {
  font-size: var(--cf-fs-base);
  line-height: var(--cf-lh-base);
  letter-spacing: var(--cf-tracking-body);
}
