/* Tokens ------------------------------------------------------------- */
:root {
	--navy: #344a96;
	--navy-dark: #1d3a66;
	--blue: #4670b8;
	--sky: #bce2ff;
	--sky-light: #eaf5ff;
	--snow: #fafafa;
	--gray-bar: #eeeeee;
	--ink: #333333;
	--ink-soft: #666666;
	--border: #e2e8f0;
	--white: #ffffff;
	--radius: 8px;
	--shadow: 0 4px 8px 0 rgba(0, 0, 0, 0.2), 0 0 20px 0 rgba(0, 0, 0, 0.2);
	--max-width: 1140px;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }

body {
	margin: 0;
	font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
	color: var(--ink);
	background: var(--snow);
	line-height: 1.6;
}

img { max-width: 100%; height: auto; display: block; }
a { color: var(--blue); }
a:hover { color: var(--navy); }

/* Whole site sits in one centered, shadowed container on the page's light
   gray background - matches the original (Bootstrap .container) layout,
   not full-bleed header/nav bars. */
.site {
	max-width: var(--max-width);
	margin: 12px auto;
	background: var(--white);
	box-shadow: var(--shadow);
	overflow: hidden;
}

.wrap { padding: 0 20px; }

.skip-link {
	position: absolute;
	left: -9999px;
	top: 0;
	background: var(--navy);
	color: #fff;
	padding: 10px 16px;
	z-index: 200;
}
.skip-link:focus { left: 0; }

.sr-only {
	position: absolute;
	width: 1px; height: 1px;
	overflow: hidden;
	clip: rect(0 0 0 0);
}

/* Header --------------------------------------------------------------- */
.site-header { background: var(--white); }

.topbar { background: var(--gray-bar); }
.topbar-inner {
	display: flex;
	align-items: center;
	justify-content: flex-end;
	gap: 20px;
	padding: 10px 20px;
}

.topnav {
	display: flex;
	flex-wrap: wrap;
	gap: 4px 22px;
}
.topnav a {
	color: var(--ink-soft);
	text-decoration: none;
	font-size: .85rem;
	padding: 4px 0;
}
.topnav a:hover, .topnav a.active { color: var(--navy); }

.nav-toggle {
	display: none;
	flex-direction: column;
	justify-content: center;
	gap: 4px;
	width: 38px;
	height: 34px;
	background: transparent;
	border: 1px solid #ccc;
	border-radius: 6px;
	cursor: pointer;
}
.nav-toggle span {
	display: block;
	height: 2px;
	background: var(--ink-soft);
	margin: 0 7px;
}

.mainnav { background: var(--sky); }
.mainnav .wrap {
	display: flex;
	flex-wrap: wrap;
	gap: 2px;
}
.mainnav > .wrap > a,
.mainnav .has-sub > a {
	display: block;
	color: var(--blue);
	text-decoration: none;
	font-weight: 600;
	font-size: .92rem;
	padding: 12px 14px;
}
.mainnav > .wrap > a:hover,
.mainnav .has-sub:hover > a,
.mainnav a.active { color: var(--navy-dark); background: rgba(255,255,255,.4); }

.has-sub { position: relative; }
.has-sub > a::after { content: "\25BE"; margin-left: 5px; font-size: .7em; }
.submenu {
	display: none;
	position: absolute;
	left: 0;
	top: 100%;
	min-width: 260px;
	background: #fff;
	border-radius: 0 0 var(--radius) var(--radius);
	box-shadow: var(--shadow);
	padding: 6px;
	z-index: 50;
}
.has-sub:hover .submenu,
.has-sub:focus-within .submenu { display: block; }
.submenu a {
	display: block;
	padding: 9px 12px;
	border-radius: 6px;
	color: var(--ink);
	text-decoration: none;
	font-size: .9rem;
	font-weight: 500;
}
.submenu a:hover { background: var(--sky-light); color: var(--navy); }

