/* Final shared presentation override for Astro and transformed static pages. */

:root {
  --navy: #06224a;
  --navy-2: #10365f;
  --teal: #08777c;
  --teal-dark: #075e63;
  --gold: #e4a817;
  --ink: #13233a;
  --muted: #52647b;
  --line: #d5e0e9;
  --soft: #f3f7f9;
  --surface: #ffffff;
  --focus: #c88a00;
  --shadow: 0 16px 38px rgba(6, 34, 74, 0.12);
}

html {
  overflow-x: clip;
  scroll-behavior: smooth;
}

body {
  min-width: 0;
  overflow-x: clip;
  background: var(--surface);
  color: var(--ink);
}

main,
#main-content,
section,
.section-inner,
.page-hero-inner,
.hero-grid,
.footer-inner,
.primary-nav {
  min-width: 0;
}

img,
picture,
svg,
video,
iframe {
  max-width: 100%;
}

p,
li,
a,
label,
input,
select,
textarea,
button,
.site-footer span {
  overflow-wrap: anywhere;
}

:where(a, button, input, select, textarea, summary):focus-visible {
  outline-color: var(--focus) !important;
  outline-style: solid !important;
  outline-width: 3px !important;
  outline-offset: 3px !important;
}

#main-content:focus-visible {
  outline-color: var(--focus) !important;
  outline-style: solid !important;
  outline-width: 3px !important;
  outline-offset: -3px !important;
}

.skip-link {
  position: fixed;
  top: 8px;
  left: 12px;
  z-index: 1000;
  padding: 10px 14px;
  border-radius: 6px;
  background: #fff;
  color: var(--navy);
  font-weight: 800;
  box-shadow: 0 4px 18px rgba(6, 34, 74, 0.22);
  transform: translateY(-160%);
}

.skip-link:focus,
.skip-link:focus-visible {
  transform: translateY(0);
}

/* Header: the only mobile state is .primary-nav.is-open. */
.site-header.human-site-header[data-site-header] {
  position: sticky;
  top: 0;
  z-index: 100;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: clamp(12px, 1.6vw, 24px);
  min-height: 66px;
  padding: 9px clamp(18px, 4vw, 56px);
  border-bottom: 1px solid rgba(213, 224, 233, 0.95);
  background: rgba(255, 255, 255, 0.98);
  box-shadow: 0 4px 18px rgba(6, 34, 74, 0.06);
  backdrop-filter: blur(12px);
}

.site-header.human-site-header .brand {
  min-width: 0;
  max-width: 300px;
}

.site-header.human-site-header .brand-mark {
  flex: 0 0 auto;
  width: 38px;
  height: 38px;
  border-radius: 6px;
  background: linear-gradient(135deg, var(--navy) 0 58%, var(--teal) 58% 78%, var(--gold) 78%);
  box-shadow: none;
}

.site-header.human-site-header .brand-copy,
.site-header.human-site-header .brand-copy strong,
.site-header.human-site-header .brand-copy small {
  min-width: 0;
}

.site-header.human-site-header .brand-copy strong {
  color: var(--navy);
  font-size: 15px;
  line-height: 1.15;
}

.site-header.human-site-header .brand-copy small {
  color: var(--muted);
  font-size: 10px;
  line-height: 1.25;
}

.site-header.human-site-header button.nav-toggle[data-nav-toggle] {
  display: none !important;
  width: 44px;
  height: 44px;
  min-width: 44px;
  padding: 9px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #fff;
  color: var(--navy);
  cursor: pointer;
}

.site-header.human-site-header button.nav-toggle[data-nav-toggle] span {
  display: block;
  width: 22px;
  height: 2px;
  margin: 4px auto;
  border-radius: 1px;
  background: currentColor;
}

.site-header.human-site-header nav.primary-nav[data-primary-nav] {
  position: static;
  inset: auto;
  display: flex !important;
  align-items: center;
  justify-content: flex-end;
  gap: 4px;
  width: auto;
  max-height: none;
  padding: 0 !important;
  overflow: visible;
  border: 0;
  background: transparent;
  box-shadow: none;
}

.site-header.human-site-header .nav-menu {
  position: relative;
  min-width: 0;
}

.site-header.human-site-header .nav-menu-button,
.site-header.human-site-header .nav-link {
  min-height: 40px;
  padding: 8px 10px;
  border: 0;
  border-radius: 5px;
  background: transparent;
  color: #213654;
  font: inherit;
  font-size: 14px;
  font-weight: 800;
  line-height: 1.2;
  white-space: nowrap;
}

