/* Info Grove base styles: utility classes shared by templates, patterns and the block editor.
   Colours come from the theme.json palette (--wp--preset--color--*). */

/* ===== iOS Safari scroll fix — REQUIRED, do not remove =====
   The Zakra theme sets `html, body { overflow-x: hidden }`. Per the CSS spec,
   overflow-x:hidden forces the other axis to compute to overflow-y:auto, which
   turns <body> into its OWN scroll container. On desktop this is harmless (the
   browser scrolls <html>), but iOS Safari — when <body> is a scroll container
   AND a position:fixed element (this header) is on screen at load — tries to
   scroll <body>, which has no overflow of its own, and the page FREEZES (you
   can't scroll on iPhone).

   `overflow-x: clip` clips horizontal overflow exactly like hidden (the page has
   a very wide carousel that must stay clipped) but, unlike hidden, does NOT
   force overflow-y to auto — so <body> stops being a vertical scroll container
   and iOS scrolls <html> normally again. clip is supported on iOS Safari 16+. */
body {
	overflow-x: clip;
	overflow-y: visible;
}

/* ===== Focus: 2px blue, light blue on dark backgrounds ===== */
:focus-visible {
	outline: 2px solid var(--wp--preset--color--blue);
	outline-offset: 2px;
}
.ig-on-dark :focus-visible {
	outline-color: var(--wp--preset--color--light-blue);
}

/* ===== Headings: lines of even length, so a heading never wraps with one word alone on its last line ===== */
:is(h1, h2, h3, h4, h5, h6) { text-wrap: balance; }

/* ===== Layout ===== */
.ig-wrap {
	box-sizing: border-box;
	max-width: 1222px;
	margin-inline: auto;
	padding-inline: 16px;
}

/* ===== Dark sections (navy by default; a blue background class overrides the colour) ===== */
.ig-on-dark {
	background-color: var(--wp--preset--color--navy);
	color: var(--wp--preset--color--white);
}
.ig-on-dark :is(h1, h2, h3, h4, h5, h6) {
	color: var(--wp--preset--color--white);
}
/* Links on dark: soft white, full white on hover (colour-only). Buttons keep their own colours. */
.ig-on-dark a:not(.ig-btn):not(.wp-element-button) {
	color: rgba(255, 255, 255, 0.75);
}
.ig-on-dark a:not(.ig-btn):not(.wp-element-button):hover {
	color: var(--wp--preset--color--white);
}

/* ===== Eyebrow, pill, subtitle ===== */
.ig-eyebrow {
	display: inline-block;
	font-size: 11px;
	font-weight: 800;
	letter-spacing: 0.15em;
	text-transform: uppercase;
	color: var(--wp--preset--color--blue);
}
.ig-on-dark .ig-eyebrow {
	color: var(--wp--preset--color--light-blue);
}

.ig-pill {
	display: inline-block;
	padding: 4px 12px;
	border: 1px solid rgba(0, 93, 166, 0.25);
	border-radius: 999px;
	background: rgba(0, 93, 166, 0.08);
	color: var(--wp--preset--color--blue);
	font-size: 10px;
	font-weight: 700;
	letter-spacing: 0.05em;
	text-transform: uppercase;
}
.ig-on-dark .ig-pill {
	border-color: rgba(0, 179, 226, 0.4);
	background: rgba(0, 179, 226, 0.15);
	color: var(--wp--preset--color--light-blue);
}

.ig-sub {
	font-size: 16px;
	font-weight: 300;
	line-height: 1.6;
	color: var(--wp--preset--color--muted);
}
.ig-on-dark .ig-sub {
	color: rgba(255, 255, 255, 0.8);
}

/* ===== Muted text on grey =====
   Muted #6b7280 passes AA on white (4.8:1) but not on the grey #f4f6f9 (4.47:1) or the light-blue tint of a current
   filter (4.3:1). Grey surfaces (including the white-to-grey hero gradients) swap in a darker muted, so all the muted
   text inside them passes. */
