/**
 * PROM directors list. Scoped to Semplice Advanced Portfolio Grid modules (preset "Text")
 * with the class `prom-directors`.
 *
 * Semplice does the behaviour: hovering a name dims the others, fades in that director's
 * preview and plays it (touch devices get plain links). Its "Cover" image mode shows the
 * preview full screen; this file only moves it into a 16:9 frame beside the list (under it on
 * tablets), as in Figma. Fonts, colours, sizes and the dim level are module settings, not set here.
 */

/* Rows span the full width, like epochfilms.com/directors (PROM-12, dev): hovering anywhere at a name's height,
   including the right side, picks that director (Semplice's hover is on the row), and the row is the link.
   The names are short and sit on the left, clear of the preview (which starts at the middle). */
.prom-directors[data-apg-preset=text] .apg-post-text {
	width: 100%;
	max-width: none;
}
.prom-directors[data-apg-preset=text] .apg-post-text > a { display: block; flex: 1 1 auto; }
/* The names' rows sit above the preview (z-index 0, below), so at a name's height the row wins even where the shown
   preview covers it (it's level with the list since 0.13.0); below the list the preview takes the pointer. */
.prom-directors[data-apg-preset=text] .apg-post-title { width: 100%; z-index: 1; }

/* The preview itself keeps playing while the pointer is on it, and a click on it opens that director. Semplice
   shows only the hovered row's media (the others are visibility: hidden, which takes no pointer), and the media is
   inside that row's link, so the row stays hovered and the click is the row's. The frame stays pointer-transparent
   (Semplice), so the hidden frames stacked in the same place don't catch the pointer. */
.prom-directors[data-apg-preset=text] .post-thumbnail :is(img, video) {
	pointer-events: auto;
	cursor: pointer;
}

/* Underlined names (Figma). Colour comes from the module's title colour. */
.prom-directors[data-apg-preset=text] .apg-post-title .title span {
	text-decoration: underline;
	text-decoration-thickness: 0.08em;
	text-underline-offset: 0.18em;
}

/* Preview frame (Figma Directors, PROM-12): 16:9, 40% of the window wide, from the middle of the page, its top level
   with the first name. Below 992px (tablets with a mouse) it sits under the list, right-aligned, as in Figma's
   Tablet frame, and the list keeps room for it so the footer stays clear.
   Placed against the list (.apg), not the window: it was fixed and centred in the window until 0.13.0, which put it
   well below the names. Semplice's rule `[data-apg-preset=text] [data-image-mode=cover] .post-thumbnail` makes it
   full-size; this selector is one attribute more specific. Semplice animates the media inside (opacity, scale 1.1),
   never this frame. overflow:hidden (from Semplice) keeps the 1.1 zoom inside the frame. */
.prom-directors[data-apg-preset=text] .apg { position: relative; }
.prom-directors[data-apg-preset=text] :is(.apg-post-text, .apg-grid-item) { position: static; }
.prom-directors[data-apg-preset=text] [data-image-mode=cover] .post-thumbnail {
	position: absolute;
	top: 0;
	left: 50%;
	width: 40vw;
	height: auto;
	aspect-ratio: 16 / 9;
	transform: none;
	z-index: 0;
}
/* Room for it on the module, so a preview taller than a short list isn't cut off by Semplice's section (which clips
   its content) and the pointer can rest on all of it. Only where previews show (a mouse). Below 992px the room is
   under the list instead; the % is of the list's width, the same as the frame's. Semplice sets the .apg's own
   padding with an ID rule, so it's on the module. */
@media (hover: hover) {
	smp-content.prom-directors[data-apg-preset=text] { min-height: calc(40vw * 9 / 16); }
}
@media screen and (max-width: 991.98px) and (hover: hover) {
	smp-content.prom-directors[data-apg-preset=text] { min-height: 0; padding-bottom: calc(70% * 9 / 16 + 2.2222rem); }
}
@media screen and (max-width: 991.98px) {
	.prom-directors[data-apg-preset=text] [data-image-mode=cover] .post-thumbnail {
		top: calc(100% + 2.2222rem);
		left: auto;
		right: 0;
		width: 70%;
	}
}

/* Touch screens never show previews (Semplice only reacts to hover); don't lay them out. */
@media (hover: none) {
	.prom-directors[data-apg-preset=text] .post-thumbnail {
		display: none;
	}
}

/* No one-screen minimum on the list. Semplice's `[data-apg-preset="text"] .apg { min-height: 100svh }` (one class
   less) kept the footer below a short list, at the cost of a page taller than the window. The footer now sits at
   the bottom of short pages by itself (nav.css), so the page is as tall as its content. */
.prom-directors[data-apg-preset=text] .apg {
	min-height: 0;
}
