/*
Theme Name: medviral Custom
Theme URI: https://medviral.ru/
Description: Ультралёгкая тема для новостей медицины 2025–2030
Version: 1.0
Text Domain: medviral
*/

:root {
	--mv-bg: #f5f8fc;
	--mv-surface: #ffffff;
	--mv-surface-soft: #f0f6ff;
	--mv-text: #10233f;
	--mv-text-muted: #54677f;
	--mv-primary: #0f4ea7;
	--mv-primary-soft: #e8f0ff;
	--mv-border: #dce6f3;
	--mv-shadow: 0 14px 40px rgba(13, 42, 86, 0.08);
	--mv-header-image: url("https://medviral.ru/wp-content/uploads/2026/04/header-medviral.jpg");
}

*,
*::before,
*::after {
	box-sizing: border-box;
}

html {
	font-size: 16px;
	scroll-behavior: smooth;
}

body {
	margin: 0;
	font-family: "Inter", "Roboto", system-ui, sans-serif;
	line-height: 1.7;
	color: var(--mv-text);
	background: var(--mv-bg);
	font-weight: 400;
}

.main-header {
	position: relative;
	min-height: clamp(280px, 38vw, 480px);
	background-color: #dff5fb;
	background-image: var(--mv-header-image) !important;
	background-size: contain;
	background-position: center center;
	background-repeat: no-repeat;
}

.header-overlay {
	display: flex;
	align-items: flex-end;
	min-height: inherit;
	padding: clamp(2rem, 5vw, 3.5rem) 0;
	background: linear-gradient(180deg, rgba(255, 255, 255, 0.18) 0%, rgba(255, 255, 255, 0.45) 100%);
}

.site-branding {
	display: inline-block;
	max-width: min(720px, 100%);
	padding: clamp(0.55rem, 1vw, 0.75rem) clamp(0.8rem, 1.8vw, 1.15rem);
	border-radius: 14px;
	background: rgba(255, 255, 255, 0.45);
	backdrop-filter: blur(2px);
	color: #0f3558;
	text-decoration: none;
}

.site-branding:hover {
	text-decoration: none;
}

.site-branding__title {
	margin: 0;
	color: #0f3558;
	font-size: clamp(1.7rem, 4.1vw, 2.75rem);
	line-height: 1.1;
	text-wrap: balance;
}

.site-branding__tagline {
	margin: 0;
	color: rgba(15, 53, 88, 0.95);
	font-size: clamp(0.95rem, 1.7vw, 1.08rem);
	max-width: 62ch;
	font-weight: 600;
}

.screen-reader-text {
	position: absolute;
	width: 1px;
	height: 1px;
	padding: 0;
	margin: -1px;
	overflow: hidden;
	clip: rect(0, 0, 0, 0);
	white-space: nowrap;
	border: 0;
}

.main-content {
	padding-block: 2rem 4rem;
}

.container {
	width: 100%;
	max-width: 1240px;
	margin: 0 auto;
	padding: 0 20px;
}

h1,
h2,
h3,
h4,
h5,
h6 {
	font-weight: 800;
	line-height: 1.2;
	margin: 0 0 1rem;
	color: #0b1f3d;
}

h1 {
	font-size: clamp(2rem, 4vw, 3rem);
}

h2 {
	font-size: clamp(1.5rem, 2.6vw, 2.2rem);
}

h3 {
	font-size: clamp(1.3rem, 2.2vw, 1.7rem);
}

p {
	margin: 0 0 1rem;
}

a {
	color: var(--mv-primary);
	text-decoration: none;
}

a:hover {
	text-decoration: underline;
}

img {
	max-width: 100%;
	height: auto;
	display: block;
}

.mv-chip {
	display: inline-flex;
	align-items: center;
	padding: 0.3rem 0.85rem;
	border-radius: 999px;
	background: var(--mv-primary-soft);
	color: var(--mv-primary);
	font-size: 0.8rem;
	font-weight: 700;
	text-transform: uppercase;
	letter-spacing: 0.03em;
}

.mv-page-title {
	margin-bottom: 1.8rem;
}

.mv-page-title h1 {
	margin-bottom: 0.45rem;
	font-size: clamp(1.55rem, 2.8vw, 2.2rem);
}

.mv-page-title p {
	color: var(--mv-text-muted);
	max-width: 70ch;
}

.mv-grid {
	display: grid;
	grid-template-columns: repeat(auto-fit, minmax(290px, 1fr));
	gap: 1.4rem;
}

.mv-card {
	background: var(--mv-surface);
	border-radius: 16px;
	border: 1px solid var(--mv-border);
	box-shadow: var(--mv-shadow);
	overflow: hidden;
	transition: transform 0.2s ease, box-shadow 0.2s ease;
	height: 100%;
}

