/*
Theme Name: TovMeod Clean
Description: Clean responsive rebuild for tovmeod.ru
Version: 1.0.0
Requires at least: 7.1
Requires PHP: 8.3
Text Domain: tovmeod-clean
*/

:root {
	--tm-accent: #c52f2b;
	--tm-accent-hover: #9f211e;
	--tm-text: #2f3337;
	--tm-muted: #667078;
	--tm-background: #f3f4f5;
	--tm-surface: #fff;
	--tm-border: #d9dde1;
	--tm-radius: 2px;
	--tm-shell: 1040px;
}

* { box-sizing: border-box; }

html { overflow-wrap: break-word; }

body {
	margin: 0;
	background: var(--tm-background);
	color: var(--tm-text);
	font-family: system-ui, -apple-system, "Segoe UI", Arial, sans-serif;
	font-size: 17px;
	line-height: 1.65;
}

a { color: var(--tm-accent); }
a:hover { color: var(--tm-accent-hover); }
a:focus-visible,
button:focus-visible,
input:focus-visible,
summary:focus-visible {
	outline: 3px solid var(--tm-accent);
	outline-offset: 3px;
}

img, video, iframe { max-width: 100%; height: auto; }
figure { max-width: 100%; margin: 1.5rem 0; }
table { display: block; max-width: 100%; overflow-x: auto; border-collapse: collapse; }

.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;
}
.screen-reader-text:focus {
	position: fixed;
	top: 8px;
	left: 8px;
	z-index: 100000;
	width: auto;
	height: auto;
	padding: .75rem 1rem;
	clip: auto;
	background: var(--tm-surface);
	color: var(--tm-text);
}

.site-shell { width: min(calc(100% - 48px), var(--tm-shell)); margin-inline: auto; }
.site-header { background: var(--tm-surface); border-bottom: 3px solid var(--tm-accent); }
.header-inner { min-height: 96px; display: flex; align-items: center; justify-content: space-between; gap: 2rem; padding-block: 20px; }
.site-logo { display: block; width: 278px; max-width: 100%; height: auto; }
.site-branding { line-height: 1; }

.desktop-nav ul,
.mobile-nav ul { display: flex; flex-wrap: wrap; gap: .4rem 1.25rem; margin: 0; padding: 0; list-style: none; }
.desktop-nav a,
.mobile-nav a { color: var(--tm-text); font-size: .88rem; font-weight: 700; text-decoration: none; text-transform: uppercase; }
.desktop-nav a:hover,
.mobile-nav a:hover { color: var(--tm-accent); }
.mobile-nav { display: none; }
.mobile-nav summary { cursor: pointer; color: var(--tm-text); font-weight: 700; }
.mobile-nav[open] ul { margin-top: 1rem; }

.site-main { padding-block: 32px 48px; }
.content-grid { display: grid; grid-template-columns: minmax(0, 1fr) 320px; gap: 32px; align-items: start; }
.content-area,
.sidebar,
.site-footer { min-width: 0; }
.content-area,
.sidebar { background: var(--tm-surface); border: 1px solid var(--tm-border); border-radius: var(--tm-radius); }
.content-area { padding: clamp(20px, 4vw, 36px); }
.sidebar { padding: 24px; }

.page-header { margin-bottom: 28px; padding-bottom: 14px; border-bottom: 2px solid var(--tm-text); }
.page-title { margin: 0; font-size: clamp(1.75rem, 4vw, 2.25rem); line-height: 1.2; }
.archive-description { color: var(--tm-muted); }
.archive-description > :last-child { margin-bottom: 0; }

.post-card { display: grid; grid-template-columns: minmax(180px, 320px) minmax(0, 1fr); gap: 24px; padding-bottom: 28px; margin-bottom: 28px; border-bottom: 1px solid var(--tm-border); }
.post-card:last-of-type { margin-bottom: 0; }
.card-thumbnail img { display: block; width: 100%; aspect-ratio: 4 / 3; object-fit: cover; border: 1px solid var(--tm-border); }
.card-title { margin: 0 0 .45rem; font-size: 24px; line-height: 1.25; }
.card-title a { color: var(--tm-text); text-decoration: none; }
.card-title a:hover { color: var(--tm-accent); }
.entry-meta { margin: 0 0 .8rem; color: var(--tm-muted); font-size: .84rem; }
.entry-meta a { color: inherit; }
.card-excerpt > :last-child { margin-bottom: 0; }

