/* Разделы билетов, знаков, правил, статей и штрафов. Грузится поверх landing.css: токены,
   шапка, подвал, кнопки и шрифты общие, здесь только длинные страницы со
   списками и разборами. */

.content-page .wrap,
.page {
	max-width: 860px;
	margin: 0 auto;
	padding: 0 28px;
}

/* Хлебные крошки */
.crumbs {
	max-width: 860px;
	margin: 0 auto;
	padding: 22px 28px 0;
	font-size: 13px;
}

.crumbs ol {
	display: flex;
	flex-wrap: wrap;
	gap: 6px;
	margin: 0;
	padding: 0;
	list-style: none;
}

.crumbs li+li::before {
	content: '/';
	margin-right: 6px;
	color: var(--faint);
}

.crumbs a {
	color: var(--muted);
	text-decoration: none;
}

.crumbs a:hover {
	color: var(--text);
}

.crumbs span {
	color: var(--faint);
}

.page h1 {
	margin: 24px 0 14px;
	font-size: 38px;
	line-height: 1.12;
	letter-spacing: -.02em;
	font-weight: 800;
}

.page .lead {
	margin: 0 0 24px;
	font-size: 17px;
	line-height: 1.65;
	color: var(--muted);
}

.page h2 {
	margin: 38px 0 14px;
	font-size: 22px;
	font-weight: 800;
	letter-spacing: -.01em;
	scroll-margin-top: 96px;
}

.page h2 a {
	color: inherit;
	text-decoration: none;
}

.page h2 a:hover {
	color: var(--accent-ink);
}

.page>p {
	margin: 0 0 14px;
	font-size: 16px;
	line-height: 1.75;
	color: var(--muted);
}

.page .note {
	margin-top: 22px;
	font-size: 14px;
	color: var(--faint);
}

/* ─────────────────────────── сетка билетов ─────────────────────────── */

.ticket-grid {
	display: grid;
	grid-template-columns: repeat(auto-fill, minmax(88px, 1fr));
	gap: 10px;
	margin: 0 0 8px;
}

.ticket-card {
	display: flex;
	align-items: center;
	justify-content: center;
	min-height: 62px;
	border: 1px solid var(--border);
	border-radius: 14px;
	background: var(--card);
	color: var(--text);
	font-size: 20px;
	font-weight: 800;
	text-decoration: none;
	transition: border-color .15s, transform .15s;
}

.ticket-card:hover {
	border-color: var(--accent);
	transform: translateY(-1px);
}

/* Подпись «Билет N» нужна только читалке экрана: в сетке из 128 плиток
   слово перед каждым числом лишний шум, а голым числом ссылка бессмысленна. */
.ticket-card span {
	position: absolute;
	width: 1px;
	height: 1px;
	overflow: hidden;
	clip: rect(0 0 0 0);
	white-space: nowrap;
}

/* ─────────────────────────── вопросы билета ─────────────────────────── */

.questions {
	padding-top: 4px;
}

.q-cta {
	margin: 0 0 8px;
}

.q-card {
	margin: 0 0 26px;
	padding: 24px 26px 26px;
	border: 1px solid var(--border);
	border-radius: 20px;
	background: var(--surface);
	scroll-margin-top: 96px;
}

.q-label {
	display: flex;
	align-items: center;
	gap: 10px;
	margin-bottom: 8px;
	font-size: 13px;
	font-weight: 700;
	letter-spacing: .04em;
	text-transform: uppercase;
	color: var(--faint);
}

.q-tag {
	padding: 3px 9px;
	border-radius: 999px;
	background: var(--tile-blue);
	color: var(--ink-blue);
	font-size: 11px;
	letter-spacing: .02em;
	text-transform: none;
}

.q-card h2 {
	margin: 0 0 16px;
	font-size: 20px;
	line-height: 1.4;
	font-weight: 700;
	letter-spacing: -.01em;
}

/* Схемы перекрёстков рисованы на белом. В тёмной теме без подложки картинка
   светится рваным прямоугольником — поэтому фон белый в обеих темах. */
.q-fig {
	margin: 0 0 18px;
}

.q-img,
.sign-img,
.sign-hero-img,
.cat-img {
	display: block;
	background: #fff;
	border-radius: 14px;
}

.q-img {
	width: 100%;
	height: auto;
	border: 1px solid var(--border);
}

.q-answers {
	margin: 0;
	padding: 0;
	list-style: none;
	counter-reset: ans;
}

.q-answers li {
	position: relative;
	margin-bottom: 8px;
	padding: 12px 14px 12px 46px;
	border: 1px solid var(--border);
	border-radius: 14px;
	font-size: 16px;
	line-height: 1.55;
	color: var(--muted);
	counter-increment: ans;
}

