/*  ==========================================================================
Media controls (play / pause buttons, slide dots, rotator arrows)
--------------------------------------------------------------------------
Load LAST (after footer-theme.css), before the inline theme <style>.

Every colour of these controls comes from one set of variables, and every
var() fallback is the prototype's own value, so with no theme override the
controls look exactly like proto/:

  --play-ring        ring + slide-dot outline     default --color-text-light (#fff)
  --play-icon        triangle / pause bars         default --color-text-light (#fff)
  --play-fill        resting fill                  default per control (video grid rgba(0,0,0,.7),
                                                   hero play/pause transparent)
  --play-fill-hover  hover / keyboard-focus fill   default Primary (--color-primary-usfgreen)
  --play-focus       video card focus outline      default derived from Primary (#006747 -> #009374,
                                                   the prototype's teal); on dark sections the accent
                                                   (--blk-accent / --color-accent-apple), as before
  --play-ring-width  video-grid ring width         default 5px
  --play-speed       colour transition             default .25s (only with prefers-reduced-motion:
                                                   no-preference)

Any of them can be set on :root or on a block (inline style) to restyle every
control below it.

Why this file exists (the "abrupt / washed-out" icons after a theme change):
 - the hover/focus fill was the raw Primary, so a light Primary (e.g. yellow) put the
   white triangle on a pale disc -> the icons looked greyed out. The fill is now
   clamped to a dark-enough lightness (OKLCH L <= .55); #006747 (L .455) is untouched.
 - the triangle used --color-text-light but the ring was a fixed #fff.
 - the card focus outline was --color-accent-teal (Highlight role), so it stayed
   green when only Primary changed.
 - ui-components.css' reduced-motion block replaced the icon's background-color
   transition with `transition: width, height`, so every colour change snapped.
 - `:focus` (not :focus-visible) painted the fill, so a clicked card / the hero button
   stayed coloured after a mouse click while the others did not.
 - VideoGrid's inline style (border:none) removed the prototype's gold card border.
==========================================================================  */

