/* Updated 2025 02 07 */

/* RESET */
* { position: relative; box-sizing: border-box;	background-clip: padding-box; max-width: 100%; line-height: calc(1em + 0.5rem); }
*, *::before, *::after { margin: 0; padding: 0; box-sizing: border-box; overscroll-behavior: contain; }


:root {
	line-sizing: normal; 
	text-spacing: trim-start allow-end trim-adjacent ideograph-alpha ideograph-numeric;

	--font:		16;
	--dark:		63,42,85;
	--light:	#9a999a;
	--medium:	#005B56;
	--grey:		#222;
	--gold:		#ffb100;
	--hover:	all .2s ease-in-out;
	--scale:	scale(1.1);
}

html {
	-moz-text-size-adjust: none;
	-webkit-text-size-adjust: none;
	text-size-adjust: none;
	/* font adjust is now available */
	hanging-punctuation: first allow-end last;
	tab-size: 2;
	word-break: break-word;
}

::-webkit-scrollbar { width: 20px; }
::-webkit-scrollbar-track { background: #000; }
::-webkit-scrollbar-thumb { min-height: 100px; background: #6BAF8D; border-radius: 10px; }


body { 
	margin: unset;
	font: normal 16px/1.5 sans-serif;
	color: #222;
	hanging-punctuation: first last;
	text-rendering: optimizeSpeed;
	overflow-x: hidden;
	overflow-y: scroll;
	scroll-behavior: smooth;
}


h1,
h2 {
  font-weight: 900;
  letter-spacing: -0.02rem;
}
h1,
h2,
h3 {
  line-height: 1.1;
}
h1,
h2,
h3,
h4,
h5,
h6 {
  text-wrap: balance;
  margin-block-start: 0;
}

p,
li,
dd {
  text-wrap: pretty;
  max-inline-size: 88ch;
}

sub,
sup {
  font-size: 75%;
  line-height: 0;
  position: relative;
  vertical-align: baseline;
}
sub {
  inset-block-end: -0.25em;
}
sup {
  inset-block-start: -0.5em;
}

pre,
code,
kbd,
samp {
  font-family: ui-monospace, SFMono-Regular, monospace;
}

text-underline-offset: 2px;
  &:not(:is(:hover, :focus)) {
    text-decoration-color: color-mix(in srgb, currentColor, transparent 50%);
  }



h1, h2, h3, h4, h5, h6 {
	margin: 0 0 2em;
	text-wrap: balance;
	overflow-wrap: break-word;
}
	
:is(h1, h2, h3) + * {
	margin-bottom: 0.5em;
}

:is(h2, h3, h4):target, [id] {
  scroll-margin-top: var(--header-height);
  scroll-margin-top: 2rem;
}


p, dl, ol, ul, address {
	margin: 0 0 24px;
	text-wrap: pretty;
	overflow-wrap: break-word;
}

article > * + * {
	margin-top: 2em;
}

dd, li { 
	margin: 0 0 8px 32px; 
}

dl, ol, ul {
	padding-inline-start: 2ch;
}

img,
video,
iframe {
  display: block;
  max-inline-size: 100%;
  block-size: auto;
  border-style: none;
}

figure {
  inline-size: fit-content;
  margin-inline: auto;
}
figcaption {
  contain: inline-size;
  font-size: 90%;
}

input,
select,
textarea,
button {
  font: inherit;
  /* FUTURE: apperance: base; */
}
label {
  display: block;
}
input:not(
  :where(
    [type="submit"],
    [type="checkbox"],
    [type="radio"],
    [type="button"],
    [type="reset"]
  )
) {
  inline-size: 100%;
}
button,
input:where(
  [type="submit"],
  [type="reset"],
  [type="button"]
) {
  background: CanvasText;
  color: Canvas;
  border: 1px solid transparent;
}
textarea {
  field-sizing: content;
  min-block-size: 5lh;
  inline-size: 100%;
  max-inline-size: 100%;
}



/* Links without a class get default styling. */
a:not([class]) { 
	text-decoration: none; 
	cursor: pointer; 
}

sub,sup{
	font-size:75%;
	line-height:0;
	vertical-align:baseline;
}

sup { top: -.5em; }
sub { bottom: -.25em; }



/* IMAGES */

.featured-image {
	display: none;
}

.featured-image:has(img) {
  /* styles here */
}

caption, figcaption {
    text-wrap: balance;
}

figcaption {
	max-inline-size: max-content;
	margin-inline: auto;
}


ul,ol,dl,dt,dd,p,figure,blockquote {
  hanging-punctuation: first last;
  text-wrap: pretty;
}

article a:visited {
	color: purple;
}

img {
    max-width: 100%;
    height: auto;
    vertical-align: middle;
    font-style: italic;
    background-repeat: no-repeat;
    background-size: cover;
}

/* images fit perfectly */

iframe[src*="youtube"],
iframe[src*="vimeo"] {
  width: 100%;
  max-width: 100%;
  height: auto;
  aspect-ratio: 16 / 9;
}

pre { white-space: pre-wrap; }
hr { border: .5px solid; }
hr {
  border-style: solid;
  border-width: 1px 0 0;
  color: inherit;
  height: 0;
  overflow: visible;
  margin-block: 2.5rem;
}
blockquote { quotes: none; }
blockquote:before, blockquote:after { content: none; }


/* POPOVER as DRAWER - read https://frontendmasters.com/blog/popovers-work-pretty-nicely-as-slide-out-drawers/ */

[popover] {
  ...
  
  &:popover-open {
    z-index: 1;
    position: fixed;
    inset: auto;
    bottom: 0;
    left: 0;
    margin: 0;
    width: 100vi;
    padding: 2rem;
    background: lavender;
    box-shadow: 0 -1rem 5rem oklch(0% 0 0 / 0.33);

    animation: slide-open 0.2s;

    /* Make sure the popup isn't screen-covering */
    max-block-size: 50dvh;
    overflow: auto;
  }
}




/* Layout */

.flex { 				display: flex; gap: 24px; }
.flex-row, .fr { 		flex-direction: row; }
.flex-column, .fc { 	flex-direction: column; }
.justify-center, .jc { 	justify-content: center; }
.justify-around, .ja { 	justify-content: space-around; }
.justify-between, .jb { justify-content: space-between; }
.justify-end, .je { 	justify-content: flex-end; }
.align-center, .ac { 	align-items: center; }
.align-start, .as { 	align-items: flex-start; }
.flex-wrap, .fw { 		flex-wrap: wrap; }

header {
	background: #ddd; 
}

main {
	margin-inline: auto; 
	padding: 24px 24px 100px;
	background: #ddd; 
}

.inner {
	margin-inline: auto;
	width: min(1200px, 100% - 4rem);
}

nav { 
	background: #ccc; 
}

nav ul {
	display: flex; 
	justify-content: center;
	align-items: center;
	flex-wrap: wrap;
	gap: 24px;
	list-style: none;
	margin-inline: auto;
	padding: 0;
	width: 100%;
	background: #bbb;
	text-align: center; }

nav li {
	margin: 0; }

nav .menu a {
	display: inline-block;
	padding: 12px 24px;
	color: #fff;
	text-decoration: none;
	border: 0;
	transition: var(--hover);
}

nav .menu a:hover {
  transform: var(--scale);
}

nav .menu:hover a:not(:hover) {
  opacity: 0.5;
}

nav a {
	display: inline-block;
	padding: 12px 24px;
	background: #999;
	text-decoration: none; }

nav a:hover { 
	color: #fff; 
}

footer { 
	background: #666; 
}

.copy {
		margin: 0;
		padding: 24px;
		font-size: var(--font-sm);
		color: #fff;
		text-align: center;
		text-transform: uppercase; 
}

#skip-link {
	left: -9999px;
}

#skip-link:focus {
	display: block;
	left: auto;
	margin: 100px auto;
	padding: 4px;
	width: fit-content;
	background-color: red;
	color: #fff;
	text-decoration: none;
	outline: 0; 
}

