/* ==========================================================================
   СЕНАТ — самописный сайт. Дизайн и механики по образцу МосОблЕИРЦ.
   ========================================================================== */

:root {
	--color-primary: #1a3a6c;
	--color-accent: #f7941e;
	--bg: #ffffff;
	--bg-elevated: #f7f9fc;
	--footer-bg: #16233f;
	--footer-text: #e7ebf3;
	--text: #262b36;
	--text-muted: #667085;
	--border: #e4e8ef;
	--border-accent: #f0c48a;
	--link: var(--color-accent);
	--focus-ring: #1a3a6c;
	--card-shadow: 0 2px 10px rgba(20, 30, 60, 0.06);

	--font-body: "Segoe UI", -apple-system, BlinkMacSystemFont, "Roboto", sans-serif;
	--font-readable: "Verdana", "Tahoma", sans-serif;
	--font-size-base: 16px;
	--line-height-base: 1.6;
	--radius: 8px;
	--motion-fast: 150ms;
	--motion-base: 250ms;
}

body.theme-dark {
	--color-primary: #8fb4f0;
	--color-accent: #ffb15c;
	--bg: #0f1420;
	--bg-elevated: #171d2c;
	--footer-bg: #090c14;
	--footer-text: #e7ebf3;
	--text: #e9ecf3;
	--text-muted: #a3aac0;
	--border: #262e42;
	--border-accent: #5a4326;
	--link: #ffb15c;
	--focus-ring: #ffb15c;
	--card-shadow: 0 4px 20px rgba(0, 0, 0, 0.35);
}

body.theme-accessible {
	--color-primary: #00003d;
	--color-accent: #cc5500;
	--bg: #ffffff;
	--bg-elevated: #ffffff;
	--footer-bg: #000000;
	--footer-text: #ffffff;
	--text: #000000;
	--text-muted: #1a1a1a;
	--border: #000000;
	--border-accent: #000000;
	--link: #0000cc;
	--focus-ring: #000000;
	--font-size-base: 18px;
}

/* ---------- Динамический фон (настраивается в админке) ---------- */
/* Цвета/непрозрачность/скорость анимации задаются инлайн-стилем в
   includes/header.php (свои значения для каждой темы) — так надёжнее,
   чем полагаться на каскад CSS-переменных. */

