/* RESET */
* {
	position: relative;
	box-sizing: border-box;
	background-clip: padding-box;
	max-width: 100%;
	line-height: calc(1em + 0.5rem);
	hyphens: none;
	scroll-behavior: smooth;
}

*,
*::before,
*::after {
	margin: 0;
	padding: 0;
	box-sizing: border-box;
	overscroll-behavior: contain;
}

@font-face {
	font-family: 'Montserrat';
	src: url('/app/css/mont-regular.woff2') format('woff2'),
		url('/app/css/mont-regular.woff') format('woff');
	font-display: swap;
	font-weight: normal;
	font-style: normal;
}

/* READING PROGRESS INDICATOR */
.progress {
	animation: grow-progress auto linear;
	animation-timeline: --page-scroll;
}

.progress {
	position: fixed;
	top: 0;
	left: 0;
	z-index: 10;
	height: 5px;
	width: 100%;
	background: var(--red);
	transform-origin: 0 50%;
}

@keyframes grow-progress {
	from {
		transform: scaleX(0);
	}

	to {
		transform: scaleX(1);
	}
}

/* VARIABLES */
:root {
	line-sizing: normal;
	text-spacing: trim-start allow-end trim-adjacent ideograph-alpha ideograph-numeric;
	height: -moz-fill-available;
	height: -webkit-fill-available;
	-moz-text-size-adjust: none;
	-webkit-text-size-adjust: none;
	text-size-adjust: none;
	scroll-timeline: --page-scroll block;

	--red: #ee3423;
	--verydark: #2c2c2c;
	--dark: #444444;
	--medium: #666666;
	--mediumlight: #dddddd;
	--light: #dddddd;
	--verylight: #eeeeee;
	--bodytext: #222222;
	--white: #ffffff;
	--tnr: 'Times New Roman';
	--hover: all 250ms ease-out;
	--scale: scale(1.15);
}

::target-text {
	background-color: yellow;
	color: #333;
}

/* SCROLLBAR */
::-webkit-scrollbar {
	width: 20px;
}

::-webkit-scrollbar-track {
	background: #000;
}

::-webkit-scrollbar-thumb {
	min-height: 100px;
	background: var(--dark);
	border: 1px solid var(--medium);
	border-radius: 7px;
}


body {
	margin: unset;
	background-color: var(--medium);
	background-image: url(/app/images/topography.avif);
	font: normal 1rem/1.56 Montserrat, sans-serif;
	color: var(--bodytext);
	hanging-punctuation: first last;
	text-rendering: optimizeSpeed;
	overflow-x: hidden;
	overflow-y: scroll;
	overscroll-behavior-y: none;
}

.stackbar {
	position: sticky;
	top: 0;
	z-index: 7;
	display: flex;
	justify-content: space-between;
	align-items: center;
	padding: 0 ;
	min-height: 1rem;
	width: 100%;
	background-color: var(--verydark);
	font-weight: bold;
	color: var(--white);
	border-bottom: 2px solid #000;
}

.stackbar > div {
	display: flex;
	justify-content: center;
	align-items: center; 
	margin: 0;
	height: 40px;
}

.homelink {
	padding-right: 1rem; 
}

.homelink:has(a):hover {
	background-color: var(--red);
}

.homelink a {
	display: flex;
	align-items: center;
}

.stackbar > .library {
	margin: 0 0 0 auto;
	padding: 0 1rem;
}

.library:hover {
	background-color: var(--red);
	color: #fff;
}

.stackbar a:is(:link, :visited, :active) {
	color: var(--white);
}

.stackbar img[src*="arrow"] {
	margin: 0 .75rem;
	height: 1.5rem;
}

.menu {
	justify-content: flex-end;
	width: 40px;
}

.menu:hover {
	background-color: var(--red);
}

.menu,
.menu li {
	list-style-type: none;
	display: flex;
	margin: 0 !important;
	cursor: pointer;
}

.menu > li {
	width: 100%;
}

.menu > li:has(.gear) {
	display: flex;
	justify-content: center;
	align-items: center;
	padding: 12px 0;
}

