/* ========================================================
   StudyMRCOG lightweight responsive header
   ======================================================== */

:root {
	--header-height: 105px;
	--header-container-width: 1480px;
	--header-text: #111111;
	--header-background: rgba(255, 255, 255, 0.96);
	--header-border: rgba(0, 0, 0, 0.08);
	--header-shadow: 0 8px 28px rgba(0, 0, 0, 0.08);
	--header-pink: #e75c98;
	--header-blue: #199ce3;
}
/* ===================================================
   DM Sans Font
=================================================== */

@font-face {
    font-family: "DM Sans";
    src: url("../fonts/dm-sans-v17-latin-regular.woff2") format("woff2");
    font-weight: 400;
    font-style: normal;
    font-display: swap;
}

@font-face {
    font-family: "DM Sans";
    src: url("../fonts/dm-sans-v17-latin-500.woff2") format("woff2");
    font-weight: 500;
    font-style: normal;
    font-display: swap;
}

@font-face {
    font-family: "DM Sans";
    src: url("../fonts/dm-sans-v17-latin-700.woff2") format("woff2");
    font-weight: 700;
    font-style: normal;
    font-display: swap;
}
h1, h2, h3, h4, h5, h6{
    font-family: "DM Sans", sans-serif;
    font-weight:700;
}
/* Prevent default browser spacing */
body {
	margin: 0;
}

/* Header container */
.site-header {
	position: fixed;
	z-index: 999;
	top: 0;
	right: 0;
	left: 0;
	width: 100%;
	background: transparent;
	transition:
		background-color 0.25s ease,
		box-shadow 0.25s ease,
		border-color 0.25s ease;
}

/* Header after scrolling */
.site-header.is-scrolled {
	border-bottom: 1px solid var(--header-border);
	background: var(--header-background);
	box-shadow: var(--header-shadow);
	backdrop-filter: blur(8px);
}

/* Inner header width */
.header-container {
	display: flex;
	width: min(
		var(--header-container-width),
		calc(100% - 60px)
	);
	min-height: var(--header-height);
	margin-inline: auto;
	align-items: center;
	gap: 36px;
}

/* Logo area */
.site-branding {
	display: flex;
	flex-shrink: 0;
	align-items: center;
}

.custom-logo-link {
	display: inline-flex;
	align-items: center;
}

.custom-logo {
	display: block;
	width: auto;
	max-width: 235px;
	max-height: 82px;
	object-fit: contain;
}

.site-title {
	color: var(--header-text);
	font-size: 25px;
	font-weight: 700;
	text-decoration: none;
}

/* Desktop navigation */
.primary-navigation {
	margin-left: auto;
}

.primary-menu,
.primary-menu ul {
	padding: 0;
	margin: 0;
	list-style: none;
}

.primary-menu {
	display: flex;
	align-items: center;
	gap: 12px;
}

.primary-menu > li {
	position: relative;
}

.primary-menu > li > a {
	display: flex;
	min-height: 54px;
	padding: 0 21px;
   font-family: "DM Sans", sans-serif;
	align-items: center;
	justify-content: center;
	border-radius: 30px;
	color: var(--header-text);
	font-size: 16px;
	font-weight: 500;
	letter-spacing: 0.01em;
	text-decoration: none;
	text-transform: uppercase;
	transition:
		color 0.2s ease,
		background-color 0.2s ease;
}

.primary-menu > li > a:hover,
.primary-menu > li.current-menu-item > a,
.primary-menu > li.current-menu-ancestor > a,
.primary-menu > li.current_page_item > a {
	color: var(--header-text);
	background: rgba(255, 255, 255, 0.88);
}

/* LMS Login menu item */
.primary-menu > li.menu-lms-login > a {
	padding-inline: 24px;
	border: 1px solid #111111;
	background: linear-gradient(
		90deg,
		var(--header-blue),
		var(--header-pink)
	);
	color: #111111;
}

.primary-menu > li.menu-lms-login > a:hover {
	color: #ffffff;
}

/* Dropdown submenu */
.primary-menu .sub-menu {
	position: absolute;
	top: calc(100% + 5px);
	left: 0;
	width: 230px;
	padding: 10px;
	border: 1px solid var(--header-border);
	border-radius: 12px;
	visibility: hidden;
	opacity: 0;
	background: #ffffff;
	box-shadow: var(--header-shadow);
	transform: translateY(8px);
	transition:
		opacity 0.2s ease,
		visibility 0.2s ease,
		transform 0.2s ease;
}

