/*
 * SHMATS — Homepage Section 1 (introduction)
 * Loaded only on the front page. Mobile-first; desktop rules in the
 * min-width: 768px block below.
 */

.shmats-intro {
	--shmats-bg: #ece3d6;
	--shmats-bg-light: #fbf8f2;
	--shmats-ink: #17140f;
	--shmats-ink-soft: rgba(23, 20, 15, 0.62);
	--shmats-line: rgba(23, 20, 15, 0.35);

	position: relative;
	overflow: hidden;
	display: flex;
	flex-direction: column;
	min-height: 100vh;
	min-height: 100dvh;
	padding: 1.5rem 1.25rem 2.25rem;
	background-color: var(--shmats-bg);
	background-image: url("../images/homepage/shmats-section-01-mobile.webp");
	background-size: cover;
	background-position: center;
	background-repeat: no-repeat;
	color: var(--shmats-ink);
	font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, "Noto Sans Hebrew", "Arial Hebrew", sans-serif;
}

/* Header bar: wordmark + menu trigger. Layout is fixed left-to-right
   regardless of page text direction, so it's locked with direction: ltr. */
.shmats-intro__bar {
	position: relative;
	z-index: 2;
	display: flex;
	align-items: center;
	justify-content: space-between;
	direction: ltr;
}

.shmats-intro__wordmark {
	font-size: 0.85rem;
	font-weight: 700;
	letter-spacing: 0.28em;
	text-decoration: none;
	color: var(--shmats-ink);
	text-transform: uppercase;
}

.shmats-intro__menu-trigger {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 2.75rem;
	height: 2.75rem;
	padding: 0;
	border: 0;
	background: transparent;
	cursor: pointer;
}

.shmats-intro__menu-icon {
	display: flex;
	flex-direction: column;
	gap: 5px;
	width: 22px;
}

.shmats-intro__menu-icon span {
	display: block;
	height: 2px;
	background-color: var(--shmats-ink);
}

/* Main content block */
.shmats-intro__content {
	position: relative;
	z-index: 2;
	flex: 1;
	display: flex;
	flex-direction: column;
	align-items: center;
	justify-content: center;
	gap: clamp(1.5rem, 4vw, 2.25rem);
	text-align: center;
	padding-block: 2.5rem;
}

.shmats-intro__heading {
	margin: 0;
	font-size: clamp(3rem, 15vw, 7.5rem);
	font-weight: 800;
	line-height: 0.95;
	letter-spacing: -0.01em;
}

.shmats-intro__copy {
	display: flex;
	flex-direction: column;
	align-items: center;
	gap: 1.5rem;
	max-width: 26rem;
}

.shmats-intro__body {
	margin: 0;
	font-size: clamp(1.05rem, 4vw, 1.35rem);
	line-height: 1.7;
	font-weight: 400;
}

.shmats-intro__divider {
	font-size: 1rem;
	color: var(--shmats-line);
}

.shmats-intro__closing {
	margin: 0;
	font-size: clamp(1.1rem, 4.4vw, 1.5rem);
	line-height: 1.6;
	font-weight: 600;
}

/* Scroll cue — a real link; the whole cue is clickable, not just the arrow. */
.shmats-intro__scroll {
	position: relative;
	z-index: 2;
	display: flex;
	flex-direction: column;
	align-items: center;
	gap: 0.5rem;
	margin-inline: auto;
	padding: 0.5rem;
	font-size: 0.85rem;
	letter-spacing: 0.04em;
	color: var(--shmats-ink-soft);
	text-decoration: none;
	cursor: pointer;
}

.shmats-intro__scroll:hover {
	color: var(--shmats-ink);
}

.shmats-intro__scroll:focus-visible {
	outline: 2px solid var(--shmats-ink);
	outline-offset: 2px;
	border-radius: 2px;
}

.shmats-intro__scroll-arrow {
	font-size: 1.1rem;
}

@media (prefers-reduced-motion: no-preference) {
	.shmats-intro__scroll-arrow {
		animation: shmats-scroll-cue 2.2s ease-in-out infinite;
	}
}

@keyframes shmats-scroll-cue {
	0%,
	100% {
		transform: translateY(0);
	}

	50% {
		transform: translateY(6px);
	}
}

/* Desktop composition */
@media (min-width: 768px) {
	.shmats-intro {
		padding: 2.5rem 3.5rem 3rem;
		background-image: url("../images/homepage/shmats-section-01-desktop.webp");
	}

	.shmats-intro__content {
		padding-block: 4rem;
	}

	.shmats-intro__copy {
		max-width: 34rem;
	}
}

