/*
 Theme Name:   INCUBATEC (GeneratePress Child)
 Theme URI:    https://www.incubatec.com/
 Description:  Child theme for incubatec.com. Colours and fonts are set in Customizer > Colors / Typography (GeneratePress Global Colors); this file only adds what the Customizer cannot do.
 Author:       INCUBATEC
 Template:     generatepress
 Version:      1.0.0
 Requires PHP: 8.1
 Text Domain:  incubatec
*/

/*
 * Customizer setup (Appearance > Customize > Colors > Global Colors).
 * GeneratePress exposes these as CSS variables; everything below uses them.
 *
 *   --contrast    #1d1f24   body text, headings      (current site: #747474 light weight, too faint)
 *   --contrast-2  #4b4f58   secondary text
 *   --contrast-3  #b6b9c0   borders, muted UI
 *   --base        #eceef1   section dividers
 *   --base-2      #f6f7f8   alternate section background
 *   --base-3      #ffffff   page background
 *   --accent      #e10713   INCUBATEC red (logo). 4.9:1 on white, passes WCAG AA for text.
 *   --accent-dark #b00510   add as a custom global color: hover state, text on tinted bg
 *   --ink         #0f1031   add as a custom global color: dark hero / footer background
 *
 * Typography (Customizer > Typography), fonts uploaded via
 * Appearance > GeneratePress > Font Library as WOFF2 with "Preload" ticked:
 *   Body:     FS Joey Regular 18px / 1.65 (not Light: Light at grey fails readability)
 *   Headings: FS Joey Medium
 *   Drop Gilroy (4 weights) and Orbitron: 6 fewer font files per page.
 */

:root {
	--accent-dark: #b00510;
	--ink: #0f1031;
	--radius: 6px;
	--inc-shadow: 0 1px 2px rgb(15 16 49 / 6%), 0 8px 24px rgb(15 16 49 / 8%);
}

/* ---------- Base ---------- */

body {
	text-rendering: optimizeLegibility;
	-webkit-font-smoothing: antialiased;
}

h1, h2, h3 {
	text-wrap: balance;
}

.entry-content p,
.entry-content li {
	max-width: 68ch;
}

/* Visible keyboard focus everywhere (Avada removed outlines). */
:where(a, button, input, select, textarea, summary, [tabindex]):focus-visible {
	outline: 3px solid var(--accent);
	outline-offset: 2px;
	border-radius: 2px;
}

/* ---------- Section heading with the INCUBATEC double rule ----------
 * Recreates the existing brand motif (heading between two red double lines)
 * in pure CSS. GenerateBlocks Headline > Advanced > Additional CSS class: inc-rule-heading
 */
.inc-rule-heading {
	display: flex;
	align-items: center;
	gap: 1.25rem;
	text-align: center;
}

.inc-rule-heading::before,
.inc-rule-heading::after {
	content: "";
	flex: 1;
	height: 5px;
	border-block: 1px solid var(--accent);
	opacity: 0.85;
}

/* ---------- Hero ----------
 * GenerateBlocks Container class: inc-hero
 * The current homepage hero puts white text on a 9.8 MB background video over a
 * light-grey fallback; when the video does not play, the headline is invisible.
 * Here the dark ink colour is always painted first, so text stays readable whether
 * or not the background image loads. Set the image in GenerateBlocks as a
 * background with the "Inline background image" option and fetchpriority high.
 */
.inc-hero {
	position: relative;
	isolation: isolate;
	background-color: var(--ink);
	color: #fff;
}

.inc-hero::before {
	content: "";
	position: absolute;
	inset: 0;
	z-index: -1;
	background: linear-gradient(90deg, rgb(15 16 49 / 88%) 0%, rgb(15 16 49 / 55%) 60%, rgb(15 16 49 / 25%) 100%);
}

.inc-hero :is(h1, h2, p) {
	color: inherit;
}

/* ---------- Brand cards ----------
 * GenerateBlocks Grid > each Container class: inc-card
 */
.inc-card {
	display: flex;
	flex-direction: column;
	gap: 0.75rem;
	height: 100%;
	padding: 1.5rem;
	background: var(--base-3);
	border: 1px solid var(--base);
	border-radius: var(--radius);
	transition: box-shadow 0.2s ease, transform 0.2s ease;
}

.inc-card:hover,
.inc-card:focus-within {
	box-shadow: var(--inc-shadow);
	transform: translateY(-2px);
}

.inc-card img {
	aspect-ratio: 16 / 10;
	width: 100%;
	object-fit: cover;
	border-radius: calc(var(--radius) - 2px);
}

/* Push the card's link to the bottom so links align across a row. */
.inc-card > :last-child {
	margin-top: auto;
}

/* ---------- Key figures ----------
 * Static numbers (no JS count-up): crawlers and screen readers get the real value.
 * GenerateBlocks Container class: inc-stats; each figure is a Headline with class inc-stat
 */
.inc-stats {
	font-variant-numeric: tabular-nums;
}

.inc-stat {
	font-size: clamp(2.25rem, 5vw, 3.25rem);
	line-height: 1;
	font-weight: 600;
	color: var(--accent);
}

/* ---------- Buttons ---------- */

.gb-button,
.wp-block-button__link {
	transition: background-color 0.15s ease, color 0.15s ease;
}

.gb-button:hover,
.gb-button:focus-visible {
	background-color: var(--accent-dark);
}

/* ---------- Footer ---------- */

.site-footer .site-info {
	font-size: 0.875rem;
}

/* ---------- Motion ---------- */

@media (prefers-reduced-motion: reduce) {
	*,
	*::before,
	*::after {
		animation-duration: 0.01ms !important;
		transition-duration: 0.01ms !important;
		scroll-behavior: auto !important;
	}
}
