/* Late overrides loaded after plugin styles (mobile fixes that must win). */

/* Global typography scale: make fonts less "giant" across the site.
   Base sizes are defined in theme :root (style.css) and are quite large. */
:root {
	/* Display / hero */
	--font-display: clamp(30px, 3.8vw, 40px);

	/* Headings */
	--font-h1: clamp(24px, 3.2vw, 32px);
	--font-h2: clamp(22px, 2.7vw, 28px);
	--font-h3: clamp(20px, 2.3vw, 24px);
	--font-h4: clamp(20px, 2.2vw, 24px);
	--font-h5: clamp(18px, 2.0vw, 22px);

	/* Text */
	--font-lead: clamp(16px, 1.4vw, 18px);
	--font-body: 16px;
	--font-body-sm: 15px;
	--font-small: 14px;
}

/* Single course: ensure Tutor's lead title isn't gigantic */
.course__info h1,
.course__info .tutor-course-title,
.course__info .tutor-course-header h1,
.course__info .tutor-course-header-title,
.course__info .tutor-course-details-title {
	font-size: clamp(22px, 2.6vw, 32px) !important;
	line-height: 1.12;
	letter-spacing: -0.02em;
}

@media (max-width: 768px) {
	.course__info h1,
	.course__info .tutor-course-title,
	.course__info .tutor-course-header h1,
	.course__info .tutor-course-header-title,
	.course__info .tutor-course-details-title {
		font-size: clamp(20px, 5.2vw, 26px) !important;
		line-height: 1.14;
	}
}

/* Course title: reduce overly large headings (desktop + mobile) */
.single-courses .tutor-course-details-title,
.single-courses .tutor-course-header-title,
.single-courses .tutor-course-title,
.single-courses .tutor-course-header h1,
.course__title.title,
.course__title {
	/* Desktop: keep it strong but not gigantic on long titles */
	font-size: clamp(22px, 2.6vw, 32px) !important;
	line-height: 1.08;
	overflow-wrap: anywhere;
}

@media (max-width: 768px) {
	.single-courses .tutor-course-details-title,
	.single-courses .tutor-course-header-title,
	.single-courses .tutor-course-title,
	.single-courses .tutor-course-header h1,
	.course__title.title,
	.course__title {
		/* Mobile/tablet: make long titles noticeably more compact */
		font-size: clamp(20px, 5.2vw, 26px) !important;
		line-height: 1.12;
		overflow-wrap: break-word;
	}
}

@media (max-width: 420px) {
	.single-courses .tutor-course-details-title,
	.single-courses .tutor-course-header-title,
	.single-courses .tutor-course-title,
	.single-courses .tutor-course-header h1,
	.course__title.title,
	.course__title {
		/* Small phones: even more compact */
		font-size: clamp(18px, 6.0vw, 24px) !important;
		line-height: 1.14;
	}
}

@media (max-width: 768px) {
	/* Some plugin/theme CSS sets a fixed grid track for course layout on mobile.
	   Force a simple stacked layout so the mini-form/help block never overflows. */
	.course__main {
		display: block !important;
		grid-template-columns: none !important;
	}

	.course__media,
	.course__form,
	.course__media .tutor-course-thumbnail,
	.course__media .tutor-course-thumbnail img {
		max-width: 100% !important;
		width: 100% !important;
	}
}

/* Perf: defer heavy below-the-fold background images until idle time (JS sets CSS vars). */
.stories {
	background-image: var(--profintell-bg-stories, none) !important;
}

.footer__mailing {
	background-image: var(--profintell-bg-mailing, none) !important;
}

/* Single course media: keep course image centered and not repeating */
.course__media {
	background-position: center !important;
	background-repeat: no-repeat !important;
}

/* The template uses background-image already; hide the raw thumbnail image to avoid "zoomed" look. */
.course__media .tutor-course-thumbnail {
	display: none !important;
}

/* Single course: back link + breadcrumbs */
.profintell-course-nav {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 16px;
	padding: 14px 0 18px;
	margin-bottom: 14px; /* add "air" before course content */
}

