/* ==========================================================================
   LAYOUT STYLES: Header, Navigation, Hero, Sections, Grids & Footer
   ========================================================================== */

/* --------------------------------------------------------------------------
   Site Header & Brand
   -------------------------------------------------------------------------- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 20;
  background-color: var(--bg);
  border-bottom: 1px solid var(--line);
  display: flex;
  align-items: center;
  gap: 16px;
  min-height: 80px;
  padding: 10px var(--gutter);
  box-sizing: border-box;
}

.brand {
  order: 1;
  display: inline-flex;
  align-items: center;
  gap: 12px;
  text-decoration: none;
  font: 800 19.5px/1.2 var(--font-head);
  color: var(--heading);
  white-space: nowrap;
  letter-spacing: -0.01em;
}

.brand img {
  width: 60px;
  height: 60px;
  object-fit: contain;
  flex-shrink: 0;
  display: block;
}

.brand span {
  display: inline-block;
  line-height: 1.15;
}

/* --------------------------------------------------------------------------
   Desktop Navigation
   -------------------------------------------------------------------------- */
.nav {
  order: 2;
  margin-left: auto;
}

.nav__list,
.nav__sub {
  list-style: none;
  margin: 0;
  padding: 0;
}

.nav__list {
  display: flex;
  gap: 4px;
  align-items: center;
}

.nav__item {
  position: relative;
}

.nav__link {
  display: block;
  font: 600 15px/1.4 var(--font-body);
  color: var(--heading);
  padding: 12px 10px;
  text-decoration: none;
  letter-spacing: 0;
}

.nav__link[aria-current="page"] {
  box-shadow: inset 0 -3px var(--amber);
}

/* Submenu Dropdown */
.nav__sub {
  display: none;
  position: absolute;
  left: 0;
  top: 100%;
  background-color: var(--card-bg, var(--bg));
  border: 1px solid var(--line);
  border-top: 3px solid var(--amber);
  border-radius: 0 0 6px 6px;
  padding: 10px 12px;
  min-width: 260px;
  box-shadow: 0 16px 36px rgba(0, 0, 0, 0.15);
  z-index: 100;
  animation: navFade 0.2s cubic-bezier(0.16, 1, 0.3, 1) both;
}

.nav__sub::before {
  content: "";
  position: absolute;
  top: -10px;
  left: 0;
  right: 0;
  height: 10px;
}

@media (min-width: 901px) {
  .nav__item:nth-child(5) > .nav__sub,
  .nav__item:nth-child(6) > .nav__sub {
    left: auto;
    right: 0;
  }
}

