/* Firework Awards UK - layout.css */

/* ---------- Fonts (self-hosted Poppins, latin subset) ---------- */
@font-face {
	font-family: "Poppins";
	font-style: normal;
	font-weight: 200;
	font-display: swap;
	src: url("poppins-200.woff2") format("woff2");
}
@font-face {
	font-family: "Poppins";
	font-style: normal;
	font-weight: 400;
	font-display: swap;
	src: url("poppins-400.woff2") format("woff2");
}
@font-face {
	font-family: "Poppins";
	font-style: normal;
	font-weight: 600;
	font-display: swap;
	src: url("poppins-600.woff2") format("woff2");
}

/* ---------- Design tokens ----------
   One set of sizes used everywhere. Change a value here and every page follows. */
:root {
	--text-width: 780px;   /* reading column: ~75 characters a line */
	--wide-width: 1140px;  /* grids of cards, logos and images */
	--gutter: clamp(20px, 5vw, 80px);      /* page side padding */
	--space: clamp(40px, 6vw, 80px);       /* vertical gap between sections */

	--fs-body: clamp(1rem, 0.95rem + 0.3vw, 1.125rem);        /* 16 -> 18px */
	--fs-small: 0.875rem;                                      /* 14px */
	--fs-title: clamp(2rem, 1.4rem + 2.6vw, 3.125rem);         /* page titles: 32 -> 50px */
	--fs-heading: clamp(1.375rem, 1.15rem + 0.9vw, 1.75rem);   /* section headings: 22 -> 28px */
	--fs-card: 1.25rem;                                        /* card / item headings: 20px */
	--fs-display: clamp(2.5rem, 1.2rem + 5.5vw, 5.5rem);       /* banner headings over images: 40 -> 88px */
}

/* ---------- Base ---------- */
*,
*::before,
*::after { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
	margin: 0;
	background: #000;
	color: #fff;
	font-family: "Poppins", Arial, Helvetica, sans-serif;
	font-weight: 200;
	font-size: var(--fs-body);
	line-height: 1.75;
}

img { max-width: 100%; height: auto; display: block; }