.gear {
	display: flex;
	align-items: center;
}

.menu li ul {
	position: absolute;
	top: 40px;
	right: 0;
	z-index: 11;
	visibility: hidden;
	margin: 0;
	padding: 0;
	min-width: 125px;
	white-space: nowrap;
}

.menu:hover li ul,
.menu:focus-within li ul {
	visibility: visible;
}

.menu li ul li {
	padding: 1rem;
	background-color: var(--dark);
}

.menu li ul a {
	display: block;
	height: 100%;
	width: 100%;
}

.gearbox li:hover {
	background-color: var(--red);
}


/* HEADER */ 
 
header {
	display: flex;
	flex-direction: column;
	justify-content: center;
	align-items: center;
	flex-wrap: wrap;
	padding: 1rem;
	background-color: black;
	color: var(--white);
	text-align: center;
}

img[src*="spiral.png"] {
	height: 87px;
	width: 100px;
}

header h1 {
	margin-bottom: 0;
	font-family: var(--tnr);
}

.byline {
	margin-top: 0;
}

.section {
	margin: 0;
	font-size: .8rem;
	letter-spacing: 1px;
	text-transform: uppercase;
}

.day {
	margin: 1rem 0 0;
	font-size: .8rem;
	letter-spacing: 1px;
	text-transform: uppercase;
}

p.day-title {
	margin: 0;
	font-size: 1.5rem; 
}

.search-box {
  display: flex;
  justify-content: center;
  align-items: center;
  margin: -100px 0 0;
  padding: 0;
  height: 100px;
  background-color: var(--red);
  transition: all 500ms cubic-bezier(0.420, 0.000, 0.560, 1.230);
}

.search-box input { 
  padding: .5rem;
  text-align: center;
  border: 0;
  border-radius: 50px;
}

.search-box ::-webkit-input-placeholder {
  text-align: center;
}

body.search-open .search-box {
  margin: 0;
  box-shadow: inset auto #000;
  transition: all 500ms cubic-bezier(0.420, 0.000, 0.560, 1.230);
}

#search {
  display: flex; 
	justify-content: center;
	align-items: center;
  height: 40px;
  width: 40px;
  cursor: pointer;
}

#search:hover {
	background-color: var(--red);
}

#search img {
	height: 32px;
	width: 16px;
}

img.search:hover {
	background-color: #444;
}


/* COMMON CONTENT AREA */

main {
	margin: 0 auto;
	padding: 24px 24px 300px;
	min-height: 100vh;
}

.inner {
	margin: 0 auto;
	width: 600px;
}

hgroup {
	margin: 0 0 1rem;
	padding: 1rem;
	background-color: var(--verydark);
	color: var(--white);
	text-align: center;
	border-bottom: 3px solid var(--red);
	border-radius: 7px 7px 0 0;
}

hgroup h2 {
	margin: 0;
	font-size: 1.5rem;
	text-align: center;
}

hgroup h3 {
	margin: 0;
	font-size: 1.25rem;
	text-align: center;
}

.book-intro-2 h3 {
	margin: 0 auto;
	padding: 1rem;
	width: calc(100% - 4rem);
	background-color: var(--verydark);
	text-align: center;
}


/* ARTICLES */

article {
	margin: 0 auto;
	padding: 2rem;
	background-color: rgba(247, 247, 247, 0.8);
	width: 600px;
	border-radius: 3px;
}

article > a {
	padding: 0;
} 

article p a, 
article li a,
article dd a {
	display: inline-block; 
	border-bottom: 1px dashed;
}

article *:nth-child(1) {
	margin-top: 0;
}

article hgroup {
	margin: 0 0 2rem;
	padding: 1rem 0;
	background-color: var(--verydark);
	color: var(--verylight);
	text-align: center;
	border-bottom: 3px solid var(--red);
	border-radius: 3px;
}

article hgroup * {
	margin: 0;
}

article hgroup h2 {
	font-weight: bold;
	font-size: 2rem;
}

article > h2 {
	margin: 0 0 .5rem;
	padding: 0;
	font-weight: bold;
}

