/*
Theme Name: Хроники
Description: Тёмная журнальная тема для арт-медиа «Хроники».
Version: 1.0.0
Requires at least: 6.4
Requires PHP: 8.0
Text Domain: khroniki
*/

:root {
	--bg: #121110;
	--surface: #1C1A17;
	--mat: #23211D;
	--line: #2F2C27;
	--text: #EDE8DF;
	--muted: #A9A39A;
	--muted2: #8E887E;
	--acc: #C8A45D;
	--serif: 'Cormorant Garamond', Georgia, serif;
	--sans: 'Golos Text', system-ui, -apple-system, 'Segoe UI', sans-serif;
	--logo: 'Unbounded', var(--sans);
	--gap: 32px;
	color-scheme: dark;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body { margin: 0; background: var(--bg); color: var(--text); font-family: var(--sans); font-size: 16px; line-height: 1.5; -webkit-font-smoothing: antialiased; }
img { max-width: 100%; height: auto; display: block; }
a { color: var(--text); }
a:hover { color: var(--acc); }
:focus-visible { outline: 2px solid var(--acc); outline-offset: 3px; }
.serif { font-family: var(--serif); }
.sr, .screen-reader-text { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.skip { position: absolute; left: -9999px; top: 8px; background: var(--acc); color: var(--bg); padding: 8px 14px; z-index: 100; }
.skip:focus { left: 8px; }
.wrap { max-width: 1280px; margin: 0 auto; padding-left: 32px; padding-right: 32px; }

/* ---------- Логотип ---------- */
.logo { position: relative; display: inline-block; padding: 11px 18px 10px; color: var(--text); text-decoration: none; line-height: 1; }
.logo:hover { color: var(--text); }
.logo__text { font-family: var(--logo); font-weight: 500; font-size: 24px; letter-spacing: -0.5px; }
.lc { position: absolute; width: 10px; height: 10px; border: 0 solid var(--acc); }
.lc.tl { left: 0; top: 0; border-left-width: 2px; border-top-width: 2px; }
.lc.tr { right: 0; top: 0; border-right-width: 2px; border-top-width: 2px; }
.lc.bl { left: 0; bottom: 0; border-left-width: 2px; border-bottom-width: 2px; }
.lc.br { right: 0; bottom: 0; border-right-width: 2px; border-bottom-width: 2px; }
.logo--sm { padding: 9px 15px 8px; }
.logo--sm .logo__text { font-size: 20px; }
.logo--sm .lc { width: 9px; height: 9px; }

/* ---------- Шапка ---------- */
.site-header { border-bottom: 1px solid var(--line); background: var(--bg); position: relative; z-index: 20; }
.header-row { display: flex; align-items: center; justify-content: space-between; gap: 24px; padding-top: 18px; padding-bottom: 18px; }
.nav__list { list-style: none; margin: 0; padding: 0; display: flex; gap: 28px; flex-wrap: wrap; }
.nav__list a { text-decoration: none; font-size: 15px; font-weight: 500; }
.nav__list .current-menu-item > a, .nav__list .current-category-ancestor > a, .nav__list .current-post-ancestor > a, .nav__list .current-menu-parent > a { color: var(--acc); }
.header-actions { display: flex; gap: 10px; }
.icon-btn { width: 44px; height: 44px; border-radius: 22px; border: 1px solid var(--line); background: var(--bg); color: var(--text); display: inline-flex; align-items: center; justify-content: center; cursor: pointer; }
.icon-btn:hover { border-color: var(--text); }
.burger { display: none; }
.search-panel { border-top: 1px solid var(--line); padding: 18px 0; background: var(--surface); }

.search-form { display: flex; gap: 10px; max-width: 640px; }
.search-form__input { flex: 1; min-width: 0; height: 48px; padding: 0 16px; background: var(--bg); color: var(--text); border: 1px solid var(--line); font: inherit; font-size: 16px; }
.search-form__input:focus { border-color: var(--acc); outline: none; }
.btn { height: 48px; padding: 0 22px; border: 0; background: var(--text); color: var(--bg); font: inherit; font-weight: 600; cursor: pointer; }
.btn:hover { background: var(--acc); }

/* ---------- Общие блоки ---------- */
.section { padding-top: 48px; padding-bottom: 48px; }
.section--line { border-top: 1px solid var(--line); }
.section-title { margin: 0 0 28px; font-size: 40px; font-weight: 600; line-height: 1.1; }
.section-head { display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap; margin-bottom: 28px; }
.section-head .section-title { margin: 0; }
.more { font-size: 15px; font-weight: 500; }
.eyebrow { font-size: 13px; font-weight: 600; letter-spacing: 1px; text-transform: uppercase; color: var(--acc); }
.eyebrow--sm { font-size: 11px; }
.meta { font-size: 13px; color: var(--muted2); }
.grid { display: grid; gap: var(--gap); }
.grid--4 { grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); }
.grid--3 { grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); }
.empty { color: var(--muted); font-size: 18px; }