.page-bg {
	position: fixed; inset: -10%; z-index: -1; pointer-events: none;
	background:
		radial-gradient(ellipse 640px 480px at 15% 20%, var(--bg-blob-1, #1a3a6c), transparent 62%),
		radial-gradient(ellipse 600px 520px at 85% 15%, var(--bg-blob-2, #7e57c2), transparent 60%),
		radial-gradient(ellipse 700px 560px at 50% 90%, var(--bg-blob-3, #00bfa5), transparent 62%);
	filter: blur(70px);
	animation-name: page-bg-drift;
	animation-timing-function: ease-in-out;
	animation-iteration-count: infinite;
	animation-direction: alternate;
	transition: opacity var(--motion-base) ease;
}
.page-bg--image { filter: none; }
@keyframes page-bg-drift {
	0%   { transform: translate(0%, 0%) scale(1) rotate(0deg); }
	33%  { transform: translate(-4%, 3%) scale(1.06) rotate(2deg); }
	66%  { transform: translate(3%, -3%) scale(1.04) rotate(-2deg); }
	100% { transform: translate(-3%, -3%) scale(1.08) rotate(1deg); }
}
@media (prefers-reduced-motion: reduce) {
	.page-bg { animation: none; }
}

.page-bg-video {
	position: fixed; inset: 0; z-index: -2; pointer-events: none;
	width: 100%; height: 100%; object-fit: cover;
}
.page-bg-video-overlay {
	position: fixed; inset: 0; z-index: -1; pointer-events: none;
	background: var(--bg); opacity: 0.55;
}



body.font-size-100 { --user-font-scale: 1; }
body.font-size-125 { --user-font-scale: 1.25; }
body.font-size-150 { --user-font-scale: 1.5; }
body.font-size-200 { --user-font-scale: 2; }

body.line-height-normal { --user-line-height: var(--line-height-base); }
body.line-height-large  { --user-line-height: 2; }

body.font-readable { --font-body: var(--font-readable); }

body.high-contrast {
	--text: #000000;
	--bg: #ffffff;
	--border: #000000;
	--link: #0000cc;
}

body.no-images img { display: none !important; }

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; overflow-x: clip; }

body {
	margin: 0;
	background: var(--bg);
	color: var(--text);
	font-family: var(--font-body);
	font-size: calc(var(--font-size-base) * var(--user-font-scale, 1));
	line-height: var(--user-line-height, var(--line-height-base));
	transition: background-color var(--motion-base) ease, color var(--motion-base) ease;
	overflow-x: clip;
}

img, video { max-width: 100%; height: auto; display: block; }
a { color: var(--link); text-decoration: underline; text-underline-offset: 2px; }
a:hover { text-decoration: none; }

h1, h2, h3, h4 { color: var(--color-primary); line-height: 1.25; margin: 0 0 0.6em; }
h1 { font-size: 2rem; }
h2 { font-size: 1.5rem; }
h3 { font-size: 1.2rem; }
p { margin: 0 0 1em; }

.container { max-width: 1200px; margin: 0 auto; padding: 0 20px; }
.section { padding-top: 40px; padding-bottom: 40px; }

a:focus-visible, button:focus-visible, input:focus-visible, textarea:focus-visible,
select:focus-visible, [tabindex]:focus-visible {
	outline: 3px solid var(--focus-ring);
	outline-offset: 2px;
}

.screen-reader-text {
	position: absolute !important; clip: rect(1px,1px,1px,1px);
	width: 1px; height: 1px; overflow: hidden; white-space: nowrap;
}
.skip-link {
	position: absolute; left: 8px; top: -60px;
	background: var(--color-primary); color: #fff;
	padding: 10px 16px; z-index: 10000;
	border-radius: 0 0 var(--radius) var(--radius);
	transition: top var(--motion-fast) ease;
}
.skip-link:focus { top: 0; }

/* ---------- Кнопки ---------- */

.btn {
	display: inline-flex; align-items: center; justify-content: center; gap: 8px;
	padding: 12px 22px; border-radius: 6px; font-weight: 600;
	text-decoration: none; border: 2px solid transparent; cursor: pointer;
	font-size: 1rem; min-height: 44px;
	transition: background-color var(--motion-fast) ease, transform var(--motion-fast) ease;
}
.btn:hover { transform: translateY(-1px); }
.btn-primary { background: var(--color-accent); color: #fff; }
.btn-primary:hover { background: #e07f00; }
.btn-lk {
	background: var(--color-primary); color: #fff; border-color: var(--color-primary);
}
.btn-lk:hover { background: #12294f; }
.btn-small { padding: 8px 14px; min-height: 36px; font-size: 0.9rem; }
body.theme-accessible .btn { border: 2px solid var(--text); }

/* ---------- Верхняя полоса (topbar) ---------- */

/* ---------- Шапка (один компактный ряд) ---------- */

.site-header {
	background: var(--bg); border-bottom: 1px solid var(--border);
	position: sticky; top: 0; z-index: 100;
}
.site-header__inner {
	display: flex; align-items: center;
	padding: 12px 20px; gap: 14px;
}
.site-header__logo {
	font-weight: 700; font-size: 1.2rem; color: var(--color-primary);
	text-decoration: none; margin-right: auto;
	overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
	display: flex; align-items: center;
}
.site-header__logo-img { max-height: 52px; max-width: 220px; width: auto; height: auto; display: block; }
.site-header__lk { padding: 10px 16px; font-size: 0.9rem; white-space: nowrap; }
.site-header__phones { display: flex; flex-direction: column; gap: 1px; }
.site-header__phone {
	font-weight: 600; color: var(--text); text-decoration: none;
	white-space: nowrap; font-size: 0.85rem; line-height: 1.3;
}

.nav-toggle {
	background: none; border: 1px solid var(--border); border-radius: 6px;
	cursor: pointer; padding: 10px; display: flex; flex-direction: column;
	gap: 4px; min-height: 44px; min-width: 44px; align-items: center; justify-content: center;
	flex-shrink: 0;
}
.nav-toggle span { width: 22px; height: 2px; background: var(--text); display: block; }

.theme-switcher { position: relative; flex-shrink: 0; }
.theme-switcher__toggle {
	background: var(--bg-elevated); border: 1px solid var(--border); border-radius: 6px;
	cursor: pointer; padding: 10px; color: var(--color-primary);
	min-height: 44px; min-width: 44px; display: flex; align-items: center; justify-content: center;
}
.theme-switcher__toggle:hover { background: var(--border); }

.theme-popover {
	position: absolute; top: calc(100% + 8px); right: 0;

	background: var(--bg); border: 1px solid var(--border); border-radius: 10px;
	box-shadow: 0 10px 30px rgba(0,0,0,0.18);
	padding: 16px; width: 260px; z-index: 300;
}
.theme-popover[hidden] { display: none; }
.theme-popover__label {
	font-size: 0.8rem; text-transform: uppercase; letter-spacing: 0.04em;
	color: var(--text-muted); margin: 0 0 8px;
}
.theme-popover__row { display: flex; flex-direction: column; gap: 6px; margin-bottom: 16px; }
.theme-popover__row:last-child { margin-bottom: 0; flex-direction: row; }
.theme-opt {
	background: var(--bg-elevated); border: 1px solid var(--border); border-radius: 6px;
	padding: 10px 12px; cursor: pointer; text-align: left; font-size: 0.95rem; color: var(--text);
	min-height: 40px;
}
.theme-opt:hover { border-color: var(--color-accent); }
.theme-opt.is-active { border-color: var(--color-accent); background: var(--bg); font-weight: 600; }
.theme-opt--font { flex: 1; text-align: center; }


/* ---------- Боковая выезжающая панель меню ---------- */

.side-menu-overlay {
	position: fixed; inset: 0; background: rgba(0,0,0,0.45); z-index: 490;
}
.side-menu-overlay[hidden] { display: none; }

.side-menu {
	position: fixed; top: 0; left: 0; bottom: 0; width: 320px; max-width: 85vw;
	background: var(--bg); z-index: 500; overflow-y: auto;
	box-shadow: 4px 0 24px rgba(0,0,0,0.2);
	display: flex; flex-direction: column;
}
.side-menu[hidden] { display: none; }
.side-menu__header {
	display: flex; align-items: center; justify-content: space-between;
	padding: 16px 20px; border-bottom: 1px solid var(--border);
}
.side-menu__title { font-weight: 700; font-size: 1.1rem; color: var(--color-primary); }
.side-menu__close {
	background: var(--bg-elevated); border: 1px solid var(--border); border-radius: 6px;
	font-size: 1.2rem; cursor: pointer; min-width: 40px; min-height: 40px;
}
.side-menu__list { list-style: none; margin: 0; padding: 8px 12px; flex: 1; }
.side-menu__list li { border-bottom: 1px solid var(--border); }
.side-menu__list a {
	display: block; padding: 14px 8px; text-decoration: none; color: var(--text);
	font-size: 1.05rem; font-weight: 600; border-radius: 6px;
}
.side-menu__list a:hover { color: var(--color-accent); background: var(--bg-elevated); }
.side-menu__footer { padding: 16px 20px; border-top: 1px solid var(--border); display: flex; flex-direction: column; gap: 12px; align-items: flex-start; }
.side-menu__phone a { font-size: 1.1rem; font-weight: 700; text-decoration: none; }


/* ---------- Hero (главная) ---------- */

.hero { padding: 48px 0 0; }
.hero__inner { text-align: left; }
.hero__text h1 { font-size: 2.1rem; max-width: 760px; }
.hero__accent { color: var(--color-accent); }
.hero__subtitle { font-size: 1.2rem; color: var(--text-muted); }
.hero__subtitle2 { font-size: 1.05rem; line-height: 1.6; margin: -8px 0 16px; }
.hero__subtitle2 p { margin: 0 0 0.6em; }
.hero__subtitle2--bordered {
    border: 2px solid;
    border-radius: 10px;
    padding: 14px 20px;
    background: rgba(255,255,255,0.07);
}
.hero__actions { display: flex; gap: 14px; margin: 20px 0 12px; flex-wrap: wrap; }

.hero__features {
	display: flex; flex-wrap: wrap; gap: 16px;
	padding-bottom: 40px;
	justify-content: flex-start;
}
.hero__features--center  { justify-content: center; }
.hero__features--right   { justify-content: flex-end; }
.hero__features--stretch .feature-card { flex-grow: 1; }
.feature-card {
	background: var(--bg-elevated); border: 1px solid var(--border);
	border-radius: 16px; padding: 24px 16px; text-align: center;
	text-decoration: none; display: block;
	box-shadow: var(--card-shadow);
	transition: transform var(--motion-fast) ease, border-color var(--motion-fast) ease;
	flex: 0 0 calc(20% - 13px); min-width: 140px;
}
.feature-card:hover { transform: translateY(-3px); border-color: var(--color-accent); text-decoration: none; }
.feature-card__icon { font-size: 2rem; margin-bottom: 10px; }
.feature-card__label { font-weight: 700; text-transform: uppercase; font-size: 0.85rem; color: var(--color-primary); }

.section__heading {
	display: flex; justify-content: space-between; align-items: baseline;
	margin-bottom: 24px; flex-wrap: wrap; gap: 8px;
}
.section__more { text-decoration: none; font-weight: 600; }

/* ---------- Новости ---------- */

.news-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 24px; }

/* Карусель — только на главной странице (модификатор news-grid--carousel) */
.news-grid--carousel {
	display: flex; gap: 24px; overflow-x: auto; scroll-snap-type: x mandatory;
	-webkit-overflow-scrolling: touch; padding-bottom: 4px;
	scrollbar-width: none; -ms-overflow-style: none;
}
.news-grid--carousel::-webkit-scrollbar { display: none; }
.news-grid--carousel .news-card { scroll-snap-align: start; flex: 0 0 calc((100% - 48px) / 3); }

.news-carousel__dots { display: flex; justify-content: center; gap: 8px; margin-top: 16px; }
.news-carousel__dot {
	width: 10px; height: 10px; border-radius: 50%; padding: 0; border: none;
	background: var(--border); cursor: pointer; transition: background-color var(--motion-fast) ease, transform var(--motion-fast) ease;
}
.news-carousel__dot:hover { background: var(--border-accent); }
.news-carousel__dot.is-active { background: var(--color-accent); transform: scale(1.2); }

.news-card {
	background: var(--bg-elevated); border: 1px solid var(--border);
	border-radius: var(--radius); overflow: hidden; display: flex; flex-direction: column;
	box-shadow: var(--card-shadow);
	transition: transform var(--motion-fast) ease;
}
.news-card:hover { transform: translateY(-2px); }
.news-card__thumb { display: block; aspect-ratio: 3/2; background: var(--border); overflow: hidden; }
.news-card__thumb img { width: 100%; height: 100%; object-fit: cover; }
.news-card__thumb-placeholder { display: block; width: 100%; height: 100%; }
.news-card__body { padding: 16px; display: flex; flex-direction: column; gap: 6px; flex: 1; }
.news-card__category {
	display: inline-block; align-self: flex-start;
	background: var(--color-accent); color: #fff; font-size: 0.7rem;
	text-transform: uppercase; font-weight: 700; padding: 3px 8px; border-radius: 4px;
}
.news-card__date { font-size: 0.85rem; color: var(--text-muted); }
.news-card__title { font-size: 1.05rem; margin: 0; }
.news-card__title a { text-decoration: none; color: var(--color-primary); }
.news-card__excerpt { color: var(--text-muted); font-size: 0.95rem; flex: 1; }
.news-card__more { font-weight: 600; text-decoration: none; }

.pagination { display: flex; gap: 8px; justify-content: center; margin-top: 32px; flex-wrap: wrap; }
.pagination a, .pagination span {
	display: inline-flex; align-items: center; justify-content: center;
	min-width: 40px; min-height: 40px; border: 1px solid var(--border); border-radius: 6px;
	text-decoration: none; color: var(--text);
}
.pagination .current { background: var(--color-accent); color: #fff; border-color: var(--color-accent); }

/* ---------- Фильтр-пилюли (документы/галерея) ---------- */

.filter-pills { display: flex; gap: 10px; flex-wrap: wrap; margin-bottom: 24px; }
.filter-pills a {
	padding: 8px 14px; border-radius: 999px; border: 1px solid var(--border-accent);
	text-decoration: none; color: var(--text);
}
.filter-pills a.is-active { background: var(--color-accent); color: #fff; border-color: var(--color-accent); }

/* ---------- Документы ---------- */

.doc-table-scroll { overflow-x: auto; -webkit-overflow-scrolling: touch; }
.doc-table { width: 100%; min-width: 560px; border-collapse: collapse; }
.doc-table th, .doc-table td { text-align: left; padding: 10px 12px; border-bottom: 1px solid var(--border); }
.doc-table th { color: var(--text-muted); font-weight: 600; font-size: 0.9rem; }

/* ---------- Галерея ---------- */

.gallery-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; }
.gallery-grid__cell { display: flex; flex-direction: column; gap: 6px; }
.gallery-grid__item {
	position: relative; aspect-ratio: 1/1; border: none; padding: 0;
	overflow: hidden; border-radius: var(--radius); cursor: pointer; background: var(--border);
}
.gallery-grid__item img { width: 100%; height: 100%; object-fit: cover; }
.gallery-grid__caption { font-size: 0.9rem; color: var(--text-muted); text-align: center; margin: 0; }
.gallery-grid__play {
	position: absolute; inset: 0; display: flex; align-items: center; justify-content: center;
	color: #fff; font-size: 2rem; background: rgba(0,0,0,0.35);
}
.lightbox {
	position: fixed; inset: 0; background: rgba(0,0,0,0.9);
	display: flex; flex-direction: column; align-items: center; justify-content: center;
	z-index: 1000; padding: 24px;
}
.lightbox[hidden] { display: none; }
.lightbox__content { max-width: 90vw; max-height: 80vh; }
.lightbox__content img, .lightbox__content video { max-width: 90vw; max-height: 80vh; }
.lightbox__caption { color: #fff; margin-top: 12px; text-align: center; }
.lightbox__close {
	position: absolute; top: 16px; right: 20px; background: none; border: none;
	color: #fff; font-size: 2rem; cursor: pointer; min-width: 44px; min-height: 44px;
}
.lightbox__nav {
	position: absolute; top: 50%; transform: translateY(-50%);
	background: rgba(255,255,255,0.12); border: none; color: #fff;
	font-size: 2.5rem; line-height: 1; cursor: pointer; border-radius: 50%;
	width: 56px; height: 56px; display: flex; align-items: center; justify-content: center;
}
.lightbox__nav:hover { background: rgba(255,255,255,0.25); }
.lightbox__nav--prev { left: 16px; }
.lightbox__nav--next { right: 16px; }
@media (max-width: 640px) {
	.lightbox__nav { width: 44px; height: 44px; font-size: 2rem; }
	.lightbox__nav--prev { left: 4px; }
	.lightbox__nav--next { right: 4px; }
}

/* ---------- FAQ ---------- */

.faq-item { border-bottom: 1px solid var(--border); }
.faq-item__toggle {
	width: 100%; text-align: left; background: none; border: none;
	padding: 16px 0; font-weight: 600; font-size: 1.05rem;
	color: var(--color-primary); cursor: pointer; min-height: 44px;
}
.faq-item__toggle::after { content: "+"; float: right; }
.faq-item__toggle[aria-expanded="true"]::after { content: "−"; }
.faq-item__answer { padding: 0 0 16px; }

/* ---------- Форма обратной связи (стиль "Быстрый заказ") ---------- */

.contacts-grid { display: grid; grid-template-columns: 1fr 2fr; gap: 32px; }
.contacts-info__group { margin-bottom: 20px; }
.contacts-info__line { display: flex; align-items: baseline; gap: 8px; flex-wrap: wrap; margin: 0 0 8px; }
.contacts-info__label { color: var(--text-muted); font-size: 0.9rem; }
.contacts-info__heading { font-size: 1.1rem; margin: 0 0 8px; }
.contacts-info__hours { margin: 0; line-height: 1.6; }

.quick-form__row { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.quick-form__field { margin-bottom: 16px; }
.quick-form label { display: block; font-weight: 600; margin-bottom: 6px; }
.quick-form input[type="text"], .quick-form input[type="email"], .quick-form input[type="tel"],
.quick-form textarea {
	width: 100%; padding: 10px 12px; border: 1px solid var(--border); border-radius: 6px;
	background: var(--bg); color: var(--text); font-size: 1rem; font-family: inherit; min-height: 44px;
}
.quick-form textarea { min-height: 120px; }
.quick-form__consent {
	display: flex; align-items: flex-start; gap: 10px; font-weight: 400;
	margin: 16px 0; font-size: 0.95rem;
}
.hp-field { position: absolute !important; left: -9999px !important; }
.form-notice { padding: 14px 16px; border-radius: 6px; margin-bottom: 16px; }
.form-notice--success { background: #e6f7ec; color: #1a6b3a; border: 1px solid #b6e3c6; }
.form-notice--error { background: #fdecec; color: #9c1c1c; border: 1px solid #f3bcbc; }

/* ---------- Cookie-баннер ---------- */

.cookie-banner {
	position: fixed; left: 0; right: 0; bottom: 0;
	background: var(--footer-bg); color: var(--footer-text);
	padding: 16px 20px; z-index: 2000;
	box-shadow: 0 -4px 16px rgba(0,0,0,0.2);
}
.cookie-banner__inner { display: flex; align-items: center; justify-content: space-between; gap: 20px; flex-wrap: wrap; }
.cookie-banner__inner p { margin: 0; flex: 1 1 480px; }
.cookie-banner__inner a { color: inherit; }

/* ---------- Подвал ---------- */

.site-footer { background: var(--footer-bg); color: var(--footer-text); margin-top: 48px; }
.site-footer a { color: var(--footer-text); text-decoration: none; }
.site-footer a:hover { text-decoration: underline; }
.site-footer h3 { color: var(--footer-text); font-size: 1rem; margin-bottom: 12px; }
.site-footer__inner { display: grid; grid-template-columns: repeat(3, 1fr); gap: 32px; padding: 48px 20px; }
.site-footer ul { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.site-footer__bottom {
	border-top: 1px solid rgba(255,255,255,0.15); padding: 16px 20px;
	font-size: 0.85rem; color: rgba(255,255,255,0.7);
}

/* ---------- Прочее / доступность ---------- */

body.theme-accessible input, body.theme-accessible select, body.theme-accessible textarea,
body.theme-accessible .btn, body.theme-accessible button {
	min-height: 48px; font-size: calc(1rem * var(--user-font-scale, 1));
}
body.theme-accessible a { text-decoration: underline; }

/* ---------- Адаптивность ---------- */

@media (max-width: 1199px) {
	.news-grid--carousel .news-card { flex-basis: calc((100% - 24px) / 2); }
	.news-grid:not(.news-grid--carousel) { grid-template-columns: repeat(2, 1fr); }
	.gallery-grid { grid-template-columns: repeat(3, 1fr); }
	.hero__features .feature-card { flex-basis: calc(33.333% - 11px); }
	.contacts-grid { grid-template-columns: 1fr; }
	.site-footer__inner { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 767px) {
	.news-grid--carousel .news-card { flex-basis: 82%; }
	.news-grid:not(.news-grid--carousel) { grid-template-columns: 1fr; }
	.gallery-grid { grid-template-columns: repeat(2, 1fr); }
	.hero__features .feature-card { flex-basis: calc(50% - 8px); }
	.quick-form__row { grid-template-columns: 1fr; }
	.site-footer__inner { grid-template-columns: 1fr; }
	.theme-popover { width: calc(100vw - 40px); right: -10px; }
	.site-header__phones { display: none; }
	.site-header__logo { font-size: 1.05rem; }
	.site-header__lk { padding: 8px 12px; font-size: 0.85rem; }
	.hero__text h1 { font-size: 1.5rem; }
}

/* ---------- Блоки контента (текст/фото/видео на любой странице) ---------- */

.content-block { padding-top: 32px; padding-bottom: 32px; }
.content-block__text { line-height: 1.7; }

/* Подложка на всю ширину экрана позади центрированного фото (высота = высоте фото) */
.content-block__media-wrap {
	position: relative; display: flex; justify-content: center;
}
.content-block__media-wrap::before {
	content: ""; position: absolute; top: 0; bottom: 0;
	left: 50%; right: 50%; margin-left: -50vw; margin-right: -50vw; width: 100vw;
	background: rgba(0, 0, 0, 0.05); z-index: 0;
}
body.theme-dark .content-block__media-wrap::before { background: rgba(255, 255, 255, 0.06); }
.content-block__image-btn {
	position: relative; z-index: 1;
	display: block; border: none; padding: 0; background: none; cursor: pointer;
	width: 100%; max-width: 900px; border-radius: var(--radius); overflow: hidden;
}
.content-block__image-btn img { width: 100%; height: auto; display: block; transition: transform var(--motion-fast) ease; }
.content-block__image-btn:hover img { transform: scale(1.01); }
.content-block__video { width: 100%; max-width: 900px; margin: 0 auto; display: block; border-radius: var(--radius); background: #000; }
.content-block__caption { color: var(--text-muted); font-size: 0.9rem; margin-top: 8px; text-align: center; }

/* ---------- Модалка новости ---------- */

.news-modal { position: fixed; inset: 0; z-index: 900; display: flex; align-items: center; justify-content: center; padding: 20px; }
.news-modal[hidden] { display: none; }
.news-modal__backdrop { position: absolute; inset: 0; background: rgba(0,0,0,0.6); }
.news-modal__box {
	position: relative; background: var(--bg); border-radius: var(--radius);
	max-width: 720px; width: 100%; max-height: 85vh; overflow-y: auto;
	padding: 32px; box-shadow: 0 20px 60px rgba(0,0,0,0.3);
}
.news-modal__close {
	position: absolute; top: 12px; right: 12px; background: var(--bg-elevated); border: 1px solid var(--border);
	border-radius: 50%; width: 40px; height: 40px; font-size: 1.4rem; cursor: pointer;
}
.news-modal__header h2 { margin-bottom: 6px; }
.news-modal__image-btn {
	display: block; border: none; padding: 0; background: none; cursor: pointer;
	width: 100%; margin: 16px 0; border-radius: var(--radius); overflow: hidden;
}
.news-modal__image-btn img { width: 100%; height: auto; display: block; }

/* ---------- Документы: две кнопки в ряд ---------- */
.doc-table td:last-child { display: flex; gap: 8px; flex-wrap: wrap; }

/* ---------- Режим работы в подвале ---------- */
.site-footer__hours { color: rgba(255,255,255,0.7); font-size: 0.9rem; margin-top: 8px; }

/* ---------- Модалка «Оставить заявку» (тот же паттерн, что news-modal) ---------- */
.cta-modal { position: fixed; inset: 0; z-index: 900; display: flex; align-items: center; justify-content: center; padding: 20px; }
.cta-modal[hidden] { display: none; }
.cta-modal__backdrop { position: absolute; inset: 0; background: rgba(0,0,0,0.6); }
.cta-modal__box {
	position: relative; background: var(--bg); border-radius: var(--radius);
	max-width: 560px; width: 100%; max-height: 90vh; overflow-y: auto;
	padding: 32px; box-shadow: 0 20px 60px rgba(0,0,0,0.3);
}
.cta-modal__close {
	position: absolute; top: 12px; right: 12px; background: var(--bg-elevated); border: 1px solid var(--border);
	border-radius: 50%; width: 40px; height: 40px; font-size: 1.4rem; cursor: pointer;
}
.cta-modal__content h2 { margin-top: 0; }

/* ---------- Простая капча (X + Y = ?) ---------- */
.captcha-field { display: flex; align-items: center; gap: 10px; }
.captcha-field input[type="number"] { max-width: 100px; }

/* ---------- Модалка просмотра документа (PDF и т.п. в iframe) ---------- */
.doc-modal { position: fixed; inset: 0; z-index: 900; display: flex; align-items: center; justify-content: center; padding: 20px; }
.doc-modal[hidden] { display: none; }
.doc-modal__backdrop { position: absolute; inset: 0; background: rgba(0,0,0,0.6); }
.doc-modal__box {
	position: relative; background: var(--bg); border-radius: var(--radius);
	width: 100%; max-width: 900px; height: 85vh;
	display: flex; flex-direction: column;
	box-shadow: 0 20px 60px rgba(0,0,0,0.3); overflow: hidden;
}
.doc-modal__header {
	display: flex; align-items: center; gap: 12px; padding: 12px 16px;
	border-bottom: 1px solid var(--border); flex-shrink: 0;
}
.doc-modal__title { font-weight: 600; flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.doc-modal__close {
	background: var(--bg-elevated); border: 1px solid var(--border);
	border-radius: 50%; width: 36px; height: 36px; font-size: 1.3rem; cursor: pointer; flex-shrink: 0;
}
.doc-modal__body { flex: 1; min-height: 0; }
.doc-modal__body iframe { width: 100%; height: 100%; border: none; }
@media (max-width: 640px) {
	.doc-modal { padding: 0; }
	.doc-modal__box { max-width: 100%; height: 100%; border-radius: 0; }
	.doc-modal__title { font-size: 0.9rem; }
}

/* ---------- Баннер объявления (закрываемый, вверху сайта) ---------- */
.site-banner { background: #fff4e0; border-bottom: 1px solid #f0c48a; }
.site-banner__inner {
	display: flex; align-items: center; gap: 12px;
	padding: 12px 20px; flex-wrap: wrap;
}
.site-banner__icon { font-size: 1.3rem; flex-shrink: 0; }
.site-banner__text { flex: 1; margin: 0; color: #5c3d00; font-weight: 500; min-width: 200px; }
.site-banner__close {
	background: none; border: none; font-size: 1.5rem; line-height: 1; cursor: pointer;
	color: #5c3d00; min-width: 36px; min-height: 36px; flex-shrink: 0;
}
body.theme-dark .site-banner { background: #3a2c0f; border-bottom-color: #5a4326; }
body.theme-dark .site-banner__text, body.theme-dark .site-banner__close { color: #ffd89b; }

/* ---------- Посты галереи (несколько фото под одной подписью) ---------- */
.gallery-posts { display: grid; grid-template-columns: repeat(3, 1fr); gap: 24px; }
.gallery-post { display: flex; flex-direction: column; gap: 8px; }
.gallery-post__grid {
	display: grid; gap: 4px; aspect-ratio: 1/1; border-radius: var(--radius); overflow: hidden;
	background: var(--border);
}
.gallery-post__grid--1 { grid-template-columns: 1fr; }
.gallery-post__grid--2 { grid-template-columns: 1fr 1fr; }
.gallery-post__grid--3 { grid-template-columns: 1fr 1fr; grid-template-rows: 1fr 1fr; }
.gallery-post__grid--3 .gallery-post__item:first-child { grid-row: 1 / 3; }
.gallery-post__grid--4 { grid-template-columns: 1fr 1fr; grid-template-rows: 1fr 1fr; }
.gallery-post__item { position: relative; border: none; padding: 0; cursor: pointer; background: var(--border); overflow: hidden; }
.gallery-post__item img { width: 100%; height: 100%; object-fit: cover; display: block; }
.gallery-post__more {
	position: absolute; inset: 0; background: rgba(0,0,0,0.5); color: #fff;
	display: flex; align-items: center; justify-content: center; font-size: 1.4rem; font-weight: 700;
}
.gallery-post__play {
	position: absolute; inset: 0; display: flex; align-items: center; justify-content: center;
	color: #fff; font-size: 1.6rem; background: rgba(0,0,0,0.25); pointer-events: none;
}
.gallery-post__caption { font-size: 0.95rem; color: var(--text-muted); text-align: center; margin: 0; }
@media (max-width: 1199px) {
	.gallery-posts { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 640px) {
	.gallery-posts { grid-template-columns: 1fr 1fr; gap: 16px; }
}

/* ---------- Виджет "Госуслуги — Решаем вместе" ---------- */
/* Сам виджет не трогаем (это запрещено инструкцией по размещению) — просто
   даём ему более узкий контейнер. Его собственный JS измеряет ширину
   обёртки и сам подбирает подходящий (более компактный) вариант вёрстки —
   это штатное адаптивное поведение виджета, а не переопределение его CSS. */
.gosuslugi-widget-wrap { margin-top: 20px; margin-bottom: 32px; }

/* ---------- Выравнивание hero-блока (задаётся в админке) ---------- */
.hero__text--center { text-align: center; }
.hero__text--center h1 { margin-left: auto; margin-right: auto; }
.hero__text--center .hero__actions { justify-content: center; }
.hero__text--center .gosuslugi-widget-wrap { margin-left: auto; margin-right: auto; }

.hero__text--right { text-align: right; }
.hero__text--right h1 { margin-left: auto; margin-right: 0; }
.hero__text--right .hero__actions { justify-content: flex-end; }
.hero__text--right .gosuslugi-widget-wrap { margin-left: auto; margin-right: 0; }

.hero__or { text-align: center; font-size: 0.8rem; color: var(--text-muted); margin: 0 0 16px; }

/* ---------- Всплывающий баннер-информер (модальное окно по центру экрана) ---------- */
.site-popup {
	position: fixed; inset: 0; z-index: 1200;
	display: flex; align-items: center; justify-content: center; padding: 20px;
	animation: site-popup-fade var(--motion-base) ease;
}
@keyframes site-popup-fade { from { opacity: 0; } to { opacity: 1; } }
.site-popup__backdrop { position: absolute; inset: 0; background: rgba(0,0,0,0.55); }
.site-popup__box {
	position: relative; max-width: 440px; width: 100%; max-height: 85vh; overflow-y: auto;
	background: #fff; border: 3px solid var(--color-accent); border-radius: 12px;
	padding: 32px 28px; text-align: center; box-shadow: 0 20px 60px rgba(0,0,0,0.35);
}
.site-popup__close {
	position: absolute; top: 10px; right: 10px; background: rgba(0,0,0,0.06); border: none;
	border-radius: 50%; width: 36px; height: 36px; font-size: 1.3rem; cursor: pointer; line-height: 1;
}
.site-popup__image { width: 100%; max-height: 220px; object-fit: contain; margin-bottom: 16px; border-radius: 8px; }
.site-popup__text { font-size: 1.05rem; line-height: 1.5; color: var(--text); }
@media (max-width: 480px) {
	.site-popup__box { padding: 24px 18px; }
}

/* === Documents table: zebra striping + mobile compact === */
.doc-table tbody tr:nth-child(even) { background: rgba(0,0,0,0.035); }
@media (max-width: 700px) {
  .doc-table th, .doc-table td { padding: 6px 8px; font-size: 0.83rem; }
}

