/*
Theme Name: Apple IT Center
Description: Тема для IT-центра в духе Apple Human Interface Guidelines: системный шрифт, светлая и тёмная темы, полупрозрачная навигация, крупная типографика. Преподаватели с курсами, новости, заявки на обучение внутри WordPress, редактор главной страницы в Customizer.
Version: 1.0.0
Requires at least: 6.3
Requires PHP: 7.4
License: GPL-2.0-or-later
Text Domain: aitc
*/

:root {
	--blue: #007aff;
	--bg: #ffffff;
	--bg2: #f5f5f7;
	--card: #ffffff;
	--label: #1d1d1f;
	--label2: #6e6e73;
	--sep: rgba(60, 60, 67, .16);
	--fill: rgba(120, 120, 128, .12);
	--nav: rgba(255, 255, 255, .72);
	--green: #248a3d;
	--red: #d70015;
	--radius: 20px;
	--ease: cubic-bezier(.25, .1, .25, 1);
	--font: -apple-system, BlinkMacSystemFont, "SF Pro Text", "SF Pro Display", "Helvetica Neue", "Segoe UI", Roboto, "Noto Sans", Arial, sans-serif;
}
@media (prefers-color-scheme: dark) {
	:root {
		--blue: #0a84ff;
		--bg: #000000; --bg2: #1c1c1e; --card: #2c2c2e;
		--label: #f5f5f7; --label2: #98989d;
		--sep: rgba(84, 84, 88, .55); --fill: rgba(120, 120, 128, .24);
		--nav: rgba(22, 22, 23, .72);
		--green: #30d158; --red: #ff453a;
	}
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; scroll-padding-top: 72px; }
body {
	margin: 0; background: var(--bg); color: var(--label);
	font: 400 17px/1.47 var(--font); letter-spacing: -.011em;
	-webkit-font-smoothing: antialiased; text-rendering: optimizeLegibility;
}
img { max-width: 100%; height: auto; display: block; }
a { color: var(--blue); text-decoration: none; }
a:hover { text-decoration: underline; }
:focus-visible { outline: 3px solid color-mix(in srgb, var(--blue) 55%, transparent); outline-offset: 2px; border-radius: 6px; }
[hidden] { display: none !important; }
h1, h2, h3 { margin: 0; line-height: 1.1; letter-spacing: -.022em; }
p { margin: 0 0 1em; }
ul { margin: 0; padding: 0; list-style: none; }

