/* Maltby Scouts theme. Colours and type follow the Scouts brand guidelines (v3.3). */

@font-face {
	font-family: "Nunito Sans";
	font-style: normal;
	font-weight: 200 1000;
	font-display: swap;
	src: url("../fonts/nunito-sans-latin-wght-normal.woff2") format("woff2");
	unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
	font-family: "Nunito Sans";
	font-style: normal;
	font-weight: 200 1000;
	font-display: swap;
	src: url("../fonts/nunito-sans-latin-ext-wght-normal.woff2") format("woff2");
	unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}

:root {
	--purple: #7413dc;
	--teal: #088486;
	--navy: #003982;
	--pink: #ffb4e5;
	--yellow: #ffe627;
	--forest: #205b41;
	--red: #ed3f23;
	--blue: #006ddf;
	--orange: #ff912a;
	--green: #25b755;
	--black: #000;
	--white: #fff;

	--tint: #f5eefc; /* very light purple, for alternate sections */
	--ink: var(--black);
	--link: var(--purple);
	--focus: var(--navy);
	--focus-on-dark: var(--yellow);

	--font: "Nunito Sans", system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
	--radius: 1.5rem;
	--gutter: 1rem;
	--max: 72rem;
}

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

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

body {
	margin: 0;
	background: var(--white);
	color: var(--ink);
	font-family: var(--font);
	font-size: 1.125rem;
	font-weight: 400;
	line-height: 1.6;
}

img, svg, video { max-width: 100%; height: auto; }

h1, h2, h3, h4 {
	font-weight: 900;
	line-height: 1.15;
	margin: 0 0 .6em;
	text-wrap: balance;
}
h1 { font-size: clamp(2.1rem, 5vw, 3.5rem); }
h2 { font-size: clamp(1.7rem, 3.5vw, 2.5rem); }
h3 { font-size: 1.4rem; }

p, ul, ol { margin: 0 0 1.1em; }

strong, b { font-weight: 700; }

/* Brand rules: no capitals styling, no underline or italics except links in text. */
* { text-transform: none !important; }
em, i, cite, address { font-style: normal; }
a { color: var(--link); text-underline-offset: .18em; }

.entry__content a:not(.button),

.skip-link {
	position: absolute;
	left: .5rem; top: -4rem;
	z-index: 100;
	padding: .75rem 1.25rem;
	background: var(--white);
	color: var(--purple);
	font-weight: 700;
	border-radius: .5rem;
	border: 3px solid var(--purple);
}
.skip-link:focus { top: .5rem; }

.wrap {
	width: 100%;
	max-width: var(--max);
	margin-inline: auto;
	padding-inline: var(--gutter);
}
.narrow > * { max-width: 46rem; }

.section { padding-block: clamp(2.5rem, 6vw, 5rem); }
.section--tint { background: var(--tint); }

.lead { font-size: 1.3rem; }

/* Buttons */
.button {
	display: inline-block;
	padding: .75em 1.5em;
	border: 3px solid transparent;
	border-radius: 999px;
	font: inherit;
	font-weight: 700;
	line-height: 1.2;
	text-align: center;
	text-decoration: none;
	cursor: pointer;
}
.button--primary { background: var(--purple); color: var(--white); border-color: var(--purple); }
.button--primary:hover { background: var(--white); color: var(--purple); }
.button--light { background: var(--white); color: var(--purple); border-color: var(--white); }
.button--light:hover { background: transparent; color: var(--white); }
.button--outline-light { background: transparent; color: var(--white); border-color: var(--white); }
.button--outline-light:hover { background: var(--white); color: var(--purple); }
.button-row { display: flex; flex-wrap: wrap; gap: .75rem; }

/* Header */

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


.header__inner {
	display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between;
	gap: 1rem; padding-block: 1rem;
}

