/* Videos page. Tokens only. Card look follows the home page cards (front-page.css, "cards"). */

/* Full width: the GeneratePress page box is set back so .ft-container (1280) rules. */
body.ft-videos-page {
	background: var(--surface-page);
}

body.ft-videos-page .site.grid-container,
body.ft-videos-page .site-content,
body.ft-videos-page .grid-container {
	max-width: none;
}

body.ft-videos-page .site-content {
	display: block;
}

body.ft-videos-page #page,
body.ft-videos-page .site {
	background: transparent;
}

.ft-videos {
	--ft-vid-header: 147px; /* the sticky header's height (header.css): 147 wide, 71 at <=1000, 63 at <=680 */
	--ft-vid-adminbar: 0px;
	display: block;
	width: 100%;
	padding-bottom: var(--space-8);
	font-family: var(--font-body);
	color: var(--text-strong);
}

/* WordPress admin bar (logged-in staff): 32px; 46px up to 782px; not fixed under 600px (header.css). */
.admin-bar .ft-videos {
	--ft-vid-adminbar: 32px;
}

@media (max-width: 1000px) {
	.ft-videos {
		--ft-vid-header: 71px;
	}
}

@media (max-width: 782px) {
	.admin-bar .ft-videos {
		--ft-vid-adminbar: 46px;
	}
}

@media (max-width: 680px) {
	.ft-videos {
		--ft-vid-header: 63px;
	}
}

@media (max-width: 600px) {
	.admin-bar .ft-videos {
		--ft-vid-adminbar: 0px;
	}
}

.ft-videos .ft-vid-h {
	margin: var(--space-6) 0 var(--space-2);
	font-size: 34px;
	line-height: 1.1;
	font-weight: 800;
	text-transform: uppercase;
	color: var(--text-strong);
}

.ft-videos .ft-vid-bar {
	display: block;
	width: 44px;
	height: 3px;
	background: var(--brass-400);
}

/* Group buttons. */
.ft-videos .ft-vid-jump {
	display: flex;
	flex-wrap: wrap;
	gap: 10px;
	margin: 22px 0 var(--space-6);
}

.ft-videos a.ft-vid-jumpbtn {
	display: inline-block;
	padding: 12px 14px;
	background: var(--surface-card);
	border: 1px solid var(--border-hairline);
	border-radius: var(--radius-md);
	font-size: 15px;
	line-height: 1.2;
	font-weight: 600;
	color: var(--text-strong);
	text-decoration: none;
	transition: border-color .16s ease-out, box-shadow .16s ease-out;
}

.ft-videos a.ft-vid-jumpbtn:hover,
.ft-videos a.ft-vid-jumpbtn:focus-visible {
	border-color: var(--brass-400);
	color: var(--text-strong);
	text-decoration: none;
}

.ft-videos a.ft-vid-jumpbtn:focus-visible {
	outline: none;
	box-shadow: var(--ring);
}

/* Groups. */
.ft-videos .ft-vid-group {
	margin-bottom: var(--space-8);
	/* A group button lands the group's heading below the sticky header, not under it. */
	scroll-margin-top: calc(var(--ft-vid-header) + var(--ft-vid-adminbar) + var(--space-5));
}

.ft-videos .ft-vid-ghead {
	display: flex;
	flex-wrap: wrap;
	align-items: baseline;
	gap: var(--space-3);
	margin-bottom: var(--space-3);
	padding-bottom: var(--space-2);
	border-bottom: 1px solid var(--border-hairline);
}

.ft-videos .ft-vid-gname {
	margin: 0;
	font-size: 22px;
	line-height: 1.2;
	font-weight: 700;
	color: var(--text-strong);
}

.ft-videos .ft-vid-gcount {
	font-size: 15px;
	font-weight: 600;
	color: var(--brass-700);
}

.ft-videos .ft-vid-grid {
	display: grid;
	grid-template-columns: repeat(4, minmax(0, 1fr));
	gap: 20px;
}

/* Card. */
.ft-videos a.ft-vid {
	position: relative;
	display: flex;
	flex-direction: column;
	container-type: inline-size; /* at least square like the home cards (title min-height below); a long title grows the row */
	background: var(--surface-card);
	border: 1px solid var(--border-hairline);
	border-radius: 5px;
	overflow: hidden;
	color: var(--text-strong);
	text-decoration: none;
	transition: transform .16s ease-out, box-shadow .16s ease-out, border-color .16s ease-out;
}