.skip-link { position: absolute; left: -999px; top: 8px; background: var(--blue); color: #fff; padding: 10px 16px; border-radius: 10px; z-index: 100; }
.skip-link:focus { left: 12px; }
.screen-reader-text { position: absolute !important; clip: rect(1px,1px,1px,1px); width: 1px; height: 1px; overflow: hidden; }

.container { width: 100%; max-width: 1120px; margin: 0 auto; padding: 0 22px; }
.container--narrow { max-width: 720px; }

/* ---------- Навигация (материал «Regular» с размытием) ---------- */
.site-header {
	position: sticky; top: 0; z-index: 50; background: var(--nav);
	-webkit-backdrop-filter: saturate(180%) blur(20px); backdrop-filter: saturate(180%) blur(20px);
	border-bottom: 1px solid transparent; transition: border-color .25s var(--ease);
}
.site-header.is-scrolled { border-bottom-color: var(--sep); }
.nav { display: flex; align-items: center; gap: 20px; min-height: 52px; }
.brand { color: var(--label); font-weight: 600; font-size: 19px; letter-spacing: -.02em; margin-right: auto; display: flex; align-items: center; }
.brand:hover { text-decoration: none; }
.brand img { max-height: 32px; width: auto; }
.primary-nav .menu { display: flex; gap: 4px; }
.primary-nav a { display: block; padding: 8px 12px; color: var(--label); font-size: 14px; border-radius: 980px; opacity: .8; }
.primary-nav a:hover { opacity: 1; text-decoration: none; background: var(--fill); }
.primary-nav .current-menu-item > a { opacity: 1; font-weight: 600; }

.nav-toggle { display: none; width: 44px; height: 44px; margin-right: -12px; background: none; border: 0; cursor: pointer; position: relative; }
.nav-toggle span { position: absolute; left: 13px; right: 13px; height: 1.5px; background: var(--label); border-radius: 2px; transition: transform .3s var(--ease), top .3s var(--ease); }
.nav-toggle span:first-child { top: 18px; }
.nav-toggle span:last-child { top: 25px; }
.nav-open .nav-toggle span:first-child { top: 21px; transform: rotate(45deg); }
.nav-open .nav-toggle span:last-child { top: 21px; transform: rotate(-45deg); }

@media (max-width: 820px) {
	.nav-toggle { display: block; }
	.nav { gap: 8px; }
	.primary-nav {
		position: absolute; left: 0; right: 0; top: 52px; display: none; padding: 8px 22px 24px;
		background: var(--bg); border-bottom: 1px solid var(--sep);
	}
	.nav-open .primary-nav { display: block; }
	.primary-nav .menu { flex-direction: column; gap: 0; }
	.primary-nav a { font-size: 21px; padding: 14px 0; border-radius: 0; border-bottom: 1px solid var(--sep); opacity: 1; }
	.primary-nav a:hover { background: none; }
}

/* ---------- Кнопки ---------- */
.btn {
	display: inline-flex; align-items: center; justify-content: center; min-height: 44px; padding: 0 24px;
	border: 0; border-radius: 980px; background: var(--blue); color: #fff; font: 400 17px/1 var(--font);
	cursor: pointer; transition: filter .2s var(--ease), transform .2s var(--ease);
}
.btn:hover { filter: brightness(1.1); text-decoration: none; }
.btn:active { transform: scale(.98); filter: brightness(.9); }
.btn--secondary { background: color-mix(in srgb, var(--blue) 12%, transparent); color: var(--blue); }
.btn--sm { min-height: 36px; padding: 0 16px; font-size: 14px; }
.btn--block { width: 100%; margin-top: 20px; }
.actions { display: flex; flex-wrap: wrap; gap: 12px; justify-content: center; margin: 0; }

/* ---------- Типографика ---------- */
.lead { font-size: clamp(19px, 2.2vw, 24px); line-height: 1.3; letter-spacing: -.015em; color: var(--label2); }
.muted { color: var(--label2); }
.small { font-size: 14px; }
.role { font-weight: 600; color: var(--label); margin: 0 0 .25em; }
.label { font-size: 13px; font-weight: 600; color: var(--label2); margin: 0 0 8px; }
.eyebrow { font-size: 21px; font-weight: 600; margin-bottom: 8px; }
.link-more { font-size: 17px; white-space: nowrap; }

/* ---------- Блоки ---------- */
.section { padding: 80px 0; background: var(--bg); }
.section--grouped { background: var(--bg2); }
.section--tight { padding: 0 0 80px; }
.section-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 24px; margin-bottom: 40px; }
.section-head h2 { font-size: clamp(32px, 4.4vw, 48px); font-weight: 700; }
.section-head .lead { margin: 12px 0 0; max-width: 560px; }
.container--narrow .section-head { display: block; text-align: center; }
.container--narrow .section-head .lead { margin-left: auto; margin-right: auto; }
.page-header { padding: 72px 0 40px; background: var(--bg); }
.page-header h1 { font-size: clamp(40px, 6vw, 64px); font-weight: 700; letter-spacing: -.03em; }
.page-header .lead { margin: 16px 0 0; max-width: 620px; }
.page-body { padding-top: 48px; }
.empty { color: var(--label2); text-align: center; padding: 32px 0; }

/* Hero */
.hero { padding: 88px 0 64px; text-align: center; }
.hero h1 { font-size: clamp(44px, 8vw, 80px); font-weight: 700; letter-spacing: -.035em; line-height: 1.04; max-width: 14ch; margin: 0 auto 20px; }
.hero .lead { max-width: 640px; margin: 0 auto 32px; }
.hero-image { margin: 56px auto 0; max-width: 1000px; border-radius: 28px; overflow: hidden; }
.hero-image img { width: 100%; }

/* Цифры */
.stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 24px; margin: 0; text-align: center; }
.stats dt { font-size: clamp(32px, 4.4vw, 48px); font-weight: 700; letter-spacing: -.03em; line-height: 1.1; }
.stats dd { margin: 6px 0 0; color: var(--label2); font-size: 15px; }
@media (max-width: 700px) { .stats { grid-template-columns: repeat(2, 1fr); row-gap: 32px; } }

