/* One spacing scale for the whole site (user 22.11). Loaded after styles.css on every page (inc/spacing.php).
   - section padding (top and bottom): 72 computers / 56 up to 1280px / 44 phones (--section-padding-y);
   - two white sections in a row: one padding + a quarter (not two paddings; also when a <style>/<script> sits between them);
   - next to a grey section: half a padding on the white side (as before, now also with code between them);
   - section title -> its text: 14 / 12 / 10, the text -> the content: 40 / 32 / 24. */
:root { --section-padding-y: 72px; --vw-head-gap: 14px; --vw-head-mb: 40px; }
@media (max-width: 1280px) { :root { --section-padding-y: 56px; --vw-head-gap: 12px; --vw-head-mb: 32px; } }
@media (max-width: 799px) { :root { --section-padding-y: 44px; --vw-head-gap: 10px; --vw-head-mb: 24px; } }

/* white after white: a quarter of a padding on top (the earlier rule kept 0.4, and missed sections with code between them) */
.section:not(.bg-grey):not(.extra-bg):not(.section__archive) + .section:not(.bg-grey):not(.extra-bg),
.section:not(.bg-grey):not(.extra-bg):not(.section__archive) + :is(style, script, link, noscript) + .section:not(.bg-grey):not(.extra-bg),
.section:not(.bg-grey):not(.extra-bg):not(.section__archive) + :is(style, script, link, noscript) + :is(style, script, link, noscript) + .section:not(.bg-grey):not(.extra-bg) { padding-top: calc(var(--section-padding-y) * .25); }
/* next to grey: half a padding on the white side, also when code sits between them */
.bg-grey + :is(style, script, link, noscript) + .section:not(.bg-grey) { padding-top: calc(var(--section-padding-y) * .5); }
.section:not(.bg-grey):has(+ :is(style, script, link, noscript) + .bg-grey) { padding-bottom: calc(var(--section-padding-y) * .5); }

/* section header: title -> text -> content */
.section__header, .section__header-block { gap: var(--vw-head-gap); row-gap: var(--vw-head-gap); }
.section__header:not(:last-child) { margin-bottom: var(--vw-head-mb); }
/* "איך זה עובד": the same header gap and bottom as every section (it had its own 14px / 8px on phones) */
@media (max-width: 799px) { .section:has(> .section__body > .hw) > .section__header { margin-bottom: var(--vw-head-mb); } }
@media (max-width: 1029px) { .section:has(> .section__body > .hw) { padding-bottom: var(--section-padding-y); } }