.q-answers li::before {
	content: counter(ans);
	position: absolute;
	left: 13px;
	top: 11px;
	width: 22px;
	height: 22px;
	border-radius: 50%;
	background: var(--chip);
	color: var(--faint);
	font-size: 13px;
	font-weight: 700;
	line-height: 22px;
	text-align: center;
}

.q-answers li.is-correct {
	border-color: var(--ink-green);
	background: var(--tile-green);
	color: var(--text);
	font-weight: 600;
}

.q-answers li.is-correct::before {
	background: var(--ink-green);
	color: #fff;
}

.q-badge {
	display: inline-block;
	margin-left: 8px;
	padding: 2px 9px;
	border-radius: 999px;
	background: var(--ink-green);
	color: #fff;
	font-size: 11px;
	font-weight: 700;
	letter-spacing: .03em;
	text-transform: uppercase;
	vertical-align: 2px;
	white-space: nowrap;
}

.q-comment {
	margin-top: 18px;
	padding: 18px 20px;
	border-radius: 16px;
	background: var(--card);
}

.q-comment h3 {
	margin: 0 0 8px;
	font-size: 13px;
	font-weight: 700;
	letter-spacing: .04em;
	text-transform: uppercase;
	color: var(--faint);
}

.q-comment p {
	margin: 0 0 10px;
	font-size: 15px;
	line-height: 1.7;
	color: var(--muted);
}

.q-comment p:last-child {
	margin-bottom: 0;
}

.q-comment a {
	color: var(--accent-ink);
	font-weight: 600;
	text-decoration: underline;
	text-underline-offset: 2px;
}

/* ─────────────────────────── листалка ─────────────────────────── */

.pager {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	justify-content: space-between;
	gap: 10px;
	max-width: 860px;
	margin: 0 auto 8px;
	padding: 0 28px;
}

.pager a {
	display: flex;
	flex-direction: column;
	gap: 2px;
	padding: 13px 18px;
	border: 1px solid var(--border);
	border-radius: 14px;
	background: var(--surface);
	color: var(--text);
	text-decoration: none;
	transition: border-color .15s;
}

.pager a:hover {
	border-color: var(--accent);
}

.pager span {
	font-size: 12px;
	color: var(--faint);
}

.pager b {
	font-size: 15px;
	font-weight: 700;
}

.pager-next {
	text-align: right;
	margin-left: auto;
}

.pager-up {
	font-size: 14px;
	font-weight: 600;
	color: var(--muted) !important;
}

/* ─────────────────────────── знаки ─────────────────────────── */

.cat-grid {
	display: grid;
	grid-template-columns: repeat(auto-fill, minmax(170px, 1fr));
	gap: 12px;
	margin-bottom: 8px;
}

.cat-card {
	display: flex;
	flex-direction: column;
	align-items: flex-start;
	gap: 6px;
	padding: 16px;
	border: 1px solid var(--border);
	border-radius: 18px;
	background: var(--surface);
	color: var(--text);
	text-decoration: none;
	transition: border-color .15s, transform .15s;
}

.cat-card:hover {
	border-color: var(--accent);
	transform: translateY(-1px);
}

.cat-img {
	width: 52px;
	height: auto;
	margin-bottom: 2px;
	padding: 4px;
}

.cat-name {
	font-size: 15px;
	font-weight: 700;
	line-height: 1.35;
}

.cat-count {
	font-size: 13px;
	color: var(--faint);
}

.sign-sec {
	margin-top: 8px;
}

.sign-list {
	display: grid;
	grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
	gap: 2px 18px;
	margin: 0;
	padding: 0;
	list-style: none;
}

.sign-list a {
	display: block;
	padding: 6px 0;
	font-size: 15px;
	line-height: 1.5;
	color: var(--muted);
	text-decoration: none;
}

.sign-list a:hover {
	color: var(--accent-ink);
}

.sign-list b {
	margin-right: 6px;
	color: var(--text);
	font-weight: 700;
}

.sign-grid {
	display: grid;
	grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
	gap: 14px;
}

.sign-card {
	display: flex;
	flex-direction: column;
	gap: 6px;
	padding: 18px;
	border: 1px solid var(--border);
	border-radius: 18px;
	background: var(--surface);
	color: var(--text);
	text-decoration: none;
	transition: border-color .15s, transform .15s;
}

.sign-card:hover {
	border-color: var(--accent);
	transform: translateY(-1px);
}

.sign-img {
	width: 96px;
	height: auto;
	padding: 6px;
}

.sign-num {
	font-size: 13px;
	font-weight: 700;
	color: var(--faint);
}

.sign-name {
	font-size: 16px;
	font-weight: 700;
	line-height: 1.35;
}

