/**
 * home.css
 * Styles specific to front-page.php sections. The product grid itself
 * (.product-grid / .product-card) is defined once in components.css and
 * reused here, in Phase 5's shop archive, and in Phase 6's related
 * products — not redefined per context.
 */

/* ---------------------------------------------------------------
 * Hero (§8)
 * ------------------------------------------------------------- */
.hero {
	padding-block: var(--space-6);
}

.hero__inner {
	display: grid;
	grid-template-columns: 1fr 1fr;
	gap: var(--space-6);
	align-items: center;
}

.hero__eyebrow {
	display: block;
	margin-bottom: var(--space-2);
}

.hero__title {
	margin-bottom: var(--space-3);
}

.hero__description {
	max-width: 40ch;
	margin-bottom: var(--space-4);
	font-size: 1.0625rem;
}

.hero__media {
	border-radius: var(--radius-lg);
	overflow: hidden;
	aspect-ratio: 4 / 3;
	background-color: var(--color-surface);
}

.hero__image {
	width: 100%;
	height: 100%;
	object-fit: cover;
}

.hero__image-placeholder {
	width: 100%;
	height: 100%;
	background: linear-gradient(160deg, var(--color-surface) 0%, var(--color-surface-2) 100%);
}

@media (max-width: 900px) {
	.hero__inner {
		grid-template-columns: 1fr;
	}

	.hero__media {
		order: -1;
		aspect-ratio: 16 / 10;
	}
}

/* ---------------------------------------------------------------
 * Featured categories (§8)
 * ------------------------------------------------------------- */
.category-card {
	position: relative;
}

.category-card__link {
	display: block;
	border-radius: var(--radius-md);
	overflow: hidden;
}

.category-card__media {
	position: relative;
	aspect-ratio: 1 / 1;
	background-color: var(--color-surface-2);
	overflow: hidden;
}

.category-card__image {
	width: 100%;
	height: 100%;
	object-fit: cover;
	transition: transform var(--duration-slow) var(--ease-standard);
}

.category-card__link:hover .category-card__image {
	transform: scale(1.05);
}

.category-card__media::after {
	content: "";
	position: absolute;
	inset: 0;
	background: linear-gradient(to top, rgba(0, 0, 0, 0.55) 0%, rgba(0, 0, 0, 0) 55%);
}

.category-card__body {
	position: absolute;
	left: var(--space-3);
	bottom: var(--space-3);
	right: var(--space-3);
	display: flex;
	flex-direction: column;
	gap: 2px;
	z-index: 1;
}

.category-card__name {
	font-weight: 600;
	color: #ffffff;
}

.category-card__count {
	font-size: var(--font-size-xs);
	color: rgba(255, 255, 255, 0.75);
}

/* ---------------------------------------------------------------
 * Promo banner (§8)
 * ------------------------------------------------------------- */
.promo-banner {
	text-align: center;
	padding: var(--space-6) var(--space-4);
	border-radius: var(--radius-lg);
	background: linear-gradient(160deg, var(--color-surface) 0%, var(--color-surface-2) 100%);
	border: 1px solid var(--color-border);
}

.promo-banner__eyebrow {
	display: block;
	margin-bottom: var(--space-2);
}

.promo-banner__title {
	margin-bottom: var(--space-1);
}

.promo-banner__subtitle {
	font-size: 1.125rem;
	color: var(--color-text-secondary);
	margin-bottom: var(--space-4);
}

/* ---------------------------------------------------------------
 * Benefits (§8)
 * ------------------------------------------------------------- */
.benefits-grid {
	display: grid;
	grid-template-columns: repeat(4, 1fr);
	gap: var(--space-4);
}

.benefit {
	display: flex;
	flex-direction: column;
	align-items: flex-start;
	gap: var(--space-1);
	padding: var(--space-4);
	border: 1px solid var(--color-border);
	border-radius: var(--radius-md);
}

.benefit__icon {
	display: inline-flex;
	width: 36px;
	height: 36px;
	align-items: center;
	justify-content: center;
	margin-bottom: var(--space-1);
	color: var(--color-text);
}

.benefit__icon svg {
	width: 28px;
	height: 28px;
}

.benefit__title {
	font-weight: 600;
	font-size: var(--font-size-small);
}

.benefit__description {
	font-size: var(--font-size-xs);
	color: var(--color-text-muted);
}

@media (max-width: 768px) {
	.benefits-grid {
		grid-template-columns: repeat(2, 1fr);
	}
}

@media (max-width: 380px) {
	/* At the smallest tested widths (320–375px, §21) two columns leaves
	   each benefit card too narrow for its padding + icon + copy without
	   feeling cramped — one column reads better than shrinking further. */
	.benefits-grid {
		grid-template-columns: 1fr;
	}
}

/* ---------------------------------------------------------------
 * Newsletter (§8)
 * ------------------------------------------------------------- */
.newsletter {
	text-align: center;
	max-width: 560px;
	margin-inline: auto;
	padding-block: var(--space-4);
}

.newsletter__title {
	margin-bottom: var(--space-2);
}

.newsletter__description {
	margin-bottom: var(--space-4);
}

.newsletter__form {
	display: flex;
	gap: var(--space-2);
}

.newsletter__input {
	flex: 1;
}

.newsletter__honeypot {
	position: absolute;
	left: -9999px;
	width: 1px;
	height: 1px;
	overflow: hidden;
}

.newsletter__feedback {
	margin-top: var(--space-3);
	font-size: var(--font-size-small);
	min-height: 1.2em;
}

.newsletter__feedback.is-success {
	color: var(--color-success);
}

.newsletter__feedback.is-error {
	color: var(--color-danger);
}

@media (max-width: 480px) {
	.newsletter__form {
		flex-direction: column;
	}
}
