/* ───────────────────────────────────────────────────────────────
   Header button presence — modern glass-pill navigation.

   Matches the reference layout: nav links grouped inside one translucent
   rounded capsule, plus a solid pill CTA.

   SPECIFICITY NOTE: the header fragment ships an inline <style> block that
   styles `.th-btn.style2.th-btn-icon.scroll-toggle-btn` (4 classes) with
   !important, and it appears AFTER this file in the document. To win, the
   rules below add `.th-header` as a 5th class rather than relying on order.

   The theme's `th-btn-icon` already renders the ↗ arrow via ::after, so no
   arrow is added here — only its colour is corrected per button state.

   Scrolled state: a scroll listener in the header adds `.scrolled` to
   `.main-menu`, the CTA link and `.nav-burger-btn` (NOT to `.th-header`).
   ─────────────────────────────────────────────────────────────── */

/* ── Nav links grouped into one glass capsule ───────────────────────────── */
.th-header .main-menu > ul.realar-menu {
  display: flex;
  align-items: center;
  gap: 4px;
  margin: 0;
  padding: 6px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.18);
  -webkit-backdrop-filter: blur(14px) saturate(140%);
  backdrop-filter: blur(14px) saturate(140%);
  box-shadow: 0 4px 18px rgba(0, 0, 0, 0.12);
  transition: background 0.25s ease, border-color 0.25s ease;
}

.th-header .main-menu > ul.realar-menu > li.menu-item {
  margin: 0;
  padding: 0;
}

/* Each link becomes its own pill so hover/active reads clearly. */
.th-header .main-menu > ul.realar-menu > li.menu-item > a {
  display: inline-flex;
  align-items: center;
  padding: 9px 20px !important;
  border-radius: 999px;
  color: #fff;
  font-size: 13px;
  line-height: 1;
  white-space: nowrap;
  transition: background 0.22s ease, color 0.22s ease;
}

/* Drop the theme's underline/marker effects inside the capsule. */
.th-header .main-menu > ul.realar-menu > li.menu-item > a:before,
.th-header .main-menu > ul.realar-menu > li.menu-item > a:after {
  display: none !important;
}

.th-header .main-menu > ul.realar-menu > li.menu-item > a:hover,
.th-header .main-menu > ul.realar-menu > li.menu-item.current-menu-item > a {
  background: #fff;
  color: #14304f !important;
}

.th-header .main-menu > ul.realar-menu > li.menu-item > a:focus-visible {
  outline: 2px solid #fff;
  outline-offset: 2px;
}

/* ── Primary CTA — top state: solid white pill, dark label ──────────────── */
/* 5 classes + !important so this beats the later inline <style> block. */
.th-header .th-btn.style2.th-btn-icon.scroll-toggle-btn {
  display: inline-flex !important;
  align-items: center;
  gap: 8px;
  padding: 13px 26px !important;
  border: 0 !important;
  border-radius: 999px !important;
  background-color: #fff !important;
  color: #14304f !important;
  font-size: 12.5px;
  font-weight: 600;
  letter-spacing: 0.9px;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.16);
  /* The inline block runs an infinite attention "pulse" that fights this
     shadow on a solid button — the pill already stands out, so stop it. */
  animation: none !important;
}

/* The theme forces its arrow white (for the old transparent button). On a
   white pill that made it invisible, so tint it to the brand navy. */
.th-header .th-btn.style2.th-btn-icon.scroll-toggle-btn:after {
  color: #14304f !important;
  -webkit-filter: none !important;
  filter: none !important;
}

.th-header .th-btn.style2.th-btn-icon.scroll-toggle-btn:hover {
  background-color: #c9a227 !important;
  color: #14304f !important;
  box-shadow: 0 8px 22px rgba(0, 0, 0, 0.24);
}

.th-header .th-btn.style2.th-btn-icon.scroll-toggle-btn:focus-visible {
  outline: 2px solid #c9a227;
  outline-offset: 3px;
}

