/* =========================
   HEADER
========================= */

body.admin-bar .site-header {
  top: 32px;
}

.site-header {
  position: sticky;
  top: 0;
  left: 0;
  right: 0;
  z-index: 9999;

  width: 100%;

  background: rgba(255, 255, 255, 0.9);
  border-bottom: 1px solid rgba(226, 232, 240, 0.72);

  backdrop-filter: blur(22px);
  -webkit-backdrop-filter: blur(22px);
}

.site-header .tm-header-inner {
  width: min(100% - clamp(32px, 5vw, 96px), 1280px);
  max-width: 1280px;
  margin-inline: auto;
}

.tm-header-inner {
  display: grid;
  grid-template-columns: 240px minmax(0, 1fr) 180px;
  align-items: center;

  height: 82px;
  gap: 32px;
}

.site-branding {
  display: flex;
  align-items: center;
}

.site-branding a {
  display: inline-flex;
  align-items: center;
}

.site-header .tm-logo,
.tm-mobile-menu .tm-logo {
  display: inline-flex;
  align-items: baseline;
  justify-content: flex-start;

  min-height: auto;
  padding: 0;

  border: 0;
  border-radius: 0;

  background: transparent;
  box-shadow: none;
  transform: none;

  color: var(--tm-logo-main);

  font-size: 1.46rem;
  font-weight: 840;
  line-height: 1;
  letter-spacing: -0.06em;

  white-space: nowrap;
}

.site-header .tm-logo:hover,
.tm-mobile-menu .tm-logo:hover {
  transform: none;
  box-shadow: none;
}

.tm-logo-main {
  color: var(--tm-logo-main);
}

.tm-logo-dot {
  color: var(--tm-logo-accent);
  margin: 0 0.015em;
}

.tm-logo-sub {
  color: var(--tm-logo-sub);
  font-weight: 660;
}

.site-branding a:hover .tm-logo-dot,
.site-branding a:hover .tm-logo-sub {
  opacity: 0.78;
}

/* Desktop Navigation */

.main-navigation {
  display: flex;
  justify-content: center;
  min-width: 0;
}

.tm-main-menu {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: clamp(20px, 2vw, 36px);

  margin: 0;
  padding: 0;

  list-style: none;
}

.tm-main-menu li {
  position: relative;
  margin: 0;
  padding: 0;
}

.tm-main-menu a {
  position: relative;

  display: inline-flex;
  align-items: center;

  min-height: 82px;

  color: #334155;

  font-size: 0.9rem;
  font-weight: 700;
  line-height: 1;
  letter-spacing: -0.015em;
  white-space: nowrap;

  transition: color 0.18s ease;
}

.tm-main-menu a::after {
  content: "";

  position: absolute;
  left: 50%;
  bottom: 22px;

  width: 0;
  height: 2px;

  border-radius: 999px;
  background: var(--tm-primary);

  transform: translateX(-50%);
  transition: width 0.18s ease;
}

.tm-main-menu a:hover,
.tm-main-menu .current-menu-item > a,
.tm-main-menu .current_page_item > a,
.tm-main-menu .current-menu-ancestor > a {
  color: var(--tm-text);
}

.tm-main-menu a:hover::after,
.tm-main-menu .current-menu-item > a::after,
.tm-main-menu .current_page_item > a::after,
.tm-main-menu .current-menu-ancestor > a::after {
  width: 100%;
}

/* Header CTA */

