/* Plaquette Mécénat — 4 страницы A4, светлый editorial design-pass.
   Trim 1240×1754 CSS px = 210×297 мм; .sheet 1276×1790 (вылеты 18 px ≈ 3 мм).
   Рендер @2x → 2480×3508 px = 300 dpi. Токены — BRAND.md. */

@import url("assets/fonts.css");

:root {
  /* Cormorant по умолчанию даёт старостильные цифры — для сумм нечитаемо */
  --forest-green:       #1E3A2F;
  --deep-forest-black:  #121B17;
  --imperial-burgundy:  #5C2A2A;
  --warm-charcoal:      #1D1A17;
  --parchment:          #F7F2E9;
  --museum-paper:       #FBF8F3;
  --dusty-beige:        #EDE3D4;
  --antique-gold:       #C9B48A;
  --aged-bronze:        #9D7C4A;
  --soft-beige-line:    #D9CEC0;
  --ink:                #1D1A17;
  /* muted и бронза для мелкого текста затемнены до 4.5:1 на museum-paper:
     исходные #7E766D (4.22) и #9D7C4A (3.66) порог не проходили. */
  --ink-muted:          #6A6259;
  --bronze-text:        #82633A;
  --photo-outline:      rgba(157, 124, 74, 0.45);
  --serif: 'Cormorant Garamond', 'Cormorant', Georgia, serif;
  --sans:  'Inter', 'Helvetica Neue', Helvetica, Arial, sans-serif;
}

* { margin: 0; padding: 0; box-sizing: border-box; }

.sheet {
  width: 1276px; height: 1790px;
  display: flex; align-items: center; justify-content: center;
  background: var(--museum-paper);
  overflow: hidden;
}
.page {
  position: relative;
  width: 1240px; height: 1754px;
  overflow: hidden;
  background: var(--museum-paper);
  color: var(--ink);
  font-family: var(--sans);
  font-weight: 400;
  font-size: 18px;
  line-height: 1.45;
  padding: 98px 92px 90px;
  display: flex; flex-direction: column;
}

.phead, .pfoot {
  position: absolute; left: 92px; right: 92px;
  display: flex; align-items: baseline; gap: 16px;
  font-family: var(--sans); font-weight: 500;
  font-size: 11.5px; letter-spacing: 2.4px; text-transform: uppercase;
  color: var(--ink-muted);
  white-space: nowrap;
}
.phead { top: 44px; }
.pfoot { bottom: 40px; }
.phead::after, .pfoot::after {
  content: ""; flex: 1 1 auto; height: 1px; align-self: center;
  background: currentColor; opacity: 0.35;
}
.phead .pright, .pfoot .pright { order: 9; }
.phead::after, .pfoot::after { order: 5; }

.eyebrow {
  font-family: var(--sans); font-weight: 500;
  font-size: 13px; letter-spacing: 3px; text-transform: uppercase;
  color: var(--bronze-text);
  margin-bottom: 10px;
}
h1, h2 { font-family: var(--serif); font-weight: 500; }
.title {
  font-size: 46px; line-height: 1.08; letter-spacing: -0.2px;
  color: var(--imperial-burgundy);
  margin-bottom: 12px;
}
.title-hero {
  font-size: 42px; line-height: 1.1; text-align: left;
  letter-spacing: -0.4px;
  color: var(--imperial-burgundy);
  max-width: 760px;
  margin: 0 0 20px;
}
.subtitle {
  font-family: var(--serif); font-style: italic; font-weight: 500;
  font-size: 24px; color: var(--bronze-text);
  margin-bottom: 20px;
}
.lead { font-size: 21px; font-weight: 400; line-height: 1.5; }
/* p01: клиент (31.08) — крупнее логотип, «Institut Rachmaninoff» над заголовком,
   больше воздуха между блоками, чуть крупнее шрифты; низ страницы не пустует. */
.p01-institut {
  font-family: var(--serif); font-weight: 600;
  font-size: 48px; letter-spacing: 2px; text-transform: uppercase;
  color: var(--bronze-text);
  line-height: 1.1;
  margin-bottom: 14px;
}
.p01-hero {
  display: grid; grid-template-columns: minmax(0, 1fr) 320px;
  gap: 40px; align-items: center;
  padding: 18px 0 32px;
  border-bottom: 1px solid var(--antique-gold);
}
.p01-heading .lead {
  max-width: 760px;
  color: var(--ink-muted);
}
.p01-mark {
  min-height: 340px;
  display: flex; align-items: center; justify-content: center;
}
#p01 .logo { width: 300px; }
.manifesto {
  font-family: var(--serif); font-style: italic; font-weight: 400;
  font-size: 32px; line-height: 1.3; text-align: left;
  color: var(--warm-charcoal);
  max-width: 900px;
  margin: 34px 0 30px 164px;
}
.rule {
  width: 72px; height: 1px; border: 0;
  background: var(--antique-gold);
  margin: 18px auto;
}