/* Shared resolved values (private, underscore-prefixed) */
:is(.video-grid .video-grid-icon, .hero .hero__play-pause, .hero .hero__dot,
	.content .u-rotator_navigation, .content .snippetRotator_navigation) {
	--_play-ring: var(--play-ring, var(--color-text-light, #fff));
	--_play-icon: var(--play-icon, var(--color-text-light, #fff));
	--_play-fill-hover: var(--play-fill-hover, var(--color-primary-usfgreen, #006747));
}
/* A light Primary would wash out the white icon: cap the fill's lightness. */
@supports (color: oklch(from red min(l, 0.5) c h)) {
	:is(.video-grid .video-grid-icon, .hero .hero__play-pause, .hero .hero__dot,
		.content .u-rotator_navigation, .content .snippetRotator_navigation) {
		--_play-fill-hover: var(--play-fill-hover, oklch(from var(--color-primary-usfgreen, #006747) min(l, 0.55) c h));
	}
}


/*  ==========================================================================
Video grid (home "Live the Bulls Life")
==========================================================================  */
/* Button reset (was an inline style on the <button>; the prototype used an <a>).
   The image card keeps ui-components.css' gold border / shadow (:has(img) rule). */
.video-grid__item .video-grid__button {
	display: block;
	width: 100%;
	margin: 0;
	padding: 0;
	border: 0;
	background: none;
	color: inherit;
	font: inherit;
	text-align: left;
	cursor: pointer;
}

/* Card focus outline: keyboard focus only, colour from the theme */
.video-grid .video-grid__item .dialog-button {
	--_play-focus: var(--play-focus, var(--color-accent-teal, #009374));
}
@supports (color: oklch(from red min(l, 0.5) c h)) {
	.video-grid .video-grid__item .dialog-button {
		/* the prototype's teal is Primary's "glow" (same offsets as theme-patterns.css): #006747 -> #009374 */
		--_play-focus: var(--play-focus, oklch(from var(--color-primary-usfgreen, #006747) min(calc(l + 0.1357), 0.62) calc(c * 1.1848) calc(h + 7.52)));
	}
}
/* dark sections (prototype: .section--usfgreen -> apple; custom dark backgrounds -> their accent) */
:is(.section--usfgreen, .u-on-dark) .video-grid .video-grid__item .dialog-button {
	--_play-focus: var(--play-focus, var(--blk-accent, var(--color-accent-apple, #9ccb3b)));
}
.video-grid .video-grid__item .dialog-button:focus:not(:focus-visible) {
	outline: none;
}
.video-grid .video-grid__item .dialog-button:has(img):focus-visible,
.video-grid .video-grid__item .dialog-button:focus-visible {
	outline: 5px solid var(--_play-focus);
}

/* The round play button */
.video-grid .video-grid__item .dialog-button .video-grid-icon {
	background-color: var(--play-fill, rgba(0, 0, 0, 0.7));
	border: var(--play-ring-width, 5px) solid var(--_play-ring);
	color: var(--_play-icon);
	opacity: 1;
	filter: none;
	transition: none;
}
.video-grid .video-grid__item .dialog-button:is(:hover, :active, :focus-visible) .video-grid-icon {
	background-color: var(--_play-fill-hover);
}


/*  ==========================================================================
Homepage hero (HeroMedia): play/pause button + carousel dots
==========================================================================  */
.hero .hero__play-pause {
	background-color: var(--play-fill, transparent);
	border-color: var(--_play-ring);
	color: var(--_play-icon);
	transition: none;
}
.hero .hero__play-pause:is(:hover, :active, :focus-visible) {
	background-color: var(--_play-fill-hover);
}

.hero .hero__dot {
	color: var(--_play-icon);
}
.hero .hero__dot:before {
	border-color: var(--_play-ring);
	background-color: transparent;
}
.hero .hero__dot:is(:hover, :focus-visible):before {
	background-color: var(--_play-fill-hover);
}
.hero .hero__dot.is-active:before {
	background-color: var(--_play-ring);
}
.hero .hero__dot:focus-visible {
	outline-color: var(--_play-ring);
}


/*  ==========================================================================
Rotators (legacy-global.css .u-rotator_*, legacy-secondary.css .snippetRotator_*)
Resting looks are the prototype's (u-rotator: Primary 90% square, snippetRotator:
dark round); only icon colour, hover/keyboard states and the active dot are themed.
==========================================================================  */
.content .u-rotator_navigation :is(.u-rotator_prev, .u-rotator_next, .u-rotator_pause, .u-rotator_play),
.content .snippetRotator_navigation :is(.snippetRotator_prev, .snippetRotator_next) .snippetRotator_icon {
	color: var(--_play-icon);
}
/* a mouse click leaves focus on the link: don't keep the hover look */
.content .u-rotator_navigation :is(.u-rotator_prev, .u-rotator_next, .u-rotator_pause, .u-rotator_play):focus:not(:focus-visible):not(:hover) {
	background-color: color-mix(in srgb, var(--color-primary-usfgreen, #006747) 90%, transparent);
	color: var(--_play-icon);
}
.content .snippetRotator_navigation :is(.snippetRotator_prev, .snippetRotator_next):is(:hover, :focus-visible) {
	background: var(--_play-fill-hover);
}

/* React marks the current slide with aria-current (the prototype's flexslider used .flex-active) */
.content .u-rotator_controlLink[aria-current="true"] {
	background-color: #007955;
	width: 20px;
}
@media (min-width: 850px), print {
	.content .snippetRotator_controlLink[aria-current="true"] {
		background-color: #007955;
	}
}
@supports (color: oklch(from red l c h)) {
	.content .u-rotator_controlLink[aria-current="true"] {
		background-color: oklch(from var(--color-primary-usfgreen) calc(l + 0.0554) calc(c * 1.1129) calc(h + 0.57));
	}
	@media (min-width: 850px), print {
		.content .snippetRotator_controlLink[aria-current="true"] {
			background-color: oklch(from var(--color-primary-usfgreen) calc(l + 0.0554) calc(c * 1.1129) calc(h + 0.57));
		}
	}
}


/*  ==========================================================================
Motion: colour changes fade instead of snapping (layout/size transitions kept)
==========================================================================  */
@media (prefers-reduced-motion: no-preference) {
	.video-grid .video-grid__item .dialog-button .video-grid-icon {
		transition:
			background-color var(--play-speed, 0.25s) ease,
			border-color var(--play-speed, 0.25s) ease,
			color var(--play-speed, 0.25s) ease,
			width 0.3s,
			height 0.3s;
	}
	/* ui-components.css zooms the photo on :focus too; keep a mouse-clicked card like the others */
	.video-grid .video-grid__item .dialog-button:focus:not(:focus-visible):not(:hover, :active) img {
		transform: none;
	}
	.hero .hero__play-pause,
	.content .snippetRotator_navigation :is(.snippetRotator_prev, .snippetRotator_next) {
		transition:
			background-color var(--play-speed, 0.25s) ease,
			border-color var(--play-speed, 0.25s) ease,
			color var(--play-speed, 0.25s) ease;
	}
	.hero .hero__dot:before {
		transition: background-color var(--play-speed, 0.25s) ease, border-color var(--play-speed, 0.25s) ease;
	}
}
