/*
Theme Name: DeepWard
Description: Тема сайта игрового сервера DeepWard в стиле «Ледяная ночь»: тёмный холодный фон, сталь и голубой лёд.
Version: 1.0.0
Requires at least: 6.4
Requires PHP: 7.4
Text Domain: deepward
*/

/* ---------------------------------------------------------------------------
   Токены «Ледяная ночь»
   ------------------------------------------------------------------------- */
:root {
	--bg-0: #0b0d14;      /* верх фона */
	--bg-1: #141a2b;      /* середина */
	--bg-2: #1d2640;      /* низ */
	--card: #1a2238;      /* карточки */
	--line: #33416b;      /* рамки */
	--accent: #5d86ff;    /* акцент */
	--ice: #a9c4ff;       /* светлый акцент */
	--text: #e6ecff;      /* текст */
	--muted: #a3b0d1;     /* второстепенный текст (7:1 на карточке) */
	--faint: #8d9abd;     /* мелкие подписи (5:1 на фоне) */
	--field: #0f1422;     /* поля ввода */
	--online: #7fe0c3;    /* мир открыт */
	--offline: #ff9b9b;   /* мир закрыт */

	--glow: 0 0 18px rgba(93, 134, 255, .55), 0 0 2px rgba(93, 134, 255, .45);
	--font-display: "Forum", "Times New Roman", serif;
	--font-body: "Golos Text", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
	--wrap: 1160px;
	--gutter: 24px;
}

/* ---------------------------------------------------------------------------
   Основа
   ------------------------------------------------------------------------- */
*, *::before, *::after { box-sizing: border-box; }

html {
	-webkit-text-size-adjust: 100%;
	text-size-adjust: 100%;
	scroll-behavior: smooth;
	background: var(--bg-0);
}

