/**
 * The promotion block.
 *
 * Mobile first. The default is the phone layout: picture on top, copy beneath,
 * button full width and comfortably tappable. The two-column arrangement is
 * added only once there is room for it, so a narrow screen never inherits a
 * layout designed for a wide one.
 */

/*
 * The unit is the frame. Everything the reader sees sits inside .vads-box,
 * and the few pixels of padding between the two are where the colour runs, so
 * the promotion is wrapped on all four sides rather than trimmed on one.
 */
.vads-unit {
	--vads-accent: #f04f55;
	--vads-frame: 5px;
	position: relative;
	display: block;
	margin: 2.2rem 0;
	padding: var(--vads-frame);
	border: 0;
	border-radius: 14px;
	background: #e6e1df;
	overflow: hidden;
	box-shadow: 0 1px 2px rgba(20, 15, 18, .04);
	clear: both;
	isolation: isolate;
}

/*
 * The colour itself: a cone of it centred on the promotion, filling the frame
 * exactly, with the angle it starts from turning all the way round.
 *
 * Turning the angle rather than spinning an oversized square is deliberate.
 * A spinning square has to be at least as wide as the block's diagonal or its
 * corners fall outside the colour, and a tall narrow promotion on a phone is
 * exactly where that goes wrong. This covers whatever shape it is given.
 */
@property --vads-angle {
	syntax: "<angle>";
	initial-value: 0deg;
	inherits: false;
}

