/*
 Theme Name:   GeneratePress Child
 Theme URI:    https://generatepress.com
 Description:  Default GeneratePress child theme
 Author:       Tom Usborne
 Author URI:   https://tomusborne.com
 Template:     generatepress
 Version:      1.7
*/

/* =========================================================================
   Home Screen template (page-home-template.php)
   Mobile-first. Squared / flat design.
   ========================================================================= */

/* ---- Break the template out of GeneratePress's contained #page wrapper ----
   #page has `grid-container container` (max-width + centered). The header and
   footer sit OUTSIDE #page, so widening #page only affects the page content. */
.page-template-page-home-template #page {
	max-width: 100%;
	padding: 0;
}
.page-template-page-home-template .site-content {
	padding: 0;
}
/* .site-content is a flex row; make our <main> fill it fully. */
.page-template-page-home-template #home-screen {
	flex: 1 1 100%;
	width: 100%;
	min-width: 0;
}

/* Legacy aliases: this template predates the design system. The --hs-*
   names below now point at the global tokens (design-system/tokens.css).
   New code should use the --vk-* tokens and .vk-* components directly. */
#home-screen {
	--hs-bg: var(--vk-bg);
	--hs-bg-muted: var(--vk-bg-muted);
	--hs-bg-dark: var(--vk-bg-dark);
	--hs-ink: var(--vk-ink);
	--hs-ink-soft: var(--vk-ink-soft);
	--hs-accent: var(--vk-accent);
	--hs-accent-dark: var(--vk-accent-dark);
	--hs-border: var(--vk-border);
	--hs-container: var(--vk-container);
	/* Process ink colors (CMYK) — used for the registration strip. */
	--hs-cyan: var(--vk-cyan);
	--hs-magenta: var(--vk-magenta);
	--hs-yellow: var(--vk-yellow);
	color: var(--hs-ink);
}

#home-screen .hs-container {
	max-width: var(--hs-container);
	margin: 0 auto;
	padding: 0 16px;
}

/* ---------- Buttons (rectangular) ---------- */
#home-screen .hs-btn {
	display: inline-block;
	padding: 14px 26px;
	border-radius: 0;
	font-weight: 600;
	line-height: 1;
	text-decoration: none;
	transition: background-color .15s ease, color .15s ease, border-color .15s ease;
}
#home-screen .hs-btn--primary { background: var(--hs-accent); color: #fff; }
#home-screen .hs-btn--primary:hover { background: var(--hs-accent-dark); }
/* Arrow that nudges right on hover. */
#home-screen .hs-btn--primary::after {
	content: "\2192";
	display: inline-block;
	margin-left: 10px;
	transition: transform .2s ease;
}
#home-screen .hs-btn--primary:hover::after { transform: translateX(4px); }
#home-screen .hs-btn--outline {
	background: transparent;
	border: 2px solid #fff;
	color: #fff;
}
#home-screen .hs-btn--outline:hover { background: #fff; color: var(--hs-ink); }

/* ---------- Banner (full width, ~30% viewport height) ----------
   Dark ink background with a diagonal red slab on the right — echoes the
   red/black diagonal cuts in the product mockups. A thin CMYK registration
   strip closes the banner (the four process ink colors). */
