/* =========================================================
   HEADER — Top Utility Bar + Main Header
   Department of Endocrinology, CMC Vellore
   ========================================================= */

:root {
	--endo-navy: #0A2559;
	--endo-navy-light: #123a80;
	--endo-gold: #D9A03B;
	--endo-blue-accent: #2C6FE3;
	--endo-red: #E0332F;
	--endo-text: #1F2937;
	--endo-border: #E7EAF0;
}

.endo-mainheader,
.endo-topbar,
.endo-topbar * ,
.endo-mainheader * {
	box-sizing: border-box;
}

/* ---------------------------------------------------------
   TOP UTILITY BAR
   --------------------------------------------------------- */
.endo-topbar {
	background: var(--endo-navy);
	color: #cfd8ea;
	font-size: 13px;
	line-height: 1.4;
}

.endo-topbar-inner {
	max-width: 1320px;
	margin: 0 auto;
	padding: 7px 24px;
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 16px;
}

.endo-topbar-links {
	display: flex;
	align-items: center;
	overflow-x: auto;
	scrollbar-width: none;
	white-space: nowrap;
}
.endo-topbar-links::-webkit-scrollbar { display: none; }

.endo-topbar-links a {
	color: #cfd8ea;
	text-decoration: none;
	white-space: nowrap;
	transition: color .15s ease;
}
.endo-topbar-links a:hover { color: #fff; }

/* Pipe separators between the utility links, like the reference design */
.endo-topbar-links a + a {
	position: relative;
	margin-left: 14px;
}
.endo-topbar-links a + a::before {
	content: "";
	position: absolute;
	left: -14px;
	top: 50%;
	transform: translateY(-50%);
	width: 1px;
	height: 12px;
	background: rgba(207, 216, 234, 0.35);
}

.endo-topbar-right {
	display: flex;
	align-items: center;
	gap: 22px;
	flex-shrink: 0;
}

.endo-emergency {
	display: inline-flex;
	align-items: center;
	gap: 7px;
	color: var(--endo-red);
	font-weight: 600;
	text-decoration: none;
	white-space: nowrap;
}
.endo-emergency-icon {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 20px;
	height: 20px;
	border-radius: 50%;
	background: var(--endo-red);
	flex-shrink: 0;
}
.endo-emergency-icon .dashicons {
	font-size: 12px;
	width: 12px;
	height: 12px;
	color: #fff;
}
.endo-emergency-label { color: var(--endo-red); }
.endo-emergency-number { color: #fff; font-weight: 700; }

.endo-social {
	display: flex;
	align-items: center;
	gap: 10px;
}

.endo-social a {
	color: #cfd8ea;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 22px;
	height: 22px;
	border-radius: 50%;
	transition: color .15s ease, background .15s ease;
}
.endo-social a:hover {
	color: var(--endo-navy);
	background: #fff;
}
.endo-social .dashicons {
	font-size: 14px;
	width: 14px;
	height: 14px;
}

/* Search trigger, now living in the topbar (see PART A.3 in functions.php)
   instead of the white main header row — same circular-icon-button shape
   as .endo-search-toggle's base rules further down, just re-coloured here
   for the dark navy background it now always sits on. One shared button/
   panel for every breakpoint, so nothing needs a separate mobile version. */
.endo-topbar-right .endo-search-toggle {
	width: 30px;
	height: 30px;
	border-color: rgba(207, 216, 234, 0.35);
	color: #cfd8ea;
}
.endo-topbar-right .endo-search-toggle:hover {
	background: #fff;
	border-color: #fff;
	color: var(--endo-navy);
}
.endo-topbar-right .endo-search-toggle .dashicons {
	font-size: 15px;
	width: 15px;
	height: 15px;
}

/* ---------------------------------------------------------
   MAIN HEADER
   --------------------------------------------------------- */
.endo-mainheader {
	background: #fff;
	border-bottom: 1px solid var(--endo-border);
	position: sticky;
	top: 0;
	z-index: 999;
	transition: box-shadow .2s ease;
}
.endo-mainheader.endo-is-scrolled {
	box-shadow: 0 4px 16px rgba(10, 37, 89, 0.08);
}

.endo-mainheader-inner {
	max-width: 1320px;
	margin: 0 auto;
	padding: 12px 24px;
	display: flex;
	align-items: center;
	gap: 24px;
}

/* Logo */
.endo-logo a {
	display: flex;
	align-items: center;
	gap: 12px;
	text-decoration: none;
	color: inherit;
}

.endo-logo-img {
	height: 54px;
	width: 54px;
	object-fit: contain;
	flex-shrink: 0;
}

.endo-logo-text {
	display: flex;
	flex-direction: column;
	line-height: 1.25;
}
.endo-logo-text strong {
	font-size: 14.5px;
	font-weight: 700;
	color: var(--endo-navy);
	letter-spacing: .2px;
	text-transform: uppercase;
}
.endo-logo-text small {
	font-size: 11.5px;
	font-weight: 600;
	color: var(--endo-gold);
	letter-spacing: .3px;
}

/* Mobile-drawer-only element — hidden by default (desktop uses none of
   this; the desktop nav is exactly what it was before this redesign).
   Only shown ≤991px, inside the off-canvas drawer — see that media query
   further down. */
.endo-mobile-drawer-lang {
	display: none;
}

/* Nav */
.endo-nav-wrap {
	flex: 1;
	display: flex;
	justify-content: flex-end;
}

.endo-menu {
	display: flex;
	align-items: center;
	gap: 4px;
	list-style: none;
	margin: 0;
	padding: 0;
	flex-wrap: wrap;
	justify-content: flex-end;
}

.endo-menu li {
	position: relative;
}

.endo-menu > li > a {
	display: flex;
	align-items: center;
	gap: 4px;
	padding: 10px 12px;
	text-decoration: none;
	color: var(--endo-navy);
	font-size: 14px;
	font-weight: 500;
	white-space: nowrap;
	border-bottom: 2px solid transparent;
	transition: color .15s ease, border-color .15s ease;
}

.endo-menu > li > a:hover,
.endo-menu > li.current-menu-item > a {
	color: var(--endo-blue-accent);
	border-bottom-color: var(--endo-blue-accent);
}

/* dropdown caret for items with children — applies at every nesting
   depth (not just top-level), so Level 2/3/4 parent items also get an
   indicator. Top-level caret points down (opens below); nested carets
   are flipped to point right (flyout opens to the side) below. */
.endo-menu li.menu-item-has-children > a::after {
	content: "";
	width: 6px;
	height: 6px;
	border-right: 1.5px solid currentColor;
	border-bottom: 1.5px solid currentColor;
	transform: rotate(45deg);
	margin-left: 2px;
	margin-top: -3px;
	transition: transform .15s ease;
	flex-shrink: 0;
}

/* Nested (Level 3+) carets point right, since those submenus flyout
   to the side instead of dropping down. */
.endo-menu .sub-menu li.menu-item-has-children > a::after {
	transform: rotate(-45deg);
	margin-top: 0;
}

.endo-menu .sub-menu {
	list-style: none;
	margin: 0;
	padding: 8px 0;
	position: absolute;
	top: 100%;
	left: 0;
	min-width: 220px;
	background: #fff;
	border: 1px solid var(--endo-border);
	border-radius: 6px;
	box-shadow: 0 12px 28px rgba(10, 37, 89, 0.12);
	opacity: 0;
	visibility: hidden;
	transform: translateY(6px);
	transition: opacity .15s ease, transform .15s ease, visibility .15s ease;
	z-index: 20;
}

/* Level 3+ submenus (a .sub-menu nested inside another .sub-menu) flyout
   to the RIGHT of their parent item instead of dropping below it —
   otherwise they'd stack directly under the Level 2 item and overlap
   the rest of the Level 2 list. */
.endo-menu .sub-menu .sub-menu {
	top: -9px;
	left: 100%;
	margin-left: 6px;
	transform: translateX(6px);
}

/* ---- Edge-of-viewport flip ----
   Applied by header.js right before a submenu opens, only when it
   measures that the default position would overflow past the right
   edge of the viewport (e.g. the last couple of top-level items, or
   any flyout several levels deep). Same class name at both depths —
   which behaviour applies depends on how deeply the submenu is
   nested, matching the two positioning rules above/below it. */
.endo-menu > li.menu-item-has-children > .sub-menu.endo-submenu-flip {
	left: auto;
	right: 0;
}
.endo-menu .sub-menu .sub-menu.endo-submenu-flip {
	left: auto;
	right: 100%;
	margin-left: 0;
	margin-right: 6px;
	transform: translateX(-6px);
}

/* Generalized (was previously scoped to only top-level `.endo-menu > li`,
   which is why Level 3/4 nested submenus never appeared — this now
   matches a menu-item-has-children at ANY depth, so hovering/opening a
   Level 2 or Level 3 parent reveals its own child submenu too). Resting
   translateY(0)/translateX(0) both resolve to "no offset", so this one
   rule correctly settles both the top-level (vertical slide) and nested
   (horizontal slide, either direction) submenus into place. */
.endo-menu li.menu-item-has-children:hover > .sub-menu,
.endo-menu li.menu-item-has-children.endo-submenu-open > .sub-menu {
	opacity: 1;
	visibility: visible;
	transform: translateY(0);
}

.endo-menu .sub-menu a {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 8px;
	padding: 9px 18px;
	color: var(--endo-text);
	text-decoration: none;
	font-size: 13.5px;
	white-space: nowrap;
}
.endo-menu .sub-menu a:hover {
	background: #F3F6FC;
	color: var(--endo-blue-accent);
}

/* Search toggle + panel */
.endo-search-toggle {
	background: none;
	border: 1.5px solid var(--endo-border);
	border-radius: 50%;
	width: 38px;
	height: 38px;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	color: var(--endo-navy);
	cursor: pointer;
	flex-shrink: 0;
	transition: background .15s ease, border-color .15s ease;
}
.endo-search-toggle:hover {
	background: #F3F6FC;
	border-color: var(--endo-blue-accent);
}
.endo-search-toggle .dashicons {
	font-size: 18px;
	width: 18px;
	height: 18px;
}

.endo-search-panel {
	max-height: 0;
	overflow: hidden;
	border-top: 0 solid var(--endo-border);
	transition: max-height .25s ease, border-color .25s ease;
}
.endo-search-panel.endo-search-open {
	max-height: 90px;
	border-top-width: 1px;
}

.endo-search-form {
	max-width: 1320px;
	margin: 0 auto;
	padding: 16px 24px;
	display: flex;
	gap: 10px;
}
.endo-search-form input[type="search"] {
	flex: 1;
	padding: 10px 14px;
	border: 1.5px solid var(--endo-border);
	border-radius: 6px;
	font-size: 14px;
}
.endo-search-form input[type="search"]:focus {
	outline: none;
	border-color: var(--endo-blue-accent);
}
.endo-search-form button {
	background: var(--endo-navy);
	color: #fff;
	border: 0;
	border-radius: 6px;
	padding: 0 18px;
	cursor: pointer;
	display: inline-flex;
	align-items: center;
}

/* NABH accreditation badge, next to the logo */
.endo-nabh-badge {
	display: flex;
	align-items: center;
	flex-shrink: 0;
}
.endo-nabh-badge-img {
	height: 50px;
	width: auto;
	object-fit: contain;
}

/* Language translator dropdown (Google Translate under the hood —
   see endo_translator_footer_script() in functions.php). Reused in
   two spots: the desktop top bar, and the mobile language+search row
   further down — same markup, wrapper class only changes which
   context it's in. */
.endo-translator select {
	background: #fff;
	border: 1px solid var(--endo-border);
	border-radius: 6px;
	padding: 5px 10px;
	font-size: 13px;
	color: var(--endo-text);
	height: 30px;
	cursor: pointer;
}
.endo-translator--desktop select {
	background: rgba(255, 255, 255, 0.08);
	border-color: rgba(207, 216, 234, 0.35);
	color: #cfd8ea;
}
.endo-translator--desktop select option {
	color: var(--endo-text);
}

/* Hide Google's own floating translate UI — we drive it entirely
   through our own styled <select> instead. */
#google_translate_element,
.goog-te-banner-frame,
.goog-te-balloon-frame,
#goog-gt-tt,
.goog-tooltip,
.skiptranslate iframe {
	display: none !important;
	visibility: hidden !important;
	opacity: 0 !important;
	pointer-events: none !important;
}
.goog-text-highlight {
	background-color: transparent !important;
	box-shadow: none !important;
}
body.translated-ltr,
body.translated-rtl {
	top: 0 !important;
}

/* Hamburger — now sits directly in the compact header row (☰ — logo —
   lang/search/account), hidden on desktop, shown ≤991px. */
.endo-mobile-toggle {
	display: none;
	align-items: center;
	justify-content: center;
	width: 40px;
	height: 40px;
	flex-shrink: 0;
	background: transparent;
	border: 0;
	border-radius: 8px;
	cursor: pointer;
	transition: background .15s ease;
}
.endo-mobile-toggle:hover { background: #F3F6FC; }
.endo-mobile-toggle-icon {
	display: flex;
	flex-direction: column;
	justify-content: center;
	gap: 5px;
	width: 20px;
}
.endo-mobile-toggle-icon span {
	width: 20px;
	height: 2px;
	background: var(--endo-navy);
	border-radius: 2px;
	transition: transform .2s ease, opacity .2s ease;
}
.endo-mobile-toggle.endo-is-active .endo-mobile-toggle-icon span:nth-child(1) {
	transform: translateY(7px) rotate(45deg);
}
.endo-mobile-toggle.endo-is-active .endo-mobile-toggle-icon span:nth-child(2) {
	opacity: 0;
}
.endo-mobile-toggle.endo-is-active .endo-mobile-toggle-icon span:nth-child(3) {
	transform: translateY(-7px) rotate(-45deg);
}

/* Mobile header icon cluster (language / search / account) — hidden on
   desktop, where the topbar already has its own versions of these. */
.endo-header-mobile-icons {
	display: none;
	align-items: center;
	gap: 8px;
	margin-left: auto;
}
.endo-header-mobile-icons .endo-translator select {
	height: 32px;
	font-size: 12px;
	padding: 4px 8px;
}
.endo-search-toggle--mobile,
.endo-account-toggle {
	display: flex;
	align-items: center;
	justify-content: center;
	width: 34px;
	height: 34px;
	border-radius: 50%;
	border: 1px solid var(--endo-border);
	background: #fff;
	color: var(--endo-navy);
	flex-shrink: 0;
	text-decoration: none;
}
.endo-search-toggle--mobile .dashicons,
.endo-account-toggle .dashicons {
	font-size: 16px;
	width: 16px;
	height: 16px;
}

/* Body scroll-lock while the drawer or search overlay is open (mobile). */
body.endo-scroll-lock {
	overflow: hidden;
}

/* Dimmed backdrop behind the drawer / search overlay. */
.endo-drawer-backdrop {
	display: none;
	position: fixed;
	inset: 0;
	background: rgba(10, 37, 89, 0.45);
	z-index: 1150;
	opacity: 0;
	visibility: hidden;
	transition: opacity .2s ease, visibility .2s ease;
}
.endo-drawer-backdrop.endo-backdrop-open {
	opacity: 1;
	visibility: visible;
}

/* ---------------------------------------------------------
   MOBILE QUICK-ACCESS ICON ROW (Home / Education / etc.)
   Hidden on desktop; shown ≤991px, directly under the header.
   --------------------------------------------------------- */
.endo-mobile-quicklinks {
	display: none;
}
.endo-tablet-navstrip {
	display: none;
}

/* ---------------------------------------------------------
   FULL-SCREEN SEARCH OVERLAY (mobile) — reuses the same
   .endo-search-panel element the desktop dropdown uses; the
   ≤991px rules further down convert it into a fixed overlay.
   --------------------------------------------------------- */
.endo-search-close { display: none; }
.endo-search-form-icon { display: none; }
.endo-search-popular,
.endo-search-recent,
.endo-search-info {
	display: none; /* desktop dropdown stays input-only */
}

/* ===========================================================
   RESPONSIVE BREAKPOINTS
   =========================================================== */

/* ---- Large tablets / small laptops ---- */
@media (max-width: 1199px) {
	.endo-menu > li > a {
		padding: 10px 9px;
		font-size: 13.5px;
	}
}

/* ---- Tablets & below: collapse to hamburger menu ---- */
@media (max-width: 991px) {

	/* Desktop topbar is fully hidden here — its language, search, and
	   account controls now live inside .endo-header-mobile-icons in the
	   compact header row itself (see functions.php PART A.4), so
	   keeping a stripped-down topbar around underneath it just
	   duplicates them. */
	.endo-topbar {
		display: none;
	}

	.endo-mainheader-inner {
		padding: 10px 16px;
		gap: 10px;
		flex-wrap: wrap;
	}

	.endo-logo { min-width: 0; }

	.endo-logo-img { height: 44px; width: 44px; }
	.endo-logo-text strong { font-size: 12.5px; }
	.endo-logo-text small { font-size: 10px; }

	.endo-nabh-badge { display: none; }

	.endo-mobile-toggle { display: flex; order: -1; }
	.endo-header-mobile-icons { display: flex; }

	/* ------------------------------------------------------
	   OFF-CANVAS DRAWER
	   .endo-nav-wrap becomes a fixed left-hand panel instead
	   of an inline dropdown; header.js toggles .endo-nav-open.
	   ------------------------------------------------------ */
	.endo-nav-wrap {
		position: fixed;
		top: var(--endo-header-h, 96px);
		left: 0;
		bottom: 0;
		width: min(320px, 86vw);
		background: #fff;
		z-index: 1200;
		display: flex;
		flex-direction: column;
		transform: translateX(-100%);
		transition: transform .25s ease;
		box-shadow: 8px 0 24px rgba(10, 37, 89, 0.18);
		overflow-y: auto;
		-webkit-overflow-scrolling: touch;
		overscroll-behavior: contain;
	}
	.endo-nav-wrap.endo-nav-open {
		transform: translateX(0);
	}

	.endo-mobile-drawer-lang {
		display: block;
		padding: 12px 18px;
		border-bottom: 1px solid var(--endo-border);
		flex-shrink: 0;
	}
	.endo-mobile-drawer-lang .endo-translator select {
		width: 100%;
	}

	.endo-nav {
		flex: 1;
		min-height: 0;
	}

	.endo-menu {
		flex-direction: column;
		align-items: stretch;
		gap: 0;
		padding: 6px 0 16px;
	}

	/* Top-level dashicon, matched via the endo-icon-{slug} class added
	   in functions.php (PART A.1b). */
	.endo-menu > li > a {
		padding: 13px 18px;
		border-bottom: 1px solid var(--endo-border);
		justify-content: flex-start;
		gap: 12px;
		font-size: 14.5px;
	}
	.endo-menu > li[class*="endo-icon-"] > a::before {
		font-family: dashicons;
		font-size: 18px;
		width: 18px;
		height: 18px;
		line-height: 1;
		color: var(--endo-blue-accent);
		flex-shrink: 0;
	}
	.endo-menu > li.endo-icon-admin-home > a::before { content: "\f102"; }
	.endo-menu > li.endo-icon-groups > a::before { content: "\f307"; }
	.endo-menu > li.endo-icon-welcome-learn-more > a::before { content: "\f118"; }
	.endo-menu > li.endo-icon-heart > a::before { content: "\f487"; }
	.endo-menu > li.endo-icon-chart-line > a::before { content: "\f238"; }
	.endo-menu > li.endo-icon-media-document > a::before { content: "\f497"; }
	.endo-menu > li.endo-icon-calendar-alt > a::before { content: "\f508"; }
	.endo-menu > li.endo-icon-portfolio > a::before { content: "\f322"; }
	.endo-menu > li.endo-icon-phone > a::before { content: "\f525"; }
	.endo-menu > li.endo-icon-arrow-right-alt2 > a::before { content: "\f345"; }

	/* Caret moves to the end of the row (icon + label take the start). */
	.endo-menu li.menu-item-has-children > a::after {
		margin-top: 0;
		margin-left: auto;
		transition: transform .2s ease;
	}
	.endo-menu li.menu-item-has-children.endo-submenu-open > a::after {
		transform: rotate(-135deg);
	}
	.endo-menu .sub-menu li.menu-item-has-children > a::after {
		transform: rotate(45deg);
	}
	.endo-menu .sub-menu li.menu-item-has-children.endo-submenu-open > a::after {
		transform: rotate(-135deg);
	}

	/* Sub-menus become inline accordions on mobile, not floating/flyout
	   panels — this already matches nested (Level 3+) submenus too,
	   since it's a plain descendant selector with no `>` restricting it
	   to direct children. Each item gets a small bullet, matching the
	   reference design's indented sub-item dots. */
	.endo-menu .sub-menu {
		position: static;
		opacity: 1;
		visibility: visible;
		transform: none;
		box-shadow: none;
		border: 0;
		border-radius: 0;
		background: #F8FAFD;
		max-height: 0;
		overflow: hidden;
		padding: 0;
		margin-left: 0;
		transition: max-height .25s ease;
	}
	.endo-menu li.endo-submenu-open > .sub-menu {
		max-height: 600px;
		padding: 4px 0;
	}
	.endo-menu .sub-menu a {
		padding: 10px 18px 10px 40px;
		font-size: 13.5px;
		position: relative;
	}
	.endo-menu .sub-menu li > a::before {
		content: "\2022";
		position: absolute;
		left: 24px;
		color: var(--endo-blue-accent);
	}
	/* Indent each nesting level a bit further so the hierarchy
	   (Level 2 → Level 3 → Level 4) stays readable in the accordion. */
	.endo-menu .sub-menu .sub-menu {
		background: #F1F5FB;
	}
	.endo-menu .sub-menu .sub-menu a {
		padding-left: 54px;
	}
	.endo-menu .sub-menu .sub-menu li > a::before { left: 38px; }
	.endo-menu .sub-menu .sub-menu .sub-menu {
		background: #EAF0F9;
	}
	.endo-menu .sub-menu .sub-menu .sub-menu a {
		padding-left: 70px;
	}
	.endo-menu .sub-menu .sub-menu .sub-menu li > a::before { left: 54px; }

	/* Mobile quick-access icon row (Home/Faculty/Appointment/etc.) is
	   phone-only — see the ≤767px block further down. Tablet portrait
	   gets the fuller inline nav strip instead (≤991 && ≥768 block). */

	/* ------------------------------------------------------
	   FULL-SCREEN SEARCH OVERLAY
	   ------------------------------------------------------ */
	.endo-search-panel {
		position: fixed;
		inset: 0;
		max-height: none;
		background: #fff;
		z-index: 1200;
		opacity: 0;
		visibility: hidden;
		transform: translateY(8px);
		transition: opacity .2s ease, visibility .2s ease, transform .2s ease;
		border-top: 0;
		overflow-y: auto;
	}
	.endo-search-panel.endo-search-open {
		opacity: 1;
		visibility: visible;
		transform: translateY(0);
		max-height: none;
	}
	.endo-search-panel-inner {
		padding: 18px 20px 32px;
		max-width: 640px;
		margin: 0 auto;
	}
	.endo-search-close {
		display: flex;
		margin-left: auto;
		align-items: center;
		justify-content: center;
		width: 36px;
		height: 36px;
		border: 0;
		background: transparent;
		color: var(--endo-navy);
		cursor: pointer;
	}

	.endo-search-form {
		padding: 4px 0 0;
		position: relative;
	}
	.endo-search-form-icon {
		display: block;
		position: absolute;
		left: 14px;
		top: 50%;
		transform: translateY(-50%);
		color: #8A93A6;
		font-size: 17px;
	}
	.endo-search-form input[type="search"] {
		padding-left: 40px;
		background: #F5F8FD;
		border-radius: 10px;
		height: 44px;
	}
	.endo-search-form button { display: none; }

	.endo-search-popular,
	.endo-search-recent {
		display: block;
		margin-top: 24px;
	}
	.endo-search-section-label {
		margin: 0 0 10px;
		font-size: 13px;
		font-weight: 700;
		color: var(--endo-navy);
	}
	.endo-search-chips {
		display: flex;
		flex-wrap: wrap;
		gap: 8px;
	}
	.endo-search-chip {
		background: #F1F5FB;
		border: 0;
		border-radius: 20px;
		padding: 8px 14px;
		font-size: 12.5px;
		font-weight: 600;
		color: var(--endo-navy);
		cursor: pointer;
	}
	.endo-search-chip:hover { background: #E4ECFA; }

	.endo-search-recent-list {
		list-style: none;
		margin: 0;
		padding: 0;
	}
	.endo-search-recent-list li {
		display: flex;
		align-items: center;
		gap: 10px;
		border-bottom: 1px solid var(--endo-border);
	}
	.endo-search-recent-term {
		flex: 1;
		display: flex;
		align-items: center;
		gap: 10px;
		background: transparent;
		border: 0;
		padding: 11px 4px;
		font-size: 13.5px;
		color: var(--endo-text);
		cursor: pointer;
		text-align: left;
	}
	.endo-search-recent-term .dashicons {
		font-size: 15px;
		width: 15px;
		height: 15px;
		color: #8A93A6;
	}
	.endo-search-recent-remove {
		display: flex;
		align-items: center;
		justify-content: center;
		width: 26px;
		height: 26px;
		border: 0;
		background: transparent;
		color: #8A93A6;
		cursor: pointer;
		flex-shrink: 0;
	}
	.endo-search-recent-remove:hover { color: var(--endo-red); }

	.endo-search-info {
		display: flex;
		align-items: flex-start;
		gap: 10px;
		margin-top: 24px;
		padding: 14px;
		background: #EEF3FC;
		border-radius: 10px;
		font-size: 12.5px;
		color: var(--endo-navy);
		line-height: 1.5;
	}
	.endo-search-info .dashicons { flex-shrink: 0; margin-top: 1px; }
}

/* ---- Tablet portrait: header row stays left-aligned (hamburger — logo
   — lang/search/account), same shape as phone, but with a visible
   horizontal nav strip underneath instead of nav-only-via-drawer. The
   hamburger still opens the same off-canvas drawer as phone — see
   header.js — this strip is just a faster path to the top-level pages
   without opening it. ---- */
@media (min-width: 768px) and (max-width: 991px) {
	.endo-logo-img { height: 50px; width: 50px; }
	.endo-logo-text strong { font-size: 14px; }
	.endo-logo-text small { font-size: 11px; }
	.endo-nabh-badge-img { height: 42px; }

	.endo-tablet-navstrip {
		display: flex;
		gap: 4px;
		padding: 4px 16px 0;
		background: #fff;
		border-bottom: 1px solid var(--endo-border);
		overflow-x: auto;
		scrollbar-width: none;
	}
	.endo-tablet-navstrip::-webkit-scrollbar { display: none; }

	.endo-tablet-navlink {
		display: flex;
		flex-direction: column;
		align-items: center;
		gap: 6px;
		flex: 1;
		min-width: 76px;
		padding: 10px 6px 12px;
		text-decoration: none;
		color: var(--endo-text);
		text-align: center;
		white-space: nowrap;
		border-bottom: 2px solid transparent;
	}
	.endo-tablet-navlink .dashicons {
		font-size: 21px;
		width: 21px;
		height: 21px;
		color: var(--endo-navy);
	}
	.endo-tablet-navlink span:last-child {
		font-size: 12.5px;
		font-weight: 600;
	}
	.endo-tablet-navlink:hover,
	.endo-tablet-navlink.endo-is-active {
		color: var(--endo-blue-accent);
		border-bottom-color: var(--endo-blue-accent);
	}
	.endo-tablet-navlink:hover .dashicons,
	.endo-tablet-navlink.endo-is-active .dashicons {
		color: var(--endo-blue-accent);
	}
}

/* ---- Phone: the fixed quick-access icon grid (Home/Faculty/Appointment/
   Order Books/Training/Patient Services) — tablet portrait uses the
   inline nav strip above instead. ---- */
@media (max-width: 767px) {
	.endo-mobile-quicklinks {
		display: flex;
		justify-content: space-between;
		gap: 2px;
		padding: 10px 8px;
		background: #fff;
		border-bottom: 1px solid var(--endo-border);
	}
	.endo-mobile-quicklink {
		display: flex;
		flex-direction: column;
		align-items: center;
		gap: 4px;
		flex: 1;
		min-width: 0;
		padding: 4px 2px;
		text-decoration: none;
		color: var(--endo-text);
		text-align: center;
		border-radius: 8px;
	}
	.endo-mobile-quicklink .dashicons {
		font-size: 20px;
		width: 20px;
		height: 20px;
		color: var(--endo-navy);
	}
	.endo-mobile-quicklink span:last-child {
		font-size: 10.5px;
		font-weight: 600;
		line-height: 1.15;
		white-space: nowrap;
		overflow: hidden;
		text-overflow: ellipsis;
		max-width: 100%;
	}
}

/* ---- Small phones ---- */
@media (max-width: 480px) {
	.endo-logo-text small { display: none; }
	.endo-search-form { padding-top: 4px; }

	.endo-nabh-badge-img { height: 28px; }

	/* Header's own translator control gets a little tighter at this width. */
	.endo-translator select { font-size: 12px; }
}
