/**
 * GHFF Film Lineup — styles for the /films/ archive and /films/{slug}/ pages.
 *
 * Colors reference the theme's own Elementor Kit custom properties
 * (--e-global-color-*, set on the <body> via the elementor-kit-# class)
 * with hardcoded fallbacks matching the live site, so this keeps tracking
 * the theme's palette automatically if it's ever tweaked in wp-admin.
 * Container width (1400px) matches the theme's --content-width.
 */

.ghff-films-page {
	--ghff-black: var(--e-global-color-primary, #000000);
	--ghff-gold: var(--e-global-color-accent, #d4af37);
	--ghff-gold-dark: #b3922a;
	--ghff-secondary: var(--e-global-color-secondary, #54595f);
	--ghff-muted: var(--e-global-color-text, #7a7a7a);
	--ghff-mint: var(--e-global-color-7422973, #e4f1e3);
	--ghff-border: #e5e5e5;

	font-family: inherit;
	color: var(--ghff-black);
	background: #fff;
	padding: 40px 0 80px;
}

.ghff-films-container {
	max-width: 1400px;
	margin: 0 auto;
	padding: 0 20px;
}

.ghff-films-title {
	font-family: "Montserrat", sans-serif;
	font-weight: 700;
	text-transform: uppercase;
	font-size: 30px;
	line-height: 1.2;
	letter-spacing: -0.5px;
	margin: 0 0 8px;
	color: var(--ghff-black);
}

/* Used on /film-block/{slug}/ (see templates/film-block.php) — the
   "Short Film Block - " lead-in stays unbolded so the block's own name
   (still bold, inherited from .ghff-films-title) is what stands out.
   !important: same fight as the buttons elsewhere in this file — the
   theme's own heading styles can otherwise force every span inside an
   <h1> back to bold regardless of this rule's normal-specificity weight. */
.ghff-films-title-prefix {
	font-weight: 400 !important;
}

.ghff-films-subtitle {
	color: var(--ghff-secondary);
	margin: 0 0 32px;
	font-size: 16px;
	line-height: 1.5;
}

/* Filters */
.ghff-films-filters {
	border: 1px solid var(--ghff-border);
	padding: 20px;
	display: flex;
	flex-direction: column;
	gap: 16px;
	margin-bottom: 24px;
}

.ghff-films-search {
	position: relative;
}

.ghff-films-search input {
	width: 100%;
	box-sizing: border-box;
	border: 1px solid #ccc;
	padding: 10px 14px;
	font-size: 14px;
	line-height: 1.4;
	font-family: inherit;
}

.ghff-films-search input:focus {
	outline: none;
	border-color: var(--ghff-gold);
}

.ghff-films-filter-row {
	display: flex;
	flex-wrap: wrap;
	align-items: flex-end;
	gap: 20px;
}

.ghff-films-filter-row label {
	display: flex;
	flex-direction: column;
	gap: 4px;
	font-size: 13px;
	line-height: 1.3;
	font-weight: 600;
	color: var(--ghff-secondary);
}

.ghff-films-filter-row select {
	border: 1px solid #ccc;
	padding: 7px 8px;
	font-size: 14px;
	line-height: 1.4;
	font-family: inherit;
	background: #fff;
}

.ghff-films-wa-toggle {
	flex-direction: row !important;
	align-items: center;
	gap: 8px !important;
	cursor: pointer;
}

.ghff-films-wa-toggle input {
	width: 16px;
	height: 16px;
	accent-color: var(--ghff-gold);
}

/* !important below: the theme's reset.css applies a hard-coded style to
   every <button> element site-wide (background/border/color/border-radius),
   which otherwise wins over these rules regardless of source order. */
.ghff-films-clear {
	background: none !important;
	border: none !important;
	border-radius: 0 !important;
	color: var(--ghff-muted) !important;
	text-decoration: underline;
	cursor: pointer;
	font-size: 13px !important;
	line-height: 1 !important;
	padding-bottom: 2px;
}

.ghff-films-clear[hidden] {
	display: none !important;
}

.ghff-films-clear:hover {
	background: none !important;
	color: var(--ghff-black) !important;
}

.ghff-films-count {
	color: var(--ghff-muted);
	font-size: 14px;
	line-height: 1.4;
	margin: 0 0 20px;
}

.ghff-films-empty {
	border: 1px dashed #ccc;
	padding: 40px;
	text-align: center;
	color: var(--ghff-muted);
}

/* Used on /film-block/{slug}/ (see templates/film-block.php) for the
   "← Back to the full film lineup" link below its grid. */
.ghff-films-footnote {
	margin: 32px 0 0;
	font-size: 14px;
	line-height: 1.5;
}

.ghff-films-footnote a {
	color: var(--ghff-gold-dark);
	font-weight: 600;
	text-decoration: none;
}

.ghff-films-footnote a:hover {
	text-decoration: underline;
}

/* Grid */
.ghff-films-grid[hidden] {
	display: none;
}

.ghff-films-grid {
	display: grid;
	grid-template-columns: repeat(5, 1fr);
	gap: 20px;
}

@media (max-width: 1200px) {
	.ghff-films-grid {
		grid-template-columns: repeat(4, 1fr);
	}
}

@media (max-width: 900px) {
	.ghff-films-grid {
		grid-template-columns: repeat(3, 1fr);
	}
}

@media (max-width: 640px) {
	.ghff-films-grid {
		grid-template-columns: repeat(2, 1fr);
	}
}

.ghff-film-card[hidden] {
	display: none;
}

.ghff-film-card {
	display: flex;
	flex-direction: column;
	border: 1px solid var(--ghff-border);
	background: #fff;
	box-shadow: 0 1px 2px rgba(0, 0, 0, 0.04);
	transition: box-shadow 0.2s ease;
}

.ghff-film-card:hover {
	box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.ghff-film-poster-link {
	display: block;
	position: relative;
	aspect-ratio: 16 / 9;
	background: #ddd;
	overflow: hidden;
}

.ghff-film-poster-link img {
	width: 100%;
	height: 100%;
	object-fit: cover;
	display: block;
	transition: transform 0.3s ease;
}

.ghff-film-card:hover .ghff-film-poster-link img {
	transform: scale(1.05);
}

.ghff-poster-fallback {
	display: flex;
	align-items: center;
	justify-content: center;
	padding: 16px;
	text-align: center;
	background: var(--ghff-black);
	color: #fff;
	font-weight: 600;
	font-size: 14px;
	line-height: 1.3;
}

.ghff-badge-wa {
	position: absolute;
	top: 8px;
	left: 8px;
	background: var(--ghff-mint);
	color: #065f46;
	font-size: 11px;
	line-height: 1;
	font-weight: 700;
	padding: 3px 8px;
	box-shadow: 0 1px 2px rgba(0, 0, 0, 0.15);
}

.ghff-film-card-body {
	padding: 12px;
	display: flex;
	flex-direction: column;
	gap: 4px;
	flex: 1;
}

.ghff-film-card-body h3 {
	font-size: 14px;
	font-weight: 600;
	margin: 0;
	line-height: 1.3;
	color: var(--ghff-black);
}

.ghff-film-card-body p {
	font-size: 12px;
	line-height: 1.4;
	color: var(--ghff-muted);
	margin: 0;
}

/* Cards stretch to equal height across a grid row (CSS grid default
   align-items: stretch); push the button to the bottom of that space so
   "View Full Details" lines up horizontally even when a longer title or
   director name wraps to more lines above it. */
.ghff-film-card-body .ghff-btn-gold {
	margin-top: auto;
}

/* !important on background/border/color/etc. below: this class is also used
   on <button> elements (e.g. .gp-add-to-planner), and the theme's reset.css
   applies a hard-coded style to every <button> site-wide that otherwise
   wins over these rules regardless of source order. */
.ghff-btn-gold {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	background: var(--ghff-gold) !important;
	border: none !important;
	border-radius: 0 !important;
	color: #fff !important;
	font-family: "Montserrat", sans-serif;
	font-weight: 700;
	text-transform: uppercase;
	font-size: 12px !important;
	line-height: 1 !important;
	letter-spacing: 0.3px;
	text-decoration: none;
	padding: 10px 14px !important;
	margin-top: 10px;
	box-shadow: 0 1px 2px rgba(0, 0, 0, 0.15);
	transition: background 0.2s ease;
	cursor: pointer;
}

.ghff-btn-gold:hover {
	background: var(--ghff-gold-dark) !important;
	color: #fff !important;
}

.ghff-btn-gold-lg {
	border-radius: 4px !important;
	padding: 12px 20px !important;
	font-size: 14px !important;
	line-height: 1 !important;
}

/* Single film page */
.ghff-film-back {
	display: inline-flex;
	align-items: center;
	gap: 6px;
	font-size: 14px;
	line-height: 1.3;
	color: var(--ghff-secondary);
	text-decoration: none;
	margin-bottom: 24px;
}

.ghff-film-back:hover {
	color: var(--ghff-black);
}

.ghff-film-detail {
	display: grid;
	grid-template-columns: minmax(0, 380px) 1fr;
	gap: 32px;
	align-items: start;
}

@media (min-width: 1024px) {
	.ghff-film-detail {
		grid-template-columns: minmax(0, 480px) 1fr;
	}
}

@media (max-width: 640px) {
	.ghff-film-detail {
		grid-template-columns: 1fr;
	}
}

.ghff-film-detail-poster {
	position: relative;
	/* Detail page uses full portrait poster artwork (detail_poster_url),
	   unlike the 16:9 grid crop used on /films/ — keep this in the
	   standard 2:3 movie-poster ratio so it isn't cropped awkwardly. */
	aspect-ratio: 2 / 3;
	border: 1px solid var(--ghff-border);
	background: #ddd;
	overflow: hidden;
}

.ghff-film-detail-poster img {
	width: 100%;
	height: 100%;
	object-fit: cover;
	display: block;
}

.ghff-film-detail-badge {
	position: absolute;
	top: 12px;
	left: 12px;
	background: var(--ghff-mint);
	color: #065f46;
	font-size: 12px;
	line-height: 1;
	font-weight: 700;
	padding: 4px 10px;
	box-shadow: 0 1px 2px rgba(0, 0, 0, 0.15);
}

.ghff-film-tags {
	display: flex;
	flex-wrap: wrap;
	gap: 8px;
	margin-bottom: 8px;
}

.ghff-tag-type {
	background: var(--ghff-black);
	color: #fff;
	font-size: 12px;
	line-height: 1;
	font-weight: 600;
	text-transform: uppercase;
	letter-spacing: 0.3px;
	padding: 4px 10px;
}

.ghff-tag-genre {
	border: 1px solid #ccc;
	color: var(--ghff-secondary);
	font-size: 12px;
	line-height: 1;
	font-weight: 500;
	padding: 4px 10px;
}

.ghff-film-detail h1 {
	font-family: "Montserrat", sans-serif;
	font-weight: 700;
	text-transform: uppercase;
	font-size: 28px;
	line-height: 1.2;
	margin: 0 0 6px;
	color: var(--ghff-black);
}

.ghff-film-director {
	display: flex;
	align-items: center;
	gap: 6px;
	color: var(--ghff-secondary);
	margin: 0 0 8px;
}

.ghff-film-block {
	color: var(--ghff-muted);
	font-size: 14px;
	line-height: 1.4;
	margin: 0 0 24px;
}

.ghff-film-block strong {
	color: var(--ghff-black);
}

/* "short film block" tooltip trigger — hover/focus shows it (desktop),
   .is-open (toggled by ghff-films.js on click/tap) covers touch devices
   that don't have a real :hover state. */
.ghff-tooltip-trigger {
	position: relative;
	display: inline-block;
	color: var(--ghff-black);
	text-decoration: underline dotted;
	text-underline-offset: 3px;
	cursor: help;
	outline: none;
}

.ghff-tooltip-bubble {
	position: absolute;
	left: 50%;
	bottom: calc(100% + 10px);
	transform: translateX(-50%) translateY(4px);
	width: 240px;
	background: var(--ghff-black);
	color: #fff;
	font-size: 12px;
	font-weight: 400;
	text-decoration: none;
	line-height: 1.5;
	text-align: left;
	padding: 10px 12px;
	border-radius: 4px;
	box-shadow: 0 4px 14px rgba(0, 0, 0, 0.25);
	opacity: 0;
	visibility: hidden;
	pointer-events: none;
	transition: opacity 0.15s ease, transform 0.15s ease;
	z-index: 20;
}

.ghff-tooltip-bubble::after {
	content: "";
	position: absolute;
	top: 100%;
	left: 50%;
	transform: translateX(-50%);
	border: 6px solid transparent;
	border-top-color: var(--ghff-black);
}

.ghff-tooltip-trigger:hover .ghff-tooltip-bubble,
.ghff-tooltip-trigger:focus .ghff-tooltip-bubble,
.ghff-tooltip-trigger.is-open .ghff-tooltip-bubble {
	opacity: 1;
	visibility: visible;
	transform: translateX(-50%) translateY(0);
}

@media (max-width: 480px) {
	.ghff-tooltip-bubble {
		left: 0;
		transform: translateX(0) translateY(4px);
		width: 200px;
	}

	.ghff-tooltip-trigger:hover .ghff-tooltip-bubble,
	.ghff-tooltip-trigger:focus .ghff-tooltip-bubble,
	.ghff-tooltip-trigger.is-open .ghff-tooltip-bubble {
		transform: translateX(0) translateY(0);
	}

	.ghff-tooltip-bubble::after {
		left: 16px;
		transform: translateX(0);
	}
}

.ghff-film-stats {
	display: grid;
	grid-template-columns: repeat(3, 1fr);
	gap: 16px;
	border: 1px solid var(--ghff-border);
	padding: 16px;
	margin-bottom: 24px;
}

.ghff-film-stats dt {
	color: var(--ghff-muted);
	font-size: 13px;
	line-height: 1.3;
	margin-bottom: 2px;
}

.ghff-film-stats dd {
	margin: 0;
	font-weight: 600;
	color: var(--ghff-black);
}

.ghff-film-section {
	margin-bottom: 24px;
}

.ghff-film-section h2 {
	font-family: "Montserrat", sans-serif;
	font-weight: 700;
	text-transform: uppercase;
	font-size: 16px;
	line-height: 1.3;
	margin: 0 0 10px;
	color: var(--ghff-black);
}

.ghff-film-summary {
	line-height: 1.6;
	color: var(--ghff-secondary);
	margin: 0;
}

.ghff-showtime-list {
	list-style: none;
	margin: 0;
	padding: 0;
	display: flex;
	flex-direction: column;
	gap: 8px;
}

.ghff-showtime-list li {
	border: 1px solid var(--ghff-border);
	padding: 12px 16px;
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 16px;
	font-size: 14px;
	line-height: 1.4;
}

.gp-add-to-planner {
	margin-left: auto;
	white-space: nowrap;
	font-size: 11px !important;
	line-height: 1 !important;
	padding: 8px 12px !important;
}

.ghff-showtime-date {
	font-weight: 700;
	color: var(--ghff-black);
}

.ghff-showtime-venue {
	color: var(--ghff-muted);
	display: flex;
	align-items: center;
	gap: 4px;
}

.ghff-showtime-badge {
	background: var(--ghff-mint);
	color: #065f46;
	font-size: 11px;
	line-height: 1;
	font-weight: 700;
	text-transform: uppercase;
	letter-spacing: 0.03em;
	padding: 4px 10px;
	border-radius: 999px;
	white-space: nowrap;
}

/* Other films in the same short-film block */
.ghff-block-siblings {
	display: grid;
	grid-template-columns: repeat(4, 1fr);
	gap: 16px;
}

@media (max-width: 640px) {
	.ghff-block-siblings {
		grid-template-columns: repeat(2, 1fr);
	}
}

.ghff-block-sibling {
	display: flex;
	flex-direction: column;
	gap: 6px;
	text-decoration: none;
}

.ghff-block-sibling-poster {
	position: relative;
	display: block;
	aspect-ratio: 16 / 9;
	background: #ddd;
	overflow: hidden;
	border: 1px solid var(--ghff-border);
	transition: box-shadow 0.2s ease;
}

.ghff-block-sibling:hover .ghff-block-sibling-poster {
	box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.ghff-block-sibling-poster img {
	width: 100%;
	height: 100%;
	object-fit: cover;
	display: block;
	transition: transform 0.3s ease;
}

.ghff-block-sibling:hover .ghff-block-sibling-poster img {
	transform: scale(1.05);
}

/* Two shapes for a missing poster here: the JS onerror handler adds
   .ghff-poster-fallback directly onto this same element, OR (no poster_url
   at all) the template nests a .ghff-poster-fallback span inside it. */
.ghff-block-sibling-poster.ghff-poster-fallback,
.ghff-block-sibling-poster .ghff-poster-fallback {
	display: flex;
	align-items: center;
	justify-content: center;
	padding: 8px;
	text-align: center;
	font-size: 11px;
	line-height: 1.2;
}

.ghff-block-sibling-title {
	font-size: 12.5px;
	font-weight: 600;
	line-height: 1.3;
	color: var(--ghff-black);
}

.ghff-block-sibling:hover .ghff-block-sibling-title {
	color: var(--ghff-gold-dark);
}

/* Preview lightbox */
.ghff-lightbox[hidden] {
	display: none;
}

.ghff-lightbox {
	position: fixed;
	inset: 0;
	z-index: 9999;
	display: flex;
	align-items: center;
	justify-content: center;
	padding: 24px;
}

.ghff-lightbox-backdrop {
	position: absolute;
	inset: 0;
	background: rgba(0, 0, 0, 0.85);
}

.ghff-lightbox-content {
	position: relative;
	width: 100%;
	max-width: 960px;
}

.ghff-lightbox-close {
	position: absolute;
	top: -40px;
	right: 0;
	background: none !important;
	border: none !important;
	border-radius: 0 !important;
	color: #fff !important;
	font-size: 32px !important;
	line-height: 1;
	cursor: pointer;
	padding: 4px 8px;
}

.ghff-lightbox-close:hover {
	color: var(--ghff-gold) !important;
}

.ghff-lightbox-frame {
	position: relative;
	width: 100%;
	aspect-ratio: 16 / 9;
	background: #000;
	box-shadow: 0 10px 40px rgba(0, 0, 0, 0.5);
}

.ghff-lightbox-frame iframe {
	position: absolute;
	inset: 0;
	width: 100%;
	height: 100%;
	border: 0;
}
