/**
 * OptConnect footer (PR 2.2).
 *
 * Two full-bleed bands under `parts/footer.html` → `patterns/footer.php`: band 1
 * (accent-1 / OC Blue) holds two vertical link menus and the HubSpot newsletter
 * form; band 2 (accent-2 / OC Blue Dark) holds the social icons and the
 * copyright line. After them come the site-wide `optconnect/popup` dialogs
 * (PR 5.2), which need nothing from this file.
 *
 * The 1000px inner width is set per-block via the constrained layout attribute,
 * not here, so the Site Editor canvas draws the same guide as the front end.
 *
 * Deliberate deviations from the Elementor original (PR 2.2 "parity + fix"):
 *   - nav link `line-height: 10px` → a normal 1.5 (glyphs overlapped their line
 *     box; the live 13px padding existed only to undo that);
 *   - social icons 16px → 24px, keeping core's padding for a ~36px tap target;
 *   - the 30% / 67% mobile column split → a clean full-width stack;
 *   - Open Sans 400 → the theme's Rubik body face (PR 1.1 brand tokens).
 *
 * Breakpoint 781px matches WordPress's own mobile breakpoint used by core blocks
 * and by PR 2.1's header, so the footer restacks in step with the rest of the
 * page — core/columns already forces `flex-basis: 100%` there. The live footer's
 * 767px is deliberately not matched; fighting core would need `!important`.
 * 1024px is kept only for the band padding step-down.
 */

/* --------------------------------------------------------------------------
 * Shell + bands
 * ---------------------------------------------------------------------- */
.oc-footer {
	color: #fff;
}

/* The root block gap would open a strip of page background between the last
   section and the footer; the bands are spaced by the pattern's `blockGap: 0`. */
.wp-site-blocks > footer.wp-block-template-part {
	margin-block-start: 0;
}

.oc-footer__cols {
	margin-bottom: 0;
	align-items: center;
}

/* --------------------------------------------------------------------------
 * Link menus
 * core/navigation calls get_block_wrapper_attributes() twice — once for the
 * <nav> and once for the inner <ul> — so `oc-footer__nav` lands on BOTH. Scope
 * by tag or by child, or every gap and padding applies twice.
 * ---------------------------------------------------------------------- */
nav.oc-footer__nav {
	flex: 0 1 auto;
	min-width: 0;
}

nav.oc-footer__nav > .wp-block-navigation__container {
	align-items: flex-start;
}

.oc-footer__nav .wp-block-navigation-item__content {
	display: block;
	padding: 0;
	color: #fff;
	font-family: var(--wp--preset--font-family--rubik, sans-serif);
	font-size: 0.9375rem;
	font-weight: 400;
	line-height: 1.5;
	text-decoration: none;
}

.oc-footer__nav .wp-block-navigation-item__content:hover,
.oc-footer__nav .wp-block-navigation-item__content:focus-visible {
	color: var(--wp--preset--color--accent-5, #eff2f8);
	text-decoration: underline;
}

/* --------------------------------------------------------------------------
 * Newsletter (HubSpot form via the leadin plugin's [hubspot] shortcode)
 * ---------------------------------------------------------------------- */
.oc-footer__newsletter {
	min-width: 0;
}

.oc-footer__newsletter .hbspt-form,
.oc-footer__newsletter .hs-form-frame {
	max-width: 100%;
}

/* HubSpot injects its own markup after paint; keep labels legible on the OC
   Blue band without reaching into HubSpot's internal class names. */
.oc-footer__newsletter label,
.oc-footer__newsletter legend {
	color: #fff;
}

/* --------------------------------------------------------------------------
 * Social icons
 * Core's brand backgrounds ship at zero specificity — `:where(...)
 * .wp-social-link-linkedin` is (0,1,0) — so a two-class selector clears them.
 * Never set iconBackgroundColor* in the block JSON: that serialises an inline
 * background onto each <li> which no stylesheet can beat.
 * ---------------------------------------------------------------------- */
.oc-footer__social .wp-social-link {
	background-color: transparent;
}

/* Core's `padding: .25em` on the anchor gives a ~36px box at 24px icons. */
.oc-footer__social .wp-block-social-link.wp-social-link .wp-block-social-link-anchor {
	padding: 0.25em;
}

/* Beats core's `color/fill: currentColor` at (0,4,1) — both properties must be
   set, since `fill` is re-declared there independently of `color`. */
.oc-footer__social .wp-block-social-link.wp-social-link:hover .wp-block-social-link-anchor,
.oc-footer__social .wp-block-social-link.wp-social-link:focus-within .wp-block-social-link-anchor,
.oc-footer__social .wp-block-social-link.wp-social-link:hover .wp-block-social-link-anchor svg,
.oc-footer__social
	.wp-block-social-link.wp-social-link:focus-within
	.wp-block-social-link-anchor
	svg {
	color: #00ce1b;
	fill: #00ce1b;
}

/* --------------------------------------------------------------------------
 * Copyright
 * ---------------------------------------------------------------------- */
.oc-footer__copyright {
	margin: 0;
	color: #fff;
	font-family: var(--wp--preset--font-family--rubik, sans-serif);
	font-size: 0.875rem;
	line-height: 1.5;
	text-align: start;
}

/* --------------------------------------------------------------------------
 * Tablet (<= 1024px): match the live band padding step-down
 * ---------------------------------------------------------------------- */
@media (max-width: 1024px) {
	.oc-footer__band {
		padding-top: 30px;
		padding-bottom: 30px;
	}
}

/* --------------------------------------------------------------------------
 * Mobile (<= 781px): full-width stack
 * core/columns already forces `flex-basis: 100% !important` here, so this only
 * handles alignment and the centred copyright.
 * ---------------------------------------------------------------------- */
@media (max-width: 781px) {
	.oc-footer__band {
		padding-top: 25px;
		padding-bottom: 25px;
	}

	.oc-footer__legal-row {
		justify-content: center;
	}

	.oc-footer__social {
		justify-content: center;
		width: 100%;
	}

	.oc-footer__copyright {
		width: 100%;
		text-align: center;
	}
}

/* --------------------------------------------------------------------------
 * Site Editor canvas fixes
 * Selectors containing `.editor-styles-wrapper` are passed through unprefixed
 * by the editor's style transform, so they only ever apply inside the canvas.
 * ---------------------------------------------------------------------- */

/* core/shortcode renders as a plain-text field in the editor and would
   otherwise inherit the band's white text on its own light chrome. */
.editor-styles-wrapper .oc-footer .wp-block-shortcode {
	padding: 0.5rem 0.75rem;
	border-radius: 4px;
	background: var(--wp--preset--color--base, #ffffff);
	color: var(--wp--preset--color--contrast, #1d2c38);
}

/* The editor renders the social icons without social-link's server-side inline
   colour, so assert white to match the front end. */
.editor-styles-wrapper .oc-footer__social .wp-social-link {
	color: #fff;
}
