/* Site header shared by every page (moved out of home.css). Scoped to
   .rsm-* so the older styles.css header rules stay untouched. */
:root {
  --rh-navy: #0a2552;
  --rh-blue: #1565d8;
  --rh-blue-strong: #0d55c2;
  --rh-teal: #0fa3b8;
  --rh-hero-bg-1: #f6fafe;
  --rh-hero-bg-2: #e6f2fb;
  --rh-glow: rgba(56, 160, 230, 0.28);
  --rh-chip-bg: #eef5fc;
  --rh-chip-text: #24425f;
  --rh-ink: #111111;
  --rh-line: #dfe7ef;
  --rh-line-strong: #c9d6e3;
  --rh-menu-shadow: 0 6px 16px rgba(10, 37, 82, 0.08);
  --rh-tint-blue: #e8f1fd;
  --rh-tint-teal: #e2f6f6;
  --rh-tint-indigo: #ebeefd;
  --rh-badge-blue: #1a8be0;
  --rh-badge-green: #22a54a;
  --rh-badge-purple: #7b5ce6;
  --rh-wash-strong: rgba(246, 250, 254, 0.9);
  --rh-wash-soft: rgba(246, 250, 254, 0.35);
}
[data-theme="dark"] {
  --rh-navy: #f2f7fc;
  --rh-blue: #4aa8f5;
  --rh-blue-strong: #2f8fe0;
  --rh-teal: #3fd0dc;
  --rh-hero-bg-1: #0a1626;
  --rh-hero-bg-2: #0e2036;
  --rh-glow: rgba(62, 192, 240, 0.18);
  --rh-chip-bg: #183552;
  --rh-chip-text: #cfe0ef;
  --rh-ink: #e9eef4;
  --rh-line: rgba(255, 255, 255, 0.1);
  --rh-line-strong: rgba(255, 255, 255, 0.2);
  --rh-menu-shadow: 0 6px 16px rgba(0, 0, 0, 0.35);
  --rh-tint-blue: rgba(74, 168, 245, 0.14);
  --rh-tint-teal: rgba(63, 208, 220, 0.14);
  --rh-tint-indigo: rgba(120, 140, 245, 0.16);
  --rh-wash-strong: rgba(10, 22, 38, 0.88);
  --rh-wash-soft: rgba(10, 22, 38, 0.35);
}

/* ---------- Header ---------- */
.site-header.rsm-header {
  padding: 0;
  background: var(--header-bg);
}
.rsm-header-inner {
  display: flex;
  align-items: center;
  gap: 1.5rem;
  max-width: var(--content-wide);
  margin: 0 auto;
  padding: 0.6rem clamp(1rem, 2.5vw, 2.5rem);
}
.rsm-brand {
  display: flex;
  align-items: center;
  gap: 0.8rem;
  flex: 0 0 auto;
  color: var(--rh-navy);
}
.rsm-brand picture {
  display: block;
}
.rsm-brand img {
  width: 3rem;
  height: auto;
  display: block;
}
.rsm-brand-text {
  display: flex;
  flex-direction: column;
  line-height: 1.15;
}
.rsm-brand-name {
  font-size: 1.15rem;
  font-weight: 800;
  letter-spacing: -0.01em;
}
.rsm-brand-tag {
  margin-top: 0.2rem;
  font-size: 0.55rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-muted);
}

.rsm-nav {
  flex: 1 1 auto;
  min-width: 0;
  display: flex;
}
.rsm-nav-list {
  margin-inline: auto !important;
}
.rsm-nav-list {
  display: flex;
  align-items: center;
  gap: clamp(0.75rem, 1.6vw, 1.75rem);
  margin: 0;
  padding: 0;
  list-style: none;
}
.rsm-nav-item {
  position: relative;
}
.rsm-nav-link {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.7rem 0;
  border: 0;
  background: none;
  color: var(--text-primary);
  font-size: 0.8rem;
  font-weight: 500;
  white-space: nowrap;
  cursor: pointer;
  position: relative;
}
.rsm-nav-link::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0.25rem;
  height: 2px;
  border-radius: 2px;
  background: var(--rh-blue);
  transform: scaleX(0);
  transition: transform 0.2s ease;
}
.rsm-nav-link:hover,
.rsm-nav-link[aria-current="page"] {
  color: var(--rh-blue);
}
.rsm-nav-link:hover::after,
.rsm-nav-link[aria-current="page"]::after {
  transform: scaleX(1);
}
.rsm-caret {
  width: 0.7rem;
  height: 0.7rem;
  transition: transform 0.2s ease;
}
.rsm-has-menu.is-open > .rsm-nav-link .rsm-caret,
.rsm-portal.is-open .rsm-caret {
  transform: rotate(180deg);
}

