/* fable/design: storefronts presentation (grid cards, related block,
   announcement banner). Uses the theme's own design tokens
   (theme.json custom properties) so it inherits the existing look;
   --mo-sf-accent is the one storefront-specific knob, set inline per
   block only when a storefront defines an accent_color. */

.mo-sf-announcement {
	background: var(--wp--preset--color--surface-secondary, #f4f4f0);
	border-left: 4px solid var(--mo-sf-accent, var(--wp--preset--color--accent-cobalt, #1d4ed8));
	padding: 0.75rem 1.25rem;
	margin: 0 auto 1.5rem;
	max-width: var(--wp--style--global--content-size, 1100px);
	border-radius: 4px;
}

.mo-sf-announcement p {
	margin: 0;
	font-size: var(--wp--preset--font-size--sm, 0.95rem);
	font-weight: 600;
}

.mo-sf-grid {
	padding: 2.5rem 1.25rem;
}

.mo-sf-grid__inner {
	max-width: var(--wp--style--global--content-size, 1100px);
	margin: 0 auto;
}

.mo-sf-grid .mo-eyebrow {
	/* fable/design round 3: the raw brand accent (--mo-sf-accent) is a fill
	   color, not guaranteed AA-safe as TEXT on this section's background —
	   MEASURED 2.48:1 for pets. accent-cobalt-light is the token
	   Mo_Storefronts_Theme actually AA-enforces for exactly this role
	   (link/eyebrow text on $bg); it still falls back the same way on the
	   default storefront, where it's theme.json's original value. */
	color: var(--wp--preset--color--accent-cobalt-light, var(--mo-sf-accent, var(--wp--preset--color--accent-cobalt, #1d4ed8)));
}

.mo-sf-grid__title {
	margin: 0.25rem 0 1.25rem;
}

.mo-sf-grid__list {
	list-style: none;
	display: grid;
	grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
	gap: 1.25rem;
	margin: 0;
	padding: 0;
}

.mo-sf-card {
	border: 1px solid var(--wp--preset--color--border, #e2e2df);
	border-top: 3px solid var(--mo-sf-accent, transparent);
	border-radius: 8px;
	overflow: hidden;
	background: var(--wp--preset--color--surface-primary, #fff);
}

.mo-sf-card__link {
	display: flex;
	flex-direction: column;
	text-decoration: none;
	color: inherit;
	height: 100%;
}

.mo-sf-card__img {
	width: 100%;
	height: auto;
	aspect-ratio: 1 / 1;
	object-fit: cover;
}

.mo-sf-card__name {
	padding: 0.6rem 0.75rem 0.2rem;
	font-weight: 600;
	font-size: 0.95rem;
}

.mo-sf-card__price {
	padding: 0 0.75rem 0.75rem;
	font-size: 0.9rem;
	opacity: 0.85;
}

.mo-sf-related {
	border-top: 1px solid var(--wp--preset--color--border, #e2e2df);
}

/* fable/design round 2: the hero's "no photo" mode — a storefront that has
   neither a custom hero_image nor a featured product with a real uploaded
   photo gets a simple on-palette gradient instead, never the dash-cam
   render. Sized to match .mo-home-hero__figure img's own box model
   (components.css) at the same breakpoints so switching between a photo
   and this gradient never shifts layout. */
.mo-home-hero__gradient {
	display: block;
	width: 100%;
	aspect-ratio: 900 / 703;
	max-height: 45vh;
	background:
		linear-gradient(135deg, rgba(0, 0, 0, 0) 0%, rgba(0, 0, 0, 0.45) 100%),
		var(--mo-sf-accent, var(--wp--preset--color--accent-cobalt, #1d4ed8));
}

@media (min-width: 768px) {
	.mo-home-hero__gradient {
		max-height: none;
		aspect-ratio: 16 / 9;
	}
}

/* [mo_home_featured_product]'s "our current pick" media, same "no product
   photo -> on-palette gradient, never the dash-cam render" rule as the
   hero — matches .mo-spotlight__img's own aspect-ratio at both sizes so
   swapping between a real photo and this gradient never shifts layout. */
.mo-spotlight__gradient {
	display: block;
	width: 100%;
	height: 100%;
	aspect-ratio: 4 / 3;
	background:
		linear-gradient(135deg, rgba(0, 0, 0, 0) 0%, rgba(0, 0, 0, 0.45) 100%),
		var(--mo-sf-accent, var(--wp--preset--color--accent-cobalt, #1d4ed8));
}
@media (min-width: 768px) {
	.mo-spotlight__gradient {
		aspect-ratio: 5 / 4;
	}
}

/* fable/design round 3: full visual identity ---------------------------- */

/* Header wordmark / optional logo (mo_sf_header_wordmark shortcode
   replaces core/site-title — see class-mo-storefronts-presentation.php).
   .wp-block-site-title is kept as a class specifically so the existing
   selectors below (already targeting that class) need no changes. */
.mo-header__logo {
	height: 28px;
	width: auto;
	vertical-align: middle;
	margin-right: 0.5em;
}

/* Button style: 'outline' (Mo_Storefronts::button_style()). 'solid' is the
   original look and needs no rule — it IS the existing .mo-btn--primary. */
body.mo-sf-button-outline .mo-btn--primary {
	background: transparent;
	color: var(--wp--preset--color--accent-cobalt);
	border-color: var(--wp--preset--color--accent-cobalt);
}
body.mo-sf-button-outline .mo-btn--primary:hover,
body.mo-sf-button-outline .mo-btn--primary:focus-visible {
	background: var(--wp--custom--accent-tint);
	color: var(--wp--preset--color--accent-cobalt);
}

/* Hero layout variants (Mo_Storefronts::hero_layout()). 'split' is the
   original two-column layout and needs no rule. Both variants below work
   with any of the hero's four visual modes (concept/custom/product/
   gradient, class-mo-storefronts.php's hero_visual()) since they only
   reposition the existing .mo-home-hero__* boxes, never their content. */

body.mo-sf-hero-centered .mo-home-hero__inner {
	grid-template-columns: 1fr;
	justify-items: center;
	text-align: center;
	max-width: 760px;
}
body.mo-sf-hero-centered .mo-home-hero__copy {
	align-items: center;
}
body.mo-sf-hero-centered .mo-home-hero__facts {
	justify-content: center;
}
body.mo-sf-hero-centered .mo-home-hero__actions {
	flex-direction: row;
	justify-content: center;
	flex-wrap: wrap;
}
body.mo-sf-hero-centered .mo-home-hero__media {
	order: 2;
	max-width: 420px;
}

body.mo-sf-hero-full-bleed .mo-home-hero {
	padding: 0;
	min-height: 520px;
	display: flex;
	align-items: flex-end;
}
body.mo-sf-hero-full-bleed .mo-home-hero__inner {
	grid-template-columns: 1fr;
	max-width: none;
	width: 100%;
	padding: var(--wp--preset--spacing--xl) var(--wp--preset--spacing--md);
}
body.mo-sf-hero-full-bleed .mo-home-hero__media {
	position: absolute;
	inset: 0;
	z-index: -1;
	max-width: none;
	margin: 0;
	padding: 0;
}
body.mo-sf-hero-full-bleed .mo-home-hero__figure {
	width: 100%;
	height: 100%;
	border-radius: 0;
	box-shadow: none;
}
body.mo-sf-hero-full-bleed .mo-home-hero__figure picture,
body.mo-sf-hero-full-bleed .mo-home-hero__figure img,
body.mo-sf-hero-full-bleed .mo-home-hero__gradient {
	width: 100%;
	height: 100%;
	max-height: none;
	aspect-ratio: auto;
	object-fit: cover;
}
body.mo-sf-hero-full-bleed .mo-home-hero__figure::after {
	content: "";
	position: absolute;
	inset: 0;
	background: linear-gradient(0deg, var(--wp--custom--overlay-scrim, rgba(0, 0, 0, 0.75)) 0%, transparent 65%);
}
body.mo-sf-hero-full-bleed .mo-home-hero__copy {
	position: relative;
	z-index: 1;
	max-width: 640px;
}
body.mo-sf-hero-full-bleed .mo-home-hero__figure .mo-concept-tag {
	z-index: 1;
}
body.mo-sf-hero-full-bleed .mo-home-hero__tag {
	position: relative;
	margin-top: var(--wp--preset--spacing--sm);
}

@media (min-width: 768px) {
	body.mo-sf-hero-full-bleed .mo-home-hero__tag {
		position: static;
	}
}

/* fable/design (owner reviewer fix): umbrella/default homepage department
   cards, replacing the raw-CJ-photo product collage in .mo-sf-grid's
   default-storefront branch. Reuses .mo-sf-grid's outer padding/eyebrow so
   it sits visually consistent with the personalized-storefront grid it
   stands in for. */
.mo-dept-cards {
	list-style: none;
	display: grid;
	grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
	gap: 1.25rem;
	margin: 0;
	padding: 0;
}

.mo-dept-card__link {
	display: block;
	position: relative;
	border-radius: var(--wp--custom--radius--lg, 12px);
	overflow: hidden;
	text-decoration: none;
	color: #fff;
	aspect-ratio: 16 / 10;
	box-shadow: var(--wp--preset--shadow--glow, 0 4px 18px rgba(0, 0, 0, 0.12));
}

.mo-dept-card__img {
	position: absolute;
	inset: 0;
	width: 100%;
	height: 100%;
	object-fit: cover;
}

.mo-dept-card__link::after {
	content: '';
	position: absolute;
	inset: 0;
	background: linear-gradient(180deg, rgba(0, 0, 0, 0) 40%, rgba(0, 0, 0, 0.72) 100%);
}

.mo-dept-card__label,
.mo-dept-card__blurb {
	position: relative;
	z-index: 1;
	display: block;
	padding-inline: 1rem;
}

.mo-dept-card__label {
	margin-top: auto;
	padding-top: 6rem;
	font-weight: 700;
	font-size: 1.1rem;
	text-shadow: 0 1px 3px rgba(0, 0, 0, 0.6);
}

.mo-dept-card__blurb {
	padding-bottom: 0.25rem;
	font-size: 0.85rem;
	opacity: 0.92;
	text-shadow: 0 1px 3px rgba(0, 0, 0, 0.6);
}

/* fable/design round 5 (reviewer fix): each department card's config-driven
   hero pick (Mo_Storefronts::hero_product_id()), shown as a small label
   under the blurb so the umbrella homepage names an actual product per
   world, not just a category thumbnail. */
.mo-dept-card__pick {
	padding-bottom: 1rem;
	font-size: 0.75rem;
	font-weight: 600;
	letter-spacing: 0.02em;
	opacity: 0.85;
	text-shadow: 0 1px 3px rgba(0, 0, 0, 0.6);
}

.mo-dept-card__link {
	display: flex;
	flex-direction: column;
}

/* Shared-owner: product note (`product_notes` in a store's JSON; the text
   is each product's `_mo_product_note` meta). Classes: .mo-sf-note plus
   --card/--pdp and --price/--image/--buybox; text in .mo-sf-note__text.
   A quiet default at zero specificity (:where), so any store rule wins. */
:where(.mo-sf-note) {
	display: inline-block;
	margin-top: var(--wp--preset--spacing--2-xs);
	font-size: var(--wp--preset--font-size--sm);
	line-height: 1.35;
	color: var(--wp--preset--color--text-secondary);
}
:where(.mo-sf-note--price) {
	display: block;
}
:where(.mo-sf-note--image) {
	position: absolute;
	top: 10px;
	left: 10px;
	z-index: 1;
	margin: 0;
	padding: 4px 8px;
	background: var(--wp--preset--color--surface-primary);
	pointer-events: none;
}