article h3,
article h4 {
	margin: 2rem 0 1rem;
	padding: 0;
	font-weight: bold;
}

article>form {
	padding: 0;
}

article img {
	display: block;
	margin: 1rem auto;
	max-width: 100%;
	height: auto;
}

iframe[src*="youtube"] {
	margin: .5rem 0 3rem;
}


/* BOOKS HOME */

body.bookshome {
	background-color: var(--verylightgreen);
	background-image: url(/app/images/topography.png);
}

.bookshome .book-intro {
	padding-top: 0;
}

a.finished {
	display: inline-block;
	margin-top: 1.5rem;
	padding: 1rem 2rem;
	background-color: var(--red);
	font-weight: bold;
	color: var(--white);
	border: 0;
	transition: var(--hover);
}

a.finished:hover {
	background-color: var(--dark);
}

.sh {
	background: yellow;
	scroll-margin: 5rem;
}



/* BIBLE and QUOTES */

p.bible {
	padding: 1rem 2rem;
	background-color: var(--verylight);
	border-left: 5px solid var(--red);
	border-radius: 3px;
}

li > p.bible + p.bible {
	margin-top: 1rem;
}

span.bible {
	color: var(--red);
}

details {
	margin: 2rem 0;
	padding: 1rem;
	background-color: #4e7d7e;
	border-radius: 7px;
}

summary {
	color: #fff;
	cursor: pointer;
	user-select: none;
}

.verses, details > div {
	margin: 1rem 0 0;
	padding: 1rem;
	background-color: var(--verylight);
	border-radius: 7px;
}

.verses h3, details > div h3 {
	margin: 0 0 .25rem;
}

.verses p.bible {
	background-color: var(--white);
	border: 0;
}

.verses p:last-child, details > div p:last-child {
	margin-bottom: 0;
}

.ref {
	font-weight: bold;
	font-size: .75rem;
	color: var(--verydark);
	text-transform: uppercase;
	white-space: nowrap;
}

p.quote {
	background-color: var(--verylight);
	padding: 1rem;
	border-left: 5px solid var(--dark);
	border-radius: 3px;
}

/* TYPOGRAPHY */

h1, h2, h3, h4, h5, h6 {
	font-weight: normal;
	line-height: 1.2;
	text-wrap: balance;
	overflow-wrap: break-word;
}

h1 { font-size: 2.25rem; }

h2 {
	margin: 1rem 0 0;
	font-size: 1.37rem;
}

h3 { font-size: 1.37rem; }

h4, h5, h6 { font-size: 1.12rem; }

:is(h1, h2, h3)+* { margin-bottom: 0.5em; }

p {	margin: 0 0 1rem; }

:is(p, dl, ol, ul, address) {
	text-wrap: pretty;
	overflow-wrap: break-word;
}

ol {
	margin: 0 2rem 1rem; 
}

ul:not(.daylinks) {
	margin: 0 0 1rem 2rem;
}

li {
	margin-bottom: .5rem;
}

li ul:not(.daylinks, .menu ul) {
	margin-top: .5rem;
}

li > p {
	margin-top: 0;
}

dl {
	margin: 0 0 1rem;
}

dt { 
	font-weight: bold;
}

dd {
	margin: 0 0 1rem 1rem;
}

p.quote + p.quote {
	margin-top: 2rem;
}

pre {
	margin: 1rem 0;
	font: normal 1rem/1.56 Montserrat, sans-serif;
}

.note-title {
	margin: 2rem 0 2px;
	padding: 0;
	font-size: 1.2rem;
}

form.notes {
	margin: 0;
}

textarea {
	display: block;
	margin: 0 0 1rem;
	padding: .5rem;
	min-height: 14rem;
	width: 100%;
	border: 1px solid #999;
}

textarea::-webkit-scrollbar {
	width: 4px;
}

textarea::-webkit-scrollbar-track {
	background: var(--white);
	border-left: 1px solid #333;
}

textarea::-webkit-scrollbar-thumb {
	min-height: 20px; max-height: 20px;
	background: var(--red);
	border-radius: 0 0 3px 3px;
}

