/*
 * Feature (design draft V2): a large photograph, the burgundy panel over its
 * lower left corner with a fading inner gold frame, and, with a film, a fine
 * ring that turns slowly around a play mark.
 */
@layer blocks {
	/*
	 * One grid for photograph, panel and caption: the panel is anchored to
	 * the photograph's lower edge, never to the caption.
	 *   phones   photograph, panel, caption
	 *   desktop  the panel sits on the photograph's lower left corner
	 */
	.feature__figure {
		position: relative;
		display: grid;
		grid-template-columns: minmax(0, 1fr);
		margin: 0;
	}

	.feature__stage {
		grid-row: 1;
		grid-column: 1;
	}

	.feature__panel {
		grid-row: 2;
		grid-column: 1;
	}

	.feature__caption {
		grid-row: 3;
	}

	.feature__stage {
		position: relative;
		height: 20rem;
		overflow: hidden;
		background: var(--muted);
	}

	.feature__image {
		width: 100%;
		height: 100%;
		object-fit: cover;
	}

	/* ---- Play ring ------------------------------------------------------ */
	.feature__play {
		position: absolute;
		top: 50%;
		left: 50%;
		display: grid;
		place-items: center;
		width: 8rem;
		height: 8rem;
		border-radius: 50%;
		color: var(--ramp-white);
		translate: -50% -50%;
		transition: background-color var(--duration-base) var(--ease-out);
	}

	.feature__ring {
		position: absolute;
		inset: 0;
		width: 100%;
		height: 100%;
		overflow: visible;
	}

	/* Two short gaps in the ring, like a seal: it turns slowly while in view. */
	.feature__ring circle {
		fill: none;
		stroke: currentColor;
		stroke-width: 1.5;
		vector-effect: non-scaling-stroke;
		stroke-dasharray: 47 3;
	}

	@media (prefers-reduced-motion: no-preference) {
		.feature__ring {
			animation: feature-turn 24s linear infinite;
		}

		.feature__play:hover .feature__ring {
			animation-duration: 8s;
		}
	}

	@keyframes feature-turn {
		to { rotate: 1turn; }
	}

	.feature__play-icon {
		width: var(--space-5);
		height: var(--space-6);
		margin-left: var(--space-1);
		background: currentColor;
		mask: var(--icon-play) center / contain no-repeat;
	}

	.feature__play:is(:hover, :focus-visible) {
		background: rgb(255 255 255 / 0.08);
	}

	.feature__play:focus-visible {
		outline-color: var(--ramp-white);
		outline-offset: var(--space-2);
	}

	.feature .video__frame {
		position: absolute;
		inset: 0;
		z-index: 2;
		width: 100%;
		height: 100%;
		border: 0;
	}

	/* ---- Panel ---------------------------------------------------------- */
	.feature__panel {
		position: relative;
		padding: var(--space-10) var(--space-8);
	}

	.feature__frame {
		inset: var(--space-4) var(--space-4) var(--space-4) var(--space-20);
		--frame-color: color-mix(in srgb, var(--ramp-gold-300) 70%, transparent);
	}

	.feature__eyebrow {
		margin-bottom: var(--space-3);
	}

	.feature__title {
		max-width: 16em;
		font-size: var(--type-h3-size);
		line-height: var(--type-h3-line);
	}

	.feature__link {
		margin-top: var(--space-6);
		color: var(--ramp-gold-300);
		font-weight: 600;
	}

	.feature__caption {
		max-width: none;
		padding-top: var(--space-3);
	}


	@media (min-width: 48rem) {
		.feature__stage {
			height: 30rem;
		}

		.feature__play {
			width: 10rem;
			height: 10rem;
		}
	}

	@media (min-width: 64rem) {
		.feature__stage {
			height: 40rem;
		}

		.feature__panel {
			grid-row: 1;
			align-self: end;
			justify-self: start;
			z-index: 1;
			width: min(30rem, 36%);
			padding: var(--space-12) var(--space-12) var(--space-10);
		}

		.feature__caption {
			grid-row: 2;
			text-align: right;
		}

		/* The panel lies over the film: it steps back (and out of the tab order) while it plays. */
		.video__player--loaded ~ .feature__panel {
			opacity: 0;
			visibility: hidden;
			transition:
				opacity var(--duration-base) var(--ease-out),
				visibility 0s var(--duration-base);
		}

		.feature__play {
			width: 12.5rem;
			height: 12.5rem;
		}
	}

	@media (min-width: 80rem) {
		.feature__stage {
			height: 44rem;
		}
	}
}
