/* ==========================================================================
   Homepage
   ========================================================================== */

.home-section {
	padding: var(--section-padding) var(--gutter);
}

.home-section-inner {
	max-width: var(--container);
	margin: 0 auto;
}

.home-section-header {
	max-width: 640px;
	margin: 0 auto 32px;
	text-align: center;
}

.home-section-title {
	font-size: var(--text-h1);
	font-weight: 800;
	line-height: 1.2;
	color: var(--color-secondary);
}

.home-section-lead {
	margin-top: 8px;
	font-size: var(--text-lg);
	color: var(--color-secondary);
}

.home-section-footer {
	margin-top: 32px;
	text-align: center;
}

.home-button-secondary {
	display: inline-flex;
	align-items: center;
	gap: 8px;
	padding: 13px 26px;
	border: 1px solid var(--color-border);
	border-radius: var(--radius-pill);
	background: var(--color-surface);
	color: var(--color-secondary);
	font-size: var(--text-md);
	font-weight: 700;
	transition: background 0.2s ease, border-color 0.2s ease;
}

.home-button-secondary:hover {
	background: var(--color-primary-tint);
	border-color: var(--color-primary-tint);
}

.home-button-secondary .dp-icon {
	width: 18px;
	height: 18px;
}

/* Banner slideshow
   A horizontal scroll-snap track: swiping works natively on touch screens,
   and the arrows, dots and autoplay (home.js) just scroll it.
   ========================================================================== */

.home-hero {
	padding: 24px var(--gutter) 0;
}

.home-hero-inner {
	max-width: var(--container);
	margin: 0 auto;
}

.home-hero-viewport {
	position: relative;
	border-radius: var(--radius-lg);
	overflow: hidden;
	background: var(--color-surface-muted);
}

/* --hero-ratio-* are set inline from the first banner's image sizes */
.home-hero-track {
	display: flex;
	aspect-ratio: var(--hero-ratio-desktop);
	overflow-x: auto;
	overscroll-behavior-x: contain;
	scroll-snap-type: x mandatory;
	scrollbar-width: none;
}

.home-hero-track::-webkit-scrollbar {
	display: none;
}

.home-hero-slide {
	flex: 0 0 100%;
	scroll-snap-align: start;
	scroll-snap-stop: always;
}

.home-hero-link,
.home-hero-slide picture {
	display: block;
	height: 100%;
}

.home-hero-image {
	width: 100%;
	height: 100%;
	object-fit: cover;
}

/* A banner whose image is a different shape from the box at this screen
   size (e.g. a desktop image standing in for a missing mobile one) is
   shown whole rather than cropped, so text in the artwork isn't cut off. */
@media (min-width: 992px) {
	.home-hero-slide.is-letterboxed-desktop .home-hero-image {
		object-fit: contain;
	}
}

@media (min-width: 601px) and (max-width: 991px) {
	.home-hero-slide.is-letterboxed-tablet .home-hero-image {
		object-fit: contain;
	}
}

@media (max-width: 600px) {
	.home-hero-slide.is-letterboxed-mobile .home-hero-image {
		object-fit: contain;
	}
}

/* The viewport clips overflow, so a focused banner shows its ring inside. */
.home-hero-link:focus-visible {
	outline-offset: -4px;
}

.home-hero-controls {
	display: flex;
	align-items: center;
	justify-content: center;
	gap: 8px;
	margin-top: 12px;
}

.home-hero-pause,
.home-hero-arrow {
	display: flex;
	align-items: center;
	justify-content: center;
	width: 36px;
	height: 36px;
	border-radius: 50%;
	color: var(--color-secondary);
	transition: background 0.2s ease;
}

.home-hero-pause:hover,
.home-hero-arrow:hover {
	background: var(--color-surface-muted);
}

.home-hero-pause .dp-icon {
	width: 16px;
	height: 16px;
}

.home-hero-arrow .dp-icon {
	width: 20px;
	height: 20px;
}

/* Pause sits a little apart from the prev / dots / next group */
.home-hero-pause {
	margin-right: 8px;
}