.note-save {
	display: flex;
	justify-content: flex-end;
	align-items: center;
	flex-wrap: wrap;
	margin: -.75rem 0 2rem;
}

.note-save span {
	display: inline-block;
	padding: 0 1rem;
	color: green;
}

[data-state] {
	padding-right: 1rem;
	font-weight: bold; 
	font-size: .75rem;
}

[data-state="typing"] {
	color: var(--red);
}

[data-state="saved"] {
	color: green;
}

:has([data-state="saved"]) textarea { outline: 2px solid green; }

[data-state="error-connection"] {
	background-color: red;
	color: #fff;
}

.pagination {
	display: flex;
} 

.day-0 .pagination a[href="https://otm.co/app/journey/read.php?day=1"] { margin-left: auto; }
.day-2 .pagination a[href="https://otm.co/app/journey/read.php?day=1"] { margin-right: auto; margin-left: 0; }

.pagination:first-child:nth-last-child(1) a[href*="364"] { margin-right: auto; margin-left: 0; }


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

a:is(:link, :visited, :hover, :active) {
	text-decoration: none;
	touch-action: manipulation;
	user-select: none;
	cursor: pointer;
}

cite.vince {
	display: block;
	margin-top: 1rem;
	font-style: normal;
	font-weight: normal;
}

.vince {
	display: inline;
	font-weight: bold;
}

.btn-wrap {
	display: flex;
	margin: 2rem 0;
}

.btn-wrap:last-child {
	margin-bottom: 0
}

.btn-wrap a {
	padding: 1rem 2rem;
	background-color: var(--red);
	color: var(--white);
	border-radius: 100px;
}

p:has(.go) {
	display: flex;
	justify-content: center;
	margin: 2rem 0;
}

.books-home p.two {
	margin-bottom: 0;
}

.two {
	display: flex;
	justify-content: space-between !important;
	flex-wrap: wrap;
	gap: 2rem;
	margin: 2rem 0 0;
}

.ghost {
	padding: calc(.5rem - 2px) 1rem;
	font-weight: bold;
	color: var(--medium);
	text-decoration: none;
	border: 2px solid var(--medium);
	border-radius: 3px;
	transition: var(--hover);
	cursor: pointer;
}

.ghost:hover {
	background-color: var(--medium);
	color: var(--white);
	border: 2px solid var(--medium);
}

p:has(.btn-intro) {
	display: flex;
	justify-content: center;
	margin-bottom: 2rem;
}

.more,
.btn-intro {
	display: flex;
	align-items: center;
	padding: .25rem 3rem;
	background-color: var(--red);
	color: var(--white);
	text-decoration: none;
	border-radius: 4px;
}

.btn-intro:hover {
	background-color: var(--verydark);
}



.more {
	padding: .5rem 1rem;
	background-color: rgba(0, 0, 0, 0.2);
	color: var(--dark);
	border-radius: 3px;
	transition: var(--hover);
}

.more:hover {
	background-color: var(--dark);
}

.go,
.go:visited {
	display: flex;
	align-items: center;
	padding: .5rem 3rem .5rem 1rem;
	background-color: var(--red);
	color: var(--white);
	text-decoration: none;
	border-radius: 3px;
	user-select: none;
}

.go img {
	left: 1rem;
	height: 1.5rem;
	transition: var(--hover);
}

.go:hover img {
	left: 1.5rem;
}

.begin {
	display: inline-block;
}

.continue {
	display: none;
	display: inline-block;
}

.btn-wrap a:hover {
	background-color: var(--dark);
	transition: var(--hover);
}

.reading-title {
	margin: 2rem 0 0;
	padding: .25rem 0;
	background-color: var(--darkgreen);
	font-weight: bold;
	color: var(--white);
	text-align: center;
	text-transform: uppercase;
}



/* IMAGES */

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

pre {
	white-space: pre-wrap;
}

blockquote {
	quotes: none;
}

blockquote:before,
blockquote:after {
	content: none;
}


/* Books Home Page */