.site-header.human-site-header .nav-menu-button:hover,
.site-header.human-site-header .nav-link:hover,
.site-header.human-site-header .nav-menu-button:focus-visible,
.site-header.human-site-header .nav-link:focus-visible {
  background: #eaf4f5;
  color: var(--teal-dark);
}

.site-header.human-site-header .nav-link[aria-current="page"],
.site-header.human-site-header .nav-submenu a[aria-current="page"] {
  color: var(--teal-dark);
  text-decoration-color: var(--gold);
  text-decoration-thickness: 2px;
}

.site-header.human-site-header .nav-submenu {
  position: absolute;
  top: calc(100% + 7px);
  left: 0;
  z-index: 110;
  width: max-content;
  min-width: 230px;
  max-width: min(320px, calc(100vw - 32px));
  padding: 7px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: #fff;
  box-shadow: var(--shadow);
}

.site-header.human-site-header .nav-submenu[hidden] {
  display: none !important;
}

.site-header.human-site-header .nav-submenu a {
  display: block;
  padding: 10px 11px;
  border-radius: 4px;
  color: #213654;
  line-height: 1.35;
}

.site-header.human-site-header .nav-submenu a:hover,
.site-header.human-site-header .nav-submenu a:focus-visible {
  background: #eaf4f5;
  color: var(--teal-dark);
}

.site-header.human-site-header .header-call {
  display: grid;
  justify-self: end;
  gap: 1px;
  width: auto;
  min-width: 116px;
  padding: 8px 13px;
  border: 1px solid var(--navy);
  border-radius: 6px;
  background: var(--navy);
  color: #fff;
  text-align: center;
  line-height: 1.1;
  white-space: nowrap;
}

.site-header.human-site-header .header-call:hover {
  background: var(--teal-dark);
  border-color: var(--teal-dark);
}

.site-header.human-site-header .call-label {
  font-size: 10px;
}

.site-header.human-site-header .call-number {
  font-size: 13px;
}

/* Homepage: seven clear, full-width content bands. */
main > .hero {
  min-height: clamp(560px, calc(100svh - 66px), 760px);
  padding: clamp(42px, 6vw, 76px) clamp(18px, 5vw, 64px);
}

main > .hero + .section,
main > .hero ~ .section {
  padding-block: clamp(58px, 7vw, 88px);
}

main > .hero ~ .section.soft {
  background: var(--soft);
}

main > .hero ~ .section.process {
  border-block: 1px solid var(--line);
  background: #fff;
}

main > .hero ~ .section:last-child {
  padding-bottom: clamp(68px, 8vw, 104px);
}

.hero-grid,
.section-inner {
  width: min(1180px, 100%);
}

.hero-copy h1 {
  max-width: 700px;
}

.hero .calc-card {
  overflow: hidden;
  border-top: 4px solid var(--gold);
}

.hero .calc-card figcaption {
  padding: 16px 18px 18px;
  background: #fff;
  color: var(--navy);
}

/* The local proof row reads as a deliberate location trust strip. */
.trust-row,
.location-trust-strip {
  display: flex;
  align-items: center;
  gap: 12px 22px;
  width: fit-content;
  max-width: 100%;
  padding: 12px 16px;
  border: 1px solid #c8dce0;
  border-left: 4px solid var(--teal);
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.94);
  color: var(--navy);
  box-shadow: 0 8px 22px rgba(6, 34, 74, 0.07);
}

.trust-row a,
.location-trust-strip a,
.local-trust-strip a {
  color: var(--teal-dark);
  text-decoration: underline;
  text-underline-offset: 3px;
}

.trust-row b {
  color: var(--teal-dark);
  border-color: #a9d0d2;
}

.local-trust-strip {
  width: 100%;
  border-block: 1px solid #c8dce0;
  border-left: 4px solid var(--teal);
  background: #f6fafb;
}

.local-trust-strip-inner {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 22px;
  width: min(1180px, 100%);
  margin-inline: auto;
  padding: 12px clamp(18px, 5vw, 64px);
  color: var(--navy);
  font-size: 13px;
  line-height: 1.45;
}

/* Static-page heroes use real photography and stay compact. */
.page-hero:not(.page-hero-carousel),
.visual-page-intro {
  min-height: clamp(330px, 34vw, 470px);
  display: grid;
  align-items: center;
  padding: clamp(48px, 6vw, 76px) clamp(18px, 5vw, 64px);
  background:
    linear-gradient(90deg, rgba(244, 248, 250, 0.99) 0%, rgba(244, 248, 250, 0.95) 42%, rgba(244, 248, 250, 0.68) 64%, rgba(244, 248, 250, 0.2) 100%),
    image-set(
      url("/images/hero-home-1280.avif") type("image/avif"),
      url("/images/hero-home-1280.webp") type("image/webp"),
      url("/images/hero-home.png") type("image/png")
    ) center / cover no-repeat;
}

