/* ============================================================================
   aca-cms — pages rebuilt in the design system (template "designed").
   Bodies use base.css components; the page groups' own additions live in
   assets/pages/{group}.css. This file sets the one vertical rhythm all of
   them share, so blocks never touch and sections never drift apart:
     block after block ............ 24px
     heading or section after block  48px
     heading → its content ........ 16px (section-head: 24px)
   ============================================================================ */
.designed{--rhythm-block:var(--space-5); --rhythm-section:var(--space-7)}

/* Sections carry no padding of their own inside a page: the rhythm spaces them. */
.designed section,.designed .section-sm{padding:0}

/* Containers whose children are page blocks: the body, a group wrapper, a section. */
:is(.designed, .designed > [class*="pg-"], .designed section, .designed [class*="pg-"] > section) > * + *{margin-top:var(--rhythm-block)}
:is(.designed, .designed > [class*="pg-"], .designed section, .designed [class*="pg-"] > section) > * + :is(section, .section-sm, h2){margin-top:var(--rhythm-section)}
:is(.designed, .designed > [class*="pg-"], .designed section, .designed [class*="pg-"] > section) > :is(h2, h3){margin-bottom:0}
:is(.designed, .designed > [class*="pg-"], .designed section, .designed [class*="pg-"] > section) > :is(h2, h3) + *{margin-top:var(--space-4)}
:is(.designed, .designed > [class*="pg-"], .designed section, .designed [class*="pg-"] > section) > * + h3{margin-top:var(--space-6)}
:is(.designed, .designed > [class*="pg-"], .designed section, .designed [class*="pg-"] > section) > p + p{margin-top:var(--space-4)}
.designed .section-head{margin-bottom:0}
.designed .section-head + *{margin-top:var(--space-5)}
.designed > :first-child,.designed > [class*="pg-"] > :first-child{margin-top:0}
.designed :is(p, ul, ol, dl, .grid-2, .grid-3, .grid-4, .table-wrap, .notice, .chart-card, .faq, .timeline, .box):last-child{margin-bottom:0}

/* Tables with bars (appeal reports, indicators): numbers take only the room they need,
   so long names ("Государственные нужды и заказы …") get the width instead of wrapping word by word. */
.designed table td.n,.designed table th.n{width:1%; white-space:nowrap}
.designed table th[scope="row"]{min-width:14rem; font-weight:500}
.designed table .rbar{min-width:4px}

/* Blocks nested one level deeper (inside a box, a card body or an unnamed wrapper) keep the same distance. */
.designed :is(.prose,.grid-2,.grid-3,.grid-4,.table-wrap,.notice,.chart-card,.faq,.timeline,.people,.org,.gallery-grid) + :is(.prose,.grid-2,.grid-3,.grid-4,.table-wrap,.notice,.chart-card,.faq,.timeline,.people,.org,.gallery-grid){margin-top:var(--rhythm-block)}
.designed :is(h2, h3) + :is(.table-wrap,.grid-2,.grid-3,.grid-4,.chart-card){margin-top:var(--space-4)}