:is(.ig-hero, .ig-post-hero, .ig-showcase, .ig-testimonials,
	.ig-rail__card, .ig-related, .ig-filter:hover, .ig-filter.is-current, .ig-mega__link:hover) {
	--wp--preset--color--muted: var(--wp--custom--color--muted-on-grey);
}

/* ===== Buttons, as on the L3b landing page: 4px radius, 14px / 700, and on hover they lift 2px (no shadow, and
   the solid ones keep their colour). The core/button block styles (is-style-ig-*, registered in inc/blocks.php)
   and theme.json's button element share these rules. ===== */
.ig-btn {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	box-sizing: border-box;
	padding: 12px 24px;
	border: 1.5px solid transparent;
	border-radius: 4px;
	background-color: var(--wp--preset--color--red);
	color: var(--wp--preset--color--white);
	font-size: 14px;
	font-weight: 700;
	line-height: 1.8;
	letter-spacing: 0.01em;
	text-decoration: none;
	cursor: pointer;
}
.ig-btn,
.wp-element-button {
	transition: transform 0.2s ease;
}
.ig-btn:hover,
.wp-element-button:hover {
	transform: translateY(-2px);
}
@media (prefers-reduced-motion: reduce) {
	.ig-btn,
	.wp-element-button { transition: none; }
}
.ig-btn--red:hover,
.ig-btn:not([class*="ig-btn--"]):hover {
	color: var(--wp--preset--color--white);
}

/* The solid button gets the outline buttons' 1.5px border (transparent), so a pair is the same height and lines up. */
.wp-block-button:not([class*="is-style-"]) .wp-block-button__link { border: 1.5px solid transparent; }

.ig-btn--outline-light,
.wp-block-button.is-style-ig-outline-light .wp-block-button__link {
	border: 1.5px solid rgba(255, 255, 255, 0.8);
	background-color: transparent;
	color: var(--wp--preset--color--white);
}
.ig-btn--outline-light:hover,
.wp-block-button.is-style-ig-outline-light .wp-block-button__link:hover {
	border-color: var(--wp--preset--color--white);
	background-color: rgba(255, 255, 255, 0.12);
	color: var(--wp--preset--color--white);
}

.ig-btn--outline-dark,
.wp-block-button.is-style-ig-outline-dark .wp-block-button__link {
	border: 1.5px solid var(--wp--preset--color--navy);
	background-color: transparent;
	color: var(--wp--preset--color--navy);
}
.ig-btn--outline-dark:hover,
.wp-block-button.is-style-ig-outline-dark .wp-block-button__link:hover {
	background-color: var(--wp--preset--color--navy);
	color: var(--wp--preset--color--white);
}

.ig-btn--white,
.wp-block-button.is-style-ig-white .wp-block-button__link {
	border: 1.5px solid transparent;
	background-color: var(--wp--preset--color--white);
	color: var(--wp--preset--color--red);
}
.ig-btn--white:hover,
.wp-block-button.is-style-ig-white .wp-block-button__link:hover {
	color: var(--wp--preset--color--red);
}

/* Text link next to a solid button on a dark band, as L3b's "Schedule a Demo →": no box, brightens on hover. */
.wp-block-button.is-style-ig-ghost .wp-block-button__link {
	padding-inline: 4px;
	border: 0;
	background: none;
	color: rgba(255, 255, 255, 0.82);
	font-weight: 600;
	transition: color 0.2s ease;
}
.wp-block-button.is-style-ig-ghost .wp-block-button__link:hover {
	background: none;
	color: var(--wp--preset--color--white);
	transform: none;
}

/* ===== Page heading: the short photo band at the top of every inner page =====
   One look for three markups: the page-intro section of block pages (Reviews, Contact, Support...), the title band
   page.php adds to a page with no H1 of its own (privacy policy, calculator) and the blue title bar of the
   unconverted Elementor pages (.title-section: the guides, customer pages, whitepaper...). Here rather than in
   sections.css because the Elementor pages don't load sections.css. The homepage hero's photo under the same
   photo-overlay gradient, so white text keeps AA. #main beats Elementor's per-element rules (four classes) without
   !important. The blog, search and 404 headings (parts/archive-hero.php) use .ig-page-title too. */
