/*
 * Правки поверх портированной темы. Отдельным файлом, чтобы style.css остался
 * точной копией прода: так видно, что именно изменено, и это легко откатить.
 *
 * Что чинится: картинки в статьях. WordPress оставил у них случайные размеры
 * и случайное обтекание — часть растягивалась из мелкого файла и мылила, часть
 * жалась, текст обтекал их то слева, то справа. Размеры выправлены в конвертере
 * (convert.py, fix_images), здесь — отступы, центровка и единая рамка.
 */

.post__entry img {
	display: block;
	margin: 24px auto;
	max-width: 100%;
	height: auto;
	border-radius: 3px;
}

/* Обтекания в статьях больше нет: все картинки идут по центру колонки.
   Классы alignleft/alignright остались у единиц картинок, которых нет
   в медиатеке, — гасим их, чтобы вёрстка не разъезжалась. */
.post__entry .alignleft,
.post__entry .alignright,
.post__entry img.alignleft,
.post__entry img.alignright {
	float: none;
	margin: 24px auto;
}

/* Картинка внутри ссылки на оригинал (лайтбокс) — ссылка должна быть блоком,
   иначе центрирование картинки внутри неё не срабатывает. */
.post__entry a:has(> img) {
	display: block;
	text-align: center;
}

/* Подписи под картинками. WordPress прибивал обёртке ширину инлайном
   (style="width: 507px"), конвертер её пересчитывает — но на случай, если
   в тексте появится ещё одна, ширину задаём тут и не даём подписи стать уже
   самой картинки. */
.post__entry .wp-caption {
	width: fit-content !important;
	max-width: 100% !important;
	margin: 24px auto;
	float: none;
}

.post__entry .wp-caption img {
	margin: 0 auto 8px;
}

.post__entry .wp-caption-text {
	text-align: center;
	font-size: 13px;
	color: #7b7f95;
}

/* Первый и последний элементы блока не должны добавлять лишний отступ */
.post__entry > p:first-child img {
	margin-top: 0;
}

/* ------------------------------------------------------------------
 * Каталог шин: страница бренда и страница модели.
 * Классы новые, в портированной style.css их нет — оформляем здесь,
 * опираясь на палитру темы (#2F3243 текст, #4964C7 ссылки, #F7F8FC фон).
 * ------------------------------------------------------------------ */

/* --- страница бренда: список моделей по сезонам --- */
.brand-catalog__group {
	margin-bottom: 30px;
}

.brand-catalog__season {
	margin: 0 0 12px;
	padding-bottom: 8px;
	border-bottom: 2px solid #E8EAF2;
	font-size: 20px;
	font-weight: 700;
	color: #2F3243;
}

.brand-catalog__season span {
	margin-left: 8px;
	font-size: 14px;
	font-weight: 400;
	color: #9598A8;
}

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

.brand-catalog__item {
	display: flex;
	align-items: baseline;
	justify-content: space-between;
	gap: 10px;
	padding: 7px 0;
	border-bottom: 1px solid #F0F1F6;
}

.brand-catalog__item a {
	color: #4964C7;
	text-decoration: none;
}

.brand-catalog__item a:hover {
	text-decoration: underline;
}

/* модель, про которую на сайте есть своя статья */
.brand-catalog__item--article a {
	font-weight: 700;
}

.brand-catalog__sizes {
	flex: none;
	min-width: 26px;
	text-align: right;
	font-size: 13px;
	color: #9598A8;
}

.brand-articles {
	margin-top: 34px;
}

.brand-articles__title {
	margin: 0 0 16px;
	font-size: 22px;
	color: #2F3243;
}

/* --- страница модели --- */
.tyre-specs {
	margin: 26px 0;
}

.tyre-specs__title,
.tyre-sizes__title,
.tyre-others__title {
	margin: 0 0 14px;
	font-size: 22px;
	color: #2F3243;
}

/* быстрый переход по посадочным диаметрам */
.tyre-sizes__nav {
	display: flex;
	flex-wrap: wrap;
	gap: 8px;
	margin-bottom: 20px;
}

.tyre-sizes__d {
	padding: 5px 12px;
	border: 1px solid #DDE0EC;
	border-radius: 3px;
	background: #F7F8FC;
	color: #4964C7;
	font-size: 14px;
	text-decoration: none;
}

.tyre-sizes__d:hover {
	border-color: #4964C7;
}