#home-screen .hs-banner {
	position: relative;
	min-height: 30vh;
	display: flex;
	align-items: center;
	padding: 44px 0 50px;
	background: var(--hs-bg-dark);
	color: #fff;
	overflow: hidden;
}
/* Diagonal red slab, clipped like a cut sheet. */
#home-screen .hs-banner::before {
	content: "";
	position: absolute;
	top: 0;
	right: 0;
	bottom: 0;
	width: 46%;
	background: linear-gradient(115deg, var(--hs-accent-dark), var(--hs-accent) 60%);
	clip-path: polygon(38% 0, 100% 0, 100% 100%, 0 100%);
	opacity: .92;
}
/* CMYK registration strip along the bottom edge. */
#home-screen .hs-banner::after {
	content: "";
	position: absolute;
	left: 0;
	right: 0;
	bottom: 0;
	height: 6px;
	background: linear-gradient(
		90deg,
		var(--hs-cyan) 0 25%,
		var(--hs-magenta) 25% 50%,
		var(--hs-yellow) 50% 75%,
		#000 75% 100%
	);
	z-index: 2;
}
#home-screen .hs-banner__inner { position: relative; z-index: 1; }
/* On narrow screens keep the slab as a thin edge so it never sits behind text. */
@media (max-width: 599px) {
	#home-screen .hs-banner::before { width: 24%; }
}
#home-screen .hs-banner__title {
	color: #fff;
	font-size: clamp(26px, 6vw, 46px);
	line-height: 1.12;
	margin: 0 0 14px;
	max-width: 20ch;
	text-wrap: balance;
}
#home-screen .hs-banner__subtitle {
	font-size: clamp(15px, 3.5vw, 19px);
	line-height: 1.55;
	color: #c8ccd1;
	max-width: 52ch;
	margin: 0 0 24px;
}

/* ---------- Sections ---------- */
#home-screen .hs-section { padding: 44px 0; background: var(--hs-bg); }
#home-screen .hs-section--muted { background: var(--hs-bg-muted); }
#home-screen .hs-section--dark { background: var(--hs-bg-dark); color: #fff; }

#home-screen .hs-section-head { margin-bottom: 22px; }
#home-screen .hs-section-title {
	display: flex;
	align-items: center;
	gap: 12px;
	font-size: clamp(20px, 4.5vw, 30px);
	line-height: 1.2;
	margin: 0 0 6px;
}
/* Small squared accent tick before each section title (takes the section type color). */
#home-screen .hs-section-title::before {
	content: "";
	flex: 0 0 auto;
	width: 6px;
	height: 1em;
	background: var(--hs-section-accent, var(--hs-accent));
}
/* Section type accents — same CMYK coding as the cards. */
#home-screen .hs-section--shop { --hs-section-accent: var(--hs-accent); }
#home-screen .hs-section--page { --hs-section-accent: var(--hs-cyan); }
#home-screen .hs-section--flipbook { --hs-section-accent: var(--hs-magenta); }
/* Eyebrow chip: names the destination type before the customer scans the cards. */
#home-screen .hs-section-eyebrow {
	display: inline-flex;
	align-items: center;
	gap: 8px;
	margin: 0 0 6px;
	font-size: 11px;
	font-weight: 700;
	letter-spacing: .14em;
	text-transform: uppercase;
	color: var(--hs-ink-soft);
}
#home-screen .hs-section-eyebrow::before {
	content: "";
	width: 8px;
	height: 8px;
	background: var(--hs-section-accent, var(--hs-accent));
}
#home-screen .hs-section-lead {
	color: var(--hs-ink-soft);
	font-size: 16px;
	margin: 0;
}
#home-screen .hs-section--dark .hs-section-lead { color: #c8ccd1; }

/* ---------- Product cards (image + title, squared) ---------- */
#home-screen .hs-cards {
	display: grid;
	grid-template-columns: repeat(2, 1fr);
	gap: 14px;
}
#home-screen .hs-card {
	/* Per-type accent: red = shop (default), cyan = page, magenta = catalogue. */
	--hs-card-accent: var(--hs-accent);
	position: relative;
	display: flex;
	flex-direction: column;
	background: var(--hs-bg);
	border: 1px solid var(--hs-border);
	border-radius: 0;
	text-decoration: none;
	color: inherit;
	overflow: hidden;
	transition: border-color .2s ease, transform .2s ease, box-shadow .2s ease;
}
#home-screen .hs-card--page { --hs-card-accent: var(--hs-cyan); }
#home-screen .hs-card--flipbook { --hs-card-accent: var(--hs-magenta); }
#home-screen .hs-card:hover,
#home-screen .hs-card:focus-visible {
	border-color: var(--hs-card-accent);
	transform: translateY(-4px);
	box-shadow: 0 12px 24px -12px rgba(27, 31, 36, .25);
}
#home-screen .hs-card__media {
	display: flex;
	align-items: center;
	justify-content: center;
	width: 100%;
	aspect-ratio: 1 / 1;
	padding: 16px;
	background: radial-gradient(120% 90% at 50% 20%, #ffffff 55%, #f1eeeb 100%);
	border-bottom: 1px solid var(--hs-border);
	overflow: hidden;
}
#home-screen .hs-card__media img {
	max-width: 100%;
	max-height: 100%;
	object-fit: contain;
	display: block;
	transition: transform .25s ease;
}
#home-screen .hs-card:hover .hs-card__media img { transform: scale(1.05); }
#home-screen .hs-card__title {
	margin: 0;
	padding: 14px 12px 4px;
	text-align: center;
	font-size: 14px;
	font-weight: 600;
	letter-spacing: .02em;
	color: var(--hs-ink);
}
#home-screen .hs-card:hover .hs-card__title { color: var(--hs-card-accent); }
/* Red underline that slides in from the left on hover. */
#home-screen .hs-card::after {
	content: "";
	position: absolute;
	left: 0;
	bottom: 0;
	width: 100%;
	height: 3px;
	background: var(--hs-card-accent);
	transform: scaleX(0);
	transform-origin: left;
	transition: transform .25s ease;
}
#home-screen .hs-card:hover::after,
#home-screen .hs-card:focus-visible::after { transform: scaleX(1); }