.ft-videos a.ft-vid:hover,
.ft-videos a.ft-vid:focus-visible {
	transform: translateY(-2px);
	box-shadow: var(--shadow-md);
	border-color: var(--brass-400);
	color: var(--text-strong);
	text-decoration: none;
}

.ft-videos a.ft-vid:focus-visible {
	outline: none;
	box-shadow: var(--shadow-md), var(--ring);
}

.ft-videos a.ft-vid:active {
	transform: translateY(0);
}

.ft-videos .ft-vid-pic {
	position: relative;
	display: block;
	flex-shrink: 0; /* a long title must not squeeze the picture */
	aspect-ratio: 16 / 9;
	overflow: hidden;
	background: var(--espresso-900);
}

.ft-videos .ft-vid-pic img {
	position: absolute;
	inset: 0;
	display: block;
	width: 100%;
	height: 100%;
	max-width: none;
	object-fit: cover;
	transition: transform .2s ease-out;
}

.ft-videos a.ft-vid:hover .ft-vid-pic img,
.ft-videos a.ft-vid:focus-visible .ft-vid-pic img {
	transform: scale(1.04);
}

.ft-videos .ft-vid-len {
	position: absolute;
	right: 8px;
	bottom: 8px;
	padding: 2px 7px;
	background: color-mix(in srgb, var(--espresso-950) 85%, transparent);
	border-radius: var(--radius-md);
	font-size: 14px;
	line-height: 1.3;
	font-weight: 700;
	color: var(--white);
}

.ft-videos .ft-vid-title {
	display: -webkit-box;
	-webkit-box-orient: vertical;
	-webkit-line-clamp: 4;
	line-clamp: 4;
	overflow: hidden;
	box-sizing: border-box;
	min-height: 43.75cqw; /* picture (56.25% of the width) + this = a square card */
	padding: 14px 14px var(--space-5);
	font-size: 16px;
	line-height: 1.25;
	font-weight: 700;
	color: var(--text-strong);
}

.ft-videos .ft-vid-bar2 {
	position: absolute;
	left: 0;
	right: 0;
	bottom: 0;
	height: 3px;
	background: var(--brass-400);
	transform: scaleX(0);
	transform-origin: left center;
	transition: transform .2s ease-out;
}

.ft-videos a.ft-vid:hover .ft-vid-bar2,
.ft-videos a.ft-vid:focus-visible .ft-vid-bar2 {
	transform: scaleX(1);
}

/* Player window (native dialog, opened with showModal). Built by videos.js. */
.ft-videos dialog.ft-vid-dialog {
	position: fixed;
	inset: 0;
	margin: auto;
	padding: 0;
	border: 0;
	width: min(1040px, calc(100% - 64px));
	max-width: none;
	height: fit-content;
	max-height: calc(100vh - 24px);
	box-sizing: border-box;
	background: var(--espresso-900);
	color: var(--text-on-inverse);
	font-family: var(--font-body);
	border-radius: 8px;
	overflow: visible;
	box-shadow: 0 16px 40px color-mix(in srgb, var(--espresso-800) 45%, transparent);
}

.ft-videos dialog.ft-vid-dialog::backdrop {
	background: color-mix(in srgb, var(--espresso-900) 62%, transparent);
}

.ft-videos .ft-vid-frame {
	position: relative;
	aspect-ratio: 16 / 9;
	background: var(--espresso-950);
	border-radius: 8px 8px 0 0;
	overflow: hidden;
}

.ft-videos .ft-vid-frame iframe {
	position: absolute;
	inset: 0;
	width: 100%;
	height: 100%;
	border: 0;
	display: block;
}

.ft-videos .ft-vid-cap {
	margin: 0;
	padding: 14px 18px 16px;
	font-size: 18px;
	line-height: 1.3;
	font-weight: 700;
	color: var(--text-on-inverse);
}