.rsm-menu {
  position: absolute;
  top: calc(100% + 0.35rem);
  left: 50%;
  z-index: 50;
  min-width: 15rem;
  padding: 0.6rem;
  margin: 0;
  list-style: none;
  background: var(--bg-surface);
  border: 1px solid var(--border-medium);
  border-radius: 1rem;
  box-shadow: var(--rh-menu-shadow);
  opacity: 0;
  visibility: hidden;
  transform: translate(-50%, 0.4rem);
  transition:
    opacity 0.18s ease,
    transform 0.18s ease,
    visibility 0.18s;
}
.rsm-has-menu.is-open > .rsm-menu {
  opacity: 1;
  visibility: visible;
  transform: translate(-50%, 0);
}
.rsm-menu-mega {
  display: grid;
  grid-template-columns: repeat(2, minmax(12rem, 1fr));
  gap: 0.4rem 1rem;
  min-width: 28rem;
  padding: 1rem;
}
.rsm-menu-group-title {
  display: block;
  padding: 0.45rem 0.7rem;
  font-weight: 700;
  font-size: 0.88rem;
  color: var(--rh-navy);
  border-radius: 0.6rem;
}
.rsm-menu-group ul {
  margin: 0;
  padding: 0;
  list-style: none;
}
.rsm-menu a {
  display: block;
  padding: 0.45rem 0.7rem;
  border-radius: 0.6rem;
  font-size: 0.85rem;
  color: var(--text-muted);
}
.rsm-menu a.rsm-menu-group-title {
  color: var(--rh-navy);
}
.rsm-menu a:hover,
.rsm-menu a:focus-visible {
  background: var(--surface-hover);
  color: var(--rh-blue);
}

.rsm-header-actions {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 0.4rem;
  flex: 0 0 auto;
}
.rsm-contact-row {
  display: flex;
  align-items: center;
  gap: 1rem;
  font-size: 0.72rem;
}
.rsm-contact-row a {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  color: var(--text-primary);
}
.rsm-contact-row a:hover {
  color: var(--rh-blue);
}
.rsm-contact-row svg {
  width: 1.05rem;
  height: 1.05rem;
  color: var(--rh-blue);
}
.rsm-header .theme-toggle-btn {
  width: 2rem;
  height: 2rem;
  display: inline-grid;
  place-items: center;
  padding: 0;
  border: 1px solid var(--border-medium);
  border-radius: 999px;
  background: transparent;
  color: var(--text-muted);
  cursor: pointer;
}
.rsm-header .theme-toggle-btn svg {
  width: 1rem;
  height: 1rem;
}

.rsm-portal {
  position: relative;
}
.rsm-portal-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
  padding: 0.5rem 1rem;
  border: 0;
  border-radius: 0.6rem;
  background: var(--rh-blue-strong);
  color: #fff;
  font-weight: 600;
  font-size: 0.8rem;
  cursor: pointer;
  transition: background-color 0.15s ease;
}
.rsm-portal-btn:hover {
  background: var(--rh-navy);
}
[data-theme="dark"] .rsm-portal-btn:hover {
  background: var(--rh-blue);
}
.rsm-portal-btn svg {
  width: 1.05rem;
  height: 1.05rem;
}
.rsm-portal .rsm-menu {
  left: auto;
  right: 0;
  min-width: 24rem;
  transform: translateY(0.4rem);
}
.rsm-portal.is-open .rsm-menu {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}
.rsm-portal-item {
  display: flex !important;
  align-items: center;
  gap: 0.75rem;
}
.rsm-portal-icon {
  flex: 0 0 auto;
  display: grid;
  place-items: center;
  width: 2.2rem;
  height: 2.2rem;
  border-radius: 0.6rem;
  background: var(--rh-chip-bg);
  color: var(--rh-blue);
}
.rsm-portal-icon svg {
  width: 1.15rem;
  height: 1.15rem;
}
.rsm-portal-item.is-disabled {
  padding: 0.45rem 0.7rem;
  cursor: default;
}
.rsm-portal-item.is-disabled .rsm-portal-icon {
  opacity: 0.6;
}
.rsm-portal-item.is-disabled strong {
  color: var(--text-muted);
}
.rsm-soon {
  display: inline-block;
  margin-left: 0.35rem;
  vertical-align: 0.1em;
  padding: 0.15rem 0.5rem;
  border-radius: 999px;
  background: var(--rh-chip-bg);
  color: var(--rh-blue);
  font-size: 0.62rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  white-space: nowrap;
}
.rsm-mobile-panel .rsm-portal-item.is-disabled {
  padding: 0.55rem 0.25rem;
  border-bottom: 1px solid var(--border);
}
.rsm-portal-text {
  display: flex;
  flex-direction: column;
  line-height: 1.25;
}
.rsm-portal-text strong {
  color: var(--rh-navy);
  font-size: 0.88rem;
}
.rsm-portal-text small {
  font-size: 0.74rem;
  color: var(--text-muted);
}

.rsm-menu-toggle {
  display: none;
  align-items: center;
  gap: 0.45rem;
  margin-left: auto;
  padding: 0.55rem 0.85rem;
  border: 1px solid var(--border-medium);
  border-radius: 0.65rem;
  background: var(--nav-toggle-bg);
  color: var(--text-heading);
  font-weight: 600;
  cursor: pointer;
}
.rsm-menu-toggle svg {
  width: 1.1rem;
  height: 1.1rem;
}
.rsm-mobile-panel {
  display: none;
}

