.random-filebird-cover {
	--rfc-cyan: var(--wp--preset--color--accent-1, #00f6ff);
	--rfc-magenta: var(--wp--preset--color--accent-2, #ff00ff);
	position: relative;
	overflow: hidden;
	display: flex;
	align-items: flex-end;
	min-height: var(--rfc-min-height, 480px);
	margin: 0;
	color: #fff;
	background: #0a0a0a;
}

.random-filebird-cover::after {
	content: "";
	position: absolute;
	left: 0;
	bottom: 0;
	width: 100%;
	height: 4px;
	background: linear-gradient(to right, var(--rfc-magenta), var(--rfc-cyan));
	z-index: 3;
	pointer-events: none;
}

.random-filebird-cover__media {
	position: absolute;
	inset: 0;
	z-index: 0;
	margin: 0;
}

.random-filebird-cover__img {
	display: block;
	width: 100%;
	height: 100%;
	min-height: var(--rfc-min-height, 480px);
	object-fit: cover;
	transition: opacity 0.45s ease;
}

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

.random-filebird-cover__img.is-swapping {
	opacity: 0;
}

.random-filebird-cover__overlay {
	position: absolute;
	inset: 0;
	z-index: 1;
	background: linear-gradient(
		115deg,
		rgba(0, 0, 0, calc(0.55 + var(--rfc-dim, 0.5) * 0.35)) 0%,
		rgba(0, 0, 0, calc(0.2 + var(--rfc-dim, 0.5) * 0.25)) 50%,
		rgba(0, 0, 0, calc(0.45 + var(--rfc-dim, 0.5) * 0.3)) 100%
	);
	pointer-events: none;
}

.random-filebird-cover__content {
	position: relative;
	z-index: 2;
	box-sizing: border-box;
	width: 100%;
	max-width: min(42rem, 92%);
	padding: clamp(1.5rem, 4vw, 3rem);
	pointer-events: none;
}

/* Tekst i temaets innholds-/bred-/fullbredde (WordPress layout sizes) */
.random-filebird-cover--content-width .random-filebird-cover__content {
	max-width: none;
	width: 100%;
	padding: 0;
}

.random-filebird-cover--content-width .random-filebird-cover__content-inner {
	box-sizing: border-box;
	width: 100%;
	margin-left: auto;
	margin-right: auto;
	padding: clamp(1.5rem, 4vw, 3rem)
		var(--wp--style--root--padding-right, clamp(1.25rem, 4vw, 3rem))
		clamp(1.5rem, 4vw, 3rem)
		var(--wp--style--root--padding-left, clamp(1.25rem, 4vw, 3rem));
	pointer-events: none;
}

.random-filebird-cover--width-content .random-filebird-cover__content-inner {
	max-width: var(--wp--style--global--content-size, 645px);
}

.random-filebird-cover--width-wide .random-filebird-cover__content-inner {
	max-width: var(--wp--style--global--wide-size, var(--wp--style--global--content-size, 645px));
}

.random-filebird-cover--width-full .random-filebird-cover__content-inner {
	max-width: none;
}

.random-filebird-cover--content-width .random-filebird-cover__text {
	max-width: none;
}

.random-filebird-cover--content-width .random-filebird-cover__content-inner > * {
	pointer-events: auto;
}

.random-filebird-cover__heading {
	margin: 0 0 0.65rem;
	font-size: clamp(1.75rem, 4.5vw, 3rem);
	font-weight: 400;
	line-height: 1.15;
	color: #fff;
	text-wrap: balance;
}

.random-filebird-cover__text {
	margin: 0;
	max-width: 36rem;
	font-size: clamp(0.95rem, 1.8vw, 1.1rem);
	line-height: 1.55;
	color: rgba(255, 255, 255, 0.92);
}

.random-filebird-cover__text p {
	margin: 0 0 0.65rem;
}

.random-filebird-cover__text p:last-child {
	margin-bottom: 0;
}

.random-filebird-cover__actions {
	margin-top: 1.1rem;
	pointer-events: auto;
}

.random-filebird-cover__btn {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	min-height: 2.65rem;
	padding: 0.55rem 1.5rem;
	border-radius: 10px;
	font-size: 0.78rem;
	font-weight: 700;
	letter-spacing: 0.08em;
	text-transform: uppercase;
	text-decoration: none;
	color: #000;
	background: var(--rfc-magenta);
	border: 2px solid var(--rfc-magenta);
	box-shadow: 0 0 14px rgba(255, 0, 255, 0.45);
	transition:
		transform 0.15s ease,
		box-shadow 0.15s ease,
		background-color 0.15s ease;
}

.random-filebird-cover__btn:hover,
.random-filebird-cover__btn:focus-visible {
	transform: translateY(-1px);
	box-shadow: 0 0 20px rgba(255, 0, 255, 0.65);
	color: #000;
}

.random-filebird-cover__btn:focus-visible {
	outline: 2px solid #fff;
	outline-offset: 3px;
}

.random-filebird-cover--empty .random-filebird-cover__media {
	background: linear-gradient(135deg, #1a1a1a, #2a2a2a);
}

.random-filebird-cover--editor {
	min-height: 280px;
	border: 1px dashed rgba(0, 0, 0, 0.25);
	border-radius: 6px;
}

.random-filebird-cover--editor.random-filebird-cover--empty {
	background: #1a1a1a;
}

.random-filebird-cover--editor .random-filebird-cover__heading,
.random-filebird-cover--editor .random-filebird-cover__text {
	opacity: 0.95;
}

/* Mobil */
@media (max-width: 639px) {
	.random-filebird-cover {
		/* Unngå at fast px-høyde dominerer hele skjermen på små telefoner */
		min-height: min(var(--rfc-min-height, 480px), 72vh);
	}

	.random-filebird-cover__img {
		min-height: min(var(--rfc-min-height, 480px), 72vh);
	}

	.random-filebird-cover__content {
		max-width: 100%;
		padding: 1.25rem 1rem 1.5rem;
	}

	.random-filebird-cover--content-width .random-filebird-cover__content-inner {
		padding: 1.25rem 1rem 1.5rem;
	}

	.random-filebird-cover__heading {
		font-size: clamp(1.5rem, 7.5vw, 2.15rem);
		line-height: 1.2;
	}

	.random-filebird-cover__text {
		font-size: 0.95rem;
		line-height: 1.5;
	}

	.random-filebird-cover__actions {
		margin-top: 1rem;
	}

	.random-filebird-cover__btn {
		min-height: 2.75rem;
		padding-inline: 1.35rem;
	}
}