a { color: inherit; }
a:hover, a:focus-visible { color: #ccc; }

h1, h2, h3 {
	font-weight: 600;
	line-height: 1.25;
	margin: 0 0 0.6em;
}
h1 { font-size: var(--fs-title); text-transform: uppercase; }
h2 { font-size: var(--fs-heading); }
h3 { font-size: var(--fs-card); }

p { margin: 0 0 1em; }
ul { margin: 0 0 1em; padding-left: 1.25em; }
strong { font-weight: 600; }

:focus-visible { outline: 2px solid #fff; outline-offset: 3px; }

.center { text-align: center; }
.center ul { list-style: none; padding: 0; }

.skip-link {
	position: absolute;
	left: 1rem;
	top: -100px;
	background: #fff;
	color: #000;
	padding: 0.5rem 1rem;
	z-index: 10;
}
.skip-link:focus { top: 1rem; }

.visually-hidden {
	position: absolute !important;
	width: 1px; height: 1px;
	overflow: hidden;
	clip: rect(0 0 0 0);
	white-space: nowrap;
}

/* ---------- Header ---------- */
.site-header { padding: 30px var(--gutter); }
.header-inner {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 20px;
}
.site-logo img { width: 201px; }
.site-nav ul {
	list-style: none;
	margin: 0;
	padding: 0;
	display: flex;
	flex-wrap: wrap;
	justify-content: flex-end;
	gap: 0 22px;
}
.site-nav a {
	display: block;
	padding: 8px 0;
	color: #e7e7e7;
	font-weight: 400;
	font-size: clamp(1.0625rem, 0.8rem + 0.9vw, 1.5625rem);  /* 17 -> 25px */
	text-decoration: none;
}
.site-nav a:hover,
.site-nav a:focus-visible,
.site-nav a[aria-current="page"] { color: #fff; text-decoration: underline; text-underline-offset: 6px; }

/* ---------- Page layout ----------
   Every section is centred with the same side padding and vertical spacing.
   Reading sections use --text-width, grids use --wide-width. */
main { display: block; }
main > section,
main > article {
	max-width: calc(var(--wide-width) + 2 * var(--gutter));
	margin: 0 auto;
	padding: calc(var(--space) / 2) var(--gutter);
}
main > :first-child { padding-top: calc(var(--space) / 2); }
main > :last-child { padding-bottom: var(--space); }

.text,
.intro,
.category-info { max-width: calc(var(--text-width) + 2 * var(--gutter)); }

.text h2,
.category-info h2 { margin-top: 1.5em; }
.text > h1 + h2 { margin-top: 0.5em; }
.text h3 { margin-top: 1.25em; }

/* An image placed within the reading column (e.g. the 2021 winner graphics) */
.content-image { width: 100%; max-width: 560px; margin: 0 auto 1.25em; }

/* Section headings that introduce a whole block (e.g. "The awards process", "Contact") */
h2.section-title { margin-top: 0.5em; }

/* Text over a faded background image (About page) */
.hero-split {
	position: relative;
	max-width: none;
	min-height: min(658px, 80vh);
	padding: var(--space) var(--gutter);
	display: flex;
	align-items: center;
	overflow: hidden;
}
main > .hero-split:first-child { padding-top: var(--space); }
.hero-bg {
	position: absolute;
	inset: 0;
	width: 100%;
	height: 100%;
	max-width: none;
	object-fit: cover;
	opacity: 0.29;
}
.hero-split-inner {
	position: relative;
	width: 100%;
	max-width: var(--wide-width);
	margin: 0 auto;
	display: grid;
	grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
	gap: 20px 60px;
	align-items: center;
}
.hero-split h1 { font-size: var(--fs-display); line-height: 1.1; margin: 0; }
.hero-split-text p:last-child { margin-bottom: 0; }

/* Centred version: heading, text and button stacked in the middle (Vote page) */
.hero-centre .hero-split-inner { grid-template-columns: minmax(0, 1fr); text-align: center; }
.hero-centre .hero-split-text { max-width: var(--text-width); margin: 0 auto; }

/* ---------- Buttons ---------- */
.btn-wrap { margin: 1.5em 0 0; }
.btn {
	display: inline-block;
	min-width: 185px;
	padding: 9px 22px;
	border: 1px solid #fff;
	border-radius: 100px;
	color: #fff;
	font-size: 1rem;
	font-weight: 200;
	text-align: center;
	text-decoration: none;
	transition: background-color 0.2s, color 0.2s;
}
.btn:hover,
.btn:focus-visible { background: #fff; color: #000; }
.btn-square { border-radius: 0; }

.social { margin: 1em 0; }
.social a { display: inline-block; padding: 6px; }
.social img { width: 20px; height: 20px; }

/* ---------- Home ---------- */
.home-logo img { width: 1044px; margin: 0 auto; }
h1.home-title {
	font-size: var(--fs-card);
	text-transform: none;
	line-height: 1.41;
	max-width: var(--text-width);
	margin: 20px auto 40px;
}
.video {
	position: relative;
	max-width: 880px;
	margin: 0 auto;
	aspect-ratio: 16 / 9;
}
.video iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }

.cards {
	display: grid;
	grid-template-columns: repeat(3, 1fr);
	gap: 40px;
	text-align: center;
}
.card { display: flex; flex-direction: column; align-items: center; }
.card-image { width: 100%; margin-bottom: 30px; }
.card-image img { width: 100%; max-width: min(100%, 555px); height: auto; margin: 0 auto; }  /* whole image, never cropped */
.card h2 { font-size: var(--fs-card); }
.card p { max-width: 340px; }
.card .btn-wrap { margin-top: auto; padding-top: 1em; }

/* ---------- Category winner pages ---------- */
.winner {
	display: grid;
	grid-template-columns: 1fr minmax(0, 1fr);
	gap: 40px clamp(30px, 5vw, 60px);
	align-items: center;
}
.winner-image img { margin: 0 auto; max-height: 600px; width: auto; }
.winner-text { max-width: 560px; }
.winner-name { font-size: var(--fs-card); text-transform: uppercase; }
.category-info h3 { font-size: 1rem; font-weight: 200; text-transform: uppercase; margin: 2em 0 0.25em; }
.previous-winners { list-style: none; padding: 0; }

/* ---------- Award categories ---------- */
.categories h1 { text-align: center; margin-bottom: 1em; }
.category-grid {
	list-style: none;
	margin: 0 auto;
	padding: 0;
	display: grid;
	grid-template-columns: repeat(4, 1fr);
	gap: 50px 30px;
	text-align: center;
}
.category-grid a { display: block; text-decoration: none; }
.category-grid img { width: 180px; margin: 0 auto 20px; }
.category-grid h2 {
	font-size: var(--fs-card);
	line-height: 1.41;
	text-decoration: underline;
	text-underline-offset: 3px;
	margin: 0;
}

/* ---------- Retailers ---------- */
.retailer-grid {
	display: grid;
	grid-template-columns: repeat(3, 1fr);
	gap: 60px 40px;
}
.retailer {
	display: flex;
	flex-direction: column;
	align-items: center;
	text-align: center;
}
.retailer-logo { height: 200px; display: flex; align-items: center; margin-bottom: 20px; }
.retailer-logo img { max-height: 200px; width: auto; }
.retailer h2 { font-size: var(--fs-card); line-height: 1.41; }
.retailer h2 span { display: block; }
.retailer ul { list-style: none; padding: 0; }
.retailer .btn-wrap { margin-top: auto; padding-top: 1em; }

/* ---------- Hall of Fame ---------- */
.feature {
	display: grid;
	grid-template-columns: 1fr minmax(0, 1fr);
	gap: 30px clamp(30px, 5vw, 60px);
	align-items: center;
}
.feature-image img { margin: 0 auto; max-height: 560px; width: auto; }
.feature-text { max-width: 560px; }

/* ---------- Footer ---------- */
.site-footer {
	max-width: calc(var(--wide-width) + 2 * var(--gutter));
	margin: 0 auto;
	padding: 30px var(--gutter);
	text-align: center;
	font-size: var(--fs-small);
}
.legal-links {
	list-style: none;
	margin: 0 0 40px;
	padding: 0;
	display: flex;
	flex-wrap: wrap;
	justify-content: space-around;
	gap: 15px 30px;
}
.legal-links a { font-size: 1rem; text-transform: uppercase; }
.copyright { margin: 0 0 10px; }
.site-footer .social { margin: 0; }

/* ---------- Cookie preferences button (fixed, bottom-left corner) ---------- */
.cookiecontrol {
	position: fixed;
	left: 0;
	bottom: 0;
	z-index: 1000;
	width: 56px;
	height: 56px;
	margin: 0;
	padding: 0;
	border: 0;
	background: none;
	line-height: 0;
	cursor: pointer;
}
.cookiecontrol svg {
	display: block;
	width: 100%;
	height: 100%;
	fill: #2c3c87;                /* the blue from the UK Firework Alliance logo */
	transition: fill 0.2s;
}
.cookiecontrol:hover svg,
.cookiecontrol:focus-visible svg { fill: #4157bd; }
.cookiecontrol:focus-visible { outline-offset: -4px; }

@media print {
	.cookiecontrol { display: none; }
}

/* ---------- Responsive ---------- */

/* Tablets and small laptops: logo above a centred nav, so the links never wrap beside the logo */
@media (max-width: 1000px) {
	.header-inner { flex-direction: column; gap: 10px; }
	.site-nav ul { justify-content: center; }
	.cards,
	.retailer-grid { grid-template-columns: repeat(2, 1fr); }
	.category-grid { grid-template-columns: repeat(3, 1fr); }
}

/* Portrait tablets: stack the image + text pages so the text column isn't squeezed */
@media (max-width: 820px) {
	.winner,
	.feature { grid-template-columns: 1fr; }
	.winner-text,
	.feature-text { max-width: var(--text-width); margin: 0 auto; }
}

/* Phones and narrow tablets: stack everything into one column */
@media (max-width: 700px) {
	.site-logo img { width: 140px; }
	.site-nav ul { justify-content: center; gap: 0 18px; }
	.hero-split { min-height: 0; }
	.hero-split-inner,
	.cards,
	.retailer-grid { grid-template-columns: 1fr; }
	.winner-image img { max-height: 420px; }
	.feature-image img { max-height: 380px; }
	.category-grid { grid-template-columns: repeat(2, 1fr); gap: 40px 20px; }
	.category-grid img { width: 130px; }
	.retailer-logo { height: 160px; }
	.retailer-logo img { max-height: 160px; }
	.legal-links { justify-content: center; }
}

@media (max-width: 420px) {
	.category-grid h2 { font-size: 1rem; }
}

/* Phones held sideways: keep images from filling the whole screen */
@media (orientation: landscape) and (max-height: 500px) {
	.site-header { padding-top: 10px; padding-bottom: 10px; }
	.header-inner { flex-direction: row; }
	.site-logo img { width: 90px; }
	.site-nav ul { justify-content: flex-end; }
	.hero-split { min-height: 0; }
	.winner-image img,
	.feature-image img { max-height: 80vh; }
}

@media (prefers-reduced-motion: reduce) {
	* { transition: none !important; }
}
