/* ==========================================================================
   Vertical rhythm: loaded last so it governs section spacing site-wide.
   Audit (23 Nov 2026): 104px top + bottom on every section gave 208–314px of
   empty space between sections at 1440px, and same-colour neighbours stacked
   both paddings with nothing to separate them.
   ========================================================================== */

/* 44px on phones (mobile-ux-audit.md X4, was 56), 80px from ~1330px up. */
.aa-section { padding-top: clamp(2.75rem, 6vw, 5rem); padding-bottom: clamp(2.75rem, 6vw, 5rem); }

/* Two sections with the same background read as one: drop the second one's top padding. */
.aa-section--white:not(.aa-apply-sec) + .aa-section--white:not(.aa-apply-sec),
.aa-section:not(.aa-section--white):not(.aa-section--dark):not(.aa-apply-sec):not(.aa-cta-band):not(.aa-contact)
	+ .aa-section:not(.aa-section--white):not(.aa-section--dark):not(.aa-apply-sec):not(.aa-cta-band):not(.aa-contact) {
	padding-top: 0;
}

/* Section heads: a little less air before the content on large screens.
   :where() keeps this at single-class weight, so component overrides such as
   `.aa-cta-band .aa-head { margin-bottom: 0 }` still win. At full weight it added 44px
   under every CTA band and split heading (audit 23 Nov 2026). */
@media (min-width: 1024px) {
	:where(.aa-section) .aa-head { margin-bottom: 2.75rem; }
}

/* Stray top margin on the newsletter archive list. */
.aa-nl-posts { margin-top: 0 !important; }

/* Sections that hold a single padded card (brochure, apply) need less outer padding. */
.aa-bro-sec { padding-top: clamp(2.5rem, 4vw, 3.5rem); padding-bottom: clamp(2.5rem, 4vw, 3.5rem); }
@media (min-width: 1024px) { .aa-bro { padding: 3.25rem 4rem; } }

/* ==========================================================================
   Template review (23 Nov 2026)
   ========================================================================== */

/* Home: .aa-process is white on the home page without the --white modifier, so the
   same-background collapse above wrongly removed its top padding and the next section's. */
.aa-home > .aa-section.aa-process,
.aa-home > .aa-section.aa-process + .aa-section { padding-top: clamp(2.75rem, 6vw, 5rem) !important; }

/* Insights listing / category archive: the flow layout's block gap left a 20px band between hero and list. */
.aa-blog-hero + .aa-blog-list { margin-top: 0; }

/* Page hero followed by a section on the same ivory background: hero bottom padding + section
   top padding stacked to ~100px. Keep one comfortable gap instead. */
.aa-page-hero + .aa-section:not(.aa-section--white):not(.aa-section--dark):not(.aa-cta-band) { padding-top: 1rem; }

/* Internships: the apply section is ivory (careers.css) like the section before it. */
.aa-section:not(.aa-section--white):not(.aa-section--dark) + .aa-apply-sec { padding-top: 0; }

/* ==========================================================================
   Alignment audit (23 Nov 2026)
   ========================================================================== */

/* Flow-layout groups that the theme turns into grids still received WordPress's block gap
   (1.25rem margin-top on every child but the first). In a row that pushed the 2nd and 3rd
   items 20px below the first: post cards, hero forms, apply and contact forms. Grid gap
   alone now spaces them. */
.aa-cards__grid > *,
.aa-apply > *,
.aa-contact__grid > *,
.aa-svc-hero__grid > *,
.aa-home-hero__grid > *,
.aa-home-brochures__grid > *,
.aa-home-tools__grid > *,
.aa-co-hero__grid > *,
.aa-co-smhero__grid > *,
.aa-co-split > *,
.aa-inv-formwrap > * { margin-top: 0; }

/* The contact head sits in its own grid row; the section-head margin doubled the row gap. */
.aa-contact__grid > .aa-contact__head { margin-bottom: 0; }

/* Post cards: a clear gap between stacked cards and between desktop rows. */
.aa-cards__grid { row-gap: 1.5rem; }
@media (min-width: 782px) { .aa-cards__grid { row-gap: 2rem; } }

/* Session / referral forms: the head's own bottom margin stacked on the grid gap (80px). */
.aa-inv-formwrap > .aa-head { margin-bottom: 0; }
.aa-inv-formwrap { row-gap: 2.25rem; }

/* Narrow blocks in constrained sections (office card, sources, wide prose, timelines, notes,
   the FAQ search) were centred by the layout's auto margins, so they floated up to 300px in
   from the heading above them. Start them on the column's left edge instead: the margin is the
   space left over beside a 1280px column, or 0 when the screen is narrower than that. */
.is-layout-constrained > :is(.aa-city-office, .aa-inv-sources, .aa-inv-prose--wide, .aa-inv-ladder, .aa-inv-soon, .aa-inv-note, .aa-timeline-x, .aa-plans__note, .aa-faq-search) {
	margin-left: max(0px, (100% - var(--wp--style--global--wide-size, 1280px)) / 2) !important;
	margin-right: auto !important;
}

/* Padded boxes that are direct children of a constrained section got the 1280px column as
   their content width, so padding and border pushed their edges 20 to 40px past the cards
   above and below. Count padding inside the column. */
.aa-benefits,
.aa-inv-riskbox,
.aa-nl-card,
.aa-co-empty { box-sizing: border-box; }
