/* Info Grove sections, shared part: the page.php wrapper, what every .ig-section has in common, the band backgrounds
   and the phone frame block style. Each section's own rules are in sections/<name>.css, loaded only on pages that use
   it (IG_SECTION_STYLES in inc/blocks.php says which block classes load which file). Mobile first; colour-only
   hovers (buttons lift 2px, base.css), no hover shadows. Also loaded in the block editor (add_editor_style). */

/* ===== Page wrapper (page.php) ===== */
/* Blocks placed straight on a page, outside a section, keep the 1222px width and 16px gutter. */
.ig-page > :where(:not(.alignfull):not(.ig-page-title)) {
	box-sizing: border-box;
	max-width: 1222px;
	margin-inline: auto;
	padding-inline: 16px;
}
.ig-page > :where(:not(.alignfull):not(.ig-page-title)):last-child { margin-bottom: 64px; }
.ig-page > :where(ul, ol):not(.alignfull) { padding-left: calc(16px + 1.5em); }
.ig-page-title + :where(:not(.alignfull)) { margin-top: 40px; }

/* The page.php title band (.ig-page-title) and the page-intro H1 type are in base.css: the band also shows on older
   pages that don't load this file. */
.ig-page-intro h1 { margin-top: 14px; }
.ig-page-intro .ig-wrap > h1:first-child { margin-top: 0; }

/* ===== Sections: shared ===== */
.ig-section {
	box-sizing: border-box;
	padding: 56px 0;
}
@media (min-width: 782px) {
	.ig-section { padding: 80px 0; }
}
/* Zero-specificity reset, so every margin set below wins without fighting over specificity. The per-block
   core styles (.wp-block-image img, .wp-block-post-template...) print after this file, so rules that override
   them use two classes. */
:where(.ig-section) :where(h1, h2, h3, p, figure, blockquote) { margin: 0; }
.ig-section h2 { overflow-wrap: anywhere; }

/* Centred head: eyebrow, H2, subtitle. */
.ig-section-head {
	max-width: 760px;
	margin-inline: auto;
	text-align: center;
}
.ig-section-head h2,
:is(.ig-what-is__head, .ig-faq__head, .ig-latest-posts__head) h2 { margin-top: 14px; }
.ig-section-head > h2:first-child { margin-top: 0; }
.ig-section-head .ig-sub,
.ig-faq__head .ig-sub { margin-top: 16px; }

/* Buttons inside sections: the theme's button sizes, a little more space between them. */
.ig-section .wp-block-buttons { gap: 12px 14px; }
/* Phones: a section's two buttons (Request a Quote / Estimate My App Cost and Schedule a Demo) stay side by side down
   to 360px. Narrower side padding, no letter spacing and a smaller gap; below 400px also 13px text. On a narrower
   screen, or zoomed in, they wrap onto two lines as before. */
@media (max-width: 479px) {
	.ig-section .wp-block-buttons { gap: 10px 8px; }
	/* A pair of buttons grows to fill the row (centred, equal margins); when the screen is too narrow for both, each
	   takes the full width on its own line. A single button (the FAQ's) keeps its size, on the left with its text. */
	.ig-section .wp-block-buttons:has(> .wp-block-button + .wp-block-button) > .wp-block-button { flex: 1 1 auto; }
	.ig-section .wp-block-buttons:has(> .wp-block-button + .wp-block-button) .wp-block-button__link { width: 100%; }
	.ig-section .wp-block-button__link {
		padding-inline: 14px;
		letter-spacing: 0;
	}
}
@media (max-width: 399px) {
	.ig-section .wp-block-button__link {
		padding-inline: 12px;
		font-size: 13px;
	}
}

/* ===== Band backgrounds: put one on any .ig-section to change its full-width background. Two classes, so they win
   over a pattern's own background on specificity alone. Blue and navy go with .ig-on-dark (base.css: text, links,
   eyebrows on dark). ===== */
.ig-section.ig-band--white { background: var(--wp--preset--color--white); }
.ig-section.ig-band--grey { background: var(--wp--preset--color--grey); }
.ig-section.ig-band--blue {
	background: var(--wp--preset--color--blue);
	color: var(--wp--preset--color--white);
}
.ig-section.ig-band--navy {
	background: var(--wp--preset--color--navy);
	color: var(--wp--preset--color--white);
}
/* Muted grey on the grey band is 4.46:1 (under AA), so subtitles there are navy. */
.ig-band--grey .ig-sub { color: var(--wp--preset--color--navy); }
/* Light blue on blue is 2.74:1, and over a photo it can be lower still, so small eyebrow text on a blue band or a
   photo band is white. */
:is(.ig-band--blue, .ig-features-grid, .ig-hero-photo, .ig-audience--photo) .ig-eyebrow { color: var(--wp--preset--color--white); }

/* Focus on coloured backgrounds: a white ring (the default blue one disappears on blue and red). */
:is(.ig-stats, .ig-aud-card, .ig-case-study__card, .ig-cta-card__box, .ig-cta-banner, .ig-hero-photo, .ig-cta-closing, .ig-band--blue, .ig-features-grid) :focus-visible {
	outline-color: var(--wp--preset--color--white);
}

/* White section after white section: no double gap (as in the mockups). */
.ig-what-is:not(.ig-band--grey) + .ig-video,
.ig-feature-row + .ig-feature-row,
:is(.ig-what-is, .ig-video, .ig-feature-row, .ig-audience, .ig-customers, .ig-case-study, .ig-faq, .ig-latest-posts, .ig-map) + :is(.ig-case-study, .ig-cta-card) {
	padding-top: 0;
}

/* ===== Phone frame block style (core/image and core/video: is-style-ig-phone) ===== */
:is(.wp-block-image, .wp-block-video).is-style-ig-phone {
	box-sizing: border-box;
	width: 270px;
	max-width: 100%;
	aspect-ratio: 270 / 550;
	padding: 10px;
	border-radius: 40px;
	background: #0a0a0a;
	box-shadow: 0 25px 50px -15px rgba(0, 0, 0, 0.45);
}
.wp-block-video.is-style-ig-phone { position: relative; }
:is(.wp-block-image, .wp-block-video).is-style-ig-phone :is(img, video) {
	display: block;
	width: 100%;
	height: 100%;
	border-radius: 31px;
	background: var(--wp--preset--color--white);
	object-fit: cover;
	object-position: center bottom; /* the demo recording has a status bar strip at the top */
}
/* Pause / play button that sections.js adds to a looping phone video (WCAG 2.2.2). Top corner: the phone's
   bottom edge is cropped by the hero. */
.ig-video-toggle {
	position: absolute;
	top: 22px;
	right: 22px;
	z-index: 2;
	display: grid;
	place-items: center;
	width: 36px;
	height: 36px;
	padding: 0;
	border: 0;
	border-radius: 50%;
	background: rgba(12, 26, 46, 0.78);
	color: var(--wp--preset--color--white);
	cursor: pointer;
}
.ig-video-toggle:hover { background: var(--wp--preset--color--navy); }
.ig-video-toggle svg { display: block; width: 14px; height: 14px; fill: currentColor; }