.book-intro,
.box {
	display: flex;
	flex-direction: column;
	margin: 2rem auto;
	padding: 0 0 2rem;
	background-color: rgba(255, 255, 255, 0.5);
	background-color: var(--mediumlight);
	border-radius: 7px;
}

.book-intro>*:not(hgroup) {
	padding: 0 2rem;
}

.book-intro-2 {
	padding: 2rem;
	background-color: var(--mediumlight);
	border-radius: 7px;
}

.book-intro-2 h2,
.book-intro h3 {
	margin: 0 0 2rem;
	padding: .5rem 1rem;
	background-color: var(--dark);
	color: var(--white);
	text-align: center;
	border-radius: 7px;
}

.book-intro h3 {
	margin: 1rem 2rem;
}

.intro {
	margin: 0 0 2rem;
	padding: 0 0 2rem;
	background-color: var(--verylight);
	border-radius: 2px;
}

.intro>* {
	padding: 0 2rem;
}

.byline {
	margin-bottom: 0;
}

/* TOC */

.weekgroup {
	display: flex;
	justify-content: center;
	align-items: center;
	flex-wrap: wrap;
	gap: .5rem;
	margin: 1rem 0 2rem;
	width: 100%;
}

.weekgroup h4 {
	margin: 0 0 .5rem;
	padding: .35rem 0 .25rem 0;
	width: 100%;
	background-color: var(--dark);
	font-weight: normal;
	font-size: .8rem;
	color: var(--white);
	text-align: center;
	text-transform: uppercase;
	border-radius: 2px;
}

.weekgroup a {
	display: flex;
	justify-content: center;
	align-items: center;
	background-color: var(--dark);
	height: 40px;
	width: 40px;
	color: var(--white);
	transition: var(--hover);
}

.weekgroup a:hover {
	background-color: var(--red);
	font-weight: bold;
	color: var(--white);
	transform: var(--scale);
}

.weekgroup a.read {
	background-color: transparent;
	color: var(--red);
	box-shadow: none;
}

.weekgroup a.read:hover {
	background-color: var(--red);
	color: var(--white);
}

.weekgroup a {
	display: inline-block;
	margin: 0;
	height: 60px;
	width: 60px;
	line-height: 60px;
	background-color: white;
	font-size: 1.3em;
	color: var(--red);
	text-align: center;
	white-space: nowrap;
	box-shadow: 0 1px 5px rgba(0, 0, 0, .25);
	transition: transform .15s linear;
}

.weekgroup li a.read {
	background-color: transparent;
	color: var(--red);
	box-shadow: none;
}

.weekgroup li a:hover,
.weekgroup li a.read:hover {
	background-color: #f00;
	color: #fff;
	transform: scale(1.15);
}

.daylinks {
	list-style-type: none;
	display: flex;
	justify-content: center;
	flex-wrap: wrap;
	gap: 1rem;
}

.daylinks li {
	margin: 0;
}

.daylinks a {
	display: inline-block;
	height: 60px;
	width: 60px;
	line-height: 60px;
	background: var(--white);
	font-size: 1.3em;
	color: var(--red);
	text-align: center;
	white-space: nowrap;
	box-shadow: 0 1px 5px rgba(0, 0, 0, .25);
	transition: transform .15s linear;
}

.daylinks li a:hover {
	background: var(--red);
	color: var(--white);
	transform: scale(1.15);
}


/* 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;
}



/* Focus Styles */

:focus-visible {
	outline: 2px solid var(--red);
}

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


/* Forms */

button,
input,
textarea,
select {
	font: inherit;
}

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

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

.btn {
	will-change: transform;
}


/* Utility Classes */

b, strong { font-weight: bold; }
.center { text-align: center; }
.fleft { float: left; margin: 0 1rem 0 0; }
i, em { font-style: italic; }
.left { text-align: left; }
.print { display: none; }
.red { color: var(--red); }
.bgred { display: inline-block; padding: 2px 4px; background-color: var(--red); color: #fff; }
.right { text-align: right; }
.white { color: var(--white); }


[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;
}

@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: 600px) {
	.fleft {
		clear: both;
		float: none;
		margin: 0 auto;
	}
}