/* ============================================================
   LAYOUT — Header, footer, container, grid helpers
   ============================================================ */

/* --- Container --- */
.container {
  width: 100%;
  max-width: var(--container-inner);
  margin-inline: auto;
  padding-inline: var(--space-lg);
}

.container--wide {
  max-width: var(--container-max);
  padding-inline: 0;
}

/* ============================================================
   SITE HEADER
   ============================================================ */
.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  width: 100%;
  background-color: var(--color-header-bg);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  border-bottom: 1px solid var(--color-header-border);
}

.site-header__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 22px var(--space-lg);
  width: 100%;
  min-height: var(--header-height);
}

.site-header__logo {
  display: flex;
  align-items: center;
  flex-shrink: 0;
  width: 320px;
}

.site-header__logo:hover {
  text-decoration: none;
}

.site-logo-img {
  display: block;
  width: 100%;
  max-width: 270px;
  height: auto;
}

/* ============================================================
   SITE NAVIGATION
   ============================================================ */
.site-nav {
  display: flex;
  align-items: center;
  position: relative;
}

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

.site-nav__link {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 13px 14px;
  font-family: var(--font-primary);
  font-size: var(--text-nav);
  font-weight: 400;
  text-transform: uppercase;
  color: var(--color-text-dark);
  white-space: nowrap;
  transition: color 0.2s ease;
}

.site-nav__link:hover,
.site-nav__link[aria-current="page"] {
  color: var(--color-red);
  text-decoration: none;
}

.site-nav__link--cta {
  border: 4px solid var(--color-red-cta);
  color: var(--color-red-cta);
  padding: 14px 12px;
}

.site-nav__link--cta:hover {
  color: var(--color-white);
  background-color: var(--color-red-cta);
  text-decoration: none;
}

/* Hamburger toggle — hidden on desktop */
.site-nav__toggle {
  display: none;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  gap: 5px;
  width: 44px;
  height: 44px;
  padding: 0;
  background: none;
  border: none;
  cursor: pointer;
  z-index: 200;
  flex-shrink: 0;
}

.site-nav__toggle span {
  display: block;
  width: 26px;
  height: 2px;
  background-color: var(--color-text-dark);
  transition: transform 0.3s ease, opacity 0.3s ease;
  flex-shrink: 0;
}

/* Open state — bars 1 and 3 move 7px (gap 5px + bar height 2px) */
.site-nav__toggle[aria-expanded="true"] span:nth-child(1) {
  transform: translateY(7px) rotate(45deg);
}
.site-nav__toggle[aria-expanded="true"] span:nth-child(2) {
  opacity: 0;
}
.site-nav__toggle[aria-expanded="true"] span:nth-child(3) {
  transform: translateY(-7px) rotate(-45deg);
}

/* ============================================================
   SITE FOOTER
   ============================================================ */
.site-footer {
  background-color: var(--color-footer-bg);
  color: var(--color-text-gray);
  overflow: hidden;
}

.site-footer__body {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr 1fr;
  gap: var(--space-xl);
  padding: var(--space-lg) var(--space-lg) 0;
  max-width: calc(var(--container-inner) + 2 * var(--space-lg));
  margin-inline: auto;
}

.site-footer__col-heading {
  font-size: var(--text-nav);
  font-weight: 400;
  color: var(--color-text-med);
  line-height: 1.2;
  margin-bottom: var(--space-lg);
}

.site-footer__logo-wrap {
  display: block;
  margin-bottom: var(--space-md);
  max-width: 160px;
  margin-left: -2px;
}

.site-footer__logo-wrap .site-logo-img {
  max-width: 100%;
}

.site-footer__blurb {
  font-size: var(--text-footer);
  font-weight: 400;
  color: var(--color-text-gray);
  line-height: 1.6;
}

.site-footer__contact-entry {
  margin-bottom: var(--space-md);
  font-size: var(--text-footer);
  line-height: 1.2;
}

.site-footer__contact-city {
  font-weight: 700;
  color: var(--color-text-gray);
}

.site-footer__contact-details {
  font-weight: 400;
}

.site-footer__links {
  display: flex;
  flex-direction: column;
  gap: var(--space-sm);
}

.site-footer__link {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: var(--text-footer);
  font-weight: 400;
  line-height: 1.2;
  color: var(--color-text-gray);
  transition: color 0.2s ease;
  border-bottom: 1px solid rgba(146, 148, 151, 0.4);
  padding-bottom: var(--space-sm);
}

.site-footer__link:hover {
  color: var(--color-text-dark);
  text-decoration: none;
}

.site-footer__link::after {
  content: '';
  display: inline-block;
  width: 6px;
  height: 6px;
  border-right: 2px solid var(--color-text-gray);
  border-top: 2px solid var(--color-text-gray);
  transform: rotate(45deg);
  margin-left: 10px;
  flex-shrink: 0;
  transition: border-color 0.2s ease;
}

