/* 4D Infrastructure base: tokens, typography, buttons, layout, Section settings.
   Loaded on the site and inside the editor canvas. */

:root {
	--color-brand: #00afd7;
	--color-brand-dark: #0090b1;
	--color-text: #282728;
	--color-heading: #282728;
	--color-dark: #343334;
	--color-black: #282728;
	--color-muted: #5f6b85;
	--color-border: #e6e6e6;
	--color-grey: #f8fbfd;
	--color-grey-blue: #f5f8fc;
	--color-zebra: #f9fbfc;
	--color-white: #fff;
	--color-notice: #ffc20e;

	--font-heading: "Asap Condensed", "Arial Narrow", sans-serif;
	--font-body: Roboto, "Helvetica Neue", Arial, sans-serif;

	/* Type scale measured from www.4dinfra.com (desktop >= 1224px, smaller below). */
	--fs-body: 1rem;          /* 16px, 18px from 1224px */
	--lh-body: 1.75;
	--fs-small: 0.875rem;     /* 14px */
	--fs-h1: 2.5rem;          /* 40 / 44 / 48 */
	--fs-h2: 1.75rem;         /* 28 / 32 / 36 */
	--fs-h3: 1.75rem;         /* 28 */
	--fs-h4: 1.375rem;        /* 22 */

	--container: 1400px;
	--container-medium: 1100px;
	--container-narrow: 850px;
	--gutter: 1rem;           /* 16px, 32px from 768px */

	--space-s: 1.75rem;       /* 28px */
	--space-m: 2.5rem;        /* 40px, 80px from 768px */
	--space-l: 4rem;

	--radius: 3px;
	--radius-pill: 9999px;
	--shadow-card: 5px 0 15px rgba(0, 0, 0, 0.05);
	--shadow-card-hover: 5px 0 20px rgba(0, 0, 0, 0.12);
	--header-height: 65px;
}
@media (min-width: 768px) {
	:root { --gutter: 2rem; --space-m: 5rem; --space-l: 7rem; --fs-h1: 2.75rem; --fs-h2: 2rem; --header-height: 72px; }
}
@media (min-width: 1224px) {
	:root { --fs-body: 1.125rem; --fs-h1: 3rem; --fs-h2: 2.25rem; --header-height: 84px; }
}

*, *::before, *::after { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; scroll-padding-top: calc(var(--header-height) + 1rem); }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } *, *::before, *::after { transition: none !important; animation: none !important; } }

body {
	margin: 0;
	background: var(--color-white);
	color: var(--color-text);
	font-family: var(--font-body);
	font-size: var(--fs-body);
	line-height: var(--lh-body);
	-webkit-font-smoothing: antialiased;
	overflow-x: hidden;
}

img, svg, video, iframe { max-width: 100%; height: auto; }
img { display: block; }
iframe { border: 0; }

h1, h2, h3, h4, h5, h6 {
	margin: 0 0 1rem;
	font-family: var(--font-heading);
	font-weight: 500;
	line-height: 1.2;
	color: var(--color-heading);
}
h1 { font-size: var(--fs-h1); line-height: 1; }
h2 { font-size: var(--fs-h2); }
h3 { font-size: var(--fs-h3); }
h4 { font-size: var(--fs-h4); line-height: 1.23; }
p, ul, ol, table, figure, blockquote { margin: 0 0 1.5rem; }
:where(ul, ol) { padding-left: 0; }
:where(.entry-content, .rich-text) :where(ul, ol) { padding-left: 0; margin-left: 1.5rem; }
:where(.entry-content, .rich-text) li { margin-bottom: 1rem; }
:where(.entry-content, .rich-text) li::marker { color: var(--color-brand); }
a { color: var(--color-brand); text-decoration: none; }
a:hover { text-decoration: underline; }
strong, b { font-weight: 700; }
small { font-size: var(--fs-small); }
hr { border: 0; border-top: 1px solid var(--color-border); margin: 2em 0; }

:focus-visible { outline: 2px solid var(--color-brand); outline-offset: 3px; }

.screen-reader-text {
	position: absolute !important; width: 1px; height: 1px; padding: 0; margin: -1px;
	overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}
.skip-link { position: absolute; left: 1rem; top: -100px; z-index: 1000; background: var(--color-white); padding: 0.75rem 1rem; }
.skip-link:focus { top: 1rem; }

/* Layout: 1400px max, 16px gutter on phones and 32px from 768px (as www.4dinfra.com) */
.container, .container--wide, .container--medium, .container--narrow {
	width: 100%;
	margin-inline: auto;
	padding-inline: var(--gutter);
}
.container, .container--wide { max-width: calc(var(--container) + 2 * var(--gutter)); }
.container--medium { max-width: calc(var(--container-medium) + 2 * var(--gutter)); }
.container--narrow { max-width: calc(var(--container-narrow) + 2 * var(--gutter)); }
.container--full { width: 100%; padding-inline: 0; }