/*
 * SHMATS — Homepage Section 2 (the story and the choice)
 * Loaded only on the front page. Mobile-first; desktop rules in the
 * min-width: 768px block below.
 */

.shmats-story {
	--shmats-story-bg: #0c0c0c;
	--shmats-story-ink: #f6f4ef;
	--shmats-story-ink-soft: rgba(246, 244, 239, 0.7);
	--shmats-story-line: rgba(246, 244, 239, 0.35);

	position: relative;
	overflow: hidden;
	display: flex;
	flex-direction: column;
	min-height: 100vh;
	min-height: 100dvh;
	padding: 1.5rem 1.25rem 2.25rem;
	background-color: var(--shmats-story-bg);
	background-image: url("../images/homepage/shmats-section-02-mobile.webp");
	background-size: cover;
	background-position: center;
	background-repeat: no-repeat;
	color: var(--shmats-story-ink);
	font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, "Noto Sans Hebrew", "Arial Hebrew", sans-serif;
}

.shmats-story__content {
	position: relative;
	z-index: 2;
	flex: 1;
	display: flex;
	flex-direction: column;
	align-items: center;
	justify-content: center;
	text-align: center;
	padding-block: 2.5rem;
}

.shmats-story__copy {
	display: flex;
	flex-direction: column;
	align-items: center;
	gap: 1.5rem;
	max-width: 26rem;
}

.shmats-story__body {
	margin: 0;
	font-size: clamp(1.05rem, 4vw, 1.35rem);
	line-height: 1.7;
	font-weight: 400;
}

.shmats-story__divider {
	font-size: 1rem;
	color: var(--shmats-story-line);
}

.shmats-story__closing {
	margin: 0;
	font-size: clamp(1.1rem, 4.4vw, 1.5rem);
	line-height: 1.6;
	font-weight: 600;
}

.shmats-story__scroll {
	position: relative;
	z-index: 2;
	display: flex;
	justify-content: center;
	align-items: center;
	margin-inline: auto;
	padding: 0.5rem;
	font-size: 1.1rem;
	color: var(--shmats-story-ink-soft);
	text-decoration: none;
	cursor: pointer;
}

.shmats-story__scroll:hover {
	color: var(--shmats-story-ink);
}

.shmats-story__scroll:focus-visible {
	outline: 2px solid var(--shmats-story-ink);
	outline-offset: 2px;
	border-radius: 2px;
}

@media (prefers-reduced-motion: no-preference) {
	.shmats-story__scroll-arrow {
		animation: shmats-scroll-cue 2.2s ease-in-out infinite;
	}
}

/*
 * SHMATS — Homepage Section 3 (BETTER אומה collection introduction)
 * Loaded only on the front page. Mobile-first; desktop rules in the
 * min-width: 768px block below.
 */

.shmats-collection {
	--shmats-collection-bg: #ece3d6;
	--shmats-collection-ink: #17140f;
	--shmats-collection-ink-soft: rgba(23, 20, 15, 0.62);
	--shmats-collection-line: rgba(23, 20, 15, 0.35);

	position: relative;
	overflow: hidden;
	display: flex;
	flex-direction: column;
	min-height: 100vh;
	min-height: 100dvh;
	padding: 1.5rem 1.25rem 2.25rem;
	background-color: var(--shmats-collection-bg);
	background-image: url("../images/homepage/shmats-section-03-mobile.webp");
	background-size: cover;
	background-position: center;
	background-repeat: no-repeat;
	color: var(--shmats-collection-ink);
	font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, "Noto Sans Hebrew", "Arial Hebrew", sans-serif;
}

.shmats-collection__content {
	position: relative;
	z-index: 2;
	flex: 1;
	display: flex;
	flex-direction: column;
	align-items: center;
	justify-content: flex-start;
	text-align: center;
	padding-block: 3.75rem 2.5rem;
}

.shmats-collection__copy {
	display: flex;
	flex-direction: column;
	align-items: center;
	gap: 1rem;
	max-width: 26rem;
}

/*
 * The title is the transparent lockup image (docs/SHMATS-medina-BETTER-title.png,
 * copied into assets/images/homepage/), always centered within the
 * content block. If the image fails to load, its onerror handler
 * reveals .shmats-collection__heading-text -- the same live, editable
 * two-line HTML title used before the image existed -- as a fallback,
 * so the heading is never left blank.
 */
.shmats-collection__heading {
	margin: 0;
	text-align: center;
}

.shmats-collection__title-image {
	display: block;
	width: min(88vw, 430px);
	max-width: none; /* override the sitewide img{max-width:100%} reset in style.css, which would otherwise cap this at its flex parent's width */
	height: auto;
	margin: 0 auto;
}

.shmats-collection__title-image[hidden] {
	display: none;
}