.site-footer__link:hover::after {
  border-color: var(--color-text-dark);
}

.site-footer__bar {
  margin-top: var(--space-lg);
  background-color: var(--color-footer-bar);
}

.site-footer__copyright {
  max-width: calc(var(--container-inner) + 2 * var(--space-lg));
  margin-inline: auto;
  padding: 18px var(--space-lg);
  font-size: var(--text-footer);
  font-weight: 700;
  color: var(--color-text-gray);
}

/* ============================================================
   RESPONSIVE — Header & Footer
   ============================================================ */

/* ≤1600px — large desktop: begin compressing nav */
@media (max-width: 1600px) {
  .site-header__logo {
    width: 320px;
  }

  .site-nav__list {
    gap: 20px;
  }

  .site-nav__link {
    padding: 10px 10px;
  }
}

/* ≤1400px — laptop: reduce font + gap further, tighten footer */
@media (max-width: 1400px) {
  .site-header__logo {
    width: 260px;
  }

  .site-nav__list {
    gap: 12px;
  }

  .site-nav__link {
    font-size: 18px;
    padding: 8px 8px;
  }

  .site-footer__body {
    gap: var(--space-lg);
  }
}

/* ≤1280px — MacBook Pro 13" (1280px logical CSS width at 2× DPR): step down to 18px nav */
@media (max-width: 1280px) {
  .site-header__inner {
    padding: 16px var(--space-lg);
  }

  .site-header__logo {
    width: 220px;
  }

  .site-nav__list {
    gap: 8px;
  }

  .site-nav__link {
    /* redundant after --text-nav reduced to 18px default —
       kept for explicit 1280px/1200px documentation */
    font-size: 18px;
    padding: 6px 8px;
  }
}

/* ≤1200px — small desktop: smallest nav before hamburger, footer 2-col */
@media (max-width: 1200px) {
  .site-header__logo {
    width: 200px;
  }

  .site-nav__list {
    gap: 8px;
  }

  .site-nav__link {
    /* redundant after --text-nav reduced to 18px default —
       kept for explicit 1280px/1200px documentation */
    font-size: 18px;
    padding: 6px 8px;
  }

  .site-footer__body {
    grid-template-columns: 1fr 1fr;
  }
}

/* ≤1024px — tablet landscape: hamburger replaces full nav */
@media (max-width: 1024px) {
  .site-header__inner {
    padding: 16px var(--space-lg);
  }

  .site-header__logo {
    width: 220px;
  }

  .site-nav__toggle {
    display: flex;
  }

  /* When open, float the toggle above the overlay */
  .site-nav__toggle[aria-expanded="true"] {
    position: fixed;
    top: 18px;
    right: var(--space-lg);
    z-index: 300;
  }

  .site-nav__list {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    height: 100dvh;
    background-color: var(--color-white);
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0;
    z-index: 200;
    overflow-y: auto;
    padding: 80px var(--space-md) var(--space-xl);
  }

  .site-nav__list.is-open {
    display: flex;
  }

  .site-nav__link {
    font-size: 28px;
    padding: 18px 0;
    width: 100%;
    max-width: 320px;
    justify-content: flex-start;
    border-bottom: 1px solid var(--color-bg-light);
    white-space: nowrap;
  }

  .site-nav__link--cta {
    border: none;
    border-bottom: 1px solid var(--color-bg-light);
    color: var(--color-red-cta);
    background: none;
    padding: 18px 0;
    justify-content: flex-start;
  }
}

/* ≤768px — tablet portrait: compact header, smaller logo, single-column footer */
@media (max-width: 768px) {
  .site-header__inner {
    padding: 16px var(--space-md);
  }

  .site-header__logo {
    width: 130px;
  }

  .site-footer__logo-wrap {
    max-width: 130px;
  }

  .img-placeholder--logo {
    width: 130px;
    height: 39px;
  }

  .site-nav__toggle[aria-expanded="true"] {
    top: 18px;
    right: var(--space-md);
  }

  .site-footer__body {
    grid-template-columns: 1fr;
    gap: var(--space-md);
    padding: var(--space-lg) var(--space-md) 0;
  }

  .site-footer__copyright {
    padding: 14px var(--space-md);
  }
}

/* ≤375px — small phone: smallest logo, tightest padding */
@media (max-width: 375px) {
  .site-header__inner {
    padding: 12px var(--space-sm);
  }

  .site-header__logo {
    width: 100px;
  }

  .site-footer__logo-wrap {
    max-width: 100px;
  }

  .site-nav__toggle[aria-expanded="true"] {
    top: 14px;
    right: var(--space-sm);
  }

  .site-footer__body {
    padding: var(--space-lg) var(--space-sm) 0;
  }

  .site-footer__copyright {
    padding: 14px var(--space-sm);
  }
}