.ft-videos dialog.ft-vid-dialog button.ft-vid-x,
.ft-videos dialog.ft-vid-dialog button.ft-vid-x:focus,
.ft-videos dialog.ft-vid-dialog button.ft-vid-x:active {
	position: absolute;
	top: -23px;
	right: -23px;
	z-index: 1;
	width: 46px;
	height: 46px;
	margin: 0;
	padding: 0;
	border: 2px solid var(--espresso-900);
	border-radius: 50%;
	background: var(--brass-400);
	color: var(--espresso-900);
	box-shadow: 0 0 0 2px var(--white);
	display: flex;
	align-items: center;
	justify-content: center;
	cursor: pointer;
	outline: none;
}

.ft-videos dialog.ft-vid-dialog button.ft-vid-x:hover {
	background: var(--brass-600);
	color: var(--espresso-900);
}

.ft-videos dialog.ft-vid-dialog button.ft-vid-x:focus-visible {
	box-shadow: var(--ring);
}

@media (prefers-reduced-motion: reduce) {
	.ft-videos a.ft-vid,
	.ft-videos .ft-vid-pic img,
	.ft-videos .ft-vid-bar2,
	.ft-videos a.ft-vid-jumpbtn {
		transition: none;
	}

	.ft-videos a.ft-vid:hover,
	.ft-videos a.ft-vid:hover .ft-vid-pic img {
		transform: none;
	}
}

/* Feature pair (first group): two big promo films, brass line under them, then "How-to videos". */
.ft-videos .ft-vid-group--feature {
	margin: 8px 0 28px;
	padding-bottom: 32px;
	border-bottom: 3px solid var(--brass-500);
}

.ft-videos .ft-vid-group--feature .ft-vid-ghead {
	margin: 0 0 18px;
	padding: 0;
	border: 0;
}

.ft-videos .ft-vid-group--feature .ft-vid-gname {
	font-size: 28px;
}

.ft-videos .ft-vid-group--feature .ft-vid-grid {
	grid-template-columns: repeat(2, minmax(0, 1fr));
	gap: 28px;
}

.ft-videos .ft-vid-group--feature .ft-vid-title {
	min-height: 0;
}

.ft-videos .ft-vid-group--feature .ft-vid-title {
	font-size: 20px;
}

.ft-videos .ft-vid-play {
	position: absolute;
	left: 50%;
	top: 50%;
	width: 76px;
	height: 76px;
	margin: -38px 0 0 -38px;
	border: 3px solid var(--brass-500);
	border-radius: 50%;
	background: color-mix(in srgb, var(--espresso-950) 75%, transparent);
}

.ft-videos .ft-vid-play::after {
	content: "";
	position: absolute;
	left: 29px;
	top: 21px;
	border-left: 24px solid var(--white);
	border-top: 14px solid transparent;
	border-bottom: 14px solid transparent;
}

.ft-videos .ft-vid-howto {
	margin: 0 0 14px;
	font-size: 22px;
	font-weight: 700;
}

/* Same first two break points as the home page grid; one across on a phone. */
@media (max-width: 1000px) {
	.ft-videos .ft-vid-grid {
		grid-template-columns: repeat(3, minmax(0, 1fr));
	}
}

@media (max-width: 700px) {
	.ft-videos .ft-vid-grid {
		grid-template-columns: repeat(2, minmax(0, 1fr));
		gap: 12px;
	}

	.ft-videos .ft-vid-group--feature .ft-vid-grid {
		grid-template-columns: minmax(0, 1fr);
		gap: 20px;
	}

	.ft-videos .ft-vid-group--feature .ft-vid-gname {
		font-size: 24px;
	}
}

@media (max-width: 480px) {
	.ft-videos .ft-vid-grid {
		grid-template-columns: minmax(0, 1fr);
		gap: 16px;
	}

	/* One across: a square card would be mostly empty. */
	.ft-videos .ft-vid-title {
		min-height: 0;
	}

	.ft-videos .ft-vid-h {
		font-size: 30px;
	}

	.ft-videos dialog.ft-vid-dialog {
		width: 100%;
		border-radius: 0;
	}

	.ft-videos .ft-vid-frame {
		border-radius: 0;
	}

	.ft-videos dialog.ft-vid-dialog button.ft-vid-x,
	.ft-videos dialog.ft-vid-dialog button.ft-vid-x:focus,
	.ft-videos dialog.ft-vid-dialog button.ft-vid-x:active {
		top: -52px;
		right: 8px;
	}
}
