/* OMU DSpace Header Layout Fix v2 */

/* Arabic header */
body.omu-dir-rtl ds-header,
body.omu-dir-rtl header,
html[lang^="ar"] ds-header,
html[lang^="ar"] header,
html[dir="rtl"] ds-header,
html[dir="rtl"] header {
  direction: rtl;
}

/* English header */
body.omu-dir-ltr ds-header,
body.omu-dir-ltr header,
html[lang^="en"] ds-header,
html[lang^="en"] header,
html[dir="ltr"] ds-header,
html[dir="ltr"] header {
  direction: ltr;
}

/* Header main row */
ds-header .navbar > .container,
ds-header .navbar > .container-fluid,
header .navbar > .container,
header .navbar > .container-fluid {
  max-width: 100% !important;
  padding-inline: clamp(34px, 5vw, 90px) !important;
  min-height: 92px !important;
  display: flex !important;
  align-items: center !important;
  gap: 18px !important;
}

/* Arabic: logo at far right, tools at opposite side */
body.omu-dir-rtl .omu-header-brand-anchor,
html[lang^="ar"] .omu-header-brand-anchor,
html[dir="rtl"] .omu-header-brand-anchor {
  order: 1 !important;
  margin-inline-start: 0 !important;
  margin-inline-end: 0 !important;
  display: inline-flex !important;
  align-items: center !important;
  flex: 0 0 auto !important;
}

body.omu-dir-rtl ds-header .navbar-collapse,
body.omu-dir-rtl ds-header .navbar-nav,
body.omu-dir-rtl ds-header .nav,
html[lang^="ar"] ds-header .navbar-collapse,
html[lang^="ar"] ds-header .navbar-nav,
html[lang^="ar"] ds-header .nav,
html[dir="rtl"] ds-header .navbar-collapse,
html[dir="rtl"] ds-header .navbar-nav,
html[dir="rtl"] ds-header .nav {
  order: 2 !important;
  margin-inline-start: auto !important;
  margin-inline-end: 0 !important;
  display: flex !important;
  align-items: center !important;
  justify-content: flex-start !important;
  flex-direction: row !important;
  gap: 0.55rem !important;
}

/* Logo sizes */
body.omu-dir-rtl .omu-header-brand-logo,
html[lang^="ar"] .omu-header-brand-logo,
html[dir="rtl"] .omu-header-brand-logo {
  max-width: 245px !important;
  max-height: 62px !important;
  width: auto !important;
  height: auto !important;
  object-fit: contain !important;
}

body.omu-dir-ltr .omu-header-brand-logo,
html[lang^="en"] .omu-header-brand-logo,
html[dir="ltr"] .omu-header-brand-logo {
  max-width: 255px !important;
  max-height: 62px !important;
  width: auto !important;
  height: auto !important;
  object-fit: contain !important;
}

/* Tools balance */
ds-header .nav-link,
ds-header .dropdown-toggle,
ds-header button {
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  gap: 0.35rem !important;
  white-space: nowrap !important;
  line-height: 1.2 !important;
}

ds-header button {
  min-width: 44px !important;
  min-height: 44px !important;
  border-radius: 13px !important;
}

ds-header a {
  text-decoration: none !important;
}

/* Mobile */
@media (max-width: 768px) {
  ds-header .navbar > .container,
  ds-header .navbar > .container-fluid,
  header .navbar > .container,
  header .navbar > .container-fluid {
    padding-inline: 18px !important;
    min-height: 76px !important;
    gap: 10px !important;
  }

  body.omu-dir-rtl .omu-header-brand-logo,
  html[lang^="ar"] .omu-header-brand-logo,
  html[dir="rtl"] .omu-header-brand-logo,
  body.omu-dir-ltr .omu-header-brand-logo,
  html[lang^="en"] .omu-header-brand-logo,
  html[dir="ltr"] .omu-header-brand-logo {
    max-width: 200px !important;
    max-height: 54px !important;
  }
}
