/*************************
 * 	CUSTOM PROPERTIES
 *************************/
:root {
	color-scheme: light dark;
	--base: #fefefe;
	--text: #222;
	--tint: #ededed;
	--accent: #066;
	
	--triangle: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="4 4 20 20" fill="%23066"><path d="M18.5,15.5l-6-7l-6,7H18.5z"/></svg>');
	
	@media( prefers-color-scheme: dark ) {
		--base: #111;
		--text: #eee;
		--tint: #444;
		--accent: aquamarine;
		--triangle: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="aquamarine"><path d="M18.5,15.5l-6-7l-6,7H18.5z"/></svg>');
	}
}

/*************************
 * 	PAGE LAYOUT
 *************************/
*,
*::before,
*::after {
	margin: 0;
	box-sizing: border-box;
}

.flow > * + * {
	margin-top: 1.35em;
}

body {
	max-width: 70ch;
	width: 90vw;
	margin: 5vw auto;
	overflow-x: hidden;
	font-family: system-ui;
	font-size: 1.1875rem;
	line-height: 1.5;
	color: var(--text);
	background-color: var(--base);
	
	> :first-child {
		margin-block-start: 0;
	}
	> :last-child {
		margin-block-end: 0;
	}
}

main {
	margin-block: 3em;
}

/*************************
 * 	ACCESSIBILITY
 *************************/
:focus-visible {
	outline: 3px solid var(--accent);
	box-shadow: 0 0 0 6px #ddd;
	border-radius: 3px;
}

.screen-reader-text {
	border: 0;
	clip: rect(1px, 1px, 1px, 1px);
	clip-path: inset(50%);
	height: 1px;
	margin: -1px;
	overflow: hidden;
	padding: 0;
	position: absolute;
	width: 1px;
	word-wrap: normal !important;
}
.screen-reader-text:focus {
	background-color: #eee;
	clip: auto !important;
	clip-path: none;
	color: #444;
	display: block;
	font-size: 1em;
	height: auto;
	left: 5px;
	line-height: normal;
	padding: 15px 23px 14px;
	text-decoration: none;
	top: 5px;
	width: auto;
	z-index: 100000; /* Above WP toolbar. */
}

/*************************
 * 	TYPOGRAPHY
 *************************/
a {
	color: var(--accent);

	&:hover {
		text-decoration: none;
	}
}

h1,h2,h3,h4 {
	line-height: 1.2;
	text-wrap: balance;
	font-weight: 600;
}

.subhead {
	margin-block-start: 0;
	text-transform: uppercase;
	color: #555;
	font-weight: 550;
	line-height: 1.4;
	font-size: .875em;
	text-wrap: balance
}

hr {
	border: 0;
	border-top: 1px solid var(--tint);
	margin-block: 2rem !important;
}

/* Bold top-level list items if they have children */
ul:has(ul) {
	font-weight: bold;
	
	ul {
		font-weight: normal;
	}
}

li + li {
	margin-block-start: .3125em;
}

img {
	max-width: 100%;
	display: block;
	margin-inline: auto;
}

dt {
	font-weight: 700;
}

dd {
	margin-inline-start: 2em;
}

kbd,
code {
	padding: .125em;
	background-color: var(--tint);
	border: 2px outset var(--tint);
	border-radius: 3px;
	font-family: monospace;
}

code {
	padding: .0625em;
	border-width: 1px;
	border-style: solid;
}

nav {
	ul {
		list-style: none;
		padding: 0;
	}

	li {
		margin-top: 0;
	}

	a:hover {
		text-decoration: underline;
	}
}

/*************************
 * 	SUMMARY / DETAILS
 *************************/
summary {
	padding: .5em 1em;
	background-color: var(--tint);
	border: 1px solid var(--tint);
	color: var(--accent);
	border-radius: 3px;
	outline-offset: 2px;
	font-size: 1.325rem;
	font-weight: 600;
	
	&:hover {
		filter: brightness(95%);
	}
}

summary > * {
	display: inline;
	font-size: inherit;
}

