/**
 * Cover Block – Link Wrapper Styles
 * Applied to the <a> tag that wraps a linked Cover block.
 */

/* Remove default anchor appearance from the wrapper */
a.wp-block-cover__link-wrapper {
	display: block;
	text-decoration: none;
	color: inherit;
	outline-offset: 4px;
	/* Keep the cover's own border-radius if set via inline style */
	border-radius: inherit;
	/* Isolate stacking context so child z-indices work normally */
	isolation: isolate;
}

/* Smooth, subtle scale on hover – respects reduced-motion preference */
@media ( prefers-reduced-motion: no-preference ) {
	a.wp-block-cover__link-wrapper {
		transition: transform 0.25s ease, box-shadow 0.25s ease;
	}

	a.wp-block-cover__link-wrapper:hover {
		transform: scale( 1.015 );
		box-shadow: 0 8px 30px rgba( 0, 0, 0, 0.18 );
	}
}

/* Accessible focus ring */
a.wp-block-cover__link-wrapper:focus-visible {
	outline: 3px solid currentColor;
	outline-offset: 4px;
}

/* Cursor hint */
a.wp-block-cover__link-wrapper {
	cursor: pointer;
}

/* -----------------------------------------------------------------------
   Mobile background image: <picture> wrapper
   display:contents makes <picture> invisible to layout, so the browser's
   <source> matching still works while WordPress's .wp-block-cover__image-background
   styles (position:absolute, object-fit:cover, etc.) apply directly to the <img>.
   ----------------------------------------------------------------------- */
picture.wp-block-cover__picture-mobile {
	display: contents;
}

/* -----------------------------------------------------------------------
   Block editor: show a small "linked" badge on the selected cover block
   ----------------------------------------------------------------------- */
.block-editor .wp-block[data-has-link="true"] > .wp-block-cover {
	outline: 2px dashed #0ea5e9;
	outline-offset: -2px;
}

.block-editor .wp-block[data-has-link="true"] > .wp-block-cover::before {
	content: "🔗 Linked";
	position: absolute;
	top: 8px;
	right: 8px;
	background: #0ea5e9;
	color: #fff;
	font-size: 11px;
	font-weight: 600;
	padding: 2px 8px;
	border-radius: 4px;
	z-index: 20;
	pointer-events: none;
	letter-spacing: 0.03em;
}

/* -----------------------------------------------------------------------
   Block editor: mobile background image badge
   ----------------------------------------------------------------------- */
.block-editor .wp-block[data-has-mobile-bg="true"] > .wp-block-cover {
	outline: 2px dashed #7c3aed;
	outline-offset: -2px;
}

.block-editor .wp-block[data-has-mobile-bg="true"] > .wp-block-cover::after {
	content: "📱 Mobile BG";
	position: absolute;
	top: 8px;
	left: 8px;
	background: #7c3aed;
	color: #fff;
	font-size: 11px;
	font-weight: 600;
	padding: 2px 8px;
	border-radius: 4px;
	z-index: 20;
	pointer-events: none;
	letter-spacing: 0.03em;
}
