/*
 * Salman Personality base styles.
 * Everything uses :where() so it has zero specificity and any generated .salman-<uid> rule wins.
 */

/* Blank-canvas reset (only on the Canvas template). */
:where(body.salman-canvas) {
	margin: 0;
	-webkit-font-smoothing: antialiased;
	text-rendering: optimizeLegibility;
}

:where(body.salman-canvas) *,
:where(body.salman-canvas) *::before,
:where(body.salman-canvas) *::after {
	box-sizing: border-box;
}

/* Every block starts from zero so converted designs state their own spacing. */
:where(.salman-block) {
	margin: 0;
	box-sizing: border-box;
}

:where(.wp-block-salman-section) {
	display: block;
	position: relative;
}

:where(.wp-block-salman-container) {
	display: block;
	min-width: 0;
}

/* A container used as a link (card, icon link) looks like its content, not like a default link. */
:where(a.wp-block-salman-container) {
	color: inherit;
	text-decoration: none;
}

:where(ul.salman-block, ol.salman-block) {
	padding: 0;
	list-style: none;
}

:where(.wp-block-salman-image) {
	display: block;
	max-width: 100%;
	height: auto;
}

:where(.wp-block-salman-button) {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	cursor: pointer;
	text-decoration: none;
	font: inherit;
	color: inherit;
	background: none;
	border: 0;
	padding: 0;
}

/* Visually hidden helper for accessible labels. */
.salman-sr-only {
	position: absolute;
	width: 1px;
	height: 1px;
	padding: 0;
	margin: -1px;
	overflow: hidden;
	clip: rect(0, 0, 0, 0);
	white-space: nowrap;
	border: 0;
}

/* Scroll reveal (assets/js/reveal.js adds `in` once the element is in view). */
.rise.in {
	transform: none;
}

@media (prefers-reduced-motion: reduce) {
	.rise,
	.rise.in {
		transform: none;
		transition: none;
	}
}

/* Video block: poster and play button (see src/blocks/video). */
.salman-video-poster {
	position: absolute;
	inset: 0;
	width: 100%;
	height: 100%;
	object-fit: cover;
}

.salman-video-play {
	position: absolute;
	top: 50%;
	left: 50%;
	transform: translate(-50%, -50%);
	width: 64px;
	height: 64px;
	border-radius: 50%;
	background: var(--salman-color-white, #fff);
	display: grid;
	place-items: center;
}

.salman-video-play svg {
	width: 26px;
	height: 26px;
	fill: var(--salman-color-purple, #44287a);
	margin-inline-start: -3px;
}

.salman-video-file {
	position: absolute;
	inset: 0;
	width: 100%;
	height: 100%;
	object-fit: cover;
}

/* Video overlay sits above the poster, below the play button. */
.wp-block-salman-video::before {
	z-index: 1;
}

.salman-video-play {
	z-index: 2;
}

/* Video playing in place: the embed or <video> fills the frame. */
.salman-video-media {
	position: absolute;
	inset: 0;
	width: 100%;
	height: 100%;
	border: 0;
	object-fit: contain;
	background: #000;
}

button.salman-video-play {
	border: 0;
	padding: 0;
	cursor: pointer;
}

/* While playing, the design's dim overlay goes away so the player's controls are usable. */
.wp-block-salman-video.is-playing::before {
	display: none;
}

.salman-video-media {
	z-index: 2;
}

/* Clip the video and its cover to the frame's rounded corners. */
.wp-block-salman-video {
	overflow: hidden;
}

/* Dimming over the cover (the design's overlay). It is a layer, so it goes away with the cover on play. */
.wp-block-salman-video::before {
	display: none;
}

.salman-video-shade {
	position: absolute;
	inset: 0;
	background: rgba(46, 26, 85, 0.55);
	z-index: 1;
	pointer-events: none;
}