.profintell-course-nav__back {
	display: inline-flex;
	align-items: center;
	gap: 8px;
	text-decoration: none;
	font-weight: 700;
	font-size: 14px;
	color: rgba(26, 26, 26, 0.78);
}

.profintell-course-nav__back:hover {
	color: rgba(26, 26, 26, 1);
}

.profintell-breadcrumbs {
	font-size: 13px;
	line-height: 1.3;
	color: rgba(26, 26, 26, 0.62);
	white-space: nowrap;
	overflow: hidden;
	text-overflow: ellipsis;
	min-width: 0;
}

.profintell-breadcrumbs a {
	color: inherit;
	text-decoration: none;
}

.profintell-breadcrumbs a:hover {
	text-decoration: underline;
}

.profintell-breadcrumbs__sep {
	margin: 0 8px;
	opacity: 0.6;
}

.profintell-breadcrumbs__current {
	color: rgba(26, 26, 26, 0.86);
}

@media (max-width: 768px) {
	.profintell-course-nav {
		flex-direction: column;
		align-items: flex-start;
		padding: 12px 0 14px;
		margin-bottom: 12px;
	}
	.profintell-breadcrumbs {
		width: 100%;
		white-space: normal;
	}
}

.profintell-course-memo {
	margin-top: 18px;
	padding: 16px 18px;
	border: 1px solid rgba(0, 0, 0, 0.08);
	border-radius: var(--radius-md);
	background: #fff;
	box-shadow: 0 10px 25px rgba(0, 0, 0, 0.05);
}

.profintell-course-memo h3 {
	margin: 0 0 10px;
	font-size: 18px;
	line-height: 1.25;
}

.profintell-course-memo p {
	margin: 0 0 10px;
	line-height: 1.5;
}

.profintell-course-memo ol,
.profintell-course-memo ul {
	margin: 0 0 10px 18px;
	padding: 0;
}

.profintell-course-memo li {
	margin: 0 0 6px;
	line-height: 1.45;
}

/* Contacts page: consult image should not look "crooked" on mobile */
.consult__img {
	transform: none !important;
	object-position: center !important;
}

@media (max-width: 768px) {
	.consult__media {
		width: 100%;
	}
	.consult__img {
		width: 100% !important;
		max-width: none !important;
		height: auto !important;
		aspect-ratio: 16 / 9;
		object-fit: cover;
		border-radius: var(--radius-md);
	}
}

/* Text-with-image block: make the image fully responsive and stable on mobile */
.text-w-img__img {
	display: block;
	width: 100% !important;
	max-width: 100% !important;
	height: auto !important;
	max-height: none !important;
	aspect-ratio: auto !important;
	object-position: center !important;
	object-fit: cover !important;
}

/* Mobile header: add a bit of space between search and first content block */
@media (max-width: 1024px) {
	.header {
		margin-bottom: 14px;
	}
}

/* If secondary font lacks Cyrillic, fall back to primary font everywhere */
:root {
	--font-secondary: var(--font-primary);
}

/* Hard fallback for legacy pages where font is set directly */
body,
body * {
	font-family: var(--font-primary), sans-serif !important;
}

/* Header text: force Cyrillic-capable font to avoid mojibake */
.header__menu,
.header__menu a,
.header__contacts,
.header__link,
.header__account-btn,
.header__sign-up-btn,
.burger__menu,
.burger__menu a,
.burger__link {
	font-family: var(--font-primary), sans-serif;
	font-variant-ligatures: none;
}

/* Header search: show as a dropdown overlay without breaking layout */
.header__container {
	position: relative;
}

.header__search {
	left: var(--container-pad);
	right: var(--container-pad);
	top: calc(100% + 10px);
	bottom: auto !important; /* override theme bottom:-10px */
	z-index: 1100;
}

.header__search .search__input {
	border: 1px solid rgba(0, 0, 0, 0.08);
	box-shadow: 0 10px 25px rgba(0, 0, 0, 0.08);
}

@media (max-width: 1024px) {
	.header__search {
		top: calc(100% + 8px);
	}
}

