/* Shared navigation. Loaded after the site's own base styles. */
:root {
  --am-header-height: 80px;
  --header: var(--am-header-height);
  --am-menu-gutter: clamp(18px, 3vw, 48px);
}
html { scroll-padding-top: var(--am-header-height); }
:where(main [id], footer[id]) { scroll-margin-top: 24px; }
.page-home .home-hero { margin-top: var(--am-header-height); }
.am-skip-link {
  position: fixed;
  top: 8px;
  left: var(--am-menu-gutter);
  z-index: 120;
  padding: 12px 18px;
  color: #fff;
  background: #161412;
  transform: translateY(-150%);
}
.am-skip-link:focus { transform: translateY(0); }
.am-header {
  position: fixed;
  z-index: 100;
  inset: 0 0 auto;
  height: var(--am-header-height);
  color: #161412;
  background: rgba(247, 243, 237, .98);
  border-bottom: 1px solid rgba(22, 20, 18, .16);
}
.am-header__inner {
  display: flex;
  align-items: center;
  gap: clamp(18px, 2vw, 32px);
  width: 100%;
  max-width: 1896px;
  height: 100%;
  margin-inline: auto;
  padding-inline: var(--am-menu-gutter);
}
.am-header__brand {
  display: inline-flex;
  flex: 0 0 auto;
  align-items: center;
  min-height: 44px;
  color: inherit;
  font-family: Georgia, 'Times New Roman', serif;
  font-size: clamp(23px, 2vw, 30px);
  font-weight: 400;
  line-height: 1;
  letter-spacing: -.035em;
  white-space: nowrap;
}
.am-header__nav { flex: 0 1 auto; margin-left: auto; min-width: 0; }
.am-header__list,
.am-header__submenu-list { margin: 0; padding: 0; list-style: none; }
.am-header__list { display: flex; align-items: center; gap: 24px; }
.am-header__item { position: relative; min-width: 0; }
.am-header__row { display: flex; align-items: center; }
.am-header__link,
.am-header__sublink {
  display: flex;
  align-items: center;
  min-height: 44px;
  color: inherit;
  font-size: 14px;
  line-height: 1.4;
}
.am-header__link { min-width: 44px; padding: 0 4px; white-space: nowrap; }
.am-header__link::after {
  position: absolute;
  right: 4px;
  bottom: 5px;
  left: 4px;
  height: 1px;
  background: #9d1f2e;
  content: '';
  opacity: 0;
}
.am-header__row > .am-header__link { position: relative; }
.am-header__item.is-current > .am-header__row > .am-header__link::after,
.am-header__link:hover::after { opacity: 1; }
.am-header__submenu-toggle {
  display: inline-flex;
  flex: 0 0 44px;
  align-items: center;
  justify-content: flex-start;
  width: 44px;
  height: 44px;
  padding: 0 0 0 5px;
  color: inherit;
  background: transparent;
  border: 0;
  border-radius: 0;
  cursor: pointer;
}
.am-header__submenu-toggle > span {
  display: block;
  width: 6px;
  height: 6px;
  border-right: 1px solid currentColor;
  border-bottom: 1px solid currentColor;
  transform: translateY(-2px) rotate(45deg);
  transition: transform .2s ease;
}
.am-header__submenu-toggle[aria-expanded='true'] > span { transform: translateY(2px) rotate(225deg); }
.am-header__submenu {
  display: grid;
  position: absolute;
  top: calc(100% + 18px);
  left: -16px;
  width: max-content;
  min-width: 230px;
  max-width: min(360px, calc(100vw - 36px));
  padding: 10px;
  border: 1px solid rgba(22, 20, 18, .16);
  background: #f7f3ed;
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transform: translateY(-8px);
  transition: opacity 220ms cubic-bezier(.2, .75, .25, 1), transform 240ms cubic-bezier(.2, .75, .25, 1), visibility 0s linear 240ms;
}
.am-header__submenu-content { min-height: 0; overflow: hidden; }
.am-header__item.is-open > .am-header__submenu {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
  transform: translateY(0);
  transition-delay: 0s;
}
.am-header__sublink { min-height: 48px; padding: 10px 14px; overflow-wrap: anywhere; }
.am-header__sublink:hover,
.am-header__sublink.is-active { color: #9d1f2e; background: #eee7dc; }
.am-header__request {
  display: inline-flex;
  flex: 0 0 auto;
  align-items: center;
  justify-content: center;
  gap: 13px;
  min-height: 44px;
  padding: 10px 16px;
  color: #161412;
  background: #e8e1d7;
  border: 1px solid rgba(22, 20, 18, .7);
  border-radius: 0;
  font-size: 14px;
  line-height: 1.3;
  white-space: nowrap;
  transition: color .2s ease, background .2s ease;
}
.am-header__request:hover { color: #fff; background: #161412; }
.am-header__request--mobile,
.am-header__menu-toggle { display: none; }
.am-header :focus-visible,
.am-footer :focus-visible { outline: 2px solid #9d1f2e; outline-offset: 4px; }
.am-header__sublink:focus-visible { outline-offset: -2px; }
.am-footer { color: #f7f3ed; background: #171513; }
.am-footer__inner {
  display: grid;
  grid-template-columns: minmax(0, 1.3fr) minmax(140px, .7fr) minmax(0, 1fr);
  gap: 40px;
  width: 100%;
  max-width: 1896px;
  margin-inline: auto;
  padding: clamp(40px, 5vw, 72px) var(--am-menu-gutter);
}
.am-footer__inner > * { min-width: 0; }
.am-footer__brand { display: inline-flex; align-items: center; min-height: 44px; font: 400 clamp(28px, 3vw, 40px)/1.1 Georgia, 'Times New Roman', serif; }
.am-footer__identity p { margin: 10px 0 0; color: #bdb7ae; font-size: 13px; }
.am-footer__nav,
.am-footer__contacts { display: flex; flex-direction: column; align-items: flex-start; gap: 2px; }
.am-footer__nav a,
.am-footer__contacts a { display: inline-flex; align-items: center; min-height: 44px; min-width: 44px; max-width: 100%; font-size: 16px; overflow-wrap: anywhere; }
.am-footer__nav a:hover,
.am-footer__contacts a:hover { text-decoration: underline; text-underline-offset: 5px; }
.am-footer__heading { margin: 0 0 8px; font-size: 12px; letter-spacing: .1em; text-transform: uppercase; }
.am-footer__address { max-width: 35ch; margin: 12px 0; color: #bdb7ae; font-size: 13px; overflow-wrap: anywhere; }
.am-footer__request { gap: 14px; margin-top: 6px; }
/* Keep equal visible gaps: the chevron ends with the same 4px inset as text.
   Its transparent hit area extends into the group's own spacing to remain 44px. */
@media (min-width: 1240px) {
  .am-header__submenu-toggle {
    position: relative;
    flex-basis: 16px;
    width: 16px;
  }
  .am-header__submenu-toggle::before {
    position: absolute;
    inset: 0 -24px 0 -4px;
    content: '';
  }
}
@media (max-width: 1239px) {
  :root { --am-header-height: 72px; }
  .am-header__inner { justify-content: space-between; gap: 16px; }
  .am-header__brand { font-size: clamp(23px, 3vw, 29px); }
  .am-header__menu-toggle {
    display: inline-flex;
    flex: 0 0 auto;
    align-items: center;
    justify-content: center;
    gap: 10px;
    min-width: 44px;
    height: 44px;
    padding: 0 2px;
    color: #161412;
    background: transparent;
    border: 0;
    border-radius: 0;
    cursor: pointer;
  }
  .am-header__menu-label { font-size: 14px; }
  .am-header__menu-icon { display: flex; flex-direction: column; gap: 5px; width: 21px; }
  .am-header__menu-icon > span { display: block; width: 21px; height: 1px; background: currentColor; transition: transform .2s ease, opacity .2s ease; }
  .am-header__menu-toggle[aria-expanded='true'] .am-header__menu-icon > span:nth-child(1) { transform: translateY(6px) rotate(45deg); }
  .am-header__menu-toggle[aria-expanded='true'] .am-header__menu-icon > span:nth-child(2) { opacity: 0; }
  .am-header__menu-toggle[aria-expanded='true'] .am-header__menu-icon > span:nth-child(3) { transform: translateY(-6px) rotate(-45deg); }
  .am-header__nav {
    display: block;
    position: absolute;
    inset: 100% 0 auto;
    max-height: calc(100vh - var(--am-header-height));
    max-height: calc(100dvh - var(--am-header-height));
    margin: 0;
    padding: 12px var(--am-menu-gutter) 24px;
    overflow-y: auto;
    overscroll-behavior: contain;
    background: #f7f3ed;
    border-bottom: 1px solid rgba(22, 20, 18, .2);
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transform: translateY(-8px);
    transition: opacity 220ms cubic-bezier(.2, .75, .25, 1), transform 240ms cubic-bezier(.2, .75, .25, 1), visibility 0s linear 240ms;
  }
  .am-header__nav.is-open {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
    transform: translateY(0);
    transition-delay: 0s;
  }
  .am-header__list { display: block; }
  .am-header__item { border-bottom: 1px solid rgba(22, 20, 18, .13); }
  .am-header__row { justify-content: flex-start; }
  .am-header__link { flex: 0 1 auto; min-height: 56px; padding: 10px 0; font-size: 18px; }
  .am-header__link::after { display: none; }
  .am-header__item.is-current > .am-header__row > .am-header__link { color: #9d1f2e; }
  .am-header__submenu-toggle { margin-left: 4px; }
  .am-header__submenu {
    position: static;
    grid-template-rows: 0fr;
    width: 100%;
    min-width: 0;
    max-width: none;
    padding: 0;
    border: 0;
    transform: translateY(-4px);
    transition: grid-template-rows 240ms cubic-bezier(.2, .75, .25, 1), opacity 200ms cubic-bezier(.2, .75, .25, 1), transform 240ms cubic-bezier(.2, .75, .25, 1), visibility 0s linear 240ms;
  }
  .am-header__item.is-open > .am-header__submenu { grid-template-rows: 1fr; }
  .am-header__submenu-list { padding-bottom: 12px; }
  .am-header__sublink { padding-inline: 16px; font-size: 16px; }
  .am-header__request--desktop { display: none; }
  .am-header__request--mobile { display: inline-flex; margin-top: 24px; font-size: 18px; }
}
@media (max-width: 680px) {
  .am-footer__inner { grid-template-columns: minmax(0, 1fr); gap: 26px; }
  .am-footer__nav { flex-direction: row; flex-wrap: wrap; gap: 4px 24px; }
}
@media (max-width: 359px) {
  .am-header__menu-label { display: none; }
  .am-header__inner { gap: 8px; }
}
@media (prefers-reduced-motion: reduce) {
  .am-header *, .am-skip-link { transition: none !important; }
}
