/* ==========================================================================
   Layout — page gutters, header, main navigation (with the mobile menu
   toggle), and footer.
   ========================================================================== */

/* Page gutters ------------------------------------------------------------ */

.section-shell {
  padding-right: max(6.2vw, 24px);
  padding-left: max(6.2vw, 24px);
}

.section-space {
  padding-top: 104px;
  padding-bottom: 104px;
}

/* Header ------------------------------------------------------------------ */

.site-header {
  position: relative;
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 125px;
  padding: 0 5%;
  border-bottom: 1px solid var(--border);
  background: var(--cream);
}

.brand {
  display: flex;
  align-items: center;
  gap: 20px;
}

.brand-logo {
  flex-shrink: 0;
  width: 90px;
}

.wordmark {
  font-family: var(--serif);
  font-size: 2.375rem;
  line-height: 1.2;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.wordmark > span {
  display: block;
  margin-top: 5px;
  font: 0.9375rem var(--sans);
  letter-spacing: 0.31em;
}

/* Navigation -------------------------------------------------------------- */

nav {
  display: flex;
  align-items: center;
  gap: 34px;
}

nav > a:not(.button) {
  font-size: 0.875rem;
}

nav > a:not(.button):hover {
  color: var(--gold);
}

/* Shown only below 760px, where the nav collapses into a drop-down.
   nav-menu.js keeps aria-expanded in sync with the open state. */
.menu-toggle {
  display: none;
}

/* Footer ------------------------------------------------------------------ */

footer {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 13px;
  padding-top: 37px;
  padding-bottom: 34px;
}

.footer-brand {
  font-family: var(--serif);
  font-size: 1.25rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.footer-tagline,
.footer-copyright,
.footer-instagram {
  color: var(--muted);
  font-size: 0.75rem;
}

.footer-tagline,
.footer-instagram {
  text-align: right;
}

.footer-tagline {
  align-self: center;
}

.footer-instagram:hover {
  color: var(--gold);
}

/* Responsive -------------------------------------------------------------- */

/* Keep 80px gutters on wide screens and cap the content at 1400px. */
@media (min-width: 1600px) {
  .section-shell {
    padding-right: max(calc((100vw - 1400px) / 2), 80px);
    padding-left: max(calc((100vw - 1400px) / 2), 80px);
  }
}

/* Tighten the header so the full nav still fits beside the wordmark. */
@media (min-width: 761px) and (max-width: 1100px) {
  .site-header {
    padding-right: 3%;
    padding-left: 3%;
  }

  .brand {
    gap: 12px;
  }

  .brand-logo {
    width: 70px;
  }

  .wordmark {
    font-size: 2rem;
  }

  .wordmark > span {
    font-size: 0.8125rem;
    letter-spacing: 0.24em;
  }

  nav {
    gap: 18px;
  }

  nav > a:not(.button) {
    font-size: 0.8125rem;
  }

  .button-small {
    padding-right: 14px;
    padding-left: 14px;
  }
}

/* Below this width the nav becomes a drop-down behind the menu toggle. */
@media (max-width: 760px) {
  .section-space {
    padding-top: 65px;
    padding-bottom: 65px;
  }

  .site-header {
    height: 101px;
    padding: 0 23px;
  }

  .brand {
    gap: 12px;
  }

  .brand-logo {
    width: 64px;
  }

  .wordmark {
    font-size: 1.9375rem;
    letter-spacing: 0.12em;
  }

  .wordmark > span {
    font-size: 0.8125rem;
    letter-spacing: 0.22em;
  }

  .menu-toggle {
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 7px;
    width: 44px;
    height: 44px;
    padding: 11px;
    border: 1px solid var(--border);
    background: transparent;
    color: var(--ink);
  }

  .menu-toggle span {
    width: 100%;
    height: 1px;
    background: currentColor;
  }

  /* The two bars cross into an "×" while the menu is open. */
  .menu-toggle[aria-expanded="true"] span:first-child {
    transform: translateY(4px) rotate(45deg);
  }

  .menu-toggle[aria-expanded="true"] span:last-child {
    transform: translateY(-4px) rotate(-45deg);
  }

  nav {
    position: absolute;
    top: 101px;
    right: 0;
    left: 0;
    display: none;
    flex-direction: column;
    align-items: stretch;
    gap: 23px;
    padding: 22px 24px 27px;
    border-bottom: 1px solid var(--border);
    background: var(--cream);
  }

  nav.is-open {
    display: flex;
  }

  footer {
    grid-template-columns: 1fr;
    gap: 17px;
    text-align: center;
  }

  .footer-tagline,
  .footer-instagram {
    text-align: center;
  }

  .footer-copyright {
    margin-top: 6px;
  }
}

@media (max-width: 380px) {
  .site-header {
    padding-right: 18px;
    padding-left: 18px;
  }

  .brand-logo {
    width: 52px;
  }

  .wordmark {
    font-size: 1.6875rem;
  }

  .wordmark > span {
    font-size: 0.6875rem;
  }
}
