/* ==========================================================================
   Header v2 — modern, mobile-first site header.
   Self-contained under the `.hv2` namespace so it does not depend on the
   Bootsnav theme. Colours are reused from the existing UGM palette
   (see :root in brand.css) — no new colours are introduced.

   Layout:
   - Mobile-first: brand + hamburger; the menu lives in a right-hand drawer.
   - Desktop (>= 1200px): inline horizontal nav; hamburger/drawer hidden.
   ========================================================================== */

.hv2 * {
  box-sizing: border-box;
}

.hv2 {
  position: sticky;
  top: 0;
  z-index: 1030;
  background: var(--ugm-blue-dark);
  border-bottom: 1px solid rgba(255, 255, 255, 0.14);
  box-shadow: 0 6px 20px rgba(0, 46, 85, 0.16);
  font-family: var(--flc-font-sans);
}

/* --- Institutional contact bar ------------------------------------------- */
.hv2-contact {
  max-height: 48px;
  overflow: hidden;
  margin: 0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  background: rgba(0, 20, 40, 0.28);
  color: rgba(255, 255, 255, 0.82);
  font-style: normal;
  opacity: 1;
  transform: translateY(0);
  transition: max-height 0.22s ease, opacity 0.16s ease, transform 0.22s ease, border-color 0.22s ease;
}

.hv2.is-contact-hidden .hv2-contact {
  max-height: 0;
  border-bottom-color: transparent;
  opacity: 0;
  pointer-events: none;
  transform: translateY(-100%);
}

.hv2-contact__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  width: 100%;
  max-width: 1170px;
  min-height: 34px;
  margin: 0 auto;
  padding: 6px 20px;
  font-size: 11px;
  line-height: 1.35;
}

.hv2-contact__address,
.hv2-contact__links,
.hv2-contact__link {
  display: inline-flex;
  align-items: center;
}

.hv2-contact__address {
  min-width: 0;
}

.hv2-contact__links {
  flex-shrink: 0;
  gap: 18px;
}

.hv2-contact__link {
  gap: 5px;
  border-radius: 4px;
  color: rgba(255, 255, 255, 0.88);
  font-style: normal;
  white-space: nowrap;
  text-decoration: none;
}

.hv2-contact__link:hover,
.hv2-contact__link:focus-visible {
  color: var(--ugm-yellow);
  outline: none;
  text-decoration: none;
}

.hv2-contact__link:focus-visible {
  box-shadow: 0 0 0 2px var(--ugm-yellow);
}

.hv2-contact .fa {
  flex-shrink: 0;
  margin-right: 2px;
  color: var(--ugm-yellow);
  font-size: 12px;
}

.hv2-contact__link strong {
  color: var(--white);
  font-weight: 700;
}

.hv2__bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  width: 100%;
  max-width: 1170px;
  margin: 0 auto;
  padding: 10px 16px;
  min-height: 64px;
}

/* --- Brand ---------------------------------------------------------------- */
.hv2__brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
  flex: 0 1 auto;
  color: var(--white);
  text-decoration: none;
}

.hv2__brand:hover,
.hv2__brand:focus {
  color: var(--white);
  text-decoration: none;
}

.hv2__logo {
  flex-shrink: 0;
  width: auto;
  height: 44px;
  max-width: 64px;
  object-fit: contain;
}

.hv2__title {
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  max-width: 220px;
  color: var(--white);
  font-size: 15px;
  font-weight: 700;
  line-height: 1.2;
  overflow-wrap: break-word;
}

/* --- Shared nav link look ------------------------------------------------- */
.hv2__menu {
  list-style: none;
  margin: 0;
  padding: 0;
  text-transform: none;
}

.hv2__link {
  display: flex;
  align-items: center;
  color: rgba(255, 255, 255, 0.9);
  font-size: 13px;
  font-weight: 600;
  text-transform: none;
  text-decoration: none;
  border-radius: 8px;
  transition: color 0.15s ease, background-color 0.15s ease;
}

.hv2__link:hover,
.hv2__link:focus {
  color: var(--ugm-yellow) !important;
  text-decoration: none;
}

/* --- Right-hand actions --------------------------------------------------- */
.hv2__actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}

/* Buttons (login / logout etc.) */
.hv2__btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 9px 16px;
  border: 1px solid transparent;
  border-radius: 999px;
  font-size: 14px;
  font-weight: 700;
  line-height: 1;
  cursor: pointer;
  text-decoration: none;
  transition: background-color 0.15s ease, color 0.15s ease, border-color 0.15s ease;
}

.hv2__btn--solid {
  background: var(--ugm-yellow);
  color: var(--ugm-blue-dark);
}

.hv2__btn--solid:hover,
.hv2__btn--solid:focus {
  background: var(--ugm-yellow-dark);
  color: var(--ugm-blue-dark);
  text-decoration: none;
}

.hv2__btn--ghost {
  background: transparent;
  color: var(--white);
  border-color: rgba(255, 255, 255, 0.4);
}

