/**
 * Five Villages Film Festival – front-end and editor styles.
 *
 * Colours, fonts and spacing come from theme.json tokens (var(--wp--preset--*)
 * and var(--wp--custom--*)). Change branding there, not here.
 */

/* ---------- Accessibility ---------- */

:where(a, button, input, select, textarea, summary, [tabindex]):focus-visible {
	outline: var(--wp--custom--focus--width) solid var(--wp--custom--focus--color);
	outline-offset: var(--wp--custom--focus--offset);
	border-radius: 2px;
}

.has-night-background-color :where(a, button, input, select, textarea):focus-visible,
.has-night-soft-background-color :where(a, button, input, select, textarea):focus-visible,
.wp-block-cover :where(a, button):focus-visible {
	outline-color: var(--wp--custom--focus--color-on-dark);
}

/* Core prints the skip link; make it obvious when it receives focus. */
.skip-link.screen-reader-text:focus {
	background: var(--wp--preset--color--marquee);
	color: var(--wp--preset--color--ink);
	font-weight: 700;
	padding: 0.75rem 1.25rem;
	z-index: 100000;
}

.screen-reader-text:not(:focus) {
	border: 0;
	clip-path: inset(50%);
	height: 1px;
	margin: -1px;
	overflow: hidden;
	padding: 0;
	position: absolute;
	width: 1px;
	word-wrap: normal !important;
}

@media (prefers-reduced-motion: reduce) {
	*,
	*::before,
	*::after {
		scroll-behavior: auto !important;
		transition: none !important;
	}
}

/* ---------- Header and footer ---------- */

/* The header, main and footer sit flush; <main> provides its own padding. */
.wp-site-blocks > main,
.wp-site-blocks > footer {
	margin-block-start: 0;
}

/* Full-width coloured bands stack without a strip of page colour between them. */
:where(.wp-block-post-content) > .alignfull + .alignfull {
	margin-block-start: 0;
}

.fvff-header .wp-block-navigation__responsive-container.is-menu-open {
	background-color: var(--wp--preset--color--night);
	color: var(--wp--preset--color--on-night);
}

.fvff-header .wp-block-navigation a:where(:not(.wp-element-button)),
.fvff-footer a:where(:not(.wp-element-button)) {
	color: var(--wp--preset--color--on-night);
}

.fvff-header .wp-block-navigation a:where(:not(.wp-element-button)):hover,
.fvff-footer a:where(:not(.wp-element-button)):hover {
	color: var(--wp--preset--color--marquee);
}

.fvff-header .wp-block-navigation .current-menu-item > a {
	text-decoration: underline;
	text-decoration-color: var(--wp--preset--color--marquee);
	text-decoration-thickness: 3px;
	text-underline-offset: 0.4em;
}

.fvff-footer-list {
	list-style: none;
	margin: 0;
	padding: 0;
}

.fvff-footer-list li + li {
	margin-top: 0.35rem;
}

/* ---------- Cards and grids ---------- */

.fvff-grid {
	display: grid;
	gap: var(--wp--preset--spacing--40);
	grid-template-columns: repeat(auto-fill, minmax(min(100%, 16rem), 1fr));
	list-style: none;
	margin: 0;
	padding: 0;
}

.fvff-card {
	background: var(--wp--preset--color--paper);
	border: 1px solid var(--wp--preset--color--border);
	border-radius: var(--wp--custom--radius--medium);
	box-shadow: var(--wp--custom--shadow--card);
	display: flex;
	flex-direction: column;
	overflow: hidden;
	position: relative;
}

.fvff-card__media {
	aspect-ratio: 2 / 3;
	background: var(--wp--preset--gradient--projector);
	margin: 0;
	overflow: hidden;
}

.fvff-card--venue .fvff-card__media {
	aspect-ratio: 8 / 5;
}

.fvff-card__media img {
	display: block;
	height: 100%;
	object-fit: cover;
	width: 100%;
}

.fvff-card__body {
	display: flex;
	flex: 1;
	flex-direction: column;
	gap: 0.5rem;
	padding: var(--wp--preset--spacing--30) var(--wp--preset--spacing--30) var(--wp--preset--spacing--40);
}

.fvff-card__title {
	font-size: var(--wp--preset--font-size--large);
	margin: 0;
}

.fvff-card__title a {
	color: inherit;
	text-decoration: none;
}

/* Whole card is clickable via the title link, without nesting links. */
.fvff-card__title a::after {
	content: "";
	inset: 0;
	position: absolute;
}

.fvff-card__title a:hover {
	text-decoration: underline;
}

.fvff-card__meta {
	color: var(--wp--preset--color--muted);
	font-size: var(--wp--preset--font-size--small);
	margin: 0;
}

.fvff-card__meta strong {
	color: var(--wp--preset--color--ink);
}

.fvff-card__actions {
	margin-top: auto;
	padding-top: 0.5rem;
	position: relative; /* Sits above the stretched title link. */
	z-index: 1;
}

.fvff-card__actions .wp-element-button {
	display: inline-block;
}

/* Placeholder poster for screenings without an image. */
.fvff-poster-placeholder {
	align-items: center;
	color: var(--wp--preset--color--on-night);
	display: flex;
	flex-direction: column;
	font-family: var(--wp--preset--font-family--display);
	height: 100%;
	justify-content: center;
	padding: var(--wp--preset--spacing--40);
	text-align: center;
}

