:root {
  --bg: #f4f1ea;
  --paper: #fbf9f4;
  --ink: #161411;
  --muted: #6a655c;
  --line: #d9d3c7;
  --accent: #b3261e;
  --max: 1180px;
  --serif: "Newsreader", "Times New Roman", Times, serif;
  --sans: "Inter", "Helvetica Neue", Helvetica, Arial, sans-serif;
}
*, *::before, *::after { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body {
  background: var(--bg);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 15px;
  line-height: 1.45;
  -webkit-font-smoothing: antialiased;
}
a { color: inherit; text-decoration: none; }
a:hover { color: var(--accent); }
img { max-width: 100%; display: block; }
button { font: inherit; color: inherit; background: none; border: 0; padding: 0; cursor: pointer; }
[hidden] { display: none !important; }
.wrap { width: min(var(--max), calc(100% - 48px)); margin: 0 auto; }

/* ---------- Шапка в стиле журнала ---------- */
.topbar {
  border-bottom: 1px solid var(--line);
  font-size: 11px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  display: flex;
  justify-content: space-between;
  align-items: center;
  height: 38px;
  color: var(--muted);
}
.langs { display: flex; gap: 4px; }
.langs button {
  font-size: 11px;
  letter-spacing: 0.12em;
  padding: 6px 8px;
  color: var(--muted);
  border-bottom: 1px solid transparent;
}
.langs button:hover { color: var(--ink); }
.langs button.is-active { color: var(--ink); border-bottom-color: var(--ink); }
.header { border-bottom: 1px solid var(--ink); padding: 18px 0 16px; background: var(--bg); }
.brand {
  text-align: center;
  font-family: var(--serif);
  font-weight: 500;
  font-size: clamp(36px, 6vw, 64px);
  letter-spacing: -0.03em;
  line-height: 0.9;
  margin: 0 0 8px;
}
.brand a:hover { color: inherit; }
.tagline {
  text-align: center;
  font-size: 11px;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--muted);
  margin: 0 0 18px;
}
.nav {
  display: flex;
  justify-content: center;
  gap: 28px;
  font-size: 13px;
  border-top: 1px solid var(--line);
  padding-top: 12px;
}
.nav a.is-active { color: var(--accent); }

/* ---------- Центральный блок: выставка / репортаж ---------- */
.current {
  display: grid;
  grid-template-columns: 1.1fr 0.9fr;
  gap: 56px;
  align-items: center;
  padding: 44px 0 44px;
  border-bottom: 1px solid var(--ink);
}
.current-copy { min-width: 0; }
.kicker {
  font-size: 11px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--accent);
  margin: 0 0 12px;
}
.current h1 {
  font-family: var(--serif);
  font-weight: 500;
  font-size: clamp(32px, 4.2vw, 52px);
  letter-spacing: -0.03em;
  line-height: 1.05;
  margin: 0 0 16px;
}
.current .standfirst {
  font-family: var(--serif);
  font-size: 20px;
  line-height: 1.35;
  margin: 0 0 18px;
}
.current .body { font-size: 14px; color: var(--muted); margin: 0 0 14px; }
.current .meta { font-size: 13px; color: var(--muted); margin: 0 0 20px; }
.current .more { display: inline-block; margin-top: 6px; font-size: 13px; border-bottom: 1px solid var(--ink); padding-bottom: 2px; }

