/* OMU DSpace Header Mirror Fix v3 */

body.omu-header-mirror-active .omu-header-topbar {
  position: relative !important;
}

body.omu-header-mirror-active .omu-header-topbar-container {
  position: relative !important;
  max-width: 100% !important;
  min-height: 92px !important;
  padding-inline: clamp(34px, 5vw, 92px) !important;
}

/* Arabic mirror: logo right, tools left */
body.omu-header-ar .omu-header-brand-anchor {
  position: absolute !important;
  right: clamp(34px, 5vw, 92px) !important;
  left: auto !important;
  top: 50% !important;
  transform: translateY(-50%) !important;
  margin: 0 !important;
  z-index: 5 !important;
  display: inline-flex !important;
  align-items: center !important;
}

body.omu-header-ar .omu-header-tools-anchor {
  position: absolute !important;
  left: clamp(34px, 5vw, 92px) !important;
  right: auto !important;
  top: 50% !important;
  transform: translateY(-50%) !important;
  margin: 0 !important;
  width: auto !important;
  max-width: calc(100% - 430px) !important;
  display: flex !important;
  align-items: center !important;
  justify-content: flex-start !important;
  flex-direction: row !important;
  gap: 12px !important;
  z-index: 5 !important;
}

/* English mirror: logo left, tools right */
body.omu-header-en .omu-header-brand-anchor {
  position: absolute !important;
  left: clamp(34px, 5vw, 92px) !important;
  right: auto !important;
  top: 50% !important;
  transform: translateY(-50%) !important;
  margin: 0 !important;
  z-index: 5 !important;
  display: inline-flex !important;
  align-items: center !important;
}

body.omu-header-en .omu-header-tools-anchor {
  position: absolute !important;
  right: clamp(34px, 5vw, 92px) !important;
  left: auto !important;
  top: 50% !important;
  transform: translateY(-50%) !important;
  margin: 0 !important;
  width: auto !important;
  max-width: calc(100% - 430px) !important;
  display: flex !important;
  align-items: center !important;
  justify-content: flex-end !important;
  flex-direction: row !important;
  gap: 12px !important;
  z-index: 5 !important;
}

/* Logo size */
body.omu-header-mirror-active .omu-header-brand-logo {
  display: block !important;
  width: auto !important;
  max-width: 255px !important;
  max-height: 62px !important;
  object-fit: contain !important;
}

/* Normalize tools */
body.omu-header-mirror-active .omu-header-tools-anchor,
body.omu-header-mirror-active .omu-header-tools-anchor *,
body.omu-header-mirror-active .omu-header-tools-anchor .navbar-nav,
body.omu-header-mirror-active .omu-header-tools-anchor .nav {
  flex-direction: row !important;
  align-items: center !important;
  white-space: nowrap !important;
}

body.omu-header-mirror-active .omu-header-tools-anchor .navbar-nav,
body.omu-header-mirror-active .omu-header-tools-anchor .nav {
  display: flex !important;
  gap: 10px !important;
  margin: 0 !important;
}

body.omu-header-mirror-active ds-header button,
body.omu-header-mirror-active header button {
  min-width: 44px !important;
  min-height: 44px !important;
  border-radius: 13px !important;
}

body.omu-header-mirror-active ds-header a,
body.omu-header-mirror-active header a {
  text-decoration: none !important;
}

/* Do not affect second navigation row */
body.omu-header-ar ds-header > *:not(.omu-header-topbar) {
  direction: rtl;
}

@media (max-width: 768px) {
  body.omu-header-mirror-active .omu-header-topbar-container {
    min-height: 78px !important;
    padding-inline: 18px !important;
  }

  body.omu-header-ar .omu-header-brand-anchor {
    right: 18px !important;
  }

  body.omu-header-ar .omu-header-tools-anchor {
    left: 18px !important;
    max-width: calc(100% - 245px) !important;
    gap: 8px !important;
  }

  body.omu-header-en .omu-header-brand-anchor {
    left: 18px !important;
  }

  body.omu-header-en .omu-header-tools-anchor {
    right: 18px !important;
    max-width: calc(100% - 245px) !important;
    gap: 8px !important;
  }

  body.omu-header-mirror-active .omu-header-brand-logo {
    max-width: 195px !important;
    max-height: 54px !important;
  }
}
