/*
Theme Name: EVELYN JEGZ
Text Domain: evelyn-jegz
Description: Custom block theme for EVELYN JEGZ. The layout is fixed in the theme; text and images are edited in the Site Editor.
Version: 0.13.0
Requires at least: 7.0
Requires PHP: 8.0
*/

/* Loaded on the site and in the Site Editor. Front-end-only rules are in assets/css/front.css. */

:root {
	--ej-white: var(--wp--preset--color--white);
	--ej-petrol: var(--wp--preset--color--petrol);
	--ej-bone: var(--wp--preset--color--bone);
	--ej-ink: var(--wp--preset--color--ink);
	--ej-caslon: var(--wp--preset--font-family--caslon);
	--ej-small: var(--wp--preset--font-size--small);
	--ej-rule: rgb(17 19 18 / 0.16);
	--ej-muted: rgb(17 19 18 / 0.72);
	--ej-gutter: clamp(16px, 2.2vw, 32px);
	--ej-gap: clamp(8px, 0.8vw, 12px);
	--ej-section: clamp(72px, 9vw, 144px);
	--ej-header: 56px;
}

@media (min-width: 1024px) {
	:root { --ej-header: 72px; }
}

/* Sections set their own spacing, so drop WordPress's block margins inside them. */
.wp-block-group[class*="ej-"] > *,
.wp-site-blocks > main,
.wp-site-blocks > footer { margin-block: 0; }

.wp-block-group[class*="ej-"] .wp-block-image { margin: 0; }

.ej-icon { display: block; }

.ej-link a,
.ej-footer a:hover,
.ej-card__name a:hover { text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: 0.35em; }

.ej-link { font-size: var(--ej-small); }
.ej-link a { display: inline-flex; align-items: center; min-height: 44px; }

:focus-visible { outline: 2px solid currentColor; outline-offset: 3px; }

/* ---------- Header ---------- */

.ej-header {
	display: grid;
	grid-template-columns: 1fr auto;
	align-items: center;
	height: var(--ej-header);
	padding-inline: var(--ej-gutter);
	background: var(--ej-white);
	color: var(--ej-ink);
	font-size: var(--ej-small);
}

.ej-header__nav { display: none; }

.ej-header a { text-decoration: none; }
.ej-header__nav a:hover,
.ej-tool:hover .ej-word { text-decoration: underline; text-underline-offset: 0.35em; }

.ej-logo {
	position: relative;
	display: flex;
	align-items: center;
	justify-self: start;
	min-height: 44px;
}

.ej-logo__wordmark { display: block; width: 148px; height: auto; }
.ej-logo__mark { display: none; }

.ej-tools { display: flex; align-items: center; justify-content: flex-end; margin-right: -10px; }

.ej-tool {
	position: relative;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	min-width: 44px;
	min-height: 44px;
	padding: 0;
	border: 0;
	background: none;
	color: inherit;
	font: inherit;
	cursor: pointer;
}


.ej-tool__count {
	position: absolute;
	top: 5px;
	right: 3px;
	font-size: 0.6875rem;
	line-height: 1;
}

@media (max-width: 1023.98px) {
	/* Icons only, but the words stay available to screen readers. */
	.ej-tool .ej-word,
	.ej-menu-bar__close .ej-word {
		position: absolute;
		width: 1px;
		height: 1px;
		overflow: hidden;
		clip-path: inset(50%);
		white-space: nowrap;
	}
}

@media (min-width: 1024px) {
	.ej-header { grid-template-columns: 1fr auto 1fr; }

	.ej-header__nav { display: flex; gap: 28px; }
	.ej-header__nav a { display: inline-flex; align-items: center; min-height: 44px; }

	.ej-logo { justify-self: center; justify-content: center; }
	.ej-logo__wordmark { width: 236px; }

	.ej-tools { gap: 28px; margin-right: 0; }
	.ej-tool { min-width: 0; }
	.ej-tool .ej-icon,
	.ej-tool__count,
	.ej-tool--menu { display: none; }
}

/* ---------- Full-screen menu ---------- */

.ej-menu {
	display: flex;
	flex-direction: column;
	min-height: 100%;
	background: var(--ej-petrol);
	color: var(--ej-bone);
}

.ej-menu a { color: inherit; text-decoration: none; }
.ej-menu a:hover,
.ej-menu .ej-link a { text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: 0.35em; }

