/* Хроники — Энциклопедия. Цвета и шрифты берутся из темы (переменные :root). */

.khr-enc {
	--e-bg: var(--bg, #121110);
	--e-surface: var(--surface, #1C1A17);
	--e-mat: var(--mat, #23211D);
	--e-line: var(--line, #2F2C27);
	--e-text: var(--text, #EDE8DF);
	--e-muted: var(--muted, #A9A39A);
	--e-muted2: var(--muted2, #8E887E);
	--e-acc: var(--acc, #C8A45D);
	--e-serif: var(--serif, 'Cormorant Garamond', Georgia, serif);
	--e-sans: var(--sans, 'Golos Text', system-ui, sans-serif);
	color: var(--e-text);
	padding-bottom: 24px;
}
.khr-enc a { color: inherit; text-decoration: none; }
.khr-enc a:hover { color: var(--e-acc); }
.khr-enc .eyebrow { display: inline-block; font-family: var(--e-sans); font-size: 13px; font-weight: 600; letter-spacing: 1px; text-transform: uppercase; color: var(--e-acc); margin: 0; }

/* Крошки */
.khr-crumbs { display: flex; flex-wrap: wrap; gap: 8px; padding-top: 28px; font-size: 13px; color: var(--e-muted2); }
.khr-crumbs a { color: var(--e-muted2); }
.khr-crumbs .crumbs__cur { color: var(--e-muted); }

/* Типографика */
.khr-h1 { font-family: var(--e-serif); font-weight: 600; font-size: clamp(44px, 6.5vw, 92px); line-height: .95; margin: 12px 0 0; letter-spacing: -.005em; }
.khr-h1--xl { font-size: clamp(52px, 8vw, 112px); line-height: .92; }
.khr-h2 { font-family: var(--e-serif); font-weight: 600; font-size: clamp(32px, 3.4vw, 40px); line-height: 1.1; margin: 0; }
.khr-h3 { font-family: var(--e-serif); font-weight: 600; font-size: 30px; margin: 48px 0 24px; }
.khr-lead { display: block; margin: 18px 0 0; font-size: 18px; color: var(--e-muted); max-width: 680px; }
.khr-muted { color: var(--e-muted2); font-size: 14px; }
.khr-hint { margin: -16px 0 28px; font-size: 15px; }
.khr-center { text-align: center; margin-top: 40px; }
.khr-more, .khr-link { color: var(--e-acc) !important; font-weight: 500; font-size: 15px; }
.khr-more:hover, .khr-link:hover { text-decoration: underline; text-underline-offset: 4px; }

.khr-head { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: baseline; gap: 12px; margin-bottom: 36px; }
.khr-section { padding: 64px 0; border-top: 1px solid var(--e-line); }
.khr-anchors + .khr-section { border-top: 0; padding-top: 48px; }

/* Рамка с золотыми уголками — как обложки журнала */
.khr-frame { position: relative; display: block; background: var(--e-mat); padding: 10px; }
.khr-frame--sm { padding: 7px; }
.khr-frame--lg { padding: 12px; }
.khr-c { position: absolute; width: 16px; height: 16px; border: 0 solid var(--e-acc); z-index: 1; pointer-events: none; }
.khr-frame--sm .khr-c { width: 12px; height: 12px; }
.khr-frame--lg .khr-c { width: 20px; height: 20px; }
.khr-c.tl { top: 0; left: 0; border-top-width: 1.5px; border-left-width: 1.5px; }
.khr-c.tr { top: 0; right: 0; border-top-width: 1.5px; border-right-width: 1.5px; }
.khr-c.bl { bottom: 0; left: 0; border-bottom-width: 1.5px; border-left-width: 1.5px; }
.khr-c.br { bottom: 0; right: 0; border-bottom-width: 1.5px; border-right-width: 1.5px; }
.khr-img { display: block; width: 100%; height: 100%; object-fit: cover; }
.khr-r-4-3 .khr-img { aspect-ratio: 4 / 3; }
.khr-r-4-5 .khr-img { aspect-ratio: 4 / 5; }
.khr-r-16-10 .khr-img { aspect-ratio: 16 / 10; }
.khr-r-1-1 .khr-img { aspect-ratio: 1 / 1; }
.khr-r-natural .khr-img { height: auto; max-height: 78vh; object-fit: contain; margin: 0 auto; width: auto; max-width: 100%; }
.khr-img--empty { background: linear-gradient(0deg, #2a2620, #332d25); display: flex; align-items: flex-end; padding: 14px; box-sizing: border-box; font-size: 12px; color: var(--e-muted); }
.khr-r-natural .khr-img--empty { aspect-ratio: 16 / 9; width: 100%; max-height: none; }

/* Интро главной энциклопедии */
.khr-intro { display: flex; flex-wrap: wrap; gap: 40px 48px; align-items: flex-end; padding: 36px 0 44px; border-bottom: 1px solid var(--e-line); }
.khr-intro--compact { padding-bottom: 32px; }
.khr-intro__text { flex: 999 1 520px; min-width: 0; }
.khr-search { flex: 1 1 340px; display: flex; flex-direction: column; gap: 8px; }
.khr-search label { font-size: 13px; color: var(--e-muted); }
.khr-search__row { display: flex; border: 1px solid var(--e-line); background: var(--e-surface); }
.khr-search input { flex: 1 1 auto; min-width: 0; border: 0; background: transparent; color: var(--e-text); font: inherit; font-size: 15px; padding: 14px 16px; outline: none; }
.khr-search input::placeholder { color: var(--e-muted2); }
.khr-search__row:focus-within { border-color: var(--e-acc); }
.khr-search button { border: 0; background: var(--e-acc); color: var(--e-bg); font: inherit; font-size: 14px; font-weight: 600; padding: 0 22px; min-height: 48px; cursor: pointer; }

.khr-abc { display: flex; flex-wrap: wrap; gap: 2px; padding: 18px 0; border-bottom: 1px solid var(--e-line); }
.khr-abc a, .khr-abc span { min-width: 38px; height: 44px; display: inline-flex; align-items: center; justify-content: center; font-family: var(--e-serif); font-size: 24px; font-weight: 600; }
.khr-abc a { color: var(--e-text); }
.khr-abc a.is-active { color: var(--e-bg) !important; background: var(--e-acc); }
.khr-abc span { color: #4a463f; }

.khr-tabs { display: flex; flex-wrap: wrap; gap: 10px; padding-top: 28px; }
.khr-tabs a { padding: 10px 18px; border: 1px solid var(--e-line); font-size: 14px; font-weight: 500; }
.khr-tabs a.is-active { background: var(--e-acc); border-color: var(--e-acc); color: var(--e-bg) !important; font-weight: 600; }
.khr-tabs + .khr-section { border-top: 0; padding-top: 48px; }

.khr-btn { display: inline-flex; align-items: center; min-height: 48px; padding: 0 22px; border: 1px solid var(--e-acc); color: var(--e-acc) !important; font-weight: 600; font-size: 14px; }
.khr-btn:hover { background: var(--e-acc); color: var(--e-bg) !important; }

/* Сетки */
.khr-grid { display: grid; gap: 40px 24px; }
.khr-grid--artists { grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); }
.khr-grid--four { grid-template-columns: repeat(4, minmax(0, 1fr)); }
@media (max-width: 1024px) { .khr-grid--four { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.khr-grid--works { grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); gap: 36px 24px; }
.khr-grid--articles { grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); }
.khr-grid--people { grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 16px; }

.khr-person { display: flex; flex-direction: column; gap: 6px; }
.khr-person .khr-frame { margin-bottom: 10px; }
.khr-person__name { font-family: var(--e-serif); font-size: 30px; font-weight: 600; line-height: 1.1; }

.khr-work { display: flex; flex-direction: column; gap: 8px; }
.khr-work .khr-frame { margin-bottom: 4px; }
.khr-work__title { font-family: var(--e-serif); font-size: 21px; font-weight: 600; line-height: 1.15; color: var(--e-text); }

.khr-acard a { display: flex; flex-direction: column; gap: 10px; }
.khr-acard__title { font-family: var(--e-serif); font-size: 26px; font-weight: 600; line-height: 1.15; }

.khr-mini { display: flex; gap: 16px; align-items: center; padding: 16px; background: var(--e-surface); border: 1px solid var(--e-line); }
.khr-mini__img { flex: 0 0 56px; width: 56px; height: 56px; border-radius: 50%; overflow: hidden; border: 1.5px solid var(--e-acc); background: var(--e-mat); }
.khr-mini__img img { width: 100%; height: 100%; object-fit: cover; display: block; }
.khr-mini__body { display: flex; flex-direction: column; }
.khr-mini__name { font-family: var(--e-serif); font-size: 23px; font-weight: 600; line-height: 1.1; }

/* Список направлений */
.khr-rows { display: flex; flex-direction: column; }
.khr-row { display: flex; flex-wrap: wrap; gap: 8px 32px; align-items: baseline; padding: 24px 0; border-bottom: 1px solid var(--e-line); }
.khr-row__name { flex: 0 0 300px; max-width: 100%; font-family: var(--e-serif); font-size: 32px; font-weight: 600; line-height: 1.1; }
.khr-row__period { flex: 0 0 210px; font-size: 13px; font-weight: 600; text-transform: uppercase; letter-spacing: 1px; color: var(--e-acc); }
.khr-row__text { flex: 1 1 320px; color: var(--e-muted); font-size: 17px; }

.khr-about { display: flex; flex-wrap: wrap; gap: 24px 56px; }
.khr-about .khr-h2 { flex: 1 1 260px; font-size: 34px; }
.khr-about__text { flex: 999 1 560px; min-width: 0; color: var(--e-muted); font-size: 17px; }
.khr-about__text p { margin: 0 0 14px; }

/* Шапка художника */
.khr-hero { display: flex; flex-wrap: wrap; gap: 32px 56px; align-items: flex-end; padding: 36px 0 40px; }
.khr-hero__img { flex: 1 1 300px; max-width: 420px; }
.khr-hero__text { flex: 999 1 480px; min-width: 0; }
.khr-hero--text { padding-bottom: 32px; }
.khr-chips { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 24px; }
.khr-chip { display: inline-flex; padding: 7px 14px; border: 1px solid var(--e-line); font-size: 13px; color: var(--e-text); }
a.khr-chip:hover { border-color: var(--e-acc); }

/* Полоса разделов */
.khr-anchors { display: flex; flex-wrap: wrap; gap: 0 36px; padding: 6px 0; border-top: 1px solid var(--e-line); border-bottom: 1px solid var(--e-line); font-size: 15px; font-weight: 500; }
.khr-anchors a { min-height: 44px; display: inline-flex; align-items: center; }
.khr-anchors a:first-child { color: var(--e-acc); }
.khr-anchors:empty { display: none; }

/* Биография */
.khr-bio { display: flex; flex-wrap: wrap; gap: 40px 56px; align-items: flex-start; }
.khr-bio__main { flex: 999 1 560px; min-width: 0; }
.khr-bio__main .khr-h2 { margin-bottom: 24px; }
.khr-prose { font-size: 18px; line-height: 1.7; max-width: 740px; }
.khr-prose p { margin: 0 0 20px; }
.khr-facts { flex: 1 1 300px; background: var(--e-surface); border: 1px solid var(--e-line); padding: 28px; box-sizing: border-box; }
.khr-facts .eyebrow { margin-bottom: 18px; }
.khr-facts dl, .khr-dl { margin: 0; display: flex; flex-direction: column; gap: 14px; font-size: 15px; }
.khr-facts dt, .khr-dl dt { color: var(--e-muted2); font-size: 13px; }
.khr-facts dd, .khr-dl dd { margin: 2px 0 0; }

/* Галерея главных работ */
.khr-gallery { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); gap: 36px 24px; }
.khr-gitem { margin: 0; display: flex; flex-direction: column; gap: 6px; }
.khr-gitem__open { display: flex; flex-direction: column; gap: 8px; }
.khr-gitem__open .khr-frame { margin-bottom: 4px; transition: transform .2s ease; }
.khr-gitem__open:hover .khr-frame { transform: translateY(-2px); }
.khr-gitem__num { font-size: 12px; font-weight: 600; letter-spacing: 1px; color: var(--e-acc); }

/* Окно с картиной */
.khr-dialog { padding: 0; border: 0; background: transparent; color: var(--e-text, #EDE8DF); max-width: min(1120px, calc(100vw - 32px)); width: 100%; max-height: calc(100vh - 32px); }
.khr-dialog::backdrop { background: rgba(10, 9, 8, .86); }
.khr-dialog__box { position: relative; background: var(--e-surface, #1C1A17); border: 1px solid var(--e-line, #2F2C27); padding: 32px; display: flex; flex-wrap: wrap; gap: 36px; max-height: calc(100vh - 32px); overflow-y: auto; box-sizing: border-box; font-family: var(--e-sans); }
.khr-dialog__media { flex: 999 1 480px; min-width: 0; display: flex; align-items: center; }
.khr-dialog__media .khr-frame { width: 100%; }
.khr-dialog__media .khr-img { max-height: 62vh; }
.khr-dialog__info { flex: 1 1 280px; display: flex; flex-direction: column; gap: 16px; padding-top: 8px; }
.khr-dialog__title { font-family: var(--e-serif, 'Cormorant Garamond', serif); font-weight: 600; font-size: 34px; line-height: 1.08; margin: 0; padding-right: 48px; }
.khr-dialog .khr-dl { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px 16px; padding: 18px 0; border-top: 1px solid var(--e-line, #2F2C27); border-bottom: 1px solid var(--e-line, #2F2C27); }
.khr-dialog__note { margin: 0; color: var(--e-muted, #A9A39A); font-size: 17px; }
.khr-dialog__nav { display: flex; gap: 10px; margin-top: auto; padding-top: 8px; }
.khr-dialog__close { position: absolute; top: 14px; right: 14px; z-index: 2; }
.khr-dialog .khr-more { color: var(--e-acc, #C8A45D) !important; }
.khr-round { width: 48px; height: 48px; border-radius: 50%; border: 1px solid var(--e-line, #2F2C27); background: var(--e-bg, #121110); color: var(--e-text, #EDE8DF); display: inline-flex; align-items: center; justify-content: center; cursor: pointer; padding: 0; }
.khr-round:hover { border-color: var(--e-acc, #C8A45D); }
.khr-round--acc { background: var(--e-acc, #C8A45D); border-color: var(--e-acc, #C8A45D); color: var(--e-bg, #121110); }
.khr-dialog [hidden] { display: none !important; }
html.khr-modal-open { overflow: hidden; }

/* Страница картины */
.khr-painting { margin: 0; padding-top: 28px; }
.khr-painting__img .khr-frame { display: flex; justify-content: center; }
.khr-painting__cap { display: flex; flex-wrap: wrap; gap: 28px 56px; align-items: flex-end; padding: 40px 0 44px; }
.khr-painting__title { flex: 999 1 520px; min-width: 0; }
.khr-dl--card { flex: 1 1 380px; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px 24px; padding: 20px 24px; background: var(--e-surface); border: 1px solid var(--e-line); }

/* Текст о картине: фрагменты-детали в рамках, как в журнале */
.khr-prose--art { max-width: 760px; margin: 0 auto; }
.khr-prose--art h2 { font-family: var(--e-serif); font-weight: 600; font-size: 40px; line-height: 1.1; margin: 56px 0 20px; }
.khr-prose--art h2:first-child { margin-top: 0; }
.khr-prose--art h3 { font-family: var(--e-serif); font-weight: 600; font-size: 30px; line-height: 1.1; margin: 40px 0 14px; }
.khr-prose--art figure, .khr-prose--art .wp-block-image { position: relative; margin: 40px 0; }
/* Уголки рисуются фоном самой картинки — в поле паспарту вокруг неё. */
.khr-prose--art .wp-block-image img, .khr-prose--art figure > img {
	display: block; width: 100%; height: auto; padding: 10px; box-sizing: border-box;
	background:
		linear-gradient(var(--e-acc), var(--e-acc)) left top / 16px 1.5px no-repeat,
		linear-gradient(var(--e-acc), var(--e-acc)) left top / 1.5px 16px no-repeat,
		linear-gradient(var(--e-acc), var(--e-acc)) right top / 16px 1.5px no-repeat,
		linear-gradient(var(--e-acc), var(--e-acc)) right top / 1.5px 16px no-repeat,
		linear-gradient(var(--e-acc), var(--e-acc)) left bottom / 16px 1.5px no-repeat,
		linear-gradient(var(--e-acc), var(--e-acc)) left bottom / 1.5px 16px no-repeat,
		linear-gradient(var(--e-acc), var(--e-acc)) right bottom / 16px 1.5px no-repeat,
		linear-gradient(var(--e-acc), var(--e-acc)) right bottom / 1.5px 16px no-repeat,
		var(--e-mat);
}
.khr-prose--art figcaption, .khr-prose--art .wp-element-caption { margin-top: 12px; font-size: 14px; color: var(--e-muted2); text-align: left; }
.khr-prose--art .alignwide, .khr-prose--art .alignfull { margin-left: calc(50% - min(50vw, 640px) + 12px); margin-right: calc(50% - min(50vw, 640px) + 12px); max-width: none; }
.khr-prose--art blockquote { margin: 40px 0; padding: 0 0 0 24px; border-left: 2px solid var(--e-acc); font-family: var(--e-serif); font-size: 28px; line-height: 1.25; }

.khr-pager { margin-top: 48px; }
.khr-pager .nav-links { display: flex; gap: 6px; flex-wrap: wrap; }
.khr-pager .page-numbers { min-width: 44px; height: 44px; display: inline-flex; align-items: center; justify-content: center; border: 1px solid var(--e-line); }
.khr-pager .page-numbers.current { background: var(--e-acc); border-color: var(--e-acc); color: var(--e-bg); }

@media (max-width: 640px) {
	.khr-section { padding: 48px 0; }
	.khr-hero__img { max-width: none; }
	.khr-dialog__box { padding: 20px; gap: 20px; }
	.khr-dialog__title { font-size: 28px; }
	.khr-row__name { flex-basis: 100%; }
	.khr-grid--works, .khr-gallery { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 28px 14px; }
	.khr-work__title { font-size: 18px; }
	.khr-grid--four { gap: 28px 14px; }
	.khr-grid--four .khr-person__name { font-size: 21px; }
	.khr-grid--four .khr-person .eyebrow { font-size: 11px; }
	.khr-grid--four .khr-person .khr-frame { margin-bottom: 6px; }
	.khr-center .khr-btn { width: 100%; justify-content: center; }
}

/* ---------- Выпадающее меню «Истории» в шапке ---------- */

.site-header .nav__list .menu-item-has-children { position: relative; }
.site-header .nav__list .menu-item-has-children > a { display: inline-flex; align-items: center; gap: 6px; }
.site-header .nav__list .menu-item-has-children > a::after {
	content: ''; width: 7px; height: 7px; border-right: 1.8px solid currentColor; border-bottom: 1.8px solid currentColor;
	transform: translateY(-2px) rotate(45deg); transition: transform .2s ease;
}
.site-header .nav__list .sub-menu { list-style: none; margin: 0; padding: 0; }
.site-header .nav__list .sub-menu a { display: block; }

@media (min-width: 1025px) {
	.site-header .nav__list .sub-menu {
		position: absolute; top: calc(100% + 14px); left: -20px; z-index: 60; min-width: 250px;
		padding: 8px 0; background: var(--surface, #1C1A17); border: 1px solid var(--line, #2F2C27); border-top: 2px solid var(--acc, #C8A45D);
		visibility: hidden; opacity: 0; transform: translateY(-4px); transition: opacity .15s ease, transform .15s ease, visibility .15s;
	}
	.site-header .nav__list .sub-menu::before { content: ''; position: absolute; left: 0; right: 0; top: -16px; height: 16px; }
	.site-header .nav__list .sub-menu a { padding: 12px 20px; white-space: nowrap; }
	.site-header .nav__list .menu-item-has-children:hover > .sub-menu,
	.site-header .nav__list .menu-item-has-children:focus-within > .sub-menu,
	.site-header .nav__list .menu-item-has-children.is-open > .sub-menu { visibility: visible; opacity: 1; transform: none; }
	.site-header .nav__list .menu-item-has-children:hover > a::after,
	.site-header .nav__list .menu-item-has-children.is-open > a::after { transform: translateY(1px) rotate(-135deg); }
}
@media (max-width: 1024px) {
	.site-header .nav__list .sub-menu { display: none; padding: 4px 0 8px 16px; }
	.site-header .nav__list .menu-item-has-children.is-open > .sub-menu { display: block; }
	.site-header .nav__list .menu-item-has-children.is-open > a::after { transform: translateY(1px) rotate(-135deg); }
}

/* Пустые места: инициалы и подписи к фолбэкам (11.10.2026) */
.khr-img--mono { align-items: center; justify-content: center; padding: 0; }
.khr-img--mono b { font-family: var(--e-serif); font-weight: 600; font-size: clamp(36px, 5vw, 64px); line-height: 1; color: var(--e-acc); opacity: .6; letter-spacing: .04em; }
.khr-mini__img--mono { display: flex; align-items: center; justify-content: center; }
.khr-mini__img--mono b { font-family: var(--e-serif); font-weight: 600; font-size: 20px; line-height: 1; color: var(--e-acc); }
.khr-hero__cap { margin: 10px 0 0; font-size: 13px; line-height: 1.4; }
.khr-hero__cap a { color: inherit; text-decoration: none; border-bottom: 1px solid var(--e-line); }