.brand .custom-logo-link { display: block; }
.brand .custom-logo { display: block; max-height: 5rem; width: auto; }
.brand__link { display: inline-block; text-decoration: none; color: var(--purple); }
.brand__logo { display: block; width: 11rem; height: auto; }
.brand__name { display: block; margin-top: .15rem; font-weight: 800; font-size: 1rem; line-height: 1.2; color: var(--purple); }

.nav-toggle {
	padding: .6rem 1.2rem;
	border: 3px solid var(--purple);
	border-radius: 999px;
	background: var(--white); color: var(--purple);
	font: inherit; font-weight: 700; cursor: pointer;
}
.nav-toggle[aria-expanded="true"] { background: var(--purple); color: var(--white); }

.primary-nav { display: none; flex-basis: 100%; }
.primary-nav.is-open { display: block; }

.primary-menu a {
	display: block; padding: .6rem 0;
	color: var(--black); font-weight: 700; text-decoration: none;
}
.primary-menu a { white-space: nowrap; }
.primary-menu a:hover, .primary-menu .current-menu-item > a, .primary-menu .current_page_item > a { color: var(--purple); }
.primary-menu .current-menu-item > a, .primary-menu .current_page_item > a { text-decoration: underline; text-decoration-thickness: .15em; text-underline-offset: .3em; }
.primary-menu .sub-menu { display: none; list-style: none; margin: 0; padding: 0 0 0 1rem; }
.primary-menu .is-open > .sub-menu { display: block; }
.menu-item-has-children { position: relative; }
.submenu-toggle {
	position: absolute; right: 0; top: .2rem;
	width: 2.5rem; height: 2.5rem;
	border: 2px solid var(--purple); border-radius: 50%;
	background: var(--white); color: var(--purple); cursor: pointer;
}
.submenu-toggle::before { content: ""; display: block; width: .55rem; height: .55rem; margin: auto; border-right: 3px solid currentColor; border-bottom: 3px solid currentColor; transform: translateY(-.1rem) rotate(45deg); }
.submenu-toggle[aria-expanded="true"]::before { transform: translateY(.1rem) rotate(-135deg); }
.header__join { margin-top: .75rem; }

@media (min-width: 62rem) {
	.nav-toggle { display: none; }
	.primary-nav { display: flex !important; flex-basis: auto; align-items: center; gap: 1.5rem; }
	.primary-menu { display: flex; align-items: center; gap: .25rem 1.5rem; }
	.primary-menu a { padding: .5rem 0; }
	.header__join { margin-top: 0; }
	.primary-menu .sub-menu {
		flex-basis: 100%;
		position: absolute; left: -1rem; top: 100%; z-index: 20;
		min-width: 16rem; padding: .5rem 1rem;
		background: var(--white); border: 2px solid var(--purple); border-radius: 1rem;
	}
	.menu-item-has-children { display: flex; align-items: center; }
	.menu-item-has-children > a { padding-right: .25rem; }
	.submenu-toggle { position: static; display: inline-block; width: 1.9rem; height: 1.9rem; vertical-align: middle; margin-left: .15rem; }
	.menu-item-has-children:hover > .sub-menu, .menu-item-has-children:focus-within > .sub-menu { display: block; }
}

/* Hero */
.hero { background: var(--purple); color: var(--white); }
.hero__inner { display: grid; gap: 2rem; padding-block: clamp(2.5rem, 6vw, 5rem); align-items: center; }
.hero a:not(.button) { color: var(--white); }
.hero__img img { display: block; width: 100%; border-radius: var(--radius); object-fit: cover; aspect-ratio: 4 / 3; }
@media (min-width: 52rem) {
	.hero__inner:has(.hero__img) { grid-template-columns: 1.1fr 1fr; gap: 3rem; }
}