@keyframes navFade {
  from {
    opacity: 0;
    transform: translateY(6px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.nav__item:hover > .nav__sub,
.nav__item:focus-within > .nav__sub {
  display: block;
}

.nav__group {
  font: 800 14px/1.25 var(--font-head);
  color: var(--blue);
  margin: 10px 0 4px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.nav__sub a {
  display: block;
  padding: 6px 10px;
  font: 600 15px/1.4 var(--font-body);
  letter-spacing: 0;
  text-decoration: none;
  color: var(--text);
  border-radius: 4px;
  transition: background-color 0.15s ease, color 0.15s ease, transform 0.15s ease;
}

.nav__sub a:hover,
.nav__sub a:focus {
  background-color: var(--bg-soft);
  color: var(--blue);
  transform: translateX(3px);
}

.nav__sub a[aria-current="page"] {
  color: var(--blue);
  font-weight: 700;
  background-color: var(--bg-soft);
}

.nav__cta {
  margin-left: 8px;
}

.nav__cta .btn {
  padding: 10px 18px;
  white-space: nowrap;
  box-shadow: 0 4px 14px rgba(245, 158, 11, 0.28);
}

/* Header Action Controls */
.theme-toggle {
  order: 3;
  margin-left: 0;
}

.nav-toggle {
  order: 4;
  display: none;
  margin-left: 0;
  font: 600 15px/1.4 var(--font-body);
  background: none;
  border: 1px solid var(--line);
  color: var(--heading);
  padding: 8px 14px;
  cursor: pointer;
  border-radius: 4px;
}

/* --------------------------------------------------------------------------
   Hero Sections
   -------------------------------------------------------------------------- */
.hero {
  position: relative;
  min-height: 84vh;
  display: flex;
  align-items: flex-end;
  color: #ffffff;
  background-color: var(--navy);
  overflow: hidden;
}

.hero--page {
  min-height: 44vh;
}

.hero__img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.hero::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 1;
  background: linear-gradient(
    90deg,
    rgba(11, 42, 91, 0.95) 8%,
    rgba(11, 42, 91, 0.6) 60%,
    rgba(11, 42, 91, 0.2)
  );
}

.hero__body {
  position: relative;
  z-index: 2;
  padding: 0 var(--gutter) 9vh;
  max-width: 820px;
}

.hero__title {
  color: #ffffff;
  font-size: clamp(34px, 5vw, 60px);
  font-weight: 900;
  line-height: 1.1;
  border-bottom: 8px solid var(--amber);
  padding-bottom: 0.2em;
  display: inline-block;
  max-width: 100%;
  overflow-wrap: anywhere;
  animation: reveal 0.9s ease-out both;
}

@media (max-width: 600px) {
  .hero__title {
    font-size: clamp(30px, 9vw, 42px);
  }
}

.hero__lead {
  font-size: 18px;
  line-height: 1.6;
  max-width: 700px;
  margin: 18px 0 28px;
  color: inherit;
}

.hero--slideshow {
  min-height: clamp(480px, 84vh, 900px);
}

.hero__slides {
  position: absolute;
  inset: 0;
  z-index: 1;
}

.hero--slideshow::before {
  display: none;
}

.hero__slide {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: flex-start;
  isolation: isolate;
}

.hero__slide[hidden],
.hero__controls[hidden] {
  display: none;
}

.hero__slide .hero__img {
  z-index: 0;
}

.hero__slide::after {
  position: absolute;
  z-index: 1;
  inset: 0;
  content: "";
  pointer-events: none;
  background: linear-gradient(
    90deg,
    rgba(11, 42, 91, 0.92) 8%,
    rgba(11, 42, 91, 0.62) 60%,
    rgba(11, 42, 91, 0.22)
  );
}

.hero__slide .hero__body {
  z-index: 2;
  max-width: 1040px;
  padding-top: clamp(24px, 4vh, 48px);
  padding-bottom: clamp(88px, 10vh, 120px);
}

.hero__eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  margin: 0 0 18px;
  color: #fff;
  font-size: 13px;
  font-weight: 800;
  letter-spacing: 0.14em;
  line-height: 1.4;
  text-transform: uppercase;
}

.hero__eyebrow::before {
  width: 9px;
  height: 9px;
  flex: 0 0 auto;
  content: "";
  background: var(--amber);
}

.hero__slide .hero__title {
  max-width: 960px;
  margin-top: 0;
  margin-bottom: 0.45em;
  text-wrap: balance;
  animation: none;
}

.hero__controls {
  position: absolute;
  z-index: 3;
  left: var(--gutter);
  bottom: 30px;
  display: flex;
  align-items: center;
  gap: 10px;
}

.hero__control,
.hero__pagination button {
  display: grid;
  width: 44px;
  height: 44px;
  place-items: center;
  border: 1px solid rgba(255, 255, 255, 0.72);
  border-radius: 50%;
  background: rgba(11, 42, 91, 0.72);
  color: #fff;
  cursor: pointer;
  transition: background-color 160ms ease, border-color 160ms ease, transform 160ms ease;
}

.hero__control:hover,
.hero__control:focus-visible,
.hero__pagination button:hover,
.hero__pagination button:focus-visible {
  border-color: #fff;
  background: var(--blue);
}

.hero__control:focus-visible,
.hero__pagination button:focus-visible {
  outline: 3px solid var(--amber);
  outline-offset: 3px;
}

.hero__pagination {
  display: flex;
  align-items: center;
  gap: 7px;
}

.hero__pagination button {
  width: 12px;
  height: 12px;
  padding: 0;
  border: 0;
  background: rgba(255, 255, 255, 0.55);
}

.hero__pagination button[aria-current="true"] {
  width: 30px;
  border-radius: 10px;
  background: var(--amber);
}

@keyframes heroSlideReveal {
  from {
    opacity: 0.35;
  }
  to {
    opacity: 1;
  }
}

.hero__slide:not([hidden]) {
  animation: heroSlideReveal 450ms ease-out both;
}

@media (max-width: 600px) {
  .hero--slideshow {
    min-height: clamp(640px, 84vh, 900px);
  }

  .hero__slide .hero__body {
    padding-top: clamp(24px, 4vh, 40px);
    padding-bottom: 88px;
  }

  .hero__eyebrow {
    max-width: 32ch;
    font-size: 11px;
    letter-spacing: 0.1em;
  }

  .hero__controls {
    left: var(--gutter);
    bottom: 22px;
    gap: 6px;
  }

  .hero__pagination {
    gap: 3px;
  }

  .hero__pagination button {
    width: 8px;
    height: 8px;
  }

  .hero__pagination button[aria-current="true"] {
    width: 20px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .hero__slide:not([hidden]) {
    animation: none;
  }

  .hero__control,
  .hero__pagination button {
    transition: none;
  }
}

@keyframes reveal {
  from {
    clip-path: inset(0 100% 0 0);
  }
  to {
    clip-path: inset(0);
  }
}

/* Breadcrumbs */
.crumbs ol {
  list-style: none;
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin: 0 0 10px;
  padding: 0;
  font-size: 14px;
}

.crumbs li + li::before {
  content: "/";
  margin-right: 6px;
}

.crumbs a {
  color: #ffffff;
}

/* --------------------------------------------------------------------------
   Content Containers & Grids
   -------------------------------------------------------------------------- */
.section {
  padding: 68px var(--gutter);
}

.section--soft {
  background-color: var(--bg-soft);
}

.container {
  max-width: var(--max);
  margin: 0 auto;
}

.section > .container > h2 + p {
  width: 100%;
  max-width: 650px;
  margin-left: auto;
  margin-right: auto;
  text-align: center;
  text-wrap: balance;
}

.section--soft .container > #s110 + p,
.section .container > #s111 + p {
  margin-left: 0;
  margin-right: 0;
  text-align: left;
}

.section:has(> .container > h2 + p + a.btn[href*="quote"]) > .container {
  text-align: center;
}

.grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 22px;
  list-style: none;
  padding: 0;
  margin: 0;
}

.split {
  display: grid;
  grid-template-columns: minmax(240px, 380px) 1fr;
  gap: 40px;
  align-items: start;
}

/* --------------------------------------------------------------------------
   Site Footer
   -------------------------------------------------------------------------- */
.site-footer {
  background-color: var(--navy);
  color: #c9d6f2;
  padding: 50px var(--gutter) 90px;
}

.site-footer a {
  color: #ffffff;
}

.site-footer h2 {
  color: #ffffff;
  font-size: 20px;
  line-height: 1.25;
  margin: 0 0 14px;
}

.site-footer p {
  color: inherit;
  margin: 0 0 1em;
}

.site-footer address {
  color: inherit;
  font-style: normal;
}

.site-footer .grid {
  column-gap: clamp(24px, 3vw, 40px);
  row-gap: 32px;
}

.footer-social-links {
  display: grid;
  grid-template-columns: repeat(3, max-content);
  align-items: center;
  gap: 12px 18px;
}

.legal {
  margin-top: 30px;
  font-size: 14px;
}

/* --------------------------------------------------------------------------
   Responsive Media Queries (Desktop Compact, Tablet & Mobile)
   -------------------------------------------------------------------------- */
@media (max-width: 1100px) and (min-width: 901px) {
  .site-header {
    min-height: 76px;
    padding: 10px clamp(16px, 3vw, 24px);
    gap: 12px;
  }

  .brand {
    gap: 10px;
  }

  .brand img {
    width: 56px;
    height: 56px;
  }

  .brand span {
    font-size: 18px;
  }

  .nav__list {
    gap: 2px;
  }

  .nav__link {
    padding: 10px 7px;
  }

  .nav__cta {
    margin-left: 4px;
  }

  .nav__cta .btn {
    padding: 8px 13px;
  }

  .theme-toggle {
    width: 40px;
    height: 40px;
  }
}

@media (max-width: 900px) {
  .site-header {
    min-height: 76px;
    padding: 10px clamp(16px, 4vw, 24px);
    gap: 10px;
  }

  .brand {
    gap: 10px;
  }

  .brand img {
    width: 56px;
    height: 56px;
  }

  .brand span {
    font-size: 17.5px;
  }

  .theme-toggle {
    order: 2;
    margin-left: auto;
    width: 40px;
    height: 40px;
  }

  .nav-toggle {
    order: 3;
    display: block;
    margin-left: 8px;
    padding: 8px 13px;
  }

  .nav {
    order: 4;
    display: none;
    position: absolute;
    left: 0;
    right: 0;
    top: 100%;
    background-color: var(--bg);
    border-bottom: 1px solid var(--line);
    padding: 10px var(--gutter) 18px;
    max-height: 75vh;
    overflow-y: auto;
    margin: 0;
  }

  .nav.is-open {
    display: block;
  }

  .nav__list {
    flex-direction: column;
    align-items: stretch;
  }

  .nav__sub {
    display: block;
    position: static;
    border: 0;
    box-shadow: none;
    padding: 4px 0 10px 14px;
    margin-left: 8px;
    border-left: 2px solid var(--line);
    animation: none;
    border-radius: 0;
    min-width: 0;
  }

  .nav__sub a {
    padding: 8px 10px;
  }

  .nav__cta {
    margin: 12px 0 6px;
  }

  .nav__cta .btn {
    display: block;
    text-align: center;
    width: 100%;
  }

  .split {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 600px) {
  .site-header {
    min-height: 66px;
    padding: 8px clamp(12px, 3.5vw, 16px);
    gap: 8px;
  }

  .brand {
    gap: 8px;
  }

  .brand img {
    width: 50px;
    height: 50px;
  }

  .brand span {
    font-size: 15.5px;
  }

  .theme-toggle {
    width: 38px;
    height: 38px;
  }

  .nav-toggle {
    padding: 7px 11px;
    margin-left: 6px;
  }

  .hero__lead {
    font-size: 17px;
    line-height: 1.55;
  }
}

@media (max-width: 375px) {
  .site-header {
    padding: 8px 10px;
    gap: 6px;
  }

  .brand {
    gap: 7px;
  }

  .brand span {
    font-size: 14px;
    letter-spacing: -0.02em;
  }

  .theme-toggle {
    width: 36px;
    height: 36px;
  }

  .nav-toggle {
    padding: 6px 9px;
    margin-left: 4px;
  }
}