.mv-card:hover {
	transform: translateY(-4px);
	box-shadow: 0 18px 42px rgba(13, 42, 86, 0.12);
}

.mv-card__thumb {
	display: block;
	background: #e8edf5;
	aspect-ratio: 16 / 9;
}

.mv-card__thumb img {
	width: 100%;
	height: 100%;
	object-fit: cover;
}

.mv-card__thumb-fallback {
	width: 100%;
	height: 100%;
	display: flex;
	align-items: center;
	justify-content: center;
	color: var(--mv-text-muted);
	font-size: 0.95rem;
}

.mv-card__body {
	padding: 1.25rem 1.3rem 1.4rem;
}

.mv-card__title {
	font-size: 1.26rem;
	margin: 0.8rem 0;
}

.mv-card__meta {
	display: flex;
	flex-wrap: wrap;
	gap: 0.45rem;
	color: var(--mv-text-muted);
	font-size: 0.92rem;
	margin-bottom: 0.85rem;
}

.mv-card__excerpt {
	color: #274260;
	font-size: 0.98rem;
}

.mv-card__link {
	font-weight: 700;
}

.mv-pagination {
	margin-top: 2rem;
	display: flex;
	justify-content: center;
}

.mv-pagination .nav-links {
	display: inline-flex;
	gap: 0.35rem;
	padding: 0.4rem;
	background: #fff;
	border: 1px solid var(--mv-border);
	border-radius: 999px;
}

.mv-pagination .page-numbers {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	min-width: 40px;
	height: 40px;
	padding: 0 0.75rem;
	font-weight: 700;
	border-radius: 999px;
}

.mv-pagination .current {
	background: var(--mv-primary);
	color: #fff;
}

.mv-single {
	max-width: 860px;
	margin: 0 auto;
	background: var(--mv-surface);
	border: 1px solid var(--mv-border);
	border-radius: 22px;
	padding: clamp(1.2rem, 3vw, 2.4rem);
	box-shadow: var(--mv-shadow);
}

.mv-single__meta {
	display: flex;
	flex-wrap: wrap;
	gap: 0.5rem;
	margin-bottom: 1rem;
	color: var(--mv-text-muted);
	font-size: 0.94rem;
}

.mv-single__lead {
	background: var(--mv-surface-soft);
	border-left: 4px solid var(--mv-primary);
	padding: 1rem 1rem 0.3rem;
	border-radius: 10px;
	margin: 1.3rem 0 1.5rem;
}

.mv-single__content {
	font-size: 1.05rem;
}

.mv-single__content h2,
.mv-single__content h3,
.mv-single__content h4 {
	scroll-margin-top: 120px;
}

.mv-single__content ul,
.mv-single__content ol {
	padding-left: 1.2rem;
}

.mv-tags {
	display: flex;
	flex-wrap: wrap;
	gap: 0.5rem;
	margin-top: 1.6rem;
}