.fvff-poster-placeholder__label {
	color: var(--wp--preset--color--marquee);
	font-family: var(--wp--preset--font-family--body);
	font-size: var(--wp--preset--font-size--small);
	font-weight: 700;
	letter-spacing: 0.08em;
	text-transform: uppercase;
}

.fvff-poster-placeholder__title {
	font-size: var(--wp--preset--font-size--x-large);
	line-height: 1.15;
}

/* Strip of venue links on the home page. */
.fvff-venue-strip {
	display: flex;
	flex-wrap: wrap;
	gap: var(--wp--preset--spacing--20);
	list-style: none;
	margin: 0;
	padding: 0;
}

.fvff-venue-strip a {
	border: 2px solid currentColor;
	border-radius: 999px;
	display: inline-block;
	font-weight: 700;
	padding: 0.55em 1.1em;
	text-decoration: none;
}

.fvff-venue-strip a:hover {
	background: var(--wp--preset--color--marquee);
	border-color: var(--wp--preset--color--marquee);
	color: var(--wp--preset--color--ink);
}

/* ---------- Labels and notices ---------- */

.fvff-badge {
	align-self: flex-start;
	background: var(--wp--preset--color--sand);
	border-radius: 999px;
	color: var(--wp--preset--color--ink);
	display: inline-block;
	font-size: var(--wp--preset--font-size--small);
	font-weight: 700;
	line-height: 1.3;
	padding: 0.2em 0.75em;
}

.fvff-badge--sample {
	background: var(--wp--preset--color--velvet);
	color: var(--wp--preset--color--paper);
}

.fvff-badge--past {
	background: var(--wp--preset--color--border);
}

.fvff-notice {
	border-left: 6px solid var(--wp--preset--color--velvet);
	background: var(--wp--preset--color--sand);
	border-radius: var(--wp--custom--radius--small);
	margin-block: var(--wp--preset--spacing--30);
	padding: var(--wp--preset--spacing--30);
}

.fvff-notice > :first-child {
	margin-top: 0;
}

.fvff-notice > :last-child {
	margin-bottom: 0;
}

.fvff-notice--success {
	border-left-color: var(--wp--preset--color--success);
}

.fvff-notice--error {
	border-left-color: var(--wp--preset--color--error);
}

.fvff-empty {
	color: var(--wp--preset--color--muted);
	font-style: italic;
}

/* ---------- Screening and venue details ---------- */

.fvff-details {
	display: grid;
	gap: 0.15rem 1.25rem;
	grid-template-columns: max-content 1fr;
	margin: 0;
}

.fvff-details dt {
	color: var(--wp--preset--color--muted);
	font-weight: 600;
}

.fvff-details dd {
	margin: 0;
}

@media (max-width: 30rem) {
	.fvff-details {
		grid-template-columns: 1fr;
	}

	.fvff-details dd {
		margin-bottom: 0.6rem;
	}
}

.fvff-venue-info h2,
.fvff-venue-info h3 {
	font-size: var(--wp--preset--font-size--large);
	margin-bottom: 0.4rem;
}

.fvff-venue-info address {
	font-style: normal;
}

.fvff-link-list {
	display: flex;
	flex-wrap: wrap;
	gap: 0.5rem 1.25rem;
	list-style: none;
	padding: 0;
}

/* ---------- Contact form ---------- */

.fvff-form {
	display: grid;
	gap: var(--wp--preset--spacing--30);
	max-width: 36rem;
}

.fvff-field label {
	display: block;
	font-weight: 700;
	margin-bottom: 0.3rem;
}

.fvff-field input,
.fvff-field textarea {
	background: var(--wp--preset--color--paper);
	border: 2px solid var(--wp--preset--color--muted);
	border-radius: var(--wp--custom--radius--small);
	box-sizing: border-box;
	color: var(--wp--preset--color--ink);
	font: inherit;
	padding: 0.65rem 0.75rem;
	width: 100%;
}

.fvff-field textarea {
	min-height: 10rem;
	resize: vertical;
}

.fvff-field [aria-invalid="true"] {
	border-color: var(--wp--preset--color--error);
}

.fvff-field__hint,
.fvff-field__error {
	display: block;
	font-size: var(--wp--preset--font-size--small);
	margin-top: 0.3rem;
}

.fvff-field__hint {
	color: var(--wp--preset--color--muted);
}

.fvff-field__error {
	color: var(--wp--preset--color--error);
	font-weight: 700;
}

/* Honeypot: hidden from people and assistive technology, visible to bots. */
.fvff-hp {
	height: 1px;
	left: -10000px;
	overflow: hidden;
	position: absolute;
	width: 1px;
}

.fvff-form button {
	border: 0;
	cursor: pointer;
	justify-self: start;
}

/* ---------- Holding page ---------- */

/* The contact form sits on a dark background here. */
.has-on-night-color .fvff-field input,
.has-on-night-color .fvff-field textarea {
	border-color: var(--wp--preset--color--on-night-muted);
}

.has-on-night-color .fvff-notice {
	color: var(--wp--preset--color--ink);
}

.has-on-night-color .fvff-notice a {
	color: var(--wp--preset--color--velvet);
}

.has-on-night-color .fvff-field__error {
	color: var(--wp--preset--color--marquee);
}
