/* ==========================================================================
   history.css — два адреса раздела «История»:

     /history/              (history.tpl)         — шапка, таймлайн, архив;
     /history/result/{год}/ (history_result.tpl)  — матчи одного года.

   Файл один на оба, потому что общего между ними больше, чем разного:
   тёмная шапка, сетка годов и типографика секций. Правила, которые нужны
   только странице года, собраны в конце отдельным разделом.

   ИСТОЧНИК — html_flat/starco_history_concept.html. Из дословного куска
   (migrate/css_draft/history.css) убраны 48 правил, уже лежащих в base.css,
   а также шапка, подвал, бегущая строка, .reveal и брейкпоинты общих узлов:
   всё это общее и живёт в base.css.

   ЧЕГО ЗДЕСЬ НЕТ ИЗ КОНЦЕПТА. Секция «География команды» (облако из ста с
   лишним городов с фильтром) не перенесена: под неё нет ни таблицы, ни
   разумного способа набить сотню строк блоками. Видеоархив тоже: ролики
   живут на /video/, и три карточки-дубля с той же ссылкой пользы не дают.
   ========================================================================== */

:root {
	/* Архивный снимок в шапке. Лежит в files/misc/ — это загруженный файл,
	   а не ассет темы: его меняют через админку (Файлы/картинки), и тогда
	   имя здесь надо поправить. Держим переменной, чтобы правка была одна. */
	--history-image: url('/files/misc/history-image.77d6fb09.jpg');
}

/* --------------------------------------------------------------- секции -- */
/* .section / .section-title / .section-copy различаются от концепта к
   концепту (у истории заголовок крупнее, чем на /matchmaking/), поэтому
   они постраничные, а не в base.css. */
.section { padding: 110px 0; }

.section-title {
	margin: 16px 0 24px;
	font-size: clamp(42px, 5vw, 78px);
	line-height: .94;
	letter-spacing: -.055em;
	font-weight: 950;
	text-transform: uppercase;
	text-wrap: balance;
}
.section-copy {
	max-width: 780px;
	font-size: 18px;
	line-height: 1.7;
	color: #536176;
}

/* Ховеры кнопок в base.css не попали (их нет в каноническом концепте), а
   нужны они на каждой странице. Правило общее, но править base.css из
   постраничной задачи нельзя — см. отчёт фазы 10. */