body {
	margin: 0;
	min-height: 100vh;
	color: var(--text);
	font-family: var(--font-body);
	font-size: 1.0625rem;
	line-height: 1.6;
	overflow-wrap: break-word;
	background-color: var(--bg-0);
	background-image:
		url("assets/img/frost.svg"),
		linear-gradient(180deg, #0b0d14 0%, #141a2b 55%, #1d2640 100%);
	background-size: 220px 220px, 100% 100%;
	background-repeat: repeat, no-repeat;
	display: flex;
	flex-direction: column;
	font-synthesis: none;
}

.site-main { flex: 1 0 auto; }
.site-main:focus { outline: none; }

h1, h2, h3, h4 {
	font-family: var(--font-display);
	font-weight: 400;
	line-height: 1.12;
	color: var(--text);
	text-shadow: var(--glow);
	margin: 0 0 .5em;
}

p { margin: 0 0 1em; }
img, svg, video { max-width: 100%; height: auto; }

a { color: var(--ice); }
a:hover { color: #fff; }

:focus-visible {
	outline: 2px solid var(--ice);
	outline-offset: 3px;
	border-radius: 2px;
}

::selection { background: var(--accent); color: var(--bg-0); }

.wrap {
	width: 100%;
	max-width: calc(var(--wrap) + 2 * var(--gutter));
	margin-inline: auto;
	padding-inline: var(--gutter);
}

.screen-reader-text {
	position: absolute !important;
	width: 1px; height: 1px;
	padding: 0; margin: -1px;
	overflow: hidden;
	clip: rect(0, 0, 0, 0);
	clip-path: inset(50%);
	white-space: nowrap;
	border: 0;
}

.skip-link {
	position: absolute;
	left: 16px; top: -100px;
	z-index: 1000;
	padding: 10px 16px;
	background: var(--ice);
	color: var(--bg-0);
	font-weight: 600;
	text-decoration: none;
	border-radius: 4px;
}
.skip-link:focus { top: 12px; }

/* ---------------------------------------------------------------------------
   Кнопки и ссылки
   ------------------------------------------------------------------------- */
.btn {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	gap: .5em;
	padding: .8em 1.4em;
	border: 1px solid var(--accent);
	border-radius: 4px;
	background: var(--accent);
	color: var(--bg-0);           /* тёмный текст на акценте: контраст 5.8:1 */
	font: 600 1rem/1.2 var(--font-body);
	text-decoration: none;
	cursor: pointer;
	transition: background-color .15s, border-color .15s, box-shadow .2s, color .15s;
}
.btn:hover {
	background: var(--ice);
	border-color: var(--ice);
	color: var(--bg-0);
	box-shadow: 0 0 24px rgba(93, 134, 255, .45);
}
.btn-ghost {
	background: rgba(11, 13, 20, .35);
	border-color: var(--line);
	color: var(--ice);
}
.btn-ghost:hover {
	background: rgba(93, 134, 255, .12);
	border-color: var(--ice);
	color: #fff;
}
.btn-large { padding: .95em 1.75em; font-size: 1.0625rem; }
.btn-small { padding: .5em 1em; font-size: .9375rem; }

.text-link {
	color: var(--ice);
	font-weight: 500;
	text-decoration: underline;
	text-decoration-color: rgba(169, 196, 255, .45);
	text-underline-offset: .25em;
	text-decoration-thickness: 1px;
}
.text-link:hover { color: #fff; text-decoration-color: var(--ice); }

/* ---------------------------------------------------------------------------
   Шапка
   ------------------------------------------------------------------------- */
.site-header {
	position: relative;
	z-index: 50;
	background: rgba(11, 13, 20, .72);
	border-bottom: 1px solid rgba(51, 65, 107, .7);
}
.header-inner {
	display: flex;
	align-items: center;
	gap: 24px;
	min-height: 72px;
	padding-block: 12px;
}
.brand { display: inline-flex; flex: 0 0 auto; }
.brand img { display: block; height: 32px; width: auto; }

.site-nav {
	display: flex;
	align-items: center;
	gap: 32px;
	margin-left: auto;
}
.site-nav .menu {
	display: flex;
	gap: 28px;
	margin: 0;
	padding: 0;
	list-style: none;
}
.site-nav .menu a,
.nav-link {
	color: var(--text);
	font-weight: 500;
	font-size: .975rem;
	text-decoration: none;
	padding-block: 6px;
	border-bottom: 1px solid transparent;
}
.site-nav .menu a:hover,
.nav-link:hover { color: var(--ice); border-bottom-color: var(--accent); }
.site-nav .current-menu-item > a { border-bottom-color: var(--accent); }
.nav-link-quiet { color: var(--muted); }

.nav-account {
	display: flex;
	align-items: center;
	gap: 20px;
	padding-left: 32px;
	border-left: 1px solid rgba(51, 65, 107, .8);
}

.nav-toggle {
	display: none;
	align-items: center;
	gap: 10px;
	margin-left: auto;
	padding: 10px 14px;
	background: transparent;
	border: 1px solid var(--line);
	border-radius: 4px;
	color: var(--text);
	font: 500 .95rem/1 var(--font-body);
	cursor: pointer;
}
.nav-toggle-icon { position: relative; width: 18px; height: 12px; }
.nav-toggle-icon::before,
.nav-toggle-icon::after {
	content: "";
	position: absolute;
	left: 0; right: 0;
	height: 2px;
	background: currentColor;
	transition: transform .2s, top .2s, bottom .2s;
}
.nav-toggle-icon::before { top: 1px; }
.nav-toggle-icon::after { bottom: 1px; }
.nav-toggle[aria-expanded="true"] .nav-toggle-icon::before { top: 5px; transform: rotate(45deg); }
.nav-toggle[aria-expanded="true"] .nav-toggle-icon::after { bottom: 5px; transform: rotate(-45deg); }

/* ---------------------------------------------------------------------------
   Герой-блок и оберег со статусом мира
   ------------------------------------------------------------------------- */
.hero {
	padding-block: clamp(48px, 8vw, 112px) clamp(56px, 8vw, 104px);
	background: radial-gradient(ellipse 55% 65% at 76% 50%, rgba(93, 134, 255, .16), transparent 70%);
}
.hero-grid {
	display: grid;
	grid-template-columns: minmax(0, 1.15fr) minmax(0, .85fr);
	align-items: center;
	gap: 48px;
}
.hero-title {
	font-size: clamp(2.75rem, 1.4rem + 4.6vw, 5.25rem);
	line-height: 1.02;
	letter-spacing: .005em;
	color: #eef3ff;
	text-shadow: 0 0 28px rgba(93, 134, 255, .6), 0 0 3px rgba(93, 134, 255, .5);
	margin-bottom: .45em;
	max-width: 11ch;
}
.hero-lead {
	max-width: 34em;
	font-size: clamp(1.0625rem, 1rem + .3vw, 1.2rem);
	color: var(--muted);
	margin-bottom: 2em;
}
.hero-actions { display: flex; flex-wrap: wrap; gap: 14px; }

.realm { text-align: center; }
.ward {
	position: relative;
	width: min(420px, 100%);
	aspect-ratio: 1;
	margin-inline: auto;
	border-radius: 50%;
	overflow: hidden;              /* углы вращающейся картинки не выходят за круг (нет горизонтальной прокрутки) */
	animation: dw-wake 1.6s cubic-bezier(.2, .7, .2, 1) both;
}
.ward-sigil {
	position: absolute;
	inset: 0;
	width: 100%;
	height: 100%;
	animation: dw-turn 240s linear infinite;
	transition: opacity .6s, filter .6s;
}
.ward-core {
	position: absolute;
	inset: 23%;
	margin: 0;
	display: flex;
	flex-direction: column;
	align-items: center;
	justify-content: center;
	gap: 2px;
	border-radius: 50%;
}
.ward-state {
	display: inline-flex;
	align-items: center;
	gap: 8px;
	font-size: .9rem;
	font-weight: 500;
	color: var(--ice);
}
.ward-dot {
	width: 8px; height: 8px;
	border-radius: 50%;
	background: var(--online);
	box-shadow: 0 0 10px var(--online);
}
.ward-count {
	font-family: var(--font-display);
	font-size: clamp(3rem, 2rem + 3vw, 4.5rem);
	line-height: 1.05;
	color: #fff;
	text-shadow: var(--glow);
	font-variant-numeric: lining-nums tabular-nums;
}
.ward-label { font-size: .9rem; color: var(--muted); }
.ward-note { margin: 14px 0 0; font-size: .875rem; color: var(--faint); }

.realm[data-online="0"] .ward-sigil {
	opacity: .38;
	filter: saturate(.25);
	animation-play-state: paused;
}
.realm[data-online="0"] .ward-dot { background: var(--offline); box-shadow: none; }
.realm[data-online="0"] .ward-state { color: var(--offline); }
.realm[data-online="0"] .ward-count { color: var(--muted); text-shadow: none; }

@keyframes dw-turn { to { transform: rotate(360deg); } }
@keyframes dw-wake {
	from { opacity: 0; transform: scale(.94); filter: blur(6px); }
	to   { opacity: 1; transform: none; filter: none; }
}

/* ---------------------------------------------------------------------------
   Разделы главной
   ------------------------------------------------------------------------- */
.section { padding-block: clamp(52px, 7vw, 88px); }
.section-title {
	font-size: clamp(2rem, 1.4rem + 2.2vw, 3rem);
	margin-bottom: .8em;
}
.section-head {
	display: flex;
	flex-wrap: wrap;
	align-items: baseline;
	justify-content: space-between;
	gap: 8px 24px;
	margin-bottom: .8em;
}
.section-head .section-title { margin-bottom: 0; }

/* О сервере */
.about { border-top: 1px solid rgba(51, 65, 107, .5); }
.about-grid {
	display: grid;
	grid-template-columns: minmax(0, 5fr) minmax(0, 7fr);
	gap: 48px;
}
.about-text { max-width: 62ch; color: var(--muted); }
.about-text p:first-child { font-size: 1.2rem; color: var(--text); }

/* Особенности: одна панель с ячейками, разделёнными стальной линией */
.feature-grid {
	display: grid;
	grid-template-columns: repeat(3, minmax(0, 1fr));
	gap: 1px;
	margin: 0;
	padding: 0;
	list-style: none;
	background: var(--line);
	border: 1px solid var(--line);
	border-radius: 2px;
}
.feature {
	padding: 32px 28px 28px;
	background: var(--card);
}
.feature-icon { display: block; width: 44px; height: 44px; margin-bottom: 20px; }
.feature-title { font-size: 1.55rem; margin-bottom: .4em; }
.feature p { margin: 0; color: var(--muted); font-size: 1rem; }

/* Как начать: настоящая последовательность из трёх шагов */
.steps {
	display: grid;
	grid-template-columns: repeat(3, minmax(0, 1fr));
	gap: 40px;
	margin: 0;
	padding: 0;
	list-style: none;
	counter-reset: step;
}
.step {
	position: relative;
	padding-top: 92px;
	counter-increment: step;
	color: var(--muted);
}
.step::before {
	content: counter(step);
	position: absolute;
	top: 0; left: 0;
	font-family: var(--font-display);
	font-size: 4.5rem;
	line-height: 1;
	color: var(--accent);
	text-shadow: var(--glow);
}
.step:not(:last-child)::after {
	content: "";
	position: absolute;
	top: 2.3rem;
	left: 4rem;
	right: -28px;
	height: 1px;
	background: linear-gradient(90deg, var(--accent), rgba(93, 134, 255, 0));
}
.step-title { font-size: 1.6rem; margin-bottom: .45em; }
.step p { margin-bottom: .9em; }
.step-done { color: var(--online); }

/* Новости */
.news-grid {
	display: grid;
	grid-template-columns: repeat(3, minmax(0, 1fr));
	gap: 24px;
}
.news-card {
	position: relative;
	padding: 26px 26px 24px;
	background: var(--card);
	border: 1px solid var(--line);
	border-radius: 2px;
	transition: border-color .15s;
}
.news-card:hover, .news-card:focus-within { border-color: var(--accent); }
.news-date { display: block; font-size: .875rem; color: var(--faint); }
.news-title { font-size: 1.5rem; margin: .35em 0 .45em; }
.news-title a { color: var(--text); text-decoration: none; }
.news-title a::after { content: ""; position: absolute; inset: 0; }
.news-title a:focus-visible { outline: none; }
.news-card:focus-within { outline: 2px solid var(--ice); outline-offset: 3px; }
.news-excerpt { margin: 0; color: var(--muted); font-size: .98rem; }
.empty-note { color: var(--muted); max-width: 60ch; }

/* ---------------------------------------------------------------------------
   Внутренние страницы
   ------------------------------------------------------------------------- */
.page-wrap { padding-block: clamp(40px, 6vw, 80px) clamp(56px, 8vw, 104px); }
.entry, .page-wrap > .page-header, .news-list, .page-wrap .empty-note { max-width: 820px; }
.page-header { margin-bottom: 2rem; }
.page-title { font-size: clamp(2.25rem, 1.6rem + 2.4vw, 3.5rem); margin-bottom: .3em; }
.page-lead { font-size: 1.15rem; color: var(--muted); max-width: 60ch; }
.entry-back { margin-bottom: 1.2rem; }
.entry-cover { margin: 0 0 2rem; }
.entry-cover img { display: block; width: 100%; border: 1px solid var(--line); }

.news-list { display: grid; gap: 16px; }

.entry-content { font-size: 1.0625rem; }
.entry-content > * { max-width: 70ch; }
.entry-content h2 { font-size: 2rem; margin: 1.6em 0 .5em; }
.entry-content h3 { font-size: 1.5rem; margin: 1.4em 0 .4em; }
.entry-content h4 { font-size: 1.25rem; margin: 1.2em 0 .4em; text-shadow: none; }
.entry-content ul, .entry-content ol { margin: 0 0 1.1em; padding-left: 1.4em; }
.entry-content li { margin-bottom: .35em; }
.entry-content li::marker { color: var(--accent); }
.entry-content a { color: var(--ice); text-underline-offset: .2em; }
.entry-content strong { color: #fff; }
.entry-content blockquote {
	margin: 1.5em 0;
	padding: 16px 22px;
	background: var(--card);
	border-left: 3px solid var(--accent);
	color: var(--text);
}
.entry-content blockquote p:last-child { margin-bottom: 0; }
.entry-content code, .entry-content kbd {
	padding: .1em .35em;
	background: var(--field);
	border: 1px solid var(--line);
	border-radius: 3px;
	font-size: .92em;
}
.entry-content pre {
	overflow-x: auto;
	padding: 16px;
	background: var(--field);
	border: 1px solid var(--line);
}
.entry-content pre code { padding: 0; border: 0; }
.entry-content hr, .entry-content .wp-block-separator {
	border: 0;
	border-top: 1px solid var(--line);
	margin: 2.4em 0;
}
.entry-content table { width: 100%; border-collapse: collapse; margin: 0 0 1.5em; font-size: .975rem; }
.entry-content .wp-block-table { overflow-x: auto; max-width: 100%; }
.entry-content th, .entry-content td { padding: 10px 12px; border: 1px solid var(--line); text-align: left; }
.entry-content th { background: var(--card); color: var(--ice); font-weight: 600; }
.entry-content figure { margin: 0 0 1.5em; }
.entry-content figcaption { font-size: .875rem; color: var(--faint); margin-top: .5em; }
.entry-content .wp-block-button__link,
.entry-content .wp-element-button {
	background: var(--accent);
	color: var(--bg-0);
	border-radius: 4px;
	font-weight: 600;
	text-decoration: none;
}
.entry-content .wp-block-button__link:hover { background: var(--ice); }
.entry-content .is-style-outline .wp-block-button__link {
	background: transparent;
	color: var(--ice);
	border: 1px solid var(--line);
}

/* Навигация между записями и страницы ленты */
.post-navigation { margin-top: 3rem; max-width: 820px; }
.post-navigation .nav-links,
.pagination .nav-links { display: flex; flex-wrap: wrap; gap: 12px; }
.post-navigation .nav-links > div { flex: 1 1 240px; }
.post-navigation a {
	display: block;
	height: 100%;
	padding: 16px 18px;
	background: var(--card);
	border: 1px solid var(--line);
	color: var(--text);
	text-decoration: none;
}
.post-navigation a:hover { border-color: var(--accent); }
.post-navigation .nav-dir { display: block; font-size: .85rem; color: var(--faint); }
.post-navigation .nav-name { font-family: var(--font-display); font-size: 1.25rem; }
.pagination { margin-top: 2.5rem; }
.pagination .page-numbers {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	min-width: 44px;
	min-height: 44px;
	padding: 0 14px;
	border: 1px solid var(--line);
	color: var(--text);
	text-decoration: none;
}
.pagination .page-numbers.current { background: var(--accent); border-color: var(--accent); color: var(--bg-0); font-weight: 600; }
.pagination a.page-numbers:hover { border-color: var(--ice); }

/* 404 */
.dw-404 { text-align: center; }
.dw-404 .page-lead { margin-inline: auto; }
.dw-404 .hero-actions { justify-content: center; }
.dw-404-sigil { display: block; width: 160px; margin: 0 auto 24px; opacity: .55; }

/* ---------------------------------------------------------------------------
   Подвал
   ------------------------------------------------------------------------- */
.site-footer {
	margin-top: auto;
	padding-block: 48px 28px;
	background: rgba(11, 13, 20, .55);
	border-top: 1px solid var(--line);
	color: var(--muted);
	font-size: .975rem;
}
.footer-grid {
	display: grid;
	grid-template-columns: minmax(0, 2fr) minmax(0, 1fr) minmax(0, 1fr);
	gap: 40px;
}
.footer-brand img { display: block; height: 26px; width: auto; margin-bottom: 14px; }
.footer-brand p { max-width: 40ch; margin: 0; }
.footer-title { font-size: 1.25rem; color: var(--ice); text-shadow: none; margin-bottom: .6em; }
.site-footer .menu { margin: 0; padding: 0; list-style: none; display: grid; gap: 8px; }
.site-footer .menu a { color: var(--muted); text-decoration: none; }
.site-footer .menu a:hover { color: var(--ice); text-decoration: underline; text-underline-offset: .2em; }
.footer-note { margin: 0; }
.footer-legal {
	margin-top: 40px;
	padding-top: 20px;
	border-top: 1px solid rgba(51, 65, 107, .5);
	font-size: .85rem;
	color: var(--faint);
}
.footer-legal {
	display: flex;
	flex-wrap: wrap;
	align-items: flex-start;
	justify-content: space-between;
	gap: 12px 24px;
}
.footer-legal p { margin: 0; max-width: 90ch; }
.footer-legal .footer-age { flex: 0 0 auto; }

/* ---------------------------------------------------------------------------
   Планшет и телефон
   ------------------------------------------------------------------------- */
@media (max-width: 1080px) {
	.feature-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
	.news-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
	.news-grid > :nth-child(3) { display: none; }
}

@media (max-width: 899px) {
	:root { --gutter: 20px; }

	.nav-toggle { display: inline-flex; }
	.no-js .nav-toggle { display: none; }
	.no-js .header-inner { flex-wrap: wrap; }
	.site-nav { gap: 20px; flex-wrap: wrap; }

	.js .site-nav {
		display: none;
		position: absolute;
		top: 100%;
		left: 0; right: 0;
		flex-direction: column;
		align-items: stretch;
		gap: 0;
		margin: 0;
		padding: 8px var(--gutter) 20px;
		background: #10152a;
		border-bottom: 1px solid var(--line);
		box-shadow: 0 18px 40px rgba(0, 0, 0, .45);
	}
	.js .site-nav.is-open { display: flex; }
	.js .site-nav .menu { flex-direction: column; gap: 0; }
	.js .site-nav .menu a {
		display: block;
		padding: 14px 0;
		border-bottom: 1px solid rgba(51, 65, 107, .6);
		font-size: 1.05rem;
	}
	.js .nav-account {
		flex-direction: column;
		align-items: stretch;
		gap: 12px;
		padding: 16px 0 0;
		border-left: 0;
	}
	.js .nav-account .nav-link { padding: 8px 0; border-bottom: 0; font-size: 1.05rem; }
	.js .nav-account .btn { width: 100%; padding-block: .8em; }

	.hero-grid { grid-template-columns: minmax(0, 1fr); gap: 40px; }
	.hero { background: radial-gradient(ellipse 90% 45% at 50% 78%, rgba(93, 134, 255, .16), transparent 70%); }
	.realm .ward { width: min(340px, 86%); }

	.about-grid { grid-template-columns: minmax(0, 1fr); gap: 8px; }

	.steps { grid-template-columns: minmax(0, 1fr); gap: 36px; }
	.step { padding: 0 0 0 76px; min-height: 64px; }
	.step::before { font-size: 3.5rem; }
	.step:not(:last-child)::after {
		top: 4.2rem; bottom: -28px;
		left: 1rem; right: auto;
		width: 1px; height: auto;
		background: linear-gradient(180deg, var(--accent), rgba(93, 134, 255, 0));
	}

	.footer-grid { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
	.footer-brand { grid-column: 1 / -1; }
}

@media (max-width: 640px) {
	:root { --gutter: 16px; }
	.brand img { height: 26px; }
	.feature-grid { grid-template-columns: minmax(0, 1fr); }
	.feature { padding: 26px 20px 24px; }
	.news-grid { grid-template-columns: minmax(0, 1fr); }
	.news-grid > :nth-child(3) { display: block; }
	.hero-actions .btn { flex: 1 1 100%; }
	.footer-grid { grid-template-columns: minmax(0, 1fr); gap: 28px; }
}

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