/* r13 (2026-12-01): sitewide vertical rhythm on one 4/8 px scale. Loaded last on every page (mu-plugins/hm-r13.php).
   Tokens: --hm-sp-1..16 = 4,8,12,16,20,24,32,40,48,64 px. Section gap 64 px desktop / 40 px mobile (home keeps its r10 rhythm).
   Title -> subtitle 12–16 px; title/subtitle -> content 36 px (24 mobile); card title -> text 8 px. */
:root { --hm-sp-1: 4px; --hm-sp-2: 8px; --hm-sp-3: 12px; --hm-sp-4: 16px; --hm-sp-5: 20px; --hm-sp-6: 24px; --hm-sp-8: 32px; --hm-sp-10: 40px; --hm-sp-12: 48px; --hm-sp-16: 64px; --hm-sec: 64px; }
@media (max-width: 640px) { :root { --hm-sec: 40px; } }

/* 0. header -> breadcrumbs -> hero: 20 / 20 px desktop, 14 / 16 px mobile (all templates incl. r12) */
body.hm-r1 main > section:first-of-type:has(> .hm-container > .hm-crumbs:first-child) { padding-top: var(--hm-sp-5) !important; }
body.hm-r1 .hm-crumbs { margin-top: 0 !important; margin-bottom: var(--hm-sp-5) !important; }
@media (max-width: 640px) {
  body.hm-r1 main > section:first-of-type:has(> .hm-container > .hm-crumbs:first-child) { padding-top: 14px !important; }
  body.hm-r1 .hm-crumbs { margin-bottom: var(--hm-sp-4) !important; }
}

/* 00. inner pages: one section rhythm (top padding only, 64 / 40 px) */
body.hm-r1:not(.home) main > .hm-r3-sec,
body.hm-r1:not(.home) main > .hm-tariffs,
body.hm-r1:not(.home) main > .hm-r12-cfg > .hm-tariffs,
body.hm-r1:not(.home) main > .hm-r2-incl,
body.hm-r1:not(.home) main > .hm-r2-panel,
body.hm-r1:not(.home) main > .hm-r2-contact,
body.hm-r1:not(.home) main > .hm-r2-cta,
body.hm-r1:not(.home) main > .hm-r2-crypto,
body.hm-r1:not(.home) main > .hm-landing-depth { padding-top: var(--hm-sec); padding-bottom: 0; }
/* end of page -> footer: one gap (main bottom padding), last section adds nothing */
body.hm-r1:not(.home) main.hm-main { padding-bottom: var(--hm-sec); }
body.hm-r1:not(.home) main.hm-main > section:last-child,
body.hm-r1:not(.home) main > .hm-r3-last { padding-bottom: 0; margin-bottom: 0; }
/* pages where the shared incl / contact / CTA bands follow <main>: same 64 / 40 px steps, one gap before the footer */
body.hm-r1:not(.home) main.hm-main:has(+ section) { padding-bottom: 0; }
body.hm-r1:not(.home) main.hm-main ~ section.hm-r2-incl,
body.hm-r1:not(.home) main.hm-main ~ section.hm-r2-contact,
body.hm-r1:not(.home) main.hm-main ~ section.hm-r2-cta { padding-top: var(--hm-sec); padding-bottom: 0; }
body.hm-r1:not(.home) main.hm-main ~ section.hm-r2-incl:has(+ footer),
body.hm-r1:not(.home) main.hm-main ~ section.hm-r2-contact:has(+ footer),
body.hm-r1:not(.home) main.hm-main ~ section.hm-r2-cta:has(+ footer) { padding-bottom: var(--hm-sec); }
/* note strip attached to the prose card above it */
body.hm-r1 main > .hm-r12c-note-sec { padding-top: var(--hm-sp-6); padding-bottom: 0; }
@media (max-width: 640px) { body.hm-r1 main > .hm-r12c-note-sec { padding-top: var(--hm-sp-4); } }
/* contacts / support: blocks after the "ways" cards */
body.hm-r1 main > .hm-gh-ways { padding-bottom: 0; }
body.hm-r1 main > .hm-gh-ways + .hm-gh-form,
body.hm-r1 main > .hm-gh-ways + .hm-gh-guide { margin-top: var(--hm-sec); }
body.hm-r1 main > .hm-gh-form, body.hm-r1 main > .hm-gh-guide { margin-bottom: 0; }


/* 1. r3/r4 section titles followed directly by a grid/card block (no subtitle) had 0 gap */
body.hm-r1 .hm-container > .hm-r3-h2 + :not(p):not(.hm-r3-sub):not(h2):not(h3) { margin-top: 2.25rem; }
/* 2. r3 title followed by any other lead paragraph */
body.hm-r1 .hm-r3-h2 + p:not(.hm-r3-sub) { margin-top: .9rem; }
body.hm-r1 .hm-container > .hm-r3-h2 + p:not(.hm-r3-sub) + :not(p) { margin-top: 2.25rem; }

/* 3. page titles -> lead / meta */
body.hm-r1 .hm-landing__title { margin-bottom: clamp(.8rem, 1.3vw, 1.15rem); }
.hm-article__title { margin-bottom: .8rem; }

/* 4. home: compact r9/r10 heads */
.hm-r9svc__head h2 { margin-bottom: .7rem; }
.hm-r9help h3 { margin-bottom: .45rem; }
.hm-rstorage__intro h3 { margin-bottom: .45rem; }
body.home.hm-r1 .hm-rstorage .hm-rhead { row-gap: .6rem; }

/* 5. guide/prose blocks on landings */
.hm-landing-prose .hm-landing-depth__block h2.wp-block-heading { margin-bottom: 1rem; }

/* 6. generic card titles in r3/r4 grids: h3 -> text */
body.hm-r1 .hm-r3-card h3, body.hm-r1 .hm-r4-link h3 { margin-bottom: .55rem; }

@media (max-width: 640px) {
  body.hm-r1 .hm-container > .hm-r3-h2 + :not(p):not(.hm-r3-sub):not(h2):not(h3),
  body.hm-r1 .hm-container > .hm-r3-h2 + p:not(.hm-r3-sub) + :not(p),
  body.hm-r1 .hm-r3-sub + * { margin-top: 1.5rem; }
  body.hm-r1 .hm-container > .hm-r3-h2 + p:not(.hm-r3-sub) { margin-top: .7rem; }
  .hm-r9t__head { row-gap: .5rem; }
}