.logo {
  display: block; margin: 0 auto;
  width: 200px; height: auto;
}
.logo-sm {
  display: block; margin: 0 auto 18px;
  width: 240px; height: auto;
}

/* Группы миссий занимают всю оставшуюся высоту и распределяются равномерно до футера. */
.missions {
  display: flex; flex-direction: column; gap: 24px; margin-top: 0;
  flex: 1 1 auto; justify-content: space-evenly; padding-bottom: 10px;
  counter-reset: mission;
}
.mission-group { min-height: 132px; }
.mission-group .mg-title {
  font-family: var(--sans); font-weight: 600; font-size: 15px;
  letter-spacing: 2.4px; text-transform: uppercase;
  color: var(--bronze-text);
  display: flex; align-items: center; gap: 14px;
  margin-bottom: 12px;
}
.mission-group .mg-title::after { content: ""; flex: 1; height: 1px; background: var(--soft-beige-line); }
.mission-pair { display: grid; grid-template-columns: 1fr 1fr; gap: 10px 38px; }
.mission .m-name {
  font-family: var(--serif); font-weight: 600;
  font-size: 26px; line-height: 1.16; margin-bottom: 6px;
}
/* Номера 1.-10. есть в исходнике клиента; рисуем счётчиком, в content.json не вносим. */
.mission .m-name::before {
  counter-increment: mission;
  content: counter(mission) ". ";
  font-variant-numeric: lining-nums;
  color: var(--bronze-text);
}
.mission .m-desc { font-size: 20px; color: var(--ink-muted); line-height: 1.38; }

/* p02: клиент (31.08) — фото и таблица одной высоты (пропорция сохранена, пустоты
   под фото нет), чуть крупнее цифры, закрывающий абзац ближе к блоку. */
.budget-composition {
  display: grid; grid-template-columns: 390px minmax(0, 1fr);
  gap: 40px; align-items: stretch;
  margin-top: 115px; /* клиент (31.08): блок по центру свободного пространства (зазоры сверху/снизу ~135/134) */
}
.budget-panel { min-width: 0; }

.budget-grid {
  display: grid; grid-template-columns: 1fr; gap: 36px;
  align-items: start;
}
table.budget {
  width: 100%; border-collapse: collapse;
  font-size: 18px; line-height: 1.32;
}
/* Заголовок таблицы — div, не <caption>: html-to-image (экспорт PDF/PPTX)
   не учитывал высоту caption, и всё после таблицы налезало вверх. */
.budget-caption {
  text-align: left;
  font-family: var(--serif); font-weight: 600; font-size: 28px;
  color: var(--imperial-burgundy);
  padding-bottom: 10px;
}
table.budget td {
  padding: 9.5px 0; border-bottom: 1px solid var(--soft-beige-line);
  vertical-align: top;
}
table.budget td:first-child { padding-right: 12px; }
table.budget td.amount {
  /* onum во вложенном Inter отсутствует - объявление ничего не давало, снято. */
  text-align: right; white-space: nowrap;
  font-weight: 500; width: 110px;
}
/* Итоговая строка — div после таблицы (не tfoot: html-to-image терял его высоту при экспорте). */
.budget-total {
  display: flex; justify-content: space-between; align-items: baseline; gap: 12px;
  border-top: 1.5px solid var(--warm-charcoal);
  font-family: var(--serif); font-weight: 600; font-size: 22px;
  font-variant-numeric: lining-nums;
  padding-top: 12px;
}
.budget-total .amount { white-space: nowrap; }
table.budget .budget-error td { color: var(--imperial-burgundy); font-size: 13px; }

.footnote {
  font-size: 15px; color: var(--ink-muted); line-height: 1.42;
  margin-top: 22px;
}
.body-close {
  width: 100%;
  font-family: var(--serif); font-weight: 500;
  font-size: 30px; line-height: 1.34;
  color: var(--imperial-burgundy);
  margin-top: auto; margin-bottom: 48px; padding-top: 34px;
  border-top: 1px solid var(--antique-gold);
  text-wrap: balance;
}

.vignette {
  margin: 0; width: 100%; height: auto; min-height: 780px; align-self: stretch;
  position: relative; overflow: hidden;
}
.vignette img {
  display: block; width: 100%; height: 100%;
  object-fit: cover; object-position: 46% center;
  outline: 1px solid var(--photo-outline); outline-offset: 6px;
}

/* p03: клиент (31.08) — проекты растянуты на всю высоту с равными интервалами,
   фото ниже, шрифты чуть крупнее. */