.ig-page-title,
.ig-page-intro,
#main .title-section {
	box-sizing: border-box;
	display: grid;
	align-content: center;
	min-height: 220px;
	margin: 0;
	padding: 48px 0;
	border: 0;
	background: var(--wp--preset--gradient--photo-overlay), url(../img/page-heading.jpg) center / cover no-repeat;
	color: var(--wp--preset--color--white);
}
@media (min-width: 782px) {
	.ig-page-title,
	.ig-page-intro,
	#main .title-section { min-height: 300px; padding: 64px 0; }
}
/* Auto margins would shrink a grid item to its text and centre it: keep the wrap full width. */
:is(.ig-page-title, .ig-page-intro) > .ig-wrap { width: 100%; }
.ig-page-title h1,
.ig-page-intro h1,
#main .title-section .elementor-heading-title {
	margin: 0;
	color: var(--wp--preset--color--white);
	font-family: var(--wp--preset--font-family--open-sans);
	font-size: clamp(32px, 5vw, 40px);
	font-weight: 800;
	line-height: 1.05;
	letter-spacing: -0.03em;
	overflow-wrap: anywhere;
}
/* Eyebrow above and subtitle under the H1, white on the photo. */
:is(.ig-page-title, .ig-page-intro) .ig-eyebrow {
	margin: 0;
	color: var(--wp--preset--color--white);
}
:is(.ig-page-title, .ig-page-intro) .ig-eyebrow + h1 { margin-top: 14px; }
:is(.ig-page-title, .ig-page-intro) .ig-sub,
#main .title-section .ig-sub {
	max-width: 640px;
	margin: 16px 0 0;
	color: var(--wp--preset--color--white);
	font-family: var(--wp--preset--font-family--open-sans); /* Elementor pages set Roboto, which the theme doesn't load */
	font-size: 18px;
	line-height: 1.6;
}
/* Elementor's title bar: its tile picture and overlay go, and its boxed container lines up with the header's 1222px. */
#main .title-section > .elementor-background-overlay { display: none; }
#main .title-section > .elementor-container {
	box-sizing: border-box;
	width: 100%;
	max-width: 1222px;
	padding-inline: 16px;
}
#main .title-section :is(.elementor-column, .elementor-widget-wrap, .elementor-widget-container) { padding: 0; }
#main .title-section .elementor-widget:not(:last-child) { margin-bottom: 0; }
/* A second heading in the bar (the whitepaper's and partners' subtitle) reads as the subtitle line. */
#main .title-section .elementor-widget + .elementor-widget .elementor-heading-title {
	margin-top: 16px;
	font-size: 18px;
	font-weight: 400;
	line-height: 1.6;
	letter-spacing: 0;
}

/* ===== Card: 16px radius, 1px border, no shadow, no hover effect ===== */
.ig-card {
	box-sizing: border-box;
	padding: 24px;
	border: 1px solid var(--wp--preset--color--border);
	border-radius: 16px;
	background-color: var(--wp--preset--color--white);
}

/* ===== Skip link (header.php): hidden until it has keyboard focus ===== */
.ig-skip-link {
	position: absolute;
	top: 8px;
	left: 8px;
	z-index: 1000; /* above the sticky header (100), below the drawers */
	padding: 12px 20px;
	border-radius: 8px;
	background: var(--wp--preset--color--navy);
	color: var(--wp--preset--color--white);
	font-weight: 600;
	text-decoration: none;
	transform: translateY(-200%);
}
.ig-skip-link:focus {
	transform: none;
	outline: 2px solid var(--wp--preset--color--light-blue);
	outline-offset: 2px;
}

/* ===== Visually hidden: stays available to screen readers ===== */
.ig-visually-hidden {
	position: absolute;
	width: 1px;
	height: 1px;
	margin: -1px;
	padding: 0;
	overflow: hidden;
	clip-path: inset(50%);
	white-space: nowrap;
}