details {
	border: 1px solid var(--accent);
	border-radius: 3px;
	
	> div {
		padding: 2em;
	}
}

/*************************
 * 	BANNER
 *************************/
header,
.logo,
nav,
nav > ul,
nav button {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	justify-content: space-between;
	gap: .5em;
}

header {
	position: relative;
	color: var(--accent);
	z-index: 1;
}

.logo {
	text-decoration: none;
	color: inherit;
		
	path {
		fill: currentColor;
	}
}

.logo__name {
	font-weight: bold;
	font-size: 1.25em;
}

/*************************
 * 	MENU STYLES
 *************************/

.clicky-menu {
	font-weight: 600;

	a,
	button {
		font: inherit;
		text-decoration: none;
		color: inherit;
		cursor: pointer;
	}

	button {
		background-color: transparent;
		border: 0;
	}

	button::after {
		display: block;
		content: "";
		width: 1em;
		height: .75em;
		background: var(--triangle) center / contain no-repeat;
		transform: scaleY(-1);
	}

	button[aria-expanded="true"]::after {
		transform: scaleY(1);
		margin-top: 3px;
	}

	/* Submenus */
	ul {
		margin-top: 10px;
		padding: .25em 0;
		width: 20ch;
		border: 1px solid currentColor;
		background-color: var(--base);
		box-shadow: 2px 2px 5px #666;
		font-weight: 400;
		z-index: 99;
		
		a {
			display: block;
			padding: .25em .5em;
			font-weight: 400;
			font-size: .875em;
		}
	}
}

/*************************
 * 	FOOTER
 *************************/
footer {
	border-top: 1px solid var(--tint);
	padding-top: 3em;
	font-size: .875em;
	opacity: 0.8;
	text-align: center;
	
	h2 {
		font-size: 1.25em;
	}
	
	a {
		color: inherit;
	}
	
	p {
		text-align: left;
	}
	
	nav {
		justify-content: center;
	}
}

/*************************
 * 	FORMS ELEMENTS
 *************************/
form {
	padding: 1em;
	border: 1px solid var(--tint);
	box-shadow: 0 0 3px var(--tint);
	border-radius: 3px;
}

input,
textarea {
	padding: 2px;
	background-color: inherit;
	accent-color: var(--accent);
	font: inherit;
	border: 1px solid var(--accent);
}

fieldset,
legend {
	all: unset;
	display: block;
}

label,
legend {
	display: block;
	margin-block-end: .5em;
	font-weight: 600;
}

fieldset label {
	display: inline-block;
	margin: 0;
	font-weight: 400;
}

input[type="checkbox"],
input[type="radio"] {
	width: 1em;
	height: 1em;
}

textarea {
	min-width: 100%;
	max-width: 100%;
	min-height: calc( 2lh + 4px + 2px ); /* 2 lines + padding + border, I think */
	background: var(--base);
}

form button {
	padding: .5em 1em;
	background-color: var(--accent);
	border: 1px solid var(--accent);
	color: var(--base);
	font: inherit;
	border-radius: 3px;
	outline-offset: 2px;
	
	&:hover {
		filter: brightness(110%);
	}
}

/*************************
 * 	FORM CLASSES
 *************************/
.form-container {
	transition: .5s ease-out;
	transition-property: background-color, border;
}
.success {
	padding: 1em;
	background-color: var(--tint);
	color: var(--accent);
	box-shadow: 0 0 3px var(--tint);
	border-radius: 3px;
}
.radios {
	display: flex;
	gap: .5em 1em;
	flex-wrap: wrap;
}

/*************************
 * 	CLICKY MEU DEFAULTS
 *************************/
.clicky-menu ul {
	position: absolute;
	top: 100%;
	left: 0;
	visibility: hidden;
}

.clicky-menu li {
	position: relative;
}

/**
 * Open/Close Menu Behavior with JS
 */
.clicky-menu ul[aria-hidden="false"] {
	visibility: visible;
}

/* Prevent offscreen-submenus */
.clicky-menu .sub-menu--right {
	left: auto !important;
	right: 0 !important;
}