.hv2__btn--ghost:hover,
.hv2__btn--ghost:focus {
  background: rgba(255, 255, 255, 0.12);
  color: var(--white);
  text-decoration: none;
}

/* --- Hamburger ------------------------------------------------------------ */
.hv2__toggle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 42px;
  height: 42px;
  padding: 0;
  border: 1px solid rgba(255, 255, 255, 0.25);
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.08);
  color: var(--white);
  cursor: pointer;
}

.hv2__toggle:hover,
.hv2__toggle:focus {
  background: rgba(255, 255, 255, 0.16);
}

.hv2__toggle-bars {
  position: relative;
  display: block;
  width: 20px;
  height: 2px;
  background: var(--white);
  border-radius: 2px;
}

.hv2__toggle-bars::before,
.hv2__toggle-bars::after {
  content: "";
  position: absolute;
  left: 0;
  width: 20px;
  height: 2px;
  background: var(--white);
  border-radius: 2px;
}

.hv2__toggle-bars::before {
  top: -6px;
}

.hv2__toggle-bars::after {
  top: 6px;
}

/* --- Desktop user dropdown ------------------------------------------------ */
.hv2-user {
  position: relative;
}

.hv2-user__btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 5px 10px 5px 5px;
  border: 1px solid rgba(255, 255, 255, 0.22);
  border-radius: 999px;
  background: none;
  color: var(--white);
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
}

.hv2-user__btn:hover,
.hv2-user__btn:focus {
  background: rgba(255, 255, 255, 0.16);
}

.hv2-user__avatar {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  object-fit: cover;
  border: 1px solid rgba(255, 255, 255, 0.4);
  flex-shrink: 0;
}

.hv2-user__name {
  max-width: 140px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.hv2-user__caret {
  transition: transform 0.15s ease;
}

.hv2-user.is-open .hv2-user__caret {
  transform: rotate(180deg);
}

.hv2-user__menu {
  position: absolute;
  right: 0;
  top: calc(100% + 8px);
  z-index: 1200;
  display: none;
  min-width: 240px;
  padding: 6px;
  border: 1px solid var(--border-color);
  border-radius: 12px;
  background: var(--white);
  box-shadow: 0 18px 40px rgba(31, 41, 55, 0.18);
}

.hv2-user.is-open .hv2-user__menu {
  display: block;
}

.hv2-user__head {
  padding: 10px 12px;
  border-bottom: 1px solid var(--border-color);
  margin-bottom: 6px;
}

.hv2-user__head strong {
  display: block;
  color: var(--heading-color);
  font-size: 14px;
  line-height: 1.3;
}

.hv2-user__head span {
  display: block;
  color: var(--text-color);
  font-size: 12px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.hv2-user__item {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  padding: 10px 12px;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: var(--heading-color);
  font-size: 14px;
  font-weight: 600;
  text-align: left;
  text-decoration: none;
  cursor: pointer;
}

.hv2-user__item:hover,
.hv2-user__item:focus {
  background: var(--bg-light);
  color: var(--ugm-blue);
  text-decoration: none;
}

.hv2-user__item--danger:hover,
.hv2-user__item--danger:focus {
  color: #b91c1c;
}

.hv2-user__logout {
  margin: 0;
}

/* --- Drawer (mobile menu) ------------------------------------------------- */
.hv2__overlay {
  position: fixed;
  inset: 0;
  z-index: 1040;
  background: rgba(0, 20, 40, 0.55);
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.25s ease, visibility 0.25s ease;
}

.hv2__drawer {
  position: fixed;
  top: 0;
  right: 0;
  z-index: 1050;
  display: flex;
  flex-direction: column;
  width: min(340px, 86vw);
  height: 100%;
  background: var(--ugm-blue-dark);
  box-shadow: -12px 0 40px rgba(0, 0, 0, 0.3);
  transform: translateX(100%);
  transition: transform 0.28s ease;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
}

.hv2.is-open .hv2__overlay {
  opacity: 1;
  visibility: visible;
}

.hv2.is-open .hv2__drawer {
  transform: translateX(0);
}

.hv2__drawer-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 16px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.14);
}

.hv2__drawer-title {
  color: var(--white);
  font-size: 15px;
  font-weight: 700;
}

.hv2__close {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 38px;
  height: 38px;
  border: 1px solid rgba(255, 255, 255, 0.25);
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.08);
  color: var(--white);
  font-size: 22px;
  line-height: 1;
  cursor: pointer;
}

.hv2__close:hover,
.hv2__close:focus {
  background: rgba(255, 255, 255, 0.16);
}

.hv2__drawer .hv2__menu {
  padding: 8px 0;
}

