/* Shared stacked brand: native vector emblem and Georgia wordmark. */
.monarch-brand {
  --monarch-emblem-width: 84px;
  --monarch-name-size: 32px;
  display: inline-flex;
  width: max-content;
  flex: 0 0 auto;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 6px;
  line-height: 1;
  text-decoration: none;
}

.monarch-brand .monarch-brand-emblem {
  display: block;
  width: var(--monarch-emblem-width);
  aspect-ratio: 821 / 974;
  flex: 0 0 auto;
  overflow: hidden;
}

/* Render paths directly at the displayed size; no bitmap cropping or filters. */
.monarch-brand .monarch-brand-emblem img {
  display: block;
  width: 100%;
  max-width: none;
  height: 100%;
  object-fit: contain;
}

.monarch-brand .monarch-brand-name {
  display: block;
  color: #25485d;
  font-family: Georgia, "Times New Roman", serif;
  font-size: var(--monarch-name-size);
  font-weight: 400;
  line-height: 1.15;
  letter-spacing: 0;
  font-kerning: none;
  white-space: nowrap;
  text-align: center;
}

/* Optical spacing compensates for Georgia's different glyph side bearings. */
.monarch-brand-name [data-letter="M"] { margin-right: -0.0095em; }
.monarch-brand-name [data-letter="O"] { margin-right: 0.025em; }
.monarch-brand-name [data-letter="N"] { margin-right: 0.0875em; }
.monarch-brand-name [data-letter="A"] { margin-right: 0.0505em; }
.monarch-brand-name [data-letter="R"] { margin-right: 0.0585em; }
.monarch-brand-name [data-letter="C"] { margin-right: 0.015em; }
.monarch-brand-name [data-letter="H"] { margin-right: -0.0432em; }

.monarch-brand-number {
  /* Keep 22 at the same visual height as the capital letters. */
  font-size: 1.2842em;
  line-height: 0;
}
.monarch-brand-number > span:first-child { margin-right: -0.0421em; }

.monarch-brand:focus-visible {
  outline: 2px solid #345c72;
  outline-offset: 6px;
  border-radius: 4px;
}

.topbar-inner:has(> .monarch-brand) {
  min-height: 140px;
  padding-block: 14px;
}

.footer-brand.monarch-brand {
  --monarch-emblem-width: 54px;
  --monarch-name-size: 24px;
  justify-self: start;
}

/* Explicit button/panel state avoids stale closed-details painting in Safari. */
.monarch-topbar {
  position: relative;
  z-index: 30;
}

.monarch-topbar .topbar-inner {
  grid-template-columns: minmax(0, 1fr) auto;
  justify-items: stretch;
}

.monarch-topbar .monarch-brand { justify-self: start; }
.monarch-header-menu { position: relative; justify-self: end; }

.monarch-menu-toggle {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 5px;
  width: 46px;
  height: 46px;
  padding: 0;
  list-style: none;
  border: 1px solid rgba(37, 72, 93, 0.16);
  border-radius: 14px;
  background: #fff;
  color: #25485d;
  box-shadow: 0 4px 14px rgba(20, 39, 51, 0.06);
  cursor: pointer;
  -webkit-appearance: none;
  appearance: none;
  touch-action: manipulation;
}

.monarch-menu-toggle span {
  width: 20px;
  height: 2px;
  border-radius: 2px;
  background: currentColor;
  pointer-events: none;
}
.monarch-header-menu.is-open .monarch-menu-toggle span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.monarch-header-menu.is-open .monarch-menu-toggle span:nth-child(2) { opacity: 0; }
.monarch-header-menu.is-open .monarch-menu-toggle span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }
.monarch-menu-toggle:focus-visible { outline: 2px solid #345c72; outline-offset: 4px; }

.monarch-menu-panel {
  position: absolute;
  top: calc(100% + 12px);
  right: 0;
  z-index: 40;
  display: grid;
  gap: 20px;
  width: min(280px, calc(100vw - 32px));
  max-height: calc(100dvh - 150px);
  overflow-y: auto;
  padding: 22px;
  border: 1px solid rgba(37, 72, 93, 0.12);
  border-radius: 20px;
  background: #fff;
  box-shadow: 0 16px 40px rgba(20, 39, 51, 0.14);
}
.monarch-menu-panel[hidden] { display: none !important; }
.monarch-menu-language, .monarch-menu-login { display: grid; gap: 10px; }
.monarch-menu-label { font-size: 12px; font-weight: 700; color: #527185; letter-spacing: 0.04em; }
.monarch-menu-panel .site-lang-switch { display: flex; width: 100%; }
.monarch-menu-panel .site-lang-link { flex: 1; min-height: 38px; }
.monarch-menu-panel .login-launch { display: inline-flex; width: 100%; justify-content: center; min-height: 44px; }
.monarch-menu-panel .nav { justify-content: center; }
.monarch-menu-panel .inline-login-panel { position: static; width: 100%; min-width: 0; margin-top: 4px; box-shadow: none; }

@media (max-width: 640px) {
  .monarch-brand {
    --monarch-emblem-width: 66px;
    --monarch-name-size: 28px;
  }

  .topbar-inner:has(> .monarch-brand) {
    min-height: 118px;
    padding-block: 12px;
  }

  .sector-hub-page .hub-header {
    min-height: var(--hub-header-height);
    padding-block: 14px;
  }
}

/* Public brand palette restored to selected green 09 on white, 2026-09-29. */
.monarch-topbar, .sector-hub-page .topbar { background: #fff; border-bottom-color: rgba(55, 123, 101, 0.16); }
.monarch-brand { background: #fff; padding: 8px 12px; border-radius: 10px; }
.monarch-brand .monarch-brand-emblem { aspect-ratio: 1; width: calc(var(--monarch-emblem-width) * 1.35); }
.monarch-brand .monarch-brand-name img { display: block; width: calc(var(--monarch-name-size) * 6.5); height: auto; }
.monarch-brand:focus-visible { outline-color: #345C72; }
