/* Base styles + header tokens from Figma */
@import "./site-footer.css";

:root {
  /* Colors */
  --color-text-title: #131313;
  /* Darkened for WCAG AA (~4.5:1) with white / light backgrounds */
  --color-brand: #057a44;
  --color-brand-dark: #046b3b;
  --color-brand-shadow: rgba(5, 122, 68, 0.2);
  --color-btn-secondary-bg: #ededed;
  --color-icon-stroke: #121217;
  --color-white: #ffffff;
  --color-text: #1a1a1a;
  --color-body-text: #6b6a6a;
  --color-text-muted: #5c5c5c;
  --color-bg: #ffffff;
  --color-bg-muted: rgba(237, 237, 237, 1);
  --color-border: #e2e8e4;

  /* Typography — Body/Text-sm (nav) */
  --text-sm-size: 14px;
  --text-sm-line: 1.4;
  --text-sm-weight: 400;

  /* Typography — button label */
  --btn-font-family: "Inter", system-ui, sans-serif;
  --btn-font-size: 14px;
  --btn-font-weight: 600;
  --btn-line-height: 1.5;

  /* Button shell (Small) */
  --btn-radius: 6px;
  --btn-padding-y: 8px;
  --btn-padding-x: 12px;
  --btn-gap: 8px;
  --btn-shadow-primary: 0 0 20px 4px var(--color-brand-shadow);

  --font-sans: "Inter", system-ui, -apple-system, "Segoe UI", sans-serif;
  --container-pad: clamp(1rem, 3vw, 2.5rem);
  --container-width: none;
  --radius: 0.5rem;
  --shadow: 0 8px 24px rgba(0, 0, 0, 0.08);
  --header-bar-radius: 9999px;
  --header-shadow: 0 4px 24px rgba(0, 0, 0, 0.06);

  /* Footer tokens (also defined on .site-footer in site-footer.css for app layouts) */
  --color-footer-bg: #121212;
  --color-footer-body-light: rgba(255, 255, 255, 0.7);
  --color-footer-white: #ffffff;
  --footer-radius: 1.5rem;
  --text-xs-size: 12px;
  --text-xs-line: 18px;
  --footer-heading-size: 16px;
  --footer-heading-line: 24px;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin: 0;
  padding: 20px;
  font-family: var(--font-sans);
  font-size: 1rem;
  line-height: 1.6;
  color: var(--color-text);
  background: var(--color-bg-muted);
}

img {
  display: block;
  max-width: 100%;
  height: auto;
}

a {
  color: var(--color-brand);
}

.container {
  width: 100%;
  max-width: var(--container-width);
  padding-inline: var(--container-pad);
  margin-inline: auto;
}

.skip-link {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
  z-index: 1000;
  background: var(--color-brand);
  color: #fff;
}

.skip-link:focus {
  width: auto;
  height: auto;
  margin: 0;
  clip: auto;
  left: 1rem;
  top: 1rem;
  padding: 0.5rem 1rem;
  white-space: normal;
}

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

html.is-nav-open {
  overflow: hidden;
}

/* Header */

.site-header {
  position: sticky;
  top: 20px;
  z-index: 100;
  padding: 0;
  background: transparent;
}

.site-header__inner {
  width: 100%;
  max-width: var(--container-width);
  padding-inline: var(--container-pad);
  margin-inline: auto;
}

.site-header__bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  min-height: 4.5rem;
  padding: 0.875rem 1.5rem 0.875rem 1.75rem;
  background: var(--color-white);
  border-radius: var(--header-bar-radius);
  box-shadow: var(--header-shadow);
}

.site-logo {
  flex-shrink: 0;
  text-decoration: none;
}

.site-logo img {
  height: 2.25rem;
  width: auto;
}

.site-header__toggle {
  display: none;
  align-items: center;
  justify-content: center;
  width: 2.5rem;
  height: 2.5rem;
  margin-left: auto;
  padding: 0;
  border: 0;
  border-radius: var(--btn-radius);
  background: transparent;
  color: var(--color-brand);
  cursor: pointer;
}

.site-header__toggle-icon--close {
  display: none;
}

.site-header.is-nav-open .site-header__toggle-icon--open {
  display: none;
}

.site-header.is-nav-open .site-header__toggle-icon--close {
  display: block;
}

.btn__label--mobile {
  display: none;
}

.site-nav {
  flex: 1;
  display: flex;
  justify-content: center;
  min-width: 0;
}

.site-nav__list {
  display: flex;
  flex-wrap: nowrap;
  align-items: center;
  gap: 1.25rem;
  margin: 0;
  padding: 0;
  list-style: none;
}

.site-nav__item {
  position: relative;
}

.site-nav__link {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  padding: 0;
  border: 0;
  background: none;
  font-family: var(--font-sans);
  font-size: var(--text-sm-size);
  font-weight: var(--text-sm-weight);
  line-height: var(--text-sm-line);
  color: var(--color-text-title);
  text-decoration: none;
  white-space: nowrap;
  cursor: pointer;
}