.home-hero-pause .dp-icon-play,
.home-hero-pause.is-paused .dp-icon-pause {
	display: none;
}

.home-hero-pause.is-paused .dp-icon-play {
	display: block;
}

.home-hero-dots {
	display: flex;
}

/* Each dot is a 28px button for an easy tap target; the visible dot is drawn inside. */
.home-hero-dot {
	display: flex;
	align-items: center;
	justify-content: center;
	width: 28px;
	height: 28px;
}

.home-hero-dot::before {
	content: '';
	width: 8px;
	height: 8px;
	border-radius: var(--radius-pill);
	background: var(--color-border-strong);
	transition: width 0.2s ease, background 0.2s ease;
}

.home-hero-dot:hover::before {
	background: var(--color-secondary);
}

.home-hero-dot[aria-current="true"]::before {
	width: 22px;
	background: var(--color-secondary);
}

/* School finder
   ========================================================================== */

.home-school-search {
	position: relative;
	max-width: 560px;
	margin: 0 auto;
}

.home-school-search-icon {
	position: absolute;
	top: 50%;
	left: 20px;
	transform: translateY(-50%);
	display: flex;
	color: var(--color-secondary);
	pointer-events: none;
}

.home-school-search-input {
	width: 100%;
	height: 56px;
	padding: 0 56px 0 52px;
	border: 1px solid var(--color-border);
	border-radius: var(--radius-pill);
	background: var(--color-surface);
	box-shadow: var(--shadow-sm);
	font-size: var(--text-lg);
	color: var(--color-secondary);
	transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.home-school-search-input::placeholder {
	color: var(--color-secondary);
	opacity: 1;
}

/* The form has its own clear button. */
.home-school-search-input::-webkit-search-cancel-button {
	-webkit-appearance: none;
	appearance: none;
}

.home-school-search-input:focus {
	outline: none;
	border-color: var(--color-focus);
	box-shadow: var(--shadow-sm), var(--focus-halo);
}

.home-school-search-clear {
	position: absolute;
	top: 50%;
	right: 12px;
	transform: translateY(-50%);
	display: flex;
	align-items: center;
	justify-content: center;
	width: 36px;
	height: 36px;
	border-radius: 50%;
	color: var(--color-secondary);
}

.home-school-search-clear:hover {
	background: var(--color-surface-muted);
}

.home-school-search-status {
	min-height: 1.5em;
	margin: 12px 0 20px;
	text-align: center;
	font-size: var(--text-base);
	color: var(--color-secondary);
}

.home-school-empty {
	padding: 24px 0;
	text-align: center;
	color: var(--color-secondary);
}

.home-school-empty-link {
	font-weight: 600;
	text-decoration: underline;
}

/* How it works
   ========================================================================== */

.home-steps {
	background: var(--color-surface-subtle);
}

.home-steps-list {
	display: grid;
	grid-template-columns: repeat(3, minmax(0, 1fr));
	gap: 24px;
	counter-reset: step;
}

.home-step {
	position: relative;
	padding: 28px 24px;
	border-radius: var(--radius-lg);
	background: var(--color-surface);
	box-shadow: var(--shadow-sm);
	counter-increment: step;
}

/* Step number, top right (the <ol> carries the order for screen readers) */
.home-step::before {
	content: counter(step);
	position: absolute;
	top: 20px;
	right: 24px;
	font-size: var(--text-3xl);
	font-weight: 800;
	line-height: 1;
	color: var(--color-border-strong);
}

.home-step-icon {
	display: flex;
	align-items: center;
	justify-content: center;
	width: 52px;
	height: 52px;
	border-radius: var(--radius-md);
	background: var(--color-primary-tint);
	color: var(--color-secondary);
}

.home-step-icon .dp-icon {
	width: 26px;
	height: 26px;
}

.home-step-title {
	margin-top: 16px;
	font-size: var(--text-xl);
	font-weight: 700;
	color: var(--color-secondary);
}

.home-step-text {
	margin-top: 6px;
	font-size: var(--text-md);
	line-height: 1.6;
	color: var(--color-secondary);
}

/* Categories
   ========================================================================== */

.home-category-grid {
	display: grid;
	grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
	gap: 16px;
}

.home-category a {
	display: flex;
	flex-direction: column;
	align-items: center;
	gap: 4px;
	height: 100%;
	padding: 24px 16px;
	border-radius: var(--radius-lg);
	background: var(--color-surface);
	box-shadow: var(--shadow-sm);
	text-align: center;
	transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.home-category a:hover {
	transform: translateY(-4px);
	box-shadow: var(--shadow-md);
}

.home-category-icon {
	display: flex;
	align-items: center;
	justify-content: center;
	width: 64px;
	height: 64px;
	margin-bottom: 8px;
	border-radius: 50%;
	overflow: hidden;
	background: var(--color-primary-tint);
	color: var(--color-secondary);
}

.home-category-icon .dp-icon {
	width: 28px;
	height: 28px;
}

.home-category-icon img {
	width: 100%;
	height: 100%;
	object-fit: cover;
}

.home-category-name {
	font-size: var(--text-md);
	font-weight: 700;
	color: var(--color-secondary);
}

.home-category-count {
	font-size: var(--text-sm);
	color: var(--color-secondary);
}

/* Products
   Four across (two rows of the eight shown), two on phones.
   ========================================================================== */

.home-products {
	background: var(--color-surface-subtle);
}

.home-product-grid {
	grid-template-columns: repeat(4, minmax(0, 1fr));
}

/* WhatsApp help band
   ========================================================================== */

.home-help {
	padding: var(--section-padding) var(--gutter);
}

.home-help-inner {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 24px;
	max-width: var(--container);
	margin: 0 auto;
	padding: 40px 48px;
	border-radius: var(--radius-lg);
	background: var(--color-primary-tint);
}

.home-help-title {
	font-size: var(--text-3xl);
	font-weight: 800;
	line-height: 1.25;
	color: var(--color-dark);
}

.home-help-text {
	margin-top: 6px;
	font-size: var(--text-lg);
	color: var(--color-secondary);
}

.home-help-button {
	display: inline-flex;
	align-items: center;
	flex-shrink: 0;
	gap: 10px;
	padding: 14px 28px;
	border-radius: var(--radius-pill);
	background: var(--color-dark);
	color: var(--color-white);
	font-size: var(--text-md);
	font-weight: 700;
	transition: opacity 0.2s ease;
}

.home-help-button:hover {
	opacity: 0.85;
}

.home-help-button .dp-icon {
	width: 20px;
	height: 20px;
}

/* Responsive
   ========================================================================== */

@media (max-width: 991px) {
	.home-hero-track {
		aspect-ratio: var(--hero-ratio-tablet);
	}
}

@media (max-width: 900px) {
	/* Steps stack as wide rows: icon on the left, text beside it */
	.home-steps-list {
		grid-template-columns: minmax(0, 1fr);
		gap: 16px;
	}

	.home-step {
		display: flex;
		align-items: flex-start;
		gap: 16px;
		padding: 20px 56px 20px 20px;
	}

	.home-step-icon {
		flex-shrink: 0;
	}

	.home-step-title {
		margin-top: 0;
	}

	.home-help-inner {
		flex-direction: column;
		align-items: flex-start;
		padding: 32px 28px;
	}
}

@media (max-width: 600px) {
	.home-hero {
		padding-top: 16px;
	}

	.home-hero-track {
		aspect-ratio: var(--hero-ratio-mobile);
	}

	.home-hero-viewport {
		border-radius: var(--radius-md);
	}

	.home-section-header {
		margin-bottom: 24px;
	}

	.home-category-grid,
	.home-product-grid {
		grid-template-columns: repeat(2, minmax(0, 1fr));
		gap: 12px;
	}

	.home-category a {
		padding: 20px 12px;
	}

	.home-help-title {
		font-size: var(--text-2xl);
	}

	.home-help-button {
		align-self: stretch;
		justify-content: center;
	}
}