.ej-menu-bar {
	display: grid;
	grid-template-columns: 1fr auto;
	align-items: center;
	flex: none;
	height: var(--ej-header);
	padding-inline: var(--ej-gutter);
	font-size: var(--ej-small);
}

.ej-menu-bar__logo { order: -1; display: flex; align-items: center; justify-self: start; min-height: 44px; }

.ej-menu-bar__close,
.ej-icon-button {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	min-width: 44px;
	min-height: 44px;
	padding: 0;
	border: 0;
	background: none;
	color: inherit;
	font: inherit;
	cursor: pointer;
}

.ej-menu-bar__close { margin-right: -10px; }

.ej-menu__body { display: grid; gap: 40px; padding: 8px var(--ej-gutter) 48px; }

.ej-menu__tiles { display: grid; grid-template-columns: repeat(2, 1fr); gap: var(--ej-gap); }
.ej-menu__tile { position: relative; }
.ej-menu__tile img { display: block; width: 100%; aspect-ratio: 3 / 4; object-fit: cover; }
.ej-menu__tile-name { font-size: var(--ej-small); }
.ej-menu__tile-name a { display: flex; align-items: center; min-height: 44px; }
.ej-menu__tile-name a::after { content: ""; position: absolute; inset: 0; }

.ej-menu__card { display: none; }

.ej-menu__nav { display: grid; gap: 32px; }

.ej-menu__category {
	font-family: var(--ej-caslon);
	font-size: 1.75rem;
	line-height: 1.2;
}

.ej-menu__category button {
	padding: 0;
	border: 0;
	background: none;
	color: inherit;
	font: inherit;
	text-align: left;
}

.ej-menu__links { padding-top: 8px; }
.ej-menu__link a { display: inline-flex; align-items: center; min-height: 44px; }

@media (min-width: 1024px) {
	.ej-menu-bar { grid-template-columns: 1fr auto 1fr; }
	.ej-menu-bar__logo { order: 0; justify-self: center; }
	.ej-menu-bar__close { justify-self: start; margin: 0; }
	.ej-menu-bar__close .ej-icon { display: none; }

	.ej-menu__body {
		grid-template-columns: 7fr 4fr;
		flex: 1;
		gap: 48px;
		padding-top: 40px;
	}

	.ej-menu__tiles { display: none; }

	/* Categories share column one; each category's links appear in column two. */
	.ej-menu__nav {
		grid-template-columns: 1fr 1fr;
		grid-auto-rows: min-content;
		column-gap: 32px;
		row-gap: 4px;
		align-content: start;
	}
	.ej-menu__group { display: contents; }
	.ej-menu__category { grid-column: 1; font-size: 2.5rem; }
	.ej-menu__category button { min-height: 56px; color: rgb(243 240 232 / 0.64); cursor: pointer; }
	.ej-menu__category button:hover,
	.ej-menu__category button[aria-expanded="true"] { color: var(--ej-bone); }
	.ej-menu__links { grid-column: 2; grid-row: 1 / span 8; padding-top: 6px; }

	.ej-menu__card { display: block; justify-self: end; width: min(100%, calc((100vh - 240px) * 0.75)); min-width: 260px; }
	.ej-menu__card img { display: block; width: 100%; aspect-ratio: 3 / 4; object-fit: cover; }
	.ej-menu__caption { padding-top: 16px; font-family: var(--ej-caslon); font-size: 1.5rem; line-height: 1.2; }
}

/* ---------- Home: opening photo ---------- */

.ej-tile { position: relative; overflow: hidden; color: var(--ej-bone); }
.ej-tile .wp-block-image,
.ej-tile img { display: block; width: 100%; height: 100%; }
.ej-tile img { aspect-ratio: 3 / 4; object-fit: cover; }

.ej-tile::after {
	content: "";
	position: absolute;
	inset: 45% 0 0;
	background: linear-gradient(to top, rgb(17 19 18 / 0.78), rgb(17 19 18 / 0.45) 40%, transparent);
	pointer-events: none;
}

.ej-tile__text { position: absolute; z-index: 1; inset: auto 0 0; padding: 0 var(--ej-gutter) 20px; }
.ej-tile__title { font-size: var(--wp--preset--font-size--title); }
.ej-tile__line { padding-top: 6px; }
/* The whole tile is clickable. */
.ej-tile__text .ej-link a::after { content: ""; position: absolute; inset: -100vh 0 0; }

/* The left edge of the bag stays in view on phones. front.css makes the photo fill the screen. */
.ej-hero img { object-position: 5% 30%; }

