/**
 * Show favorites
 *
 * Standalone stylesheet — deliberately outside the gulp/sass build so the
 * feature ships without rebuilding client.min.css. Follows the same pattern
 * as styles/src/client/reelz-new.css.
 *
 * Palette matches the newer work on the site: gold #F5B700 on dark.
 */


/* ----------------------------------------------------------------------
 * The heart button
 * ---------------------------------------------------------------------- */

.reelz-fav {
	-webkit-appearance: none;
	appearance: none;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	gap: 8px;
	margin: 0;
	border: 0;
	background: none;
	color: #fff;
	font: inherit;
	line-height: 1;
	cursor: pointer;
}

.reelz-fav:focus-visible {
	outline: 2px solid #F5B700;
	outline-offset: 2px;
}

.reelz-fav__icon {
	display: block;
	width: 22px;
	height: 22px;
	flex: none;

	/* Unfavorited: an outline heart. */
	fill: none;
	stroke: currentColor;
	stroke-width: 1.7;
	stroke-linejoin: round;

	transition: fill 0.15s ease, stroke 0.15s ease, transform 0.15s ease;
}

/* Favorited: the same path, filled. */
.reelz-fav.is-favorited .reelz-fav__icon {
	fill: #F5B700;
	stroke: #F5B700;
}

.reelz-fav:hover .reelz-fav__icon {
	stroke: #F5B700;
	transform: scale( 1.12 );
}


/* The pop when a show is added. */

.reelz-fav.is-animating .reelz-fav__icon {
	animation: reelz-fav-pop 0.32s ease;
}

@keyframes reelz-fav-pop {
	0%   { transform: scale( 1 ); }
	45%  { transform: scale( 1.35 ); }
	100% { transform: scale( 1 ); }
}


/* ----------------------------------------------------------------------
 * Card variant — top right of a show card
 * ---------------------------------------------------------------------- */

/*
 * The card markup only sets position on the featured grid, so establish a
 * containing block on both grids before absolutely positioning the heart.
 */
.shows-grid .shows-grid__show,
.shows-grid-all .shows-grid__show,
.shows-grid__image {
	position: relative;
}

.reelz-fav--card {
	position: absolute;
	top: 8px;
	right: 8px;
	z-index: 2;
	width: 38px;
	height: 38px;
	border-radius: 50%;

	/*
	 * Show art runs light or dark depending on the show, so the heart gets
	 * its own scrim rather than relying on the image behind it.
	 */
	background: rgba( 0, 0, 0, 0.55 );
	-webkit-backdrop-filter: blur( 2px );
	backdrop-filter: blur( 2px );
	transition: background 0.15s ease;
}

.reelz-fav--card:hover {
	background: rgba( 0, 0, 0, 0.75 );
}

.reelz-fav--card .reelz-fav__icon {
	width: 20px;
	height: 20px;
}

@media ( max-width: 540px ) {

	.reelz-fav--card {
		top: 6px;
		right: 6px;
		width: 34px;
		height: 34px;
	}

	.reelz-fav--card .reelz-fav__icon {
		width: 18px;
		height: 18px;
	}
}


/* ----------------------------------------------------------------------
 * Inline variant — the single show page
 * ---------------------------------------------------------------------- */

/*
 * Default placement: in flow under the hero, right aligned. This is what
 * mobile keeps — see the overlay block below.
 */
.reelz-fav-actions {
	display: flex;
	justify-content: flex-end;
	padding: 14px 0;
}


/*
 * Over the hero, from 768px up.
 *
 * The hero's text column is absolutely positioned at bottom: 50px, and the CTA
 * row's own parent (.slider__slide__info__text) carries margin-bottom: 16px, so
 * the WATCH buttons' bottom edge lands 66px off the bottom of the hero rather
 * than 50px. The offset is written as the sum of the two so it stays traceable
 * to the rules it depends on. Measured against the live hero, not guessed.
 *
 * right: 0 rather than 64px. The slider breaks out of the page gutter with a
 * negative margin to sit full bleed, while this wrapper stays inside it, so the
 * wrapper's right edge already sits one gutter in from the hero image. That is
 * the same inset the hero text column takes on the left, which makes the two
 * mirror each other and keeps holding if the gutter is ever retuned.
 *
 * .single-show-hero exists purely to give this a positioned parent: the button
 * cannot be printed inside the slider, which is replaced over ajax.
 */
.single-show-hero {
	position: relative;
}

@media ( min-width: 768px ) {

	.template--single-show .single-show-hero .reelz-fav-actions {
		position: absolute;
		right: 0;
		bottom: calc( 50px + 16px );

		/* Above .slider__slide__info, which sits at z-index 2. */
		z-index: 3;
		padding: 0;
	}

	/*
	 * Show art runs light or dark, so the button gets its own scrim here
	 * rather than the faint wash it uses against the page background.
	 */
	.template--single-show .single-show-hero .reelz-fav--inline {
		background: rgba( 0, 0, 0, 0.55 );
		-webkit-backdrop-filter: blur( 2px );
		backdrop-filter: blur( 2px );
	}

	.template--single-show .single-show-hero .reelz-fav--inline:hover {
		background: rgba( 0, 0, 0, 0.75 );
	}
}