/* Welcome */
.welcome__inner { display: grid; gap: 2rem; align-items: start; }
.welcome__img img { display: block; border-radius: var(--radius); }
.welcome__img--logo img { width: 100%; max-width: 20rem; height: auto; margin-inline: auto; border-radius: 0; }
@media (min-width: 52rem) {
	.welcome__inner.has-img { grid-template-columns: 1.4fr 1fr; gap: 3rem; }
}
.tick-list { list-style: none; padding: 0; }
.tick-list li { position: relative; padding-left: 2rem; margin-bottom: .5rem; }
.tick-list li::before {
	content: ""; position: absolute; left: .2rem; top: .45em;
	width: .9rem; height: .5rem;
	border-left: 4px solid var(--forest); border-bottom: 4px solid var(--forest);
	transform: rotate(-45deg);
}

/* Age cards. Heading text colours all pass WCAG AA at the sizes used. */
.age-grid { list-style: none; margin: 0; padding: 0; display: grid; gap: 1rem; grid-template-columns: 1fr; }
@media (min-width: 36rem) { .age-grid { grid-template-columns: repeat(2, 1fr); } }
@media (min-width: 62rem) { .age-grid { grid-template-columns: repeat(3, 1fr); } }
.age-card { background: var(--white); border-radius: var(--radius); overflow: hidden; border: 3px solid var(--purple); }
.age-card__band {
	display: block; padding: 1.1rem 1.25rem;
	color: var(--white); font-size: 1.6rem; font-weight: 900; line-height: 1.1;
}
.age-card--red    { border-color: var(--red); }
.age-card--blue   { border-color: var(--blue); }
.age-card--forest { border-color: var(--forest); }
.age-card--teal   { border-color: var(--teal); }
.age-card--navy   { border-color: var(--navy); }
.age-card--purple { border-color: var(--purple); }
.age-card--red .age-card__band    { background: var(--red); }
.age-card--blue .age-card__band   { background: var(--blue); }
.age-card--forest .age-card__band { background: var(--forest); }
.age-card--teal .age-card__band   { background: var(--teal); }
.age-card--navy .age-card__band   { background: var(--navy); }
.age-card--purple .age-card__band { background: var(--purple); }

/* News */

/* Facebook band */
.promo { background: var(--forest); color: var(--white); padding-block: clamp(2.5rem, 6vw, 4.5rem); }
.promo a:not(.button) { color: var(--white); }

/* Inner pages */
.page-head { margin-bottom: 2rem; }
.entry__content { max-width: 46rem; }
.entry__content > * + * { margin-top: 1.1em; }
.entry__img img { display: block; border-radius: var(--radius); margin-bottom: 2rem; }
.entry__content .alignwide { max-width: var(--max); }
.entry__content ul, .entry__content ol { padding-left: 1.4rem; }
.entry__content blockquote { margin-left: 0; padding-left: 1.25rem; border-left: 6px solid var(--purple); }
.wp-caption-text, figcaption { font-size: .95rem; }

/* Footer. Purple, not blue, because links must not sit on a blue background. */
.site-footer { background: var(--purple); color: var(--white); padding-top: 3rem; }
.site-footer a { color: var(--white); text-decoration: none; }
.site-footer a:hover { text-decoration: underline; }
.footer__grid { display: grid; gap: 2rem; grid-template-columns: 1fr; }
@media (min-width: 36rem) { .footer__grid { grid-template-columns: repeat(2, 1fr); } }
@media (min-width: 62rem) { .footer__grid { grid-template-columns: repeat(4, 1fr); } }
.footer__crest { display: block; width: 5rem; height: auto; margin-bottom: 1rem; }
.footer__h { font-size: 1.2rem; margin-bottom: .75rem; }
.site-footer .menu li { margin-bottom: .4rem; }
.footer__legal { padding-block: 2rem 2.5rem; font-size: .95rem; }
.footer__legal p { margin: 0; padding-top: 1.5rem; border-top: 2px solid rgba(255, 255, 255, .5); }

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

/* Section anchors sit clear of the top of the screen. */
[id] { scroll-margin-top: 1rem; }

