/*
Theme Name: MDB — журнал о дизайне
Theme URI: https://moscowdesignbiennale.ru/
Author: Редакция MDB
Description: Независимый журнал о дизайне: интерьер, предмет, графика, архитектура, события Москвы. Редакционная вёрстка: крупный заголовок-заявление, обложка, нумерованный индекс рубрик, инверсный блок событий, мозаика; в статье — колонка фактов и оглавление.
Version: 1.0.0
Requires at least: 6.0
Requires PHP: 7.4
License: GPL-2.0-or-later
Text Domain: mdb
*/

:root {
	--bg: #f2f1ed;
	--ink: #0f0f0f;
	--ink-2: #2b2b29;
	--grey: #6a6a64;
	--rule: #0f0f0f;
	--hair: #cfcdc5;
	--signal: #ff4d1c;
	--signal-ink: #d63a0e;
	--font: "Manrope", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Arial, sans-serif;
	--w: 1320px;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--bg); color: var(--ink); font: 400 17px/1.6 var(--font); overflow-x: hidden; overflow-wrap: break-word; }
img, svg, video, iframe { max-width: 100%; height: auto; }
a { color: inherit; }
h1, h2, h3, h4 { margin: 0; font-weight: 800; letter-spacing: -.025em; line-height: 1.08; }
p { margin: 0 0 1em; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.skip { position: absolute; left: -999px; top: 6px; background: var(--ink); color: var(--bg); padding: 8px 12px; z-index: 30; }
.skip:focus { left: 6px; }
:focus-visible { outline: 2px solid var(--signal); outline-offset: 3px; }

.shell { max-width: var(--w); margin: 0 auto; padding: 0 16px 48px; }
.empty { color: var(--grey); padding: 24px 0; }

/* ---------- шапка ---------- */
.top { border-bottom: 1px solid var(--rule); background: var(--bg); position: relative; z-index: 5; }
.top__in { max-width: var(--w); margin: 0 auto; padding: 12px 16px; display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap; }
.mark { display: inline-flex; align-items: center; gap: 10px; text-decoration: none; color: var(--ink); }
.mark__big { font-weight: 800; font-size: 30px; letter-spacing: -.06em; line-height: 1; }
.mark__small { font-size: 11px; line-height: 1.15; font-weight: 700; text-transform: lowercase; color: var(--grey); border-left: 1px solid var(--ink); padding-left: 10px; }
.menu-cb { position: absolute; opacity: 0; pointer-events: none; }
.menu-btn { display: inline-flex; align-items: center; gap: 10px; cursor: pointer; font-weight: 700; font-size: 14px; text-transform: uppercase; letter-spacing: .08em; user-select: none; }
.menu-btn i { width: 22px; height: 10px; border-top: 2px solid var(--ink); border-bottom: 2px solid var(--ink); display: block; transition: transform .2s; }
.menu-cb:checked + .menu-btn i { transform: rotate(45deg) scaleY(.2); }
.menu-cb:focus-visible + .menu-btn { outline: 2px solid var(--signal); outline-offset: 4px; }
.menu { display: none; width: 100%; padding: 8px 0 16px; }
.menu-cb:checked ~ .menu { display: block; }
.menu__list { list-style: none; margin: 0; padding: 0; counter-reset: m; }
.menu__list li { counter-increment: m; border-top: 1px solid var(--hair); }
.menu__list a { display: flex; align-items: baseline; gap: 12px; padding: 10px 0; text-decoration: none; font-size: 24px; font-weight: 800; letter-spacing: -.02em; }
.menu__list a::before { content: counter(m, decimal-leading-zero); font-size: 12px; font-weight: 700; color: var(--signal); letter-spacing: 0; }
.menu__list a:hover, .menu__list .current-menu-item a { color: var(--signal-ink); }
.menu__search { display: flex; border-bottom: 2px solid var(--ink); margin-top: 12px; }
.menu__search input { flex: 1; min-width: 0; border: 0; background: transparent; font: 500 18px var(--font); padding: 8px 0; color: var(--ink); }
.menu__search input:focus { outline: none; }
.menu__search button { border: 0; background: none; font: 800 20px var(--font); cursor: pointer; color: var(--ink); }

/* ---------- общие элементы ---------- */
.tag { margin: 0 0 8px; font-size: 13px; font-weight: 700; }
.tag a { text-decoration: none; display: inline-flex; gap: 8px; align-items: baseline; }
.tag span { color: var(--signal); }
.tag a:hover { text-decoration: underline; text-decoration-color: var(--signal); }
.kicker-title { font-size: 13px; font-weight: 800; letter-spacing: .12em; text-transform: uppercase; padding: 12px 0; border-top: 2px solid var(--rule); margin: 0 0 18px; }
.link-arrow { font-weight: 800; text-decoration: none; }
.link-arrow::after { content: " →"; color: var(--signal); }
.ph { display: grid; place-items: center; width: 100%; aspect-ratio: 4 / 3; background: #e2e0d8; color: var(--ink); font-weight: 800; font-size: 64px; letter-spacing: -.05em; position: relative; overflow: hidden; }
.ph::before { content: ""; position: absolute; width: 38%; aspect-ratio: 1; border-radius: 50%; background: var(--signal); right: 12%; top: 18%; opacity: .9; }
.ph span { position: relative; }
.ph--interer::before { border-radius: 0; }
.ph--grafika::before { border-radius: 0; transform: rotate(45deg); }
.ph--arhitektura::before { border-radius: 50% 50% 0 0; }
.ph--cvet::before { border-radius: 50%; width: 46%; }
.ph--professiya::before { border-radius: 0 50% 0 50%; }

/* ---------- главная ---------- */
.statement { font-size: clamp(30px, 8.4vw, 76px); line-height: 1.02; letter-spacing: -.045em; margin: 26px 0 26px; max-width: 16ch; }

.opening { display: grid; grid-template-columns: minmax(0, 1fr); gap: 28px; padding-bottom: 36px; }
.cover__img { display: block; text-decoration: none; }
.cover__img img, .cover__img .ph { display: block; width: 100%; height: auto; aspect-ratio: 16 / 10; object-fit: cover; }
.cover__img .ph { display: grid; }
.cover__text { padding-top: 14px; }
.cover__title { font-size: 30px; margin-bottom: 10px; }
.cover__title a { text-decoration: none; }
.cover__title a:hover { text-decoration: underline; text-decoration-color: var(--signal); text-decoration-thickness: 3px; }
.cover__ex { color: var(--ink-2); font-size: 18px; max-width: 60ch; }
.brief { border-top: 2px solid var(--rule); }
.brief__h { font-size: 13px; font-weight: 800; letter-spacing: .12em; text-transform: uppercase; padding: 12px 0 4px; margin: 0; }
.brief__list { list-style: none; margin: 0; padding: 0; counter-reset: b; }
.brief__list li { counter-increment: b; padding: 14px 0 14px 40px; border-bottom: 1px solid var(--hair); position: relative; }
.brief__list li::before { content: counter(b, decimal-leading-zero); position: absolute; left: 0; top: 16px; font-size: 13px; font-weight: 800; color: var(--signal); }
.brief__cat { display: block; font-size: 12px; font-weight: 700; color: var(--grey); text-transform: uppercase; letter-spacing: .06em; margin-bottom: 2px; }
.brief__list a { text-decoration: none; font-weight: 700; font-size: 18px; line-height: 1.3; }
.brief__list a:hover { color: var(--signal-ink); }

.index { margin: 12px 0 44px; }
.index__list { list-style: none; margin: 0; padding: 0; }
.index__list li { border-bottom: 1px solid var(--rule); }
.index__list a { display: grid; grid-template-columns: 40px minmax(0, 1fr) auto; gap: 4px 12px; align-items: baseline; padding: 14px 0; text-decoration: none; }
.index__num { font-size: 13px; font-weight: 800; color: var(--signal); }
.index__name { font-size: 26px; font-weight: 800; letter-spacing: -.03em; line-height: 1.1; }
.index__desc { grid-column: 2 / 3; grid-row: 2; font-size: 15px; color: var(--grey); }
.index__count { font-size: 14px; font-weight: 700; color: var(--grey); }
.index__list a:hover .index__name { color: var(--signal-ink); }

.events { background: var(--ink); color: var(--bg); margin: 0 -16px 44px; padding: 8px 16px 32px; }
.events__head { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; border-top: 2px solid var(--bg); margin-top: 16px; }
.kicker-title--inv { border: 0; margin: 0; }
.events__all { color: var(--bg); font-size: 14px; font-weight: 700; text-decoration: none; }
.events__all::after { content: " →"; color: var(--signal); }
.events__grid { display: grid; grid-template-columns: minmax(0, 1fr); gap: 24px; margin-top: 10px; }
.event__img { display: block; text-decoration: none; margin-bottom: 12px; }
.event__img img, .event__img .ph { display: block; width: 100%; height: auto; aspect-ratio: 4 / 3; object-fit: cover; }
.event__img .ph { display: grid; background: #232321; color: var(--bg); }
.event__title { font-size: 21px; line-height: 1.2; margin-bottom: 6px; }
.event__title a { text-decoration: none; }
.event__title a:hover { color: var(--signal); }
.event__meta { font-size: 14px; color: #a8a79f; margin: 0; }

.mosaic { margin: 8px 0 20px; }
.mosaic__grid { display: grid; grid-template-columns: minmax(0, 1fr); gap: 32px 24px; }
.card__img { display: block; text-decoration: none; margin-bottom: 12px; overflow: hidden; }
.card__img img, .card__img .ph { display: block; width: 100%; height: auto; aspect-ratio: 4 / 3; object-fit: cover; transition: transform .4s ease; }
.card__img .ph { display: grid; }
.card:hover .card__img img { transform: scale(1.02); }
.card__title { font-size: 22px; line-height: 1.15; margin-bottom: 6px; }
.card__title a { text-decoration: none; }
.card__title a:hover { text-decoration: underline; text-decoration-color: var(--signal); }
.card__meta { font-size: 13px; color: var(--grey); margin: 0; }

/* ---------- материал ---------- */
.story { padding-top: 26px; }
.story__head { margin-bottom: 22px; }
.story__title { font-size: clamp(30px, 7.4vw, 68px); line-height: 1.04; letter-spacing: -.04em; max-width: 20ch; }
.story__title--page { max-width: none; }
.story__img { margin: 0 0 26px; }
.story__img img { display: block; width: 100%; height: auto; }
.story__grid { display: grid; grid-template-columns: minmax(0, 1fr); gap: 20px; }
.story__body { min-width: 0; max-width: 700px; }
.facts { margin: 0; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 16px; border-top: 2px solid var(--rule); }
.facts div { padding: 8px 0; border-bottom: 1px solid var(--hair); }
.facts dt { font-size: 11px; font-weight: 800; text-transform: uppercase; letter-spacing: .1em; color: var(--grey); }
.facts dd { margin: 0; font-size: 15px; font-weight: 700; }
.toc { margin-top: 20px; border-top: 2px solid var(--rule); padding-top: 10px; }
.toc__title { font-size: 11px; font-weight: 800; text-transform: uppercase; letter-spacing: .1em; color: var(--grey); margin: 0 0 6px; }
.toc__list { list-style: none; margin: 0; padding: 0; counter-reset: c; }
.toc__list li { counter-increment: c; border-bottom: 1px solid var(--hair); }
.toc__list a { display: flex; gap: 10px; padding: 7px 0; font-size: 15px; font-weight: 600; line-height: 1.3; text-decoration: none; }
.toc__list a::before { content: counter(c, decimal-leading-zero); color: var(--signal); font-size: 12px; font-weight: 800; padding-top: 2px; }
.toc__list a:hover { color: var(--signal-ink); }

.entry { font-size: 18px; line-height: 1.7; }
.entry > p:first-child { font-size: 21px; line-height: 1.5; font-weight: 500; }
.entry h2 { font-size: 30px; margin: 1.6em 0 .6em; scroll-margin-top: 16px; }
.entry h3 { font-size: 21px; letter-spacing: -.015em; margin: 1.4em 0 .5em; }
.entry a { text-decoration-color: var(--signal); text-decoration-thickness: 2px; text-underline-offset: .15em; }
.entry ul, .entry ol { padding-left: 1.3em; margin: 0 0 1.1em; }
.entry li { margin: .35em 0; }
.entry ul { list-style: none; padding-left: 0; }
.entry ul li { padding-left: 24px; position: relative; }
.entry ul li::before { content: ""; position: absolute; left: 0; top: .72em; width: 12px; height: 2px; background: var(--signal); }
.entry ol li::marker { font-weight: 800; color: var(--signal); }
.entry blockquote { margin: 1.6em 0; padding: 0; font-size: 26px; line-height: 1.25; font-weight: 800; letter-spacing: -.02em; }
.entry blockquote::before { content: "“"; display: block; color: var(--signal); font-size: 56px; line-height: .6; margin-bottom: 8px; }
.entry blockquote p:last-child { margin: 0; }
.entry figure { margin: 1.6em 0; }
.entry figcaption { font-size: 13px; color: var(--grey); margin-top: 8px; }
.entry table { display: block; max-width: 100%; overflow-x: auto; border-collapse: collapse; font-size: 15px; margin: 1.4em 0; }
.entry th { text-align: left; border-bottom: 2px solid var(--ink); padding: 8px 14px 8px 0; font-size: 12px; text-transform: uppercase; letter-spacing: .06em; }
.entry td { border-bottom: 1px solid var(--hair); padding: 9px 14px 9px 0; vertical-align: top; }
.entry pre { overflow-x: auto; font-size: 14px; background: #e7e5de; padding: 12px; }
.entry hr { border: 0; border-top: 1px solid var(--ink); margin: 2em 0; }

.offer { border: 2px solid var(--ink); padding: 18px; margin: 30px 0; background: #fff; }
.offer__label { display: block; font-size: 11px; font-weight: 800; text-transform: uppercase; letter-spacing: .12em; color: var(--signal-ink); margin-bottom: 6px; }
.offer__title { font-size: 22px; font-weight: 800; letter-spacing: -.02em; line-height: 1.15; margin: 0 0 8px; }
.offer__text p { font-size: 16px; margin: 0 0 10px; }
.offer__btn { display: inline-block; background: var(--ink); color: var(--bg); text-decoration: none; font-weight: 800; padding: 11px 18px; }
.offer__btn:hover { background: var(--signal); color: var(--ink); }
.offer__note { font-size: 11px; color: var(--grey); margin: 8px 0 0; }

.signature { margin: 36px 0 12px; border-top: 2px solid var(--rule); padding-top: 14px; }
.signature__name { font-weight: 800; font-size: 20px; margin: 0 0 4px; }
.signature p { font-size: 15px; color: var(--ink-2); }
.signature a { font-weight: 700; font-size: 14px; text-decoration-color: var(--signal); }

/* ---------- архивы ---------- */
.rubric { padding: 28px 0 24px; border-bottom: 2px solid var(--rule); margin-bottom: 28px; }
.rubric__num { font-size: 15px; font-weight: 800; color: var(--signal); margin: 0 0 4px; }
.rubric__title { font-size: clamp(38px, 10vw, 96px); letter-spacing: -.05em; line-height: .98; }
.rubric__desc { color: var(--ink-2); max-width: 58ch; margin: 12px 0 0; font-size: 18px; }
.rubric--nf { border: 0; }
.pagination { margin: 36px 0 0; }
.nav-links { display: flex; flex-wrap: wrap; gap: 6px; }
.page-numbers { display: inline-block; min-width: 42px; text-align: center; padding: 8px 12px; border: 1px solid var(--ink); text-decoration: none; font-weight: 800; }
.page-numbers.current { background: var(--ink); color: var(--bg); }
.sform { display: flex; border-bottom: 2px solid var(--ink); max-width: 560px; margin: 18px 0; }
.sform input { flex: 1; min-width: 0; border: 0; background: transparent; font: 500 18px var(--font); padding: 8px 0; }
.sform input:focus { outline: none; }
.sform button { border: 0; background: none; font: 800 15px var(--font); cursor: pointer; }

/* ---------- подвал ---------- */
.foot { background: var(--ink); color: var(--bg); margin-top: 24px; }
.foot__in { max-width: var(--w); margin: 0 auto; padding: 24px 16px 8px; }
.foot__mark { font-weight: 800; font-size: clamp(64px, 22vw, 220px); letter-spacing: -.07em; line-height: .85; margin: 0 0 20px; }
.foot__cols { display: grid; grid-template-columns: minmax(0, 1fr); gap: 22px; border-top: 1px solid #3a3a37; padding-top: 16px; }
.foot__h { font-size: 11px; font-weight: 800; text-transform: uppercase; letter-spacing: .12em; color: #9d9c95; margin: 0 0 8px; }
.foot__list { list-style: none; margin: 0; padding: 0; }
.foot__list li { margin: 4px 0; }
.foot__list a { text-decoration: none; font-weight: 600; font-size: 15px; }
.foot__list a:hover { color: var(--signal); }
.foot__note { font-size: 13px; color: #9d9c95; max-width: 44ch; margin: 0; }
.foot__copy { max-width: var(--w); margin: 0 auto; padding: 16px 16px 26px; font-size: 12px; color: #9d9c95; }

/* ---------- ≥561px ---------- */
@media (min-width: 561px) {
	body { font-size: 18px; }
	.mark__big { font-size: 34px; }
	.cover__title { font-size: 38px; }
	.index__list a { grid-template-columns: 56px minmax(0, 1fr) auto; }
	.index__name { font-size: 36px; }
	.events__grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
	.events__grid .event:first-child { grid-column: 1 / -1; }
	.mosaic__grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
	.card--wide { grid-column: 1 / -1; }
	.card--wide .card__img img, .card--wide .card__img .ph { aspect-ratio: 16 / 8; }
	.card--wide .card__title { font-size: 30px; }
	.mosaic__grid--even .card { grid-column: auto; }
	.foot__cols { grid-template-columns: repeat(2, minmax(0, 1fr)); }
	.foot__note { grid-column: 1 / -1; }
}

/* ---------- ≥921px ---------- */
@media (min-width: 921px) {
	.statement { margin: 44px 0 40px; }
	.opening { grid-template-columns: minmax(0, 2fr) minmax(0, 1fr); gap: 36px; }
	.cover__title { font-size: 46px; }
	.index__list a { grid-template-columns: 70px minmax(0, .9fr) minmax(0, 1fr) 60px; padding: 18px 0; }
	.index__name { font-size: 46px; }
	.index__desc { grid-column: 3; grid-row: 1; font-size: 16px; }
	.index__count { text-align: right; }
	.events { margin: 0 0 56px; padding: 8px 32px 36px; }
	.events__grid { grid-template-columns: 1.4fr 1fr 1fr; gap: 28px; }
	.events__grid .event:first-child { grid-column: auto; }
	.mosaic__grid { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 40px 28px; }
	.card--wide { grid-column: span 2; }
	.card--wide .card__img img, .card--wide .card__img .ph { aspect-ratio: 16 / 9; }
	.mosaic__grid--even .card--wide { grid-column: span 2; }
	.story__grid { grid-template-columns: 250px minmax(0, 700px); gap: 60px; }
	.story__grid--page { grid-template-columns: minmax(0, 760px); }
	.story__side { position: sticky; top: 20px; align-self: start; }
	.facts { grid-template-columns: minmax(0, 1fr); }
	.entry h2 { font-size: 34px; }
	.foot__cols { grid-template-columns: 1fr 1fr 1.4fr; }
	.foot__note { grid-column: auto; }
}

/* ---------- ≥1200px: меню в строку ---------- */
@media (min-width: 1200px) {
	.top__in { padding: 16px 16px; flex-wrap: nowrap; }
	.menu-btn { display: none; }
	.menu { display: flex; align-items: center; gap: 24px; width: auto; padding: 0; }
	.menu__list { display: flex; gap: 22px; }
	.menu__list li { border: 0; }
	.menu__list a { font-size: 14px; font-weight: 700; padding: 4px 0; letter-spacing: 0; }
	.menu__list a::before { font-size: 11px; }
	.menu__search { margin: 0; width: 150px; border-bottom-width: 1px; }
	.menu__search input { font-size: 14px; padding: 4px 0; }
	.menu__search button { font-size: 15px; }
}