.vads-ring {
	--vads-angle: 0deg;
	position: absolute;
	top: 0;
	right: 0;
	bottom: 0;
	left: 0;
	z-index: 0;
	background: conic-gradient(from var(--vads-angle), #ff2d2d, #ffd21e, #12c46a, #2f6bff, #a53bff, #ff2d2d);
	animation: vads-turn 4s linear infinite;
	pointer-events: none;
}

/*
 * Where a browser cannot register the angle as a real angle it cannot tween
 * it either, and steps from 0 to 360 instead. Those two are the same picture,
 * so what that reader sees is a still ring of colour rather than a stutter.
 */
@keyframes vads-turn {
	to { --vads-angle: 360deg; }
}

/* The promotion, sitting inside the frame. */
.vads-box {
	position: relative;
	z-index: 1;
	border-radius: 9px;
	background: #fff;
	overflow: hidden;
}

/*
 * A reader who has asked their device for less motion gets the frame standing
 * still. It is still a full ring of colour, it simply does not turn.
 */
@media (prefers-reduced-motion: reduce) {
	.vads-ring { animation: none; }
}

/* Older browsers without conic-gradient get a plain frame rather than a grey square. */
@supports not (background: conic-gradient(red, blue)) {
	.vads-ring { display: none; }
	.vads-unit { padding: 1px; background: #e6e1df; }
}

.vads-label {
	margin: 0 !important;
	padding: .55rem 1.05rem .5rem;
	background: #faf7f6;
	border-bottom: 1px solid #efeae8;
	font-size: .68rem !important;
	line-height: 1.3;
	letter-spacing: .13em;
	text-transform: uppercase;
	color: #8b817e;
}

.vads-inner { display: block; }

/*
 * The media takes its height from the media. No fixed box, no cropping: a
 * picture is shown at its own proportions and the block grows to hold it.
 * The width and height WordPress writes on the image reserve that space
 * before it loads, so the article does not jump when it arrives.
 */
.vads-media {
	position: relative;
	width: 100%;
	overflow: hidden;
	background: #1c2733;
	line-height: 0;
}

.vads-media .vads-img {
	width: 100%;
	height: auto;
	display: block;
	margin: 0;
	border-radius: 0;
	transition: transform .5s ease;
}

.vads-unit:hover .vads-media .vads-img { transform: scale(1.035); }

.vads-copy { padding: 1.15rem 1.05rem 1.2rem; }

.vads-headline {
	margin: 0 0 .45rem !important;
	font-size: 1.14rem !important;
	font-weight: 600;
	line-height: 1.32;
	letter-spacing: -.008em;
	color: #22282f;
	text-wrap: balance;
}

.vads-body {
	margin: 0 0 1rem !important;
	font-size: .95rem !important;
	line-height: 1.6;
	color: #575e66;
}

.vads-cta {
	display: flex;
	align-items: center;
	justify-content: center;
	width: 100%;
	min-height: 48px;
	padding: .8rem 1.4rem;
	border-radius: 6px;
	background: var(--vads-accent);
	color: #fff !important;
	font-size: .95rem;
	font-weight: 600;
	line-height: 1.2;
	text-align: center;
	text-decoration: none !important;
	box-shadow: none;
	transition: background .2s ease, transform .2s ease;
}

.vads-cta:hover,
.vads-cta:focus { background: #1f2937; color: #fff !important; transform: translateY(-1px); }
.vads-cta:focus-visible { outline: 3px solid var(--vads-accent); outline-offset: 3px; }
.vads-cta:active { transform: translateY(0); }

/* Text-only promotions sit tighter, with a rule doing the work the picture would. */
.vads-text-only .vads-copy { border-left: 3px solid var(--vads-accent); }

/* From tablet width there is room for the picture beside the copy. */
@media (min-width: 620px) {
	.vads-inner { display: flex; align-items: flex-start; }
	.vads-media { width: 40%; flex: 0 0 40%; align-self: stretch; }
	.vads-copy { flex: 1; padding: 1.35rem 1.5rem; display: flex; flex-direction: column; align-self: stretch; }
	.vads-headline { font-size: 1.24rem !important; }
	.vads-body { flex: 1; }
	.vads-cta { width: auto; align-self: flex-start; min-width: 12rem; }
	.vads-text-only .vads-copy { padding-left: 1.35rem; }
}

/* Very small phones: reclaim the horizontal padding. */
@media (max-width: 360px) {
	.vads-label { padding-left: .85rem; padding-right: .85rem; }
	.vads-copy { padding: 1rem .85rem 1.05rem; }
	.vads-headline { font-size: 1.06rem !important; }
}

@media (prefers-reduced-motion: reduce) {
	.vads-unit *, .vads-cta { transition: none !important; }
	.vads-unit:hover .vads-media .vads-img { transform: none; }
}

@media print {
	.vads-unit { display: none; }
}

/* The media paints above anything sitting behind it. */
.vads-media .vads-img,
.vads-banner .vads-b-img,
.vads-video .vads-v,
.vads-video .vads-frame,
.vads-blank {
	position: relative;
	z-index: 1;
}

/* The play button stays on top of both. */
.vads-play { z-index: 2; }

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

/*
 * A banner is finished artwork. It is shown whole, at its own shape, and the
 * whole of it is the link. Nothing is drawn over it and nothing crops it: the
 * words are inside the picture, and anything that trims an edge or slides the
 * image under a hover effect takes some of them away.
 */
.vads-unit-banner { line-height: 0; }

.vads-banner {
	position: relative;
	display: block;
	width: 100%;
	text-decoration: none !important;
	box-shadow: none !important;
	background: #f4f2f1;
}

.vads-banner .vads-b-img {
	display: block;
	width: 100%;
	height: auto;
	margin: 0;
	border: 0;
	border-radius: 0;
	aspect-ratio: var(--vads-b, 16 / 9);
	object-fit: contain;
	transform: none !important;
}

.vads-banner:focus-visible {
	outline: 3px solid var(--vads-accent);
	outline-offset: -3px;
}

/* The phone artwork has its own shape, so the reserved space changes with it. */
@media (max-width: 619px) {
	.vads-has-phone .vads-banner .vads-b-img { aspect-ratio: var(--vads-bp, var(--vads-b, 16 / 9)); }
}

.vads-unit-banner { transition: box-shadow .2s ease; }
.vads-unit-banner:hover { box-shadow: 0 3px 12px rgba(20, 15, 18, .1); }

@media (prefers-reduced-motion: reduce) {
	.vads-unit-banner { transition: none; }
	.vads-unit-banner:hover { box-shadow: 0 1px 2px rgba(20, 15, 18, .04); }
}

/* ---------- video ---------- */

/*
 * A video reserves its own shape, taken from the file's real pixel dimensions
 * where the media library knows them and 16:9 otherwise. The still frame, the
 * player and the embed all fill that same shape, so nothing shifts at the
 * moment a reader presses play.
 */
.vads-video {
	position: relative;
	width: 100%;
	aspect-ratio: var(--vads-ratio, 16 / 9);
	cursor: pointer;
	background: #12181f;
}

.vads-video .vads-img,
.vads-video .vads-v,
.vads-video .vads-frame {
	position: absolute;
	top: 0;
	left: 0;
	width: 100%;
	height: 100%;
	display: block;
	margin: 0;
	border: 0;
	object-fit: contain;
	background: #12181f;
}

.vads-video .vads-v[hidden] { display: none; }
.vads-video.is-playing { cursor: default; }
.vads-video.is-playing .vads-img { display: none; }

.vads-blank {
	position: absolute;
	top: 0; left: 0; right: 0; bottom: 0;
	background: linear-gradient(135deg, #1c2733 0%, #2b3a49 100%);
}

/* Older browsers without aspect-ratio fall back to a sensible box. */
@supports not (aspect-ratio: 16 / 9) {
	.vads-video { height: 0; padding-top: 56.25%; }
}

.vads-play {
	position: absolute;
	top: 50%;
	left: 50%;
	transform: translate(-50%, -50%);
	width: 62px;
	height: 62px;
	padding: 0;
	border: 0;
	border-radius: 50%;
	background: rgba(12, 16, 22, .62);
	box-shadow: 0 2px 14px rgba(0, 0, 0, .35);
	cursor: pointer;
	transition: background .2s ease, transform .2s ease;
}

.vads-video:hover .vads-play { background: var(--vads-accent); transform: translate(-50%, -50%) scale(1.06); }
.vads-play:focus-visible { outline: 3px solid #fff; outline-offset: 3px; }

.vads-play-tri {
	position: absolute;
	top: 50%;
	left: 50%;
	width: 0;
	height: 0;
	margin: -11px 0 0 -7px;
	border-style: solid;
	border-width: 11px 0 11px 18px;
	border-color: transparent transparent transparent #fff;
}

/* The autoplaying kind carries no button and never asks for a tap. */
.vads-video-auto { cursor: default; }

@media (prefers-reduced-motion: reduce) {
	.vads-play { transition: none; }
	.vads-video:hover .vads-play { transform: translate(-50%, -50%); }
}