.slider { outline: none; min-width: 0; }
.slider:focus-visible { outline: 1px dotted var(--muted); outline-offset: 6px; }
.slider-viewport { overflow: hidden; background: #e6e1d6; cursor: grab; touch-action: pan-y; }
.slider-track { display: flex; transition: transform 0.5s cubic-bezier(.3,.7,.2,1); }
.slide { flex: 0 0 100%; margin: 0; }
.slide-img { height: clamp(320px, 42vw, 520px); display: flex; align-items: center; justify-content: center; background: #e6e1d6; }
.slide-img img { max-width: 100%; max-height: 100%; width: auto; height: auto; object-fit: contain; user-select: none; -webkit-user-drag: none; }
.slider-bar {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 20px;
  border-top: 1px solid var(--ink);
  margin-top: 10px;
  padding-top: 10px;
}
.slider-caption { margin: 0; font-size: 12px; color: var(--muted); line-height: 1.4; min-height: 1.4em; flex: 1; }
.slider-ctrl { display: flex; align-items: center; gap: 12px; font-size: 12px; color: var(--muted); letter-spacing: 0.08em; white-space: nowrap; }
.slider-btn {
  width: 32px; height: 32px;
  border: 1px solid var(--line);
  border-radius: 50%;
  font-size: 15px;
  line-height: 1;
  display: grid; place-items: center;
  transition: border-color .2s, color .2s;
}
.slider-btn:hover { border-color: var(--ink); color: var(--accent); }

/* ---------- Заголовки секций ---------- */
.sec-title {
  font-family: var(--serif);
  font-size: 32px;
  font-weight: 500;
  margin: 0;
  letter-spacing: -0.03em;
}
.sec-title.second { margin-top: 36px; font-size: 26px; }
.sub-title { font-family: var(--serif); font-size: 22px; font-weight: 500; margin: 28px 0 10px; }
.sections { padding: 36px 0 0; }
.sections .sec-title { padding-bottom: 20px; border-bottom: 1px solid var(--line); margin-bottom: 40px; }
.recent { padding: 56px 0 0; }
.recent-head {
  display: flex; justify-content: space-between; align-items: baseline;
  padding-bottom: 20px; border-bottom: 1px solid var(--line); margin-bottom: 40px;
}
.all-link { font-size: 13px; color: var(--muted); border-bottom: 1px solid var(--line); padding-bottom: 1px; }
.all-link:hover { color: var(--ink); border-color: var(--ink); }

/* ---------- Каталог кружками ----------
   Компьютер: кружки меньше и разнесены шире (больше воздуха).
   Телефон/планшет (<=900px): без изменений — крупные, 2 в ряд. */
.grid, .cat-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 72px 96px;
  width: min(900px, 100%);
  margin: 0 auto;
  padding-bottom: 88px;
}
.cat-grid { padding-bottom: 24px; }
.card { text-align: center; display: block; }
.card:hover { color: inherit; }
.circle { aspect-ratio: 1; border-radius: 50%; overflow: hidden; background: #e6e1d6; }
.circle img { width: 100%; height: 100%; object-fit: cover; object-position: center 42%; transition: transform 0.6s ease; }
.card:hover .circle img { transform: scale(1.04); }
.caption { padding: 16px 6px 0; }
.caption .title { font-family: var(--serif); font-size: 18px; margin: 0 0 4px; font-weight: 500; letter-spacing: -0.02em; line-height: 1.2; }
.caption .meta, .caption .medium { margin: 0; font-size: 12px; color: var(--muted); letter-spacing: 0.02em; }
.cat-card .caption .title { font-size: 22px; }

/* ---------- Выставки / новости / о художнике ---------- */
.block { border-top: 1px solid var(--ink); padding: 36px 0 48px; }
.news-row { display: grid; grid-template-columns: repeat(3, 1fr); margin-top: 24px; border-top: 1px solid var(--line); }
.news-row article { padding: 24px 28px 24px 0; border-right: 1px solid var(--line); }
.news-row article:last-child { border-right: 0; }
.news-row .date { font-size: 11px; letter-spacing: 0.12em; text-transform: uppercase; color: var(--accent); margin: 0 0 8px; }
.news-row h3 { font-family: var(--serif); font-size: 22px; font-weight: 500; letter-spacing: -0.02em; margin: 0 0 8px; line-height: 1.15; }
.news-row p { margin: 0; color: var(--muted); font-size: 14px; }
.ex-list { list-style: none; padding: 0; margin: 20px 0 0; border-top: 1px solid var(--line); }
.ex-list li {
  display: grid; grid-template-columns: 90px 1fr auto; gap: 24px; align-items: baseline;
  padding: 14px 0; border-bottom: 1px solid var(--line);
}
.ex-year { font-size: 12px; letter-spacing: 0.12em; color: var(--accent); }
.ex-title { font-family: var(--serif); font-size: 20px; letter-spacing: -0.02em; }
.ex-place { font-size: 13px; color: var(--muted); text-align: right; }
.about-text { max-width: 44em; margin-top: 20px; }
.about-text p { font-family: var(--serif); font-size: 19px; line-height: 1.5; margin: 0 0 14px; }
.about-text.cv p { font-family: var(--sans); font-size: 14px; color: var(--muted); }

/* ---------- Страница раздела: прямоугольные карточки ---------- */
.catalog-page { padding: 24px 0 80px; }
.crumbs { font-size: 12px; color: var(--muted); letter-spacing: 0.04em; margin-bottom: 20px; }
.crumbs a:hover { color: var(--accent); }
.catalog-head {
  display: flex; justify-content: space-between; align-items: baseline; gap: 24px; flex-wrap: wrap;
  padding-bottom: 18px; border-bottom: 1px solid var(--ink);
}
.catalog-head h1 { font-family: var(--serif); font-size: clamp(36px, 5vw, 56px); font-weight: 500; letter-spacing: -0.03em; margin: 0; line-height: 1; }
.cats { display: flex; flex-wrap: wrap; gap: 8px 22px; font-size: 13px; color: var(--muted); }
.cats a.is-active, .subcats a.is-active { color: var(--ink); border-bottom: 1px solid var(--ink); }
.subcats {
  display: flex; flex-wrap: wrap; align-items: baseline; gap: 8px 22px;
  padding: 14px 0; border-bottom: 1px solid var(--line);
  font-size: 13px; color: var(--muted);
}
.subcats-label { font-size: 11px; letter-spacing: 0.14em; text-transform: uppercase; }
.rgrid {
  display: grid; grid-template-columns: repeat(3, 1fr);
  gap: 56px 40px; align-items: start; padding-top: 40px;
}
.rcard { display: block; }
.rcard:hover { color: inherit; }
.rimg { background: #e6e1d6; overflow: hidden; }
.rimg img { width: 100%; height: auto; transition: transform .6s ease; }
.rcard:hover .rimg img { transform: scale(1.03); }
.rcap { border-top: 1px solid var(--ink); margin-top: 12px; padding-top: 10px; }
.rcap .title { font-family: var(--serif); font-size: 19px; font-weight: 500; letter-spacing: -0.02em; line-height: 1.2; margin: 0 0 4px; }
.rcap .meta { margin: 0; font-size: 12px; color: var(--muted); }
.empty { color: var(--muted); grid-column: 1 / -1; }

/* ---------- Страница работы ---------- */
.work { display: grid; grid-template-columns: 1.15fr 0.85fr; gap: 64px; padding: 36px 0 80px; align-items: start; }
.work-media { min-width: 0; }
.work-main { background: #e6e1d6; }
.work-main img { width: 100%; height: auto; max-height: 82vh; object-fit: contain; margin: 0 auto; }
.work-thumbs { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 12px; }
.work-thumbs button { width: 72px; height: 72px; background: #e6e1d6; opacity: .65; border: 1px solid transparent; }
.work-thumbs button.is-active, .work-thumbs button:hover { opacity: 1; border-color: var(--ink); }
.work-thumbs img { width: 100%; height: 100%; object-fit: cover; }
.work-body h1 { font-family: var(--serif); font-weight: 500; font-size: clamp(30px, 3.6vw, 44px); letter-spacing: -0.03em; line-height: 1.08; margin: 0 0 20px; }
.facts { display: grid; grid-template-columns: auto 1fr; gap: 0 24px; margin: 0 0 24px; border-top: 1px solid var(--ink); }
.facts dt, .facts dd { padding: 9px 0; border-bottom: 1px solid var(--line); margin: 0; font-size: 14px; }
.facts dt { font-size: 11px; letter-spacing: 0.12em; text-transform: uppercase; color: var(--muted); padding-top: 12px; }
.desc { font-family: var(--serif); font-size: 18px; line-height: 1.5; margin: 0 0 14px; max-width: 34em; }
.prevnext { display: flex; justify-content: space-between; gap: 16px; border-top: 1px solid var(--ink); margin-top: 32px; padding-top: 14px; font-size: 13px; }
.back { display: inline-block; margin-top: 24px; font-size: 13px; color: var(--muted); }
.page-error { padding: 60px 0; color: var(--muted); }

/* ---------- Подвал ---------- */
.footer {
  border-top: 1px solid var(--ink);
  padding: 28px 0 40px;
  font-size: 13px;
  color: var(--muted);
  display: flex; justify-content: space-between; gap: 24px;
  margin-top: 24px;
}
.footer-name { font-family: var(--serif); font-size: 18px; color: var(--ink); }
.footer-links a:hover { color: var(--accent); }

/* ---------- Адаптив ---------- */
@media (max-width: 900px) {
  .current { grid-template-columns: 1fr; gap: 28px; padding: 28px 0 32px; }
  .current-copy { order: 2; }
  .slide-img { height: min(110vw, 460px); }
  .news-row { grid-template-columns: 1fr; }
  .news-row article { border-right: 0; border-bottom: 1px solid var(--line); padding: 20px 0; }
  .nav { flex-wrap: wrap; gap: 12px 20px; }
  /* телефон/планшет: кружки НЕ уменьшаем — как в прототипе */
  .grid, .cat-grid { grid-template-columns: 1fr 1fr; gap: 40px 32px; width: 100%; }
  .cat-grid .cat-card:last-child:nth-child(odd) { grid-column: 1 / -1; width: calc(50% - 16px); justify-self: center; }
  .rgrid { grid-template-columns: 1fr 1fr; gap: 36px 20px; }
  .work { grid-template-columns: 1fr; gap: 28px; padding-top: 24px; }
  .ex-list li { grid-template-columns: 60px 1fr; gap: 6px 14px; }
  .ex-place { grid-column: 2; text-align: left; }
  .catalog-head { flex-direction: column; align-items: flex-start; gap: 14px; }
}
@media (max-width: 640px) {
  .wrap { width: calc(100% - 32px); }
  .footer { flex-direction: column; }
  .sec-title { font-size: 28px; }
  .topbar-left { max-width: 55%; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  .slider-bar { flex-direction: column; gap: 10px; }
  .slider-ctrl { align-self: flex-end; }
}
