/* ==========================================================================
   SnapHub Studio Media Fallback
   Category fallback is the base layer; a valid representative <img> overlays it.
   The media container keeps navigation semantics even when no <img> exists.
   ========================================================================== */

[data-studio-fallback] {
	--studio-fallback-image: url("../images/fallback/no-image-etc.webp");
	background-color: #f7f3ef;
	background-image: var(--studio-fallback-image);
	background-position: center;
	background-repeat: no-repeat;
	background-size: cover;
}

[data-studio-fallback="wedding"] {
	--studio-fallback-image: url("../images/fallback/no-image-wedding.webp");
}

[data-studio-fallback="baby"] {
	--studio-fallback-image: url("../images/fallback/no-image-baby.webp");
}

[data-studio-fallback="family"] {
	--studio-fallback-image: url("../images/fallback/no-image-family.webp");
}

[data-studio-fallback="body"] {
	--studio-fallback-image: url("../images/fallback/no-image-body.webp");
}

[data-studio-fallback="id-passport"] {
	--studio-fallback-image: url("../images/fallback/no-image-id-passport.webp");
}

[data-studio-fallback="etc"] {
	--studio-fallback-image: url("../images/fallback/no-image-etc.webp");
}

[data-studio-fallback] [data-studio-image] {
	position: relative;
	z-index: 1;
}

/* The dark photo gradient is useful on real photos but damages the bright
   SnapHub fallback artwork. Only disable it while the fallback is visible. */
.studio-card__image.is-fallback::after,
.search-card__media.is-fallback::after {
	opacity: 0;
}

/* The fallback artwork already owns the upper-left SnapHub logo.
   Move discovery badges to the opposite corner only in fallback state. */
.studio-card__image.is-fallback .studio-card__badges {
	left: auto;
	right: 20px;
}

.search-card__media.is-fallback .search-card__badges {
	left: auto;
	right: 18px;
}

.new-card__image.is-fallback > span {
	left: auto;
	right: 16px;
}

.related-card__media.is-fallback .related-card__badge {
	left: auto;
	right: 14px;
}

@media (max-width: 1024px) {
	.studio-card__image.is-fallback .studio-card__badges {
		left: auto;
		right: 19px;
	}

	.search-card__media.is-fallback .search-card__badges {
		left: auto;
		right: 18px;
	}
}

@media (prefers-reduced-motion: reduce) {
	[data-studio-fallback] [data-studio-image] {
		transition: none;
	}
}


/* ==========================================================================
   Studio portrait representative image
   - Landscape/square keeps each page's existing cover policy.
   - Portrait shows the full image at 100% height and fills side gutters with
     the same image blurred behind it. This is shared by main/list cards.
   ========================================================================== */
[data-studio-fallback].is-portrait {
	position: relative;
	isolation: isolate;
	background-image: none;
	background-color: #111;
}

[data-studio-fallback].is-portrait::before {
	content: "";
	position: absolute;
	z-index: 0;
	inset: -18px;
	background-image: var(--studio-media-image);
	background-position: center;
	background-repeat: no-repeat;
	background-size: cover;
	filter: blur(16px);
	transform: scale(1.06);
	pointer-events: none;
}

[data-studio-fallback].is-portrait [data-studio-image] {
	position: relative;
	z-index: 1;
	width: 100%;
	height: 100%;
	object-fit: contain !important;
	object-position: center;
}
