/* The JJ Mack Building — site-wide styles (header, footer, pages and the landing page sections) */

@font-face {
	font-family: 'Euclid Circular A';
	src: url('../../build/fonts/EuclidCircularA-Regular-WebS.woff2') format('woff2');
	font-weight: 400;
	font-style: normal;
	font-display: swap;
}
@font-face {
	font-family: 'Euclid Circular A';
	src: url('../../build/fonts/EuclidCircularA-Semibold-WebS.woff2') format('woff2');
	font-weight: 600;
	font-style: normal;
	font-display: swap;
}

:root {
	--jjm-orange: #d44f2b;
	--jjm-orange-light: #f2c3ae;
	--jjm-yellow: #f3b33e;
	--jjm-brown: #401a13;
	--jjm-cream: #fdf5e8;
	--jjm-white: #ffffff;
	--jjm-gutter: 24px;
}

.jjm *,
.jjm *::before,
.jjm *::after { box-sizing: border-box; }

.jjm {
	margin: 0;
	background: var(--jjm-cream);
	color: var(--jjm-brown);
	font-family: 'Euclid Circular A', 'Helvetica Neue', Arial, sans-serif;
	font-size: 17px;
	line-height: 1.65;
	-webkit-font-smoothing: antialiased;
	overflow-x: hidden;
}
/* resets kept at zero specificity so component classes always win */
:where(.jjm) img { display: block; max-width: 100%; height: auto; }
:where(.jjm) a { color: inherit; }
:where(.jjm) ul { list-style: none; margin: 0; padding: 0; }
:where(.jjm) p { margin: 0; }
:where(.jjm) h1, :where(.jjm) h2 { margin: 0; font-weight: 600; }
html { scroll-behavior: smooth; }
/* AOS slides some elements in from the side; stop them widening the page before they animate */
.jjm main,
.jjm-footer { overflow-x: clip; }

.jjm-container {
	width: 100%;
	max-width: calc(1248px + var(--jjm-gutter) * 2);
	margin: 0 auto;
	padding: 0 var(--jjm-gutter);
}
.jjm-container--wide { max-width: calc(1290px + var(--jjm-gutter) * 2); }

.jjm-overline {
	font-size: 15px;
	font-weight: 600;
	letter-spacing: 0.14em;
	text-transform: uppercase;
	color: var(--jjm-orange);
	line-height: 1.3;
}
.jjm-overline--yellow { color: var(--jjm-yellow); }

.jjm-heading {
	font-size: clamp(24px, 2.2vw, 30px);
	line-height: 1.1;
	text-transform: uppercase;
	color: var(--jjm-brown);
}

.jjm-copy p + p { margin-top: 1em; }
.jjm-copy a { color: var(--jjm-orange); }

/* Header (every page except the landing page, where the hero takes its place) */
.jjm-header {
	background: var(--jjm-orange);
	color: var(--jjm-white);
	padding: 32px 0;
}
.jjm-header__inner {
	display: flex;
	align-items: center;
	justify-content: center;
	gap: 24px 48px;
}
.jjm-header:has(.jjm-header__nav) .jjm-header__inner { justify-content: space-between; }
.jjm-header__logo {
	display: block;
	font-size: 22px;
	font-weight: 600;
	letter-spacing: 0.1em;
	text-transform: uppercase;
	text-decoration: none;
}
.jjm-header__logo img { width: auto !important; max-width: 240px; max-height: 48px; }
.jjm-header__nav ul { display: flex; flex-wrap: wrap; gap: 8px 32px; }
.jjm-header__nav a {
	font-size: 14px;
	font-weight: 600;
	letter-spacing: 0.14em;
	text-transform: uppercase;
	text-decoration: none;
}
.jjm-header__nav a:hover,
.jjm-header__nav .current-menu-item > a { color: var(--jjm-yellow); }

/* Standard pages ------------------------------------------------------- */
.jjm-page { padding: 110px 0 130px; }
.jjm-page__inner { max-width: calc(820px + var(--jjm-gutter) * 2); }
.jjm-page__title { font-size: clamp(30px, 3.4vw, 44px); margin-bottom: 40px; }
.jjm-page__content h2,
.jjm-page__content h3 {
	margin: 1.8em 0 0.6em;
	font-size: 20px;
	font-weight: 600;
	line-height: 1.25;
	text-transform: uppercase;
	letter-spacing: 0.04em;
}
.jjm-page__content ul,
.jjm-page__content ol { margin: 1em 0; padding-left: 1.3em; }
.jjm-page__content ul { list-style: disc; }
.jjm-page__content li + li { margin-top: 0.4em; }
.jjm-page__content :is(ul, ol, h2, h3) + p { margin-top: 1em; }
.jjm-page__content img { margin: 2em 0; }
.jjm-page__list li + li { margin-top: 0.6em; }
.jjm-page__list a { color: var(--jjm-orange); }