/* ---------- About us ---------- */
#home-screen .hs-about { display: grid; gap: 28px; }
#home-screen .hs-about__body p { color: #c8ccd1; font-size: 16px; line-height: 1.7; margin: 0 0 14px; }
#home-screen .hs-about__body .hs-btn { margin-top: 6px; }
#home-screen .hs-about__stats {
	list-style: none;
	margin: 0;
	padding: 0;
	display: grid;
	grid-template-columns: repeat(3, 1fr);
	gap: 12px;
}
#home-screen .hs-about__stats li {
	border: 1px solid #3a4048;
	border-left: 3px solid var(--hs-accent);
	background: rgba(255, 255, 255, .03);
	padding: 16px 12px;
	text-align: center;
	transition: background-color .2s ease, border-color .2s ease;
}
#home-screen .hs-about__stats li:hover {
	background: rgba(200, 16, 46, .12);
	border-color: var(--hs-accent);
}
#home-screen .hs-about__stats strong { display: block; font-size: 24px; color: var(--hs-accent); line-height: 1; filter: brightness(1.35); }
#home-screen .hs-about__stats span { color: #c8ccd1; font-size: 13px; }

/* ---------- Trusted by ---------- */
#home-screen .hs-trusted .hs-section-lead { margin-bottom: 22px; }
#home-screen .hs-logos {
	list-style: none;
	margin: 0;
	padding: 0;
	display: flex;
	flex-wrap: wrap;
	align-items: flex-start;
	gap: 24px 48px;
}
#home-screen .hs-logo {
	display: flex;
	flex-direction: column;
	align-items: center;
	gap: 10px;
	text-align: center;
}
#home-screen .hs-logo img {
	height: 96px;
	width: auto;
	max-width: 220px;
	object-fit: contain;
}
#home-screen .hs-logo__name {
	font-size: 15px;
	font-weight: 700;
	color: #a7adb4;
	transition: color .2s ease;
}
#home-screen .hs-logo:hover .hs-logo__name { color: var(--hs-ink); }

/* ---------- Dark section gets a subtle red glow + CMYK strip on top ---------- */
#home-screen .hs-section--dark {
	position: relative;
	background:
		radial-gradient(90% 120% at 85% 10%, rgba(200, 16, 46, .18), transparent 60%),
		var(--hs-bg-dark);
	overflow: hidden;
}
#home-screen .hs-section--dark::before {
	content: "";
	position: absolute;
	top: 0;
	left: 0;
	right: 0;
	height: 6px;
	background: linear-gradient(
		90deg,
		var(--hs-cyan) 0 25%,
		var(--hs-magenta) 25% 50%,
		var(--hs-yellow) 50% 75%,
		#000 75% 100%
	);
}

/* ---------- Motion preferences ---------- */
@media (prefers-reduced-motion: reduce) {
	#home-screen * { transition: none !important; }
	#home-screen .hs-card:hover { transform: none; }
	#home-screen .hs-card:hover .hs-card__media img { transform: none; }
}

