/* ==========================================================================
   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;
  padding: 8px var(--gutter);
}

.brand {
  order: 1;
  display: flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  font: 900 19px var(--font-head);
  color: var(--heading);
}

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

/* --------------------------------------------------------------------------
   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 var(--font-body);
  color: var(--heading);
  padding: 12px 10px;
  text-decoration: none;
}

.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(--bg);
  border: 1px solid var(--line);
  padding: 14px;
  min-width: 240px;
  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.12);
}

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

.nav__group {
  font: 800 13px var(--font-head);
  color: var(--blue);
  margin: 8px 0 2px;
}

.nav__sub a {
  display: block;
  padding: 3px 0;
  font-size: 14.5px;
  text-decoration: none;
  color: var(--text);
}

.nav__sub a:hover {
  color: var(--blue);
}

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

.nav-toggle {
  order: 4;
  display: none;
  margin-left: 0;
  font: 600 15px 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(40px, 7vw, 84px);
  font-weight: 900;
  border-bottom: 8px solid var(--amber);
  padding-bottom: 0.2em;
  display: inline-block;
  animation: reveal 0.9s ease-out both;
}

.hero--page .hero__title {
  font-size: clamp(34px, 5vw, 60px);
}

.hero__lead {
  font-size: 20px;
  max-width: 560px;
  margin: 18px 0 28px;
}

@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;
}

.lead {
  font-size: 20px;
  max-width: 700px;
}

.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: 18px;
}

.site-footer p {
  margin: 0.3em 0;
}

.site-footer .grid {
  gap: 30px;
}

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

/* --------------------------------------------------------------------------
   Responsive Media Queries (Mobile & Tablet)
   -------------------------------------------------------------------------- */
@media (max-width: 900px) {
  .theme-toggle {
    order: 2;
    margin-left: auto;
  }

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

  .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: 0 0 6px 12px;
  }

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

  .brand span {
    display: none;
  }
}
