/**
 * homepage.css
 *
 * Homepage-only sections: hero carousel, trust bar, featured categories,
 * SEO text/testimonials, blog preview, newsletter. Ported directly from
 * the approved review mockup. Product carousel sections (New Arrivals /
 * Best Offers / Trending) reuse product-carousel.css + product-card.css —
 * nothing duplicated here.
 */

/*
 * Phase 5 (2026-09-28) — per-section "Full page width" layout option
 * (Appearance > Homepage Content). Every homepage section already
 * separates a full-bleed outer element (this file's .section,
 * .usp-bar, .hero-carousel) from an inner .wrap that caps actual
 * content at the site's standard 1240px — this override just removes
 * that inner cap for a section an admin explicitly set to "Full page
 * width" (includes/homepage-sections.php wraps that section's output
 * in this class), letting its own grid/flex content stretch to fill
 * the section instead of stopping at .wrap's max-width. .wrap's 24px
 * side padding is kept as-is, for basic edge breathing room — only the
 * max-width cap is removed, nothing else about .wrap changes.
 */
.wt-section-full-width .wrap {
	max-width: none;
}

.section {
	padding: 48px 0;
}
/*
 * Alternating section backgrounds (mockup: white / #fafafa, starting
 * white right after the trust bar). This class existed before but was
 * never applied anywhere — the `.section`/`.wrap` wrapper structure was
 * already correct (each homepage template part wraps itself, or is
 * wrapped by front-page.php, depending on the part — see each
 * template's own docblock), the alternation itself was just never
 * wired in. testimonials.php already hardcoded its own `#fafafa` inline
 * style; this class covers the other two sections that need it (New
 * Arrivals and Trending Products), applied conditionally via the
 * `$carousel_section_alt` query var product-carousel.php reads — see
 * front-page.php.
 */
.section-alt {
	background: var(--bg-soft);
}
.section-title {
	display: flex;
	align-items: baseline;
	justify-content: space-between;
	border-bottom: 2px solid var(--ink);
	padding-bottom: 10px;
	margin-bottom: 24px;
}
.section-title h2 {
	font-size: 20px;
	text-transform: uppercase;
	margin: 0;
}

/* ---------------- Hero carousel ---------------- */
.hero-carousel {
	position: relative;
	overflow: hidden;
	border-bottom: 1px solid var(--line);
}
.hero-track {
	display: flex;
	transition: transform 0.5s ease;
}
.hero-slide {
	min-width: 100%;
	height: 380px;
	display: flex;
	align-items: center;
	justify-content: center;
	color: var(--bg-bright);
	text-align: center;
	padding: 20px;
}
/*
 * Per-slide dark gradient backgrounds — the .s1/.s2/.s3 classes were
 * already being output correctly by hero-carousel.php, but these
 * background rules were never actually ported from the mockup, so
 * slides had no background at all (relying on whatever sat behind
 * them). Restoring the mockup's exact gradients.
 */
/* 2026-09-07: all 3 slides' gradients now start at #111 (was #111/#222/
 * #000 — inconsistent), matching .site-header's own `border-bottom: 2px
 * solid var(--ink)` (#111, header.css) exactly. Found live on the
 * deployed site: since that border sits along the full top edge of
 * whichever slide is showing, and only slide 1 happened to start at the
 * same #111, slides 2 and 3 showed a visible thin line where the flat
 * border color didn't match the hero's own top-edge color. End colors
 * (the 100% stop) are unchanged — each slide keeps its own distinct
 * gradient range, just anchored to the same starting shade the border
 * already is.
 *
 * 2026-09-28 (brand-token migration): the 0% stop is now var(--ink)
 * rather than a literal #111, since it's explicitly tied to matching
 * the header border/ink color above. The 100% stops (#333/#555/
 * #3a3a3a) are deliberately left as literal hex — they're per-slide
 * decorative endpoints, not part of the ink/paper token system, and
 * mapping them to the nearest token would collapse s1/s2's distinct
 * gradient ranges onto the same color (var(--ink)/var(--ink-soft)),
 * which is exactly what this comment says not to do. */