/* Desktop header in two tiers so nothing can collide:
   row 1  ............................ phone  email  theme
   row 2  [logo spans both rows]  nav ........  Portals      */
@media (min-width: 1101px) {
  .rsm-header-inner {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr) auto;
    grid-template-rows: auto auto;
    column-gap: 1.5rem;
    row-gap: 0.1rem;
    align-items: center;
  }
  .rsm-brand {
    grid-row: 1 / span 2;
    grid-column: 1;
  }
  .rsm-header-actions {
    display: contents;
  }
  .rsm-contact-row {
    grid-row: 1;
    grid-column: 2 / 4;
    justify-self: end;
  }
  .rsm-nav {
    grid-row: 2;
    grid-column: 2;
  }
  .rsm-portal {
    grid-row: 2;
    grid-column: 3;
  }
}
/* Narrow desktops: drop the tagline and tighten the nav */
@media (min-width: 1101px) and (max-width: 1360px) {
  .rsm-header-inner {
    column-gap: 1rem;
  }
  .rsm-nav-list {
    gap: clamp(0.6rem, 1.2vw, 1.1rem);
  }
  .rsm-nav-link {
    font-size: 0.76rem;
  }
}
/* Narrowest desktops: not enough room for the tagline */
@media (min-width: 1101px) and (max-width: 1140px) {
  .rsm-brand-tag {
    display: none;
  }
}
@media (max-width: 1100px) {
  .rsm-nav,
  .rsm-header-actions {
    display: none;
  }
  .rsm-header-inner {
    gap: 0.75rem;
  }
  .rsm-menu-toggle {
    display: inline-flex;
    margin-left: 0;
  }
  .rsm-header .rsm-mobile-theme {
    display: inline-grid;
    margin-left: auto;
  }
  .rsm-mobile-panel {
    max-height: calc(100dvh - 4.5rem);
    overflow-y: auto;
    border-top: 1px solid var(--border);
    padding: 0.75rem clamp(1rem, 2.5vw, 2.5rem) 1.25rem;
  }
  .rsm-mobile-panel.is-open {
    display: block;
  }
}
@media (min-width: 1101px) {
  .rsm-header .rsm-mobile-theme {
    display: none;
  }
}
.rsm-mobile-panel ul {
  margin: 0;
  padding: 0;
  list-style: none;
}
.rsm-mobile-panel a {
  display: block;
  padding: 0.65rem 0.25rem;
  color: var(--text-primary);
  font-weight: 500;
  border-bottom: 1px solid var(--border);
}
.rsm-mobile-panel a[aria-current="page"] {
  color: var(--rh-blue);
}
.rsm-mobile-panel details > summary {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.65rem 0.25rem;
  font-weight: 500;
  border-bottom: 1px solid var(--border);
  cursor: pointer;
  list-style: none;
}
.rsm-mobile-panel details > summary::-webkit-details-marker {
  display: none;
}
.rsm-mobile-panel details[open] > summary .rsm-caret {
  transform: rotate(180deg);
}
.rsm-mobile-panel details ul a {
  padding-left: 1rem;
  font-size: 0.9rem;
  color: var(--text-muted);
}
.rsm-mobile-label {
  margin: 1rem 0 0.25rem;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--rh-blue);
}
.rsm-mobile-panel .rsm-portal-item {
  padding: 0.55rem 0.25rem;
}
.rsm-mobile-contact {
  display: flex;
  flex-wrap: wrap;
  gap: 0.25rem 1.25rem;
  margin-top: 0.75rem;
}
.rsm-mobile-contact a {
  border: 0;
  color: var(--rh-blue);
  font-size: 0.9rem;
}
@media (prefers-reduced-motion: reduce) {
  .rsm-portal-btn {
    transition: none;
  }
}
@media (max-width: 560px) {
  .rsm-brand-tag {
    display: none;
  }
  .rsm-brand {
    min-width: 0;
    flex-shrink: 1;
  }
  .rsm-brand-name {
    font-size: 1rem;
  }
  .rsm-menu-toggle {
    padding: 0.55rem;
  }
  .rsm-menu-toggle-label {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip-path: inset(50%);
  }
  .rsm-brand img {
    width: 2.8rem;
  }
}

/* Larger header logo */
.rsm-brand { gap: 1rem; }
.rsm-brand img { width: 4.75rem; }
.rsm-brand-name { font-size: 1.3rem; }
.rsm-brand-tag { font-size: 0.6rem; }
@media (min-width: 1101px) and (max-width: 1360px) {
  .rsm-brand img { width: 4.25rem; }
  .rsm-brand-name { font-size: 1.2rem; }
}
@media (max-width: 560px) {
  .rsm-brand img { width: 3.6rem; }
  .rsm-brand-name { font-size: 1.05rem; }
}