/* ── Primary CTA — scrolled state: dark pill, white label ───────────────── */
.th-header .th-btn.style2.th-btn-icon.scroll-toggle-btn.scrolled {
  background-color: #14304f !important;
  color: #fff !important;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.18);
}

.th-header .th-btn.style2.th-btn-icon.scroll-toggle-btn.scrolled:after {
  color: #fff !important;
  -webkit-filter: brightness(1) invert(1) !important;
  filter: brightness(1) invert(1) !important;
}

.th-header .th-btn.style2.th-btn-icon.scroll-toggle-btn.scrolled:hover {
  background-color: #c9a227 !important;
  color: #14304f !important;
}

.th-header .th-btn.style2.th-btn-icon.scroll-toggle-btn.scrolled:hover:after {
  color: #14304f !important;
  -webkit-filter: none !important;
  filter: none !important;
}

/* ── Burger button: circular, same glass treatment as the capsule ───────── */
.th-header .nav-cta-group {
  display: flex;
  align-items: center;
  gap: 12px;
}

.th-header .nav-burger-btn {
  width: 46px;
  height: 46px;
  border-radius: 50%;
  border: 1px solid rgba(255, 255, 255, 0.22);
  background: rgba(255, 255, 255, 0.1);
  -webkit-backdrop-filter: blur(14px);
  backdrop-filter: blur(14px);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: background 0.22s ease, border-color 0.22s ease;
}

.th-header .nav-burger-btn:hover {
  background: rgba(255, 255, 255, 0.92);
  border-color: #fff;
}

.th-header .nav-burger-btn:hover .nav-burger-lines span {
  background: #14304f;
}

.th-header .nav-burger-btn:focus-visible {
  outline: 2px solid #fff;
  outline-offset: 2px;
}

/* ── Scrolled header sits on a light background: flip to dark ink ───────── */
.th-header .main-menu.scrolled > ul.realar-menu {
  background: rgba(20, 48, 79, 0.06);
  border-color: rgba(20, 48, 79, 0.12);
  box-shadow: none;
}

.th-header .main-menu.scrolled > ul.realar-menu > li.menu-item > a {
  color: #14304f;
}

.th-header .main-menu.scrolled > ul.realar-menu > li.menu-item > a:hover {
  background: #14304f;
  color: #fff !important;
}

.th-header .nav-burger-btn.scrolled {
  border-color: rgba(20, 48, 79, 0.18);
  background: rgba(20, 48, 79, 0.06);
}

.th-header .nav-burger-btn.scrolled .nav-burger-lines span {
  background: #14304f;
}

.th-header .nav-burger-btn.scrolled:hover {
  background: #14304f;
}

.th-header .nav-burger-btn.scrolled:hover .nav-burger-lines span {
  background: #fff;
}

/* ── Responsive ─────────────────────────────────────────────────────────── */
@media (max-width: 1199.98px) {
  .th-header .main-menu > ul.realar-menu > li.menu-item > a {
    padding: 8px 15px !important;
    font-size: 12px;
  }
}

@media (max-width: 991.98px) {
  .th-header .main-menu > ul.realar-menu {
    padding: 4px;
    gap: 2px;
  }
}

/* Browsers without backdrop-filter get a stronger tint so text stays legible. */
@supports not ((backdrop-filter: blur(1px)) or (-webkit-backdrop-filter: blur(1px))) {
  .th-header .main-menu > ul.realar-menu,
  .th-header .nav-burger-btn {
    background: rgba(0, 0, 0, 0.34);
  }
}

@media (prefers-reduced-motion: reduce) {
  .th-header .th-btn.style2.th-btn-icon.scroll-toggle-btn,
  .th-header .main-menu > ul.realar-menu,
  .th-header .main-menu > ul.realar-menu > li.menu-item > a,
  .th-header .nav-burger-btn {
    transition: none;
  }
}