.hero {
	position: relative;
	aspect-ratio: 1000 / 271;
	background: url("/assets/img/hero.png") center/cover no-repeat;
}
.hero-shield {
	position: absolute;
	left: 20px;
	top: -18px;
	display: block;
}
.hero-shield img { width: 82px; height: auto; filter: drop-shadow(0 2px 4px rgba(0,0,0,.2)); }
.hero-mark {
	position: absolute;
	right: 20px;
	top: 8%;
	width: 22%;
	max-width: 170px;
	height: auto;
}

/* Content shell ---------------------------------------------------------- */
main.wrap { padding-top: 28px; padding-bottom: 48px; }

.card { padding: 0; }

.card h1 { margin-top: 0; color: var(--navy); font-size: 1.9rem; }
.card h2 {
	color: var(--navy);
	font-size: 1.35rem;
	margin: 2em 0 .7em;
	padding-top: .3em;
	border-top: 1px solid var(--border);
}
.card h2:first-child { margin-top: 0; padding-top: 0; border-top: none; }
.card h3 { color: var(--navy); font-size: 1.1rem; }
.card h4, .card h5 { color: var(--navy); }
.card ul, .card ol { padding-left: 1.3em; }
.card li { margin-bottom: .35em; }

/* Mobile nav toggle state ------------------------------------------------- */
@media (max-width: 880px) {
	.nav-toggle { display: flex; }
	.topnav {
		flex-basis: 100%;
		display: none;
		flex-direction: column;
		gap: 0;
		border-top: 1px solid #ddd;
		margin-top: 10px;
		padding-top: 10px;
		order: 1;
	}
	.mainnav .wrap { display: none; flex-direction: column; }
	.site-header.nav-open .topnav,
	.site-header.nav-open .mainnav .wrap { display: flex; }
	.mainnav > .wrap > a, .mainnav .has-sub > a { padding: 12px 4px; }
	.submenu { position: static; box-shadow: none; display: block; padding-left: 12px; background: transparent; }
	.has-sub .submenu a { color: var(--navy-dark); }
	.has-sub .submenu a:hover { background: rgba(255,255,255,.5); }
	.hero-shield img { width: 60px; }
	.hero-mark { width: 30%; }
}

/* Contact person card ----------------------------------------------------- */
.contact-grid {
	display: grid;
	grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
	gap: 16px;
	margin: 1.2em 0;
}
.contact-card {
	border: 1px solid var(--border);
	border-radius: var(--radius);
	padding: 16px 18px;
	background: var(--sky-light);
}
.contact-card .name { font-weight: 700; color: var(--navy); display: block; margin-bottom: 2px; }
.contact-card .role { color: var(--ink-soft); font-size: .88rem; display: block; margin-bottom: 8px; }
.contact-card dl { margin: 0; font-size: .92rem; }
.contact-card dt { display: none; }
.contact-card div { margin-bottom: 3px; }
.contact-card a { text-decoration: none; }
.contact-card a:hover { text-decoration: underline; }

/* Training hours table ----------------------------------------------------- */
.table-wrap { overflow-x: auto; margin: 1.2em 0; }
table.training {
	width: 100%;
	border-collapse: collapse;
	font-size: .94rem;
}
table.training th, table.training td {
	text-align: left;
	padding: 10px 12px;
	border-bottom: 1px solid var(--border);
	vertical-align: top;
}
table.training td[rowspan] { vertical-align: middle; }
table.training th { color: var(--navy); background: var(--sky-light); }
table.training tr:last-child td { border-bottom: none; }

/* Competition fact list ----------------------------------------------------- */
.fact-list {
	display: grid;
	grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
	gap: 14px;
	margin: 1.2em 0;
	padding: 0;
	list-style: none;
}
.fact-list li {
	display: flex;
	gap: 12px;
	align-items: flex-start;
	border: 1px solid var(--border);
	border-radius: var(--radius);
	padding: 12px 14px;
	margin: 0;
}
.fact-list .fact-icon {
	flex: none;
	width: 34px; height: 34px;
	border-radius: 50%;
	background: var(--sky);
	color: var(--navy);
	display: flex; align-items: center; justify-content: center;
	font-size: 1rem;
}
.fact-list .fact-key { font-weight: 700; color: var(--navy); display: block; font-size: .82rem; text-transform: uppercase; letter-spacing: .03em; }
.fact-list .fact-value { display: block; }

