/**
 * Controlled homepage blocks.
 *
 * Structure and data belong to DIM LELIN Core. This file owns presentation
 * only and consumes the shared design-system tokens.
 */

.page.home .site-main--front-page {
	width: 100%;
	max-width: none;
	padding-block: 0;
}

.dim-homepage {
	width: 100%;
}

.dim-homepage-hero {
	position: relative;
	display: grid;
	width: 100%;
	margin-left: 0;
	min-height: calc(100svh - var(--dim-header-height));
	align-items: end;
	overflow: hidden;
	background: var(--dim-hero-background);
	isolation: isolate;
}

.dim-homepage-hero__media {
	position: absolute;
	z-index: var(--dim-z-base);
	inset: 0;
	background: var(--dim-hero-background);
	background-size: cover;
	transform: scale(1.02);
	animation: dim-hero-drift 18s ease-in-out infinite alternate;
}

.dim-homepage-hero--has-media .dim-homepage-hero__media::after {
	position: absolute;
	inset: 0;
	background: var(--dim-hero-image-overlay);
	content: "";
}

.dim-homepage-hero__media picture {
	position: absolute;
	inset: 0;
}

.dim-homepage-hero__media picture,
.dim-homepage-hero__image {
	display: block;
	width: 100%;
	height: 100%;
}

.dim-homepage-hero__image {
	object-fit: cover;
}

.dim-homepage-hero__content {
	position: relative;
	z-index: var(--dim-z-raised);
	width: min(100%, var(--dim-container-storefront));
	padding: var(--dim-space-8) 1.25rem calc(var(--dim-space-8) + var(--dim-space-4));
	margin-inline: auto;
	color: var(--dim-color-hero-text);
	animation: dim-hero-fade-up 1s var(--dim-ease-standard) both;
}

.dim-homepage-hero__brand {
	display: inline-flex;
	flex-direction: column;
	align-items: center;
	margin: 0 0 calc(var(--dim-space-4) + var(--dim-space-1));
	color: var(--dim-color-hero-text);
	font-family: var(--dim-font-family-hero-display);
	font-size: clamp(2.8rem, 8vw, 5.5rem);
	font-weight: var(--dim-font-weight-medium);
	letter-spacing: 0.22em;
	line-height: 0.95;
	text-transform: uppercase;
}

.dim-homepage-hero__brand > span {
	display: block;
}

.dim-homepage-hero__title {
	max-width: 18ch;
	margin: 0 0 0.6rem;
	color: var(--dim-color-hero-text);
	font-family: var(--dim-font-family-hero-display);
	font-size: clamp(1.35rem, 2.6vw, 1.85rem);
	font-weight: var(--dim-font-weight-regular);
	letter-spacing: 0.04em;
	line-height: var(--dim-line-height-tight);
}

.dim-homepage-hero__text {
	max-width: 34ch;
	margin: 0 0 1.75rem;
	color: var(--dim-color-hero-text-muted);
	font-size: var(--dim-font-size-body);
	line-height: 1.55;
}

.dim-homepage-hero__cta {
	padding: 0.7rem 1.4rem;
	border-color: transparent;
	color: var(--dim-color-hero-text);
	background: var(--dim-color-hero-ink);
	font-size: 0.92rem;
	font-weight: var(--dim-font-weight-regular);
	letter-spacing: 0.04em;
	transition:
		transform 250ms var(--dim-ease-standard),
		background-color 250ms var(--dim-ease-standard),
		color 250ms var(--dim-ease-standard);
}

.dim-homepage-hero__cta:hover {
	color: var(--dim-color-hero-text);
	background: var(--dim-color-hero-button-hover);
	transform: translateY(-1px);
}

.dim-homepage-hero__cta:focus-visible {
	outline-color: var(--dim-color-hero-text);
}

@keyframes dim-hero-fade-up {
	from {
		opacity: 0;
		transform: translateY(18px);
	}

	to {
		opacity: 1;
		transform: translateY(0);
	}
}

@keyframes dim-hero-drift {
	from {
		transform: scale(1.02) translate3d(0, 0, 0);
	}

	to {
		transform: scale(1.06) translate3d(-1.5%, -1%, 0);
	}
}

@media (prefers-reduced-motion: reduce) {
	.dim-homepage-hero__media,
	.dim-homepage-hero__content {
		animation: none;
	}

	.dim-homepage-hero__media {
		transform: none;
	}

	.dim-homepage-hero__cta {
		transition-duration: 0.01ms;
	}
}

.dim-homepage-categories {
	width: min(100%, var(--dim-container-storefront));
	padding: var(--dim-space-4) 1.25rem calc(var(--dim-space-8) + var(--dim-space-4));
	margin-inline: auto;
	overflow-wrap: anywhere;
}

.dim-homepage-products {
	width: 100%;
	padding: 0;
	margin: 0;
	color: var(--dim-color-homepage-ink);
	background: transparent;
}

.dim-homepage-products__inner {
	width: min(100%, var(--dim-container-storefront));
	padding: var(--dim-space-8) calc(var(--dim-space-4) + var(--dim-space-1));
	margin-inline: auto;
}

