/* Banner slots + HTML5 typography templates (inc/banners.php).
   A slot stays hidden until banners.js puts a banner in it. The frame keeps the
   slot's shape (--sb-r desktop, --sb-mr mobile) and is a size container, so the
   templates scale their type with the box rather than the viewport. */

.sb-slot {
	/* Full row when it lands inside a grid (archives, the home rows). */
	grid-column: 1 / -1;
	box-sizing: border-box;
	width: min(100% - 2rem, var(--sb-w, 970) * 1px);
	margin: var(--shivuk-space, 1.25rem) auto;
}

/* Inside a column (sidebar, article body) the column already has gutters. */
.widget-area .sb-slot,
.entry-content .sb-slot,
.single-article .sb-slot {
	width: min(100%, var(--sb-w, 970) * 1px);
}

.sb-slot[hidden] {
	display: none;
}

.sb-slot::before {
	content: "מודעה";
	display: block;
	margin-bottom: 4px;
	font-size: 0.6875rem;
	letter-spacing: 0.04em;
	color: var(--shivuk-color-muted, #6b6b70);
}

.sb-frame {
	position: relative;
	aspect-ratio: var(--sb-r, 970 / 250);
	container-type: size;
	overflow: hidden;
	border-radius: var(--shivuk-radius, 10px);
}

@media (max-width: 767px) {
	.sb-slot {
		max-width: 100%;
	}

	.sb-frame {
		aspect-ratio: var(--sb-mr, var(--sb-r));
	}
}

.sb {
	position: absolute;
	inset: 0;
	display: flex;
	color: inherit;
	text-decoration: none;
	overflow: hidden;
}

/* Image banner ------------------------------------------------------------ */

.sb__pic,
.sb__pic img {
	display: block;
	width: 100%;
	height: 100%;
}

.sb__pic img {
	object-fit: cover;
}

/* Typography templates ---------------------------------------------------- */

.sb--tpl {
	--sb-pad: min(8cqh, 5cqw);
	align-items: center;
	gap: min(4cqh, 3cqw);
	padding: var(--sb-pad);
	background: var(--sb-bg);
	color: var(--sb-fg);
	font-family: var(--shivuk-font-body, inherit);
	direction: rtl;
	text-align: start;
}

.sb__body {
	position: relative;
	z-index: 1;
	display: flex;
	flex-direction: column;
	align-items: flex-start;
	gap: min(3cqh, 1.6cqw);
	min-width: 0;
	flex: 1;
}

.sb__h {
	font-size: min(15cqh, 9.5cqw);
	font-weight: 800;
	line-height: 1.05;
	letter-spacing: -0.01em;
}

.sb__s {
	font-size: min(8cqh, 5cqw);
	line-height: 1.3;
	opacity: 0.88;
}

.sb__cta {
	margin-top: min(2cqh, 1cqw);
	padding: min(3.5cqh, 2cqw) min(7cqh, 4cqw);
	border-radius: 999px;
	background: var(--sb-ac);
	color: var(--sb-bg);
	font-size: min(7cqh, 4.6cqw);
	font-weight: 700;
	line-height: 1;
	white-space: nowrap;
	transition: transform 0.2s var(--shivuk-ease, ease);
}

a.sb:hover .sb__cta,
a.sb:focus-visible .sb__cta {
	transform: translateY(-1px) scale(1.03);
}

.sb__media {
	position: absolute;
	inset: 0;
	display: none;
}

/* Only these two templates use the picture. */
.sb--photo .sb__media,
.sb--split .sb__media {
	display: block;
}

.sb__media img {
	width: 100%;
	height: 100%;
	object-fit: cover;
	display: block;
}

/* Wide, short boxes (leaderboards): one row, CTA at the far end. */
@container (min-aspect-ratio: 3 / 1) {
	.sb--tpl .sb__body {
		flex-direction: row;
		align-items: center;
		flex-wrap: wrap;
		column-gap: 3cqw;
	}

	.sb__h {
		font-size: min(30cqh, 3.6cqw);
	}

	.sb__s {
		font-size: min(18cqh, 2cqw);
		flex: 1;
	}

	.sb__cta {
		margin: 0;
		margin-inline-start: auto;
		padding: 10cqh 2.2cqw;
		font-size: min(18cqh, 1.8cqw);
	}
}

/* bold: flat colour, the accent as a thick side rule. */
.sb--bold {
	box-shadow: inset -0.9cqw 0 0 var(--sb-ac);
}

/* gradient */
.sb--gradient {
	background: linear-gradient(135deg, var(--sb-bg) 0%, color-mix(in srgb, var(--sb-bg) 45%, var(--sb-ac)) 100%);
}

/* photo: picture fills the box, a scrim keeps the text readable. */
.sb--photo .sb__media::after {
	content: "";
	position: absolute;
	inset: 0;
	background: linear-gradient(to left, color-mix(in srgb, var(--sb-bg) 88%, transparent) 0%, color-mix(in srgb, var(--sb-bg) 55%, transparent) 55%, transparent 100%);
}

.sb--photo .sb__body {
	max-width: 70%;
}

/* split: picture on one side, text on the other. */
.sb--split .sb__media {
	inset: 0 auto 0 0;
	width: 42%;
}

.sb--split .sb__body {
	margin-inline-end: 42%;
}

@container (max-aspect-ratio: 1 / 1) {
	.sb--split .sb__media {
		inset: auto 0 0 0;
		width: auto;
		height: 42%;
	}

	.sb--split .sb__body {
		margin: 0 0 42% 0;
	}
}

/* Without a picture these two read as the bold template. */
.sb--split:not(.sb--has-img) .sb__body {
	margin: 0;
}

.sb--photo:not(.sb--has-img) .sb__body {
	max-width: none;
}

/* outline: quiet, framed in the accent. */
.sb--outline {
	box-shadow: inset 0 0 0 max(2px, 0.5cqw) var(--sb-ac);
}

.sb--outline .sb__cta {
	background: transparent;
	color: var(--sb-ac);
	box-shadow: inset 0 0 0 2px var(--sb-ac);
}

@media (prefers-reduced-motion: reduce) {
	.sb__cta {
		transition: none;
	}
}