.tm-header-cta {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  justify-self: end;

  min-width: 154px;
  height: 44px;
  padding: 0 20px;

  border-radius: 999px;

  background: linear-gradient(135deg, #2563eb, #1d4ed8);

  color: #ffffff;

  font-size: 0.86rem;
  font-weight: 800;
  line-height: 1;
  white-space: nowrap;

  box-shadow: 0 10px 24px rgba(15, 23, 42, 0.13);

  transition:
    background 0.18s ease,
    transform 0.18s ease,
    box-shadow 0.18s ease;
}

.tm-header-cta:hover {
  background: linear-gradient(135deg, #1d4ed8, #1e40af);
  color: #ffffff;

  transform: translateY(-1px);

  box-shadow: 0 14px 32px rgba(37, 99, 235, 0.25);
}

/* Mobile Buttons */

.tm-menu-toggle {
  display: none;
}

.tm-mobile-menu {
  display: none;
}

body.tm-menu-open {
  overflow: hidden;
}

/* =========================
   MOBILE HEADER + MENU
========================= */

@media (max-width: 1080px) {

  body.admin-bar .site-header {
    top: 46px;
  }

  .site-header .tm-header-inner {
    width: min(100% - 32px, 100%);
  }

  .tm-header-inner {
    position: relative;

    display: grid;
    grid-template-columns: 1fr auto;

    height: 68px;
    gap: 16px;
  }

  .site-branding {
    justify-self: start;
  }

  .main-navigation,
  .tm-header-cta {
    display: none;
  }

  .tm-menu-toggle {
    position: absolute;
    right: 0;
    top: 50%;
    z-index: 1100;

    display: flex;
    align-items: center;
    justify-content: center;

    width: 48px;
    height: 48px;

    border: 0;
    border-radius: 999px;

    background: transparent;

    cursor: pointer;

    transform: translateY(-50%);
  }

  .tm-menu-toggle span {
    position: absolute;
    left: 50%;

    width: 28px;
    height: 2.5px;

    border-radius: 999px;
    background: #0f172a;

    transform: translateX(-50%);

    transition:
      transform 0.24s ease,
      opacity 0.18s ease,
      top 0.24s ease;
  }

  .tm-menu-toggle span:nth-child(1) {
    top: 15px;
  }

  .tm-menu-toggle span:nth-child(2) {
    top: 23px;
  }

  .tm-menu-toggle span:nth-child(3) {
    top: 31px;
  }

  .tm-mobile-menu {
    position: fixed;
    inset: 0;
    z-index: 1050;

    display: block;

    padding: 86px 24px 38px;

    background:
      radial-gradient(circle at 50% -10%, rgba(37, 99, 235, 0.12), transparent 34%),
      rgba(248, 250, 252, 0.96);

    backdrop-filter: blur(22px);
    -webkit-backdrop-filter: blur(22px);

    opacity: 0;
    visibility: hidden;
    pointer-events: none;

    transform: translateY(-18px) scale(0.985);

    transition:
      opacity 0.28s ease,
      visibility 0.28s ease,
      transform 0.34s cubic-bezier(.22, 1, .36, 1);

    overflow: hidden;
  }

  .tm-mobile-menu.active,
  .tm-mobile-menu[aria-hidden="false"] {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;

    transform: translateY(0) scale(1);
  }

  .tm-mobile-header {
    height: 72px;

    display: flex;
    align-items: center;
    justify-content: space-between;

    margin-bottom: 42px;
    padding: 0 18px;

    border-radius: 26px;

    background: rgba(255, 255, 255, 0.92);

    box-shadow: 0 18px 50px rgba(15, 23, 42, 0.07);
  }

  .tm-mobile-brand {
    font-size: 1.34rem;
    font-weight: 820;
  }

  .tm-menu-close {
    position: relative;

    width: 48px;
    height: 48px;

    border: 0;
    border-radius: 999px;

    background: #eef4ff;

    cursor: pointer;
  }

  .tm-menu-close span {
    position: absolute;
    left: 50%;
    top: 50%;

    width: 22px;
    height: 2.5px;

    border-radius: 999px;
    background: #0f172a;
  }

  .tm-menu-close span:nth-child(1) {
    transform: translate(-50%, -50%) rotate(45deg);
  }

  .tm-menu-close span:nth-child(2) {
    transform: translate(-50%, -50%) rotate(-45deg);
  }

  .tm-mobile-nav {
    display: grid;
    gap: 14px;

    margin: 0;
    padding: 0;

    list-style: none;
  }

  .tm-mobile-nav li {
    margin: 0;
    padding: 0;
  }

  .tm-mobile-nav a {
    position: relative;

    display: flex;
    align-items: center;
    justify-content: space-between;

    min-height: 56px;
    padding: 0 20px;

    border-radius: 18px;

    background: #ffffff;
    border: 1px solid rgba(226, 232, 240, 0.9);

    color: #0f172a;

    font-size: 1.02rem;
    font-weight: 760;

    box-shadow: 0 10px 28px rgba(15, 23, 42, 0.05);
  }

  .tm-mobile-nav a::after {
    content: "→";

    color: var(--tm-primary);

    font-weight: 900;
  }

  .tm-mobile-cta {
    display: flex;
    align-items: center;
    justify-content: center;

    min-height: 58px;
    margin-top: 28px;

    border-radius: 999px;

    background: linear-gradient(135deg, #2563eb, #1d4ed8);

    color: #ffffff;

    font-size: 1rem;
    font-weight: 800;

    box-shadow: 0 20px 44px rgba(37, 99, 235, 0.26);
  }

  body.tm-menu-open .tm-menu-toggle span:nth-child(1) {
    top: 23px;
    transform: translateX(-50%) rotate(45deg);
  }

  body.tm-menu-open .tm-menu-toggle span:nth-child(2) {
    opacity: 0;
  }

  body.tm-menu-open .tm-menu-toggle span:nth-child(3) {
    top: 23px;
    transform: translateX(-50%) rotate(-45deg);
  }
}

@media (max-width: 520px) {

  .tm-mobile-menu {
    padding-left: 18px;
    padding-right: 18px;
  }

  .tm-mobile-header {
    padding: 0 16px;
  }
}