/* ANCHOR LINKS */

a {
	scroll-margin-top: 3rem;
}

a:target { 
  color: red;
  background-color: yellow; 
}

:target {
  scroll-margin: 3rlh;
}

:has(:target) {
  border-color: red;
}

/* Tables */

table {
  caption-side: bottom;
  border-collapse: collapse;
  td {
    font-size: 90%;
  }
  td,
  th {
    word-break: normal;
    border: 1px solid gray;
    padding: 0.5rem;
  }
}
[role="region"][aria-labelledby][tabindex] {
  overflow: auto;
}
caption {
  font-size: 90%;
}

table {
	border-collapse: collapse;
	border-spacing: 0; }

		
/* Focus Styles - USE FOCUS-VISIBLE ONLY */

:focus-visible {
	outline: 2px solid red;
  	outline-offset: 2px; 
}

/* Remove the focus outline */
:focus:not(:focus-visible) {
  outline: none;
}


/* Forms */

form {
	display: grid;
	gap: .5rem;
}

form label {
	text-box-trim: trim-both;
}

form button {
	justify-self: start;
	background-color: var(--accent);
}

form [type="checkbox", type="radio"] {
	accent-color: var(--accent);
}

label:has(required)::after {
	content: "(Required)";
	color: #ccc;
}

