/* ==========================================================================
   Junction Dance — theme styles
   Everything that theme.json cannot express: hover states, sticky header,
   decorative shapes, small responsive corrections.
   ========================================================================== */

html {
	scroll-behavior: smooth;
	scroll-padding-top: 6rem;
}

body {
	-webkit-font-smoothing: antialiased;
	text-rendering: optimizeLegibility;
	overflow-x: hidden;
}

::selection {
	background: var(--wp--preset--color--primary);
	color: #fff;
}

:where(a:focus-visible),
:where(button:focus-visible),
:where(.wp-block-button__link:focus-visible) {
	outline: 2px solid var(--wp--preset--color--primary-bright);
	outline-offset: 3px;
}

/* --------------------------------------------------------------- Header */

.jd-header {
	position: sticky;
	top: 0;
	z-index: 100;
	backdrop-filter: saturate(140%) blur(14px);
	background: rgba(0, 0, 0, 0.72);
	border-bottom: 1px solid rgba(255, 255, 255, 0.07);
}

.jd-header .wp-block-site-logo img {
	height: auto;
	max-height: 48px;
	width: auto;
}

.jd-header .wp-block-navigation a {
	position: relative;
	padding-block: 0.35rem;
}

.jd-header .wp-block-navigation a::after {
	content: "";
	position: absolute;
	left: 0;
	bottom: 0;
	width: 0;
	height: 2px;
	background: var(--wp--preset--color--primary-bright);
	transition: width 0.28s ease;
}

.jd-header .wp-block-navigation a:hover::after,
.jd-header .wp-block-navigation .current-menu-item a::after {
	width: 100%;
}

/* Mobile overlay menu */
.wp-block-navigation__responsive-container.is-menu-open {
	background-color: #000 !important;
	padding: 2.5rem 1.5rem;
}

.wp-block-navigation__responsive-container.is-menu-open .wp-block-navigation__responsive-container-content a {
	font-family: var(--wp--preset--font-family--display);
	font-size: 1.6rem;
	letter-spacing: 0.02em;
}

/* ----------------------------------------------------------------- Hero */

.jd-hero {
	position: relative;
	min-height: min(92vh, 900px);
	display: flex;
	align-items: flex-end;
	overflow: hidden;
}

.jd-hero .wp-block-cover__background,
.jd-hero .wp-block-cover__image-background {
	transform: scale(1.02);
}

.jd-hero__script {
	font-family: var(--wp--preset--font-family--display);
	font-weight: 600;
	font-style: italic;
	text-transform: none;
	letter-spacing: -0.01em;
	color: var(--wp--preset--color--primary-bright);
	margin-bottom: -0.35em !important;
}

.jd-hero__title {
	margin-top: 0 !important;
}

.jd-hero__meta {
	border-top: 1px solid rgba(255, 255, 255, 0.14);
	padding-top: 1.25rem;
}

/* Scroll cue */
.jd-scroll-cue {
	display: inline-flex;
	align-items: center;
	gap: 0.6rem;
	font-size: 0.75rem;
	letter-spacing: 0.22em;
	text-transform: uppercase;
	color: var(--wp--preset--color--muted);
}

.jd-scroll-cue::after {
	content: "";
	width: 46px;
	height: 1px;
	background: var(--wp--preset--color--primary-bright);
	animation: jd-slide 2.2s ease-in-out infinite;
}

@keyframes jd-slide {
	0%, 100% { transform: translateX(0); opacity: 0.4; }
	50% { transform: translateX(10px); opacity: 1; }
}

/* -------------------------------------------------------------- Devices */

/* Small uppercase label with a rule, used above section headings */
.jd-eyebrow {
	display: flex;
	align-items: center;
	gap: 0.85rem;
	font-size: 0.75rem !important;
	font-weight: 700;
	letter-spacing: 0.24em;
	text-transform: uppercase;
	color: var(--wp--preset--color--primary-bright) !important;
	margin-bottom: 1rem !important;
}

.jd-eyebrow::before {
	content: "";
	width: 34px;
	height: 2px;
	background: var(--wp--preset--color--primary);
	flex: none;
}

.has-text-align-center .jd-eyebrow,
.jd-eyebrow.has-text-align-center {
	justify-content: center;
}

/* Cards */
.jd-card {
	border: 1px solid var(--wp--preset--color--line);
	border-radius: 18px;
	transition: transform 0.35s ease, border-color 0.35s ease, box-shadow 0.35s ease;
}

/* A card keeps its own background unless the editor set one on the block. */
.jd-card:not(.has-background) {
	background: var(--wp--preset--color--surface-2);
}

.jd-card.has-background {
	border-color: transparent;
}

/* Cards in a row match heights. */
.wp-block-column > .jd-card {
	height: 100%;
}

.jd-card:hover {
	transform: translateY(-6px);
	border-color: rgba(62, 99, 214, 0.6);
	box-shadow: 0 24px 60px rgba(0, 0, 0, 0.55);
}

/* Club cards: image on top, content below */
.jd-club .wp-block-image img {
	border-radius: 16px;
	filter: grayscale(0.35) contrast(1.05);
	transition: filter 0.4s ease, transform 0.6s ease;
}

.jd-club:hover .wp-block-image img {
	filter: grayscale(0) contrast(1.05);
	transform: scale(1.03);
}

.jd-club .wp-block-image {
	overflow: hidden;
	border-radius: 16px;
	margin-bottom: 1.4rem;
}

.jd-age {
	display: inline-block;
	font-size: 0.72rem;
	font-weight: 700;
	letter-spacing: 0.18em;
	text-transform: uppercase;
	color: #fff;
	background: var(--wp--preset--color--primary);
	border-radius: 999px;
	padding: 0.4rem 0.9rem;
}

