/**
 * Академия: приёмы подачи урока и схемы.
 *
 * Подключается из includes/academy.php только на уроке, странице трека и
 * /education/. Общий site.css и тему не трогаем.
 */

/* ── Схемы файлами ───────────────────────────────────────────────────────
   С 19.10 схема — отдельный SVG-файл в <img>, а не инлайновый <svg>.
   Рамка и подложка — те же, что были у инлайновой схемы. */
.lc-longread .lc-figure {
	margin: 1.8em 0;
	max-width: 100%;
}

.lc-longread .lc-figure img {
	display: block;
	width: 100%;
	max-width: 100%;
	height: auto;
	border: 1px solid var(--wp--preset--color--ink-300, #232a2e);
	border-radius: 16px;
	background: var(--wp--preset--color--canvas, #0a0d0f);
	padding: 10px 4px;
	box-sizing: border-box;
}

/* Обложка урока — рисунок во всю ширину, без рамки схемы. */
.lc-longread .lc-figure--cover img {
	padding: 0;
	border: 0;
	background: none;
}

/* Мобильный вариант схемы подставляется через <picture> (см. academy.php). */
.lc-longread .lc-figure picture {
	display: block;
	max-width: 100%;
}

/* Схема открывается на весь экран по тапу (assets/lessons/academy.js). */
.lc-longread .lc-figure img.lc-zoomable {
	cursor: zoom-in;
}

.lc-zoom-open,
.lc-zoom-open body {
	overflow: hidden;
}

.lc-zoom {
	position: fixed;
	inset: 0;
	z-index: 100000;
	overflow: auto;
	-webkit-overflow-scrolling: touch;
	display: flex;
	align-items: safe center;
	justify-content: safe center;
	padding: 48px 8px 16px;
	box-sizing: border-box;
	background: rgba(5, 7, 8, 0.96);
	cursor: zoom-out;
}

.lc-zoom__img {
	display: block;
	flex: none;
	width: min(1200px, max(100%, 720px));
	max-width: none;
	height: auto;
	border-radius: 12px;
	background: var(--wp--preset--color--canvas, #0a0d0f);
}

/* Мобильный (вертикальный) вариант — во всю ширину экрана, без прокрутки вбок. */
.lc-zoom--fit .lc-zoom__img {
	width: 100%;
	max-width: 560px;
}

.lc-zoom__close {
	position: fixed;
	top: 8px;
	right: 8px;
	width: 40px;
	height: 40px;
	border: 1px solid var(--wp--preset--color--ink-300, #232a2e);
	border-radius: 50%;
	background: var(--wp--preset--color--surface, #111518);
	color: #f5f8f8;
	font-size: 26px;
	line-height: 36px;
	cursor: pointer;
}

/* №8 (19.10): узкий экран. Колонка урока была 271px из 390: 20px отступ
   страницы + 32px внутренний отступ карточки с каждой стороны. Ужимаем до
   8 + 16, колонка ≈ 342px. Отступы карточки заданы инлайном в шаблоне,
   поэтому !important. */
@media (max-width: 600px) {
	.lc-lesson-page.has-global-padding {
		padding-left: 8px !important;
		padding-right: 8px !important;
	}

	.lc-lesson-card {
		padding-left: 16px !important;
		padding-right: 16px !important;
	}
}

/* №8 (19.10): на телефоне схема ужимается по ширине экрана, без боковой
   прокрутки, а подпись стоит под ней, а не внутри прокручиваемой рамки.
   Тема на узком экране делает .lc-figure прокручиваемым, а svg — 640px:
   здесь это отменяется для уроков. */
@media (max-width: 599px) {
	.lc-longread .lc-figure {
		overflow: visible;
	}

	.lc-longread .lc-figure img,
	.lc-longread .lc-figure svg {
		width: 100%;
		max-width: 100%;
		height: auto;
	}

	.lc-longread .lc-figure figcaption {
		overflow: visible;
		white-space: normal;
	}

	/* Экран телефона на фото больше не прячется: пустой телефон хуже, чем
	   мелкий, но читаемый с увеличением текст. */
	.lc-phone .lc-phone__screen {
		display: flex;
	}
}

/* ── Предупреждение: красная врезка — только для того, что стоит денег. ── */
.lc-note--warn {
	border-left-color: #f87171;
}

.lc-note--warn .lc-note__label {
	color: #f87171;
}

/* ── Таблица сравнения. Обёртка даёт прокрутку на телефоне. ───────────── */
.lc-table {
	margin: 1.8em 0;
	overflow-x: auto;
	border: 1px solid var(--wp--preset--color--ink-300, #232a2e);
	border-radius: 16px;
	background: var(--wp--preset--color--canvas, #0a0d0f);
}

.lc-table table {
	width: 100%;
	min-width: 520px;
	border-collapse: collapse;
	font-size: 0.9375rem;
	line-height: 1.45;
}

.lc-table th,
.lc-table td {
	padding: 12px 16px;
	border-bottom: 1px solid var(--wp--preset--color--ink-300, #232a2e);
	text-align: left;
	vertical-align: top;
}

.lc-table tr:last-child td {
	border-bottom: 0;
}

.lc-table thead th {
	color: var(--wp--preset--color--brand-600, #8df3e2);
	font-size: 0.75rem;
	font-weight: 800;
	letter-spacing: 0.06em;
	text-transform: uppercase;
	background: var(--wp--preset--color--surface, #111518);
}

.lc-table tbody th {
	width: 26%;
	color: var(--wp--preset--color--ink-500, #8e9599);
	font-weight: 600;
}

/* ── Шаги: порядок действий карточками с крупным номером. ─────────────── */
.lc-steps {
	margin: 1.8em 0;
	padding: 0;
	list-style: none;
	counter-reset: lc-step;
	max-width: none;
}

.lc-longread .lc-steps {
	padding-left: 0;
	max-width: none;
}

.lc-steps > li {
	position: relative;
	margin: 0 0 10px;
	padding: 14px 18px 14px 62px;
	border: 1px solid var(--wp--preset--color--ink-300, #232a2e);
	border-radius: 14px;
	background: var(--wp--preset--color--canvas, #0a0d0f);
	counter-increment: lc-step;
}

.lc-steps > li::before {
	content: counter(lc-step);
	position: absolute;
	left: 16px;
	top: 14px;
	width: 30px;
	height: 30px;
	border-radius: 50%;
	background: #0c2321;
	border: 1.5px solid var(--wp--preset--color--brand-500, #5eead4);
	color: var(--wp--preset--color--brand-600, #8df3e2);
	font-size: 0.875rem;
	font-weight: 800;
	line-height: 28px;
	text-align: center;
}

.lc-steps > li strong:first-child {
	display: block;
	margin-bottom: 2px;
}

/* ── Две колонки «так / не так», «плюсы / минусы». ────────────────────── */
.lc-duo {
	display: grid;
	grid-template-columns: 1fr 1fr;
	gap: 12px;
	margin: 1.8em 0;
}

.lc-duo__col {
	padding: 16px 18px;
	border: 1px solid var(--wp--preset--color--ink-300, #232a2e);
	border-top: 3px solid var(--wp--preset--color--ink-300, #232a2e);
	border-radius: 14px;
	background: var(--wp--preset--color--canvas, #0a0d0f);
	font-size: 0.9375rem;
	line-height: 1.5;
}

.lc-duo__col--ok {
	border-top-color: #4ade80;
}

.lc-duo__col--bad {
	border-top-color: #f87171;
}

.lc-duo__col--a {
	border-top-color: var(--wp--preset--color--brand-500, #5eead4);
}

.lc-duo__label {
	margin: 0 0 8px;
	font-size: 0.75rem;
	font-weight: 800;
	letter-spacing: 0.06em;
	text-transform: uppercase;
	color: var(--wp--preset--color--ink-500, #8e9599);
}

.lc-duo__col--ok .lc-duo__label {
	color: #4ade80;
}

.lc-duo__col--bad .lc-duo__label {
	color: #f87171;
}

.lc-duo__col--a .lc-duo__label {
	color: var(--wp--preset--color--brand-600, #8df3e2);
}

.lc-duo__title {
	margin: 0 0 8px;
	font-size: 1.0625rem;
	font-weight: 700;
}

.lc-longread .lc-duo ul {
	margin: 0;
	padding-left: 1.1em;
	max-width: none;
}

.lc-duo p {
	margin: 0 0 6px;
}

/* ── «Что важно в России»: норма, практика и мнение редакции — раздельно. ── */
.lc-ru {
	display: grid;
	grid-template-columns: repeat(3, 1fr);
	gap: 12px;
	margin: 1.4em 0 1.8em;
}

.lc-ru__item {
	padding: 16px 18px;
	border: 1px solid var(--wp--preset--color--ink-300, #232a2e);
	border-radius: 14px;
	background: var(--wp--preset--color--ink-100, #161b1f);
	font-size: 0.9375rem;
	line-height: 1.55;
}

.lc-ru__label {
	margin: 0 0 8px;
	color: var(--wp--preset--color--brand-600, #8df3e2);
	font-size: 0.75rem;
	font-weight: 800;
	letter-spacing: 0.06em;
	text-transform: uppercase;
}

.lc-ru__item p {
	margin: 0 0 8px;
}

.lc-ru__item p:last-child {
	margin-bottom: 0;
}

/* ── Словарик урока. ─────────────────────────────────────────────────── */
.lc-terms {
	margin: 1.8em 0;
	padding: 6px 20px;
	border: 1px solid var(--wp--preset--color--ink-300, #232a2e);
	border-radius: 16px;
}

.lc-terms div {
	display: grid;
	grid-template-columns: 180px 1fr;
	gap: 16px;
	padding: 12px 0;
	border-bottom: 1px solid var(--wp--preset--color--ink-300, #232a2e);
	font-size: 0.9375rem;
	line-height: 1.5;
}

.lc-terms div:last-child {
	border-bottom: 0;
}

.lc-terms dt {
	font-weight: 700;
}

.lc-terms dd {
	margin: 0;
	color: var(--wp--preset--color--ink-500, #8e9599);
}

/* ── «Что читать дальше» карточками. ─────────────────────────────────── */
.lc-links {
	display: grid;
	grid-template-columns: repeat(3, 1fr);
	gap: 12px;
	margin: 1.2em 0 1.8em;
}

.lc-links a {
	display: block;
	padding: 14px 16px;
	border: 1px solid var(--wp--preset--color--ink-300, #232a2e);
	border-radius: 14px;
	color: inherit;
	font-size: 0.9375rem;
	font-weight: 600;
	line-height: 1.35;
	text-decoration: none;
}

.lc-links a:hover {
	border-color: var(--wp--preset--color--brand-500, #5eead4);
}

.lc-links a span {
	display: block;
	margin-bottom: 6px;
	color: var(--wp--preset--color--brand-600, #8df3e2);
	font-size: 0.6875rem;
	font-weight: 800;
	letter-spacing: 0.06em;
	text-transform: uppercase;
}

/* На телефоне таблица не прокручивается вбок: третья колонка пряталась за
   краем. Колонки ужимаются, текст переносится. */
@media (max-width: 600px) {
	.lc-table table {
		min-width: 0;
		font-size: 0.8125rem;
		hyphens: auto;
	}

	.lc-table th,
	.lc-table td {
		padding: 10px 8px;
	}

	.lc-table tbody th {
		width: auto;
	}
}

@media (max-width: 699px) {
	.lc-duo,
	.lc-ru,
	.lc-links {
		grid-template-columns: 1fr;
	}

	.lc-terms div {
		grid-template-columns: 1fr;
		gap: 2px;
	}
}

/* Дисклеймер под карточкой «Что важно запомнить» не должен к ней прилипать. */
.lc-longread > .lc-summary + p {
	margin-top: 1.4em;
	font-size: 0.9375rem;
	color: var(--wp--preset--color--ink-500, #8e9599);
}

/* ── №13 (19.10): пустой трек на /education/ — плашка «Скоро», не ссылка. ── */
.lc-track--soon {
	opacity: 0.55;
	cursor: default;
}

.lc-track--soon:hover,
.lc-track--soon:focus-visible {
	border-color: var(--wp--preset--color--ink-300, #232a2e);
	transform: none;
}

.lc-track--soon .lc-track__meta {
	color: var(--wp--preset--color--brand-600, #8df3e2);
	font-weight: 700;
	letter-spacing: 0.04em;
	text-transform: uppercase;
}