/* Sections + Section settings */
.section { position: relative; }
.section--space-none { padding-block: 0; }
.section--space-small { padding-block: var(--space-s); }
.section--space-default { padding-block: var(--space-m); }
.section--space-large { padding-block: var(--space-l); }
.section > * { position: relative; z-index: 1; }
/* Two plain white sections in a row share their spacing, as on the old site. */
.section--space-default:not([class*="bg--"]) + .section--space-default:not([class*="bg--"]) { padding-top: 0; }

.bg--white { background-color: var(--color-white); }
.bg--grey { background-color: var(--color-grey); }
.bg--blue { background-color: var(--color-brand); color: var(--color-white); }
.bg--dark { background-color: var(--color-dark); color: var(--color-white); }
.bg--blue :is(h1, h2, h3, h4), .bg--dark :is(h1, h2, h3, h4), .text--light :is(h1, h2, h3, h4) { color: inherit; }
.bg--blue a:not(.btn), .bg--dark a:not(.btn), .text--light a:not(.btn) { color: inherit; text-decoration: underline; }
.text--dark { color: var(--color-text); }
.text--light { color: var(--color-white); }
.has-bg-image { background-image: var(--section-bg-image); background-size: cover; background-position: center; }

/* Buttons: pill, 18px/500, 19px 40px (60px tall) */
.btn, .wp-element-button, .wp-block-button__link, .gform_button {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	gap: 0.5em;
	padding: 19px 40px;
	border: 2px solid var(--color-brand);
	border-radius: var(--radius-pill);
	background: var(--color-brand);
	color: var(--color-white);
	font-family: var(--font-body);
	font-size: 1.125rem;
	font-weight: 500;
	line-height: 1;
	text-align: center;
	text-decoration: none;
	cursor: pointer;
	transition: background-color 0.2s, color 0.2s, border-color 0.2s, box-shadow 0.2s;
}
.btn:hover, .wp-block-button__link:hover, .gform_button:hover { background: var(--color-white); border-color: var(--color-brand); color: var(--color-brand); text-decoration: none; }
.btn--white { background: var(--color-white); border-color: var(--color-white); color: var(--color-dark); }
.btn--white:hover { background: transparent; border-color: var(--color-white); color: var(--color-white); }
.btn--outline { background: transparent; color: var(--color-brand); }
.btn--outline:hover { background: var(--color-brand); color: var(--color-white); }
.btn--small { padding: 19px 40px; }
.btn-row { display: flex; flex-wrap: wrap; gap: 1rem; }

/* Rich text */
.entry-content > :last-child, .rich-text > :last-child { margin-bottom: 0; }
.entry-content :is(h2, h3, h4) { margin-top: 1.25rem; }
.entry-content > :is(h2, h3, h4):first-child { margin-top: 0; }
.entry-content h2 { font-size: var(--fs-h2); }
.entry-content h3 { font-size: 1.75rem; color: var(--color-brand); }
.entry-content h4 { font-size: var(--fs-h4); }
.entry-content table, .rich-text table { width: 100%; border-collapse: collapse; }
.entry-content :is(th, td), .rich-text :is(th, td) { padding: 18.8px 18px; border-bottom: 1px solid var(--color-border); line-height: 1.25; text-align: left; vertical-align: middle; }
.entry-content tr:nth-child(even), .rich-text tr:nth-child(even) { background: var(--color-zebra); }
.entry-content .wp-block-table { margin: 0 0 1.5rem; }
.entry-content blockquote { margin-left: 0; padding-left: 1.25rem; border-left: 4px solid var(--color-brand); }
.entry-content img { height: auto; }
.entry-content figure figcaption { font-size: var(--fs-small); color: var(--color-muted); margin-top: 0.5rem; }

/* Cards */
.card {
	background: var(--color-white);
	border: 1px solid var(--color-border);
	border-radius: var(--radius);
	box-shadow: var(--shadow-card);
	color: var(--color-text);
}

/* Shared grid */
.card-grid { display: grid; gap: 2rem; grid-template-columns: 1fr; }
@media (min-width: 768px) { .card-grid { grid-template-columns: repeat(2, 1fr); } }
@media (min-width: 1080px) { .card-grid { grid-template-columns: repeat(3, 1fr); } }

/* Editor-only helpers (rendered only when $is_preview) */
.webqem-placeholder {
	display: flex; align-items: center; justify-content: center;
	min-height: 120px; padding: 1rem;
	border: 2px dashed #b8c2cc; border-radius: var(--radius);
	background: rgba(0, 175, 215, 0.05);
	color: #4a5562; font: 500 0.9375rem/1.4 var(--font-body); text-align: center;
	cursor: pointer;
}
.webqem-placeholder--image { min-height: 240px; aspect-ratio: 4 / 3; }
.webqem-hidden-notice {
	padding: 0.75rem 1rem; margin: 0.5rem 0;
	border: 1px dashed #c58b00; border-radius: var(--radius);
	background: #fff8e1; color: #6b4b00; font: 500 0.875rem/1.4 var(--font-body);
}
.link-button { padding: 0; border: 0; background: none; color: inherit; font: inherit; font-size: 0.9375rem; font-weight: 700; text-decoration: underline; cursor: pointer; }