.btn-red:hover { transform: translateY(-2px); background: #bd0710; }
.btn-outline:hover { border-color: var(--blue); transform: translateY(-2px); }

/* ----------------------------------------------------------------- шапка -- */
/* .page-head — тема называет так то, что в концепте зовётся .hero. Шапка
   сайта position:fixed и белая по тексту, поэтому первый экран ОБЯЗАН быть
   тёмным: на светлом фоне меню и хлебные крошки пропадут. */
.page-head {
	position: relative;
	overflow: hidden;
	padding: 170px 0 96px;
	min-height: 820px;
	color: #fff;
	background:
		radial-gradient(circle at 82% 16%, rgba(230, 192, 76, .18), transparent 20%),
		linear-gradient(128deg, var(--navy2) 0%, var(--navy) 48%, #0b4f8b 100%);
}
/* Диагональная штриховка и год-призрак — чистая декорация, поэтому
   pointer-events:none: иначе они перехватывали бы клики по кнопкам. */
.page-head:before {
	content: "";
	position: absolute;
	inset: 0;
	pointer-events: none;
	background: repeating-linear-gradient(118deg, transparent 0 88px, rgba(255, 255, 255, .025) 89px 90px);
}
.page-head:after {
	content: "1991";
	position: absolute;
	right: -45px;
	bottom: -90px;
	pointer-events: none;
	font-size: clamp(250px, 27vw, 480px);
	font-weight: 950;
	line-height: .75;
	letter-spacing: -.11em;
	color: transparent;
	-webkit-text-stroke: 2px rgba(255, 255, 255, .065);
}

.page-head .container { position: relative; z-index: 2; }

.hero-grid {
	position: relative;
	z-index: 2;
	display: grid;
	grid-template-columns: .88fr 1.12fr;
	gap: 70px;
	align-items: center;
}
.hero-copy { position: relative; }
.hero-copy h1 {
	margin: 18px 0 30px;
	font-size: clamp(70px, 8.7vw, 142px);
	line-height: .76;
	letter-spacing: -.075em;
	font-weight: 950;
	text-transform: uppercase;
	text-wrap: balance;
}

/* Вводный текст страницы — единственное место, куда попадает HTML из
   TinyMCE, поэтому оформляем не только абзацы. */
.page-intro { max-width: 650px; font-size: 19px; line-height: 1.65; color: rgba(255, 255, 255, .76); }
.page-intro p { margin: 0 0 14px; }
.page-intro a { color: #fff; text-decoration: underline; }

.hero-actions { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 34px; }

/* -------------------------------------------------------- рамка со снимком */
.hero-art { position: relative; min-height: 530px; }
.history-frame {
	position: absolute;
	inset: 25px 0 30px;
	overflow: hidden;
	border: 1px solid rgba(255, 255, 255, .14);
	border-radius: 30px;
	background: #0b467d;
	box-shadow: 0 40px 90px rgba(0, 0, 0, .42);
	transform: rotate(-2deg);
}
.history-frame:before {
	content: "";
	position: absolute;
	inset: 0;
	background-image: var(--history-image);
	background-size: cover;
	background-position: center;
	filter: saturate(.92) contrast(1.03);
}
/* Затемнение снизу: под ним лежит карточка года, на светлом кадре её текст
   иначе теряется. */
.history-frame:after {
	content: "";
	position: absolute;
	inset: 0;
	background: linear-gradient(180deg, transparent 52%, rgba(4, 29, 61, .58));
}

.hero-year-card {
	position: absolute;
	left: -18px;
	bottom: 8px;
	z-index: 4;
	max-width: 260px;
	padding: 20px 22px;
	border-radius: 18px;
	background: var(--red);
	color: #fff;
	box-shadow: 0 18px 45px rgba(0, 0, 0, .32);
	transform: rotate(4deg);
}
.hero-year-card b { display: block; font-size: 34px; line-height: .95; letter-spacing: -.03em; }
.hero-year-card span {
	display: block;
	margin-top: 8px;
	font-size: 11px;
	line-height: 1.35;
	font-weight: 900;
	letter-spacing: .12em;
	text-transform: uppercase;
}

/* ------------------------------------------------------------- основатели */
.origin {
	position: relative;
	overflow: hidden;
	background: linear-gradient(135deg, #fff 0%, #f8f4e9 50%, #eef5fb 100%);
}
.origin:before {
	content: "";
	position: absolute;
	right: -310px;
	top: -280px;
	width: 620px;
	height: 620px;
	border: 90px solid rgba(7, 62, 120, .04);
	border-radius: 50%;
}
.origin .container { position: relative; z-index: 2; }

.founders {
	display: grid;
	grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
	gap: 12px;
	margin-top: 34px;
}
.founder {
	padding: 18px;
	border: 1px solid var(--line);
	border-radius: 18px;
	background: rgba(255, 255, 255, .75);
}
.founder strong { display: block; font-size: 17px; color: var(--navy); }
.founder span { display: block; margin-top: 7px; font-size: 12px; line-height: 1.4; color: var(--muted); }

/* ---------------------------------------------------------------- таймлайн */
.timeline-section {
	position: relative;
	overflow: hidden;
	background: var(--navy2);
	color: #fff;
}
.timeline-section:before {
	content: "";
	position: absolute;
	inset: 0;
	background:
		radial-gradient(circle at 85% 15%, rgba(217, 8, 18, .14), transparent 24%),
		radial-gradient(circle at 10% 78%, rgba(7, 97, 169, .2), transparent 25%);
}
.timeline-section .container { position: relative; z-index: 2; }
.timeline-section .eyebrow { color: #b7dcff; }
.timeline-section .section-copy { color: rgba(255, 255, 255, .66); }
/* .empty-state в base.css серый по светлому — на тёмной секции его почти
   не видно. */
.timeline-section .empty-state { color: rgba(255, 255, 255, .7); }

.timeline-intro {
	display: grid;
	grid-template-columns: .9fr 1.1fr;
	gap: 70px;
	align-items: end;
	margin-bottom: 70px;
}

.timeline { display: grid; gap: 18px; }
.milestone {
	display: grid;
	grid-template-columns: 170px 1fr 245px;
	gap: 28px;
	align-items: start;
	padding: 30px 0;
	border-top: 1px solid rgba(255, 255, 255, .12);
	transition: .3s;
}
.milestone:hover { padding-left: 18px; border-color: rgba(230, 192, 76, .55); }

.milestone-year {
	font-size: 52px;
	font-weight: 950;
	line-height: .9;
	letter-spacing: -.05em;
	color: var(--gold);
}
.milestone-body h3 { margin: 0 0 10px; font-size: 25px; letter-spacing: -.03em; }
.milestone-body p { margin: 0; max-width: 760px; font-size: 16px; line-height: 1.65; color: rgba(255, 255, 255, .68); }

/* Картинка вехи в концепте не предусмотрена, но поле s_history.image есть и
   заполняется в админке. Кладём над текстом узкой полосой, чтобы строка
   таймлайна не «поехала». */
.milestone-image {
	display: block;
	width: 100%;
	max-width: 420px;
	margin: 0 0 14px;
	border-radius: 14px;
	aspect-ratio: 3 / 2;
	object-fit: cover;
}

.milestone-tag {
	justify-self: end;
	text-align: right;
	font-size: 11px;
	font-weight: 900;
	letter-spacing: .11em;
	text-transform: uppercase;
	color: #cce6ff;
}
.milestone-tag b {
	display: block;
	margin-bottom: 5px;
	font-size: 28px;
	letter-spacing: -.03em;
	text-transform: none;
	color: #fff;
}

/* --------------------------------------------------------- цифры «за людей» */
.impact { background: #fff; }
.impact-head {
	display: grid;
	grid-template-columns: .92fr 1.08fr;
	gap: 70px;
	align-items: end;
	margin-bottom: 48px;
}
/* Первая карточка крупная, вторая красная — остальные обычные. Раскраска
   идёт от порядка блоков, класс вешает шаблон. */
.impact-grid {
	display: grid;
	grid-template-columns: 1.1fr .9fr .9fr;
	gap: 14px;
}
.impact-card {
	position: relative;
	overflow: hidden;
	display: flex;
	flex-direction: column;
	justify-content: space-between;
	min-height: 240px;
	padding: 30px;
	border: 1px solid var(--line);
	border-radius: 26px;
	background: #fff;
}
.impact-card.primary {
	grid-row: 1 / 3;
	min-height: 494px;
	border: 0;
	background: linear-gradient(150deg, var(--blue), #0b66ad);
	color: #fff;
}
.impact-card.red {
	border: 0;
	background: linear-gradient(145deg, #ba0810, var(--red2));
	color: #fff;
}
.impact-card:after {
	content: "★";
	position: absolute;
	right: 22px;
	top: 15px;
	font-size: 76px;
	color: rgba(7, 62, 120, .05);
}
.impact-card.primary:after, .impact-card.red:after { color: rgba(255, 255, 255, .07); }

.impact-number { font-size: clamp(58px, 6vw, 98px); font-weight: 950; line-height: .8; letter-spacing: -.07em; }
.impact-label { max-width: 280px; font-size: 19px; font-weight: 900; line-height: 1.25; }
.impact-note { margin: 14px 0 0; font-size: 13px; line-height: 1.5; color: var(--muted); }
.primary .impact-note, .red .impact-note { color: rgba(255, 255, 255, .7); }

/* ------------------------------------------------------------ архив годов -- */
.results { background: #fff; }
.results-grid {
	display: grid;
	grid-template-columns: .74fr 1.26fr;
	gap: 70px;
	align-items: start;
}

.year-grid {
	display: grid;
	grid-template-columns: repeat(4, 1fr);
	gap: 10px;
	margin: 0;
	padding: 0;
	list-style: none;
}
.year-link {
	display: flex;
	flex-direction: column;
	justify-content: space-between;
	min-height: 90px;
	padding: 16px;
	border: 1px solid var(--line);
	border-radius: 18px;
	font-size: 23px;
	font-weight: 950;
	color: var(--navy);
	transition: .25s;
}
.year-link small {
	font-size: 10px;
	font-weight: 900;
	letter-spacing: .11em;
	text-transform: uppercase;
	color: var(--blue);
}
a.year-link:hover { background: var(--blue); color: #fff; transform: translateY(-3px); }
a.year-link:hover small { color: #cce6ff; }

/* -------------------------------------------------------------- финальный CTA */
.final-cta {
	position: relative;
	overflow: hidden;
	padding: 80px 0;
	background: linear-gradient(125deg, var(--red), #b7080f 56%, #071d35);
	color: #fff;
}
.final-cta:after {
	content: "★";
	position: absolute;
	right: 2%;
	top: -55px;
	font-size: 280px;
	line-height: 1;
	font-weight: 950;
	color: rgba(255, 255, 255, .06);
}
.final-grid {
	position: relative;
	z-index: 2;
	display: grid;
	grid-template-columns: 1fr auto;
	gap: 40px;
	align-items: center;
}
.final-cta h2 {
	margin: 0 0 16px;
	font-size: clamp(42px, 6vw, 78px);
	line-height: .9;
	letter-spacing: -.06em;
	text-transform: uppercase;
}
.final-cta p { max-width: 720px; font-size: 17px; line-height: 1.6; color: rgba(255, 255, 255, .76); }

/* ==========================================================================
   Страница года: /history/result/{год}/ (history_result.tpl)

   Своего концепта у неё нет — на доноре это была голая таблица. Берём язык
   истории: та же тёмная шапка (в укороченном варианте), та же сетка годов
   строкой и список матчей карточками, а не <table>: на телефоне таблица из
   шести колонок нечитаема.
   ========================================================================== */

/* Шапка без картинки и без года-призрака: на странице года цифра «1991» в
   фоне спорила бы с настоящим годом в заголовке. */
.page-head.is-compact { min-height: 0; padding: 150px 0 64px; }
.page-head.is-compact:after { content: none; }
.page-head.is-compact h1 {
	margin: 14px 0 12px;
	font-size: clamp(48px, 7vw, 96px);
	line-height: .84;
	letter-spacing: -.06em;
	font-weight: 950;
	text-transform: uppercase;
}

.hero-kicker {
	display: flex;
	align-items: center;
	gap: 12px;
	flex-wrap: wrap;
	margin: 0;
	font-size: 12px;
	font-weight: 900;
	letter-spacing: .12em;
	text-transform: uppercase;
	color: #cce6ff;
}
.hero-kicker strong { padding: 8px 12px; border-radius: 999px; background: var(--red); color: #fff; }

.results-year { padding-top: 64px; }

/* Полоса годов: та же плитка, но авто-ширины и в одну строку с переносом. */
.year-strip {
	grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
	margin-bottom: 44px;
}
.year-strip .year-link { min-height: 72px; font-size: 20px; }
.year-strip .is-active {
	border-color: var(--navy);
	background: var(--navy);
	color: #fff;
	cursor: default;
}
.year-strip .is-active small { color: rgba(255, 255, 255, .6); }

/* ------------------------------------------------------------ список матчей */
.match-list { display: grid; gap: 10px; }
.match-row {
	display: grid;
	grid-template-columns: 150px 1fr auto;
	gap: 24px;
	align-items: center;
	padding: 22px 24px;
	border: 1px solid var(--line);
	border-radius: 18px;
	background: #fff;
	transition: .25s;
}
.match-row:hover { border-color: rgba(7, 62, 120, .3); box-shadow: 0 12px 30px rgba(3, 28, 57, .08); }

.match-date {
	font-size: 13px;
	font-weight: 900;
	letter-spacing: .08em;
	text-transform: uppercase;
	color: var(--blue);
}
.match-opponent { margin: 0 0 6px; font-size: 22px; letter-spacing: -.02em; color: var(--navy); }
.match-main p { margin: 0 0 4px; font-size: 14px; line-height: 1.5; color: var(--muted); }
.match-main p:last-child { margin-bottom: 0; }
.match-main .match-tournament { font-weight: 800; color: var(--blue); }
.match-scorers span { font-weight: 900; color: var(--ink); }

/* Счёт — самый крупный элемент строки: за ним и приходят в архив. */
.match-score {
	justify-self: end;
	padding: 10px 18px;
	border-radius: 14px;
	background: var(--cream);
	font-size: 26px;
	font-weight: 950;
	letter-spacing: -.03em;
	color: var(--navy);
	white-space: nowrap;
}

.results-back { margin: 44px 0 0; }

/* ------------------------------------------------------------ брейкпоинты -- */
/* ==========================================================================
   ГЕОГРАФИЯ КОМАНДЫ (/history/#geography)

   Перенесено из starco_history_concept.html. Два отличия от концепта, оба
   вынужденные:

   1. Активный чип — .is-active, а не .active. Так его помечает общий
      design/t1/js/filter.js; своего скрипта у секции больше нет.
   2. Скрытая карточка — атрибут hidden, а не класс .hidden. filter.js
      прячет элементы свойством item.hidden, а правило [hidden] уже поднято
      в base.css. Правило .city-tag.hidden из концепта не переносим: класс
      никто не ставит, оно было бы мёртвым.
   ========================================================================== */

.geography { position: relative; overflow: hidden; background: #f8fafc; }

.geo-head {
	display: grid;
	grid-template-columns: .9fr 1.1fr;
	gap: 70px;
	align-items: end;
}

.geo-controls { display: flex; flex-wrap: wrap; gap: 8px; margin: 32px 0 18px; }

.geo-btn {
	padding: 11px 16px;
	border: 1px solid var(--line);
	border-radius: 999px;
	background: #fff;
	color: var(--blue);
	font-size: 12px;
	font-weight: 900;
	cursor: pointer;
}
.geo-btn.is-active { background: var(--blue); color: #fff; }

.geo-search {
	width: 100%;
	max-width: 520px;
	padding: 15px 18px;
	border: 1px solid var(--line);
	border-radius: 18px;
	background: #fff;
	color: var(--ink);
	outline: none;
}
.geo-search:focus { border-color: var(--blue); }

.city-cloud { display: flex; flex-wrap: wrap; gap: 9px; margin-top: 28px; }

.city-tag {
	display: inline-flex;
	padding: 10px 13px;
	border: 1px solid rgba(7, 62, 120, .12);
	border-radius: 999px;
	background: #fff;
	color: #30465d;
	font-size: 12px;
	font-weight: 800;
	transition: .2s;
}
.city-tag:hover { background: var(--navy); color: #fff; transform: translateY(-2px); }

.geo-counter { margin-top: 22px; color: var(--muted); font-size: 13px; }
.geo-counter b { color: var(--red); }

@media (max-width: 1180px) {
	.geo-head { grid-template-columns: 1fr; gap: 28px; }
	.hero-grid,
	.impact-head,
	.results-grid { grid-template-columns: 1fr; }

	.hero-art { min-height: 470px; }
	.impact-grid { grid-template-columns: 1fr 1fr; }
	.impact-card.primary { grid-row: auto; grid-column: 1 / -1; min-height: 330px; }
	.milestone { grid-template-columns: 130px 1fr 170px; }
}

@media (max-width: 820px) {
	.section { padding: 80px 0; }
	.page-head { min-height: 0; padding: 140px 0 72px; }
	.page-head.is-compact { padding: 130px 0 52px; }
	.hero-grid { gap: 40px; }
	.hero-art { min-height: 360px; }
	.history-frame { inset: 15px 0; }
	.hero-year-card { left: 8px; }

	.timeline-intro { grid-template-columns: 1fr; gap: 20px; margin-bottom: 40px; }
	.milestone { grid-template-columns: 95px 1fr; gap: 18px; }
	.milestone-tag { grid-column: 2; justify-self: start; text-align: left; }

	.impact-grid { grid-template-columns: 1fr; }
	.impact-card.primary { grid-column: auto; }

	.year-grid { grid-template-columns: repeat(3, 1fr); }
	.final-grid { grid-template-columns: 1fr; }

	.match-row { grid-template-columns: 1fr auto; }
	.match-date { grid-column: 1 / -1; }
}

@media (max-width: 560px) {
	.page-head { padding-top: 120px; }
	.hero-copy h1 { font-size: 58px; }
	.page-intro { font-size: 16px; }
	.hero-art { min-height: 280px; }
	.hero-year-card b { font-size: 28px; }

	.milestone { grid-template-columns: 1fr; }
	.milestone-tag { grid-column: auto; }
	.milestone:hover { padding-left: 0; }
	.milestone-year { font-size: 40px; }

	.impact-card { min-height: 220px; }
	.year-grid { grid-template-columns: repeat(2, 1fr); }

	.match-row { grid-template-columns: 1fr; gap: 12px; }
	.match-score { justify-self: start; }
}