.shmats-collection__heading-text {
	display: flex;
	flex-direction: column;
	text-align: center;
}

.shmats-collection__heading-text[hidden] {
	display: none;
}

.shmats-collection__heading-line {
	display: block;
	font-weight: 800;
	line-height: 0.9;
	letter-spacing: -0.01em;
}

.shmats-collection__heading-line--state {
	font-size: clamp(2.5rem, 12vw, 5.5rem);
}

.shmats-collection__heading-line--brand {
	margin-top: 0;
	font-size: clamp(2.75rem, 13vw, 6rem);
}

.shmats-collection__heading-line--brand span {
	unicode-bidi: isolate;
}

/*
 * Body, emphasis and CTA are explicitly centered here (not left to
 * inherit from .shmats-collection__content several levels up) so
 * their alignment can't be broken by anything in between, and so it's
 * simple to flip back to right-aligned for the desktop reading layout
 * below.
 */
.shmats-collection__body {
	margin: 0;
	font-size: clamp(1.05rem, 4vw, 1.35rem);
	line-height: 1.7;
	font-weight: 400;
	text-align: center;
}

.shmats-collection__emphasis {
	margin: 0;
	font-size: clamp(1.1rem, 4.4vw, 1.5rem);
	line-height: 1.6;
	font-weight: 600;
	text-align: center;
}

.shmats-collection__cta {
	display: inline-block;
	margin-top: 0.5rem;
	color: var(--shmats-collection-ink);
	text-decoration: none;
	text-align: center;
	font-size: clamp(1.1rem, 4.4vw, 1.5rem);
	line-height: 1.6;
	font-weight: 600;
	border-bottom: 1px solid currentColor;
	padding-bottom: 0.1em;
	transition: opacity 0.2s ease;
}

.shmats-collection__cta:hover {
	opacity: 0.6;
}

.shmats-collection__cta:focus-visible {
	outline: 2px solid currentColor;
	outline-offset: 6px;
	border-radius: 1px;
}

/* Short mobile viewports: compact spacing so the closing line clears the
   model's head, which sits at a fixed position within the frame regardless
   of viewport width. */
@media (max-height: 600px) and (max-width: 767px) {
	.shmats-collection__content {
		padding-block: 1rem;
	}

	.shmats-collection__copy {
		gap: 0.5rem;
	}

	.shmats-collection__heading-line--state {
		font-size: 2rem;
	}

	.shmats-collection__cta {
		margin-top: 0.25rem;
	}
}

/* Desktop composition — Section 2 & 3 (same breakpoint as Section 1) */
@media (min-width: 768px) {
	.shmats-story {
		padding: 2.5rem 3.5rem 3rem;
		background-image: url("../images/homepage/shmats-section-02-desktop.webp");
	}

	.shmats-story__content {
		padding-block: 4rem;
	}

	.shmats-story__copy {
		max-width: 34rem;
	}

	.shmats-collection {
		padding: 2.5rem 3.5rem 3rem;
		background-image: url("../images/homepage/shmats-section-03-desktop.webp");
		direction: ltr;
	}

	/*
	 * The model occupies roughly the right ~40% of this photo at both
	 * validated desktop sizes (1440x900 and 1280x720). The content block
	 * is centered within a "clear zone" of the left 56vw of the viewport
	 * (a plain vw value -- a min() with a rem cap previously shrank this
	 * to as little as 640px at 1440px, pulling the block much further
	 * left than intended), rather than pinned to the viewport's left
	 * edge or centered on the full viewport.
	 */
	.shmats-collection__content {
		align-items: center;
		align-self: flex-start;
		justify-content: center;
		text-align: center;
		padding-block: 4rem;
		width: 56vw;
	}

	.shmats-collection__copy {
		align-items: center;
		max-width: 26rem;
		direction: rtl;
	}

	.shmats-collection__title-image {
		width: clamp(430px, 37vw, 620px);
	}

	.shmats-collection__heading-line--state {
		font-size: clamp(2.5rem, 8.5vw, 5.75rem);
	}

	.shmats-collection__heading-line--brand {
		font-size: clamp(2.75rem, 9vw, 6rem);
	}

	.shmats-collection__body,
	.shmats-collection__emphasis,
	.shmats-collection__cta {
		text-align: center;
	}
}

/*
 * SHMATS — Homepage section indicator (shared)
 * One instance for all three sections; fixed to the viewport so its
 * position is consistent regardless of scroll. Desktop only, matching
 * the previously approved position (right: 3.5rem, vertically centered).
 * Active state is toggled by main.js; plain anchors work without JS.
 */
.shmats-section-nav {
	display: none;
}

