/*
 * МосРесторан — site styles. Mobile first; the legacy look (2008) is kept:
 * red header and footer, cream sidebar and box headings, maroon links,
 * uppercase olive restaurant names. Legacy greys and olive are darkened
 * slightly to reach WCAG AA contrast on white.
 */

:root {
	--red: #da1c30;
	--cream: #faefd5;
	--cream-edge: #d8c8a1;
	--maroon: #710f19;
	--olive: #656a24;
	--grey: #6b6b6b;
	--text: #1a1a1a;
	--slogan: #fadc94;
	--page-width: 940px;
	--sidebar-width: 200px;
}

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

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

body {
	margin: 0;
	background: #fff;
	color: var(--text);
	font-family: Verdana, "DejaVu Sans", "Segoe UI", Tahoma, sans-serif;
	font-size: 15px;
	line-height: 1.5;
	/* Stored text has long runs without spaces («Русская,Кавказская,восточная»). */
	overflow-wrap: anywhere;
}

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

a {
	color: var(--maroon);
	text-decoration: underline;
	text-underline-offset: 0.15em;
}

a:hover {
	text-decoration-thickness: 2px;
}

a:focus-visible,
button:focus-visible,
input:focus-visible,
select:focus-visible {
	outline: 3px solid var(--maroon);
	outline-offset: 2px;
}

h1 {
	margin: 0.4em 0 0.5em;
	color: var(--maroon);
	font-size: 1.45rem;
	line-height: 1.25;
}

h2,
h3 {
	line-height: 1.3;
}

.nowrap {
	white-space: nowrap;
}

.skip-link {
	position: absolute;
	left: -9999px;
	top: 0;
	z-index: 10;
	padding: 0.5em 1em;
	background: #fff;
}

.skip-link:focus {
	left: 0.5em;
	top: 0.5em;
}

/* For-sale notice (home page) */

.notice {
	max-width: var(--page-width);
	margin: 10px auto;
	padding: 6px 12px;
	border: 1px dotted var(--red);
	color: var(--red);
}

.notice p {
	margin: 0.3em 0;
}

.notice a {
	color: var(--red);
	overflow-wrap: anywhere;
}

/* Header */

.site-header {
	display: flex;
	align-items: stretch;
	justify-content: space-between;
	max-width: var(--page-width);
	margin: 0 auto;
	background: var(--red);
}

.site-header__logo {
	display: flex;
	flex: 0 0 auto;
	margin: 0 auto;
}

.site-header__logo img {
	display: block;
	width: auto;
	height: 96px;
}

.site-header__art {
	display: none;
}

/* Page: main first in source order, catalogue menu after it */

.page {
	display: flex;
	flex-direction: column;
	max-width: var(--page-width);
	margin: 0 auto;
}

.content {
	min-width: 0;
	padding: 0 12px 20px;
}

.site-nav {
	padding: 10px 12px 16px;
	background: var(--cream);
	border-top: 1px solid var(--cream-edge);
}

.site-nav__title {
	margin: 0.8em 0 0.4em;
	color: var(--maroon);
	font-size: 1rem;
}

.menu {
	margin: 0;
	padding: 0;
	list-style: none;
}

.menu a {
	display: block;
	min-height: 44px;
	padding: 10px 12px;
	border-right: 1px solid var(--cream-edge);
	border-bottom: 1px solid var(--cream-edge);
	font-size: 0.95rem;
}

.menu a:hover,
.menu a[aria-current="page"] {
	background: #fff;
}

.menu--regions {
	display: grid;
	grid-template-columns: repeat(auto-fill, minmax(7.5em, 1fr));
	gap: 0 6px;
}

/* Footer */

.site-footer {
	max-width: var(--page-width);
	margin: 0 auto;
	padding: 6px 12px;
	background: var(--red);
	/* The legacy cream measured 4.4:1 on this red; white reaches AA. */
	color: #fff;
	font-size: 0.8rem;
	text-align: right;
}

.site-footer p {
	margin: 0;
}

/* Boxes: dotted red rule and a cream heading band, as in the legacy tables */

.box {
	margin: 14px 0;
	border-top: 1px dotted var(--red);
}

.box__title {
	margin: 0 0 6px;
	padding: 6px 12px 7px;
	background: var(--cream);
	color: var(--maroon);
	font-size: 1.05rem;
	font-weight: normal;
}

.lead {
	margin: 0 0 1em;
}

.hint {
	padding: 10px 12px;
	background: var(--cream);
}

/* Search */

/* Two columns even on phones, so the box stays short above the content. */
.search__form {
	display: grid;
	grid-template-columns: 1fr 1fr;
	gap: 8px 10px;
	padding: 4px 12px 10px;
}

.search__field--name,
.search__submit {
	grid-column: 1 / -1;
}

.search__form p {
	margin: 0;
}

.search__field label {
	display: block;
	margin-bottom: 2px;
	font-size: 0.9rem;
}

.search__field input,
.search__field select {
	width: 100%;
	min-height: 44px;
	padding: 8px;
	border: 1px solid #8a8a8a;
	border-radius: 2px;
	background: #fff;
	color: inherit;
	font: inherit;
}

.search__submit button {
	min-height: 44px;
	padding: 8px 24px;
	border: 1px solid var(--maroon);
	border-radius: 2px;
	background: var(--maroon);
	color: #fff;
	font: inherit;
	font-weight: bold;
	cursor: pointer;
}

.search__submit button:hover {
	background: #8e1520;
}

