/*
Theme Name: Единство
Theme URI: https://game-union.ru/
Author: Game Union
Description: Тема сайта игры «Единство» — симулятор жизни советского села. Главная, дневник разработки, запись с данными сборки и ссылками на ВК и Telegram.
Version: 1.0.1
Requires at least: 6.0
Requires PHP: 7.4
License: GPLv2 or later
Text Domain: edinstvo
*/

:root {
	--ink: #2B1D17;
	--paper: #EFE6D4;
	--paper-2: #E4D8C1;
	--card: #F7F0E2;
	--line: #CDBC9C;
	--accent: #A8261E;
	--accent-dark: #8E1F18;
	--gold: #E3B65C;
	--muted: #6B5546;
	--text-2: #4A3A2E;
	--on-dark: #DCCFB8;
	--on-dark-2: #C9B99C;
	--display: Oswald, "Arial Narrow", sans-serif;
	--body: "PT Sans", "Trebuchet MS", sans-serif;
	--serif: "PT Serif", Georgia, serif;
	--wrap: 1280px;
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }

body {
	margin: 0;
	background: var(--paper);
	color: var(--ink);
	font-family: var(--body);
	font-size: 17px;
	line-height: 1.55;
	-webkit-font-smoothing: antialiased;
}

img { max-width: 100%; height: auto; display: block; }
a { color: var(--accent-dark); }
a:hover { color: #5E140F; }
:focus-visible { outline: 3px solid var(--gold); outline-offset: 2px; }

h1, h2, h3 { font-family: var(--display); line-height: 1.05; margin: 0; }

.wrap { max-width: var(--wrap); margin: 0 auto; padding-left: 32px; padding-right: 32px; }
@media (max-width: 600px) { .wrap { padding-left: 18px; padding-right: 18px; } }

.screen-reader-text {
	position: absolute !important; width: 1px; height: 1px; overflow: hidden;
	clip: rect(1px, 1px, 1px, 1px); white-space: nowrap;
}
.skip-link:focus {
	position: fixed; left: 12px; top: 12px; z-index: 100; width: auto; height: auto; clip: auto;
	background: var(--gold); color: var(--ink); padding: 10px 16px;
}

/* ---------- Кнопки ---------- */
.btn {
	display: inline-block;
	font-family: var(--display);
	font-weight: 600;
	text-transform: uppercase;
	letter-spacing: 1px;
	text-decoration: none;
	border-radius: 3px;
	padding: 14px 26px;
	font-size: 18px;
	line-height: 1.2;
	border: 2px solid transparent;
}
.btn--red { background: var(--accent); color: #FFF6E8; }
.btn--red:hover { background: var(--accent-dark); color: #FFF6E8; }
.btn--dark { background: var(--ink); color: #FFF6E8; }
.btn--dark:hover { background: #000; color: #FFF6E8; }
.btn--light { background: #FFF6E8; color: var(--ink); }
.btn--light:hover { background: #fff; color: var(--ink); }
.btn--outline { border-color: var(--ink); color: var(--ink); }
.btn--outline:hover { background: var(--ink); color: var(--paper); }
.btn--gold { background: var(--gold); color: var(--ink); }
.btn--gold:hover { background: #F2CF86; color: var(--ink); }
.btn--small { font-size: 16px; padding: 10px 16px; }

/* ---------- Шапка ---------- */
.site-header { background: var(--ink); color: var(--paper); border-bottom: 4px solid var(--accent); }
.site-header__inner {
	display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 16px;
	padding-top: 14px; padding-bottom: 14px;
}
.brand { display: flex; align-items: center; gap: 10px; text-decoration: none; color: var(--paper); }
.brand:hover { color: #fff; }
.brand__name { font-family: var(--display); font-weight: 700; font-size: 24px; letter-spacing: 2px; }
.star { fill: var(--accent); flex: none; }

.main-nav ul { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 4px 24px; }
.main-nav a {
	display: block; padding: 10px 0; color: var(--paper); text-decoration: none;
	font-family: var(--display); font-size: 16px; letter-spacing: 1px; text-transform: uppercase;
}
.main-nav a:hover,
.main-nav .current-menu-item > a,
.main-nav .current_page_parent > a,
.main-nav .current-menu-ancestor > a { color: var(--gold); }

.header-actions { display: flex; align-items: center; gap: 12px; }
.social-chip {
	color: var(--paper); text-decoration: none; font-family: var(--display); font-weight: 600;
	border: 2px solid var(--muted); padding: 9px 12px; border-radius: 3px; line-height: 1;
}
.social-chip:hover { border-color: var(--gold); color: var(--gold); }

.nav-toggle {
	display: none; background: none; border: 2px solid var(--muted); color: var(--paper);
	font-family: var(--display); font-size: 16px; text-transform: uppercase; letter-spacing: 1px;
	padding: 9px 14px; border-radius: 3px; cursor: pointer; min-height: 44px;
}
@media (max-width: 860px) {
	.nav-toggle { display: inline-block; }
	.main-nav { display: none; width: 100%; order: 3; }
	.main-nav.is-open { display: block; }
	.main-nav ul { flex-direction: column; gap: 0; border-top: 1px solid #4A3A2E; }
	.main-nav a { padding: 12px 0; border-bottom: 1px solid #4A3A2E; }
	.header-actions .btn { display: none; }
}

/* ---------- Общие секции ---------- */
.section { padding-top: 80px; padding-bottom: 80px; }
.section--tint { background: var(--paper-2); border-top: 2px solid var(--line); border-bottom: 2px solid var(--line); }
.section--dark { background: var(--ink); color: var(--paper); }
.section-head { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: flex-end; gap: 16px; margin-bottom: 32px; }
.section-head__lead { display: flex; flex-direction: column; gap: 8px; max-width: 760px; }
.kicker { font-family: var(--display); font-weight: 600; letter-spacing: 3px; text-transform: uppercase; color: var(--accent); font-size: 15px; }
.section--dark .kicker { color: var(--gold); }
.h2 { font-weight: 700; font-size: clamp(34px, 4vw, 48px); text-transform: uppercase; }
.more-link { font-family: var(--display); font-weight: 600; text-transform: uppercase; letter-spacing: 1px; padding: 10px 0; }
.lead-text { margin: 0; color: var(--text-2); }

/* ---------- Первый экран ---------- */
.hero { text-align: center; padding-top: 64px; padding-bottom: 72px; display: flex; flex-direction: column; align-items: center; gap: 26px; }
.hero__stars { display: flex; gap: 14px; align-items: center; }
.hero__title {
	font-weight: 700; font-size: clamp(56px, 9vw, 128px); line-height: 0.95; letter-spacing: 4px;
	color: var(--accent); text-transform: uppercase;
}
.hero__tagline { margin: 0; font-family: var(--display); font-weight: 600; font-size: 22px; letter-spacing: 3px; text-transform: uppercase; }
.hero__lead { margin: 0; max-width: 640px; color: #5A4636; }
.hero__media { position: relative; width: 100%; margin-top: 10px; }
.hero__media img {
	width: 100%; aspect-ratio: 33 / 10; object-fit: cover;
	border: 6px solid var(--ink); border-radius: 4px;
}
@media (max-width: 700px) { .hero__media img { aspect-ratio: 16 / 9; } }
.status-plate {
	position: absolute; left: 24px; top: 24px; background: var(--ink); color: var(--gold);
	font-family: var(--display); font-weight: 600; font-size: 15px; letter-spacing: 2px; text-transform: uppercase;
	padding: 8px 14px; border-radius: 2px;
}
@media (max-width: 600px) { .status-plate { left: 12px; top: 12px; font-size: 13px; } }
.hero__actions { display: flex; flex-wrap: wrap; gap: 16px; justify-content: center; }

/* ---------- Карточки записей ---------- */
.cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 28px; }
.card {
	background: var(--card); border: 2px solid var(--ink); border-radius: 4px; overflow: hidden;
	display: flex; flex-direction: column;
}
.card__thumb { display: block; border-bottom: 2px solid var(--ink); background: var(--paper-2); }
.card__thumb img { width: 100%; aspect-ratio: 16 / 9; object-fit: cover; }
.card__body { padding: 20px 22px 24px; display: flex; flex-direction: column; gap: 10px; }
.card__meta { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; font-size: 14px; color: var(--muted); }
.card__title { font-weight: 600; font-size: 24px; line-height: 1.2; }
.card__title a { color: var(--ink); text-decoration: none; }
.card__title a:hover { color: var(--accent-dark); }
.card__excerpt { margin: 0; color: var(--text-2); }
.card--compact .card__body { padding: 16px 20px 20px; gap: 6px; }
.card--compact .card__title { font-size: 21px; }

.badge {
	display: inline-block; font-family: var(--display); letter-spacing: 1px; text-transform: uppercase;
	padding: 3px 8px; border-radius: 2px; text-decoration: none; font-size: 14px; line-height: 1.4;
	background: var(--ink); color: var(--paper);
}
.badge:hover { color: #fff; }
.badge--red { background: var(--accent); color: #FFF6E8; }
.badge--olive { background: #6E5A2A; color: #FFF6E8; }

.empty-state { background: var(--card); border: 2px dashed var(--line); border-radius: 4px; padding: 32px; color: var(--text-2); }

/* ---------- Возможности ---------- */
.features { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 24px; }
.feature { background: var(--card); border: 2px solid var(--ink); border-radius: 4px; padding: 28px 24px; display: flex; flex-direction: column; gap: 14px; }
.feature__icon { width: 64px; height: 64px; border-radius: 50%; background: var(--accent); display: flex; align-items: center; justify-content: center; }
.feature__title { font-weight: 600; font-size: 24px; text-transform: uppercase; }
.feature p { margin: 0; color: var(--text-2); }

/* ---------- Рычково ---------- */
.place { display: flex; flex-wrap: wrap; gap: 48px; align-items: center; }
.place__text { flex: 1 1 420px; min-width: 0; display: flex; flex-direction: column; gap: 18px; }
.place__title { font-weight: 700; font-size: clamp(40px, 5vw, 56px); line-height: 1; text-transform: uppercase; }
.place__text p { margin: 0; color: var(--on-dark); }
.place__dev { display: flex; gap: 14px; align-items: center; border-top: 1px solid #5A4636; padding-top: 18px; font-size: 15px; color: var(--on-dark-2); }
.place__media { flex: 1 1 420px; min-width: 0; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
.place__media img { width: 100%; aspect-ratio: 1 / 1; object-fit: cover; border: 4px solid var(--paper); border-radius: 3px; }
.map-slot {
	border: 2px dashed #8A7560; border-radius: 3px; display: flex; flex-direction: column; align-items: center;
	justify-content: center; gap: 8px; text-align: center; padding: 16px; color: var(--on-dark-2); font-size: 15px; aspect-ratio: 1 / 1;
}

/* ---------- Галерея ---------- */
.gallery-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 16px; }
.gallery-grid a { display: block; }
.gallery-grid img { width: 100%; aspect-ratio: 16 / 10; object-fit: cover; border: 3px solid var(--ink); border-radius: 3px; }

/* ---------- Подписка ---------- */
.subscribe { padding-bottom: 80px; }
.section--tint + .subscribe,
.archive-list + .subscribe,
.page-body + .subscribe { padding-top: 0; }
.section--tint + .subscribe { padding-top: 80px; }
.place__btn { align-self: flex-start; }
.subscribe__box {
	background: var(--accent); color: #FFF6E8; border-radius: 4px; padding: 48px 40px;
	display: flex; flex-wrap: wrap; gap: 24px; align-items: center; justify-content: space-between;
}
.subscribe__text { flex: 1 1 420px; display: flex; flex-direction: column; gap: 8px; }
.subscribe__text h2 { font-weight: 700; font-size: clamp(30px, 3.4vw, 40px); text-transform: uppercase; }
.subscribe__text p { margin: 0; color: #FBE6D6; }
.subscribe__actions { display: flex; flex-wrap: wrap; gap: 14px; }

/* ---------- Подвал ---------- */
.site-footer { background: var(--ink); color: var(--on-dark-2); font-size: 15px; }
.site-footer__inner { display: flex; flex-wrap: wrap; gap: 20px; justify-content: space-between; align-items: center; padding-top: 36px; padding-bottom: 36px; }
.site-footer__brand { font-family: var(--display); font-weight: 700; font-size: 22px; letter-spacing: 2px; color: var(--paper); }
.site-footer__brand span { color: var(--on-dark-2); font-weight: 500; font-size: 16px; letter-spacing: 1px; }
.site-footer a { color: var(--on-dark-2); }
.site-footer a:hover { color: var(--gold); }
.footer-nav ul { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 8px 20px; }

/* ---------- Запись дневника ---------- */
.breadcrumbs { padding-top: 28px; font-size: 15px; color: var(--muted); display: flex; flex-wrap: wrap; gap: 8px; }
.breadcrumbs a { color: var(--muted); }
.entry { padding-top: 28px; padding-bottom: 64px; display: flex; flex-direction: column; gap: 32px; }
.entry__head { display: flex; flex-direction: column; gap: 16px; max-width: 900px; }
.entry__title { font-weight: 700; font-size: clamp(36px, 5vw, 64px); text-transform: uppercase; }
.entry__lead { margin: 0; font-family: var(--serif); font-size: 22px; line-height: 1.5; color: var(--text-2); }
.entry__cover img { width: 100%; aspect-ratio: 21 / 9; object-fit: cover; border: 6px solid var(--ink); border-radius: 4px; }
@media (max-width: 700px) { .entry__cover img { aspect-ratio: 16 / 9; } }
.entry__layout { display: flex; flex-wrap: wrap; gap: 48px; align-items: flex-start; }
.entry__main { flex: 999 1 560px; min-width: 0; display: flex; flex-direction: column; gap: 28px; }
.entry__aside { flex: 1 1 280px; min-width: 0; display: flex; flex-direction: column; gap: 20px; }

.changes { background: var(--card); border: 2px solid var(--ink); border-radius: 4px; padding: 26px 28px; }
.changes h2 { font-weight: 600; font-size: 24px; text-transform: uppercase; display: flex; align-items: center; gap: 10px; margin-bottom: 14px; }
.changes ul { margin: 0; padding-left: 22px; display: flex; flex-direction: column; gap: 8px; color: #3A2B21; }

.entry-content { font-family: var(--serif); font-size: 19px; line-height: 1.7; }
.entry-content > * { margin-top: 0; margin-bottom: 1.1em; }
.entry-content > *:last-child { margin-bottom: 0; }
.entry-content h2, .entry-content h3 { font-family: var(--display); text-transform: uppercase; margin-top: 1.4em; }
.entry-content h2 { font-size: 30px; }
.entry-content h3 { font-size: 24px; }
.entry-content img { border: 3px solid var(--ink); border-radius: 3px; }
.entry-content figcaption, .entry-content .wp-element-caption { font-family: var(--body); font-size: 15px; color: var(--muted); margin-top: 8px; }
.entry-content .wp-block-gallery { gap: 12px; }
.entry-content .wp-block-gallery img { aspect-ratio: 16 / 10; object-fit: cover; }
.entry-content blockquote { margin-left: 0; padding-left: 20px; border-left: 4px solid var(--accent); font-style: italic; }

.tags { border-top: 2px solid var(--line); padding-top: 20px; display: flex; flex-wrap: wrap; gap: 8px; }
.tags a { background: var(--paper-2); color: var(--ink); text-decoration: none; font-size: 15px; padding: 8px 12px; border-radius: 2px; }
.tags a:hover { background: var(--line); }

.panel { border-radius: 4px; padding: 24px; display: flex; flex-direction: column; gap: 14px; }
.panel--dark { background: var(--ink); color: var(--paper); }
.panel--light { background: var(--card); border: 2px solid var(--ink); }
.panel h2 { font-weight: 600; font-size: 20px; letter-spacing: 1px; text-transform: uppercase; }
.panel--dark h2 { color: var(--gold); }
.panel p { margin: 0; font-size: 15px; color: var(--text-2); }
.facts { margin: 0; display: grid; grid-template-columns: auto 1fr; gap: 8px 16px; font-size: 15px; }
.facts dt { color: var(--on-dark-2); }
.facts dd { margin: 0; }
.panel .btn { text-align: center; }

.post-nav { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 16px; border-top: 4px solid var(--ink); padding-top: 24px; }
.post-nav a { text-decoration: none; color: var(--ink); display: flex; flex-direction: column; gap: 4px; padding: 8px 0; }
.post-nav__label { font-family: var(--display); font-size: 14px; letter-spacing: 2px; text-transform: uppercase; color: var(--accent); }
.post-nav__title { font-family: var(--display); font-weight: 600; font-size: 22px; }
.post-nav__next { text-align: right; }

/* ---------- Архив и пагинация ---------- */
.archive-list { padding-bottom: 80px; }
.archive-head { padding-top: 56px; padding-bottom: 32px; display: flex; flex-direction: column; gap: 10px; }
.pagination { margin-top: 40px; }
.pagination .nav-links { display: flex; flex-wrap: wrap; gap: 8px; }
.pagination .page-numbers {
	min-width: 44px; min-height: 44px; display: inline-flex; align-items: center; justify-content: center;
	padding: 0 12px; border: 2px solid var(--ink); border-radius: 3px; text-decoration: none; color: var(--ink);
	font-family: var(--display); font-weight: 600;
}
.pagination .page-numbers.current { background: var(--ink); color: var(--paper); }

/* ---------- Обычная страница ---------- */
.page-body { padding-top: 56px; padding-bottom: 80px; max-width: 860px; }
.page-body .entry__title { margin-bottom: 28px; }

/* ---------- Лайтбокс ---------- */
.gallery-grid a, .entry a:has(> img), .entry-content a img, .entry__cover a { cursor: zoom-in; }
.lightbox {
	position: fixed; inset: 0; z-index: 1000; background: rgba(20, 13, 10, 0.94);
	display: flex; align-items: center; justify-content: center; padding: 56px 72px;
}
.lightbox[hidden] { display: none; }
.lightbox__figure { margin: 0; max-width: 100%; max-height: 100%; display: flex; flex-direction: column; align-items: center; gap: 12px; }
.lightbox__img {
	max-width: 100%; max-height: calc(100vh - 150px); width: auto; height: auto; object-fit: contain;
	border: 4px solid var(--paper); border-radius: 3px; background: #000;
}
.lightbox__caption { color: var(--paper); font-size: 16px; text-align: center; max-width: 900px; }
.lightbox__count {
	position: absolute; left: 50%; bottom: 16px; transform: translateX(-50%);
	color: var(--on-dark-2); font-family: var(--display); letter-spacing: 2px; font-size: 15px;
}
.lightbox button {
	position: absolute; background: var(--ink); color: var(--paper); border: 2px solid var(--muted);
	border-radius: 3px; cursor: pointer; font-family: var(--display); line-height: 1;
	min-width: 48px; min-height: 48px; display: flex; align-items: center; justify-content: center;
}
.lightbox button:hover { border-color: var(--gold); color: var(--gold); }
.lightbox button[hidden] { display: none; }
.lightbox__close { top: 12px; right: 12px; font-size: 32px; }
.lightbox__nav { top: 50%; transform: translateY(-50%); font-size: 40px; padding-bottom: 6px; }
.lightbox__nav--prev { left: 12px; }
.lightbox__nav--next { right: 12px; }
@media (max-width: 700px) {
	.lightbox { padding: 64px 8px 48px; }
	.lightbox__nav { top: auto; bottom: 6px; transform: none; }
}
html.lightbox-open { overflow: hidden; }