/* ---------- Обложки в рамке ---------- */
.frame { position: relative; padding: 10px; background: var(--mat); }
.frame--sm { padding: 5px; flex: 0 0 auto; }
.fc { position: absolute; width: 16px; height: 16px; border: 0 solid var(--acc); transition: width .3s, height .3s; z-index: 1; }
.frame--sm .fc { width: 9px; height: 9px; }
.fc.tl { left: 0; top: 0; border-left-width: 1.5px; border-top-width: 1.5px; }
.fc.tr { right: 0; top: 0; border-right-width: 1.5px; border-top-width: 1.5px; }
.fc.bl { left: 0; bottom: 0; border-left-width: 1.5px; border-bottom-width: 1.5px; }
.fc.br { right: 0; bottom: 0; border-right-width: 1.5px; border-bottom-width: 1.5px; }
.card__link:hover .fc { width: 26px; height: 26px; }
.card__link:hover .frame--sm .fc { width: 14px; height: 14px; }
.cover { width: 100%; height: 100%; object-fit: cover; object-position: 50% 30%; display: block; filter: brightness(.88); transition: filter .3s; }
.frame--natural { display: flex; justify-content: center; }
.frame--natural .cover { width: auto; height: auto; max-width: 100%; max-height: min(80vh, 760px); }
.cover--empty { background: var(--line); }
.cover--lit { filter: none; }
.card__link:hover .cover { filter: none; }
.ratio-4-3 .cover { aspect-ratio: 4 / 3; }
.ratio-3-4 .cover { aspect-ratio: 3 / 4; }
.ratio-16-9 .cover { aspect-ratio: 16 / 9; }
.ratio-16-10 .cover { aspect-ratio: 16 / 10; }
.ratio-16-8 .cover { aspect-ratio: 16 / 8; }
.ratio-1-1 .cover { width: 84px; height: 84px; }
.ratio-inline .cover { width: 96px; height: 72px; }

/* ---------- Карточки ---------- */
.card__link { display: flex; flex-direction: column; gap: 12px; text-decoration: none; color: inherit; }
.card__link:hover { color: inherit; }
.card__link:hover .card__title { text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: 4px; }
.card__title { margin: 0; font-weight: 600; line-height: 1.15; }
.t-xs { font-size: 19px; }
.t-s { font-size: 22px; }
.t-m { font-size: 24px; }
.t-l { font-size: 26px; line-height: 1.12; }
.t-xl { font-size: 44px; line-height: 1.05; }
.card__excerpt { margin: 0; font-size: 15px; line-height: 1.5; color: var(--muted); }
.card__excerpt--lg { font-size: 17px; line-height: 1.55; max-width: 680px; }
.card--panel { background: var(--surface); padding: 20px; }

.hero { display: grid; grid-template-columns: minmax(0, 2fr) minmax(0, 1fr); gap: var(--gap); }
.hero__side { display: flex; flex-direction: column; gap: var(--gap); }

.arrows { display: flex; gap: 8px; }
.arrow { width: 44px; height: 44px; border-radius: 22px; border: 1px solid var(--text); background: var(--bg); color: var(--text); display: inline-flex; align-items: center; justify-content: center; cursor: pointer; }
.arrow--fill { background: var(--surface); }
.arrow:hover { border-color: var(--acc); color: var(--acc); }
.rail { display: grid; grid-auto-flow: column; grid-auto-columns: calc((100% - 3 * var(--gap)) / 4); gap: var(--gap); overflow-x: auto; scroll-snap-type: x mandatory; scrollbar-width: none; }
.rail::-webkit-scrollbar { display: none; }
.rail > .card { scroll-snap-align: start; }

.band { background: var(--surface); }
.band .section { padding-top: 64px; padding-bottom: 64px; }
.section-head--band { align-items: flex-end; margin-bottom: 32px; }
.band__intro { max-width: 640px; }
.band__intro .section-title { font-size: 44px; margin: 0 0 12px; }
.band__intro p { margin: 0; font-size: 17px; line-height: 1.55; color: var(--muted); }

