/* Public site navigation.
   Desktop (>=1024px): fixed left sidebar with the logo and menu links; a sticky top bar over the content
   holds the theme switch, language, sign in / register and "Get a quote".
   Below 1024px: the top bar shows the logo, as many actions as fit, and ☰; the sidebar becomes a drawer
   that also carries the actions that don't fit. Uses the site's colour tokens; works in both themes. */
:root { --rh-side-w: 260px; --rh-top-h: 68px; }

/* ---- top bar -------------------------------------------------------------------------- */
.rh-topbar {
  position: sticky; top: 0; z-index: 1000; display: flex; align-items: center; gap: 12px;
  height: var(--rh-top-h); padding: 0 24px; background: rgba(255, 255, 255, .97);
  border-bottom: 1px solid var(--line); box-shadow: 0 3px 18px rgba(18, 31, 54, .05); backdrop-filter: blur(12px);
}
.rh-topbar-brand { display: none; min-width: 0; }
.rh-topbar-actions { margin-left: auto; display: flex; align-items: center; gap: 10px; min-width: 0; }
.rh-topbar-actions .rh-btn { min-height: 42px; padding: 9px 16px; font-size: 14px; white-space: nowrap; }
.rh-topbar-actions form { margin: 0; }
.rh-topbar-actions .rh-theme-controls { flex: none; }
.rh-topbar-actions .rh-lang-select { height: 42px; min-width: 112px; }
.rh-top-link { font-size: 14px; font-weight: 700; color: var(--accent); white-space: nowrap; text-decoration: none; }
.rh-top-link:hover { text-decoration: underline; }
.rh-topbar .rh-menu-btn { display: none; flex: none; }

/* ---- sidebar -------------------------------------------------------------------------- */
.rh-side {
  position: fixed; top: 0; bottom: 0; left: 0; z-index: 1100;
  width: var(--rh-side-w); display: flex; flex-direction: column; gap: 16px;
  padding: 18px 16px; overflow-y: auto; overscroll-behavior: contain;
  background: #fff; border-right: 1px solid var(--line); box-shadow: 4px 0 24px rgba(18, 31, 54, .05);
}
.rh-side:focus { outline: none; }
.rh-side-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; min-height: calc(var(--rh-top-h) - 18px); padding: 0 4px 14px; border-bottom: 1px solid var(--line); }
.rh-side .rh-brand-link { display: block; flex: 1; min-width: 0; }
.rh-side .rh-logo-hmt { height: auto; width: 100%; max-width: 224px; }
.rh-side-close { display: none; flex: none; width: 38px; height: 38px; border-radius: 10px; border: 1px solid var(--line); background: transparent; color: var(--ink); font-size: 22px; line-height: 1; cursor: pointer; }