.primary-menu li:hover > .sub-menu,
.primary-menu li:focus-within > .sub-menu {
	visibility: visible;
	opacity: 1;
	transform: translateY(0);
}

.primary-menu .sub-menu li {
	width: 100%;
}

.primary-menu .sub-menu a {
	display: block;
	padding: 11px 14px;
	border-radius: 7px;
	color: var(--header-text);
	font-size: 14px;
	text-decoration: none;
}

.primary-menu .sub-menu a:hover {
	background: #fff1f7;
	color: var(--header-pink);
}

/* Account icon */
.header-account-link {
	display: inline-flex;
	width: 52px;
	height: 52px;
	flex-shrink: 0;
	align-items: center;
	justify-content: center;
	border-radius: 50%;
	color: #111111;
	text-decoration: none;
	transition: background-color 0.2s ease;
}

.header-account-link:hover {
	color: #111111;
	background: rgba(255, 255, 255, 0.8);
}

/* Mobile menu button */
.mobile-menu-toggle {
	display: none;
	width: 44px;
	height: 44px;
	padding: 9px;
	flex-direction: column;
	align-items: center;
	justify-content: center;
	gap: 5px;
	border: 0;
	border-radius: 7px;
	background: transparent;
}

.mobile-menu-toggle span {
	display: block;
	width: 25px;
	height: 2px;
	background: #111111;
	transition:
		transform 0.2s ease,
		opacity 0.2s ease;
}

/* Mobile open icon */
.mobile-menu-toggle.is-active span:nth-child(1) {
	transform: translateY(7px) rotate(45deg);
}

.mobile-menu-toggle.is-active span:nth-child(2) {
	opacity: 0;
}

.mobile-menu-toggle.is-active span:nth-child(3) {
	transform: translateY(-7px) rotate(-45deg);
}

/*
 * The fixed header overlays the first section.
 * Use this class when the first section should begin below the header.
 */
.page-header-spacing {
	padding-top: var(--header-height);
}

/* ========================================================
   Tablet and mobile
   ======================================================== */

@media (max-width: 1100px) {
	.header-container {
		width: min(100% - 40px, var(--header-container-width));
		min-height: 88px;
		gap: 14px;
	}

	.custom-logo {
		max-width: 190px;
		max-height: 65px;
	}

	.mobile-menu-toggle {
		display: inline-flex;
		margin-left: auto;
	}

	.primary-navigation {
		position: absolute;
		top: 100%;
		right: 0;
		left: 0;
		display: none;
		max-height: calc(100vh - 88px);
		padding: 18px 20px 28px;
		overflow-y: auto;
		border-top: 1px solid var(--header-border);
		background: #ffffff;
		box-shadow: var(--header-shadow);
	}

	.primary-navigation.is-open {
		display: block;
	}

	.primary-menu {
		display: block;
		width: min(100%, 700px);
		margin-inline: auto;
	}

	.primary-menu > li {
		width: 100%;
		border-bottom: 1px solid #eeeeee;
	}

	.primary-menu > li > a {
		min-height: 52px;
		padding: 10px 6px;
		justify-content: flex-start;
		border-radius: 0;
	}

	.primary-menu > li.current-menu-item > a,
	.primary-menu > li.current-menu-ancestor > a,
	.primary-menu > li.current_page_item > a {
		background: transparent;
		color: var(--header-pink);
	}

	.primary-menu > li.menu-lms-login {
		padding: 15px 0;
		border-bottom: 0;
	}

	.primary-menu > li.menu-lms-login > a {
		min-height: 50px;
		padding-inline: 22px;
		justify-content: center;
		border-radius: 28px;
	}

	.primary-menu .sub-menu {
		position: static;
		width: 100%;
		padding: 0 0 10px 15px;
		border: 0;
		visibility: visible;
		opacity: 1;
		box-shadow: none;
		transform: none;
	}

	.primary-menu .sub-menu a {
		padding: 9px 12px;
	}

	.header-account-link {
		width: 44px;
		height: 44px;
	}
}

@media (max-width: 600px) {
	:root {
		--header-height: 78px;
	}

	.header-container {
		width: calc(100% - 28px);
		min-height: 78px;
	}

	.custom-logo {
		max-width: 155px;
		max-height: 56px;
	}

	.header-account-link {
		display: none;
	}

	.primary-navigation {
		max-height: calc(100vh - 78px);
	}
}

/* Remove animation for users who prefer reduced motion */
@media (prefers-reduced-motion: reduce) {
	.site-header,
	.primary-menu a,
	.mobile-menu-toggle span {
		transition: none;
	}
}