/*
 * Home page and /products/ archive.
 * Colours come from Bloghash's variables (--bloghash-primary is the Customizer accent),
 * so these sections follow any accent change made in the Customizer.
 * Root font size is 62.5%, so 1rem = 10px.
 */

.st-home {
	--st-card: rgba(0, 0, 0, 0.3);
	--st-card-hover: rgba(0, 0, 0, 0.42);
	--st-border: rgba(255, 255, 255, 0.08);
	--st-muted: rgba(255, 255, 255, 0.7);
	--st-radius: var(--bloghash-normal-radius, 1.2rem);
	padding-bottom: 6rem;
}

/* Bloghash's light mode: keep the sections legible if dark mode is ever switched off. */
html:not([data-darkmode="dark"]) .st-home {
	--st-card: #fff;
	--st-card-hover: #fff;
	--st-border: rgba(0, 32, 80, 0.1);
	--st-muted: rgba(0, 32, 80, 0.7);
}

.st-eyebrow {
	margin: 0 0 1.2rem;
	font-size: 1.3rem;
	font-weight: 600;
	letter-spacing: 0.12em;
	text-transform: uppercase;
	color: var(--bloghash-primary);
}

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

.st-btn {
	display: inline-flex;
	align-items: center;
	gap: 0.8rem;
	padding: 1.2rem 2.4rem;
	border: 2px solid var(--bloghash-primary);
	border-radius: var(--bloghash-full-radius, 999px);
	background: var(--bloghash-primary);
	color: #fff !important;
	font-weight: 600;
	font-size: 1.5rem;
	line-height: 1.2;
	text-decoration: none !important;
	transition: background-color 0.2s, border-color 0.2s, transform 0.2s;
}
.st-btn:hover,
.st-btn:focus-visible {
	background: var(--bloghash-primary_15, var(--bloghash-primary));
	border-color: var(--bloghash-primary_15, var(--bloghash-primary));
	transform: translateY(-1px);
}
.st-btn--ghost {
	background: transparent;
	border-color: var(--st-border);
	color: inherit !important;
}
.st-btn--ghost:hover,
.st-btn--ghost:focus-visible {
	background: var(--bloghash-primary_10, transparent);
	border-color: var(--bloghash-primary);
}
.st-btn--small {
	padding: 0.8rem 1.6rem;
	font-size: 1.4rem;
}

/* ---- Hero -------------------------------------------------------------- */

.st-hero {
	position: relative;
	padding: 9rem 0 7rem;
	overflow: hidden;
}
.st-hero::before {
	content: "";
	position: absolute;
	inset: -20% -10% auto auto;
	width: 60rem;
	height: 60rem;
	background: radial-gradient(closest-side, var(--bloghash-primary_27, rgba(232, 122, 48, 0.27)), transparent);
	pointer-events: none;
}
.st-hero .bloghash-container {
	position: relative;
}
.st-hero__title {
	max-width: 18ch;
	margin: 0 0 2.4rem;
	font-size: clamp(3.6rem, 6vw, 6.4rem);
	line-height: 1.08;
	letter-spacing: -0.02em;
}
.st-hero__title span {
	color: var(--bloghash-primary);
}
.st-hero__lede {
	max-width: 62ch;
	margin: 0 0 3.2rem;
	font-size: 1.9rem;
	color: var(--st-muted);
}
.st-hero__actions {
	display: flex;
	flex-wrap: wrap;
	gap: 1.2rem;
}

/* ---- Sections ---------------------------------------------------------- */

.st-section {
	padding: 4rem 0;
}
.st-section--first {
	padding-top: 7rem;
}
.st-section__head {
	display: flex;
	align-items: baseline;
	justify-content: space-between;
	gap: 2rem;
	margin-bottom: 2.8rem;
}
.st-section__head--stacked {
	display: block;
	margin-bottom: 4rem;
}
.st-section__title {
	margin: 0;
	font-size: clamp(2.6rem, 3.5vw, 3.6rem);
	line-height: 1.15;
}
.st-section__more {
	font-weight: 600;
	color: var(--bloghash-primary) !important;
	text-decoration: none !important;
	white-space: nowrap;
}

.st-grid {
	display: grid;
	gap: 2.4rem;
}
/* Three across on desktop: five products read as 3 + 2 and six posts as 3 + 3, never a lone orphan. */
.st-grid--products,
.st-grid--posts {
	grid-template-columns: repeat(3, minmax(0, 1fr));
}
@media (min-width: 1081px) {
	.st-grid--products.st-grid--cols-4 {
		grid-template-columns: repeat(4, minmax(0, 1fr));
	}
	.st-grid--cols-4 .st-product__body {
		padding: 2rem 2rem 0;
	}
	.st-grid--cols-4 .st-product__footer {
		padding: 1.6rem 2rem 2rem;
	}
}
@media (max-width: 1080px) {
	.st-grid--products,
	.st-grid--posts {
		grid-template-columns: repeat(2, minmax(0, 1fr));
	}
}
@media (max-width: 640px) {
	.st-grid--products,
	.st-grid--posts {
		grid-template-columns: 1fr;
	}
}