.reelz-fav--inline {
	padding: 10px 20px;
	border: 1px solid rgba( 255, 255, 255, 0.35 );
	border-radius: 999px;
	background: rgba( 255, 255, 255, 0.06 );
	font-size: 15px;
	font-weight: 600;
	letter-spacing: 0.04em;
	text-transform: uppercase;
	transition: border-color 0.15s ease, background 0.15s ease, color 0.15s ease;
}

.reelz-fav--inline:hover {
	border-color: #F5B700;
	background: rgba( 245, 183, 0, 0.12 );
	color: #F5B700;
}

.reelz-fav--inline.is-favorited {
	border-color: #F5B700;
	color: #F5B700;
}


/* ----------------------------------------------------------------------
 * Schedule filter
 * ---------------------------------------------------------------------- */

.reelz-fav-filter {
	margin: 0 0 18px;
}

.reelz-fav-filter__switch {
	display: inline-flex;
	align-items: center;
	gap: 12px;
	cursor: pointer;
	-webkit-user-select: none;
	user-select: none;
}

/*
 * The checkbox stays in the accessibility tree and keeps the label, keyboard
 * and focus behaviour; the track and thumb are drawn on top of it.
 */
.reelz-fav-filter__input {
	position: absolute;
	width: 1px;
	height: 1px;
	margin: -1px;
	padding: 0;
	border: 0;
	overflow: hidden;
	clip: rect( 0 0 0 0 );
	clip-path: inset( 50% );
	white-space: nowrap;
}

.reelz-fav-filter__track {
	position: relative;
	display: block;
	width: 46px;
	height: 26px;
	flex: none;
	border-radius: 999px;
	background: rgba( 255, 255, 255, 0.22 );
	transition: background 0.18s ease;
}

.reelz-fav-filter__track::after {
	content: "";
	position: absolute;
	top: 3px;
	left: 3px;
	width: 20px;
	height: 20px;
	border-radius: 50%;
	background: #fff;
	transition: transform 0.18s ease;
}

.reelz-fav-filter__input:checked + .reelz-fav-filter__track {
	background: #F5B700;
}

.reelz-fav-filter__input:checked + .reelz-fav-filter__track::after {
	transform: translateX( 20px );
}

.reelz-fav-filter__input:focus-visible + .reelz-fav-filter__track {
	outline: 2px solid #F5B700;
	outline-offset: 2px;
}

.reelz-fav-filter__text {
	display: inline-flex;
	align-items: center;
	gap: 8px;
	color: #fff;
	font-size: 15px;
	font-weight: 600;
	letter-spacing: 0.04em;
	text-transform: uppercase;
}

/* The heart in the label is decorative — always filled, never interactive. */
.reelz-fav-filter__text .reelz-fav__icon {
	width: 17px;
	height: 17px;
	fill: #F5B700;
	stroke: #F5B700;
}

.reelz-fav-filter__empty {
	margin: 16px 0 0;
	color: #C2C2C2;
	font-size: 15px;
}

.reelz-fav-filter__empty a {
	color: #F5B700;
}


/* Rows filtered out by the toggle. */
.reelz-fav-hidden {
	display: none !important;
}


/* ----------------------------------------------------------------------
 * Favorited star — schedule rows
 * ---------------------------------------------------------------------- */

/*
 * Sits as the first inline child of .archive-event__title, which is a fixed
 * width single line with text-overflow: ellipsis. Keeping the star inline and
 * first means the show name truncates around it and the star is never the
 * part that gets clipped.
 */
.reelz-fav-star {
	margin-right: 6px;
}

/*
 * Belt and braces: any author rule that gives this span a display value would
 * otherwise beat the [hidden] attribute's user-agent style and leave the star
 * showing on every row, favorited or not.
 */
.reelz-fav-star[hidden] {
	display: none;
}

.reelz-fav-star__icon {
	display: inline-block;
	width: 14px;
	height: 14px;
	fill: #F5B700;

	/* Optically centres the star against the cap height of the show name. */
	vertical-align: -0.12em;
}

/*
 * Visually hidden but still announced. The theme has no sr-only helper of its
 * own, so the feature ships one rather than depending on a global.
 */
.reelz-fav-sr {
	position: absolute;
	width: 1px;
	height: 1px;
	margin: -1px;
	padding: 0;
	border: 0;
	overflow: hidden;
	clip: rect( 0 0 0 0 );
	clip-path: inset( 50% );
	white-space: nowrap;
}


/* ----------------------------------------------------------------------
 * Motion preferences
 * ---------------------------------------------------------------------- */

@media ( prefers-reduced-motion: reduce ) {

	.reelz-fav__icon,
	.reelz-fav-filter__track,
	.reelz-fav-filter__track::after {
		transition: none;
	}

	.reelz-fav.is-animating .reelz-fav__icon {
		animation: none;
	}

	.reelz-fav:hover .reelz-fav__icon {
		transform: none;
	}
}