/* Sources block: enhanced style and reliable priority in post content */
.mv-single .mv-sources,
.mv-single article .mv-sources,
article .mv-sources {
	position: relative;
	margin-top: 2rem;
	padding: clamp(1.1rem, 2.4vw, 1.65rem);
	background: linear-gradient(180deg, #ffffff 0%, #f8fbff 100%) !important;
	border: 1px solid #d7e4f4 !important;
	border-radius: 18px;
	box-shadow: 0 12px 30px rgba(13, 42, 86, 0.09);
}

.mv-single .mv-sources .mv-sources__title,
.mv-single article .mv-sources .mv-sources__title,
article .mv-sources .mv-sources__title {
	margin: 0 0 1rem;
	padding-bottom: 0.72rem;
	border-bottom: 1px solid #dce8f7;
	font-size: clamp(1.16rem, 2.1vw, 1.38rem);
	font-weight: 800;
	line-height: 1.35;
	letter-spacing: 0.01em;
	color: #123965 !important;
}

.mv-single .mv-sources .mv-sources__content,
.mv-single article .mv-sources .mv-sources__content,
article .mv-sources .mv-sources__content {
	color: #254567 !important;
	font-size: clamp(0.98rem, 1.2vw, 1.03rem);
	line-height: 1.82;
	overflow-wrap: anywhere;
	word-break: normal;
}

.mv-single .mv-sources .mv-sources__content p,
.mv-single article .mv-sources .mv-sources__content p,
article .mv-sources .mv-sources__content p {
	margin: 0 0 0.82rem;
}

.mv-single .mv-sources .mv-sources__content p:last-child,
.mv-single article .mv-sources .mv-sources__content p:last-child,
article .mv-sources .mv-sources__content p:last-child {
	margin-bottom: 0;
}

.mv-single .mv-sources .mv-sources__content ul,
.mv-single .mv-sources .mv-sources__content ol,
.mv-single article .mv-sources .mv-sources__content ul,
.mv-single article .mv-sources .mv-sources__content ol,
article .mv-sources .mv-sources__content ul,
article .mv-sources .mv-sources__content ol {
	margin: 0.25rem 0 0.9rem;
	padding-left: 1.25rem;
}

.mv-single .mv-sources .mv-sources__content li,
.mv-single article .mv-sources .mv-sources__content li,
article .mv-sources .mv-sources__content li {
	margin-bottom: 0.4rem;
}

.mv-single .mv-sources .mv-sources__content a,
.mv-single article .mv-sources .mv-sources__content a,
article .mv-sources .mv-sources__content a {
	color: var(--mv-primary);
	font-weight: 600;
	text-decoration: underline;
	text-decoration-thickness: 1px;
	text-underline-offset: 2px;
}

.mv-single .mv-sources .mv-sources__content a:hover,
.mv-single article .mv-sources .mv-sources__content a:hover,
article .mv-sources .mv-sources__content a:hover {
	color: #0b3f8a;
}

.mv-related {
	margin-top: 2.2rem;
}

.mv-related h2 {
	margin-bottom: 1rem;
}

.mv-related__grid {
	display: grid;
	grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
	gap: 1rem;
}

.mv-archive-header {
	margin-bottom: 1.2rem;
	background: #fff;
	border: 1px solid var(--mv-border);
	border-radius: 16px;
	padding: 1rem 1.2rem;
}

.main-footer {
	background: #102f60;
	color: #fff;
	text-align: center;
	padding: 2.6rem 0;
	margin-top: 4rem;
}

@media (max-width: 768px) {
	h1 {
		font-size: clamp(1.3rem, 6.6vw, 1.75rem);
		line-height: 1.26;
	}

	h2 {
		font-size: clamp(1.18rem, 6vw, 1.45rem);
		line-height: 1.3;
	}

	h3 {
		font-size: clamp(1.06rem, 5.4vw, 1.22rem);
		line-height: 1.35;
	}

	.main-header {
		min-height: 240px;
		background-position: center center;
	}

	.header-overlay {
		padding: 1.4rem 0 1.6rem;
	}

	.site-branding {
		padding: 0.5rem 0.75rem;
		border-radius: 10px;
		background: rgba(255, 255, 255, 0.56);
	}

	.site-branding__title {
		font-size: clamp(1.22rem, 6.1vw, 1.55rem);
		line-height: 1.2;
	}

	.site-branding__tagline {
		font-size: 0.92rem;
		line-height: 1.5;
		max-width: 48ch;
	}

	.main-content {
		padding-block: 1.25rem 2.4rem;
	}

	.container {
		padding: 0 14px;
	}

	.mv-card__body {
		padding: 1rem;
	}

	.mv-card__title {
		font-size: 1.08rem;
		line-height: 1.35;
	}

	.mv-single {
		border-radius: 14px;
		padding: 1rem 0.95rem 1.2rem;
	}

	.mv-single__content {
		font-size: 1rem;
		line-height: 1.72;
	}

	.mv-single .mv-sources,
	.mv-single article .mv-sources,
	article .mv-sources {
		margin-top: 1.45rem;
		padding: 1rem 0.95rem 1.05rem;
		border-radius: 14px;
		box-shadow: 0 10px 22px rgba(13, 42, 86, 0.08);
	}

	.mv-single .mv-sources .mv-sources__title,
	.mv-single article .mv-sources .mv-sources__title,
	article .mv-sources .mv-sources__title {
		margin-bottom: 0.78rem;
		padding-bottom: 0.55rem;
		font-size: 1.05rem;
		line-height: 1.34;
	}

	.mv-single .mv-sources .mv-sources__content,
	.mv-single article .mv-sources .mv-sources__content,
	article .mv-sources .mv-sources__content {
		font-size: 0.95rem;
		line-height: 1.72;
	}

	.mv-single .mv-sources .mv-sources__content ul,
	.mv-single .mv-sources .mv-sources__content ol,
	.mv-single article .mv-sources .mv-sources__content ul,
	.mv-single article .mv-sources .mv-sources__content ol,
	article .mv-sources .mv-sources__content ul,
	article .mv-sources .mv-sources__content ol {
		padding-left: 1.1rem;
	}

	.mv-page-title h1 {
		font-size: clamp(1.35rem, 6vw, 1.7rem);
	}

	.mv-page-title p {
		font-size: 0.97rem;
		margin-bottom: 0;
	}

	.mv-pagination .page-numbers {
		min-width: 36px;
		height: 36px;
	}
}