.page-hero.page-hero-photo {
  background:
    linear-gradient(90deg, rgba(244, 248, 250, 0.99) 0%, rgba(244, 248, 250, 0.92) 42%, rgba(244, 248, 250, 0.48) 68%, rgba(244, 248, 250, 0.12) 100%),
    var(--page-hero-image) center / cover no-repeat;
}

.page-hero:not(.page-hero-carousel) .page-hero-inner,
.visual-page-intro .section-inner {
  width: min(1180px, 100%);
  margin-inline: auto;
  text-align: left;
}

.page-hero:not(.page-hero-carousel) h1,
.visual-page-intro h1 {
  max-width: 760px;
  margin-right: 0;
  margin-left: 0;
  font-size: clamp(38px, 5vw, 62px);
  line-height: 1.04;
}

.page-hero:not(.page-hero-carousel) .section-lede,
.visual-page-intro .center-title,
.visual-page-intro .center-title p {
  max-width: 700px;
  margin-right: 0;
  margin-left: 0;
  color: #3e526a;
  text-align: left;
}

.contact-hero {
  min-height: clamp(320px, 32vw, 420px) !important;
}

.about-page-hero .about-hero-copy {
  display: grid;
  grid-template-columns: minmax(0, 1.45fr) minmax(220px, 0.55fr);
  align-items: center;
  gap: 10px clamp(32px, 6vw, 88px);
  width: 100%;
  text-align: left;
}

.about-page-hero .about-hero-copy .hero-headshot {
  grid-column: 2;
  grid-row: 1 / span 3;
  width: min(270px, 100%);
  height: auto !important;
  aspect-ratio: 1 / 1;
  margin-inline: auto;
  border: 4px solid #fff;
  border-radius: 7px;
  box-shadow: var(--shadow);
  object-fit: cover;
  object-position: center top;
}

.about-page-hero .about-hero-copy h1,
.about-page-hero .about-hero-copy p {
  grid-column: 1;
  margin-right: 0;
  margin-left: 0;
  text-align: left;
}

/* Carousel controls remain outside the caption and media stacking context. */
.page-hero-carousel {
  min-height: auto;
  padding-block: clamp(54px, 7vw, 84px);
  background: linear-gradient(135deg, #eef5f7 0%, #fff 62%, #f8f6ee 100%);
}

.hero-carousel {
  padding-bottom: 0;
}

.hero-carousel-track {
  border-color: #b9c8d6;
}

.hero-carousel-slide figcaption {
  padding: 28px 28px 30px;
}

.hero-carousel > .hero-carousel-controls {
  position: static !important;
  inset: auto !important;
  z-index: auto;
  display: flex;
  justify-content: center;
  gap: 10px;
  width: 100%;
  margin-top: 14px;
  pointer-events: auto;
}

.hero-carousel-controls > button {
  width: 42px;
  height: 42px;
  border: 1px solid var(--navy);
  background: var(--navy);
  color: #fff;
  box-shadow: 0 7px 16px rgba(6, 34, 74, 0.14);
}

.hero-carousel-controls > button:hover {
  border-color: var(--teal-dark);
  background: var(--teal-dark);
}

.hero-carousel-dots {
  min-height: 42px;
  padding: 8px 12px;
  background: #dce7eb;
}

.hero-carousel-dots button {
  background: #61768a;
}

.hero-carousel-dots button.is-active {
  background: #9b6800;
}

/* Forms retain visible labels, predictable sizing and clear states. */
form label:not(.consent-line) {
  display: grid;
  gap: 6px;
  color: inherit;
  font-size: 14px;
  font-weight: 800;
  line-height: 1.35;
}

.input,
input:not([type="checkbox"]):not([type="radio"]):not([type="hidden"]),
select,
textarea {
  width: 100%;
  min-height: 46px;
  padding: 11px 13px;
  border: 1px solid #9fb0c2;
  border-radius: 6px;
  background: #fff;
  color: var(--ink);
  font: inherit;
  line-height: 1.35;
}

textarea {
  min-height: 112px;
  resize: vertical;
}

input::placeholder,
textarea::placeholder {
  color: #68798c;
  opacity: 1;
}

input:invalid:not(:placeholder-shown),
textarea:invalid:not(:placeholder-shown),
select:invalid {
  border-color: #a84c35;
}

.lead-card {
  border-radius: 7px;
  background: var(--navy);
}

.lead-card label:not(.consent-line) > span {
  color: #f2f6fa;
}

.lead-card details {
  border-top: 1px solid rgba(255, 255, 255, 0.18);
  padding-top: 4px;
}

.lead-card summary {
  padding: 9px 0;
  color: #fff;
  font-weight: 800;
  cursor: pointer;
}

.consent-line {
  grid-template-columns: 20px minmax(0, 1fr);
}

.consent-line input[type="checkbox"] {
  width: 18px;
  height: 18px;
  margin: 2px 0 0;
  accent-color: var(--gold);
}

.consent-line a {
  color: #fff;
  text-decoration: underline;
  text-underline-offset: 2px;
}

#position-check {
  scroll-margin-top: 88px;
}