.rh-side-nav { display: flex; flex-direction: column; gap: 2px; }
.rh-side-nav a { display: block; padding: 11px 14px; border-radius: 10px; font-size: 15px; font-weight: 700; color: var(--ink); text-decoration: none; position: relative; }
.rh-side-nav a:hover { background: var(--cloud); color: var(--accent); }
.rh-side-nav a[aria-current="page"] { background: #e7f3ff; color: #0057AA; }
.rh-side-nav a[aria-current="page"]::before { content: ""; position: absolute; left: 0; top: 8px; bottom: 8px; width: 3px; border-radius: 3px; background: #0069C8; }

.rh-side-team { display: flex; flex-direction: column; gap: 2px; padding-top: 14px; border-top: 1px solid var(--line); }
.rh-side-label { margin: 0 0 4px; padding: 0 4px; font-size: 11px; font-weight: 900; letter-spacing: .12em; text-transform: uppercase; color: var(--muted); }
.rh-side-sub { padding: 6px 4px; font-size: 14px; font-weight: 700; color: var(--accent); text-decoration: none; }
.rh-side-sub:hover { text-decoration: underline; }

.rh-side-drawer-extras { display: none; flex-direction: column; gap: 10px; padding-top: 14px; border-top: 1px solid var(--line); }
.rh-side-drawer-extras .rh-btn { width: 100%; min-height: 44px; padding: 11px 14px; }
.rh-side-drawer-extras form { margin: 0; }
.rh-side-drawer-extras .rh-theme-controls { display: grid; grid-template-columns: repeat(3, 1fr); width: 100%; }
.rh-side-drawer-extras .rh-theme-option { min-width: 0; padding: 8px 4px; }
.rh-side-drawer-extras .rh-language-wrap { display: flex; align-items: center; gap: 10px; }
.rh-side-drawer-extras .rh-lang-select { flex: 1; max-width: none; }
.rh-side-pair { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.rh-side-pair .rh-btn { font-size: 14px; padding-left: 8px; padding-right: 8px; }
.rh-side-phone { margin-top: auto; padding: 14px 4px 2px; border-top: 1px solid var(--line); font-size: 14px; font-weight: 800; color: var(--ink); text-decoration: none; }
.rh-side-phone:hover { color: var(--accent); }

.rh-side-backdrop { position: fixed; inset: 0; z-index: 1050; background: rgba(7, 18, 40, .55); }
.rh-side-backdrop[hidden] { display: none; }

/* ---- desktop: permanent sidebar, top bar over the content ------------------------------- */
@media (min-width: 1024px) {
  body { padding-left: var(--rh-side-w); }
  html { scroll-padding-top: calc(var(--rh-top-h) + 12px); }
  .rh-side-backdrop { display: none !important; }
}
/* narrow desktops: drop the theme-switch labels' extra room */
@media (min-width: 1024px) and (max-width: 1180px) {
  .rh-topbar { padding: 0 16px; }
  .rh-topbar-actions { gap: 8px; }
  .rh-topbar-actions .rh-btn { padding: 9px 12px; }
  .rh-topbar-actions .rh-theme-option { padding: 7px; }
}

/* ---- tablets & phones: logo + fitting actions + ☰; sidebar becomes a drawer ------------- */
@media (max-width: 1023px) {
  :root { --rh-top-h: 72px; }
  html { scroll-padding-top: 84px; }
  .rh-topbar { padding: 0 16px; }
  .rh-topbar-brand { display: block; }
  .rh-topbar .rh-logo-hmt { height: 50px; width: auto; max-width: 100%; object-fit: contain; object-position: left; }
  .rh-topbar .rh-menu-btn { display: block; }
  .rh-top-wide { display: none !important; }          /* theme + language move into the drawer */
  .rh-side-drawer-extras { display: flex; }
  /* visibility:hidden keeps the closed drawer's links out of the Tab order and screen readers */
  .rh-side { width: min(320px, 86vw); transform: translateX(-105%); visibility: hidden; transition: transform .22s ease, visibility 0s linear .22s; box-shadow: 0 0 40px rgba(0, 0, 0, .25); }
  .rh-side.open { transform: none; visibility: visible; transition: transform .22s ease; }
  .rh-side-close { display: grid; place-items: center; }
  body.rh-side-locked { overflow: hidden; }
}
@media (max-width: 640px) { .rh-top-mid { display: none !important; } }      /* sign in / register → drawer */
@media (max-width: 480px) {
  .rh-top-quote { display: none !important; }                                     /* quote → drawer */
  .rh-topbar .rh-logo-hmt { height: 46px; }
}
@media (max-width: 360px) { .rh-topbar .rh-logo-hmt { height: 40px; } }
@media (prefers-reduced-motion: reduce) { .rh-side { transition: none; } }

/* ---- dark theme ----------------------------------------------------------------------- */
html[data-theme="dark"] .rh-topbar { background: rgba(8, 27, 58, .97); border-color: #29415E; }
html[data-theme="dark"] .rh-side { background: #0B203F; border-color: #29415E; box-shadow: 4px 0 24px rgba(0, 0, 0, .25); }
html[data-theme="dark"] .rh-side-nav a:hover { background: #142B4D; color: #79D5FF; }
html[data-theme="dark"] .rh-side-nav a[aria-current="page"] { background: #13325a; color: #EAF4FF; }
html[data-theme="dark"] .rh-side-nav a[aria-current="page"]::before { background: #48BFFF; }
html[data-theme="dark"] .rh-side-close { border-color: #395A82; }
html[data-theme="dark"] .rh-side-sub, html[data-theme="dark"] .rh-top-link { color: #79D5FF; }
