/* =================================================================
   MINDS – Header v2 + Site search
   Load AFTER style.css / custom.css (see style.php).
   All classes are prefixed "mh-" so the old template rules
   (.menu, .header-section, .header-bar …) never touch this header.
   ================================================================= */

:root {
  --mh-blue-deep: #0a4f9b;
  --mh-blue: #0d63bd;
  --mh-blue-bright: #1a78d4;
  --mh-ink: #18233a;
  --mh-muted: #5b677a;
  --mh-tint: #eaf3fd;
  --mh-line: #e2e8f0;
  --mh-mark: #fff0a6;
  --mh-font: 'Quicksand', 'Poppins', system-ui, -apple-system, 'Segoe UI', sans-serif;
  --mh-topbar-h: 44px;
  --mh-nav-h: 60px;
}

/* ---------- Shell & sticky behaviour ----------
   The whole header is sticky; its negative "top" (set by header-v2.js)
   scrolls the top bar + brand row out of view so only the menu row sticks
   on desktop, and only the brand row sticks on mobile/tablet. */
.mh-header {
  position: -webkit-sticky;
  position: sticky;
  top: var(--mh-stick, -160px);
  z-index: 1000;
  background: #fff;
  font-family: var(--mh-font);
  color: var(--mh-ink);
}
.mh-header ul { list-style: none; margin: 0; padding: 0; }
.mh-header a { text-decoration: none; }
.mh-header button { font-family: inherit; }
.mh-nowrap { white-space: nowrap; }
.mh-visually-hidden {
  position: absolute !important; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0;
}