.contact-page-grid {
  width: min(880px, 100%);
  grid-template-columns: 1fr;
  align-items: start;
}

.contact-page-grid #position-check {
  order: -1;
  width: 100%;
  max-width: none;
}

/* Four-column legal footer with a readable, untruncated licence line. */
.site-footer.human-site-footer {
  padding: clamp(54px, 6vw, 76px) clamp(18px, 5vw, 64px) 26px;
  background: #021735;
  color: #dce7f1;
}

.site-footer.human-site-footer .footer-inner {
  display: grid;
  grid-template-columns: minmax(280px, 1.4fr) repeat(3, minmax(150px, 1fr)) !important;
  gap: clamp(26px, 4vw, 48px);
  width: min(1180px, 100%);
  margin-inline: auto;
}

.site-footer.human-site-footer .footer-column {
  display: block !important;
  min-width: 0;
}

.site-footer.human-site-footer .footer-intro p,
.site-footer.human-site-footer .credit-disclosure {
  display: block;
  max-width: 460px;
  color: #dce7f1;
  font-size: 13px;
  line-height: 1.6;
  white-space: normal;
  overflow: visible;
}

.site-footer.human-site-footer h2 {
  margin: 4px 0 14px;
  color: #fff;
  font-size: 16px;
}

.site-footer.human-site-footer a,
.site-footer.human-site-footer span {
  color: #dce7f1;
  line-height: 1.45;
}

.site-footer.human-site-footer a:hover {
  color: #fff;
  text-decoration: underline;
  text-decoration-color: var(--gold);
  text-underline-offset: 3px;
}

.site-footer.human-site-footer .footer-bottom {
  padding-top: 22px;
  border-top: 1px solid rgba(220, 231, 241, 0.18);
  color: #aebfd0;
}

@media (max-width: 1100px) {
  .site-header.human-site-header {
    gap: 10px;
    padding-inline: 18px;
  }

  .site-header.human-site-header .nav-menu-button,
  .site-header.human-site-header .nav-link {
    padding-inline: 8px;
    font-size: 13px;
  }

  .site-footer.human-site-footer .footer-inner {
    grid-template-columns: minmax(230px, 1.25fr) repeat(3, minmax(130px, 1fr)) !important;
    gap: 26px;
  }
}

@media (max-width: 980px) {
  .site-header.human-site-header[data-site-header] {
    grid-template-columns: minmax(0, 1fr) auto auto;
    min-height: 64px;
  }

  .site-header.human-site-header button.nav-toggle[data-nav-toggle] {
    display: block !important;
    grid-column: 2;
  }

  .site-header.human-site-header nav.primary-nav[data-primary-nav] {
    position: absolute;
    top: 100%;
    right: 0;
    left: 0;
    display: none !important;
    flex-direction: column;
    align-items: stretch;
    gap: 2px;
    width: 100%;
    max-height: calc(100svh - 64px);
    padding: 10px 14px 16px !important;
    overflow-x: hidden;
    overflow-y: auto;
    border-bottom: 1px solid var(--line);
    background: #fff;
    box-shadow: 0 18px 30px rgba(6, 34, 74, 0.14);
  }

  .site-header.human-site-header nav.primary-nav[data-primary-nav].is-open {
    display: flex !important;
  }

  .site-header.human-site-header .nav-menu,
  .site-header.human-site-header .nav-menu-button,
  .site-header.human-site-header .nav-link {
    width: 100%;
  }

  .site-header.human-site-header .nav-menu-button,
  .site-header.human-site-header .nav-link {
    min-height: 44px;
    justify-content: space-between;
    padding: 11px 12px;
    font-size: 15px;
    text-align: left;
    white-space: normal;
  }

  .site-header.human-site-header .nav-submenu {
    position: static;
    width: 100%;
    max-width: none;
    margin: 2px 0 7px;
    border: 0;
    border-left: 3px solid var(--teal);
    border-radius: 0;
    box-shadow: none;
  }

  .site-header.human-site-header .nav-submenu a {
    min-height: 42px;
    padding: 10px 14px;
  }

  .hero-grid,
  .split,
  .faq-grid,
  .content-grid,
  .guide-layout,
  .page-hero-carousel .page-hero-inner {
    grid-template-columns: 1fr;
  }

  main > .hero {
    min-height: auto;
  }

  .hero-carousel {
    max-width: 620px;
    margin-inline: auto;
  }

  .site-footer.human-site-footer .footer-inner {
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
  }
}