/* Hero ----------------------------------------------------------------- */
.jjm-hero {
	position: relative;
	container-type: size;
	height: 100vh;
	min-height: 560px;
	background: #2b2520;
	color: var(--jjm-white);
	overflow: hidden;
}
.jjm-hero__bg {
	position: absolute;
	inset: 0;
	width: 100%;
	height: 100% !important;
	object-fit: cover;
}
/* Vimeo background: scaled to cover the hero like object-fit, fading in over the photo once loaded */
.jjm-hero__video {
	position: absolute;
	inset: 0;
	pointer-events: none;
	opacity: 0;
	transition: opacity 1.2s ease 0.6s;
}
.jjm-hero__video.is-loaded { opacity: 1; }
.jjm-hero__video iframe {
	position: absolute;
	top: 50%;
	left: 50%;
	/* --jjm-video-ratio is the video's width / height, set from Vimeo in hero.php */
	width: max(100cqw, 100cqh * var(--jjm-video-ratio, 1.7778));
	height: max(100cqh, 100cqw / var(--jjm-video-ratio, 1.7778));
	/* Slight overscan: Vimeo's reported size is rounded, so trim any thin letterbox line it adds */
	transform: translate(-50%, -50%) scale(1.05);
	border: 0;
}
@media (prefers-reduced-motion: reduce) {
	.jjm-hero__video { display: none; }
}
.jjm-hero::after {
	content: '';
	position: absolute;
	inset: 0;
	background: rgba(0, 0, 0, 0.3);
}
.jjm-hero__inner {
	position: relative;
	z-index: 1;
	height: 100%;
	display: flex;
	align-items: center;
	justify-content: center;
	padding: 0 var(--jjm-gutter);
}
.jjm-hero__logo {
	font-size: clamp(32px, 6vw, 72px);
	letter-spacing: 0.04em;
	text-transform: uppercase;
	text-align: center;
	line-height: 1;
}
.jjm-hero__logo img { max-width: 80vw; margin: 0 auto; }
.jjm-hero__scroll {
	position: absolute;
	z-index: 1;
	left: 50%;
	bottom: 7vh;
	transform: translateX(-50%);
	color: var(--jjm-white);
	animation: jjm-nudge 2.4s ease-in-out infinite;
}
.jjm-hero__scroll svg { display: block; }
@keyframes jjm-nudge {
	0%, 100% { transform: translate(-50%, 0); }
	50% { transform: translate(-50%, 8px); }
}

/* Badges (stats band + highlights) ------------------------------------- */
.jjm-badges {
	display: grid;
	grid-template-columns: repeat(3, 1fr);
	align-items: center;
}
.jjm-badge {
	position: relative;
	display: flex;
	align-items: center;
	justify-content: center;
	padding: 0 24px;
	text-align: center;
}
.jjm-badge:not(:nth-child(3n + 1))::before {
	content: '';
	position: absolute;
	left: 0;
	top: 50%;
	height: 96px;
	transform: translateY(-50%);
	border-left: 2px solid var(--jjm-brown);
}
.jjm-badge__text {
	font-family: Georgia, 'Times New Roman', serif;
	font-weight: 700;
	font-size: 26px;
	line-height: 1.15;
	letter-spacing: 0.06em;
	text-transform: uppercase;
	color: var(--jjm-brown);
}

/* Stats band ----------------------------------------------------------- */
.jjm-stats {
	background: var(--jjm-orange);
	padding: 130px 0 145px;
	text-align: center;
}
.jjm-stats__list {
	margin-top: 40px;
	padding: 48px 0;
	border-top: 1.5px solid var(--jjm-brown);
	border-bottom: 1.5px solid var(--jjm-brown);
	min-height: 192px;
}
.jjm-stats .jjm-badge::before { height: 48px; }
.jjm-stats__tagline {
	padding: 18px 0;
	border-bottom: 1.5px solid var(--jjm-brown);
	font-size: 15px;
	font-weight: 600;
	letter-spacing: 0.14em;
	text-transform: uppercase;
}