label:has(>textarea) { display:block; }

button,
input,
textarea,
select {
  font: inherit;
  letter-spacing: inherit;
  word-spacing: inherit;
}

input,
textarea,
button {
  border: 1px solid gray;
}

textarea {
	min-height: 100px;
}

button {
	-webkit-appearance: none;
	padding: 0;
	min-width: 100px;	
	background: none;
	border: none;
	border-radius: 0;
	text-align: inherit;
	box-shadow: none;
	cursor: pointer;
}


/* Content Layout Shift */
{
  content-visibility: auto; /* doesn't render stuff you can't see */
  contain-intrinsic-size: 1000px; 
}

.btn {
  will-change: transform;
}


/* Utility Classes */

.red { color: #f00; }
.alignleft { float: left; margin: 0 24px 24px 0; }
.alignright { float: right; margin: 0 0 24px 24px; }
b, strong { font-weight: bold; }
i, em { font-style: italic; }
.bible mark { background-color: red; }
.center { text-align: center; }


[hidden], 
[type="hidden"], 
.visually-hidden,
[aria-hidden="true"] {
	border: 0;
	clip: rect(0 0 0 0); 
	clip-path: inset(50%);
	height: 1px;
	margin: -1px;
	overflow: hidden;
	padding: 0;
	position: absolute;
	white-space: nowrap; 
	width: 1px;
}

[hidden] {
  display: none !important;
}
.screenreader-only:not(:focus):not(:active) {
  clip: rect(0 0 0 0);
  clip-path: inset(50%);
  height: 1px;
  overflow: hidden;
  position: absolute;
  white-space: nowrap;
  width: 1px;
}
:focus-visible {
  outline-offset: 2px;
}


/* Mobile Nav */

body.menu-open {
	overflow-y: hidden;
}

.m-menu, nav.mobile {
	display: none;
}

nav.mobile {
	align-items: flex-start; 
	position: absolute; top: 0; left: -300px; z-index: 7; 
	height: 100%; 
	width: 300px;
	box-shadow: 0 0 1000px 1000px rgba(0,0,0,.5);
	overflow-y: scroll;
	overflow-x: hidden;
	transition: all .2s ease-in-out;
}

nav.mobile > div {
	width: 100%;
}

nav.mobile li {
	margin: 0 0 4px;
	padding-left: 10px;
}

nav.mobile a {
	padding: 8px 8px 8px 0;
	font-size: 14px;
}

nav.mobile .sub-menu {
	margin: 0 0 0 8px;
}

nav.mobile .sub-menu li {
	padding-left: 0;
}

nav.mobile .sub-menu a::before {
	content: '\00bb';
	margin-right: 8px;
}

nav.mobile .menu-container::-webkit-scrollbar {
    width: 12px;
}

nav.mobile .menu-container::-webkit-scrollbar-track {
    -webkit-box-shadow: inset 0 0 6px rgba(0,0,0,0.5);
    background-color: #555;
}

nav.mobile .menu-container::-webkit-scrollbar-thumb {
    min-height: 50px;
    background-color: #fc3;
    border-radius: 24px;
    outline: 0 solid slategrey;
}

nav.mobile .menu-container {
 /* for proper scrolling */
    position: absolute; top: 0; left: 0;
	padding: 64px 0;
    height: 100%;
    width: 100%;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
}

.close {
    display: grid; 
	align-items: center;
	position: fixed; top: 52px; right: 6px; z-index: 2;
	margin: 0;
    height: 36px;
    width: 36px;
    background-color: var(--grey);
    font: bold 18px/1px arial, sans-serif;
    color: #fff;
    border: 2px solid var(--grey);
    border-radius: 100%;
	transition: transform .2s ease-in-out;
    cursor: pointer;
}

.close img {
	display: block;
	margin: 0 auto;
	height: 20px;
	width: auto;
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}


@media (prefers-reduced-motion: no-preference) {
	:has(:target) {
		scroll-behavior: smooth;
		scroll-padding-top: 3rem;
	}
}

 @media (prefers-reduced-transparency: reduce) {
    * { opacity: 1; }
  }

@media (max-width: 1040px) {
	nav.top { display: none; }
	.m-menu { display: flex; justify-content: center; align-items: center; gap: 10px; padding: 8px; font-size: 20px; color: #fff; text-align: center; }
	nav.mobile.show { display: flex; transform: translatex(300px); }
	nav.mobile .menu li,
	nav.mobile .menu li a { display: block; width: 100%; }
}