@media (min-width: 1024px) {
	.ej-hero img { aspect-ratio: 16 / 9; }
	/* Shades only the corner behind the words. */
	.ej-hero::after { inset: 45% 45% 0 0; background: radial-gradient(farthest-side at 0 100%, rgb(17 19 18 / 0.88), rgb(17 19 18 / 0.7) 35%, transparent); }
}

/* ---------- Sections and product cards ---------- */

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

.ej-section__head {
	display: grid;
	grid-template-columns: 1fr auto;
	align-items: end;
	column-gap: 24px;
	padding-bottom: 28px;
}
.ej-section__head > h2,
.ej-section__head > .ej-section__line { grid-column: 1; }
.ej-section__head > .ej-link { grid-column: 1; }
.ej-section__line { padding-top: 10px; color: var(--ej-muted); }
.ej-section__head > .ej-restock { grid-column: 1 / -1; width: 100%; max-width: 440px; margin-top: 16px; }

.ej-row {
	display: grid;
	grid-auto-flow: column;
	grid-auto-columns: 74vw;
	gap: var(--ej-gap);
	margin-inline: calc(var(--ej-gutter) * -1);
	padding-inline: var(--ej-gutter);
	overflow-x: auto;
	scroll-snap-type: x proximity;
	scroll-padding-inline: var(--ej-gutter);
	scrollbar-width: none;
}
.ej-row::-webkit-scrollbar,
.ej-gallery::-webkit-scrollbar { display: none; }

.ej-card { min-width: 0; scroll-snap-align: start; }
.ej-card > * { margin: 0; }

.ej-frame { position: relative; }

.ej-gallery {
	display: grid;
	grid-auto-flow: column;
	grid-auto-columns: 100%;
	gap: 8px; /* Hides the next photo's edge when widths round to part-pixels. */
	aspect-ratio: 3 / 4;
	overflow-x: auto;
	overflow-y: hidden;
	scroll-snap-type: x mandatory;
	scrollbar-width: none;
	background: #f7f7f7;
}
.ej-gallery__slide { display: block; min-height: 0; scroll-snap-align: start; scroll-snap-stop: always; }
.ej-gallery img { display: block; width: 100%; height: 100%; object-fit: cover; }

.ej-card__name {
	padding-top: 14px;
	font-family: var(--wp--preset--font-family--inter);
	font-size: var(--ej-small);
	font-weight: 500;
	line-height: 1.5;
	text-wrap: pretty;
}
.ej-card__name a { display: block; text-decoration: none; }
.ej-card__status { padding-top: 4px; color: var(--ej-muted); font-size: var(--ej-small); }

.ej-pair,
.ej-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--ej-gap); }
.ej-grid { row-gap: 40px; }

/* Product names are tap targets on phones and tablets. */
@media (max-width: 1023.98px) {
	.ej-card__name { padding-top: 8px; }
	.ej-card__name a { min-height: 44px; padding-top: 6px; }
}

@media (min-width: 600px) {
	.ej-row { grid-auto-columns: 46vw; }
}

@media (min-width: 1024px) {
	.ej-row { grid-auto-columns: 38vw; }
	.ej-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
	.ej-sold-out { display: grid; grid-template-columns: 1fr 2fr; gap: var(--ej-gap); }
	.ej-sold-out .ej-section__head { align-content: start; padding-right: 32px; }
}

/* ---------- Quick size bar on product cards ---------- */

.ej-card__media { position: relative; }
.ej-card .ej-card__price { padding-top: 4px; font-size: var(--ej-small); }

.ej-quick[hidden] { display: none; }
.ej-quick__toggle {
	position: absolute;
	z-index: 3;
	right: 0;
	bottom: 0;
	width: 44px;
	height: 44px;
	padding: 0;
	border: 0;
	background: var(--ej-white);
	color: var(--ej-ink);
	font: inherit;
	font-size: 1.25rem;
	cursor: pointer;
}
.ej-quick__panel {
	position: absolute;
	z-index: 2;
	right: 0;
	bottom: 44px;
	left: 0;
	display: none;
	padding: 0 8px;
	background: var(--ej-white);
	color: var(--ej-ink);
	font-size: var(--ej-small);
	text-align: center;
}
.ej-quick.is-open .ej-quick__panel { display: block; }
.ej-quick__sizes { display: flex; flex-wrap: wrap; align-items: center; justify-content: center; }
.ej-quick__sizes span { padding: 8px 8px 0; flex-basis: 100%; }
.ej-quick__sizes button { min-width: 44px; min-height: 44px; padding: 0; border: 0; background: none; color: inherit; font: inherit; font-weight: 500; cursor: pointer; }
.ej-quick__sizes button:hover { text-decoration: underline; text-underline-offset: 0.35em; }
.ej-quick__sizes button:disabled { opacity: 0.45; text-decoration: line-through; cursor: not-allowed; }

