/* Bootstrap's .navbar > .container (templates/includes/navbar/navbar.html,
   used on every website/web-form page - login, preadmission, student
   applicant, etc.) is a flex row with justify-content: space-between.
   .navbar-collapse has display:none while closed, so on mobile it drops out
   of the flex flow entirely - leaving just [brand] [toggler] [...whatever
   else sits in the container, e.g. the language switcher] as the visible
   flex items, which space-between then spreads apart, stranding the
   hamburger toggle in the visual center of the bar instead of next to the
   brand or the other controls. Grouping the toggler (and anything after it)
   together on the right - independent of whether the collapse is open -
   fixes that at every viewport width. */
.navbar .navbar-toggler {
	margin-inline-start: auto;
}

.navbar .container {
	flex-wrap: nowrap;
}

/* Bootstrap's `.ml-auto` is `margin-left: auto` - a physical property, not a
   logical one - but the *ordering* of flex children (which edge is
   "main-start") is direction-aware, so under dir="rtl" (Arabic UI) this
   `<ul class="ml-auto navbar-nav">` (language switcher, Login link, ...)
   was landing on the visual left instead of staying on the right like it
   does in English. Forcing this row's own layout direction to ltr keeps
   its flex ordering and margin math exactly as authored regardless of the
   page's language, so it's pinned to the right in both English and
   Arabic. This only affects box layout/ordering, not glyph shaping, so
   Arabic label text inside it (language switcher, translated Login label)
   still renders correctly - each nav item is its own isolated block, not
   text mixed inline with LTR content. */
.navbar .container,
.navbar .navbar-collapse,
.navbar .ml-auto.navbar-nav {
	direction: ltr;
}

.navbar .ml-auto.navbar-nav {
	margin-left: auto !important;
	margin-right: 0 !important;
}

/* navbar_login.html / dropdown_login.html render a guest "Login" link
   (`<a class="nav-link btn-login-area">`) in this navbar on every
   front-facing website page. Per explicit request, this is removed
   everywhere rather than styled: pre-admission and student-applicant
   already hid it at the page level (preadmission.css / student_applicant.css)
   with a bottom-of-form "Already have an account? Login" prompt instead,
   but every other website page using this same navbar (e.g. /admissions,
   or the generic "Not Permitted" page a logged-out visitor hits on a
   login_required web form) still showed it, since this stylesheet is the
   only one loaded on *all* of them (web_include_css). Hiding it here once
   covers every front-facing page consistently instead of needing a
   per-page override each time. */
.navbar .btn-login-area {
	display: none !important;
}

/* Website navbar (templates/includes/navbar/navbar.html) uses
   navbar-expand-lg, so below 992px Bootstrap normally hides
   #navbarSupportedContent behind the hamburger toggle - that toggle/collapse
   interaction was the thing breaking on the front-facing pages (login,
   pre-admission, student applicant, and any other website/web-form page,
   since this stylesheet is only ever loaded via web_include_css, never on
   desk/admin). Instead of gating that content behind a toggle at all on
   mobile, the toggle button is hidden and the collapse is forced to render
   the same way Bootstrap already renders it at >=992px (display:flex, nav
   items in a row) - so the language switcher and Login link stay visible
   and reachable without ever needing "Toggle navigation". */
@media (max-width: 991.98px) {
	.navbar .navbar-toggler {
		display: none !important;
	}

	.navbar #navbarSupportedContent.collapse {
		display: flex !important;
		flex-basis: auto;
	}

	.navbar #navbarSupportedContent .navbar-nav {
		flex-direction: row;
		flex-wrap: wrap;
		align-items: center;
	}

	.navbar #navbarSupportedContent .nav-item {
		margin-inline-start: 8px;
	}

	.navbar .container {
		flex-wrap: wrap;
	}
}

/* Brand name next to the logo (both hooks.py's brand_html for web forms and
   Website Settings' own brand_html field for the login page / generic
   message pages render the same markup - see hooks.py's comment above
   brand_html for why two places need to match). The full name is too long
   to sit comfortably next to the logo at narrow widths without wrapping
   awkwardly or crowding the hamburger/language-switcher/Login controls, so
   it collapses to the "RCHS" short form below 576px - swapped via CSS
   (rather than shortened with JS) so it's correct on first paint with no
   flash, and works even where brand_html's markup is the only thing
   rendered (no page-specific JS attached, e.g. the login page). */
.navbar-brand {
	display: inline-flex !important;
	align-items: center;

}

.navbar-brand img {
    display: inline-block;
    max-width: 150px;
    max-height: 22px;
}

.rchs-brand-name {
	margin-inline-start: 10px;
	font-size: 1.05rem;
	font-weight: 600;
	line-height: 1.2;
	color: #171717;
	white-space: nowrap;
}

.rchs-brand-name .rchs-brand-short {
	display: none;
}

@media (max-width: 575.98px) {
	.rchs-brand-name .rchs-brand-full {
		display: none;
	}

	.rchs-brand-name .rchs-brand-short {
		display: inline;
	}
}