/* Keyboard focus (the theme removes outlines globally) */
.mh-header a:focus-visible,
.mh-header button:focus-visible,
.mh-search a:focus-visible,
.mh-search button:focus-visible {
  outline: 2px solid var(--mh-blue-bright);
  outline-offset: 2px;
}
.mh-topbar a:focus-visible { outline-color: #fff; }

/* ---------- Top bar ---------- */
.mh-topbar {
  background: linear-gradient(90deg, var(--mh-blue-deep) 0%, var(--mh-blue) 55%, #0b58aa 100%);
  color: #fff;
  font-size: 14px;
  font-weight: 500;
}
.mh-topbar__inner {
  display: flex;
  align-items: center;
  min-height: var(--mh-topbar-h);
  gap: 16px;
}
.mh-topbar a { color: #fff; display: inline-flex; align-items: center; gap: 8px; white-space: nowrap; }
.mh-topbar a:hover { color: #d7e9ff; }
.mh-topbar i { font-size: 15px; opacity: .9; }

.mh-topbar__contact { display: flex; align-items: center; gap: 22px; margin-right: auto !important; }
.mh-topbar__phone { display: none; } /* desktop: phone lives in the brand row */

.mh-topbar__links { display: flex; align-items: center; }
.mh-topbar__links li { display: flex; align-items: center; }
.mh-topbar__links li + li::before {
  content: "";
  width: 1px; height: 18px;
  background: rgba(255, 255, 255, .28);
}
.mh-topbar__links a { padding: 0 14px; }

.mh-topbar__fee {
  align-self: stretch;
  padding: 0 18px;
  background: rgba(255, 255, 255, .12);
  border-left: 1px solid rgba(255, 255, 255, .18);
  border-right: 1px solid rgba(255, 255, 255, .18);
}
.mh-topbar__fee:hover { background: rgba(255, 255, 255, .2); color: #fff !important; }

/* ---------- Brand row ---------- */
.mh-brandbar { border-bottom: 1px solid var(--mh-line); }
.mh-brandbar__inner {
  display: flex;
  align-items: center;
  gap: 24px;
  padding-top: 12px;
  padding-bottom: 12px;
}

.mh-brand { display: flex; align-items: center; gap: 18px; margin-right: auto; min-width: 0; flex: 1 1 auto; }
.mh-brand__logo { width: auto; height: 96px; max-width: none; flex: none; }
.mh-brand__text { display: flex; flex-direction: column; min-width: 0; }
.mh-brand__name {
  color: var(--mh-blue);
  font-size: 24px;
  font-weight: 700;
  line-height: 1.15;
  text-transform: uppercase;
  letter-spacing: .01em;
  max-width: 19ch;
}
.mh-brand__addr { color: var(--mh-muted); font-size: 15.5px; font-weight: 500; margin-top: 6px; }

.mh-contact { display: flex; align-items: center; }
.mh-contact__item { border-left: 1px solid var(--mh-line); padding: 4px 0 4px 22px; margin-left: 22px; }
.mh-contact__item a { display: flex; align-items: center; gap: 14px; color: var(--mh-ink); }
.mh-contact__icon {
  flex: none;
  width: 52px; height: 52px;
  border-radius: 50%;
  background: var(--mh-tint);
  color: var(--mh-blue);
  display: grid; place-items: center;
  font-size: 24px;
  transition: background-color .2s, color .2s;
}
.mh-contact__item a:hover .mh-contact__icon { background: var(--mh-blue); color: #fff; }
.mh-contact__text { display: flex; flex-direction: column; line-height: 1.45; }
.mh-contact__text strong { font-size: 14.5px; font-weight: 700; color: var(--mh-ink); }
.mh-contact__text span { font-size: 13.5px; font-weight: 500; color: var(--mh-muted); white-space: nowrap; }

.mh-admit {
  flex: none;
  display: inline-flex;
  align-items: center;
  gap: 14px;
  padding: 12px 18px 12px 18px;
  border-radius: 6px;
  background: linear-gradient(135deg, var(--mh-blue) 0%, var(--mh-blue-deep) 100%);
  color: #fff !important;
  box-shadow: 0 8px 18px rgba(13, 99, 189, .22);
  transition: transform .2s, box-shadow .2s;
}
.mh-admit:hover { transform: translateY(-1px); box-shadow: 0 10px 22px rgba(13, 99, 189, .32); }
.mh-admit > i { font-size: 30px; }
.mh-admit__text { display: flex; flex-direction: column; font-size: 18px; font-weight: 600; line-height: 1.2; }
.mh-admit__year { font-weight: 700; white-space: nowrap; }
.mh-admit__arrow {
  width: 9px; height: 9px;
  border-top: 2px solid currentColor;
  border-right: 2px solid currentColor;
  transform: rotate(45deg);
  margin-left: 6px;
}

.mh-brandbar__tools { display: none; align-items: center; gap: 8px; }
.mh-iconbtn {
  width: 44px; height: 44px;
  padding: 0 !important;
  border: 0;
  border-radius: 8px;
  background: var(--mh-tint);
  color: var(--mh-blue);
  display: grid; place-items: center;
  font-size: 20px;
  cursor: pointer;
}
.mh-burger { position: relative; }
.mh-burger span {
  position: absolute; left: 12px; right: 12px; height: 2px;
  background: currentColor; border-radius: 2px;
  transition: transform .25s, opacity .2s, top .25s;
}
.mh-burger span:nth-child(1) { top: 15px; }
.mh-burger span:nth-child(2) { top: 21px; }
.mh-burger span:nth-child(3) { top: 27px; }
.mh-burger[aria-expanded="true"] span:nth-child(1) { top: 21px; transform: rotate(45deg); }
.mh-burger[aria-expanded="true"] span:nth-child(2) { opacity: 0; }
.mh-burger[aria-expanded="true"] span:nth-child(3) { top: 21px; transform: rotate(-45deg); }

/* ---------- Menu row (desktop ≥1200px) ---------- */
.mh-nav { background: #fff; transition: box-shadow .2s; }
.mh-header.is-stuck .mh-nav { box-shadow: 0 6px 18px rgba(16, 40, 80, .10); }
.mh-nav__inner { display: flex; align-items: center; min-height: var(--mh-nav-h); gap: 8px; }
.mh-nav__mobile { display: none; }

.mh-menu { display: flex; align-items: center; flex: 1; justify-content: space-between; }
.mh-menu__item { position: relative; }
.mh-menu__link {
  display: flex !important;
  align-items: center;
  gap: 7px;
  height: 46px;
  padding: 0 12px !important;
  border: 0;
  border-radius: 5px;
  background: transparent;
  color: var(--mh-ink) !important;
  font-size: 15px;
  font-weight: 700;
  white-space: nowrap;
  cursor: pointer;
  transition: color .2s, background-color .2s;
}
.mh-menu__link i { font-size: 17px; }
.mh-menu__item:hover > .mh-menu__link,
.mh-menu__item.is-open > .mh-menu__link { color: var(--mh-blue) !important; }
.mh-menu__item.is-active > .mh-menu__link {
  background: var(--mh-blue);
  color: #fff !important;
}

.mh-caret {
  width: 7px; height: 7px;
  border-right: 2px solid currentColor;
  border-bottom: 2px solid currentColor;
  transform: translateY(-2px) rotate(45deg);
  transition: transform .2s;
  flex: none;
}

/* Dropdowns. !important on left/right guards against the old
   theme script, which writes inline "left" values on hover. */
.mh-sub {
  position: absolute;
  top: 100%;
  left: 0 !important;
  right: auto !important;
  min-width: 250px;
  padding: 6px 0 !important;
  background: #fff;
  border-top: 3px solid var(--mh-blue);
  border-radius: 0 0 6px 6px;
  box-shadow: 0 14px 30px rgba(16, 40, 80, .14);
  display: none;
  z-index: 20;
}
@keyframes mhDrop { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
.mh-sub .mh-sub { top: -9px; left: 100% !important; border-top: 0; border-radius: 6px; }
.mh-sub.is-flipped { left: auto !important; right: 0 !important; }
.mh-sub .mh-sub.is-flipped { right: 100% !important; left: auto !important; }

.mh-sub li { position: relative; }
.mh-sub a,
.mh-sub button {
  display: flex !important;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  width: 100%;
  padding: 10px 18px !important;
  border: 0;
  background: transparent;
  color: var(--mh-ink) !important;
  font-size: 14.5px;
  font-weight: 600;
  line-height: 1.35;
  text-align: left;
  cursor: pointer;
}
.mh-sub .mh-caret { transform: rotate(-45deg); }
.mh-sub li:hover > a,
.mh-sub li:hover > button,
.mh-sub li.is-open > button,
.mh-sub a.is-current { background: var(--mh-tint); color: var(--mh-blue) !important; }

@media (min-width: 1200px) {
  .has-sub:hover > .mh-sub,
  .has-sub:focus-within > .mh-sub,
  .has-sub.is-open > .mh-sub {
    display: block;
    animation: mhDrop .18s ease-out;
  }
  .mh-menu__item.has-sub:hover > .mh-menu__link .mh-caret { transform: translateY(1px) rotate(225deg); }
}

.mh-searchbtn {
  flex: none;
  width: 46px; height: 46px;
  margin-left: 8px;
  padding: 0 !important;
  border: 0;
  border-radius: 50%;
  background: var(--mh-tint);
  color: var(--mh-blue);
  font-size: 20px;
  display: grid; place-items: center;
  cursor: pointer;
  transition: background-color .2s, color .2s;
}
.mh-searchbtn:hover { background: var(--mh-blue); color: #fff; }

/* ---------- Desktop fine-tuning ---------- */
@media (min-width: 1400px) {
  .mh-nav .container {/* max-width: 1440px; */}
}
@media (max-width: 1399.98px) {
  .mh-contact__item--location { display: none; }  /* address already sits under the name */
  .mh-brand__name { font-size: 22px; }
  .mh-brand__addr { font-size: 14.5px; }
  .mh-brand__logo { height: 88px; }
  .mh-topbar__links a { padding: 0 11px; }
}
@media (min-width: 1200px) and (max-width: 1399.98px) {
  /* give the menu row the full screen width and tighten it */
  .mh-nav .container { max-width: none; padding-left: 20px; padding-right: 20px; }
  .mh-menu__link { font-size: 14px; gap: 5px; padding: 0 7px !important; }
  .mh-menu__item:first-child .mh-menu__link { padding: 0 13px !important; }
  .mh-menu__link .mh-home-label { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(0,0,0,0); }
  .mh-menu__link i { font-size: 19px; }
  .mh-searchbtn { margin-left: 4px; }
}

/* ---------- Tablet & mobile (<1200px): drawer menu ---------- */
@media (max-width: 1199.98px) {
  .mh-header { top: var(--mh-stick, calc(var(--mh-topbar-h) * -1)); }
  .mh-header.is-stuck { box-shadow: 0 6px 18px rgba(16, 40, 80, .10); }

  .mh-topbar__links { display: none; }
  .mh-topbar__phone { display: block; }
  .mh-topbar__inner { gap: 12px; }

  .mh-contact { display: none; }
  .mh-brandbar { border-bottom: 0; }
  .mh-brandbar__inner { gap: 14px; padding-top: 10px; padding-bottom: 10px; }
  .mh-brandbar__tools { display: flex; }
  .mh-brand__logo { height: 72px; }
  .mh-brand__name { font-size: 19px; }
  .mh-brand__addr { font-size: 13.5px; }
  .mh-admit { padding: 9px 14px; gap: 10px; }
  .mh-admit > i { font-size: 24px; }
  .mh-admit__text { font-size: 15px; }

  .mh-searchbtn { display: none; }

  .mh-nav {
    position: absolute;
    left: 0; right: 0; top: 100%;
    max-height: calc(100vh - var(--mh-bar-h, 96px));
    max-height: calc(100dvh - var(--mh-bar-h, 96px));
    overflow-y: auto;
    overscroll-behavior: contain;
    border-top: 1px solid var(--mh-line);
    box-shadow: 0 18px 30px rgba(16, 40, 80, .16);
    display: none;
  }
  .mh-header.is-menu-open .mh-nav { display: block; }
  .mh-nav__inner { display: block; padding-top: 6px; padding-bottom: 18px; }

  .mh-menu { display: block; }
  .mh-menu__item { border-bottom: 1px solid var(--mh-line); }
  .mh-menu__link {
    width: 100%;
    height: auto;
    padding: 14px 4px !important;
    justify-content: space-between;
    border-radius: 0;
    font-size: 16px;
  }
  .mh-menu__link i { display: none; }
  .mh-menu__item.is-active > .mh-menu__link { background: transparent; color: var(--mh-blue) !important; }

  .mh-sub,
  .mh-sub .mh-sub {
    position: static;
    min-width: 0;
    display: none;
    animation: none;
    box-shadow: none;
    border: 0;
    border-radius: 0;
    background: #f5f8fc;
    padding: 4px 0 !important;
  }
  .mh-sub .mh-sub { background: #edf2f9; }
  .has-sub.is-open > .mh-sub { display: block; }
  .mh-sub a, .mh-sub button { padding: 11px 18px !important; font-size: 15px; }
  .mh-sub .mh-sub a, .mh-sub .mh-sub button { padding-left: 30px !important; }
  .mh-sub .mh-sub .mh-sub a { padding-left: 42px !important; }
  .mh-sub .mh-caret { transform: translateY(-2px) rotate(45deg); }
  .has-sub.is-open > .mh-menu__link .mh-caret,
  .has-sub.is-open > button .mh-caret { transform: translateY(1px) rotate(225deg); }

  .mh-nav__mobile { display: block; margin-top: 18px; }
  .mh-nav__mobile .mh-admit--block { display: none; }
  .mh-quick { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
  .mh-quick a {
    display: block;
    padding: 11px 14px;
    border: 1px solid var(--mh-line);
    border-radius: 6px;
    color: var(--mh-ink);
    font-size: 14.5px;
    font-weight: 600;
  }
  .mh-quick a:hover { border-color: var(--mh-blue); color: var(--mh-blue); }
}

@media (max-width: 767.98px) {
  :root { --mh-topbar-h: 38px; }
  .mh-topbar { font-size: 13px; }
  .mh-topbar__fee { padding: 0 12px; }
  .mh-brandbar .mh-admit { display: none; }        /* moves into the drawer */
  .mh-nav__mobile .mh-admit--block { display: flex; justify-content: center; margin-bottom: 14px; }
  .mh-brand { gap: 12px; }
  .mh-brand__logo { height: 58px; }
  .mh-brand__name { font-size: 15px; max-width: 22ch; }
  .mh-brand__addr { display: none; }
}

@media (max-width: 575.98px) {
  .mh-topbar .mh-topbar__fee { display: none; }   /* in the drawer's quick links */
  .mh-nowrap { white-space: normal; }
  .mh-topbar__contact { gap: 14px; justify-content: space-between; width: 100%; }
  .mh-topbar__email span { max-width: 44vw; overflow: hidden; text-overflow: ellipsis; }
  .mh-brand__logo { height: 50px; }
  .mh-brand__name { font-size: 13.5px; }
  .mh-iconbtn { width: 40px; height: 40px; }
  .mh-burger span { left: 11px; right: 11px; }
  .mh-burger span:nth-child(1) { top: 13px; }
  .mh-burger span:nth-child(2), .mh-burger[aria-expanded="true"] span { top: 19px; }
  .mh-burger span:nth-child(3) { top: 25px; }
}

/* =================================================================
   Site search dialog
   ================================================================= */
body.mh-search-open { overflow: hidden; }

.mh-search {
  position: fixed;
  inset: 0;
  z-index: 100050;
  font-family: var(--mh-font);
}
.mh-search[hidden] { display: none; }
.mh-search__backdrop {
  position: absolute; inset: 0;
  background: rgba(9, 26, 52, .55);
  -webkit-backdrop-filter: blur(2px);
  backdrop-filter: blur(2px);
}
.mh-search__panel {
  position: relative;
  width: min(780px, calc(100% - 32px));
  margin: 72px auto 0;
  background: #fff;
  border-radius: 12px;
  box-shadow: 0 24px 60px rgba(9, 26, 52, .35);
  overflow: hidden;
  animation: mhSearchIn .2s ease-out;
}
@keyframes mhSearchIn { from { opacity: 0; transform: translateY(-10px); } to { opacity: 1; transform: none; } }

.mh-search__form {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 10px 10px 20px;
  border-bottom: 1px solid var(--mh-line);
}
.mh-search__icon { color: var(--mh-blue); font-size: 22px; flex: none; }
.mh-search__form input[type="search"] {
  flex: 1;
  min-width: 0;
  width: auto;
  height: 52px;
  padding: 0 4px !important;
  border: 0 !important;
  background: transparent;
  color: var(--mh-ink);
  font-family: inherit;
  font-size: 19px;
  font-weight: 600;
  box-shadow: none;
}
.mh-search__form input[type="search"]::placeholder { color: #8b96a8; font-weight: 500; }
.mh-search__form input[type="search"]::-webkit-search-cancel-button { display: none; }
.mh-search__submit {
  flex: none;
  height: 46px;
  padding: 0 22px !important;
  border: 0;
  border-radius: 8px;
  background: var(--mh-blue);
  color: #fff;
  font-size: 15px;
  font-weight: 700;
  cursor: pointer;
}
.mh-search__submit:hover { background: var(--mh-blue-deep); }
.mh-search__close {
  flex: none;
  width: 46px; height: 46px;
  padding: 0 !important;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: var(--mh-muted);
  font-size: 18px;
  cursor: pointer;
}
.mh-search__close:hover { background: var(--mh-tint); color: var(--mh-ink); }

.mh-search__body {
  max-height: calc(100vh - 200px);
  overflow-y: auto;
  overscroll-behavior: contain;
  padding: 14px 20px 20px;
}
.mh-search__status { margin: 0 0 10px; color: var(--mh-muted); font-size: 14px; line-height: 1.5; }
.mh-search__status:empty { display: none; }

.mh-search__suggest { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; font-size: 14px; color: var(--mh-muted); }
.mh-search__suggest button {
  padding: 6px 14px !important;
  border: 1px solid var(--mh-line);
  border-radius: 999px;
  background: #fff;
  color: var(--mh-ink);
  font-family: inherit;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
}
.mh-search__suggest button:hover { border-color: var(--mh-blue); color: var(--mh-blue); }
.mh-search.has-query .mh-search__suggest { display: none; }

.mh-search__results { list-style: none; margin: 0; padding: 0; }
.mh-search__results li + li { border-top: 1px solid var(--mh-line); }
.mh-search__results a {
  display: block;
  padding: 14px 12px;
  margin: 0 -12px;
  border-radius: 8px;
  color: var(--mh-ink);
}
.mh-search__results a:hover,
.mh-search__results a:focus-visible { background: #f3f8fe; }
.mh-result__title {
  display: flex; align-items: center; gap: 8px;
  color: var(--mh-blue);
  font-size: 17px;
  font-weight: 700;
  line-height: 1.35;
}
.mh-result__badge {
  flex: none;
  padding: 1px 6px;
  border: 1px solid #c8372d;
  border-radius: 4px;
  color: #c8372d;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: .04em;
}
.mh-result__url { display: block; margin-top: 2px; color: #3f7a4e; font-size: 13px; word-break: break-all; }
.mh-result__snippet { display: block; margin-top: 6px; color: #3c4658; font-size: 14.5px; line-height: 1.6; }
.mh-search mark { background: var(--mh-mark); color: inherit; padding: 0 1px; border-radius: 2px; }

.mh-search__more { margin-top: 12px; text-align: center; }
.mh-search__more button {
  padding: 9px 20px !important;
  border: 1px solid var(--mh-blue);
  border-radius: 8px;
  background: #fff;
  color: var(--mh-blue);
  font-family: inherit;
  font-weight: 700;
  cursor: pointer;
}

@media (max-width: 767.98px) {
  .mh-search__panel { width: 100%; margin: 0; border-radius: 0 0 12px 12px; }
  .mh-search__form { padding: 8px 8px 8px 14px; gap: 6px; }
  .mh-search__form input[type="search"] { font-size: 16px; height: 46px; }
  .mh-search__submit { display: none; }
  .mh-search__body { max-height: calc(100vh - 80px); max-height: calc(100dvh - 80px); padding: 12px 14px 18px; }
}

@media (prefers-reduced-motion: reduce) {
  .mh-header *, .mh-search * { transition: none !important; animation: none !important; }
}