/* Intro + gallery ------------------------------------------------------ */
.jjm-intro { padding: 150px 0 60px; }
.jjm-intro__text {
	max-width: 820px;
	margin: 0 auto 120px;
	text-align: center;
}
.jjm-intro__lead {
	margin-top: 46px;
	font-size: clamp(20px, 1.8vw, 24px);
	line-height: 1.3;
}

/* Sliders -------------------------------------------------------------- */
.jjm-slider__img {
	width: 100%;
	aspect-ratio: 624 / 505;
	object-fit: cover;
}
.jjm-slider--wide .jjm-slider__img { aspect-ratio: 1245 / 705; }
.jjm-slider {
	position: relative;
	margin-bottom: 48px; /* room for the dots, which sit outside so the arrows centre on the image */
}
.jjm-slider .slick-slide { outline: none; }
.jjm-slider .slick-list { overflow: hidden; }
/* hide all but the first slide until slick has initialised */
.jjm-slider__track:not(.slick-initialized) .jjm-slider__slide + .jjm-slider__slide { display: none; }

.jjm-slider__arrow {
	position: absolute;
	z-index: 2;
	top: 50%;
	width: 48px;
	height: 48px;
	margin-top: -24px;
	border: 0;
	border-radius: 50%;
	background: rgba(255, 255, 255, 0.88);
	color: var(--jjm-orange);
	cursor: pointer;
	display: flex;
	align-items: center;
	justify-content: center;
	padding: 0;
	transition: background 0.2s ease, transform 0.2s ease;
}
.jjm-slider__arrow:hover { background: var(--jjm-white); transform: scale(1.06); }
.jjm-slider__arrow--prev { left: 37px; }
.jjm-slider__arrow--next { right: 37px; }
.jjm-slider--wide .jjm-slider__arrow--prev { left: 22px; }
.jjm-slider--wide .jjm-slider__arrow--next { right: 22px; }

.jjm-slider .slick-dots {
	position: absolute;
	top: 100%;
	bottom: auto;
	left: 0;
	right: 0;
	display: flex !important;
	justify-content: center;
	gap: 11px;
	margin: 32px 0 0;
	padding: 0;
	list-style: none;
}
.jjm-slider .slick-dots li { margin: 0; }
.jjm-slider .slick-dots button {
	display: block;
	width: 8px;
	height: 8px;
	padding: 0;
	border: 0;
	border-radius: 50%;
	background: var(--jjm-orange-light);
	font-size: 0;
	cursor: pointer;
}
.jjm-slider .slick-dots .slick-active button { background: var(--jjm-orange); }

/* Feature (image slider + text) --------------------------------------- */
.jjm-feature { padding: 64px 0; }
.jjm-feature:last-of-type,
.jjm-feature:has(+ .jjm-highlights) { padding-bottom: 110px; }
.jjm-feature__grid {
	display: grid;
	grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
	align-items: start;
}
.jjm-feature__media { min-width: 0; }
.jjm-feature__text {
	align-self: center;
	max-width: 540px;
	padding: 0 0 48px 106px;
}
.jjm-feature__text .jjm-heading { margin: 28px 0 30px; }
.jjm-feature--image-right .jjm-feature__media { order: 2; }
.jjm-feature--image-right .jjm-feature__text { padding: 0 60px 48px 84px; }

/* Highlights ------------------------------------------------------------ */
.jjm-highlights {
	background: var(--jjm-white);
	padding: 90px 0 95px;
	text-align: center;
}
.jjm-highlights__list {
	margin-top: 60px;
	row-gap: 100px;
}
.jjm-highlights__list .jjm-badge { min-height: 150px; }
.jjm-badge__inner {
	display: flex;
	align-items: center;
	justify-content: center;
	width: 100%;
	transition: opacity 0.7s ease;
}
.jjm-badge__inner.is-out { opacity: 0; }
.jjm-highlights__cta { margin-top: 110px; }

.jjm-button {
	display: inline-block;
	padding: 21px 24px 19px;
	min-width: 204px;
	background: var(--jjm-yellow);
	color: var(--jjm-brown) !important;
	box-shadow: 6px 6px 0 var(--jjm-brown);
	font-size: 14px;
	font-weight: 600;
	letter-spacing: 0.14em;
	text-transform: uppercase;
	text-decoration: none;
	transition: transform 0.15s ease, box-shadow 0.15s ease;
}
.jjm-button:hover { transform: translate(3px, 3px); box-shadow: 3px 3px 0 var(--jjm-brown); }