.sign-hint {
	font-size: 13px;
	line-height: 1.55;
	color: var(--muted);
}

.sign-hero {
	margin: 0 0 22px;
}

.sign-hero-img {
	width: 220px;
	max-width: 60%;
	height: auto;
	padding: 12px;
	border: 1px solid var(--border);
}

.sign-meta {
	display: flex;
	flex-wrap: wrap;
	gap: 10px 28px;
	margin: 0 0 22px;
	padding: 16px 20px;
	border: 1px solid var(--border);
	border-radius: 16px;
	background: var(--card);
}

.sign-meta dt {
	font-size: 12px;
	letter-spacing: .03em;
	text-transform: uppercase;
	color: var(--faint);
}

.sign-meta dd {
	margin: 2px 0 0;
	font-size: 15px;
	font-weight: 700;
}

.sign-meta a {
	color: var(--accent-ink);
	text-decoration: none;
}

.sign-page p {
	margin: 0 0 14px;
	font-size: 16px;
	line-height: 1.75;
	color: var(--muted);
}

.sign-page p a {
	color: var(--accent-ink);
	font-weight: 600;
	text-decoration: underline;
	text-underline-offset: 2px;
}

/* ─────────────────────────── штрафы ─────────────────────────── */

.table-wrap {
	border: 1px solid var(--border);
	border-radius: 16px;
	overflow-x: auto;
	-webkit-overflow-scrolling: touch;
}

.table-wrap table {
	width: 100%;
	min-width: 560px;
	border-collapse: collapse;
	font-size: 15px;
}

.table-wrap th {
	padding: 13px 16px;
	background: var(--card);
	border-bottom: 1px solid var(--border);
	color: var(--text);
	font-weight: 700;
	text-align: left;
	white-space: nowrap;
}

.table-wrap td {
	padding: 14px 16px;
	border-bottom: 1px solid var(--hairline);
	color: var(--muted);
	line-height: 1.6;
	vertical-align: top;
}

.table-wrap tr:last-child td {
	border-bottom: 0;
}

.table-wrap td.num {
	color: var(--text);
	font-weight: 700;
	white-space: nowrap;
}

.table-wrap td b {
	display: block;
	color: var(--text);
	font-weight: 700;
}

.fine-art {
	display: block;
	margin-top: 4px;
	font-size: 13px;
	color: var(--faint);
}

.fine-text {
	display: block;
	margin-top: 4px;
	font-size: 14px;
}

/* ─────────────────────────── правила ─────────────────────────── */

.chapter-list {
	margin: 0 0 8px;
	padding: 0;
	list-style: none;
	counter-reset: none;
}

.chapter-list li+li {
	margin-top: 8px;
}

.chapter-list a {
	display: flex;
	align-items: center;
	gap: 14px;
	padding: 13px 18px;
	border: 1px solid var(--border);
	border-radius: 14px;
	background: var(--card);
	color: var(--text);
	text-decoration: none;
	transition: border-color .15s, transform .15s;
}

.chapter-list a:hover {
	border-color: var(--accent);
	transform: translateY(-1px);
}

.chapter-list b {
	flex: none;
	min-width: 30px;
	font-size: 15px;
	font-weight: 800;
	color: var(--faint);
	font-variant-numeric: tabular-nums;
}

.chapter-list span {
	font-size: 16px;
	font-weight: 600;
	line-height: 1.4;
}

/* Название главы куда длиннее, чем «Билет 5»: без ограничения предыдущая
   и следующая не влезают в строку вдвоём и листалка разъезжается на два
   этажа. Длинное название обрезаем многоточием. */
.rules-pager b {
	display: block;
	max-width: 28ch;
	overflow: hidden;
	text-overflow: ellipsis;
	white-space: nowrap;
}

.rules-page .chapter-label {
	margin: 24px 0 0;
	font-size: 13px;
	font-weight: 700;
	letter-spacing: .04em;
	text-transform: uppercase;
	color: var(--faint);
}

.rules-page h1 {
	margin-top: 6px;
}

/* Пункт правил — цель ссылки вида /pdd/6-.../#p42, поэтому под шапкой нужен
   тот же отступ, что у вопросов билета. */
.clause {
	scroll-margin-top: 96px;
}

.clause p {
	margin: 0 0 14px;
	font-size: 16px;
	line-height: 1.75;
	color: var(--muted);
}

/* Номер пункта — якорь на него же. Держим на строке вместе с текстом, но
   выделяем цветом текста: сплошная синева на 44 пунктах главы читается хуже,
   чем сам закон. */
.clause-num {
	font-weight: 800;
	color: var(--text);
	text-decoration: none;
	font-variant-numeric: tabular-nums;
}

.clause-num:hover {
	color: var(--accent-ink);
}

