/**
 * Editorial homepage (page-home-editorial.php).
 *
 * Boutique-label look: full-bleed photography, a serif display face, quiet
 * uppercase labels and generous white space. Everything is scoped under
 * .ed-home so the rest of the store keeps its own styling.
 */

.ed-home {
	--ed-ink: #1c1917;
	--ed-ink-soft: #57534e;
	--ed-muted: #8a817a;
	--ed-line: #e7e2dc;
	--ed-sand: #f5f0ea;
	--ed-paper: #fff;
	--ed-accent: var(--pl-primary-ink, #ad1457);
	--ed-serif: var(--pl-font-serif);
	--ed-wrap: 90rem;
	--ed-gutter: 1rem;
	--ed-space: 3.5rem;

	color: var(--ed-ink);
	background: var(--ed-paper);
}

@media (min-width: 48rem) {
	.ed-home { --ed-gutter: 2rem; --ed-space: 5rem; }
}

@media (min-width: 80rem) {
	.ed-home { --ed-gutter: 3rem; }
}

.ed-wrap {
	max-width: var(--ed-wrap);
	margin-inline: auto;
	padding-inline: var(--ed-gutter);
}

.ed-section { padding-block: var(--ed-space) 0; }
.ed-section--tiles:first-of-type { padding-top: calc(var(--ed-space) * 0.6); }

/* ---- shared type & controls ---- */

.ed-eyebrow {
	margin: 0 0 0.75rem;
	font-size: 0.75rem;
	font-weight: 600;
	letter-spacing: 0.22em;
	text-transform: uppercase;
}

.ed-btn {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	min-height: 3rem;
	padding: 0.75rem 2.25rem;
	border: 1px solid currentColor;
	font-size: 0.75rem;
	font-weight: 600;
	letter-spacing: 0.2em;
	text-transform: uppercase;
	text-decoration: none;
	transition: background-color var(--pl-dur) var(--pl-ease), color var(--pl-dur) var(--pl-ease), border-color var(--pl-dur) var(--pl-ease);
}

.ed-btn--light { background: #fff; color: var(--ed-ink); border-color: #fff; }
.ed-btn--light:hover,
.ed-btn--light:focus-visible { background: var(--ed-ink); color: #fff; border-color: var(--ed-ink); }

.ed-btn--dark { background: var(--ed-ink); color: #fff; border-color: var(--ed-ink); }
.ed-btn--dark:hover,
.ed-btn--dark:focus-visible { background: var(--pl-primary); border-color: var(--pl-primary); color: #fff; }

.ed-btn--ghost { background: transparent; color: var(--ed-ink); border-color: var(--ed-ink); }
.ed-btn--ghost:hover,
.ed-btn--ghost:focus-visible { background: var(--ed-ink); color: #fff; }

.ed-link {
	display: inline-block;
	padding-bottom: 0.25rem;
	border-bottom: 1px solid currentColor;
	font-size: 0.75rem;
	font-weight: 600;
	letter-spacing: 0.2em;
	text-transform: uppercase;
	color: var(--ed-ink);
	text-decoration: none;
	transition: color var(--pl-dur) var(--pl-ease);
}

.ed-link:hover { color: var(--ed-accent); }

.ed-home :focus-visible { outline: 2px solid var(--ed-accent); outline-offset: 3px; }

/* ---- hero slider ---- */

.ed-hero {
	position: relative;
	overflow: hidden;
	background: var(--ed-sand);
	color: #fff;
}

.ed-hero__track {
	position: relative;
	display: grid;
	/* Tall portrait on phones, cinematic on desktop. Height is set directly
	   rather than via aspect-ratio: with aspect-ratio, max-height is transferred
	   to the width, which left the slider narrower than the screen. */
	width: 100%;
	height: min(138vw, 88vh);
}

@media (min-width: 48rem) {
	.ed-hero__track { height: clamp(32rem, 50vw, 82vh); }
}

.ed-hero__slide {
	grid-area: 1 / 1;
	position: relative;
	opacity: 0;
	visibility: hidden;
	transition: opacity 900ms var(--pl-ease), visibility 0s linear 900ms;
}

.ed-hero__slide.is-active {
	opacity: 1;
	visibility: visible;
	transition: opacity 900ms var(--pl-ease), visibility 0s;
	z-index: 1;
}

.ed-hero__media,
.ed-hero__media img {
	position: absolute;
	inset: 0;
	width: 100%;
	height: 100%;
}

.ed-hero__media img {
	object-fit: cover;
	transform: scale(1.06);
	transition: transform 7s ease-out;
}

.ed-hero__slide.is-active .ed-hero__media img { transform: scale(1); }

/* Soft scrim so white type always reads, whatever the photo. */
.ed-hero__slide::after {
	content: "";
	position: absolute;
	inset: 0;
	background: linear-gradient(to top, rgb(20 16 12 / 0.62) 0%, rgb(20 16 12 / 0.15) 45%, transparent 70%);
	pointer-events: none;
}

@media (min-width: 48rem) {
	.ed-hero__slide--left::after { background: linear-gradient(to right, rgb(20 16 12 / 0.55) 0%, rgb(20 16 12 / 0.12) 45%, transparent 65%); }
	.ed-hero__slide--right::after { background: linear-gradient(to left, rgb(20 16 12 / 0.55) 0%, rgb(20 16 12 / 0.12) 45%, transparent 65%); }
}

.ed-hero__content {
	position: absolute;
	z-index: 2;
	inset: auto var(--ed-gutter) 4.5rem;
	max-width: 32rem;
	text-align: center;
	margin-inline: auto;
}

@media (min-width: 48rem) {
	.ed-hero__content {
		top: 50%;
		bottom: auto;
		transform: translateY(-50%);
		text-align: left;
		margin: 0;
		left: calc(var(--ed-gutter) + 3rem);
		right: auto;
	}

	.ed-hero__slide--right .ed-hero__content { left: auto; right: calc(var(--ed-gutter) + 3rem); }
}

.ed-hero__content > * {
	opacity: 0;
	transform: translateY(14px);
	transition: opacity 700ms var(--pl-ease), transform 700ms var(--pl-ease);
}

.ed-hero__slide.is-active .ed-hero__content > * { opacity: 1; transform: none; }
.ed-hero__slide.is-active .ed-hero__content > :nth-child(2) { transition-delay: 120ms; }
.ed-hero__slide.is-active .ed-hero__content > :nth-child(3) { transition-delay: 220ms; }
.ed-hero__slide.is-active .ed-hero__content > :nth-child(4) { transition-delay: 320ms; }

.ed-hero__title {
	margin: 0 0 0.75rem;
	font-family: var(--ed-serif);
	font-weight: 500;
	font-size: clamp(2.75rem, 7vw, 5.5rem);
	line-height: 0.95;
	letter-spacing: -0.01em;
	color: #fff;
}

.ed-hero__text {
	margin: 0 0 1.75rem;
	font-size: 1rem;
	line-height: 1.6;
	color: rgb(255 255 255 / 0.9);
}

.ed-hero__arrow {
	position: absolute;
	z-index: 3;
	top: 50%;
	display: none;
	place-items: center;
	width: 3rem;
	height: 3rem;
	margin-top: -1.5rem;
	border: 1px solid rgb(255 255 255 / 0.6);
	border-radius: 50%;
	background: rgb(255 255 255 / 0.08);
	color: #fff;
	font-size: 1.75rem;
	line-height: 1;
	cursor: pointer;
	backdrop-filter: blur(4px);
	transition: background-color var(--pl-dur) var(--pl-ease), color var(--pl-dur) var(--pl-ease);
}

.ed-hero__arrow:hover { background: #fff; color: var(--ed-ink); }
.ed-hero__arrow--prev { left: 1rem; }
.ed-hero__arrow--next { right: 1rem; }

@media (min-width: 48rem) {
	.js .ed-hero__arrow { display: grid; }
}

.ed-hero__dots {
	position: absolute;
	z-index: 3;
	left: 50%;
	bottom: 1.5rem;
	display: flex;
	gap: 0.625rem;
	transform: translateX(-50%);
}

html:not(.js) .ed-hero__dots { display: none; }

.ed-hero__dot {
	width: 2rem;
	height: 1.25rem;
	padding: 0;
	border: 0;
	background: none;
	cursor: pointer;
	position: relative;
}

.ed-hero__dot::before {
	content: "";
	position: absolute;
	left: 0;
	right: 0;
	top: 50%;
	height: 2px;
	background: rgb(255 255 255 / 0.45);
	transition: background-color var(--pl-dur) var(--pl-ease);
}

.ed-hero__dot.is-active::before { background: #fff; }

/* ---- image tiles ---- */

.ed-tiles {
	display: grid;
	grid-template-columns: repeat(2, minmax(0, 1fr));
	gap: 1.5rem 0.75rem;
	margin: 0;
	padding: 0;
	list-style: none;
}

@media (min-width: 64rem) {
	.ed-tiles { gap: 1.25rem; }
	.ed-tiles--4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
	.ed-tiles--3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}

/* Three across on phones reads cramped; stack the explore row instead. */
@media (max-width: 39.99rem) {
	.ed-tiles--3 { grid-template-columns: 1fr; }
	.ed-tiles--3 .ed-tile__media { aspect-ratio: 4 / 3; }
}

@media (min-width: 40rem) and (max-width: 63.99rem) {
	.ed-tiles--3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}

.ed-tile {
	display: block;
	color: var(--ed-ink);
	text-decoration: none;
}

.ed-tile__media {
	position: relative;
	display: block;
	aspect-ratio: 3 / 4;
	overflow: hidden;
	background: var(--ed-sand);
}

.ed-tiles--3 .ed-tile__media { aspect-ratio: 4 / 5; }

.ed-tile__media img {
	position: absolute;
	inset: 0;
	width: 100%;
	height: 100%;
	object-fit: cover;
	transition: transform 1.2s var(--pl-ease);
}

.ed-tile__label {
	display: inline-block;
	margin-top: 0.875rem;
	padding-bottom: 0.25rem;
	border-bottom: 1px solid transparent;
	font-size: 0.75rem;
	font-weight: 600;
	letter-spacing: 0.2em;
	text-transform: uppercase;
	transition: border-color var(--pl-dur) var(--pl-ease);
}

@media (hover: hover) {
	.ed-tile:hover .ed-tile__media img { transform: scale(1.05); }
	.ed-tile:hover .ed-tile__label { border-color: currentColor; }
}

/* ---- section heading ---- */

.ed-head {
	display: flex;
	flex-direction: column;
	align-items: center;
	gap: 0.875rem;
	margin-bottom: 2rem;
	text-align: center;
}

.ed-head__title {
	margin: 0;
	font-family: var(--ed-serif);
	font-weight: 500;
	font-size: clamp(2rem, 4vw, 2.75rem);
	line-height: 1.1;
	color: var(--ed-ink);
}

/* ---- product carousel ---- */

.ed-rail__frame { position: relative; }

.ed-rail__track {
	display: grid;
	grid-auto-flow: column;
	grid-auto-columns: 68%;
	gap: 0.75rem;
	margin: 0;
	padding: 0 0 0.5rem;
	list-style: none;
	overflow-x: auto;
	scroll-snap-type: x mandatory;
	scroll-behavior: smooth;
	overscroll-behavior-x: contain;
	scrollbar-width: none;
}

.ed-rail__track::-webkit-scrollbar { display: none; }

@media (min-width: 40rem) { .ed-rail__track { grid-auto-columns: calc((100% - 1.5rem) / 3); } }
@media (min-width: 64rem) { .ed-rail__track { grid-auto-columns: calc((100% - 3.75rem) / 4); gap: 1.25rem; } }

@media (prefers-reduced-motion: reduce) {
	.ed-rail__track { scroll-behavior: auto; }
}

.ed-rail__item { scroll-snap-align: start; min-width: 0; }

.ed-rail__arrow {
	position: absolute;
	z-index: 2;
	top: 38%;
	display: none;
	place-items: center;
	width: 2.75rem;
	height: 2.75rem;
	border: 1px solid var(--ed-line);
	border-radius: 50%;
	background: #fff;
	color: var(--ed-ink);
	font-size: 1.5rem;
	line-height: 1;
	cursor: pointer;
	box-shadow: 0 4px 14px rgb(28 25 23 / 0.1);
	transition: opacity var(--pl-dur) var(--pl-ease), background-color var(--pl-dur) var(--pl-ease), color var(--pl-dur) var(--pl-ease);
}

.ed-rail__arrow:hover:not(:disabled) { background: var(--ed-ink); color: #fff; }
.ed-rail__arrow:disabled { opacity: 0; pointer-events: none; }
.ed-rail__arrow--prev { left: -1.375rem; }
.ed-rail__arrow--next { right: -1.375rem; }

@media (min-width: 64rem) {
	.js .ed-rail__arrow { display: grid; }
}

/* ---- product card ---- */

.ed-card { position: relative; }

.ed-card__media {
	position: relative;
	aspect-ratio: 3 / 4;
	overflow: hidden;
	background: var(--ed-sand);
}

.ed-card__media > a,
.ed-card__media img {
	position: absolute;
	inset: 0;
	width: 100%;
	height: 100%;
}

.ed-card__media img {
	object-fit: cover;
	transition: transform 1s var(--pl-ease);
}

.ed-card__badge {
	position: absolute;
	top: 0.75rem;
	left: 0.75rem;
	padding: 0.3125rem 0.5rem;
	background: #fff;
	font-size: 0.6875rem;
	font-weight: 600;
	letter-spacing: 0.1em;
	text-transform: uppercase;
	color: var(--ed-accent);
}

.ed-card__wish {
	position: absolute;
	top: 0.5rem;
	right: 0.5rem;
	display: grid;
	place-items: center;
	width: 2.5rem;
	height: 2.5rem;
	border: 0;
	border-radius: 50%;
	background: rgb(255 255 255 / 0.85);
	color: var(--ed-ink);
	cursor: pointer;
	transition: color var(--pl-dur) var(--pl-ease), background-color var(--pl-dur) var(--pl-ease);
}

.ed-card__wish:hover { background: #fff; }
.ed-card__wish[aria-pressed="true"] { color: var(--ed-accent); }
.ed-card__wish[aria-pressed="true"] .pl-icon { fill: currentColor; }

.ed-card__add {
	position: absolute;
	left: 0.75rem;
	right: 0.75rem;
	bottom: 0.75rem;
	display: flex;
	align-items: center;
	justify-content: center;
	min-height: 2.75rem;
	background: #fff;
	color: var(--ed-ink);
	font-size: 0.6875rem;
	font-weight: 600;
	letter-spacing: 0.2em;
	text-transform: uppercase;
	text-decoration: none;
	transition: transform var(--pl-dur) var(--pl-ease), opacity var(--pl-dur) var(--pl-ease), background-color var(--pl-dur) var(--pl-ease), color var(--pl-dur) var(--pl-ease);
}

.ed-card__add:hover { background: var(--ed-ink); color: #fff; }
.ed-card__add.loading { opacity: 0.6; pointer-events: none; }

/* WooCommerce appends a "View cart" link after a successful AJAX add. */
.ed-card__media .added_to_cart {
	position: absolute;
	left: 0.75rem;
	right: 0.75rem;
	bottom: 3.75rem;
	padding: 0.5rem;
	background: var(--ed-ink);
	color: #fff;
	font-size: 0.6875rem;
	letter-spacing: 0.14em;
	text-align: center;
	text-transform: uppercase;
	text-decoration: none;
}

@media (hover: hover) {
	.ed-card__add { opacity: 0; transform: translateY(0.75rem); }
	.ed-card:hover .ed-card__add,
	.ed-card__add:focus-visible,
	.ed-card__add.added { opacity: 1; transform: none; }
	.ed-card:hover .ed-card__media img { transform: scale(1.04); }
}

.ed-card__body { padding-top: 0.875rem; }

.ed-card__title {
	margin: 0;
	font-family: var(--pl-font-sans);
	font-size: 0.875rem;
	font-weight: 500;
	line-height: 1.4;
	display: -webkit-box;
	-webkit-line-clamp: 2;
	-webkit-box-orient: vertical;
	overflow: hidden;
}

.ed-card__title a { color: var(--ed-ink); text-decoration: none; }
.ed-card__title a:hover { text-decoration: underline; text-underline-offset: 3px; }

.ed-card__cat {
	margin: 0.25rem 0 0;
	font-size: 0.6875rem;
	letter-spacing: 0.14em;
	text-transform: uppercase;
	color: var(--ed-muted);
}

.ed-card__price {
	display: flex;
	flex-wrap: wrap;
	align-items: baseline;
	gap: 0.5rem;
	margin: 0.5rem 0 0;
	font-size: 0.875rem;
}

.ed-card__price del { color: var(--ed-muted); font-size: 0.8125rem; }
.ed-card__price ins { text-decoration: none; font-weight: 600; color: var(--ed-accent); }

/* ---- campaign banner ---- */

.ed-banner {
	position: relative;
	display: grid;
	place-items: center;
	margin-top: var(--ed-space);
	min-height: 34rem;
	overflow: hidden;
	color: #fff;
	text-align: center;
	background: var(--ed-ink);
}

@media (min-width: 48rem) {
	.ed-banner { min-height: 0; height: clamp(28rem, 42.5vw, 44rem); }
}

.ed-banner__media,
.ed-banner__media img {
	position: absolute;
	inset: 0;
	width: 100%;
	height: 100%;
}

.ed-banner__media img { object-fit: cover; }

.ed-banner::after {
	content: "";
	position: absolute;
	inset: 0;
	background: rgb(20 16 12 / 0.38);
}

.ed-banner__content {
	position: relative;
	z-index: 1;
	max-width: 36rem;
	padding: 3rem var(--ed-gutter);
}

.ed-banner__title {
	margin: 0 0 1rem;
	font-family: var(--ed-serif);
	font-weight: 500;
	font-size: clamp(2.5rem, 6vw, 4.75rem);
	line-height: 1;
	color: #fff;
}

.ed-banner__text {
	margin: 0 0 2rem;
	font-size: 1rem;
	line-height: 1.6;
	color: rgb(255 255 255 / 0.9);
}

/* ---- brand story ---- */

.ed-story {
	margin-top: var(--ed-space);
	padding: var(--ed-space) var(--ed-gutter);
	background: var(--ed-sand);
	text-align: center;
}

.ed-story__inner {
	max-width: 44rem;
	margin-inline: auto;
}

.ed-story__title {
	margin: 0 0 1.5rem;
	font-family: var(--ed-serif);
	font-weight: 500;
	font-style: italic;
	font-size: clamp(2rem, 4.5vw, 3.25rem);
	line-height: 1.1;
	color: var(--ed-ink);
}

.ed-story p {
	margin: 0 0 1.125rem;
	font-size: 1rem;
	line-height: 1.8;
	color: var(--ed-ink-soft);
}

.ed-story .ed-link { margin-top: 1rem; }

/* The footer follows straight on; the sand panel is its own divider. */
.pl-editorial-home .pl-main { padding-bottom: 0; }

@media (prefers-reduced-motion: reduce) {
	.ed-hero__slide,
	.ed-hero__slide.is-active,
	.ed-hero__media img,
	.ed-hero__content > * { transition: none; transform: none; }
}