.projects {
  display: flex; flex-direction: column; gap: 18px; margin-top: 16px;
  flex: 1 1 auto; justify-content: space-evenly;
}
.project {
  border-top: 1px solid var(--soft-beige-line);
  padding: 16px 0 8px;
  display: grid;
  grid-template-columns: 170px 1fr;
  gap: 5px 22px;
}
.project .pr-amount {
  font-family: var(--serif); font-weight: 600; font-size: 30px; line-height: 1.1;
  color: var(--imperial-burgundy);
  font-variant-numeric: lining-nums;
}
.project .pr-title {
  font-family: var(--serif); font-weight: 600; font-size: 25px; line-height: 1.18;
  align-self: center;
}
.project .pr-copy { grid-column: 1 / -1; }
.project .pr-copy [data-field]:empty { display: none; }
.project .pr-copy { font-size: 17.5px; color: var(--ink-muted); line-height: 1.4; }
.project .pr-copy [data-field] + [data-field]:not(:empty) { margin-top: 4px; }

.photos-row {
  display: flex; gap: 24px; margin-top: 30px; margin-bottom: 16px;
}
.photos-row figure {
  flex: 1 1 0; min-width: 0;
}
.photos-row img {
  display: block; width: 100%; height: 400px; object-fit: cover;
  outline: 1px solid var(--photo-outline); outline-offset: 5px;
}

#p03 .subtitle {
  align-self: flex-start;
  font-family: var(--sans); font-style: normal; font-weight: 600;
  font-size: 26px; line-height: 1.2;
  color: var(--imperial-burgundy);
  padding: 8px 0 11px;
  border-bottom: 2px solid var(--antique-gold);
  margin-bottom: 20px;
}
#p03 > .lead { font-size: 20px; color: var(--ink-muted); }

/* p04: клиент (31.08) — реквизиты текстом вместо скана RIB, блоки распределены
   по высоте равномерно, шрифты чуть крупнее. */
.cta-intro {
  text-align: center; font-size: 21px; line-height: 1.5;
  max-width: 860px; margin: 0 auto;
}
.donate-row {
  display: grid; grid-template-columns: 224px minmax(0, 1fr); gap: 44px;
  align-items: center; margin: 0;
}
.donate-block { text-align: center; }
.donate-block .label {
  font-family: var(--sans); font-weight: 500; font-size: 13px;
  letter-spacing: 2.2px; text-transform: uppercase; color: var(--bronze-text);
  margin-bottom: 14px;
}
.qr img {
  width: 205px; height: 205px; image-rendering: pixelated;
  display: block; margin: 0 auto;
}
.bank {
  text-align: left;
  background: var(--parchment);
  border: 1px solid var(--soft-beige-line);
  padding: 22px 30px;
  display: grid; grid-template-columns: 1fr; gap: 12px;
}
.bank > div { display: grid; grid-template-columns: 118px 1fr; gap: 14px; align-items: baseline; }
.bank dt {
  font-family: var(--sans); font-weight: 500; font-size: 12.5px;
  letter-spacing: 2px; text-transform: uppercase; color: var(--bronze-text);
}
.bank dd { font-size: 18px; line-height: 1.4; color: var(--ink); }
.bank dd.mono {
  font-family: var(--serif); font-weight: 600; font-size: 24px; letter-spacing: 0.6px;
  font-variant-numeric: lining-nums; white-space: nowrap;
}
.bank .bank-sub { font-size: 14.5px; color: var(--ink-muted); }

.notes {
  font-size: 18.5px; line-height: 1.5;
  padding: 26px 28px;
  border-top: 1px solid var(--soft-beige-line);
  border-bottom: 1px solid var(--soft-beige-line);
}
.notes p + p { margin-top: 10px; }
.closing {
  font-family: var(--serif); font-style: italic; font-weight: 400;
  font-size: 27px; line-height: 1.4; text-align: center;
  color: var(--imperial-burgundy);
  margin: 0 auto;
  max-width: 900px;
}
.contact {
  text-align: center; font-size: 17px; line-height: 1.5;
  color: var(--ink);
}
.contact .org { margin-top: 8px; color: var(--ink-muted); font-size: 16px; }

/* Шапка (заголовок+лого+вводка) — один блок; остаток высоты space-between делит
   поровну между шапкой, реквизитами, примечаниями, слоганом и контактами. */
#p04 { justify-content: space-between; padding-bottom: 110px; }
.p04-head .title { font-size: 48px; margin-bottom: 28px; }
/* У webp-логотипа ~55px прозрачных полей сверху/снизу — компенсируем. */
.p04-head .logo-sm { width: 280px; margin: -24px auto 6px; }

/* Пустое необязательное поле не оставляет ни линейки, ни вертикального зазора.
   Ячейки таблиц исключены: display:none сломал бы строку. */
.subtitle:empty,
.lead:empty,
.footnote:empty,
.cta-intro:empty,
.donate-block .label:empty,
.notes p:empty,
.contact .org:empty { display: none; }

.spacer { flex: 1 1 auto; }
