/*
 * 2leadership — minimal overrides for WordPress block defaults that fight
 * the imported YT4 CSS (yt4-bundle-1.css + yt4-bundle-2.css + yt4-legacy.css).
 *
 * Strategy: import the YT4 rendering layer verbatim; only patch the places
 * where WP block defaults can't be reached by the imported CSS. Keep this
 * file small — if a rule belongs to a block primitive we use heavily, add
 * it here; if it belongs to a single pattern, scope it inside that pattern.
 *
 * Decoration-style rules belong in decorations.css.
 */

/* Parent theme.json sets body font-size to var(--wp--preset--font-size--md)
   (clamp topping out at 22.5px) and line-height 1.6. We force the YT4
   baseline (20px / 1.25 / SourceSans3VF only). !important wins against the
   parent's element rules emitted via global-styles-inline-css. */
body {
	font-size: 20px !important;
	line-height: 1.25 !important;
	font-family: SourceSans3VF !important;
}

/* The .wp-block-group wrapper around our header/footer wp:html must not
   inherit the block-gap margin global-styles-inline-css emits as
   `:root :where(.is-layout-flow) > * { margin-block-start: var(--wp--preset--spacing--40) }`
   — that resolves to 28.6552px at 1440px viewport and shoves the chrome
   downwards. Two layers need pinning: WP wraps every template part in a
   `<header|footer class="wp-block-template-part">` element that is itself
   a direct child of `.wp-site-blocks` (the is-layout-flow container), and
   inside that lives our own `wp:group` outer. Both need margin: 0.
   Do NOT touch padding: the footer's `.uk-section` class supplies the
   vertical breathing room (~100px top/bottom) and we must keep that. */
header.wp-block-template-part,
footer.wp-block-template-part,
header.wp-block-group.tm-header,
footer.wp-block-group.footer-2L,
:where(.is-layout-flow) > header.wp-block-template-part,
:where(.is-layout-flow) > footer.wp-block-template-part,
:where(.is-layout-flow) > header.wp-block-group.tm-header,
:where(.is-layout-flow) > footer.wp-block-group.footer-2L {
	margin: 0 !important;
}

/* Third layer: our chrome wp:group itself uses `layout: default` so WP
   tags it `is-layout-flow`, and global-styles' direct-child margin rule
   then pushes every non-first child of the header (and footer) down by
   var(--wp--preset--spacing--40) ≈ 28.6552px @1440. On the header this
   shows up as the `.uk-navbar-container.uk-navbar-primary` nav row being
   shoved 30px below the headerbar row. Zero margin-block on every direct
   child of our wp:html chrome wrappers — UIkit's own `.uk-section` /
   `.uk-margin-*` rules supply intentional vertical rhythm where it's
   wanted, so blanketing margin-block does no harm here. */
header.wp-block-group.tm-header > *,
footer.wp-block-group.footer-2L > * {
	margin-block-start: 0 !important;
	margin-block-end: 0 !important;
}

/* Fourth layer of the same is-layout-flow injection: the page body itself
   renders as `<main class="wp-block-group is-layout-flow">` containing
   `<div class="entry-content wp-block-post-content is-layout-flow">`. Both
   wrappers fire the `:root :where(.is-layout-flow) > * { margin-block-start:
   var(--wp--preset--spacing--40) }` rule on their non-first children. On
   most pages the first direct child of .entry-content is a <div class="uk-section">
   (so :first-child zeroes it and UIkit padding handles section rhythm) —
   but home.html starts with a <style> block carrying scoped per-section
   CSS, making the hero <div> the SECOND child and inheriting ~28.6552px
   margin-top that the live site does not have. Same fix as the chrome
   wrappers: blanket-zero margin-block on every direct child of <main>
   and .entry-content. UIkit `.uk-section` / `.uk-margin-*` supplies the
   intentional rhythm inside each section. */
main.wp-block-group > *,
.entry-content.wp-block-post-content > * {
	margin-block-start: 0 !important;
	margin-block-end: 0 !important;
}

/* The Site-Editor injects a `is-layout-constrained` wrapper class on parent
   groups that gets `max-width: var(--wp--style--global--content-size)`. Our
   header/footer outer wrap is align=full but the .alignfull rule still has
   a max-width: none — let it through. */
header.wp-block-group.alignfull,
footer.wp-block-group.alignfull {
	max-width: none;
	width: 100%;
}

/* Floating contact button container — the wp:pattern reference must not
   inherit the footer's text-color (white) which would invert the SVG. */
.footer-2L #modal_link_contact .contact-cta-link svg {
	fill: currentColor;
}

/* Calendly inline widget — force the iframe to fill its `.calendly-inline-widget`
   parent (height: 620px from yt4-legacy.css). Without this, Calendly's loader
   leaves the iframe at its intrinsic 150px height on first paint, which on
   slower environments stays at 150px because Calendly's content-resize
   postMessage handshake doesn't always re-grow the iframe past the initial
   empty state. yt4-legacy.css only sets border-radius on the iframe; the live
   YT4 site renders 620px iframes anyway because YT's theme.js or older
   Calendly widget builds set the height eagerly. Until we identify which
   moving piece does that on live, this rule guarantees the iframe matches
   its container in both environments. */
.calendly-inline-widget iframe {
	height: 100% !important;
	width: 100% !important;
}

/* Subpage-hero rounded-left corners for image-backed hero columns
   (team-kathrin, team-rolf). YT4 captured these as a per-page inline
   <style> against the YT builder ID #page#0; consolidated here since
   both pages need the same rule. Video-backed heroes (andreas etc.)
   don't need this since the <video> element itself doesn't extend
   beyond the rounded container. */
.subpage-hero-2L .sph-first-column .uk-position-cover {
	border-radius: 15px 0 0 15px;
}

/* Contact CTA arrow — purple curved arrow above the Andreas+Calendly grid
   (home, leistungen, ueber-uns). Paired with the .contact-cta-author column
   rule scoped inside patterns/contact-calendly.php. */
.contact-cta-arrow .el-image {
	transform: scaleX(-1) rotate(30deg);
}
