/* Shared mobile header drawer — overrides page-level .mobile-drawer rules */

.menu-btn {
  position: relative;
  display: none;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: #f1f1f1;
  border: 0;
  cursor: pointer;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  gap: 5px;
  flex-shrink: 0;
  z-index: 2;
  -webkit-tap-highlight-color: transparent;
}
.menu-btn span {
  width: 14px;
  height: 1.5px;
  background: var(--navy, #0b1f33);
  display: block;
  border-radius: 1px;
  transition: transform .28s var(--ease, cubic-bezier(0.33, 1, 0.68, 1)),
              opacity .2s var(--ease, cubic-bezier(0.33, 1, 0.68, 1)),
              width .2s var(--ease, cubic-bezier(0.33, 1, 0.68, 1));
  transform-origin: center;
}
.menu-btn[aria-expanded="true"] span:first-child {
  transform: translateY(3.25px) rotate(45deg);
}
.menu-btn[aria-expanded="true"] span:last-child {
  transform: translateY(-3.25px) rotate(-45deg);
}

.mobile-backdrop {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 0;
  background: transparent;
  opacity: 0;
  pointer-events: none;
}
.mobile-backdrop.is-open {
  opacity: 1;
  pointer-events: auto;
}
.floating-header .pill-nav {
  position: relative;
  z-index: 2;
}

.mobile-drawer,
.mobile-drawer.is-open {
  display: none;
  position: absolute;
  top: calc(100% + 10px);
  left: 0;
  right: 0;
  width: 100%;
  max-height: calc(100dvh - var(--header-top, 16px) - var(--header-h, 64px) - 28px);
  max-height: calc(100vh - var(--header-top, 16px) - var(--header-h, 64px) - 28px);
  overflow-x: hidden;
  overflow-y: auto;
  overscroll-behavior: contain;
  -webkit-overflow-scrolling: touch;
  padding: 10px 10px calc(14px + env(safe-area-inset-bottom, 0px));
  margin-top: 0;
  background: #fff;
  border: 1px solid #e8eced;
  border-radius: 22px;
  box-shadow: 0 18px 44px rgba(11, 31, 51, .16);
  opacity: 0;
  transform: translateY(-8px);
  pointer-events: none;
  visibility: hidden;
  transition: opacity .28s var(--ease, cubic-bezier(0.33, 1, 0.68, 1)),
              transform .28s var(--ease, cubic-bezier(0.33, 1, 0.68, 1));
  z-index: 2;
}
.mobile-drawer.is-open {
  opacity: 1;
  transform: none;
  pointer-events: auto;
  visibility: visible;
}

/* Neutralize legacy page CSS (.mobile-drawer a / a:last-child CTA) */
.mobile-drawer a {
  border-bottom: 0 !important;
}
.mobile-drawer a:last-child {
  margin-top: 0 !important;
  background: transparent !important;
  color: inherit !important;
  border-radius: 0 !important;
  text-align: left !important;
}

.mobile-drawer__nav {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.mobile-drawer a.mobile-drawer__link {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 48px;
  padding: 12px 14px;
  font-size: 15px;
  font-weight: 500;
  color: var(--ink, #1a2b3c);
  border-radius: 14px;
  border: 0;
  background: transparent;
  width: 100%;
  text-align: left;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  transition: background .18s ease, color .18s ease;
}
.mobile-drawer a.mobile-drawer__link:hover,
.mobile-drawer a.mobile-drawer__link:focus-visible {
  background: #f4f7fa;
  color: var(--navy, #0b1f33);
  outline: none;
}
.mobile-drawer a.mobile-drawer__link.is-active {
  color: var(--navy, #0b1f33);
  font-weight: 600;
  background: var(--brand-soft, #fdecec);
}
.mobile-drawer a.mobile-drawer__link.is-active::before {
  content: "";
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--brand, #d7141a);
  box-shadow: 0 0 0 3px rgba(215, 20, 26, .16);
  flex-shrink: 0;
}

.mobile-drawer a.mobile-drawer__cta {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 48px;
  margin-top: 8px !important;
  padding: 12px 16px;
  font-size: 14px;
  font-weight: 600;
  color: #fff !important;
  background: var(--navy, #0b1f33) !important;
  border-radius: 999px !important;
  text-align: center !important;
}
.mobile-drawer a.mobile-drawer__cta:hover,
.mobile-drawer a.mobile-drawer__cta:focus-visible {
  background: #16324d !important;
  color: #fff !important;
}
.mobile-drawer a.mobile-drawer__cta.is-active {
  box-shadow: 0 0 0 3px rgba(215, 20, 26, .2);
}

.mobile-drawer__group {
  border-radius: 14px;
}
.mobile-drawer__toggle {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-height: 48px;
  padding: 12px 14px;
  font-size: 15px;
  font-weight: 500;
  color: var(--ink, #1a2b3c);
  border: 0;
  border-radius: 14px;
  background: transparent;
  width: 100%;
  text-align: left;
  cursor: pointer;
  font-family: inherit;
  -webkit-tap-highlight-color: transparent;
  transition: background .18s ease, color .18s ease;
}
.mobile-drawer__toggle:hover,
.mobile-drawer__toggle:focus-visible {
  background: #f4f7fa;
  color: var(--navy, #0b1f33);
  outline: none;
}
.mobile-drawer__toggle.is-active {
  color: var(--navy, #0b1f33);
  font-weight: 600;
  background: var(--brand-soft, #fdecec);
}
.mobile-drawer__toggle.is-active::before {
  content: "";
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--brand, #d7141a);
  box-shadow: 0 0 0 3px rgba(215, 20, 26, .16);
  flex-shrink: 0;
  margin-right: 4px;
}
.mobile-drawer__toggle-label {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  flex: 1;
  min-width: 0;
}
.mobile-drawer__caret {
  flex-shrink: 0;
  color: var(--muted, #5b6b7c);
  transition: transform .28s var(--ease, cubic-bezier(0.33, 1, 0.68, 1));
}
.mobile-drawer__toggle[aria-expanded="true"] .mobile-drawer__caret {
  transform: rotate(180deg);
  color: var(--navy, #0b1f33);
}

.mobile-drawer__panel {
  display: grid;
  grid-template-rows: 0fr;
  transition: grid-template-rows .32s var(--ease, cubic-bezier(0.33, 1, 0.68, 1));
}
.mobile-drawer__panel.is-open {
  grid-template-rows: 1fr;
}
.mobile-drawer__panel-inner {
  overflow: hidden;
  min-height: 0;
}
.mobile-drawer__sub {
  display: flex;
  flex-direction: column;
  gap: 1px;
  padding: 2px 6px 8px 18px;
}
.mobile-drawer a.mobile-drawer__sub-link {
  display: flex;
  align-items: center;
  min-height: 42px;
  padding: 8px 12px;
  font-size: 13.5px;
  font-weight: 450;
  color: var(--muted, #5b6b7c) !important;
  background: transparent !important;
  border-radius: 12px;
  transition: background .18s ease, color .18s ease;
}
.mobile-drawer a.mobile-drawer__sub-link:hover,
.mobile-drawer a.mobile-drawer__sub-link:focus-visible {
  background: #f4f7fa !important;
  color: var(--navy, #0b1f33) !important;
  outline: none;
}
.mobile-drawer a.mobile-drawer__sub-link--all {
  color: var(--brand, #d7141a) !important;
  font-weight: 600;
}
.mobile-drawer__sub-label {
  display: block;
  padding: 10px 12px 4px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--muted, #5b6b7c);
}

.mobile-drawer__lang {
  display: flex;
  align-items: center;
  gap: 4px;
  margin-top: 12px;
  padding: 4px;
  background: #f1f4f8;
  border-radius: 999px;
}
.mobile-drawer .mobile-drawer__lang a {
  flex: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 40px;
  padding: 8px 12px;
  font-size: 13px;
  font-weight: 600;
  letter-spacing: .04em;
  color: var(--muted, #5b6b7c) !important;
  background: transparent !important;
  border-radius: 999px !important;
  text-align: center !important;
  margin-top: 0 !important;
  transition: background .18s ease, color .18s ease, box-shadow .18s ease;
}
.mobile-drawer .mobile-drawer__lang a.is-on {
  background: #fff !important;
  color: var(--navy, #0b1f33) !important;
  box-shadow: 0 2px 8px rgba(11, 31, 51, .1);
}

body.is-menu-open {
  overflow: hidden;
  touch-action: none;
}
body.is-menu-open.is-collapsed .floating-header {
  width: min(100% - 28px, 1080px);
  top: var(--header-top, 16px);
}
body.is-menu-open.is-collapsed .pill-nav {
  min-height: var(--header-h, 64px);
  padding: 8px 10px 8px 18px;
  box-shadow: 0 8px 20px rgba(0,0,0,0.07);
}
body.is-menu-open.is-collapsed .pill-logo img {
  height: 26px;
  transform: scale(var(--logo-s, 1.85));
}

@media (max-width: 980px) {
  .menu-btn { display: inline-flex; }
  .mobile-backdrop { display: block; }
  .mobile-drawer,
  .mobile-drawer.is-open {
    display: block;
  }
  .mobile-drawer:not(.is-open) {
    visibility: hidden;
    pointer-events: none;
  }
}

@media (max-width: 640px) {
  .floating-header {
    width: min(100% - 20px, 1080px);
  }
  body.is-collapsed .floating-header,
  body.is-menu-open.is-collapsed .floating-header {
    width: min(100% - 20px, 1080px);
  }
  .mobile-drawer {
    border-radius: 18px;
    padding: 8px 8px calc(12px + env(safe-area-inset-bottom, 0px));
  }
  .mobile-drawer__link,
  .mobile-drawer__toggle {
    font-size: 14.5px;
    padding: 11px 12px;
  }
}

@media (max-width: 360px) {
  .floating-header {
    width: min(100% - 16px, 1080px);
  }
  body.is-collapsed .floating-header,
  body.is-menu-open.is-collapsed .floating-header {
    width: min(100% - 16px, 1080px);
  }
  .pill-nav {
    padding: 6px 8px 6px 14px;
  }
  .mobile-drawer__link,
  .mobile-drawer__toggle {
    font-size: 14px;
    min-height: 46px;
  }
  .mobile-drawer__sub {
    padding-left: 12px;
  }
}

@media (max-height: 480px) and (max-width: 980px) {
  .mobile-drawer {
    max-height: calc(100dvh - 72px);
    max-height: calc(100vh - 72px);
  }
  .mobile-drawer__link,
  .mobile-drawer__toggle {
    min-height: 42px;
    padding: 8px 12px;
  }
  .mobile-drawer__sub-link {
    min-height: 36px;
    padding: 6px 10px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .menu-btn span,
  .mobile-backdrop,
  .mobile-drawer,
  .mobile-drawer__caret,
  .mobile-drawer__panel {
    transition: none !important;
  }
  .mobile-drawer {
    transform: none;
  }
}

@media print {
  .mobile-drawer,
  .mobile-backdrop,
  .menu-btn {
    display: none !important;
  }
}

/* Footer slogan: paragraph, not a heading, so it stays out of the page outline. */
.site-footer .footer-brandline {
  margin: 0;
  max-width: 22em;
  padding-left: 12px;
  border-left: 3px solid var(--brand, #d7141a);
  font-size: 15px;
  font-weight: 700;
  line-height: 1.45;
  letter-spacing: -0.011em;
  color: var(--navy, #0b1f33);
}
.site-footer .footer-brandline strong {
  font-weight: 700;
}