.tyre-sizes__group {
	margin-bottom: 26px;
}

.tyre-sizes__diameter {
	margin: 0 0 8px;
	font-size: 17px;
	color: #2F3243;
}

.tyre-sizes__table {
	width: 100%;
	border-collapse: collapse;
}

.tyre-sizes__table th {
	background: #F7F8FC;
	font-size: 13px;
	font-weight: 400;
	color: #7B7F95;
	text-align: left;
}

.tyre-sizes__size {
	font-weight: 700;
}

.tyre-sizes__index {
	color: #7B7F95;
	white-space: nowrap;
}

/* --- другие модели бренда --- */
.tyre-others {
	margin-top: 34px;
	padding-top: 24px;
	border-top: 2px solid #E8EAF2;
}

.tyre-others__list {
	display: grid;
	grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
	gap: 2px 20px;
	margin: 0 0 16px;
	padding: 0;
	list-style: none;
}

.tyre-others__list li {
	display: flex;
	align-items: baseline;
	justify-content: space-between;
	gap: 10px;
	padding: 6px 0;
	border-bottom: 1px solid #F0F1F6;
}

.tyre-others__count {
	flex: none;
	font-size: 13px;
	color: #9598A8;
}

.tyre-others__all {
	display: inline-block;
	font-weight: 700;
}

.tyre-source {
	margin-top: 22px;
	font-size: 13px;
	color: #9598A8;
}

.tyre-source a {
	color: #9598A8;
	text-decoration: underline;
}

@media (max-width: 600px) {
	.brand-catalog__list,
	.tyre-others__list {
		grid-template-columns: 1fr;
	}
}

/* ------------------------------------------------------------------
 * Инфографическая карточка модели: бейджи, цифры, распределение
 * размеров по посадочным диаметрам. Всё из спарсенных данных.
 * ------------------------------------------------------------------ */
.tyre-card {
	margin: 0 0 30px;
	padding: 20px 22px;
	border: 1px solid #E8EAF2;
	border-radius: 4px;
	background: #FBFCFE;
}

.tyre-card__badges {
	display: flex;
	flex-wrap: wrap;
	gap: 8px;
	margin-bottom: 18px;
}

.tyre-badge {
	padding: 5px 11px;
	border-radius: 3px;
	background: #EDEFF7;
	font-size: 13px;
	color: #4A4D63;
}

.tyre-badge b {
	color: #2F3243;
}

