/* ros-ritual.ru — the legacy look (slate bands, grey header gradient, left menu,
   right news column), mobile-first. Legacy hover colours (#00A5D9, #0099CC) are
   darkened to meet WCAG AA; everything else keeps the original palette. */

:root {
	--text: #000;
	--heading: #333;
	--link: #333;
	--link-hover: #00739e;
	--menu-link: #2f4f4f;
	--menu-title: #32405f;
	--band: #6d7687;
	--title-band: #d9dddf;
	--border: #cbd1e0;
	--soft: #f7f7f6;
	--softer: #fafafa;
	--line: #ededed;
	--muted: #555;
	--table-head: #6f8dab;
	--table-mark: #acc3db;
	--table-even: #f2f2f2;
}

*, *::before, *::after { box-sizing: border-box; }

html { font-size: 100%; -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }

/* Wider screens get the 1440 px layout, centred: beyond that, lines of text grow
   unreadably long. */
body {
	max-width: 1440px;
	margin: 0 auto;
	padding: 8px;
	background: #fff;
	color: var(--text);
	font: 1rem/1.5 Arial, Tahoma, Verdana, Helvetica, sans-serif;
	overflow-wrap: break-word;
}

img { max-width: 100%; height: auto; border: 0; }

a:link, a:visited { color: var(--link); text-decoration: underline; }
a:hover, a:focus-visible { color: var(--link-hover); }
:focus-visible { outline: 2px solid var(--link-hover); outline-offset: 2px; }

h1, h2, h3, h4, h5, h6 { color: var(--heading); font-family: Helvetica, Arial, Verdana, sans-serif; line-height: 1.25; }

.nowrap { white-space: nowrap; }
.muted, .count { color: var(--muted); }
.count { font-size: .875em; }

