/**
 * TAG Strategies: TV + Media page (page-tv-media.php only; inc/assets.php),
 * the video grid (template-parts/sections/video-grid.php).
 *
 * Lifted from the child components/_videos-list.scss, components/_post-grid.scss
 * (+ the dream .post-grid base) and the .card-video-card rules of
 * components/02-molecules/_card.scss over the dream .card molecule
 * (css-spec child-used.css 2209-2392, 2635-2746, 5367-5410; dream-used.css
 * .card / .card-title / .card-subtitle / .post-grid). The tv dialogs,
 * layout tweaks included, are the shell's .tgs-video-dialog--tv
 * (components.css).
 *
 * @package TGS
 */

/* ==========================================================================
   Section (was section.article-loop.videos-list.post-grid#videosList)
   Inside it, .tgs-article__container stands in for the old container > row
   > column > .row > .col-md-12 stack (net 12px either side).
   ========================================================================== */

.tgs-video-grid {
	position: relative;
	padding: 5.625rem var(--tgs-gutter-sm) var(--tgs-gutter-sm);
	background-color: var(--black);
}

@media (min-width: 1024px) {
	.tgs-video-grid {
		padding-right: var(--tgs-gutter-xl);
		padding-left: var(--tgs-gutter-xl);
	}
}

@media (min-width: 1400px) {
	.tgs-video-grid {
		padding-right: var(--tgs-gutter-xxl);
		padding-left: var(--tgs-gutter-xxl);
	}
}

/* ==========================================================================
   Grid (was .video-list--grid.grid-cols-2 > .post-grid--item): one column,
   two from 768px with a 60px gutter and 60px between rows.
   ========================================================================== */

.tgs-video-grid__list {
	display: flex;
	flex-flow: row wrap;
	align-items: flex-start;
	justify-content: flex-start;
}

.tgs-video-grid__item {
	flex: 0 1 100%;
	margin-top: 1.875rem;
}

.tgs-video-grid__item:first-child {
	margin-top: 0;
}

@media (min-width: 390px) {
	.tgs-video-grid__item {
		flex: 0 0 100%;
		margin: 0;
	}
}

@media (min-width: 768px) {
	.tgs-video-grid__item {
		flex: 0 1 calc((100% - 60px) / 2);
		margin: 3.75rem 1.875rem 0;
	}

	.tgs-video-grid__item:nth-of-type(2n + 1) {
		margin-left: 0;
	}

	.tgs-video-grid__item:nth-of-type(2n) {
		margin-right: 0;
	}

	.tgs-video-grid__item:nth-of-type(-n + 2) {
		margin-top: 0;
	}
}

/* ==========================================================================
   Card (was a.card.card--linked.card-video-card.video-list--item)
   A 16:9 image box; the intro hangs below it in the 100px bottom margin.
   ========================================================================== */

.tgs-video-card {
	position: relative;
	min-width: 0;
	margin-bottom: 6.25rem;
	text-align: left;
	word-wrap: break-word;
	background-color: var(--white);
	aspect-ratio: 16 / 9;
}

.tgs-video-card__image {
	position: absolute;
	top: 0;
	left: 0;
	width: 100%;
	height: 100%;
	object-fit: cover;
	object-position: 50%;
}

/* Gradient wash on hover / focus (was .card-video-card:before). */
.tgs-video-card::before {
	position: absolute;
	top: 0;
	right: 0;
	bottom: 0;
	left: 0;
	z-index: 1;
	pointer-events: none;
	content: "";
	background: var(--octonary-primary-diagonal-down);
	opacity: 0;
	transition: opacity var(--tgs-transition);
}

.tgs-video-card:not(.tgs-video-card--inline):hover::before,
.tgs-video-card:not(.tgs-video-card--inline):focus-within::before {
	opacity: 0.5;
}

/* The control covers the image and the intro below it, as the old linked
   card (an <a>) did. */
.tgs-video-card__open {
	position: absolute;
	top: 0;
	left: 0;
	z-index: 2;
	display: block;
	width: 100%;
	height: calc(100% + 6.25rem);
	padding: 0;
	margin: 0;
	background: transparent;
	border: 0;
}

.tgs-video-card__intro {
	position: absolute;
	top: 100%;
	right: 0;
	left: 0;
	display: grid;
	grid-template-rows: auto auto;
	grid-template-columns: 1fr;
	padding: 1.25rem 0.3125rem;
}

/* Card title: the image Description, under the heading (was h4.card-title). */
.tgs-video-card__title {
	grid-row: 2;
	grid-column: 1;
	margin: 0;
	font-family: var(--tgs-font-primary);
	font-size: 1.5rem;
	font-weight: normal;
	font-style: normal;
	line-height: 1.0416666667;
	color: var(--white);
}

/* Heading: post title + Caption (was h6.card-subtitle). */
.tgs-video-card__heading {
	display: flex;
	flex-flow: row nowrap;
	grid-row: 1;
	grid-column: 1;
	justify-content: space-between;
	margin: -0.25rem 0 0.5rem;
	font-family: var(--tgs-font-primary);
	font-size: 1.5rem;
	font-weight: normal;
	font-style: normal;
	line-height: 1.0416666667;
	color: var(--white);
}

.tgs-video-card__name {
	flex: 1 1 auto;
	font-weight: 700;
}

.tgs-video-card__location {
	flex: 1 1 auto;
	text-align: right;
}

.tgs-video-card__location::before {
	content: "// ";
}
