/**
 * Millco Base CSS.
 * and definitions.
 */


/*=============================
Reset from
https://andy-bell.co.uk/a-more-modern-css-reset/
=============================*/

/* Box sizing rules */

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

/* Prevent font size inflation */
html {
	-moz-text-size-adjust: none;
	-webkit-text-size-adjust: none;
	text-size-adjust: none;
	scrollbar-color: var(--colour-caution-yellow) var(--dark);
	/* Two valid colours.
	The first applies to the thumb of the scrollbar, the second to the track. */
	scroll-behavior: smooth;
}

/* Remove default margin in favour of better control in authored CSS */
body,
h1,
h2,
h3,
h4,
p,
figure,
blockquote,
dl,
dd {
	margin: 0;
}

/* Remove list styles on ul, ol elements with a list role, which suggests default styling will be removed */
ul[role='list'],
ol[role='list'] {
	list-style: none;
}

/* Set core body defaults */
body {
	min-height: 100vh;
	line-height: 1.5;
}


/* Set shorter line heights on headings and interactive elements */
h1,
h2,
h3,
h4,
button,
input,
label {
	line-height: 1.1;
}

/* Balance text wrapping on headings */
:is(h1, h2, h3, h4, .text-balance) {
	text-wrap: balance;
}

/* Make images easier to work with */
img,
picture {
	height: auto;
	max-width: 100%;
	display: block;
}

/* Inherit fonts for inputs and buttons */
input,
button,
textarea,
select {
	font: inherit;
}

/* Make sure textareas without a rows attribute are not tiny */
textarea:not([rows]) {
	min-height: 10em;
}

/* Anything that has been anchored to should have extra scroll margin */
:target {
	scroll-margin-block: 40px;
}

/*=============================
  Link
=============================*/
a {
	color: var(--blue);
	transition: var(--transition);
}

a:hover {
	cursor: pointer;
	color: var(--theme);
	transition: var(--transition);
}


/*=============================
  Img
=============================*/
figure {
	margin: 0;
}

figure img,
svg {
	vertical-align: bottom;
	/* get rid of space for descender */
}

/*=============================
  Components
=============================*/

.alert {
	display: inline-block;
	margin: auto;
	padding: 0.5rem;
	padding-left: 28px;
	border: 2px solid hsl(349, 100%, 95%);
	background-color: hsl(349, 100%, 63%);
	color: white;
	border-radius: 0.5rem;
	position: relative;
	;
}

.alert::before {
	content: '!';
	color: hsl(349, 100%, 63%);
	background-color: white;
	width: 16px;
	height: 16px;
	position: absolute;
	top: 11px;
	left: 6px;
	font-weight: 700;
	border-radius: 50%;
	display: flex;
	align-items: center;
	justify-content: center;
}


.edit-link {
	position: fixed;
	width: 40px;
	top: 120px;
	bottom: auto;
	right: 0;
	border: 2px solid #ccc;
	background-color: var(--theme);
	padding: 4px;
	color: white;
	text-decoration: none;
	border-top-left-radius: 8px;
	border-bottom-left-radius: 8px;
	box-shadow: 2px 2px 4px #666;
	font-size: 0.9rem;

}

.edit-link:hover {
	background-color: #ccc;
	color: var(--dark);
}


/*=============================
  Grid
=============================*/

.grid {
	display: grid;
	width: 100%;
	gap: var(--layout-gutter);
	grid-template-columns: 1fr;
}

.grid_small_1-1 {
	grid-template-columns: 1fr 1fr;
}

@container (min-width: 768px) {

	.grid_1-1 {
		grid-template-columns: 1fr 1fr;
	}

	.grid_1-3 {
		grid-template-columns: 1fr 3fr;
	}

	.grid_1-4 {
		grid-template-columns: 1fr 4fr;
	}

	.grid_2-1 {
		grid-template-columns: 2fr 1fr;
	}

	.grid_1-1-1 {
		grid-template-columns: 1fr 1fr 1fr;
	}

	.grid_1-1-1-1 {
		grid-template-columns: 1fr 1fr;
	}

	.grid_3-1 {
		grid-template-columns: 3fr 1fr;
	}



}

@container (min-width: 992px) {

	.grid_1-1-1-1 {
		grid-template-columns: 1fr 1fr 1fr 1fr;
	}
	
	.grid_1-3-1 {
		grid-template-columns: 1fr 3fr 1fr;
	}

}

.contains {
	container-type: inline-size;
}

.guttered {
	padding-inline: var(--layout-gutter);
}


.d_flex {
	display: flex;
}

.d_inline_flex {
	display: inline-flex;
	align-items: center;
}

.flex_col {
	display: flex;
	flex-direction: column;
}

.gapped {
	gap: var(--gap);
}

.gapped-compactly {
	gap: var(--gap-small);
}

.gapped_demi {
	gap: calc(0.5 * 1em);
}

.gapped_hemi_demi {
	gap: calc(0.25 * 1em);
}

.gapped_large,
.contented.gapped_large {
	gap: var(--layout-gutter);
}

.columns {
	column-count: 2;
	column-gap: var(--layout-gutter, 24px);
}


.columns_3 {
	columns: 3;
}

.columns_4 {
	columns: 4;
}

/*=============================
  Contented
=============================*/

.contented {
	display: flex;
	flex-direction: column;
	gap: var(--2xl, 28px);
}