/* Shared flow: wavy joins between sections, drifting shapes and pop-in cards. */
.flow { position: relative; isolation: isolate; overflow: hidden; --prev: #fff; }
.flow::before {
	content: ""; position: absolute; left: 0; right: 0; top: -1px; height: 2.5rem; z-index: 1;
	background: var(--prev);
	-webkit-mask: no-repeat center / 100% 100% url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 1200 40' preserveAspectRatio='none'%3E%3Cpath d='M0 0h1200v18c-100 20-200 20-300 0S700-2 600 18 500 38 300 18 100-2 0 18z'/%3E%3C/svg%3E");
	mask: no-repeat center / 100% 100% url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 1200 40' preserveAspectRatio='none'%3E%3Cpath d='M0 0h1200v18c-100 20-200 20-300 0S700-2 600 18 500 38 300 18 100-2 0 18z'/%3E%3C/svg%3E");
}
.flow > .wrap { position: relative; z-index: 2; }
.flow--from-purple { --prev: var(--purple); }
.flow--from-pink { --prev: var(--pink); }
.flow--from-tint { --prev: var(--tint); }
.flow--from-white { --prev: #fff; }
.flow:not(.hero):not(.page-hero):not(.promo):not(.site-footer):not(.entry-wrap) > .wrap { padding-top: 1.5rem; padding-bottom: 1rem; }

.blob { position: absolute; z-index: 0; border-radius: 50%; background: var(--purple); opacity: .16; animation: drift 14s ease-in-out infinite alternate; pointer-events: none; }
.blob--1 { width: 14rem; height: 14rem; top: 4rem; right: -4rem; }
.blob--2 { width: 8rem; height: 8rem; bottom: 6rem; left: -2rem; border-radius: 2rem; animation-duration: 18s; }
.blob--3 { width: 5rem; height: 5rem; top: 45%; right: 12%; background: var(--navy); animation-duration: 11s; }
.blob--4 { width: 12rem; height: 12rem; top: 5rem; left: -5rem; background: var(--pink); opacity: .55; }
.blob--5 { width: 6rem; height: 6rem; bottom: 4rem; right: 6%; border-radius: 1.5rem; animation-duration: 17s; }
.blob--6 { width: 11rem; height: 11rem; bottom: 2rem; right: -3rem; background: var(--pink); opacity: .6; }
.blob--7 { width: 10rem; height: 10rem; top: 3rem; right: 8%; background: var(--white); opacity: .1; }
.blob--h1 { width: 16rem; height: 16rem; top: -4rem; right: -3rem; background: var(--white); opacity: .1; }
.blob--h2 { width: 7rem; height: 7rem; bottom: 2rem; right: 28%; border-radius: 1.75rem; background: var(--pink); opacity: .25; animation-duration: 16s; }
@keyframes drift { from { transform: translate(0, 0) rotate(0); } to { transform: translate(1.5rem, -2rem) rotate(25deg); } }

/* Cards that tilt, pop in and shine. */
.pop {
	position: relative; overflow: hidden;
	transform: rotate(var(--tilt, 0deg));
	box-shadow: 0 .5rem 0 rgba(0, 0, 0, .12);
	transition: transform .25s cubic-bezier(.34, 1.56, .64, 1), box-shadow .25s;
}
.pop:hover, .pop:focus-within { transform: rotate(0) translateY(-.4rem) scale(1.02); box-shadow: 0 1rem 0 rgba(0, 0, 0, .14); }
.pop::after {
	content: ""; position: absolute; inset: 0; pointer-events: none;
	background: linear-gradient(105deg, transparent 35%, rgba(255, 255, 255, .22) 50%, transparent 65%);
	transform: translateX(-120%);
}
.pop:hover::after { transform: translateX(120%); transition: transform .8s ease; }
.pop.will-reveal { opacity: 0; transform: translateY(1.5rem) scale(.96); }
.pop.will-reveal.is-visible { opacity: 1; transform: rotate(var(--tilt, 0deg)); transition: opacity .5s, transform .6s cubic-bezier(.34, 1.56, .64, 1); transition-delay: var(--delay, 0s); }
.pop.will-reveal.is-visible:hover, .pop.will-reveal.is-visible:focus-within { transform: rotate(0) translateY(-.4rem) scale(1.02); transition-delay: 0s; }

@media (prefers-reduced-motion: reduce) {
	.pop, .pop:hover, .pop:focus-within, .pop.will-reveal, .pop.will-reveal.is-visible { transform: none; opacity: 1; }
	.pop::after { display: none; }
}

/* Section anchors sit clear of the top of the screen. */
[id] { scroll-margin-top: 1rem; }

/* Why join */
.why { background: var(--pink); color: var(--black); }
.why .lead, .why h2 { max-width: 40rem; }
.why-grid { list-style: none; margin: 2.25rem 0; padding: 0; display: grid; gap: 1.5rem; grid-template-columns: 1fr; }
@media (min-width: 40rem) { .why-grid { grid-template-columns: repeat(2, 1fr); } }
@media (min-width: 62rem) { .why-grid { grid-template-columns: repeat(3, 1fr); } }
.why-card { padding: 1.5rem 1.5rem 1.75rem; border-radius: var(--radius); color: var(--white); }
.why-card--0 { background: var(--purple); --tilt: -1.2deg; }
.why-card--1 { background: var(--forest); --tilt: .9deg; }
.why-card--2 { background: var(--navy); --tilt: -.6deg; }
.why-card h3 { color: var(--white); font-size: 1.5rem; margin-bottom: .4rem; }
.why-card p { margin: 0; }
.why-card__icon {
	display: grid; place-items: center;
	width: 3.5rem; height: 3.5rem; margin-bottom: 1rem;
	border-radius: 50%; background: var(--white); color: var(--purple);
	transition: transform .4s cubic-bezier(.34, 1.56, .64, 1);
}
.why-card--1 .why-card__icon { color: var(--forest); }
.why-card--2 .why-card__icon { color: var(--navy); }
.pop:hover .why-card__icon { transform: rotate(-12deg) scale(1.12); }
.why-cta { font-size: 1.3rem; font-weight: 800; }

/* When we meet */
.meet { background: var(--white); }
.meet .lead { max-width: 40rem; }
.age-grid { margin-top: 2rem; gap: 1.5rem; }
.age-card { --tilt: -.8deg; }
.age-card:nth-child(2n) { --tilt: .8deg; }
.age-card:nth-child(3n) { --tilt: -.4deg; }
.age-card__band { margin: 0; }
.age-card__body { padding: 1rem 1.25rem 1.5rem; }
.age-card__body p { margin: 0 0 .5rem; }
.age-card__ages { font-weight: 700; font-size: 1.2rem; }
.age-card__when { display: flex; flex-wrap: wrap; align-items: center; gap: .4rem .6rem; }
.age-card__day { display: inline-block; padding: .15rem .85rem; border-radius: 999px; background: var(--pink); color: var(--black); font-weight: 800; }
.age-card__time { font-size: 1.2rem; font-weight: 700; }
.age-card__body a { text-decoration: underline; }

/* Adult volunteers */
.volunteer { background: var(--tint); }
.volunteer-card { --tilt: -.6deg; max-width: 52rem; padding: 2rem; border-radius: var(--radius); background: var(--purple); color: var(--white); }
.volunteer-card h2 { color: var(--white); }
.volunteer-card .lead { margin-bottom: 1.25rem; }
.volunteer-card a:not(.button) { color: var(--white); }
.volunteer-card a:focus-visible { outline-color: var(--focus-on-dark); }

/* Inner pages */
.page-hero { background: var(--purple); color: var(--white); padding: clamp(2rem, 5vw, 3.5rem) 0 clamp(3rem, 6vw, 4.5rem); }
.page-hero h1 { margin: 0; color: var(--white); }
.entry-wrap { background: var(--white); }
.entry-wrap > .wrap { padding-top: 3.5rem; }

.site-footer.flow { overflow: visible; }
.site-footer.flow::before { top: -1px; }
.site-footer { padding-top: 4.5rem; }