/* Restaurant cards in lists */

.venue {
	display: grid;
	grid-template-columns: 96px 1fr;
	column-gap: 12px;
	padding: 10px 12px;
	border-bottom: 1px solid #eee3c6;
}

/* Two classes, so the wider-screen photo column below cannot override it. */
.venue.venue--no-photo {
	grid-template-columns: 1fr;
}

.venue > * {
	min-width: 0;
}

.venue__photo {
	grid-row: 1 / span 4;
}

.venue__photo img {
	display: block;
	width: 96px;
	height: 72px;
	object-fit: cover;
}

.venue__name {
	margin: 0;
	font-size: 1.05rem;
	text-transform: uppercase;
	overflow-wrap: anywhere;
}

.venue__name a,
.restaurant__name {
	color: var(--olive);
	font-weight: bold;
}

/* Taller hit areas for the links people tap most (WCAG 2.5.8: 24 px). */
.venue__name a,
.breadcrumbs a {
	display: inline-block;
	padding: 3px 0;
}

.venue__type,
.restaurant__type {
	margin: 0;
	color: var(--grey);
}

.venue__excerpt {
	grid-column: 1 / -1;
	margin: 0.4em 0 0;
	font-style: italic;
}

/* Fact lists: «Адрес: …», «Телефон: …» */

.facts {
	margin: 0.3em 0 0;
}

.facts div {
	margin: 0.15em 0;
}

.facts dt {
	display: inline;
	color: var(--grey);
}

.facts dd {
	display: inline;
	margin: 0;
	overflow-wrap: anywhere;
}

.facts a {
	display: inline-block;
	min-height: 24px;
}

/* Restaurant page */

.breadcrumbs ol {
	display: flex;
	flex-wrap: wrap;
	margin: 12px 0 0;
	padding: 0;
	list-style: none;
	font-size: 0.85rem;
}

.breadcrumbs li:not(:last-child)::after {
	content: "›";
	margin: 0 0.5em;
	color: var(--grey);
}

.restaurant {
	padding: 0 12px 12px;
}

.restaurant__name {
	margin: 0.5em 0 0.1em;
	font-size: 1.35rem;
	text-transform: uppercase;
	overflow-wrap: anywhere;
}

.restaurant__description {
	margin: 1em 0;
	font-style: italic;
}

.restaurant__description p {
	margin: 0 0 0.4em;
}

.gallery__title {
	margin: 1em 0 0.5em;
	color: var(--maroon);
	font-size: 1.05rem;
	font-weight: normal;
}

.gallery__list {
	display: grid;
	grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
	gap: 8px;
	margin: 0;
	padding: 0;
	list-style: none;
}

.gallery__list a {
	display: block;
}

.gallery__list img {
	display: block;
	width: 100%;
	aspect-ratio: 4 / 3;
	object-fit: cover;
	background: var(--cream);
}

/* Reviews */

.review {
	padding: 8px 12px;
	border-bottom: 1px solid #eee3c6;
}

.review p {
	margin: 0.2em 0;
	overflow-wrap: anywhere;
}

.review__author .label {
	color: var(--grey);
}

/* Pagination */

.pagination {
	display: flex;
	flex-wrap: wrap;
	justify-content: center;
	gap: 4px;
	padding: 12px;
}

.pagination a,
.pagination span {
	display: inline-flex;
	align-items: center;
	min-width: 44px;
	min-height: 44px;
	padding: 0 8px;
	justify-content: center;
}

.pagination__current {
	font-weight: bold;
}

.pagination__off,
.pagination__gap {
	color: var(--grey);
}

/* Partner banner */

.partner {
	margin: 16px 0 0;
	text-align: center;
}

.partner a,
.partner img {
	display: inline-block;
	vertical-align: top;
}

/* Wider screens: legacy two-column layout */

@media (min-width: 560px) {
	.venue {
		grid-template-columns: 110px 1fr;
	}

	.venue__photo img {
		width: 110px;
		height: 82px;
	}
}

@media (min-width: 820px) {
	body {
		font-size: 14px;
		margin-top: 10px;
	}

	.site-header__logo {
		margin: 0;
	}

	.site-header__logo img {
		height: 120px;
	}

	.site-header__art {
		display: block;
		width: 470px;
		height: 120px;
		flex: 0 1 470px;
		object-fit: cover;
		object-position: right center;
		min-width: 0;
	}

	.page {
		display: grid;
		grid-template-columns: var(--sidebar-width) 1fr;
		grid-template-areas: "nav content";
	}

	.content {
		grid-area: content;
		padding: 0 3px 20px;
	}

	.site-nav {
		grid-area: nav;
		padding: 10px 10px 16px 0;
		border-top: 0;
		border-left: 1px solid var(--cream-edge);
	}

	.site-nav__title {
		padding-left: 12px;
	}

	.menu--regions {
		grid-template-columns: 1fr;
	}

	.menu a {
		min-height: 0;
		padding: 6px 12px 7px;
	}

	.search__form {
		grid-template-columns: 2fr 1fr 1fr auto;
		align-items: end;
	}

	.search__field--name,
	.search__submit {
		grid-column: auto;
	}

	.search__field input,
	.search__field select,
	.search__submit button {
		min-height: 36px;
	}

	.venue__name {
		font-size: 1.15rem;
	}

	.facts a {
		min-height: 0;
	}

	.pagination a,
	.pagination span {
		min-width: 32px;
		min-height: 32px;
	}
}