.skip-link { position: absolute; left: -10000px; top: 0; }
.skip-link:focus { left: 8px; z-index: 10; padding: 4px 8px; background: #fff; }

button, input, select { font: inherit; }
button {
	min-height: 32px;
	padding: 2px 12px;
	border: 1px solid #8a93a6;
	border-radius: 3px;
	background: var(--soft);
	color: #222;
	cursor: pointer;
}
button:hover { background: #eceef3; }
input[type="search"], select {
	min-height: 32px;
	max-width: 100%;
	padding: 2px 6px;
	border: 1px solid #8a93a6;
	border-radius: 3px;
	background: #fff;
}

/* --- Header: logo on the grey gradient, city and hotline on the right --- */

.site-header {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	justify-content: space-between;
	gap: 8px 16px;
	/* Equal padding above and below centres the site name, as on the legacy band. */
	padding: 8px 10px 8px 0;
	border: 1px solid var(--border);
	background: #fff url(/img/topbg.gif) left top repeat-y;
}
.site-header__logo { display: block; line-height: 0; }
.site-header__logo img { width: 400px; }
.site-header__side { display: flex; flex-direction: column; align-items: flex-end; gap: 6px; padding-left: 10px; margin-left: auto; text-align: right; }
.city-switch { display: flex; align-items: center; gap: 6px; }
.city-switch label { font-size: .875em; }
.hotline { margin: 0; font-weight: bold; color: #333; font-size: .875rem; line-height: 1.4; }
.hotline a { display: inline-block; }
.menu-link { display: inline-block; padding: 4px 0; font-size: .875em; }

/* --- Page: main content first in the source; menu and news follow --- */

.page { display: grid; gap: 10px; margin-top: 10px; }

.content, .site-nav, .site-aside {
	min-width: 0;
	border: 1px solid var(--border);
	padding: 8px 10px 12px;
}

@media (min-width: 960px) {
	body { font-size: .9375rem; }
	.page { grid-template-columns: 180px minmax(0, 1fr) 190px; align-items: start; }
	.site-nav { grid-column: 1; grid-row: 1; }
	.content { grid-column: 2; grid-row: 1; }
	.site-aside { grid-column: 3; grid-row: 1; }
	.page--plain { grid-template-columns: minmax(0, 1fr); }
	.page--plain .content { grid-column: 1; }
	.menu-link { display: none; }
}

@media (max-width: 560px) {
	.site-header__logo img { width: 300px; }
	.site-header__side { align-items: flex-start; margin-left: 0; padding-left: 10px; text-align: left; }
}

/* --- Left menu --- */

.site-nav { font-size: .9375rem; }
.site-nav__title { margin: 14px 0 4px; color: var(--menu-title); font-size: 1em; font-weight: bold; }
.menu { margin: 0; padding: 0; list-style: none; }
.menu li { margin: 0; }
.menu a { display: block; padding: 3px 0; line-height: 1.3; }
.menu a:link, .menu a:visited { color: var(--menu-link); }
.menu a:hover { color: var(--link-hover); }
.menu a[aria-current="page"] { font-weight: bold; text-decoration: none; }
.site-search { margin-top: 18px; }
.site-search label { display: block; margin-bottom: 4px; color: var(--menu-title); font-weight: bold; }
.site-search input { width: 100%; margin-bottom: 6px; }

/* --- Bands and headings --- */

.band {
	margin: 0 0 8px;
	padding: 3px 6px;
	background: var(--band);
	color: #fff;
	font: bold .875rem/1.4 Arial, Tahoma, Verdana, sans-serif;
	text-align: center;
}

.content h1 {
	margin: 0 0 12px;
	padding: 4px 6px;
	background: var(--title-band);
	font-size: 1.25rem;
	font-weight: normal;
}
.content h2 { font-size: 1.125rem; }

.breadcrumbs { margin: 0 0 8px; font-size: .875em; color: var(--muted); }
/* Tap targets of at least 24 px outside running text (WCAG 2.5.8). */
.breadcrumbs a, .teaser h2 a, .teaser h3 a, .org__title a, .news-teaser h3 a { display: inline-block; padding: 3px 0; }

.lead { margin-top: 0; }
.note { padding: 6px 10px; background: var(--softer); border-left: 4px solid var(--line); color: #333; font-size: .875em; }
.more { margin: 14px 0 0; text-align: center; font-weight: bold; }
.date { margin: 0 0 6px; color: var(--muted); font-size: .875em; }

/* --- Home page --- */

.sections { display: grid; gap: 14px 24px; margin: 18px 0; padding: 0; list-style: none; }
@media (min-width: 640px) { .sections { grid-template-columns: 1fr 1fr; } }
.sections__item { display: flex; flex-direction: column; }
.sections__title { font-size: 1.0625rem; font-weight: bold; }
.sections__count { color: var(--muted); font-size: .875em; }
.banner { margin: 18px 0; text-align: center; }
.digest { margin-top: 18px; }

/* --- Lists of articles, news, organisations --- */

.teaser { margin: 0 0 14px; }
.teaser h2, .teaser h3 { margin: 0 0 4px; padding: 3px 6px; background: var(--title-band); font-size: 1.0625rem; font-weight: normal; }
.teaser p { margin: 0; }

.org { margin: 0 0 18px; padding-bottom: 12px; border-bottom: 1px dotted #ccc; }
.org__title { margin: 0 0 6px; padding: 3px 6px; background: var(--title-band); font-size: 1.0625rem; font-weight: normal; }
.org__text p:first-child { margin-top: 0; }

.facts { margin: 8px 0; }
.facts div { margin: 2px 0; }
.facts dt { display: inline; font-weight: bold; }
.facts dd { display: inline; margin: 0; }

table.laws { width: 100%; border-collapse: collapse; }
table.laws td { padding: 6px; border-bottom: 1px solid var(--line); vertical-align: top; }
@media (max-width: 640px) {
	table.laws, table.laws tbody, table.laws tr, table.laws td { display: block; }
	table.laws td { border: 0; padding: 0 0 4px; }
	table.laws tr { padding: 6px 0; border-bottom: 1px solid var(--line); }
}

.columns { columns: 16em; column-gap: 24px; margin: 0; padding: 0; list-style: none; }
.columns li { margin: 0 0 4px; break-inside: avoid; }

.pagination { display: flex; flex-wrap: wrap; justify-content: center; gap: 4px 10px; margin: 20px 0; }
.pagination a, .pagination span { display: inline-block; min-width: 28px; min-height: 28px; padding: 2px 4px; text-align: center; }
.pagination__current { font-weight: bold; }
.pagination__off, .pagination__gap { color: #999; }

/* --- Questions and reviews (the legacy guestbook boxes) --- */

.entry { margin: 0 0 16px; border: 1px solid var(--line); }
.entry__meta { margin: 0; padding: 6px 10px; background: var(--soft); }
.entry__meta strong { margin-right: 10px; font-size: 1.0625rem; }
.entry__meta time { color: var(--muted); font-size: .875em; }
.entry__text, .entry__answer { margin: 8px 10px; padding: 8px 12px; background: var(--softer); border-left: 5px solid var(--line); border-right: 5px solid var(--line); }
.entry__answer { color: #444; }
.entry__label { margin: 0 0 4px; font-weight: bold; }
.entry__text p:first-child, .entry__answer .prose > :first-child { margin-top: 0; }
.entry__text p:last-child, .entry__answer .prose > :last-child { margin-bottom: 0; }

/* --- Stored articles, laws and news --- */

.prose { line-height: 1.55; }
.prose h2 { margin: 1.4em 0 .6em; text-align: center; }
.prose h3, .prose h4, .prose h5, .prose h6 { margin: 1.2em 0 .5em; font-size: 1.0625rem; }
.prose table { display: block; max-width: 100%; overflow-x: auto; border-collapse: collapse; margin: 10px 0; }
.prose td, .prose th { padding: 3px 6px; border: 1px solid #ccc; vertical-align: top; text-align: left; }
.prose table.content { display: table; width: 100%; }
@media (max-width: 640px) { .prose table.content { display: block; } }
.prose table.content td, .prose table.content th { border: 0; }
.prose table.content tr:nth-child(even) { background: var(--table-even); }
.prose table.content tr.head, .prose table.content th { background: var(--table-head); color: #fff; }
.prose table.content tr.head td { padding: 3px 6px; font-weight: bold; text-align: center; }
.prose table.content tr.mark { background: var(--table-mark); }
.prose table.default td:nth-child(3), .prose table.morgues td:nth-child(3) { text-align: right; }
.prose code, .prose pre { font-family: "Courier New", Courier, monospace; font-size: .875em; }
.prose pre { overflow-x: auto; white-space: pre; }
.prose hr { height: 1px; border: 0; background: #ccc; }
.prose img { vertical-align: middle; }
.prose blockquote { margin: 10px 0; padding: 4px 12px; border-left: 4px solid var(--line); }

/* Galleries: preview images linking to the full photo, as on the legacy pages. */
.prose .photopreview, .gallery .photopreview {
	display: inline-block;
	width: 180px;
	margin: 8px;
	vertical-align: top;
	text-align: center;
	font-size: .75rem;
	line-height: 1.3;
}
/* An image link's box wraps its image, so its focus ring and tap area are the image's. */
.prose a:has(> img:only-child), .gallery .photopreview > a { display: inline-block; }
.gallery { margin: 0 0 12px; }
.gallery figure { margin: 8px; }
.gallery figcaption { margin-top: 2px; }
.prose .clear { clear: both; }

/* Legal texts exported from ConsultantPlus (classes kept by inc/html.php). */
.prose--law { font-size: .9375em; }
.prose .aC { text-align: center; }
.prose .aR { text-align: right; }
.prose .aJ { text-align: justify; }
/* The documents' tables of contents are one link per paragraph: a little air keeps the
   links 24 px apart, as WCAG 2.5.8 asks of targets that are not in a sentence. */
.prose .aJ + .aJ { margin-top: 3px; }
.prose .bB, .prose .bH { padding: .4em 0; }
.prose .tTB { font-weight: bold; font-size: .875em; }
.prose .iF { text-indent: 3em; }
.prose .tM, .prose .tMC { max-width: 100%; overflow-x: auto; font-family: "Courier New", Courier, monospace; }
.prose .tMC { font-style: italic; }
.prose .tM code, .prose .tMC code { white-space: pre; }

/* --- Search --- */

.search-form { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 8px; margin: 0 0 16px; }
.search-form label { flex-basis: 100%; }
.search-form input { flex: 1 1 14em; }
.results h2 { margin: 18px 0 6px; font-size: 1.0625rem; }
.results ul { margin: 0; padding-left: 1.2em; }
/* Results are bare links one per line: spaced for fingers (WCAG 2.5.8). */
.results li { margin: 8px 0; }

/* --- News column --- */

.site-aside { font-size: .9375rem; }
.news-teaser { padding-bottom: 8px; margin-bottom: 8px; border-bottom: 1px dotted #ccc; }
.news-teaser h3 { margin: 0 0 4px; font-size: 1em; }
.news-teaser p { margin: 0; }

/* --- Footer and cookie notice --- */

.site-footer { margin-top: 12px; padding: 8px; text-align: center; font-size: .875em; color: #333; }
.site-footer p { margin: 4px 0; }
.site-footer__links { display: flex; flex-wrap: wrap; justify-content: center; gap: 4px 16px; }
.link-button { min-height: 0; padding: 0; border: 0; background: none; color: var(--link); font: inherit; text-decoration: underline; cursor: pointer; }
.link-button:hover { background: none; color: var(--link-hover); }

.cookie-notice {
	position: fixed;
	right: 8px;
	bottom: 8px;
	left: 8px;
	z-index: 20;
	padding: 10px 14px;
	border: 1px solid var(--border);
	background: var(--soft);
	box-shadow: 0 2px 10px rgba(0, 0, 0, .15);
	font-size: .875rem;
}
.cookie-notice[hidden] { display: none; }
.cookie-notice p { margin: 0 0 8px; }
.cookie-notice__actions { display: flex; gap: 8px; margin: 0; }
@media (min-width: 720px) { .cookie-notice { left: auto; max-width: 420px; } }

/* --- Photo viewer (js/site.js) --- */

.viewer { max-width: min(96vw, 1300px); max-height: 96vh; padding: 8px; border: 1px solid var(--border); background: #fff; }
.viewer::backdrop { background: rgba(0, 0, 0, .75); }
.viewer img { display: block; max-width: 100%; max-height: calc(96vh - 90px); margin: 0 auto; }
.viewer p { margin: 6px 0 0; text-align: center; }
.viewer__controls { display: flex; justify-content: center; gap: 8px; margin-top: 6px; }

@media print {
	.site-nav, .site-aside, .site-header__side, .cookie-notice, .skip-link { display: none; }
	.page { display: block; }
	.content { border: 0; }
}