.ej-buy-status { margin: 0; font-size: var(--ej-small); }
.ej-buy-status:not(:empty) { padding-block: 8px; }
.ej-buy-status a { display: inline-flex; align-items: center; min-height: 44px; text-underline-offset: 0.35em; }
.ej-notify__sold-out { margin: 0 0 12px; font-size: var(--ej-small); }
.ej-sizes input[data-sold-out] + span { color: var(--ej-muted); text-decoration: line-through; }
.ej-sizes input[data-sold-out]:checked + span { color: var(--ej-bone); }

/* ---------- Floating buy bar ---------- */

.ej-bar {
	display: grid;
	grid-template-columns: minmax(88px, 1fr) 2fr;
	gap: 8px;
	padding: 10px var(--ej-gutter);
	border: 1px solid var(--ej-rule);
	background: var(--ej-white);
	color: var(--ej-ink);
}
.ej-bar p { margin: 0; }
.ej-bar__photo { display: none; }
.ej-bar__text { grid-column: 1 / -1; display: flex; justify-content: space-between; gap: 16px; min-width: 0; font-size: var(--ej-small); }
.ej-bar__name { overflow: hidden; font-weight: 500; text-overflow: ellipsis; white-space: nowrap; }
.ej-bar__price { flex: none; }
.ej-bar select { min-width: 0; min-height: 48px; padding: 0 10px; border: 1px solid var(--ej-ink); border-radius: 0; background: var(--ej-white); color: var(--ej-ink); font: inherit; font-size: 1rem; }
.ej-bar .ej-button { min-height: 48px; padding-inline: 16px; }
.ej-bar .ej-button:only-of-type:nth-child(3) { grid-column: 1 / -1; }
.ej-bar .ej-buy-status { grid-column: 1 / -1; }
.ej-bar .ej-buy-status:not(:empty) { margin-block: -6px; padding-block: 0; }
.ej-bar .ej-buy-status:empty { position: absolute; }

@media (min-width: 768px) {
	.ej-bar { grid-template-columns: 54px minmax(0, 1fr) 150px 190px; align-items: center; gap: 16px; padding: 10px; }
	.ej-bar__photo { display: block; width: 54px; height: 72px; object-fit: cover; }
	.ej-bar__text { grid-column: auto; display: block; }
	.ej-bar__price { margin-top: 4px; }
	.ej-bar .ej-buy-status { text-align: right; }
}

/* ---------- Story ---------- */

/* One large photo, with the text and two looks beside it. On phones, they go below. */
.ej-story { display: grid; gap: 32px; }
.ej-story__image img { display: block; width: 100%; aspect-ratio: 4 / 5; object-fit: cover; }
.ej-story__title { font-size: clamp(1.5rem, 2vw, 1.75rem); text-wrap: balance; }
.ej-story__body { max-width: 34em; padding-top: 12px; }
.ej-story__looks { display: grid; grid-template-columns: 1fr 1fr; gap: var(--ej-gap); padding-top: 32px; }
.ej-story__look { position: relative; }
.ej-story__look img { display: block; width: 100%; aspect-ratio: 3 / 4; object-fit: cover; }
.ej-story__caption { font-size: var(--ej-small); }
.ej-story__caption a { display: inline-flex; align-items: center; min-height: 44px; text-decoration: none; }
.ej-story__look:hover a { text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: 0.35em; }

@media (max-width: 767.98px) {
	.ej-story .ej-story__image.wp-block-image { margin-inline: calc(var(--ej-gutter) * -1); }
}

@media (min-width: 768px) {
	.ej-story { grid-template-columns: 9fr 11fr; align-items: center; gap: clamp(24px, 6vw, 120px); padding-left: 0; }
}

@media (min-width: 1024px) {
	.ej-story { grid-template-columns: 1fr 1fr; }
}
/* ---------- 2027 ---------- */