.dim-homepage-section-header {
	display: flex;
	flex-wrap: wrap;
	gap: var(--dim-space-4);
	align-items: baseline;
	justify-content: space-between;
	margin-bottom: var(--dim-space-6);
}

.dim-homepage-section-header > * {
	margin-block: 0;
}

.dim-homepage-section-header h2 {
	color: var(--dim-color-homepage-ink);
	font-family: var(--dim-font-family-hero-display);
	font-size: clamp(1.8rem, 3vw, 2.4rem);
	font-weight: var(--dim-font-weight-medium);
	line-height: var(--dim-line-height-tight);
}

.dim-homepage-section-header .c-link {
	border-bottom: var(--dim-border-width) solid var(--dim-color-homepage-line);
	color: var(--dim-color-homepage-ink);
	font-size: 0.92rem;
	text-decoration: none;
	transition: border-color var(--dim-transition-base) var(--dim-ease-standard);
}

.dim-homepage-section-header .c-link:hover {
	border-color: var(--dim-color-homepage-ink);
}

.dim-homepage-products .l-product-grid {
	grid-template-columns: repeat(2, minmax(0, 1fr));
	gap: var(--dim-space-5) calc(var(--dim-space-4) + var(--dim-space-1));
}

.dim-product-card {
	transition: transform 350ms var(--dim-ease-standard);
}

.dim-product-card__link {
	display: block;
	color: inherit;
	text-decoration: none;
}

.dim-product-card__media {
	position: relative;
	aspect-ratio: 3 / 4;
	margin-bottom: 0.85rem;
	overflow: hidden;
	background: var(--dim-color-homepage-background-deep);
}

.dim-product-card__media img {
	width: 100%;
	height: 100%;
	object-fit: cover;
	transition: transform 600ms var(--dim-ease-standard);
}

.dim-product-card__placeholder {
	display: grid;
	width: 100%;
	height: 100%;
	min-height: 12rem;
	place-items: center;
	color: var(--dim-color-homepage-placeholder-text);
	background: var(--dim-products-placeholder-background);
	font-family: var(--dim-font-family-hero-display);
	font-size: 3rem;
}

.dim-product-card__body {
	display: grid;
	gap: var(--dim-space-1);
}

.dim-product-card__body .c-product-title {
	margin: 0;
	color: var(--dim-color-homepage-ink);
	font-family: var(--dim-font-family-hero-display);
	font-size: 1.35rem;
	font-weight: var(--dim-font-weight-medium);
	line-height: var(--dim-line-height-tight);
}

.dim-product-card__body .c-price {
	margin: 0;
	color: var(--dim-color-homepage-ink);
	font-size: var(--dim-font-size-body);
	font-weight: var(--dim-font-weight-medium);
}

.dim-product-card:hover {
	transform: translateY(calc(-1 * var(--dim-space-1)));
}

.dim-product-card:hover .dim-product-card__media img {
	transform: scale(1.04);
}

.dim-product-card__link:focus-visible {
	outline: var(--dim-border-width-strong) solid var(--dim-color-focus);
	outline-offset: var(--dim-space-1);
}

@media (min-width: 50rem) {
	.dim-homepage-products .l-product-grid {
		grid-template-columns: repeat(4, minmax(0, 1fr));
		gap: var(--dim-space-6) var(--dim-space-5);
	}
}

.dim-homepage-categories {
	color: var(--dim-color-homepage-ink);
	text-align: center;
}

.dim-homepage-categories > .c-caption {
	margin-bottom: var(--dim-space-5);
	color: var(--dim-color-homepage-ink-muted);
	letter-spacing: 0.16em;
	text-transform: uppercase;
}

.dim-homepage-categories__list {
	display: flex;
	flex-wrap: wrap;
	gap: var(--dim-space-3) var(--dim-space-6);
	justify-content: center;
	padding: 0;
	margin: 0;
	list-style: none;
}

.dim-homepage-categories__list li {
	min-width: 0;
}

.dim-homepage-categories__list a {
	display: inline-flex;
	min-height: 2.75rem;
	align-items: center;
	color: var(--dim-color-homepage-ink);
	font-family: var(--dim-font-family-hero-display);
	font-size: clamp(1.4rem, 3vw, 2rem);
	letter-spacing: 0.08em;
	line-height: var(--dim-line-height-tight);
	text-decoration: none;
	transition: color var(--dim-transition-base) var(--dim-ease-standard);
}

.dim-homepage-categories__list a:hover {
	color: var(--dim-color-homepage-ink-muted);
}

.dim-homepage-categories__list a:focus-visible {
	outline: var(--dim-border-width-strong) solid var(--dim-color-focus);
	outline-offset: var(--dim-space-1);
}

@media (prefers-reduced-motion: reduce) {
	.dim-product-card,
	.dim-product-card__media img,
	.dim-homepage-categories__list a {
		transform: none;
		transition-duration: 0.01ms;
	}
}