/* --------------------------------------------------- Hover-to-play media */

/* Wrap a <video> in .jd-hover-video: it shows its poster and plays on hover. */
.jd-hover-video {
	position: relative;
	display: block;
	overflow: hidden;
	border-radius: 16px;
	aspect-ratio: 3 / 4;
	background: var(--wp--preset--color--surface-2);
	cursor: pointer;
}

.jd-hover-video video,
.jd-hover-video img {
	position: absolute;
	inset: 0;
	width: 100%;
	height: 100%;
	object-fit: cover;
	filter: grayscale(0.35) contrast(1.05);
	transition: filter 0.4s ease, transform 0.6s ease;
}

.jd-hover-video:hover video,
.jd-hover-video.is-playing video {
	filter: grayscale(0) contrast(1.05);
	transform: scale(1.03);
}

/* Small play badge, fades out once it is running. */
.jd-hover-video::after {
	content: "▶";
	position: absolute;
	right: 14px;
	bottom: 14px;
	width: 42px;
	height: 42px;
	display: grid;
	place-items: center;
	font-size: 13px;
	color: #fff;
	background: rgba(36, 62, 144, 0.9);
	border-radius: 50%;
	transition: opacity 0.3s ease;
	pointer-events: none;
}

.jd-hover-video.is-playing::after {
	opacity: 0;
}

/* Landscape version, e.g. in the about section. */
.jd-hover-video.is-wide {
	aspect-ratio: 16 / 9;
}

/* GIF alternative: static frame, animated file on hover. No JavaScript. */
.jd-hover-gif {
	display: block;
	aspect-ratio: 3 / 4;
	border-radius: 16px;
	background-size: cover;
	background-position: center;
	background-image: var(--still);
}

.jd-hover-gif:hover,
.jd-hover-gif:focus-visible {
	background-image: var(--animated);
}

/* Blue disc behind the about image */
.jd-disc {
	position: relative;
}

.jd-disc::before {
	content: "";
	position: absolute;
	width: 62%;
	aspect-ratio: 1;
	border-radius: 50%;
	background: var(--wp--preset--color--primary);
	opacity: 0.55;
	top: -6%;
	left: -12%;
	z-index: 0;
	filter: blur(2px);
}

.jd-disc .wp-block-image {
	position: relative;
	z-index: 1;
}

.jd-disc .wp-block-image img {
	border-radius: 18px;
}

/* Stats */
.jd-stat {
	font-family: var(--wp--preset--font-family--display);
	font-weight: 700;
	line-height: 1;
	color: var(--wp--preset--color--primary-bright);
}

/* Timetable */
.jd-slot {
	display: flex;
	flex-wrap: wrap;
	gap: 0.5rem 1.5rem;
	align-items: baseline;
	justify-content: space-between;
	border-bottom: 1px solid var(--wp--preset--color--line);
	padding: 1.1rem 0;
}

.jd-slot:first-of-type {
	border-top: 1px solid var(--wp--preset--color--line);
}

.jd-slot strong {
	font-family: var(--wp--preset--font-family--display);
	text-transform: uppercase;
	letter-spacing: 0.04em;
}

.jd-slot span {
	color: var(--wp--preset--color--muted);
	font-size: 0.95rem;
}

.jd-slot em {
	font-style: normal;
	color: var(--wp--preset--color--primary-bright);
	font-weight: 600;
	letter-spacing: 0.06em;
	text-transform: uppercase;
	font-size: 0.85rem;
}

/* Price badge */
.jd-price {
	font-family: var(--wp--preset--font-family--display);
	font-weight: 700;
	line-height: 0.9;
}

/* Outline buttons on dark */
.wp-block-button.is-style-outline .wp-block-button__link {
	border: 1px solid rgba(255, 255, 255, 0.45);
	background: transparent;
	color: #fff;
	transition: background 0.3s ease, border-color 0.3s ease;
}

.wp-block-button.is-style-outline .wp-block-button__link:hover {
	background: #fff;
	border-color: #fff;
	color: #000;
}

/* Contact details list */
.jd-detail {
	display: flex;
	flex-direction: column;
	gap: 0.25rem;
	padding: 1.1rem 0;
	border-bottom: 1px solid var(--wp--preset--color--line);
}

.jd-detail b {
	font-size: 0.72rem;
	letter-spacing: 0.2em;
	text-transform: uppercase;
	color: var(--wp--preset--color--muted);
	font-weight: 700;
}

.jd-detail a,
.jd-detail span {
	font-family: var(--wp--preset--font-family--display);
	font-size: 1.15rem;
	font-weight: 600;
}

/* --------------------------------------------------------------- Footer */

.jd-footer {
	border-top: 1px solid var(--wp--preset--color--line);
}

.jd-footer .wp-block-site-logo img {
	max-height: 64px;
	width: auto;
}

.jd-footer a {
	color: var(--wp--preset--color--muted);
}

.jd-footer a:hover {
	color: #fff;
}

.jd-legal {
	color: var(--wp--preset--color--muted);
	font-size: 0.82rem;
}

/* ----------------------------------------------------------- Corrections */

.wp-block-image img {
	display: block;
	height: auto;
}

.wp-block-columns {
	align-items: stretch;
}

@media (max-width: 781px) {
	.jd-hero {
		min-height: 78vh;
	}

	/* The overlay menu carries the links; the header button would wrap. */
	.jd-header__cta {
		display: none;
	}

	.jd-disc::before {
		width: 55%;
		left: -8%;
	}

	.jd-slot {
		flex-direction: column;
		align-items: flex-start;
	}
}

@media (prefers-reduced-motion: reduce) {
	html { scroll-behavior: auto; }
	.jd-card, .jd-club .wp-block-image img, .jd-scroll-cue::after { transition: none; animation: none; }
}