/* ==========================================================================
   Scale up (tablet)
   ========================================================================== */
@media (min-width: 600px) {
	#home-screen .hs-container { padding: 0 24px; }
	#home-screen .hs-banner { padding: 60px 0; }
	#home-screen .hs-section { padding: 60px 0; }
	#home-screen .hs-cards { grid-template-columns: repeat(3, 1fr); gap: 18px; }
	#home-screen .hs-about {
		grid-template-columns: 1.6fr 1fr;
		gap: 40px;
		align-items: center;
	}
	#home-screen .hs-about__stats { grid-template-columns: 1fr; }
	#home-screen .hs-about__stats li { text-align: left; padding: 18px 20px; }
	#home-screen .hs-about__stats strong { font-size: 28px; }
}

/* ==========================================================================
   Scale up (desktop)
   ========================================================================== */
@media (min-width: 900px) {
	#home-screen .hs-section { padding: 72px 0; }
	#home-screen .hs-cards { grid-template-columns: repeat(4, 1fr); gap: 20px; }
}

/* ==========================================================================
   Flipbook catalogue cards + fullscreen modal
   ========================================================================== */

/* Button cards should look identical to the anchor cards. */
#home-screen .hs-card--flipbook {
	appearance: none;
	-webkit-appearance: none;
	font: inherit;
	text-align: inherit;
	cursor: pointer;
	padding: 0;
	width: 100%;
}

/* Action row: microcopy + icon naming what the card does. */
#home-screen .hs-card__action {
	display: flex;
	align-items: center;
	justify-content: center;
	gap: 6px;
	margin-top: auto; /* Pin to the card bottom when titles wrap unevenly. */
	padding: 0 12px 14px;
	font-size: 11px;
	font-weight: 600;
	letter-spacing: .08em;
	text-transform: uppercase;
	text-align: center;
	color: var(--hs-ink-soft);
	transition: color .2s ease;
}
#home-screen .hs-card__action svg {
	flex: 0 0 auto;
	width: 14px;
	height: 14px;
}
#home-screen .hs-card:hover .hs-card__action,
#home-screen .hs-card:focus-visible .hs-card__action {
	color: var(--hs-card-accent);
}

/* Catalogue cards read as physical brochures: CMYK spine on the left edge. */
#home-screen .hs-card--flipbook::before {
	content: "";
	position: absolute;
	left: 0;
	top: 0;
	bottom: 0;
	width: 7px;
	z-index: 1;
	background: linear-gradient(
		180deg,
		var(--hs-cyan) 0 25%,
		var(--hs-magenta) 25% 50%,
		var(--hs-yellow) 50% 75%,
		var(--hs-ink) 75% 100%
	);
}

.hs-flipbook-modal {
	position: fixed;
	inset: 0;
	z-index: 100000; /* Above the GeneratePress sticky header. */
	display: flex;
	flex-direction: column;
	background: rgba(22, 24, 29, 0.97);
}
.hs-flipbook-modal[hidden] { display: none; }

.hs-flipbook-modal__bar {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 16px;
	padding: 10px 16px;
	background: #16181d;
	color: #fff;
}
.hs-flipbook-modal__title {
	font-size: 16px;
	font-weight: 600;
	overflow: hidden;
	text-overflow: ellipsis;
	white-space: nowrap;
}
.hs-flipbook-modal__close {
	appearance: none;
	-webkit-appearance: none;
	border: 0;
	background: transparent;
	color: #fff;
	font-size: 32px;
	line-height: 1;
	padding: 4px 10px;
	cursor: pointer;
	transition: color 0.15s ease;
}
.hs-flipbook-modal__close:hover,
.hs-flipbook-modal__close:focus-visible {
	color: #c8102e;
}
.hs-flipbook-modal__frame {
	flex: 1;
	min-height: 0; /* iOS Safari: keep the iframe from overflowing the flex column. */
	width: 100%;
	border: 0;
	background: #fff;
}

/* Lock page scroll while the modal is open. */
body.hs-flipbook-open {
	overflow: hidden;
}