.tyre-badge--winter_studded { background: #DCE7F8; color: #1F4C8F; }
.tyre-badge--winter         { background: #E2EEF6; color: #1F5F7A; }
.tyre-badge--summer         { background: #FBEBD8; color: #8A5312; }
.tyre-badge--allseason      { background: #E4F0E2; color: #2F6B2A; }

.tyre-card__figures {
	display: grid;
	grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
	gap: 14px;
	padding-bottom: 18px;
	border-bottom: 1px solid #E8EAF2;
}

.tyre-fig__value {
	font-size: 26px;
	font-weight: 700;
	line-height: 1.1;
	color: #2F3243;
}

.tyre-fig__label {
	margin-top: 3px;
	font-size: 12px;
	color: #8A8DA0;
}

.tyre-card__chart {
	margin-top: 18px;
}

.tyre-chart__title {
	margin-bottom: 10px;
	font-size: 13px;
	color: #8A8DA0;
}

.tyre-chart__row {
	display: flex;
	align-items: center;
	gap: 10px;
	margin-bottom: 5px;
}

.tyre-chart__d {
	flex: none;
	width: 40px;
	font-size: 13px;
	font-weight: 700;
	color: #4964C7;
	text-decoration: none;
}

.tyre-chart__d:hover { text-decoration: underline; }

.tyre-chart__track {
	flex: 1;
	height: 14px;
	border-radius: 2px;
	background: #EDEFF7;
	overflow: hidden;
}

.tyre-chart__bar {
	height: 100%;
	border-radius: 2px;
	background: linear-gradient(90deg, #4964C7, #6E85D8);
}

.tyre-chart__n {
	flex: none;
	width: 28px;
	font-size: 12px;
	color: #8A8DA0;
	text-align: right;
}

/* ------------------------------------------------------------------
 * Подбор по авто. Классы specs-table, geometry-info, sizes-list,
 * size-item и warning-list берутся из темы — под них уже есть стили
 * от single-podbor.php. Здесь только то, чего в теме не было.
 * ------------------------------------------------------------------ */
/* Оглавление по годам. Каждый год — отдельная ссылка, включая те, что
   лежат в свёрнутом блоке старых периодов: до этого «2007» на странице
   Lancer вообще не было видимым текстом. */
.wheel-years {
	margin: 22px 0 28px;
	padding: 14px 16px;
	border: 1px solid #E8EAF2;
	border-radius: 4px;
	background: #FAFBFE;
}

.post__entry .wheel-years__title {
	margin: 0 0 10px;
	font-size: 15px;
	font-weight: 700;
	color: #4A4D63;
}

/* Селекторы с .post__entry — не украшение, а специфичность. У темы есть
   `.post__entry ul` (отступ слева 20 px), `.post__entry ul > li`
   (маркер-картинка и padding-left) и `.post__entry h2` (30 px, свои поля).
   Все они специфичнее одиночного класса и молча перебивают его: заголовки
   годов, написанные здесь на 22 px с подчёркиванием, до этой правки
   выводились обычными тридцатипиксельными h2 темы. */
.post__entry .wheel-years__list {
	display: flex;
	flex-wrap: wrap;
	gap: 6px;
	margin: 0;
	padding: 0;
	list-style: none;
}

.post__entry .wheel-years__list > li {
	margin: 0;
	padding: 0;
	background: none;
}

.wheel-years__item a {
	display: block;
	padding: 4px 9px;
	border: 1px solid #E0E4F0;
	border-radius: 3px;
	background: #FFF;
	font-size: 14px;
	text-decoration: none;
}

.wheel-years__item a:hover {
	border-color: #4964C7;
	background: #4964C7;
	color: #FFF;
}

.wheel-year {
	margin: 26px 0;
	scroll-margin-top: 12px;
}

.post__entry .wheel-year__title {
	margin: 0 0 12px;
	padding-bottom: 8px;
	border-bottom: 2px solid #E8EAF2;
	font-size: 22px;
	color: #2F3243;
}

.wheel-mod {
	margin-bottom: 20px;
	padding: 14px 16px;
	border: 1px solid #EDEFF7;
	border-radius: 4px;
}

.wheel-mod__names {
	margin-bottom: 10px;
	font-size: 14px;
	font-weight: 700;
	color: #4A4D63;
}

/* --- шины подходящих размеров --- */
.wheel-tyres {
	margin-top: 34px;
	padding-top: 24px;
	border-top: 2px solid #E8EAF2;
}

.post__entry .wheel-tyres__title {
	margin: 0 0 16px;
	font-size: 22px;
	color: #2F3243;
}

.wheel-tyres__group {
	margin-bottom: 16px;
}

.wheel-tyres__size {
	margin-bottom: 6px;
	font-weight: 700;
	color: #2F3243;
}

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

.wheel-tyres__list li {
	padding: 5px 0;
	border-bottom: 1px solid #F0F1F6;
	font-size: 14px;
}

/* --- хаб марки --- */
.wheel-hub__title {
	margin: 26px 0 14px;
	font-size: 22px;
	color: #2F3243;
}

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

.wheel-hub__list li {
	padding: 7px 0;
	border-bottom: 1px solid #F0F1F6;
}

.wheel-hub__years {
	font-size: 12px;
	color: #9598A8;
}

.wheel-hub__table {
	width: 100%;
	border-collapse: collapse;
	font-size: 14px;
}

.wheel-hub__table th {
	padding: 8px 10px;
	background: #F7F8FC;
	font-size: 13px;
	font-weight: 400;
	color: #7B7F95;
	text-align: left;
}

.wheel-hub__table td {
	padding: 8px 10px;
	border-bottom: 1px solid #F0F1F6;
	vertical-align: top;
}

.wheel-hub__car { font-weight: 700; }
.wheel-hub__y   { white-space: nowrap; color: #7B7F95; }
.wheel-hub__s   { color: #4A4D63; }

/* --- указатель марок --- */
.wheel-brands {
	display: grid;
	grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
	gap: 8px;
	margin-top: 20px;
}

.wheel-brands__item {
	display: flex;
	flex-wrap: wrap;
	align-items: baseline;
	justify-content: space-between;
	gap: 2px 8px;
	padding: 9px 12px;
	border: 1px solid #E8EAF2;
	border-radius: 3px;
	text-decoration: none;
}

.wheel-brands__item:hover { border-color: #4964C7; }
.wheel-brands__name { color: #4964C7; }
.wheel-brands__ru   { flex: 1 1 100%; order: 3; font-size: 12px; color: #7B7F95; }
.wheel-brands__n    { font-size: 12px; color: #9598A8; }

.size-empty { color: #9598A8; }

@media (max-width: 600px) {
	.wheel-hub__list,
	.wheel-tyres__list,
	.wheel-brands { grid-template-columns: 1fr; }
}

/* Старые годы выпуска под раскрывашкой: у Porsche 911 их 49 групп,
   и без этого страница уходит в бесконечную ленту. */
.wheel-older {
	margin-top: 20px;
	padding-top: 16px;
	border-top: 1px solid #E8EAF2;
}

.wheel-older > summary {
	cursor: pointer;
	padding: 10px 14px;
	border-radius: 3px;
	background: #F7F8FC;
	font-weight: 700;
	color: #4964C7;
}

.wheel-older[open] > summary { margin-bottom: 14px; }

/* Компактная таблица старых лет: те же данные, но разметки в разы меньше */
.wheel-old-table {
	width: 100%;
	border-collapse: collapse;
	font-size: 13px;
}

.wheel-old-table th {
	padding: 7px 8px;
	background: #F7F8FC;
	font-weight: 400;
	color: #7B7F95;
	text-align: left;
}

.wheel-old-table td {
	padding: 7px 8px;
	border-bottom: 1px solid #F0F1F6;
	vertical-align: top;
}

.wheel-old-table__y { white-space: nowrap; font-weight: 700; }
.wheel-old-table tr[id] { scroll-margin-top: 12px; }

/* ------------------------------------------------------------------
 * Заголовки рядом со слайдером. В теме это были <div>, теперь ссылки —
 * гасим подчёркивание и наследуемый цвет ссылок.
 * ------------------------------------------------------------------ */
.popular-pager a.popular-pager__item {
	color: #2F3243;
	text-decoration: none;
}

.popular-pager a.popular-pager__item:hover {
	color: #2F3243;
}

/* Строка модели в хабе марки — цель формы подбора, отступ под шапку. */
.wheel-hub__table tr[id],
.wheel-hub__list li[id] { scroll-margin-top: 12px; }

/* --- форма подбора в сайдбаре --- */
.filter-form__select select:disabled {
	color: #9598A8;
	background-color: #F7F8FC;
}

.filter__all {
	display: block;
	margin-top: 14px;
	font-size: 13px;
	text-align: center;
}

/* Текст на популярных страницах подбора. Оформление берём у статей темы
   (.post__entry h2/p/ul) — это и есть статья; здесь только отбивка от
   оглавления по годам и от таблиц ниже. */
.wheel-text {
	margin: 26px 0 32px;
	padding-bottom: 26px;
	border-bottom: 1px solid #E8EAF2;
}

.post__entry .wheel-text > h2:first-child {
	margin-top: 0;
}

/* ==================================================================
 * Компоненты инфо-статей: мнение эксперта, блоки внимания, FAQ.
 * Вид повторяет ibexpert.ru — формат брали оттуда, пусть и выглядит так же.
 * Селекторы с .post__entry не для красоты: у темы есть правила
 * `.post__entry img` (margin 24px и радиус 3px), `.post__entry ul > li`
 * и `.post__entry h3`, они специфичнее одиночного класса.
 * ================================================================== */

/* --- мнение эксперта --- */
.expert-box {
	margin: 40px 0;
	overflow: hidden;
	border: 1px solid #E8EAF2;
	border-radius: 6px;
	background: #FFF;
	box-shadow: 0 10px 30px rgba(0, 0, 0, .04);
}

.expert-box__header {
	display: flex;
	align-items: center;
	padding: 22px 24px;
	border-bottom: 1px solid #E8EAF2;
	background: #FAFBFD;
}

.expert-box__avatar {
	flex: none;
	width: 80px;
	height: 80px;
	margin-right: 22px;
	overflow: hidden;
	border: 3px solid #FFF;
	border-radius: 50%;
	box-shadow: 0 4px 10px rgba(0, 0, 0, .12);
}

/* Тема даёт каждой картинке в статье `margin: 24px 0` и радиус 3px.
   Аватар от этого уезжал вниз из круглой маски на 24 px — снизу торчал
   фон, сверху срезалось лицо. Ровно тот же фикс и тем же способом стоит
   в стилях ibexpert. */
.post__entry .expert-box__img,
.expert-box__img {
	display: block;
	width: 100%;
	height: 100%;
	margin: 0 !important;
	padding: 0;
	border: none;
	border-radius: 0;
	object-fit: cover;
}

.expert-box__info {
	display: flex;
	flex-direction: column;
	min-width: 0;
}

.expert-box__label {
	align-self: flex-start;
	margin-bottom: 8px;
	padding: 4px 12px;
	border-radius: 4px;
	background: #4964C7;
	color: #FFF;
	font-size: 11px;
	font-weight: 700;
	letter-spacing: .08em;
	text-transform: uppercase;
}

.expert-box__name {
	margin-bottom: 3px;
	font-size: 19px;
	font-weight: 700;
	color: #2F3243;
}

.expert-box__pos {
	font-size: 13px;
	color: #7B7F95;
}

.expert-box__body {
	padding: 24px;
}

.expert-box__quote {
	font-family: Georgia, 'Times New Roman', serif;
	font-size: 17px;
	font-style: italic;
	line-height: 1.6;
	color: #3A3D52;
}

/* --- блоки внимания --- */
.note-box {
	margin: 26px 0;
	padding: 16px 20px;
	border: 1px solid #E8EAF2;
	border-left: 4px solid #9598A8;
	border-radius: 4px;
	background: #F7F8FC;
}

.note-box__title {
	margin-bottom: 6px;
	font-size: 15px;
	font-weight: 700;
	color: #2F3243;
}

.post__entry .note-box p { margin: 0; }
.post__entry .note-box p + p { margin-top: 10px; }

.note-box--warning { border-left-color: #E2574C; background: #FEF7F6; }
.note-box--warning .note-box__title { color: #C0392B; }

.note-box--tip { border-left-color: #4964C7; background: #F5F7FE; }
.note-box--tip .note-box__title { color: #3A51A8; }

.note-box--fact { border-left-color: #FC0; background: #FFFCF0; }
.note-box--fact .note-box__title { color: #8A6D00; }

/* --- FAQ: аккордеон, как на ibexpert --- */
.faq-box {
	margin: 36px 0;
}

.faq-box__item {
	margin-bottom: 14px;
	padding: 20px 22px;
	border: 1px solid transparent;
	border-radius: 6px;
	background: #F7F8FC;
	cursor: pointer;
	transition: border-color .2s, background .2s, box-shadow .2s;
}

.faq-box__item:last-child { margin-bottom: 0; }
.faq-box__item:hover { border-color: #4964C7; }

.faq-box__question {
	position: relative;
	padding-right: 30px;
	font-size: 17px;
	font-weight: 700;
	line-height: 1.4;
	color: #4964C7;
	user-select: none;
}

.faq-box__question::after {
	content: '▼';
	position: absolute;
	top: 50%;
	right: 0;
	transform: translateY(-50%);
	font-size: 12px;
	opacity: .5;
	transition: transform .3s ease;
}

.faq-box__answer {
	max-height: 0;
	overflow: hidden;
	opacity: 0;
	font-size: 15px;
	line-height: 1.6;
	color: #4A4D63;
	transition: max-height .3s ease, padding .3s ease, opacity .3s ease;
}

.faq-box__item.active {
	border-color: #4964C7;
	background: #FFF;
	box-shadow: 0 4px 15px rgba(0, 0, 0, .05);
}

.faq-box__item.active .faq-box__question::after {
	transform: translateY(-50%) rotate(180deg);
}

.faq-box__item.active .faq-box__answer {
	max-height: 1000px;
	padding-top: 14px;
	opacity: 1;
}

/* --- таблица в статье --- */
.post__entry table.post-table {
	margin: 22px 0;
	border-collapse: collapse;
	font-size: 14px;
}

.post__entry table.post-table th {
	padding: 9px 10px;
	border: 1px solid #E8EAF2;
	background: #F7F8FC;
	font-weight: 700;
	color: #4A4D63;
	text-align: left;
}

.post__entry table.post-table td {
	padding: 9px 10px;
	border: 1px solid #EDEFF7;
	vertical-align: top;
}

@media (max-width: 600px) {
	.expert-box__header { flex-wrap: wrap; }
	.expert-box__avatar { margin-bottom: 12px; }
	.post__entry table.post-table { display: block; overflow-x: auto; }
}