/* ---------- Мини-карточки и боковые колонки ---------- */
.mini { flex-direction: row; gap: 14px; align-items: flex-start; }
.mini__body { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.side-block { display: flex; flex-direction: column; gap: 18px; border-top: 2px solid var(--text); padding-top: 16px; }
.side-head { font-weight: 600; font-size: 15px; }
.toc { gap: 12px; }
.toc a { text-decoration: none; color: var(--muted); font-size: 15px; line-height: 1.4; }
.toc a:hover { color: var(--acc); }
.popular { list-style: none; margin: 0; padding: 0; counter-reset: pop; display: flex; flex-direction: column; gap: 16px; }
.popular li { counter-increment: pop; display: flex; gap: 12px; align-items: baseline; }
.popular li::before { content: counter(pop); font-family: var(--serif); font-size: 30px; font-weight: 600; line-height: 1; color: var(--acc); min-width: 18px; }
.popular .card__title { font-size: 15px; font-weight: 400; line-height: 1.4; }
.teaser { background: var(--surface); padding: 20px; }

/* ---------- Статья ---------- */
.entry-head { max-width: 860px; margin: 0 auto; padding: 48px 32px 32px; display: flex; flex-direction: column; gap: 20px; }
.crumbs { display: flex; flex-wrap: wrap; gap: 8px; font-size: 14px; color: var(--muted2); }
.crumbs a { color: var(--muted2); }
.crumbs a:hover { color: var(--acc); }
.crumbs__cur, a.crumbs__cur { color: var(--acc); font-weight: 600; text-decoration: none; }
.entry-title { margin: 0; font-size: 60px; line-height: 1.02; font-weight: 600; }
.entry-lead { margin: 0; font-size: 21px; line-height: 1.5; color: var(--muted); }
.byline { display: flex; align-items: center; gap: 14px; padding-top: 8px; }
.avatar { width: 44px; height: 44px; border-radius: 22px; background: var(--line); display: inline-flex; align-items: center; justify-content: center; font-weight: 600; }
.byline__text { display: flex; flex-direction: column; gap: 2px; font-size: 14px; }
.byline__name { font-weight: 600; }
.entry-figure { margin-top: 0; margin-bottom: 0; display: flex; flex-direction: column; gap: 10px; }
.entry-figure figcaption { font-size: 14px; color: var(--muted2); }
.entry-layout { max-width: 1360px; margin: 0 auto; padding: 48px 32px; display: flex; gap: 48px; align-items: flex-start; }
.rail-left { flex: 0 1 230px; position: sticky; top: 24px; display: flex; flex-direction: column; gap: 40px; }
.entry-body { flex: 1 1 520px; min-width: 0; max-width: 700px; }
.rail-right { flex: 0 1 300px; position: sticky; top: 24px; display: flex; flex-direction: column; gap: 40px; }
.admin-bar .rail-left, .admin-bar .rail-right { top: 56px; }

.prose { font-size: 19px; line-height: 1.7; overflow-wrap: break-word; }
.prose > * { margin-top: 0; margin-bottom: 22px; }
.prose h2 { font-family: var(--serif); font-size: 34px; font-weight: 600; line-height: 1.1; margin: 44px 0 16px; scroll-margin-top: 24px; }
.prose h2:first-child { margin-top: 0; }
.prose h3 { font-family: var(--serif); font-size: 26px; font-weight: 600; line-height: 1.15; margin: 32px 0 12px; }
.prose a { color: var(--acc); }
.prose a:hover { color: var(--text); }
.prose blockquote { margin: 36px 0; padding: 0 0 0 28px; border-left: 3px solid var(--acc); font-family: var(--serif); font-size: 32px; line-height: 1.2; font-style: italic; }
.prose blockquote p { margin: 0; }
.prose blockquote cite { display: block; margin-top: 10px; font-family: var(--sans); font-size: 15px; font-style: normal; color: var(--muted2); }
.prose figure { margin-left: 0; margin-right: 0; }
.prose figcaption, .prose .wp-element-caption { font-size: 14px; color: var(--muted2); margin-top: 8px; }
.prose ul, .prose ol { padding-left: 24px; }
.prose li { margin-bottom: 8px; }
.prose hr { border: 0; border-top: 1px solid var(--line); margin: 40px 0; }
.prose table { width: 100%; border-collapse: collapse; font-size: 16px; }
.prose th, .prose td { border-bottom: 1px solid var(--line); padding: 10px 8px; text-align: left; }
.prose .alignwide { margin-left: -80px; margin-right: -80px; max-width: none; }
.prose iframe { max-width: 100%; }

.inline-read { flex-direction: row; align-items: center; gap: 18px; margin: 8px 0 34px; padding: 16px; background: var(--surface); border-left: 3px solid var(--acc); text-decoration: none; }
.prose .inline-read, .prose .inline-read:hover { color: var(--text); }

.chips { display: flex; gap: 10px; flex-wrap: wrap; padding-top: 12px; }
.chip { font-size: 14px; padding: 8px 14px; border: 1px solid var(--line); text-decoration: none; }
.chip:hover { border-color: var(--acc); }

.social { margin-top: 40px; border-top: 2px solid var(--text); padding-top: 28px; display: flex; flex-direction: column; gap: 6px; }
.social__title { font-size: 30px; font-weight: 600; line-height: 1.1; }
.social__text { font-size: 15px; color: var(--muted); }
.social__links { display: flex; gap: 12px; flex-wrap: wrap; margin-top: 14px; }
.soc { height: 48px; padding: 0 22px; border: 1px solid var(--text); display: inline-flex; align-items: center; gap: 10px; font-size: 15px; font-weight: 500; text-decoration: none; }
.soc:hover { background: var(--text); color: var(--bg); }
.admin-hint { margin-top: 32px; padding: 14px 16px; border: 1px dashed var(--acc); font-size: 14px; color: var(--muted); }

/* ---------- Страницы, архивы, 404 ---------- */
.page-body { max-width: 760px; margin: 0 auto; padding: 0 32px 80px; }
.archive-head { padding-top: 48px; padding-bottom: 8px; display: flex; flex-direction: column; gap: 14px; }
.archive-title { margin: 0; font-size: 56px; line-height: 1.05; font-weight: 600; }
.archive-desc { max-width: 720px; font-size: 18px; line-height: 1.6; color: var(--muted); }
.archive-desc p { margin: 0; }
.pagination { margin-top: 48px; }
.pagination .nav-links { display: flex; gap: 8px; flex-wrap: wrap; }
.page-numbers { min-width: 44px; height: 44px; padding: 0 12px; display: inline-flex; align-items: center; justify-content: center; border: 1px solid var(--line); text-decoration: none; }
.page-numbers.current { background: var(--text); color: var(--bg); border-color: var(--text); }
.notfound { padding-top: 64px; padding-bottom: 48px; display: flex; flex-direction: column; gap: 18px; }
.notfound__code { font-size: 120px; line-height: 1; color: var(--acc); font-weight: 600; }

/* ---------- Подвал ---------- */
.site-footer { background: var(--surface); border-top: 1px solid var(--line); margin-top: 24px; }
.site-footer .wrap { padding-top: 56px; padding-bottom: 32px; display: flex; flex-direction: column; gap: 40px; }
.foot { display: grid; grid-template-columns: minmax(0, 2fr) repeat(2, minmax(0, 1fr)); gap: 40px; }
.foot__about { display: flex; flex-direction: column; align-items: flex-start; gap: 14px; }
.foot__about p { margin: 0; font-size: 15px; line-height: 1.55; color: var(--muted); max-width: 360px; }
.foot__col { display: flex; flex-direction: column; gap: 10px; font-size: 15px; }
.foot__col a { text-decoration: none; }
.foot__head { font-weight: 600; }
.foot__menu { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 10px; }
.foot__copy { border-top: 1px solid var(--line); padding-top: 20px; font-size: 13px; color: var(--muted2); }

/* ---------- Адаптив ---------- */
@media (max-width: 1100px) {
	.entry-layout { flex-direction: column; gap: 40px; }
	.entry-body { max-width: none; width: 100%; order: 1; }
	.rail-left, .rail-right { position: static; flex: none; width: 100%; }
	.rail-left { order: 2; }
	.rail-right { order: 3; }
	.toc { display: none; }
	.prose .alignwide { margin-left: 0; margin-right: 0; }
	.rail { grid-auto-columns: calc((100% - var(--gap)) / 2.3); }
}
@media (max-width: 900px) {
	.burger { display: inline-flex; }
	.nav { display: none; position: absolute; left: 0; right: 0; top: 100%; background: var(--bg); border-bottom: 1px solid var(--line); padding: 8px 32px 20px; }
	.nav-open .nav { display: block; }
	.nav__list { flex-direction: column; gap: 0; }
	.nav__list a { display: block; padding: 12px 0; font-size: 17px; border-bottom: 1px solid var(--line); }
	.hero { grid-template-columns: minmax(0, 1fr); }
	.foot { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
	.foot__about { grid-column: 1 / -1; }
}
@media (max-width: 640px) {
	:root { --gap: 24px; }
	.wrap, .entry-layout { padding-left: 16px; padding-right: 16px; }
	.entry-head { padding: 32px 16px 24px; }
	.nav { padding-left: 16px; padding-right: 16px; }
	.section { padding-top: 36px; padding-bottom: 36px; }
	.section-title { font-size: 32px; }
	.band__intro .section-title { font-size: 34px; }
	.t-xl { font-size: 32px; }
	.entry-title { font-size: 38px; }
	.entry-lead { font-size: 18px; }
	.archive-title { font-size: 40px; }
	.prose { font-size: 18px; }
	.prose h2 { font-size: 28px; }
	.prose blockquote { font-size: 26px; padding-left: 18px; }
	.rail { grid-auto-columns: 78%; }
	.logo__text { font-size: 21px; }
	.frame { padding: 7px; }
	.inline-read { padding: 12px; gap: 12px; }
	.notfound__code { font-size: 88px; }
}
@media (prefers-reduced-motion: reduce) {
	html { scroll-behavior: auto; }
	.fc, .cover { transition: none; }
}