@media (max-width: 680px) {
  .section,
  main > .hero + .section,
  main > .hero ~ .section {
    padding: 52px 18px;
  }

  main > .hero {
    padding: 42px 18px 48px;
    background:
      linear-gradient(180deg, rgba(246, 250, 252, 0.98) 0%, rgba(246, 250, 252, 0.93) 66%, rgba(246, 250, 252, 0.78) 100%),
      var(--hero-image) 68% center / cover no-repeat;
  }

  .page-hero:not(.page-hero-carousel) {
    min-height: 350px;
    padding: 46px 18px 50px;
    background:
      linear-gradient(180deg, rgba(244, 248, 250, 0.98) 0%, rgba(244, 248, 250, 0.93) 62%, rgba(244, 248, 250, 0.68) 100%),
      image-set(
        url("/images/hero-home-640.avif") type("image/avif"),
        url("/images/hero-home-640.webp") type("image/webp"),
        url("/images/hero-home.png") type("image/png")
      ) 64% center / cover no-repeat;
  }

  .page-hero.page-hero-photo {
    background:
      linear-gradient(180deg, rgba(244, 248, 250, 0.98) 0%, rgba(244, 248, 250, 0.9) 60%, rgba(244, 248, 250, 0.56) 100%),
      var(--page-hero-image) center / cover no-repeat;
  }

  .page-hero:not(.page-hero-carousel) h1,
  .visual-page-intro h1 {
    font-size: clamp(34px, 10vw, 44px);
    line-height: 1.07;
  }

  .page-hero:not(.page-hero-carousel) .section-lede {
    font-size: 17px;
  }

  .about-page-hero .about-hero-copy {
    grid-template-columns: 1fr;
    text-align: left;
  }

  .about-page-hero .about-hero-copy .hero-headshot {
    grid-column: 1;
    grid-row: auto;
    width: 150px;
    margin: 0 0 12px;
  }

  .about-page-hero .about-hero-copy h1,
  .about-page-hero .about-hero-copy p {
    grid-column: 1;
  }

  .hero-carousel-track {
    min-height: 0;
    aspect-ratio: 1 / 1.2;
  }

  .hero-carousel-slide figcaption {
    padding: 22px 20px 24px;
  }

  .hero-carousel-slide figcaption strong,
  .pathway-board h2 {
    font-size: 24px;
    line-height: 1.1;
  }

  .hero-carousel-slide figcaption p,
  .pathway-board p {
    font-size: 14px;
    line-height: 1.45;
  }

  .trust-row,
  .location-trust-strip {
    align-items: flex-start;
    width: 100%;
  }

  .form-row {
    grid-template-columns: 1fr;
  }

  .hero-actions,
  .cta-row {
    align-items: stretch;
  }

  .button,
  .button.secondary {
    width: 100%;
    text-align: center;
  }
}

@media (max-width: 540px) {
  .site-header.human-site-header[data-site-header] {
    gap: 7px;
    padding-inline: 12px;
  }

  .site-header.human-site-header .brand {
    gap: 8px;
  }

  .site-header.human-site-header .brand-mark {
    width: 34px;
    height: 34px;
  }

  .site-header.human-site-header .brand-copy strong {
    font-size: 13px;
  }

  .site-header.human-site-header .brand-copy small {
    display: none;
  }

  .site-header.human-site-header .header-call {
    min-width: 0;
    padding: 9px 10px;
  }

  .site-header.human-site-header .call-number {
    display: none;
  }

  .site-header.human-site-header .call-label {
    font-size: 12px;
  }

  .trust-row,
  .location-trust-strip,
  .local-trust-strip {
    display: grid;
    grid-template-columns: 1fr;
    gap: 10px;
  }

  .steps,
  .loan-grid,
  .product-grid,
  .authority-grid,
  .article-grid,
  .checkpoint-grid,
  .scheme-grid,
  .strategy-grid,
  .help-metrics,
  .stats {
    grid-template-columns: 1fr;
  }

  .site-footer.human-site-footer .footer-inner {
    grid-template-columns: 1fr !important;
    gap: 28px;
  }
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}