/* Footer --------------------------------------------------------------- */
.jjm-footer {
	background: var(--jjm-orange);
	color: var(--jjm-white);
	padding-top: 100px;
}
.jjm-footer a { text-decoration: none; }
.jjm-footer a:hover { text-decoration: underline; }
.jjm-footer__logo img { max-width: 80%; margin: 0 auto; }
.jjm-footer__main {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 40px;
	padding: 120px 96px 72px;
}
.jjm-footer__address {
	font-style: normal;
	font-weight: 600;
	line-height: 1.65;
}
.jjm-footer__awards {
	display: flex;
	align-items: center;
	gap: 40px;
}
.jjm-footer__bar {
	border-top: 1px solid rgba(255, 255, 255, 0.6);
	padding: 32px 0;
	font-size: 15px;
	font-weight: 600;
}
.jjm-footer__bar-inner {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 20px;
	padding-left: calc(var(--jjm-gutter) + 96px);
	padding-right: calc(var(--jjm-gutter) + 96px);
}
.jjm-footer__legal { display: flex; flex-wrap: wrap; gap: 8px 56px; }

/* Responsive ----------------------------------------------------------- */
@media (max-width: 1100px) {
	.jjm-feature__text,
	.jjm-feature--image-right .jjm-feature__text { padding: 0 0 48px 56px; }
	.jjm-feature--image-right .jjm-feature__text { padding: 0 56px 48px 0; }
	.jjm-footer__main { padding-left: 0; padding-right: 0; }
	.jjm-footer__bar-inner { padding-left: var(--jjm-gutter); padding-right: var(--jjm-gutter); }
}

@media (max-width: 767px) {
	.jjm { font-size: 16px; }
	.jjm-header { padding: 22px 0; }
	.jjm-header__inner { flex-direction: column; }
	.jjm-header__logo img { max-width: 190px; max-height: 38px; }
	.jjm-page { padding: 64px 0 80px; }
	.jjm-page__title { margin-bottom: 28px; }
	.jjm-hero { height: 100svh; }

	.jjm-badges { grid-template-columns: 1fr; }
	.jjm-badge { padding: 28px 0; }
	.jjm-badge:not(:nth-child(3n + 1))::before { display: none; }
	.jjm-badge + .jjm-badge::after {
		content: '';
		position: absolute;
		top: 0;
		left: 50%;
		width: 60px;
		transform: translateX(-50%);
		border-top: 1.5px solid var(--jjm-brown);
	}
	.jjm-badge__img { max-width: 80% !important; }

	.jjm-stats { padding: 80px 0 90px; }
	.jjm-stats__list { padding: 12px 0; margin-top: 32px; }
	.jjm-stats__tagline { font-size: 13px; }

	.jjm-intro { padding: 90px 0 30px; }
	.jjm-intro__text { margin-bottom: 56px; }
	.jjm-intro__lead { margin-top: 28px; }

	.jjm-feature { padding: 40px 0; }
	.jjm-feature__grid { grid-template-columns: minmax(0, 1fr); }
	.jjm-feature--image-right .jjm-feature__media { order: 0; }
	.jjm-feature__text,
	.jjm-feature--image-right .jjm-feature__text { padding: 40px 0 0; max-width: none; }

	.jjm-slider__arrow { width: 40px; height: 40px; margin-top: -20px; }
	.jjm-slider__arrow--prev,
	.jjm-slider--wide .jjm-slider__arrow--prev { left: 12px; }
	.jjm-slider__arrow--next,
	.jjm-slider--wide .jjm-slider__arrow--next { right: 12px; }
	.jjm-slider { margin-bottom: 40px; }
	.jjm-slider .slick-dots { margin-top: 24px; }

	.jjm-highlights { padding: 70px 0; }
	.jjm-highlights__list { margin-top: 30px; row-gap: 0; }
	.jjm-highlights__list .jjm-badge { min-height: 0; padding: 32px 0; }
	.jjm-highlights__cta { margin-top: 50px; }

	.jjm-footer { padding-top: 70px; }
	.jjm-footer__main { flex-direction: column; text-align: center; padding: 56px 0 48px; }
	.jjm-footer__awards { flex-wrap: wrap; justify-content: center; gap: 24px; }
	.jjm-footer__awards img { max-height: 60px; width: auto; }
	.jjm-footer__bar-inner { flex-direction: column; text-align: center; }
	.jjm-footer__legal { justify-content: center; gap: 8px 24px; }
}
