/*
 * Solid Teens: base, header and menu, page templates.
 * Footer, strip, social links and the cookie notice are in components.css. Motion is in motion.css.
 * Colours come only from the theme.json palette. Sizes are fluid clamp() values from 360 px to 1440 px.
 */

:root {
	--styi-gutter: var(--wp--style--root--padding-left, clamp(1rem, 0.8333rem + 0.7407vw, 1.5rem));
	--styi-wide: var(--wp--style--global--wide-size, 1320px);
	--styi-header-h: clamp(4rem, 3.5rem + 2.2222vw, 5.5rem);
	--styi-line: rgb(54 79 117 / 0.18);
	scroll-padding-top: calc(var(--styi-header-h) + 1rem);
}

*,
*::before,
*::after {
	box-sizing: border-box;
}

[hidden] {
	display: none !important;
}

button,
input,
select,
textarea {
	font: inherit;
	color: inherit;
	letter-spacing: inherit;
}

img,
svg {
	max-width: 100%;
	height: auto;
}

.styi-sr {
	position: absolute !important;
	width: 1px;
	height: 1px;
	padding: 0;
	margin: -1px;
	overflow: hidden;
	clip-path: inset(50%);
	white-space: nowrap;
	border: 0;
}

/* The skip link target is focused by script, not by the keyboard, so it shows no ring. */
:root [tabindex="-1"]:focus,
:root [tabindex="-1"]:focus-visible {
	outline: none;
}

.wp-site-blocks > * {
	margin-block-start: 0;
}

/* Skip link: hidden until it has keyboard focus. */
.styi-skip {
	position: absolute;
	top: 0.5rem;
	left: 0.5rem;
	z-index: 100;
	padding: 0.75rem 1rem;
	background: var(--wp--preset--color--navy);
	color: var(--wp--preset--color--white);
	font-weight: 700;
	text-decoration: none;
	transform: translateY(-200%);
}

.styi-skip:focus {
	transform: none;
	color: var(--wp--preset--color--white);
}

/* Header */
.styi-site-header {
	position: sticky;
	top: 0;
	z-index: 50;
	background: var(--wp--preset--color--white);
	border-bottom: 1px solid var(--styi-line);
}

.admin-bar .styi-site-header {
	top: var(--wp-admin--admin-bar--height, 0);
}

.styi-header {
	position: relative;
	display: flex;
	align-items: center;
	gap: 0.5rem clamp(0.5rem, 0.1667rem + 1.4815vw, 1.5rem);
	max-width: calc(var(--styi-wide) + 2 * var(--styi-gutter));
	min-height: var(--styi-header-h);
	margin-inline: auto;
	padding-inline: var(--styi-gutter);
}

/* :root keeps this above WordPress's ":root :where(.is-layout-flow) > *" block gap in any stylesheet order,
   so the menu, Talk link and Give button never drop on a page whose blocks queue their own stylesheet. */
:root .styi-header > * {
	margin-block: 0;
}

.styi-logo {
	display: inline-flex;
	margin-right: auto;
	line-height: 0;
}

.styi-logo__img {
	width: auto;
	height: clamp(2.5rem, 2.2917rem + 0.9259vw, 3.125rem);
}

/* On a phone the header shows the stacked mark only: the left 345 of the 1024 units. */
@media (max-width: 29.99rem) {
	.styi-header .styi-logo__img {
		width: calc(clamp(2.5rem, 2.2917rem + 0.9259vw, 3.125rem) * 345 / 401);
		object-fit: cover;
		object-position: left center;
	}
}

.styi-header__talk {
	order: 1;
	font-size: var(--wp--preset--font-size--small);
	font-weight: 700;
	line-height: 1.2;
	white-space: nowrap;
}

.styi-header__talk a {
	display: inline-block;
	padding-block: 0.5rem;
	color: var(--wp--preset--color--navy);
	text-decoration-thickness: 2px;
	text-underline-offset: 0.3em;
}

.styi-header__give {
	order: 2;
	flex-wrap: nowrap;
}

.styi-header__give .wp-block-button__link {
	padding: 0.65em 1.1em;
	font-size: var(--wp--preset--font-size--small);
	white-space: nowrap;
}

:root .wp-block-button__link.has-gold-background-color:hover,
:root .wp-block-button__link.has-gold-background-color:focus-visible {
	background-color: var(--wp--preset--color--amber) !important;
	color: var(--wp--preset--color--navy) !important;
}

/* Main menu: a button and a drop-down panel below 75rem, a row of links above it. */
.styi-nav {
	font-weight: 600;
}

.styi-nav__list {
	margin: 0;
	padding: 0;
	list-style: none;
}

.styi-nav--primary {
	order: 3;
}

.styi-nav__toggle {
	display: inline-flex;
	align-items: center;
	gap: 0.5rem;
	min-height: 2.75rem;
	padding: 0.5rem 0.25rem;
	border: 0;
	border-radius: 0;
	background: transparent;
	color: var(--wp--preset--color--navy);
	font-size: var(--wp--preset--font-size--small);
	font-weight: 700;
	cursor: pointer;
}

.styi-nav__icon,
.styi-nav__icon::before,
.styi-nav__icon::after {
	display: block;
	width: 1.25rem;
	height: 2px;
	background: currentColor;
}

.styi-nav__icon {
	position: relative;
}

.styi-nav__icon::before,
.styi-nav__icon::after {
	content: "";
	position: absolute;
	left: 0;
}

.styi-nav__icon::before {
	top: -6px;
}