/* Competition results / document / news lists ------------------------------- */
ul.file-list { list-style: none; padding: 0; margin: 1.2em 0; display: grid; gap: 8px; }
ul.file-list li {
	border: 1px solid var(--border);
	border-radius: 8px;
	padding: 10px 14px;
}
ul.file-list a { text-decoration: none; font-weight: 600; }
ul.file-list a:hover { text-decoration: underline; }
ul.file-list .meta { color: var(--ink-soft); font-size: .85rem; font-weight: 400; }

.results-grid {
	display: grid;
	grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
	gap: 10px;
	margin: 1.2em 0;
}
.results-grid a {
	display: block;
	text-align: center;
	border: 1px solid var(--border);
	border-radius: 8px;
	padding: 10px 8px;
	text-decoration: none;
	font-weight: 600;
	background: var(--sky-light);
}
.results-grid a:hover { background: var(--sky); }

/* Sponsors -----------------------------------------------------------------
   No card chrome on the original (no border/background) - just a plain
   grid, left-aligned, with a fairly large logo. */
.sponsor-grid {
	display: grid;
	grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
	gap: 28px 20px;
	margin: 1.2em 0;
}
.sponsor-card {
	display: flex;
	flex-direction: column;
	align-items: flex-start;
	gap: 6px;
}
.sponsor-card img { max-width: 100%; max-height: 110px; width: auto; object-fit: contain; }
.sponsor-card .sponsor-name { font-weight: 700; }
.sponsor-card .sponsor-address { font-size: .88rem; color: var(--ink-soft); }
.sponsor-card a.sponsor-link { font-size: .88rem; }

/* Picture-only sponsor list (e.g. on competition pages): just the logos,
   each linking to the sponsor's homepage, no name/address text. */
.sponsor-logos {
	display: grid;
	grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
	gap: 28px 20px;
	margin: 1.2em 0;
	align-items: center;
}
.sponsor-logos a { display: block; }
.sponsor-logos img { max-width: 100%; max-height: 110px; width: auto; object-fit: contain; }

/* Text + image ----------------------------------------------------------
   Default matches the original site's textWithImage block: text on the
   left, image on the right. Add class "reverse" for the opposite. */
.text-with-image {
	display: flex;
	flex-direction: row-reverse;
	gap: 24px;
	align-items: flex-start;
	margin: 1.4em 0;
}
.text-with-image img { flex: none; width: 260px; border-radius: var(--radius); }
.text-with-image .text { flex: 1; min-width: 0; }
.text-with-image.reverse { flex-direction: row; }
@media (max-width: 640px) {
	.text-with-image { flex-direction: column; }
	.text-with-image img { width: 100%; }
}

.image-row {
	display: flex;
	flex-wrap: wrap;
	align-items: flex-start; /* default "stretch" distorts images whose aspect ratio differs from their row sibling */
	gap: 16px;
	margin: 1.4em 0;
}
.image-row img {
	flex: 1 1 260px;
	min-width: 0; /* flex items default to their intrinsic image width as a minimum otherwise, forcing a wrap */
	width: auto;
	max-width: 100%;
	border-radius: var(--radius);
}
@media (max-width: 640px) {
	.image-row { flex-wrap: wrap; }
	.image-row img { flex-basis: 100%; }
}

/* Embeds: maps, youtube ---------------------------------------------------- */
.embed-responsive {
	position: relative;
	width: 100%;
	padding-top: 56.25%;
	margin: 1.2em 0;
	border-radius: var(--radius);
	overflow: hidden;
	background: var(--sky-light);
}
.embed-responsive iframe {
	position: absolute; inset: 0;
	width: 100%; height: 100%;
	border: 0;
}