.hero-slide.s1 {
	background: linear-gradient(135deg, var(--ink) 0%, #333 100%);
}
.hero-slide.s2 {
	background: linear-gradient(135deg, var(--ink) 0%, #555 100%);
}
.hero-slide.s3 {
	background: linear-gradient(135deg, var(--ink) 0%, #3a3a3a 100%);
}
.hero-slide .inner {
	max-width: 620px;
}
.hero-slide h1 {
	font-size: 34px;
	text-transform: uppercase;
	letter-spacing: 0.02em;
	margin-bottom: 0.3em;
}
.hero-slide p {
	color: var(--line);
	margin-bottom: 20px;
}
.hero-slide .btn {
	display: inline-block;
	background: var(--bg-bright);
	color: var(--ink);
	padding: 12px 24px;
	font-size: 12.5px;
	text-transform: uppercase;
	letter-spacing: 0.04em;
	font-weight: 700;
}
.hero-arrow {
	position: absolute;
	top: 50%;
	transform: translateY(-50%);
	background: rgba(255, 255, 255, 0.9);
	border: 1px solid var(--ink);
	width: 40px;
	height: 40px;
	border-radius: 50%;
	font-size: 16px;
	z-index: 5;
	cursor: pointer;
}
.hero-arrow.prev {
	left: 20px;
}
.hero-arrow.next {
	right: 20px;
}
.hero-dots {
	position: absolute;
	bottom: 16px;
	left: 50%;
	transform: translateX(-50%);
	display: flex;
	gap: 8px;
	z-index: 5;
}
.hero-dots button {
	width: 8px;
	height: 8px;
	border-radius: 50%;
	border: 1px solid var(--bg-bright);
	background: transparent;
	padding: 0;
	cursor: pointer;
}
.hero-dots button.active {
	background: var(--bg-bright);
}

/* ---------------- Trust bar ---------------- */
.usp-bar {
	border-bottom: 1px solid var(--line);
	background: var(--bg-soft);
}
.usp-grid {
	display: grid;
	grid-template-columns: repeat(4, 1fr);
	gap: 20px;
	/* 2-value left/right restored explicitly (2026-09-07 fix) — same
	 * .wrap-clobbering bug found in header.css/footer.css: the old
	 * `padding: 26px 0` zeroed the sides, overriding .wrap's 24px
	 * horizontal gutter for the homepage trust-bar row. */
	padding: 26px 24px;
}
.usp-item {
	text-align: center;
	font-size: 12.5px;
}
.usp-item .icon {
	margin-bottom: 6px;
	display: flex;
	justify-content: center;
	color: var(--ink);
}
.usp-item .icon svg {
	width: 24px;
	height: 24px;
}
.usp-item strong {
	display: block;
	text-transform: uppercase;
	font-size: 13px;
	letter-spacing: 0.02em;
	margin-bottom: 2px;
}

/* ---------------- Featured categories ---------------- */
.cat-grid {
	display: grid;
	grid-template-columns: repeat(5, 1fr);
	gap: 16px;
}
.cat-card {
	position: relative;
	aspect-ratio: 1 / 1;
	border: 1px solid var(--ink);
	overflow: hidden;
	display: flex;
	align-items: flex-end;
	background: var(--line);
}
.cat-card span {
	background: rgba(17, 17, 17, 0.85);
	color: var(--bg-bright);
	width: 100%;
	padding: 10px;
	font-size: 12px;
	text-transform: uppercase;
	letter-spacing: 0.03em;
	font-weight: 700;
}
.cat-swatch {
	position: absolute;
	inset: 0;
}

/*
 * Carousel variant of Shop by Category — used once there are 5+
 * featured categories (see featured-categories.php's $use_carousel
 * check); below that it falls back to the plain .cat-grid above.
 * Reuses the same .carousel-wrap/.carousel-track/.carousel-arrow
 * markup contract and JS (assets/js/product-carousel.js) as the
 * product carousels — no new scroll behavior needed, just sizing.
 */
.carousel-track .cat-card {
	min-width: 220px;
	max-width: 220px;
	flex: 0 0 auto;
	scroll-snap-align: start;
}
/*
 * .cat-card's height comes from `aspect-ratio: 1/1` against its own
 * width, not a fixed pixel value like the product-carousel cards
 * (product-carousel.css's .carousel-arrow math is hardcoded to that
 * fixed 210px card height) — so centering via top:50% here instead of
 * copying that hardcoded pixel offset.
 */
.cat-carousel .carousel-arrow {
	top: 50%;
	margin-top: 0;
	transform: translateY(-50%);
}

/* ---------------- SEO text + testimonials ---------------- */
.testimonial-grid {
	display: grid;
	grid-template-columns: repeat(3, 1fr);
	gap: 20px;
	margin-top: 10px;
}
.testimonial-card {
	border: 1px solid var(--line);
	padding: 20px;
	font-size: 13px;
}
.testimonial-card p {
	color: var(--ink-soft);
	margin-bottom: 14px;
	font-style: italic;
}
.testimonial-card .author {
	font-weight: 700;
	font-size: 12.5px;
	text-transform: uppercase;
	letter-spacing: 0.02em;
}

/* ---------------- Blog preview ---------------- */
.blog-grid {
	display: grid;
	grid-template-columns: repeat(3, 1fr);
	gap: 20px;
}
.blog-card {
	border: 1px solid var(--line);
}
.blog-card .thumb {
	aspect-ratio: 16 / 9;
	background: var(--line);
}
.blog-card .body {
	padding: 14px;
}
.blog-card h4 {
	font-size: 13.5px;
	margin-bottom: 6px;
}
.blog-card a.readmore {
	font-size: 11.5px;
	text-transform: uppercase;
	letter-spacing: 0.04em;
	font-weight: 700;
}

/* ---------------- Newsletter ----------------
 * Moved to footer.css (2026-09-26): the Newsletter section now renders
 * above the footer on EVERY page, not just the homepage, and homepage.css
 * only loads on the homepage. */

/* ---------------- Responsive ---------------- */
@media (max-width: 900px) {
	.usp-grid {
		grid-template-columns: repeat(2, 1fr);
	}
	.cat-grid {
		grid-template-columns: repeat(3, 1fr);
	}
	.testimonial-grid,
	.blog-grid {
		grid-template-columns: repeat(2, 1fr);
	}
}
@media (max-width: 600px) {
	.usp-grid {
		grid-template-columns: 1fr;
	}
	.cat-grid {
		grid-template-columns: repeat(2, 1fr);
	}
	.testimonial-grid,
	.blog-grid {
		grid-template-columns: 1fr;
	}

	/*
	 * ---- Hero carousel (mobile-audit "Slider" pass, 2026-09-15) ----
	 * The 380px/34px desktop sizing was never given a mobile override at
	 * all — mockups-homepage.html's own approved review mockup DOES
	 * define one (height: 300px; h1: 24px), but it was never ported into
	 * this file. Porting just those two rules verbatim isn't enough,
	 * though: rendered at real phone widths (375px, 320px), the
	 * unmodified .hero-arrow prev/next buttons (40px circles fixed at
	 * left/right: 20px) sit directly on top of the slide heading/
	 * paragraph text, partially covering it — confirmed via
	 * headless-browser screenshot before fixing.
	 *
	 * Revised (2026-09-15, same day, explicit design decision): rather
	 * than keep shrinking/repositioning the arrows to dodge the text —
	 * which only ever patched the symptom — they're removed on mobile
	 * entirely. .hero-dots (hero-carousel.php) already gives a discrete,
	 * tap-friendly "which slide, how many total" indicator, and
	 * hero-carousel.js's own touch-swipe handling is the primary
	 * interaction on a touchscreen anyway; arrows sized for a mouse
	 * cursor were redundant with both once dots + swipe are available.
	 * This also removes the collision they caused in the first place, so
	 * the horizontal slide padding that existed purely to keep text clear
	 * of them (52px) reverts to the sitewide 24px gutter (base.css's
	 * .wrap) — freeing up real width for the heading to wrap across
	 * fewer lines at 320px, since there's no longer anything to clear.
	 * Verified via Playwright at 375px/320px: dots reachable and
	 * functional, no arrows rendered, no horizontal overflow, heading
	 * legible with the wider text column.
	 */
	.hero-slide {
		height: 300px;
		padding: 20px 24px;
	}
	.hero-slide h1 {
		font-size: 24px;
	}
	.hero-arrow {
		display: none;
	}
}
