/* Site headers, shared by every page through src/components/SiteHeader.astro
   (full nav, general web pages) and LandingHeader.astro (logo + Connect + demo,
   landing pages). The one place to change header styles: the copies that used
   to live in homepage.css and connect.css were removed. Colors fall back to
   literal values because not every page loads ui-kit.css for the --kit-* tokens.

   Full nav, modelled on ploy.ai: items inline next to the logo with small
   text-only card dropdowns at 1100px and up; below that a hamburger left of the
   logo opens a menu where an item with a subnav drills into its own list with a
   back row. Behaviour lives in js/nav.js. */

.fr-white:focus-visible { outline: none; box-shadow: 0 0 0 2px #ffffff, 0 0 0 4px #0A7891; }

/* ---------- Header ---------- */

.site-header {
  position: sticky;
  top: 0;
  z-index: 20;
  background: rgba(248, 247, 247, .94);
  backdrop-filter: blur(8px);
}

.header-inner {
  max-width: 1440px;
  margin: 0 auto;
  padding: 16px clamp(24px, 5.5vw, 80px);
  min-height: 80px;
  display: flex;
  align-items: center;
  gap: 40px;
  flex-wrap: wrap;
}

.logo-link {
  display: flex;
  align-items: center;
  border-radius: 6px;
}

.logo-link img {
  height: 26px;
  width: auto;
  display: block;
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-left: auto;
  flex: none;
}

.connect-pill {
  display: flex;
  align-items: center;
  gap: 10px;
  height: 48px;
  padding: 0 16px;
  border: 1px solid var(--color-teal-teal-shade, #0C505D);
  border-radius: 8px;
  background: transparent;
  font-size: 14px;
  line-height: 1.5;
  color: var(--color-neutrals-black, #201F1D);
  white-space: nowrap;
}

.connect-pill:hover {
  background: rgba(12, 80, 93, .06);
}

.connect-pill img {
  height: 19px;
  width: 71px;
  display: block;
}

.demo-cta-link {
  display: block;
  border-radius: 8px;
}

.demo-cta {
  width: fit-content;
  height: 48px;
  border-radius: 8px;
  background: var(--color-teal-teal-shade, #0C505D);
  display: flex;
  flex-direction: row;
  gap: 10px;
  padding: 13px 14px;
  justify-content: center;
  align-items: center;
  flex-wrap: nowrap;
}

.demo-cta:hover {
  background: var(--color-teal-teal-dark, #0D2828);
}

.demo-cta span {
  font-family: inherit;
  font-weight: 400;
  font-size: 14px;
  white-space: nowrap;
  line-height: 1.5;
  color: rgb(255, 255, 255);
}

@media (max-width: 700px) {
  .header-inner { gap: 16px; }
  .connect-pill img { display: none; }
}

@media (max-width: 480px) {
  .header-inner { padding: 12px 16px; gap: 12px; min-height: 64px; }
  .logo-link img { height: 20px; }
  .header-actions { gap: 8px; }
  .connect-pill { height: 40px; padding: 0 12px; font-size: 13px; }
  .demo-cta { height: 40px; padding: 0 12px; }
  .demo-cta span { font-size: 13px; }
}

/* ---------- Landing header options (LandingHeader.astro props) ---------- */

.fr-dark:focus-visible { outline: none; box-shadow: 0 0 0 2px #0D2828, 0 0 0 4px #C9FEFF; }

.site-header--dark {
  background: rgba(13, 40, 40, .94);
  border-bottom: 1px solid rgba(201, 254, 255, .10);
}

/* Quiet text links a page sets in place of Connect. */
.site-header .header-link {
  margin-right: 12px;
  font-size: 15px;
  line-height: 1.4;
  color: rgba(32, 31, 29, .8);
  white-space: nowrap;
  border-radius: 4px;
}

.site-header .header-link:hover { color: #201F1D; }

.site-header--dark .header-link { color: rgba(255, 255, 255, .72); }
.site-header--dark .header-link:hover { color: #FFFFFF; }

/* The page's main button: teal on light, citron on dark (as the ad). */
.site-header .header-cta {
  display: inline-flex;
  align-items: center;
  height: 44px;
  padding: 0 16px;
  border-radius: 8px;
  background: #0C505D;
  font-size: 15px;
  font-weight: 500;
  line-height: 1;
  color: #FFFFFF;
  white-space: nowrap;
}

.site-header .header-cta:hover { background: #0D2828; color: #FFFFFF; }

.site-header--dark .header-cta { background: #FFFA66; color: #201F1D; }
.site-header--dark .header-cta:hover { background: #FFFDC7; color: #201F1D; }

/* An external link (Developers -> stensul.dev): a small leaving-this-site
   icon after the word. In the header bar only where the full nav shows;
   below that it's in the mobile menu instead. */
.site-header .header-link--ext,
.site-header .nav-trigger--ext {
  display: inline-flex;
  align-items: center;
  gap: 5px;
}

.site-header :is(.header-link--ext, .nav-trigger--ext) svg {
  flex: none;
  width: 11px;
  height: 11px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.3;
  stroke-linecap: round;
  stroke-linejoin: round;
  opacity: .75;
}

@media (max-width: 1099.98px) {
  .site-header .header-actions .header-link--ext { display: none; }
}

@media (max-width: 600px) {
  .site-header .header-link { display: none; }
}

@media (max-width: 480px) {
  .site-header .header-cta { height: 40px; padding: 0 12px; font-size: 14px; }
}

/* ---------- Main nav ---------- */

.site-nav ul {
  list-style: none;
  margin: 0;
  padding: 0;
}

.nav-trigger {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 10px 12px;
  border: 0;
  border-radius: 8px;
  background: transparent;
  font: inherit;
  font-size: 15px;
  line-height: 1.4;
  color: var(--kit-text-medium, rgba(32, 31, 29, .8));
  white-space: nowrap;
  cursor: pointer;
}

.nav-trigger:hover,
.nav-item.is-open > .nav-trigger {
  color: var(--kit-text-strong, #201F1D);
}

.nav-chevron {
  width: 12px;
  height: 12px;
  flex: none;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.5;
  stroke-linecap: round;
  stroke-linejoin: round;
  transition: transform .2s ease;
}

.nav-sub-list a {
  display: block;
  padding: 9px 12px;
  border-radius: 8px;
  font-size: 15px;
  line-height: 1.4;
  color: var(--kit-text-strong, #201F1D);
}

.nav-sub-list a:hover {
  background: var(--kit-ivory-tint, #F8F7F7);
  color: var(--kit-text-strong, #201F1D);
}

.nav-sub-list a:focus-visible,
.nav-back:focus-visible {
  outline: none;
  box-shadow: inset 0 0 0 2px var(--kit-teal-medium, #0A7891);
}

/* ---------- Hamburger ---------- */

.nav-toggle {
  display: none;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  margin: 0 -8px 0 -10px;
  padding: 0;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: var(--kit-text-strong, #201F1D);
  cursor: pointer;
}

.nav-toggle-bars,
.nav-toggle-bars::before,
.nav-toggle-bars::after {
  display: block;
  width: 18px;
  height: 1.5px;
  border-radius: 1px;
  background: currentColor;
  transition: transform .2s ease, background-color .2s ease;
}

.nav-toggle-bars { position: relative; }

.nav-toggle-bars::before,
.nav-toggle-bars::after {
  content: '';
  position: absolute;
  left: 0;
}

.nav-toggle-bars::before { transform: translateY(-6px); }
.nav-toggle-bars::after { transform: translateY(6px); }

.nav-toggle[aria-expanded="true"] .nav-toggle-bars { background-color: transparent; }
.nav-toggle[aria-expanded="true"] .nav-toggle-bars::before { transform: rotate(45deg); }
.nav-toggle[aria-expanded="true"] .nav-toggle-bars::after { transform: rotate(-45deg); }

/* ---------- Wide screens: inline items, card dropdowns ---------- */

@media (min-width: 1100px) {
  .header-inner { gap: 24px; }

  .site-nav {
    display: flex;
    margin-left: -12px;
  }

  .nav-list {
    display: flex;
    align-items: center;
    gap: 2px;
  }

  .nav-list--ctas,
  .nav-back {
    display: none;
  }

  .nav-item { position: relative; }

  .nav-item.is-open > .nav-trigger .nav-chevron { transform: rotate(180deg); }

  /* padding-top keeps the pointer inside the item on its way to the card. */
  .nav-sub {
    position: absolute;
    top: 100%;
    left: 0;
    padding-top: 8px;
    opacity: 0;
    visibility: hidden;
    transform: translateY(-4px);
    transition: opacity .16s ease, transform .16s ease, visibility 0s linear .16s;
  }

  .nav-item.is-open > .nav-sub {
    opacity: 1;
    visibility: visible;
    transform: none;
    transition: opacity .16s ease, transform .16s ease;
  }

  .nav-sub-card {
    display: flex;
    padding: 8px;
    border: 1px solid var(--kit-stroke-light, rgba(32, 31, 29, .15));
    border-radius: 12px;
    background: var(--kit-white, #FFFFFF);
    box-shadow: var(--kit-elevation-2, 0 8px 15px rgba(0, 0, 0, .10));
  }

  .nav-sub-list { min-width: 220px; }

  .nav-sub-list a { white-space: nowrap; }

  .nav-sub-list--more {
    margin-left: 8px;
    padding-left: 8px;
    border-left: 1px solid var(--kit-ivory-medium, #E4E1DF);
  }

  .nav-sub-list--more a { color: var(--kit-text-medium, rgba(32, 31, 29, .8)); }
}

/* Just above the breakpoint the full row is too wide for the AI icons. */
@media (min-width: 1100px) and (max-width: 1259.98px) {
  .connect-pill img { display: none; }
}

/* ---------- Narrow screens: hamburger menu ---------- */

@media (max-width: 1099.98px) {
  .header-inner { gap: 16px; }

  .nav-toggle { display: flex; }

  .site-nav {
    display: none;
    position: absolute;
    top: calc(100% + 4px);
    left: 12px;
    right: 12px;
    max-height: calc(100dvh - 120px);
    overflow-y: auto;
    padding: 8px;
    border: 1px solid var(--kit-stroke-light, rgba(32, 31, 29, .15));
    border-radius: 16px;
    background: var(--kit-white, #FFFFFF);
    box-shadow: var(--kit-elevation-2, 0 8px 15px rgba(0, 0, 0, .10));
  }

  .site-nav.is-open {
    display: block;
    animation: nav-panel-in .18s ease;
  }

  .nav-trigger {
    width: 100%;
    justify-content: space-between;
    padding: 12px 16px;
    font-size: 18px;
    font-weight: 500;
    color: var(--kit-text-strong, #201F1D);
    text-align: left;
  }

  .nav-trigger:hover { background: var(--kit-ivory-tint, #F8F7F7); }

  .nav-trigger .nav-chevron {
    width: 14px;
    height: 14px;
    color: var(--kit-ivory-shade, #A8A39F);
    transform: rotate(-90deg);
  }

  .nav-list--ctas {
    margin-top: 8px;
    padding-top: 8px;
    border-top: 1px solid var(--kit-ivory-medium, #E4E1DF);
  }

  .nav-sub { display: none; }

  /* Drilled into one item: show only its back row and its links. */
  .site-nav.has-open-sub .nav-item:not(.is-open),
  .site-nav.has-open-sub .nav-list--ctas,
  .nav-item.is-open > .nav-trigger {
    display: none;
  }

  .nav-item.is-open > .nav-sub {
    display: block;
    animation: nav-panel-in .18s ease;
  }

  .nav-back {
    display: flex;
    align-items: center;
    gap: 8px;
    width: 100%;
    padding: 12px 16px 12px 12px;
    border: 0;
    border-radius: 8px;
    background: transparent;
    font: inherit;
    font-size: 14px;
    font-weight: 500;
    color: var(--kit-text-subtle, rgba(32, 31, 29, .6));
    text-align: left;
    cursor: pointer;
  }

  .nav-back:hover { color: var(--kit-text-strong, #201F1D); }

  .nav-back .nav-chevron { width: 14px; height: 14px; }

  .nav-sub-list a {
    padding: 12px 16px;
    font-size: 18px;
    font-weight: 500;
  }

  .nav-sub-list--more {
    margin-top: 8px;
    padding-top: 8px;
    border-top: 1px solid var(--kit-ivory-medium, #E4E1DF);
  }

  .nav-sub-list--more a {
    font-size: 16px;
    font-weight: 400;
    color: var(--kit-text-medium, rgba(32, 31, 29, .8));
  }
}

/* The menu carries Connect, so the header keeps only the demo button. */
@media (max-width: 420px) {
  .header-actions .connect-pill { display: none; }
}

@keyframes nav-panel-in {
  from { opacity: 0; transform: translateY(-6px); }
  to { opacity: 1; transform: none; }
}

@media (prefers-reduced-motion: reduce) {
  .nav-sub,
  .nav-chevron,
  .nav-toggle-bars,
  .nav-toggle-bars::before,
  .nav-toggle-bars::after { transition: none; }

  .site-nav.is-open,
  .nav-item.is-open > .nav-sub { animation: none; }
}

/* ---------- The homepage header: the site standard ---------- */
/* Rurik, 2026-10-11: the homepage's header is the standard on every page.
   These rules were scoped to the homepage's body classes (buttons.css,
   refresh.css); they now follow the header itself. They apply to every
   SiteHeader (.site-header--main) and to any header on a page with the
   homepage look (.modern, i.e. src/layouts/Layout.astro). Minimal landing
   headers on older pages (Request a demo, /lp/charity) keep their own sizes.

   - Nav items and header links 14px Medium; Connect + demo buttons 36px,
     8px radius (12px side padding on phones).
   - Logo 22px (18px on phones); on wide screens nav items 20px apart with
     40px from the logo to "Platform".
   - A hairline once the page scrolls, and the bar trims from 80 to 64px
     (js/nav.js adds .is-scrolled; the margin keeps the page from moving). */

:is(.site-header--main, .modern .site-header) :is(.nav-trigger, .header-link) {
  font-size: 14px;
  font-weight: 500;
}

:is(.site-header--main, .modern .site-header) .connect-pill {
  height: 36px;
  padding: 0 14px;
  border-radius: 8px;
  font-size: 14px;
  font-weight: 500;
  line-height: 1.1;
}

:is(.site-header--main, .modern .site-header) :is(.demo-cta-link, .demo-cta) {
  border-radius: 8px;
}

:is(.site-header--main, .modern .site-header) .demo-cta {
  height: 36px;
  padding: 0 14px;
}

:is(.site-header--main, .modern .site-header) .header-cta {
  height: 36px;
  padding: 0 14px;
  border-radius: 8px;
  font-size: 14px;
  font-weight: 500;
}

:is(.site-header--main, .modern .site-header) .demo-cta span {
  font-size: 14px;
  font-weight: 500;
  line-height: 1.1;
}

:is(.site-header--main, .modern .site-header) .logo-link img { height: 22px; }

@media (max-width: 480px) {
  :is(.site-header--main, .modern .site-header) :is(.connect-pill, .demo-cta) { padding: 0 12px; }
  :is(.site-header--main, .modern .site-header) .logo-link img { height: 18px; }
}

@media (min-width: 1100px) {
  :is(.site-header--main, .modern .site-header) .site-nav { margin-left: 7px; }
  :is(.site-header--main, .modern .site-header) .nav-list > .nav-item > .nav-trigger { padding-left: 9px; padding-right: 9px; }
}

:is(.site-header--main, .modern .site-header) {
  border-bottom: 1px solid transparent;
  transition: border-color .25s ease, background-color .25s ease;
}

:is(.site-header--main, .modern .site-header).is-scrolled {
  border-bottom-color: rgba(32, 31, 29, .08);
}

@media (min-width: 701px) {
  :is(.site-header--main, .modern .site-header) .header-inner {
    transition: min-height .25s ease, padding .25s ease;
  }

  :is(.site-header--main, .modern .site-header) {
    transition: border-color .25s ease, background-color .25s ease, margin .25s ease;
  }

  :is(.site-header--main, .modern .site-header).is-scrolled { margin-bottom: 16px; }

  :is(.site-header--main, .modern .site-header).is-scrolled .header-inner {
    min-height: 64px;
    padding-top: 8px;
    padding-bottom: 8px;
  }
}