.ej-collection__title { padding: clamp(24px, 2.6vw, 40px) var(--ej-gutter) clamp(20px, 2vw, 28px); font-size: var(--wp--preset--font-size--title); text-align: center; }

/* Phones: one scene at a time. Wider screens: all three side by side, sized to fit the screen. */
.ej-scenes { display: grid; gap: var(--ej-gap); }
.ej-scene { position: relative; aspect-ratio: 941 / 1672; margin: 0; overflow: hidden; background: #f3e6d0; }
.ej-scene__still { display: block; width: 100%; height: 100%; object-fit: cover; }

/* Each line sits in a clear part of its picture and scales with it. */
.ej-scene { container-type: inline-size; }
.ej-scene__line { position: absolute; z-index: 1; margin: 0; color: var(--ej-ink); font-family: var(--ej-caslon); font-size: 8.4cqw; line-height: 1.1; white-space: nowrap; }
.ej-scene--vermilion .ej-scene__line { top: 8%; right: 5%; }
.ej-scene--teal .ej-scene__line { top: 4.6%; left: 5%; max-width: 36cqw; white-space: normal; text-wrap: balance; }
.ej-scene--cobalt .ej-scene__line { top: 9%; right: 3.4%; }

@media (min-width: 768px) {
	.ej-scenes {
		grid-template-columns: repeat(3, minmax(0, 1fr));
		width: min(100%, max(720px, calc((100vh - var(--ej-header) - 128px) * 1.6884 + var(--ej-gap) * 2)));
		margin-inline: auto;
	}
}

/* ---------- Newsletter and form ---------- */

.ej-newsletter { display: grid; justify-items: center; padding-bottom: var(--ej-section); text-align: center; }
.ej-newsletter .ej-join { width: min(100%, 440px); margin-top: 28px; }

.ej-join { display: grid; grid-template-columns: 1fr auto; text-align: left; }
.ej-join input,
.ej-join button {
	min-height: 48px;
	border: 0;
	border-bottom: 1px solid var(--ej-ink);
	border-radius: 0;
	background: none;
	color: var(--ej-ink);
	font: inherit;
}
/* 16px stops iPhones zooming in when the field is tapped. */
.ej-join input { min-width: 0; padding: 0; font-size: 1rem; }
.ej-join input::placeholder { color: var(--ej-muted); opacity: 1; }
.ej-join button { min-width: 56px; padding: 0 0 0 20px; font-size: var(--ej-small); cursor: pointer; }
.ej-join button:hover { text-decoration: underline; text-underline-offset: 0.35em; }
.ej-join button:disabled { opacity: 0.5; cursor: not-allowed; text-decoration: none; }
.ej-join .ej-notify__consent { grid-column: 1 / -1; margin-block: 8px 0; }
.ej-join .ej-notify__consent input { min-height: 0; }
.ej-form-status { grid-column: 1 / -1; min-height: 1.6em; margin: 10px 0 0; font-size: var(--ej-small); }

/* ---------- Footer ---------- */

.ej-footer { padding: 48px var(--ej-gutter) 24px; border-top: 1px solid var(--ej-rule); font-size: var(--ej-small); }
.ej-footer a { text-decoration: none; }
.ej-footer__columns { display: grid; grid-template-columns: repeat(2, 1fr); gap: 40px 24px; }
.ej-footer__join { grid-column: 1 / -1; }
.ej-footer__title { padding-bottom: 8px; font-weight: 500; }
.ej-footer__link { display: flex; align-items: center; min-height: 44px; }
.ej-footer__link a { display: flex; align-items: center; min-width: 44px; min-height: 44px; }
.ej-footer__base { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 8px 24px; padding-top: 56px; color: var(--ej-muted); }

@media (min-width: 1024px) {
	.ej-footer__columns { grid-template-columns: 1fr 1fr 1fr 2fr; }
	.ej-footer__join { grid-column: auto; }
	.ej-footer__link,
	.ej-footer__link a { min-height: 32px; }
}

/* ---------- Shop and search ---------- */

.ej-main > .ej-shop__title { padding: clamp(32px, 4vw, 64px) var(--ej-gutter) 0; }
.ej-section.ej-shop__group { padding: clamp(32px, 4vw, 56px) var(--ej-gutter) var(--ej-section); }

.ej-shop .ej-shop__title,
.ej-shop .ej-shop__group { padding: 32px var(--ej-gutter) 0; }
.ej-shop .ej-shop__title { font-size: var(--wp--preset--font-size--title); }
.ej-shop .ej-section__head { padding-bottom: 18px; }
.ej-shop .ej-section__head h2 { font-size: 1.375rem; }
.ej-shop .ej-shop__image.wp-block-image { margin-top: 40px; }
.ej-shop__image img { display: block; width: 100%; aspect-ratio: 4 / 5; object-fit: cover; }

.ej-shop__cards { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 32px var(--ej-gap); }
/* A card alone on the last row goes wide and shows two photos, so there's no gap. */
.ej-shop__cards .ej-card:last-child:nth-child(odd) { grid-column: 1 / -1; }
.ej-shop__cards .ej-card:last-child:nth-child(odd) .ej-gallery { grid-auto-columns: calc((100% - 8px) / 2); aspect-ratio: 3 / 2; }

@media (min-width: 1024px) {
	.ej-shop { display: grid; grid-template: auto auto 1fr / minmax(0, 1fr) minmax(0, 1fr); align-items: start; }
	.ej-shop > * { grid-column: 1; }
	.ej-shop .ej-shop__group--sold-out { padding-bottom: var(--ej-section); }
	.ej-shop .ej-shop__image.wp-block-image { grid-column: 2; grid-row: 1 / span 3; margin: 0; }
	.ej-shop__image img { height: calc(100vh - var(--ej-header)); aspect-ratio: auto; }
}
/* ---------- Product page ---------- */

.ej-product { padding-bottom: clamp(40px, 5vw, 72px); }

.ej-breadcrumb { display: flex; font-size: var(--ej-small); }
.ej-breadcrumb a { display: inline-flex; align-items: center; justify-content: center; min-height: 44px; text-decoration: none; }
.ej-breadcrumb a:first-child { min-width: 44px; justify-content: flex-start; }
.ej-breadcrumb a:hover { text-decoration: underline; text-underline-offset: 0.35em; }
.ej-breadcrumb a + a { min-width: 44px; }
.ej-breadcrumb a + a::before { content: "/"; margin: 0 10px 0 4px; color: var(--ej-muted); }

.ej-thumbs { display: none; }
.ej-product__info { padding: 28px var(--ej-gutter) 0; }

.ej-product__summary > *,
.ej-product__line p { margin: 0; }
.ej-product__summary { padding-bottom: 20px; }
.ej-product__status { color: var(--ej-muted); font-size: var(--ej-small); }
.ej-product__summary .ej-product__name { margin-top: 10px; font-size: clamp(1.875rem, 2.6vw, 2.5rem); text-wrap: balance; }
.ej-product__name span { white-space: nowrap; }
.ej-product__summary .ej-product__price { margin-top: 14px; }
.ej-product__summary .ej-product__line { margin-top: 20px; }
.ej-product__summary .ej-notify { margin-top: 28px; }

.ej-sizes-wrap { position: relative; }
.ej-sizes { margin: 0 0 20px; padding: 0; border: 0; }
.ej-sizes__guide { position: absolute; top: -13px; right: 0; display: inline-flex; align-items: center; min-height: 44px; font-size: var(--ej-small); text-underline-offset: 0.35em; }
.ej-notify__contact { min-width: 0; margin: 0; padding: 0; border: 0; }
.ej-sizes legend,
.ej-notify__label { display: block; padding: 0; font-size: var(--ej-small); font-weight: 500; }
.ej-sizes__options { display: flex; gap: 8px; padding-top: 10px; }
.ej-sizes label { position: relative; }
.ej-sizes input { position: absolute; inset: 0; width: 100%; height: 100%; margin: 0; opacity: 0; cursor: pointer; }
.ej-sizes span {
	display: flex;
	align-items: center;
	justify-content: center;
	min-width: 56px;
	min-height: 44px;
	border: 1px solid rgb(17 19 18 / 0.5);
}
.ej-sizes input:hover + span { border-color: var(--ej-ink); }
.ej-sizes input:checked + span { border-color: var(--ej-petrol); background: var(--ej-petrol); color: var(--ej-bone); }
.ej-sizes input:focus-visible + span { outline: 2px solid var(--ej-ink); outline-offset: 3px; }

.ej-notify__email {
	display: block;
	box-sizing: border-box;
	width: 100%;
	min-height: 48px;
	padding: 0;
	border: 0;
	border-bottom: 1px solid var(--ej-ink);
	border-radius: 0;
	background: none;
	color: var(--ej-ink);
	font: inherit;
	font-size: 1rem;
}
.ej-notify__consent { display: flex; align-items: center; gap: 12px; min-height: 44px; margin: 14px 0 18px; font-size: var(--ej-small); }
.ej-notify__consent input { flex: none; width: 20px; height: 20px; margin: 0; accent-color: var(--ej-petrol); }

.ej-button {
	width: 100%;
	min-height: 52px;
	padding: 0 24px;
	border: 0;
	border-radius: 0;
	background: var(--ej-petrol);
	color: var(--ej-bone);
	font: inherit;
	cursor: pointer;
}
.ej-button:hover { background: var(--ej-ink); }
.ej-button:disabled { opacity: 0.5; cursor: not-allowed; }
.ej-notify__note { margin: 12px 0 0; color: var(--ej-muted); font-size: var(--ej-small); }

.ej-product__details h3 { margin: 0 0 10px; font-family: var(--wp--preset--font-family--inter); font-size: var(--ej-small); font-weight: 500; line-height: 1.5; }
.ej-product__details h3 { margin-top: 20px; }
.ej-product__details p { margin: 0; }
.ej-product__details ul { display: grid; gap: 6px; margin: 0 0 20px; padding-left: 1.1em; }

.ej-measurements { width: 100%; border-collapse: collapse; font-size: var(--ej-small); line-height: 1.45; }
.ej-product__details p + .ej-measurements { margin-top: 16px; }
.ej-measurements + p { padding-top: 14px; }
.ej-measurements th,
.ej-measurements td { width: 23%; padding: 9px 8px 9px 0; border-bottom: 1px solid var(--ej-rule); font-weight: 400; text-align: left; vertical-align: top; }
.ej-measurements th:first-child { width: 31%; }
.ej-measurements td span { white-space: nowrap; }
.ej-measurements thead th { color: var(--ej-muted); }

.ej-fold { border-top: 1px solid var(--ej-rule); }
.ej-fold summary {
	display: flex;
	align-items: center;
	justify-content: space-between;
	min-height: 56px;
	font-size: var(--ej-small);
	font-weight: 500;
	list-style: none;
	cursor: pointer;
}
.ej-fold summary::-webkit-details-marker { display: none; }
.ej-fold summary::after { content: "+"; font-size: 1.25rem; font-weight: 400; }
.ej-fold[open] summary::after { content: "–"; }
.ej-fold p { margin: 0; padding-bottom: 14px; }

.ej-questions { padding: 24px 0 0; border-top: 1px solid var(--ej-rule); }
.ej-questions h2 { margin: 0 0 14px; font-family: var(--wp--preset--font-family--inter); font-size: var(--ej-small); font-weight: 500; }
.ej-questions dl,
.ej-questions dd { margin: 0; }
.ej-questions dt { font-weight: 500; }
.ej-questions__item + .ej-questions__item { margin-top: 14px; }
.ej-questions__buttons { display: flex; flex-wrap: wrap; gap: 8px; }
.ej-questions__buttons button {
	min-height: 44px;
	padding: 8px 16px;
	border: 1px solid transparent;
	border-radius: 0;
	background: var(--ej-bone);
	color: var(--ej-ink);
	font: inherit;
	font-size: var(--ej-small);
	text-align: left;
	cursor: pointer;
}
.ej-questions__buttons button:hover { border-color: var(--ej-petrol); }
.ej-questions__buttons button[aria-expanded="true"] { background: var(--ej-petrol); color: var(--ej-bone); }
.ej-questions__answer { min-height: 1.6em; margin: 16px 0 0; }

/* Close-ups below the gallery */
.ej-closer { padding: 0 var(--ej-gutter); }
.ej-closer h2 { margin: 0 0 24px; }
.ej-closer__photos { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 32px var(--ej-gap); }
.ej-closer figure { margin: 0; }
.ej-closer figcaption { padding: 16px 12px 0 0; font-size: var(--ej-small); }
.ej-closer h3 { margin: 0 0 6px; font-family: var(--wp--preset--font-family--inter); font-size: inherit; font-weight: 500; line-height: 1.5; }
.ej-closer p { margin: 0; color: var(--ej-muted); }

/* Cross-sell: four across on desktop, swipe on smaller screens. */
.ej-section.ej-more { padding-top: clamp(64px, 7vw, 112px); padding-bottom: var(--ej-section); }
.ej-more .ej-section__head h2 { margin: 0; }
.ej-closer__photos img { display: block; width: 100%; height: auto; aspect-ratio: 3 / 4; object-fit: cover; }

/* Two photos side by side from tablet size up. */
@media (min-width: 768px) {
	.ej-product__gallery .ej-gallery { grid-auto-columns: calc((100% - 8px) / 2); aspect-ratio: 3 / 2; }
	.ej-product__info { max-width: 640px; }
}

@media (min-width: 1024px) {
	/* The photos grow with the screen but always fit its height. */
	.ej-product {
		display: grid;
		grid-template-columns: minmax(0, calc((100vh - var(--ej-header) - 32px) * 1.5 + 92px)) minmax(380px, 1fr);
		align-items: start;
		padding-top: 8px;
	}
	.ej-product__gallery { display: grid; grid-template-columns: 56px minmax(0, 1fr); gap: 12px; align-items: start; padding-left: 16px; }
	.ej-product__gallery > :only-child { grid-column: 1 / -1; }
	.ej-product__info { max-width: 560px; padding: 0 var(--ej-gutter) 0 clamp(24px, 3vw, 56px); }

	.ej-thumbs:not([hidden]) { display: grid; gap: 8px; }
	.ej-thumbs button { padding: 0; border: 1px solid transparent; background: none; cursor: pointer; }
	.ej-thumbs button[aria-current="true"] { border-color: var(--ej-ink); }
	.ej-thumbs img { display: block; width: 100%; height: auto; aspect-ratio: 3 / 4; object-fit: cover; }

	.ej-closer__photos { grid-template-columns: repeat(var(--ej-photos, 4), minmax(0, 1fr)); }
	/* Two photos stay the same size as they would in a row of four. */
	.ej-closer__photos[style*="--ej-photos:2"] { max-width: 50%; }
	.ej-more .ej-row { grid-auto-columns: calc((100% - 3 * var(--ej-gap)) / 4); }
}
/* ---------- Other pages (basic for now) ---------- */

.ej-page { padding: clamp(40px, 6vw, 96px) var(--ej-gutter) var(--ej-section); }
.wp-block-group.ej-page > * + * { margin-block-start: 32px; }
.ej-page .entry-content { overflow-wrap: break-word; }
.ej-page .entry-content .wp-block-list { padding-left: 1.25em; }
.ej-page .entry-content li + li { margin-top: 12px; }
.ej-page .ej-size-guide { margin-top: 40px; }

/* ---------- Contact form ---------- */

.ej-page .ej-contact { display: grid; gap: 28px; margin-top: 40px; }
.ej-contact label { display: block; font-size: var(--ej-small); font-weight: 500; }
.ej-contact input,
.ej-contact select,
.ej-contact textarea {
	display: block;
	box-sizing: border-box;
	width: 100%;
	min-height: 48px;
	margin: 0;
	padding: 0;
	border: 0;
	border-bottom: 1px solid var(--ej-ink);
	border-radius: 0;
	background: none;
	color: var(--ej-ink);
	font: inherit;
	font-size: 1rem;
}
/* Our own arrow, so the text lines up with the other fields in every browser. */
.ej-contact select {
	padding-right: 24px;
	appearance: none;
	background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' fill='none' stroke='%23111312' stroke-width='1.5'%3E%3Cpath d='m1 1 5 5 5-5'/%3E%3C/svg%3E") no-repeat right 2px center;
}
.ej-contact textarea { padding-block: 12px; line-height: 1.6; resize: vertical; }
.ej-contact [aria-invalid="true"] { border-bottom-width: 2px; }
.ej-contact .ej-form-status { margin: -12px 0 0; }
.ej-contact__trap { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); }

/* ---------- Size guide ---------- */

.ej-size-guide section { padding: 40px 0; border-top: 1px solid var(--ej-rule); }
.ej-size-guide section:last-child { padding-bottom: 0; }
.ej-size-guide h2 { margin: 0 0 12px; font-size: clamp(1.5rem, 2.4vw, 2rem); text-wrap: balance; }
.ej-size-guide h2 a { display: block; text-decoration: none; }
.ej-size-guide h2 a:hover { text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: 0.2em; }
.ej-size-guide h2 span { white-space: nowrap; }
.ej-size-guide h3 { margin: 24px 0 4px; font-family: var(--wp--preset--font-family--inter); font-size: var(--ej-small); font-weight: 500; }
.ej-size-guide p { margin: 0; }
.ej-size-guide p + .ej-measurements { margin-top: 16px; }