/* ---- Product cards ----------------------------------------------------- */

.st-product {
	display: flex;
	flex-direction: column;
	border: 1px solid var(--st-border);
	border-radius: var(--st-radius);
	background: var(--st-card);
	overflow: hidden;
	transition: border-color 0.2s, background-color 0.2s, transform 0.2s;
}
.st-product:hover {
	border-color: var(--bloghash-primary_27, var(--bloghash-primary));
	background: var(--st-card-hover);
	transform: translateY(-2px);
}
.st-product__media {
	position: relative;
	display: flex;
	align-items: center;
	justify-content: center;
	aspect-ratio: 16 / 9;
	background:
		linear-gradient(135deg, var(--bloghash-primary_27, rgba(232, 122, 48, 0.27)), transparent 60%),
		rgba(255, 255, 255, 0.03);
}
/* Product images are logos: show the whole mark, centred, never cropped. */
.st-product__media img {
	width: auto;
	height: auto;
	max-width: 55%;
	max-height: 70%;
	object-fit: contain;
	filter: drop-shadow(0 6px 18px rgba(0, 0, 0, 0.35));
	transition: transform 0.25s ease;
}
.st-product:hover .st-product__media img {
	transform: scale(1.04);
}
/* App-icon corners, so square logos and pre-rounded ones read as one set. */
.st-product__media img,
.st-product-hero__logo img {
	border-radius: 22%;
}

/* Featured ("Just launched") product: full row, logo beside the copy. */
.st-product--featured {
	grid-column: 1 / -1;
	display: grid;
	grid-template-columns: minmax(0, 0.9fr) minmax(0, 1.4fr);
	grid-template-rows: 1fr auto;
	border-color: var(--bloghash-primary_27, var(--bloghash-primary));
}
.st-product--featured .st-product__media {
	grid-row: 1 / span 2;
	aspect-ratio: auto;
	min-height: 28rem;
}
.st-product--featured .st-product__media img {
	max-width: 50%;
}
.st-product--featured .st-product__body {
	align-self: end;
	padding: 4rem 4rem 0;
}
.st-product--featured .st-product__title {
	font-size: clamp(2.6rem, 3vw, 3.4rem);
}
.st-product--featured .st-product__tagline {
	font-size: 1.9rem;
}
.st-product--featured .st-product__summary {
	max-width: 60ch;
	font-size: 1.7rem;
}
.st-product--featured .st-product__footer {
	padding: 2.4rem 4rem 4rem;
}
.st-product--featured .st-badge {
	background: var(--bloghash-primary);
}
@media (max-width: 760px) {
	.st-product--featured {
		display: flex;
	}
	.st-product--featured .st-product__media {
		min-height: 0;
		aspect-ratio: 16 / 9;
	}
	.st-product--featured .st-product__body {
		padding: 2.4rem 2.4rem 0;
	}
	.st-product--featured .st-product__footer {
		padding: 2rem 2.4rem 2.4rem;
	}
}
.st-product__monogram {
	font-size: 6.4rem;
	font-weight: 700;
	line-height: 1;
	color: var(--bloghash-primary);
	opacity: 0.9;
}
.st-product__body {
	flex: 1;
	padding: 2.4rem 2.4rem 0;
}
.st-product__title {
	margin: 0 0 0.6rem;
	font-size: 2.1rem;
	line-height: 1.25;
}
.st-product__title a {
	color: inherit !important;
	text-decoration: none !important;
}
.st-product__tagline {
	margin: 0 0 1.2rem;
	font-weight: 600;
	color: var(--bloghash-primary);
}
.st-product__summary {
	margin: 0;
	font-size: 1.5rem;
	color: var(--st-muted);
}
.st-product__footer {
	padding: 2rem 2.4rem 2.4rem;
}

.st-badge {
	position: absolute;
	top: 1.2rem;
	left: 1.2rem;
	padding: 0.4rem 1rem;
	border-radius: 999px;
	font-size: 1.2rem;
	font-weight: 700;
	letter-spacing: 0.04em;
	text-transform: uppercase;
	background: rgba(0, 0, 0, 0.55);
	color: #fff;
}
.st-badge--live {
	background: #1f8a4c;
}
.st-badge--beta {
	background: var(--bloghash-primary);
}

.st-badge--inline {
	position: static;
	display: inline-block;
	margin-bottom: 1.6rem;
}

/* ---- Single product page ---------------------------------------------- */