.contented p {
	max-width: 82ch;
}

.contented ul {
	margin-block: 0;
}

.contented li {
	max-width: 64ch;
}

/*=============================
  Divider
=============================*/
hr {
	border: 0;
	height: 1px;
	background: var(--accent);
	margin: 0;
}

/*=============================
  Alignment
=============================*/
.j_centre,
.justify_centre {
	justify-content: center;
}

.j_start,
.justify_start {
	justify-content: start;
}

.j_end,
.justify_end {
	justify-content: end;
}


/*=============================
  Padding and margins
=============================*/

.p-0 {
	padding: 0 !important;
}

.p-1 {
	padding: 1rem;
}

.pl-1 {
	padding-left: 1rem;
}

.pr-1 {
	padding-right: 1rem;
}

.pt-1 {
	padding-top: 1rem;
}

.pb-1 {
	padding-bottom: 1rem;
}

.p-2,
.p_2 {
	padding: 2rem;
}

.pl-2 {
	padding-left: 2rem;
}

.pr-2 {
	padding-right: 2rem;
}

.pt-2 {
	padding-top: 2rem;
}

.pb-2 {
	padding-bottom: 2rem;
}

.p-4 {
	padding: 4rem;
}

.pl-4 {
	padding-left: 4rem;
}

.pr-4 {
	padding-right: 4rem;
}

.pt-4 {
	padding-top: 4rem;
}

.pb-4 {
	padding-bottom: 4rem;
}

.m-auto {
	margin-left: auto;
	margin-right: auto;
}

.m-0 {
	margin: 0rem;
}

.ml-0,
.ml_0 {
	margin-left: 0rem !important;
}

.mr-0 {
	margin-right: 0rem;
}

.mt-0 {
	margin-top: 0rem;
}

.mb-0 {
	margin-bottom: 0rem;
}

.m-1 {
	margin: 1rem;
}

.ml-1 {
	margin-left: 1rem;
}

.mr-1 {
	margin-right: 1rem;
}

.mt-1 {
	margin-top: 1rem;
}

.mb-1 {
	margin-bottom: 1rem;
}

.m-2 {
	margin: 2rem;
}

.ml-2 {
	margin-left: 2rem;
}

.mr-2 {
	margin-right: 2rem;
}

.mt-2 {
	margin-top: 2rem;
}

.mb-2 {
	margin-bottom: 2rem;
}

.m-4 {
	margin: 4rem;
}

.ml-4 {
	margin-left: 4rem;
}

.mr-4 {
	margin-right: 4rem;
}

.mt-4 {
	margin-top: 4rem;
}

.mb-4 {
	margin-bottom: 4rem;
}

.mt-auto {
	margin: auto;
}

@media screen and (min-width: 768px) {
	.p-lg-0 {
		padding: 0;
	}
}

.pt-gap {
	padding-top: var(--gap);
}


/*=============================
  Accessibility
=============================*/
.sr_only,
.sr-only {
	position: absolute;
	width: 1px;
	height: 1px;
	padding: 0;
	margin: -1px;
	overflow: hidden;
	clip-path: inset(50%);
	white-space: nowrap;
	border-width: 0;
	color: black !important;
	background-color: white !important;
}


/*=============================
  Tables
=============================*/

.table_wrapper {
	max-width: 100%;
	overflow-x: auto;
}

.table_wrapper>table {
	min-width: 360px;
}

table {
	width: 100%;
	border-collapse: collapse;
	margin: 1rem 0 2rem 0;
}

/* Zebra striping */
tr:nth-of-type(odd) {
	background: var(--grey-very-light);
	color: var(--dark)
}

td,
th {
	padding: 6px;
	border: 1px solid #ccc;
	text-align: left;
	font-size: 0.875rem;
}

th {
	background: black;
	color: var(--accent);
	font-weight: bold;
	text-transform: uppercase;
}

/*=============================
  Details animation from
  https://nerdy.dev/open-and-close-transitions-for-the-details-element
=============================*/


details {

	summary {
		display: flex;
		align-items: center;
		gap: var(--2xs, 8px);
		align-self: stretch;
		cursor: pointer;
		width: 100%;
	}

	@media (prefers-reduced-motion: no-preference) {
		interpolate-size: allow-keywords;
	}

	&::details-content {
		opacity: 0;
		block-size: 0;
		overflow-y: clip;
		transition: content-visibility 0.68s allow-discrete, opacity 0.68s, block-size 0.68s;
	}

	&[open]::details-content {
		opacity: 1;
		block-size: auto;
	}
}

@media (max-width: 992px) {
	.nobile {
		display: none !important;
	}
	.mobile {
		display: block;
	}
}

/* oooh can we use view transitions now? */
@view-transition {
	navigation: auto;
}


/* skip link */
a.skip_main {
	left: -999px;
	position: absolute;
	top: auto;
	width: 1px;
	height: 1px;
	overflow: hidden;
	z-index: -999;
	color: #fff;
	background-color: #000;
}

a.skip_main:focus,
a.skip_main:active {
	color: #fff;
	background-color: #000;
	left: auto;
	top: auto;
	width: 30%;
	height: auto;
	overflow: auto;
	margin: 10px 35%;
	padding: 5px;
	border-radius: 15px;
	border: 4px solid var(--accent);
	text-align: center;
	font-size: 1.2em;
	z-index: 1219;
}