@media (min-width: 768px) {
	.shmats-section-nav {
		display: block;
		position: fixed;
		z-index: 10;
		top: 50%;
		right: 3.5rem;
		transform: translateY(-50%);
		direction: ltr;
	}

	.shmats-section-nav ol {
		display: flex;
		flex-direction: column;
		align-items: flex-end;
		gap: 1.25rem;
		margin: 0;
		padding: 0;
		list-style: none;
	}

	.shmats-section-nav__link {
		display: flex;
		align-items: center;
		gap: 0.6rem;
		padding: 0.25rem;
		font-size: 0.85rem;
		font-weight: 600;
		letter-spacing: 0.05em;
		color: rgba(23, 20, 15, 0.5);
		text-decoration: none;
		transition: color 0.2s ease;
	}

	/* The indicator sits above every section's own background, so its
	   resting color must work on both the light (S1/S3) and dark (S2)
	   photography. A neutral mid-tone plus a bright active state reads
	   acceptably on both without needing per-section color swapping. */
	.shmats-section-nav__link:hover {
		color: rgba(23, 20, 15, 0.8);
	}

	.shmats-section-nav__link:focus-visible {
		outline: 2px solid #17140f;
		outline-offset: 3px;
		border-radius: 2px;
	}

	.shmats-section-nav__link.is-active {
		color: #17140f;
	}

	.shmats-section-nav__dot {
		width: 7px;
		height: 7px;
		border-radius: 50%;
		border: 1px solid currentColor;
		background: transparent;
	}

	.shmats-section-nav__link.is-active .shmats-section-nav__dot {
		background-color: currentColor;
	}
}

/*
 * SHMATS — Off-canvas menu panel (shared)
 * Uses the theme's 'primary' nav menu, managed in Appearance > Menus.
 */
.shmats-menu-overlay {
	position: fixed;
	inset: 0;
	z-index: 90;
	background: rgba(12, 12, 12, 0.5);
	opacity: 0;
	transition: opacity 0.2s ease;
}

.shmats-menu-overlay[hidden] {
	display: none;
}

.shmats-menu-overlay.is-open {
	opacity: 1;
}

.shmats-menu-panel {
	position: fixed;
	top: 0;
	right: 0;
	bottom: 0;
	z-index: 100;
	width: min(20rem, 86vw);
	display: flex;
	flex-direction: column;
	gap: 2rem;
	padding: 1.5rem 1.75rem 2rem;
	background: #0c0c0c;
	color: #f6f4ef;
	transform: translateX(100%);
	transition: transform 0.25s ease;
	overflow-y: auto;
}

.shmats-menu-panel[hidden] {
	display: none;
}

.shmats-menu-panel.is-open {
	transform: translateX(0);
}

.shmats-menu-panel__close {
	align-self: flex-end;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 2.5rem;
	height: 2.5rem;
	margin-inline-start: auto;
	border: 0;
	background: transparent;
	color: inherit;
	font-size: 1.75rem;
	line-height: 1;
	cursor: pointer;
}

.shmats-menu-panel__close:focus-visible {
	outline: 2px solid currentColor;
	outline-offset: 2px;
	border-radius: 2px;
}

.shmats-menu-panel__list {
	display: flex;
	flex-direction: column;
	gap: 1.25rem;
	margin: 0;
	padding: 0;
	list-style: none;
	font-size: 1.15rem;
}

.shmats-menu-panel__list a {
	display: inline-block;
	color: inherit;
	text-decoration: none;
	padding: 0.15rem 0;
}

.shmats-menu-panel__list a:hover {
	opacity: 0.7;
}

.shmats-menu-panel__list a:focus-visible {
	outline: 2px solid currentColor;
	outline-offset: 2px;
	border-radius: 2px;
}

body.shmats-menu-open {
	overflow: hidden;
}

/*
 * Progressive reveal for Sections 2 and 3 only — Section 1 is what the
 * visitor already sees on load, so it is never hidden (avoids any risk
 * of a flash-of-hidden-content there). Scoped behind a class main.js
 * adds after it initializes, so with JS disabled nothing is ever
 * hidden; and behind prefers-reduced-motion, so that preference also
 * always sees full content with no transition.
 */
@media (prefers-reduced-motion: no-preference) {
	.shmats-reveal-ready .shmats-story__content,
	.shmats-reveal-ready .shmats-collection__content {
		opacity: 0;
		transform: translateY(16px);
		transition: opacity 0.6s ease, transform 0.6s ease;
	}

	.shmats-reveal-ready .shmats-story__content.is-visible,
	.shmats-reveal-ready .shmats-collection__content.is-visible {
		opacity: 1;
		transform: translateY(0);
	}
}