.clause-list {
	margin: -6px 0 14px;
	padding: 0 0 0 20px;
}

.clause-list li {
	margin: 0 0 6px;
	font-size: 16px;
	line-height: 1.7;
	color: var(--muted);
}

.clause-list li::marker {
	color: var(--faint);
}

/* ─────────────────────────── статьи ─────────────────────────── */

.art-grid {
	display: grid;
	gap: 12px;
	margin: 0 0 8px;
}

.art-card {
	display: block;
	padding: 20px 22px;
	border: 1px solid var(--border);
	border-radius: 18px;
	background: var(--card);
	color: var(--text);
	text-decoration: none;
	transition: border-color .15s, transform .15s;
}

.art-card:hover {
	border-color: var(--accent);
	transform: translateY(-1px);
}

.art-name {
	display: block;
	margin-bottom: 6px;
	font-size: 19px;
	font-weight: 800;
	letter-spacing: -.01em;
	line-height: 1.3;
}

.art-hint {
	display: block;
	font-size: 15px;
	line-height: 1.6;
	color: var(--muted);
}

.art-page h3 {
	margin: 28px 0 12px;
	font-size: 17px;
	font-weight: 700;
}

.art-list {
	margin: -4px 0 16px;
	padding: 0 0 0 20px;
}

.art-list li {
	margin: 0 0 6px;
	font-size: 16px;
	line-height: 1.7;
	color: var(--muted);
}

.art-list li::marker {
	color: var(--faint);
}

/* Карточка вопроса внутри статьи: в билете подпись «Вопрос 3» не кликается,
   здесь она ведёт в билет, из которого вопрос взят. */
.art-page .q-label a {
	color: inherit;
	text-decoration: none;
	border-bottom: 1px solid var(--hairline);
}

.art-page .q-label a:hover {
	color: var(--accent-ink);
}

.art-page .q-card h3 {
	margin: 0 0 16px;
	font-size: 20px;
	line-height: 1.4;
	font-weight: 700;
	letter-spacing: -.01em;
}

.art-page .q-comment h4 {
	margin: 0 0 8px;
	font-size: 13px;
	font-weight: 700;
	letter-spacing: .04em;
	text-transform: uppercase;
	color: var(--faint);
}

.faq-list {
	display: grid;
	gap: 12px;
}

.faq-item {
	padding: 18px 22px;
	border: 1px solid var(--border);
	border-radius: 16px;
	background: var(--surface);
}

.faq-item h3 {
	margin: 0 0 8px;
	font-size: 17px;
	font-weight: 700;
	line-height: 1.4;
}

.faq-item p {
	margin: 0;
	font-size: 15px;
	line-height: 1.7;
	color: var(--muted);
}

.art-links {
	margin: 0;
	padding: 0 0 0 20px;
}

.art-links li {
	margin: 0 0 8px;
	font-size: 16px;
	line-height: 1.6;
}

.art-links a {
	color: var(--accent-ink);
}

/* ─────────────────────────── призыв внизу ─────────────────────────── */

.cta-inline {
	max-width: 860px;
	margin: 34px auto 48px;
	padding: 28px;
	border-radius: 22px;
	background: var(--accent-soft);
	text-align: center;
}

.cta-inline h2 {
	margin: 0 0 8px;
	font-size: 22px;
	font-weight: 800;
	letter-spacing: -.01em;
}

.cta-inline p {
	max-width: 520px;
	margin: 0 auto 18px;
	font-size: 15px;
	line-height: 1.65;
	color: var(--muted);
}

.cta-inline .store-row {
	justify-content: center;
}

/* На лендинге разделы уезжают в ленту чипов под шапкой. Здесь их пять
   и они нужны на каждой странице — на планшете держим в строке. */
@media (min-width: 621px) and (max-width: 1080px) {
	.content-page .nav-row .nav-links {
		display: flex;
	}

	.content-page .nav-scroll {
		display: none;
	}
}

@media (max-width: 620px) {

	.page,
	.crumbs,
	.pager,
	.cta-inline {
		padding-left: 18px;
		padding-right: 18px;
	}

	.cta-inline {
		margin-left: 18px;
		margin-right: 18px;
		padding: 22px 18px;
	}

	.page h1 {
		font-size: 28px;
	}

	.page h2 {
		margin-top: 30px;
		font-size: 19px;
	}

	.q-card {
		padding: 18px 18px 20px;
		border-radius: 18px;
	}

	.q-card h2 {
		font-size: 18px;
	}

	.q-answers li {
		padding: 11px 12px 11px 42px;
		font-size: 15px;
	}

	.sign-hero-img {
		max-width: 78%;
	}

	.content-page .footer {
		padding-bottom: 44px;
	}
}