/* ---------- Карточки ---------- */
.grid { display: grid; gap: 20px; }
.grid--courses { grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); }
.grid--teachers { grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); }
.grid--teachers-detail { grid-template-columns: repeat(auto-fill, minmax(min(100%, 340px), 1fr)); }
.grid--news { grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); }

.card { display: flex; flex-direction: column; background: var(--bg2); border-radius: var(--radius); overflow: hidden; transition: transform .35s var(--ease), box-shadow .35s var(--ease); }
.section--grouped .card { background: var(--card); }
.card:hover { transform: translateY(-3px); box-shadow: 0 12px 32px rgba(0, 0, 0, .1); }
.card-body { padding: 22px 24px 26px; display: flex; flex-direction: column; flex: 1; }
.card h3 { font-size: 21px; font-weight: 600; letter-spacing: -.02em; margin-bottom: 8px; }
.card h3 a { color: var(--label); }
.card h3 a:hover { color: var(--blue); text-decoration: none; }
.card .muted { margin-bottom: 12px; font-size: 15px; }
.card-media { display: block; aspect-ratio: 8 / 5; overflow: hidden; background: var(--fill); }
.card-media img { width: 100%; height: 100%; object-fit: cover; }
.media-ph { display: grid; place-items: center; height: 100%; font: 600 40px/1 ui-monospace, SFMono-Regular, Menlo, monospace; color: #fff; background: linear-gradient(135deg, #64d2ff, #0a84ff 55%, #5e5ce6); }
.chips { display: flex; flex-wrap: wrap; gap: 6px; margin: auto 0 0; padding-top: 4px; }
.chip { font-size: 13px; line-height: 1; padding: 7px 11px; border-radius: 980px; background: var(--fill); color: var(--label2); }
.price { margin: 12px 0 0; font-weight: 600; }

/* Преподаватели */
.teacher-photo { display: block; aspect-ratio: 4 / 5; background: var(--fill); overflow: hidden; }
.teacher-photo img { width: 100%; height: 100%; object-fit: cover; }
.avatar-ph { display: grid; place-items: center; height: 100%; font-size: 64px; font-weight: 600; letter-spacing: -.02em; color: #fff; background: linear-gradient(160deg, #64d2ff, #0a84ff 55%, #5e5ce6); }
.grid--teachers-detail .teacher-card { flex-direction: column; }
.teacher-courses { margin-top: auto; padding-top: 16px; border-top: 1px solid var(--sep); }
.teacher-courses li { padding: 10px 0; border-bottom: 1px solid var(--sep); }
.teacher-courses li:last-child { border-bottom: 0; padding-bottom: 0; }
.teacher-courses a { display: block; font-weight: 600; font-size: 16px; }
.teacher-courses span { display: block; font-size: 14px; line-height: 1.4; color: var(--label2); margin-top: 2px; }

.profile { display: grid; grid-template-columns: minmax(220px, 340px) 1fr; gap: 56px; align-items: start; }
.profile-photo { aspect-ratio: 4 / 5; border-radius: 28px; overflow: hidden; background: var(--fill); }
.profile-photo img { width: 100%; height: 100%; object-fit: cover; }
@media (max-width: 760px) { .profile { grid-template-columns: 1fr; gap: 32px; } .profile-photo { max-width: 320px; } }

/* Статья / контент */
.article-title { font-size: clamp(36px, 5.6vw, 56px); font-weight: 700; letter-spacing: -.03em; margin: 4px 0 20px; }
.article-cover { margin: 32px 0; border-radius: var(--radius); overflow: hidden; }
.article-cover img { width: 100%; }
.prose { font-size: 19px; line-height: 1.53; }
.prose h2 { font-size: 32px; margin: 1.6em 0 .5em; }
.prose h3 { font-size: 24px; margin: 1.4em 0 .4em; }
.prose ul, .prose ol { padding-left: 1.3em; margin: 0 0 1em; }
.prose ul { list-style: disc; }
.prose img, .prose .wp-block-image img { border-radius: 14px; }
.prose blockquote { margin: 1.5em 0; padding: 0 0 0 20px; border-left: 3px solid var(--blue); color: var(--label2); }
.prose pre, .prose code { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: .88em; }
.prose pre { background: var(--bg2); padding: 16px; border-radius: 12px; overflow-x: auto; }
.back { margin-top: 48px; }
.facts { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); margin: 32px 0; background: var(--bg2); border-radius: var(--radius); overflow: hidden; }
.facts div { padding: 18px 22px; }
.facts dt { font-size: 13px; color: var(--label2); }
.facts dd { margin: 2px 0 0; font-weight: 600; }

/* Пагинация */
.pagination { margin-top: 40px; }
.nav-links { display: flex; justify-content: center; gap: 6px; }
.page-numbers { min-width: 44px; height: 44px; display: grid; place-items: center; border-radius: 980px; color: var(--label); }
.page-numbers.current { background: var(--blue); color: #fff; }
a.page-numbers:hover { background: var(--fill); text-decoration: none; }

/* ---------- Форма (сгруппированный список, как в iOS) ---------- */
.enroll-wrap { max-width: 560px; margin: 0 auto; }
.form-group { background: var(--bg2); border-radius: 14px; overflow: hidden; }
.section--grouped .form-group { background: var(--card); }
.form-row { display: flex; align-items: center; gap: 12px; padding: 0 16px; min-height: 52px; border-bottom: 1px solid var(--sep); }
.form-row:last-child { border-bottom: 0; }
.form-row--top { align-items: flex-start; padding-top: 14px; padding-bottom: 8px; }
.form-row label { flex: 0 0 104px; font-size: 17px; }
.form-row input, .form-row select, .form-row textarea {
	flex: 1; min-width: 0; width: 100%; min-height: 44px; border: 0; background: transparent; color: var(--label);
	font: 400 17px/1.4 var(--font); padding: 0; outline: none; -webkit-appearance: none; appearance: none;
}
.form-row textarea { resize: vertical; min-height: 72px; }
.form-row input::placeholder, .form-row textarea::placeholder { color: var(--label2); opacity: .7; }
.form-row:focus-within { box-shadow: inset 3px 0 0 var(--blue); }
.form-row select { cursor: pointer; }
@media (max-width: 480px) { .form-row label { flex-basis: 84px; } }
.consent { display: flex; align-items: flex-start; gap: 10px; margin-top: 16px; padding: 0 4px; font-size: 14px; color: var(--label2); }
.consent input { width: 20px; height: 20px; margin: 0; accent-color: var(--blue); flex: none; }
.hp { position: absolute; left: -9999px; height: 0; overflow: hidden; }
.notice { display: flex; flex-direction: column; gap: 2px; padding: 16px 20px; border-radius: 14px; margin-bottom: 20px; font-size: 15px; }
.notice--ok { background: color-mix(in srgb, var(--green) 14%, transparent); color: var(--green); }
.notice--error { background: color-mix(in srgb, var(--red) 12%, transparent); color: var(--red); }
.notice strong { font-weight: 600; }

/* ---------- Подвал ---------- */
.site-footer { background: var(--bg2); padding: 48px 0 24px; color: var(--label2); }
.footer-grid { display: grid; grid-template-columns: 1.4fr 1fr 1fr; gap: 32px; }
.footer-brand { font-weight: 600; font-size: 19px; color: var(--label); margin-bottom: 6px; }
.site-footer p { margin: 0 0 6px; }
.site-footer a { color: var(--label); }
.footer-nav .menu li { margin-bottom: 6px; }
.copy { margin-top: 32px; padding-top: 16px; border-top: 1px solid var(--sep); }
@media (max-width: 700px) { .footer-grid { grid-template-columns: 1fr; } }

@media (max-width: 700px) {
	.section { padding: 56px 0; }
	.section--tight { padding: 0 0 56px; }
	.hero { padding: 56px 0 40px; }
	.section-head { flex-direction: column; align-items: flex-start; gap: 12px; margin-bottom: 28px; }
}

@media (prefers-reduced-motion: reduce) {
	*, *::before, *::after { transition: none !important; animation: none !important; scroll-behavior: auto !important; }
	.card:hover { transform: none; }
}