.site-nav__link:hover {
  color: var(--color-brand);
}

.site-nav__chevron {
  flex-shrink: 0;
  transition: transform 0.2s ease;
}

.site-nav__item--open .site-nav__chevron {
  transform: rotate(180deg);
}

.site-nav__item--open > .site-nav__link {
  color: var(--color-brand);
}

.site-nav__submenu {
  display: none;
  position: absolute;
  top: calc(100% + 0.75rem);
  left: 0;
  z-index: 110;
  min-width: 12rem;
  margin: 0;
  padding: 0;
  list-style: none;
  background: var(--color-white);
  border: 1px solid var(--color-border);
  border-radius: var(--btn-radius);
  box-shadow: var(--shadow);
}

.site-nav__item--open .site-nav__submenu {
  display: block;
}

.site-nav__submenu a {
  display: block;
  padding: 0.5rem 1rem;
  font-size: var(--text-sm-size);
  font-weight: var(--text-sm-weight);
  line-height: var(--text-sm-line);
  color: var(--color-text-title);
  text-decoration: none;
  white-space: nowrap;
}

.site-nav__submenu a:hover {
  color: var(--color-brand);
  background: var(--color-bg-muted);
}

.site-header__actions {
  display: flex;
  flex-shrink: 0;
  align-items: center;
  gap: 0.5rem;
}

/* Hero / homepage section styles live in home.css */
/* Footer styles: site-footer.css (@import above) */

@media (min-width: 64rem) {
  /* hero layout handled in home.css */
}

@media (max-width: 64rem) {
  .site-header__toggle {
    display: inline-flex;
  }

  .btn__label--desktop {
    display: none;
  }

  .btn__label--mobile {
    display: inline;
  }

  .site-nav,
  .site-header__actions {
    display: none;
  }

  .site-header.is-nav-open {
    z-index: 200;
  }

  .site-header.is-nav-open::before {
    content: "";
    position: fixed;
    inset: 0;
    z-index: -1;
    background: rgba(18, 18, 23, 0.45);
  }

  .site-header.is-nav-open .site-header__inner {
    width: min(100% - 1.5rem, 28rem);
    margin-inline: auto;
  }

  .site-header.is-nav-open .site-header__bar {
    display: grid;
    grid-template-columns: 1fr auto;
    align-items: center;
    gap: 0;
    min-height: 0;
    padding: 1rem 1.25rem 1.5rem;
    border-radius: 1.25rem;
    box-shadow: 0 16px 40px rgba(0, 0, 0, 0.18);
  }

  .site-header.is-nav-open .site-logo {
    grid-column: 1;
    grid-row: 1;
  }

  .site-header.is-nav-open .site-header__toggle {
    grid-column: 2;
    grid-row: 1;
    margin-left: 0;
  }

  .site-header.is-nav-open .site-nav,
  .site-header.is-nav-open .site-header__actions {
    display: flex;
    width: 100%;
    grid-column: 1 / -1;
  }

  .site-header.is-nav-open .site-nav {
    order: unset;
    flex-direction: column;
    justify-content: flex-start;
    margin-top: 1rem;
    padding-top: 1.25rem;
    border-top: 1px solid #e8e8e8;
  }

  .site-header.is-nav-open .site-header__actions {
    order: unset;
    flex-direction: column-reverse;
    align-items: stretch;
    gap: 0.75rem;
    margin-top: 1.25rem;
    padding-top: 1.25rem;
    border-top: 1px solid #e8e8e8;
  }

  .site-header.is-nav-open .site-header__actions .btn {
    width: 100%;
    justify-content: center;
    min-height: 2.75rem;
  }

  .site-nav__list {
    flex-direction: column;
    align-items: stretch;
    gap: 1.5rem;
    width: 100%;
  }

  .site-nav__link {
    width: 100%;
    justify-content: space-between;
    gap: 0.75rem;
    font-size: 1rem;
    font-weight: 500;
    line-height: 1.4;
  }

  .site-nav__chevron {
    color: var(--color-icon-stroke);
  }

  .site-nav__item--open > .site-nav__link,
  .site-nav__item--open .site-nav__chevron {
    color: var(--color-brand);
  }

  .site-nav__submenu {
    position: static;
    min-width: 0;
    width: 100%;
    margin: 0.875rem 0 0;
    padding: 0 0 0 0.25rem;
    border: 0;
    border-radius: 0;
    background: transparent;
    box-shadow: none;
  }

  .site-nav__submenu li + li {
    margin-top: 0.875rem;
  }

  .site-nav__submenu a {
    padding: 0;
    font-size: 0.9375rem;
    font-weight: 400;
    color: var(--color-text-title);
    background: transparent;
  }

  .site-nav__submenu a:hover {
    background: transparent;
    color: var(--color-brand);
  }
}