.entry-title { margin: 0 0 .7rem; font-size: clamp(30px, 4vw, 42px); line-height: 1.15; }
.featured-image { margin: 1.5rem 0; }
.featured-image img { display: block; width: auto; max-width: 100%; border: 1px solid var(--tm-border); }
.entry-content { min-width: 0; }
.entry-content h2 { font-size: clamp(1.5rem, 3vw, 2rem); line-height: 1.25; }
.entry-content h3 { font-size: 1.35rem; line-height: 1.3; }
.entry-content blockquote { margin-inline: 0; padding-left: 1.25rem; border-left: 4px solid var(--tm-accent); color: var(--tm-muted); }
.entry-tags { margin-top: 2rem; padding-top: 1rem; border-top: 1px solid var(--tm-border); }
.wp-caption { max-width: 100%; color: var(--tm-muted); font-size: .88rem; }
.wp-caption-text { margin-top: .35rem; }
.gallery { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: 12px; }
.gallery-item { margin: 0; }

.widget + .widget { margin-top: 28px; }
.widget-title { margin: 0 0 .8rem; font-size: 18px; line-height: 1.3; }
.widget ul { margin: 0; padding-left: 1.2rem; }
.widget li + li { margin-top: .45rem; }

.search-form { display: flex; gap: 8px; }
.search-field { min-width: 0; width: 100%; padding: .65rem .75rem; border: 1px solid var(--tm-border); border-radius: var(--tm-radius); font: inherit; }
.search-submit {
	padding: .65rem 1rem;
	border: 1px solid var(--tm-accent);
	border-radius: var(--tm-radius);
	background: var(--tm-accent);
	color: #fff;
	font: inherit;
	font-weight: 700;
	cursor: pointer;
}
.search-submit:hover { background: var(--tm-accent-hover); }

.navigation.pagination { margin-top: 32px; }
.nav-links { display: flex; flex-wrap: wrap; gap: 8px; }
.page-numbers { padding: .4rem .7rem; border: 1px solid var(--tm-border); text-decoration: none; }
.page-numbers.current { background: var(--tm-accent); border-color: var(--tm-accent); color: #fff; }

.comments-area { margin-top: 40px; padding-top: 28px; border-top: 1px solid var(--tm-border); }
.comments-title { font-size: 1.5rem; }
.comment-list { padding-left: 1.5rem; }
.comment-list .children { padding-left: 1.5rem; }
.comment-body { margin-bottom: 1.5rem; padding: 1rem; background: var(--tm-background); border: 1px solid var(--tm-border); }
.comment-meta { color: var(--tm-muted); font-size: .84rem; }
.comment-content > :last-child { margin-bottom: 0; }

.site-footer { border-top: 3px solid var(--tm-accent); background: var(--tm-surface); }
.footer-inner { padding-block: 24px; text-align: center; color: var(--tm-muted); }
.footer-inner p { margin: 0; }

@media (max-width: 768px) {
	.site-shell { width: min(calc(100% - 32px), var(--tm-shell)); }
	.header-inner { min-height: 0; align-items: flex-start; flex-direction: column; gap: 14px; }
	.desktop-nav { display: none; }
	.mobile-nav { display: block; width: 100%; }
	.mobile-nav ul { flex-direction: column; gap: .7rem; }
	.content-grid { grid-template-columns: 1fr; gap: 24px; }
	.post-card { grid-template-columns: 1fr; gap: 16px; }
	.card-thumbnail img { max-width: 320px; }
	.sidebar { grid-row: 2; }
}

@media (max-width: 420px) {
	.site-shell { width: min(calc(100% - 24px), var(--tm-shell)); }
	.content-area, .sidebar { padding: 18px; }
	.search-form { align-items: stretch; flex-direction: column; }
}

