/* Shared structure: shell, containers, injected header/footer, navigation, and footer grid. */
.page-shell,
.page {
  position: relative;
  z-index: 1;
  overflow: hidden;
}

.container {
  width: min(calc(100% - 40px), var(--max));
  margin: 0 auto;
}

.site-header {
  position: fixed;
  inset: 0 0 auto;
  z-index: 20;
}

.nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.mobile-menu-toggle {
  display: none;
}

.mobile-menu {
  display: none;
}

.nav-links,
.footer-links {
  list-style: none;
}

.site-footer {
  position: relative;
  z-index: 1;
}

.footer-inner {
  display: grid;
}

.footer-base {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
}

@media (max-width: 768px) {
  body.has-mobile-menu-open {
    overflow: hidden;
  }

  .container {
    width: min(calc(100% - 28px), var(--max));
  }

  .site-header .nav {
    position: relative;
    gap: 12px;
  }

  .site-header .brand {
    min-width: 0;
  }

  .site-header .brand strong {
    font-size: clamp(1rem, 5.4vw, 1.34rem);
    overflow-wrap: anywhere;
  }

  .site-header .brand span {
    max-width: 18ch;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .site-header .nav-links,
  .site-header .nav > .button {
    display: none !important;
  }

  .mobile-menu-toggle {
    position: relative;
    z-index: 32;
    display: inline-flex;
    flex: 0 0 auto;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 5px;
    width: 44px;
    height: 44px;
    border: 1px solid rgba(212, 175, 55, 0.4);
    background: rgba(13, 13, 13, 0.56);
    color: var(--ivory);
    cursor: pointer;
    backdrop-filter: blur(14px);
    transition: border-color 260ms var(--ease), background 260ms var(--ease), color 260ms var(--ease);
  }

  .mobile-menu-toggle span {
    display: block;
    width: 19px;
    height: 1px;
    background: currentColor;
    transform-origin: center;
    transition: transform 260ms var(--ease), opacity 220ms var(--ease);
  }

  .mobile-menu-toggle:hover,
  .mobile-menu-toggle:focus-visible,
  .mobile-menu-toggle.is-open {
    border-color: var(--gold-bright);
    background: rgba(212, 175, 55, 0.13);
    color: var(--gold-bright);
  }

  .mobile-menu-toggle:focus-visible {
    outline: 2px solid var(--gold-bright);
    outline-offset: 3px;
  }

  .mobile-menu-toggle.is-open span:nth-child(1) {
    transform: translateY(6px) rotate(45deg);
  }

  .mobile-menu-toggle.is-open span:nth-child(2) {
    opacity: 0;
  }

  .mobile-menu-toggle.is-open span:nth-child(3) {
    transform: translateY(-6px) rotate(-45deg);
  }

  .mobile-menu[hidden] {
    display: none;
  }

  .mobile-menu {
    position: absolute;
    inset-block-start: calc(100% - 1px);
    inset-inline: 0;
    z-index: 31;
    display: block;
    padding-block-start: 10px;
  }

  .mobile-menu-panel {
    display: grid;
    gap: 14px;
    max-height: calc(100svh - 96px);
    overflow: auto;
    padding: 16px;
    border: 1px solid rgba(212, 175, 55, 0.28);
    background: rgba(13, 13, 13, 0.94);
    box-shadow: 0 28px 70px rgba(0, 0, 0, 0.42), inset 0 0 26px rgba(212, 175, 55, 0.05);
    backdrop-filter: blur(22px);
  }

  .mobile-menu-links {
    display: grid;
  }

  .mobile-menu-links a {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: space-between;
    min-height: 48px;
    padding: 0 4px;
    border-bottom: 1px solid rgba(245, 245, 240, 0.1);
    color: rgba(245, 245, 240, 0.78);
    font-family: var(--sans);
    font-size: 0.78rem;
    font-weight: 500;
    letter-spacing: 0.16em;
    line-height: 1.25;
    text-align: start;
    text-transform: uppercase;
    transition: color 260ms var(--ease), padding-inline 260ms var(--ease);
  }

  .mobile-menu-links a::after {
    content: "";
    width: 7px;
    height: 7px;
    border-block-start: 1px solid currentColor;
    border-inline-end: 1px solid currentColor;
    opacity: 0.64;
    transform: rotate(45deg);
  }

  html[dir="rtl"] .mobile-menu-links a::after {
    transform: rotate(225deg);
  }

  .mobile-menu-links a:hover,
  .mobile-menu-links a:focus-visible,
  .mobile-menu-links a[aria-current="page"] {
    color: var(--gold-bright);
    padding-inline-start: 8px;
  }

  .mobile-menu-links a:focus-visible {
    outline: 1px solid var(--gold-bright);
    outline-offset: 3px;
  }

  .mobile-menu-cta {
    width: 100%;
    min-width: 0;
  }

  .footer-base {
    align-items: flex-start;
    flex-direction: column;
  }
}