.hv2__drawer .hv2__menu li {
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.hv2__drawer .hv2__link {
  padding: 14px 20px;
  font-size: 16px;
  border-radius: 0;
}

.hv2__drawer-auth {
  margin-top: auto;
  padding: 16px 20px 24px;
  border-top: 1px solid rgba(255, 255, 255, 0.14);
}

.hv2__drawer-user {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 14px;
}

.hv2__drawer-user img {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  object-fit: cover;
  border: 1px solid rgba(255, 255, 255, 0.4);
  flex-shrink: 0;
}

.hv2__drawer-user strong {
  display: block;
  color: var(--white);
  font-size: 14px;
  line-height: 1.3;
}

.hv2__drawer-user span {
  display: block;
  color: rgba(255, 255, 255, 0.7);
  font-size: 12px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  max-width: 200px;
}

.hv2__drawer-auth .hv2__btn {
  width: 100%;
  justify-content: center;
  margin-top: 8px;
}

.hv2__drawer-social {
  display: flex;
  gap: 10px;
  padding: 0 20px 24px;
}

.hv2__drawer-social a {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 38px;
  height: 38px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.1);
  color: var(--white);
  font-size: 16px;
  text-decoration: none;
  transition: background-color 0.15s ease, color 0.15s ease;
}

.hv2__drawer-social a:hover,
.hv2__drawer-social a:focus {
  background: var(--ugm-yellow);
  color: var(--ugm-blue-dark);
}

/* Lock page scroll while the drawer is open. */
body.hv2-lock {
  overflow: hidden;
}

/* --- Element visibility per breakpoint ------------------------------------ */
/* Mobile-first defaults: inline nav + desktop user hidden, hamburger shown. */
.hv2__nav-desktop,
.hv2__actions .hv2-user,
.hv2__actions .hv2__btn {
  display: none;
}

.hv2__toggle {
  display: inline-flex;
}

/* Desktop. Below 1200px the drawer is used before the inline menu can wrap. */
@media (min-width: 1200px) {
  .hv2__bar {
    min-height: 76px;
    padding: 10px 16px;
    gap: 12px;
  }

  .hv2__logo {
    height: 52px;
    max-width: 80px;
  }

  .hv2__title {
    max-width: 130px;
    font-size: 16px;
  }

  .hv2__nav-desktop {
    display: flex;
    flex: 1 1 auto;
    min-width: 0;
    justify-content: center;
  }

  .hv2__nav-desktop .hv2__menu {
    display: flex;
    align-items: center;
    gap: 0;
    flex-wrap: nowrap;
    justify-content: center;
    white-space: nowrap;
  }

  .hv2__nav-desktop .hv2__link {
    padding: 10px 10px;
    white-space: nowrap;
  }

  .hv2__actions {
    gap: 6px;
  }

  .hv2-user__name {
    max-width: 105px;
  }

  .hv2__actions .hv2-user,
  .hv2__actions .hv2__btn {
    display: inline-flex;
  }

  .hv2__toggle {
    display: none;
  }

  /* The drawer never shows on desktop, even if a stale open-class lingers. */
  .hv2__overlay,
  .hv2__drawer {
    display: none;
  }
}
.hv2-locale {
  position: relative;
  align-items: center;
  display: inline-flex;
  white-space: nowrap;
}

@media (max-width: 767px) {
  .hv2-contact__inner {
    min-height: 30px;
    justify-content: center;
    padding: 5px 12px;
  }

  .hv2-contact__address,
  .hv2-contact__email {
    display: none;
  }

  .hv2-contact__links {
    justify-content: space-between;
    width: 100%;
    max-width: 360px;
    gap: 10px;
  }

  .hv2-contact__phone {
    gap: 3px;
    font-size: clamp(9.5px, 2.8vw, 11px);
  }

  .hv2-contact .fa {
    margin-right: 1px;
    font-size: 11px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .hv2-contact {
    transition: none;
  }
}

.hv2-locale__select {
  min-width: 116px;
  height: 36px;
  appearance: none;
  padding: 0 28px 0 30px;
  border: 1px solid rgba(255, 255, 255, 0.34);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.08);
  color: var(--white);
  cursor: pointer;
  font-size: 12px;
  font-weight: 700;
  line-height: 1;
  outline: none;
  transition: border-color 0.15s ease, background-color 0.15s ease, box-shadow 0.15s ease;
}

.hv2-locale__select:hover {
  border-color: rgba(255, 255, 255, 0.64);
  background: rgba(255, 255, 255, 0.14);
}

.hv2-locale__select:focus-visible {
  border-color: var(--ugm-yellow);
  box-shadow: 0 0 0 3px rgba(245, 196, 0, 0.28);
}

.hv2-locale__select option {
  background: var(--white);
  color: var(--ugm-blue-dark);
}

.hv2-locale__icon,
.hv2-locale__chevron {
  position: absolute;
  z-index: 1;
  color: var(--ugm-yellow);
  pointer-events: none;
}

.hv2-locale__icon {
  left: 11px;
  font-size: 13px;
}

.hv2-locale__chevron {
  right: 10px;
  font-size: 11px;
}

.hv2__drawer-auth .hv2-locale,
.hv2__drawer-auth .hv2-locale__select {
  width: 100%;
}