.video-facade {
	position: relative;
	width: 100%;
	padding-top: 56.25%;
	border-radius: var(--radius);
	overflow: hidden;
	cursor: pointer;
	background: #000 center/cover no-repeat;
	margin: 1.2em 0;
}
.video-facade .play {
	position: absolute; inset: 0;
	display: flex; align-items: center; justify-content: center;
}
.video-facade .play span {
	width: 68px; height: 68px;
	border-radius: 50%;
	background: rgba(0,0,0,.55);
	color: #fff;
	display: flex; align-items: center; justify-content: center;
	font-size: 1.6rem;
}
.video-facade iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }

video { width: 100%; border-radius: var(--radius); margin: 1em 0; }

/* News list ---------------------------------------------------------------- */
table.news { width: 100%; border-collapse: collapse; font-size: .95rem; }
table.news th, table.news td { text-align: left; padding: 10px 12px; border-bottom: 1px solid var(--border); }
table.news th { color: var(--navy); background: var(--sky-light); }
table.news .date { white-space: nowrap; color: var(--ink-soft); width: 110px; }
table.news .author { color: var(--ink-soft); width: 180px; }

/* Gallery ------------------------------------------------------------------ */
.album-grid, .photo-grid {
	display: grid;
	grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
	gap: 14px;
	margin: 1.2em 0;
	padding: 0;
	list-style: none;
}
.album-tile, .photo-tile {
	position: relative;
	border-radius: var(--radius);
	overflow: hidden;
	aspect-ratio: 4/3;
	background: var(--sky-light);
	border: 1px solid var(--border);
	cursor: pointer;
	display: block;
}
.album-tile img, .photo-tile img { width: 100%; height: 100%; object-fit: cover; }
.album-tile .label {
	position: absolute; left: 0; right: 0; bottom: 0;
	background: linear-gradient(0deg, rgba(20,40,71,.85), rgba(20,40,71,0));
	color: #fff;
	font-size: .85rem;
	font-weight: 600;
	padding: 20px 10px 8px;
}
.album-tile .count { font-weight: 400; opacity: .85; font-size: .78rem; }

.gallery-back {
	display: inline-block;
	margin-bottom: 14px;
	font-weight: 600;
	text-decoration: none;
}

.lightbox {
	position: fixed; inset: 0;
	background: rgba(10,16,26,.92);
	display: none;
	align-items: center;
	justify-content: center;
	z-index: 500;
	padding: 40px 20px;
}
.lightbox.open { display: flex; }
.lightbox img { max-width: 100%; max-height: 86vh; border-radius: 6px; }
.lightbox .lightbox-close,
.lightbox .lightbox-prev,
.lightbox .lightbox-next {
	position: absolute;
	background: rgba(255,255,255,.12);
	color: #fff;
	border: none;
	cursor: pointer;
	border-radius: 50%;
	width: 46px; height: 46px;
	font-size: 1.4rem;
	display: flex; align-items: center; justify-content: center;
}
.lightbox .lightbox-close:hover,
.lightbox .lightbox-prev:hover,
.lightbox .lightbox-next:hover { background: rgba(255,255,255,.25); }
.lightbox .lightbox-close { top: 16px; right: 16px; }
.lightbox .lightbox-prev { left: 16px; top: 50%; transform: translateY(-50%); }
.lightbox .lightbox-next { right: 16px; top: 50%; transform: translateY(-50%); }
.lightbox .lightbox-count {
	position: absolute; bottom: 16px; left: 50%; transform: translateX(-50%);
	color: #cfe0f5; font-size: .85rem;
}

/* Footer --------------------------------------------------------------- */
.site-footer { background: var(--gray-bar); color: var(--ink-soft); margin-top: 40px; }
.footer-inner {
	padding: 20px;
	display: flex;
	flex-wrap: wrap;
	gap: 16px;
	align-items: center;
	justify-content: space-between;
	font-size: .82rem;
}
.footer-inner p { margin: 0 0 4px; }
.site-footer a { color: var(--blue); }
.footer-partners { display: flex; align-items: center; gap: 14px; }
.footer-partners img { height: 55px; width: auto; }
@media (max-width: 640px) {
	.footer-inner { flex-direction: column; text-align: center; }
}