.st-product-hero {
	position: relative;
	padding: 7rem 0 4rem;
	overflow: hidden;
}
.st-product-hero::before {
	content: "";
	position: absolute;
	inset: -30% auto auto -10%;
	width: 60rem;
	height: 60rem;
	background: radial-gradient(closest-side, var(--bloghash-primary_27, rgba(232, 122, 48, 0.27)), transparent);
	pointer-events: none;
}
.st-product-hero__inner {
	position: relative;
	display: grid;
	grid-template-columns: 22rem minmax(0, 1fr);
	gap: 5rem;
	align-items: center;
}
.st-product-hero__logo {
	display: flex;
	align-items: center;
	justify-content: center;
	aspect-ratio: 1;
	padding: 2.8rem;
	border: 1px solid var(--st-border);
	border-radius: 2.8rem;
	background:
		linear-gradient(135deg, var(--bloghash-primary_27, rgba(232, 122, 48, 0.27)), transparent 65%),
		var(--st-card);
}
.st-product-hero__logo img {
	width: 100%;
	height: 100%;
	object-fit: contain;
}
.st-product-hero__title {
	margin: 0 0 0.8rem;
	font-size: clamp(3.4rem, 5vw, 5.2rem);
	line-height: 1.08;
	letter-spacing: -0.02em;
}
.st-product-hero__tagline {
	margin: 0 0 2rem;
	font-size: 2.1rem;
	font-weight: 600;
	color: var(--bloghash-primary);
}

/* Editor content: details, screenshots, galleries. */
.st-product-content {
	max-width: 96rem;
	margin-inline: auto;
	padding: 4.8rem;
	border: 1px solid var(--st-border);
	border-radius: var(--st-radius);
	background: var(--st-card);
}
.st-product-content > :first-child {
	margin-top: 0;
}
.st-product-content > :last-child {
	margin-bottom: 0;
}
.st-product-content h2 {
	margin: 4rem 0 1.6rem;
	font-size: 2.8rem;
}
.st-product-content h3 {
	margin: 3rem 0 1.2rem;
	font-size: 2.1rem;
}
.st-product-content ul {
	padding-left: 2.2rem;
}
.st-product-content li + li {
	margin-top: 0.6rem;
}
.st-product-content li::marker {
	color: var(--bloghash-primary);
}
.st-product-content img {
	border-radius: 1rem;
	box-shadow: 0 12px 32px rgba(0, 0, 0, 0.35);
}
.st-product-content .wp-block-gallery {
	gap: 1.6rem;
}

@media (max-width: 760px) {
	.st-product-hero__inner {
		grid-template-columns: 1fr;
		gap: 2.8rem;
	}
	.st-product-hero__logo {
		width: 14rem;
		padding: 1.8rem;
		border-radius: 2rem;
	}
	.st-product-content {
		padding: 2.8rem 2rem;
	}
}

/* ---- Security band ----------------------------------------------------- */

.st-security__panel {
	display: grid;
	grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr);
	gap: 4rem;
	align-items: center;
	padding: 4.8rem;
	border: 1px solid var(--st-border);
	border-radius: var(--st-radius);
	background:
		linear-gradient(120deg, var(--bloghash-primary_10, rgba(232, 122, 48, 0.1)), transparent 55%),
		var(--st-card);
}
.st-security__copy p:not(.st-eyebrow) {
	margin: 1.6rem 0 2.8rem;
	color: var(--st-muted);
}
.st-security__list {
	display: grid;
	gap: 1.2rem;
	margin: 0;
	padding: 0;
	list-style: none;
}
.st-security__list li {
	display: grid;
	gap: 0.2rem;
	padding: 1.6rem 2rem;
	border-left: 3px solid var(--bloghash-primary);
	border-radius: 0 var(--st-radius) var(--st-radius) 0;
	background: rgba(255, 255, 255, 0.04);
}
.st-security__list span {
	font-size: 1.5rem;
	color: var(--st-muted);
}
.st-security__list a {
	color: inherit !important;
}

/* ---- Latest posts ------------------------------------------------------ */

.st-post {
	display: flex;
	flex-direction: column;
	border: 1px solid var(--st-border);
	border-radius: var(--st-radius);
	background: var(--st-card);
	overflow: hidden;
}
.st-post__media {
	display: block;
	aspect-ratio: 16 / 9;
	background: rgba(255, 255, 255, 0.03);
}
.st-post__media img {
	width: 100%;
	height: 100%;
	object-fit: cover;
}
.st-post__body {
	padding: 2rem 2.4rem 2.4rem;
}
.st-post__cat {
	font-size: 1.2rem;
	font-weight: 700;
	letter-spacing: 0.06em;
	text-transform: uppercase;
	color: var(--bloghash-primary) !important;
	text-decoration: none !important;
}
.st-post__title {
	margin: 0.6rem 0 1rem;
	font-size: 1.9rem;
	line-height: 1.3;
}
.st-post__title a {
	color: inherit !important;
	text-decoration: none !important;
}
.st-post__title a:hover {
	color: var(--bloghash-primary) !important;
}
.st-post__date {
	font-size: 1.4rem;
	color: var(--st-muted);
}

/* ---- Small screens ----------------------------------------------------- */

@media (max-width: 960px) {
	.st-security__panel {
		grid-template-columns: 1fr;
		padding: 3.2rem 2.4rem;
	}
}
@media (max-width: 600px) {
	.st-hero {
		padding: 5.6rem 0 4rem;
	}
	.st-section__head {
		flex-direction: column;
		align-items: flex-start;
		gap: 0.8rem;
	}
}

@media (prefers-reduced-motion: reduce) {
	.st-btn,
	.st-product {
		transition: none;
	}
	.st-btn:hover,
	.st-product:hover {
		transform: none;
	}
}