.styi-nav__icon::after {
	top: 6px;
}

.styi-nav__toggle[aria-expanded="true"] .styi-nav__icon {
	background: transparent;
}

.styi-nav__toggle[aria-expanded="true"] .styi-nav__icon::before {
	top: 0;
	transform: rotate(45deg);
}

.styi-nav__toggle[aria-expanded="true"] .styi-nav__icon::after {
	top: 0;
	transform: rotate(-45deg);
}

.styi-nav__panel {
	display: none;
	position: absolute;
	top: 100%;
	left: 0;
	right: 0;
	max-height: calc(100dvh - var(--styi-header-h));
	overflow-y: auto;
	padding: var(--wp--preset--spacing--30) var(--styi-gutter) var(--wp--preset--spacing--50);
	background: var(--wp--preset--color--white);
	border-top: 1px solid var(--styi-line);
	border-bottom: 4px solid var(--wp--preset--color--navy);
}

.styi-nav__toggle[aria-expanded="true"] + .styi-nav__panel {
	display: block;
}

/* Until theme.js has bound the menu (html.styi-js), the panel also opens while the Menu button is tapped or
   focused, so a script that fails to load or throws never leaves a dead button on a phone. */
@media (max-width: 74.99rem) {
	:root:not(.styi-js) .styi-nav:hover .styi-nav__panel,
	:root:not(.styi-js) .styi-nav:focus-within .styi-nav__panel {
		display: block;
	}
}

.styi-nav--primary .styi-nav__list a {
	display: block;
	padding: 0.6rem 0;
	color: var(--wp--preset--color--navy);
	font-size: var(--wp--preset--font-size--card);
	font-weight: 800;
	font-stretch: 75%;
	line-height: 1.1;
	text-decoration: none;
}

.styi-nav--primary .styi-nav__list a:hover,
.styi-nav__list a[aria-current="page"] {
	text-decoration: underline;
	text-decoration-thickness: 3px;
	text-underline-offset: 0.3em;
}

@media (min-width: 75rem) {
	.styi-logo {
		margin-right: 0;
	}

	.styi-nav--primary {
		order: 0;
		flex: 1;
	}

	.styi-nav__toggle {
		display: none;
	}

	.styi-nav__panel {
		display: block;
		position: static;
		max-height: none;
		overflow: visible;
		padding: 0;
		border: 0;
		background: transparent;
	}

	.styi-nav--primary .styi-nav__list {
		display: flex;
		justify-content: center;
		gap: clamp(1rem, -1.5rem + 3.3333vw, 2rem);
	}

	.styi-nav--primary .styi-nav__list a {
		padding: 0.5rem 0;
		font-size: var(--wp--preset--font-size--body);
		font-weight: 600;
		font-stretch: 100%;
	}
}

/* Page templates */
.styi-main {
	padding-block: var(--wp--preset--spacing--60) var(--wp--preset--spacing--70);
}

.styi-main > .wp-block-post-content {
	margin-block-start: var(--wp--preset--spacing--50);
}

.styi-page-title {
	margin-block-end: 0;
}

.styi-lead {
	font-size: var(--wp--preset--font-size--lead);
}

.styi-meta {
	color: var(--wp--preset--color--slate);
	font-size: var(--wp--preset--font-size--small);
}

.styi-list .wp-block-post-template {
	padding: 0;
	list-style: none;
}

.styi-list .wp-block-post-template > li {
	padding-block: var(--wp--preset--spacing--40);
	border-bottom: 1px solid var(--styi-line);
}

.styi-list__title a {
	text-decoration: none;
}

.styi-list__title a:hover {
	text-decoration: underline;
}

/* Events (styi/events, styi/event-details): ruled rows like the posts list, soonest first. */
.styi-events {
	margin: 0;
	padding: 0;
	list-style: none;
}

.styi-event {
	padding-block: var(--wp--preset--spacing--40);
	border-bottom: 1px solid var(--styi-line);
}

.styi-event > * {
	margin-block: 0.25rem 0;
}

.styi-event__title {
	font-size: var(--wp--preset--font-size--card);
}

.styi-event__title a {
	text-decoration: none;
}

.styi-event__title a:hover {
	text-decoration: underline;
}

.styi-event__when {
	font-weight: 700;
}

.styi-event-details__list {
	display: grid;
	gap: var(--wp--preset--spacing--20);
	margin: 0 0 var(--wp--preset--spacing--40);
}

.styi-event-details__row {
	display: grid;
	grid-template-columns: 5rem 1fr;
	gap: var(--wp--preset--spacing--30);
	padding-block: var(--wp--preset--spacing--20);
	border-bottom: 1px solid var(--styi-line);
}

.styi-event-details__row dt {
	font-weight: 700;
}

.styi-event-details__row dd {
	margin: 0;
}

.styi-search .wp-block-search__input {
	min-height: 3rem;
	padding-inline: 0.75rem;
	border: 2px solid var(--wp--preset--color--slate);
	border-radius: 0;
	background: var(--wp--preset--color--white);
}

.styi-doors {
	display: flex;
	flex-wrap: wrap;
	gap: 0.75rem;
	padding: 0;
	list-style: none;
}

.styi-doors a {
	display: inline-block;
	padding: 0.75rem 1.25rem;
	border: 2px solid var(--wp--preset--color--navy);
	font-weight: 700;
	text-decoration: none;
}

.styi-doors a:hover {
	background: var(--wp--preset--color--navy);
	color: var(--wp--preset--color--white);
}
