@import "reset-picalilli.css";
/*@import "nav.css";*/
@import "layout.css";
@import "fonts.css";

/* Defaults */

:root {
    --font-family-sans: Fontin_Sans_49, alegreyasans, robotoslab, Helvetica, -apple-system, system-ui, sans-serif;
	--font-family-monospace: Consolas, Menlo, Monaco, Andale Mono WT, Andale Mono, Lucida Console, Lucida Sans Typewriter, DejaVu Sans Mono, Bitstream Vera Sans Mono, Liberation Mono, Nimbus Mono L, Courier New, Courier, monospace;
	--font-family-serif: Fontin, alegreya, Georgia, robotoslab, serif;
	--font-family-display: "IM Fell", Georgia, robotoslab, serif;
	font-size: 100%;

	--page-padding-inline: calc((100vi - min(var(--line-length), 80vi)) / 2);

    --gutter: clamp(1rem, 2.5vmax, 1.5rem);
    --line-length: 70ch;
	  --max-width: 1200px; /*1200px*/
    --font-size: clamp(95%, 80% + 0.5vi, 150%);
    --leading: 1.475;
    --padding-inline: 1rem 2rem;
    --padding-block: 1rem 2rem;
	  --font-italic: fontin, georgia, serif;
    --pt-double-canon: 4.666rem;
    --pt-canon: 3.999rem;
    --pt-double-great-primer: 2.999rem;
    --pt-double-pica: 2rem;
    --pt-paragon: 1.666rem;
    --pt-english: 1.166rem;
    --pt-pica: 1rem;
    --pt-small-pica: 0.916rem;
    --pt-long-primer: 0.833rem;
    --pt-bourgeois: 0.75rem;
    font-size: var(--font-size);
    line-height: var(--leading);
    color-scheme: light;
    --accent-color:#5B7C99; /*slate blue*/
	  color:#333;
}

/* Theme colors */

:root {
	--color-gray-20: #e0e0e0;
	--color-gray-50: #C0C0C0;
	--color-gray-70: #555555;
	--color-gray-90: #333;

	--background-color: #FAF9F6; /*#f2d5b8;*/

	--text-color: var(--color-gray-90);
	--text-color-light: var(--color-gray-70);
	--text-color-link: #7d610d; /* racing #004225; blue #082840;*/
	--text-color-link-active: #5f2b48;
	--text-color-link-visited: #17050F;

	--syntax-tab-size: 2;
}

@media (prefers-color-scheme: dark) {
	:root {
		--color-gray-20: #e0e0e0;
		--color-gray-50: #C0C0C0;
		--color-gray-90: #dad8d8;

		--background-color: #15202b;
	}
}

html {
	font-size: 1rem;
  font-kerning: auto;
}
body {
	font-family: var(--font-family-sans);
  background-color: var(--background-color);
}
h1 {
	font-size: 2.8rem;
	line-height: 1.1;
}
em {
	font-family: var(--font-italic);
}
blockquote {
	padding-left: 1rem;
  border-left: 1px solid #ccc;
}
blockquote p, blockquote ul, blockquote ol {
	font-family: var(--font-serif);
  color: #777;
}
blockquote p:last-of-type {
	margin-bottom: 1rem;
  padding-bottom: 0;
}

hr.rule {
 margin-top: 3rem;
}

.md-logo {
  margin: 0 auto;
  padding-bottom: 3rem;
}
.homepage {
  font-family: var(--font-family-serif);
  font-size: var(--pt-paragon);
  text-align: center;
  padding-bottom: 3rem;
}
mark {
  background-color: #FFCC00;
}

/* HEADER */

header a.banner {
	font-family: var(--font-family-sans);
	font-size: var(--pt-paragon);
	font-weight: 700;
	line-height: 0.5;
	text-transform: uppercase;
	text-decoration: none;
	color:#333;
}
header a.banner:hover {
	color: var(--accent-color);	
}
.masthead {
	padding-top: 1rem;
	padding-bottom: 1rem;
  margin: 0 auto;
}
.masthead_outer {
  background-color: #FFCC00; /*yellowgreen;*/
}

nav {
  padding-bottom: 3rem;
  padding-top: 1rem;
}
.menu {
  list-style: none;
  display: flex;
  flex-wrap: wrap;
  margin: 0;
  margin-block-start: 0;
  padding-left: 0;
}
.menu li {
  position: relative;
  padding: 1rem 0 0 1rem;
  /*margin-left: 1rem;*/
}
.menu li:first-of-type {
  margin-left: 0;
  padding-left: 0;
}
.menu li:last-of-type {
  padding-bottom: 1rem;
}
.menu a {
  display: block;
  /*padding: 10px;*/
  padding-left: 0;
  transition: background 0.3s, color 0.3s;
  color: var(--accent-color);
  text-decoration: none;
  white-space: nowrap;
}
.menu li:hover > a {
  text-decoration-line: underline;
  text-decoration-thickness: 3px;
  text-decoration-style: solid;
  text-underline-offset: .5rem;
  text-decoration-color: var(--accent-color);
}
/*.menu li:hover > a::after {
  content: " &rarr;";
}*/

.submenu,
.submenu-right {
  display: none;
  position: absolute;
  left: 0;
  right: 0;
  min-width: 200px;
  background-color: var(--background-color);
  border: 1px solid #ccc;
  margin-left: 0;
  padding-right: 1rem;
  list-style: none;
  z-index: 1;
}
.submenu-right {
  width: 300px;
}
.submenu li:first-of-type {
  padding-left: 1rem;
}
.submenu-left {
  margin-left: 1rem;
}
.submenu li a:hover {
  width: 100%;
}

@media (max-width: 768px) {
  .hamburger {
    display: block;
    font-size: 26px;
    color: #333;
    background: none;
    border: none;
    cursor: pointer;
    margin-bottom: 10px;
  }
  .menu {
    display: none;
    flex-direction: column;
    width: auto;  
    /*background: #f2f2f2;*/
  }
  .menu li:first-of-type {
    margin-left: 1rem;
  }
  #menu-toggle {
    display: none;
  }
  #menu-toggle:checked + label + ul {
    display: flex;
  }
  .menu li {
    width: auto;
  }
  .submenu,
  .submenu-right {
    position: static;
    display: none;
    padding-left: 20px;
    border: none;
  }
  .submenu li:first-of-type {
    margin-left: 0;
  }
  .menu li:hover > .submenu,
  .submenu li:hover > .submenu-right {
    display: block;
  }
  .submenu .dropdown > a::after {
    content: "▸";
    float: right;
  }
  .submenu .dropdown:hover > a::after {
    content: "▼";
  }
}

@media (min-width: 767px) {
  .menu li:hover > .submenu {
    display: block;
    top: 100%;
    left: 0;
  }
  .submenu li:hover > .submenu-right {
    display: block;
    top: 0;
    left: 100%;
  }
  .submenu .dropdown > a:after {
    content: "▸";
    float: right;
  }
  .submenu .dropdown:hover > a::after {
    content: "▼";
  }
  .hamburger, #menu-toggle {
    display: none;
  }
}

/* TOC */

.toc {
/*  position: sticky;
  top: 0;
  left: 0;*/
  margin-bottom: 3rem;
  background-color: #FAF9F6;
  z-index: 10;
  border-top: 1px solid #C0C0C0;
  border-bottom: 1px solid #C0C0C0;
}
.toc_inner {
  padding: 1rem;
  list-style: none;
  margin: 0;
}
.toc h2 {
  padding-top: 0;
  padding-bottom: 1rem;
}
.toc_inner li ul {
  list-style-type: square;
  padding-bottom: 0;
  margin-left: 1.5rem;
}

/* MAIN */

article, .blog {
	max-width: var(--line-length);
}
article {
  padding-bottom: 3rem;
}
article p, article ol, article ul {
	padding-bottom: 1rem;
}
/*article p:last-of-type {
  padding-bottom: 0;
}*/
article ul, article ol {
  margin-left: 1rem;
}
.page-title, .section-title {
  font-family: var(--font-family-sans);
  font-size: 2.8rem;
  font-weight: 700;
}
.section-title {
  padding-bottom: 3rem;
}  
article h2 {
	font-weight: 400;
	padding-top: 2rem;
}
.page-description, .section-description {
  padding-top: 1rem;
  padding-bottom: 3rem;
}

article h3, article h4 {
  font-family: var(--font-family-serif);
}
article h3 {
  font-weight: 700;
	padding-top: 1rem;
	padding-bottom: 1rem;
}
article h4 {
  padding-top: 1rem;
  padding-bottom: 0.5rem;
}
.content h2, article h2 {
  padding-bottom: 1rem;
}
article a {
  color: var(--accent-color);
  text-decoration: none;
}
article a:hover {
  text-decoration: underline;
  text-underline-offset: 0.2rem;
}
.post-title {
  padding-top: 1.5rem;
}

.postlist-item {
  list-style: none;
  padding-bottom: 3rem;
}
.postlist-item:first-of-type {
  padding-top: 3rem;
}
.postlist-date, .page-date {
  font-size: var(--pt-long-primer);
  color: #555;
  text-transform:uppercase;
  letter-spacing: 0.1ch;
}
.postlist-title {
  padding-top: 1.5rem;
  padding-bottom: 1rem;
}
  .postlist-title a {
    text-decoration: none;
    color: var(--accent-color);
  }
  .postlist-title a:hover {
    text-decoration: underline;
    text-underline-offset: 0.2rem;
  }
.post-nav {
  padding-bottom: 3rem
}
.post-meta {
  padding-top: 1rem;
}
.post-tags {
  padding-bottom: 0;
}

/* TERMS */

.terms-tags {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  column-gap: 1rem;
}
/*.terms-tags > * {
  flex: 1;
}*/

/* TABLE */

table {
	font-family: var(--font-family-sans);
	font-size: var(--pt-long-primer);
	margin: 0 0 1rem 0;
  width: 100%;
  border-collapse: collapse;
}
th, td {
    border: 1px solid black;
    padding: 8px;
    text-align: left;
}
/* Table caption styling */
th {
    background-color: #f2f2f2;
    font-weight: 700;
}
/* Color the rows
tr:nth-child(1) {
    background-color: #cfe2f3;
}*/
tr:hover {
    background-color: #ddd;
}
p:has(+ table) {
    padding-bottom: 2rem;
}
table:has(+ p) {
    margin-bottom: 2rem;
}
p:has(+ pre) {
    padding-bottom: 2rem;
}
pre:has(+ p) {
    margin-bottom: 2rem;
}
pre:has(+ table) {
  margin-bottom: 2rem;
}


/* CODE */

pre {
	padding: 1rem;
	margin-bottom: 1rem;
}
code {
  font-size: var(--pt-small-pica);
  word-wrap: break-word;
  text-wrap: wrap;
}
.footnote-definition sup + p {
  display: inline;
}

/* FLEXSPACE */

.flex-space {
  display: flex;
  flex-direction: row;
  padding-bottom: 3rem;
}
.flex-space h2 {
  padding-bottom: 1rem;
}
.flexible {
  padding: 1rem;
  border: 3px solid #FFCC00;
  &:last-of-type {
    margin-left: 1rem;
  }
}

.flexible h2 a {
  color: var(--accent-color);
  text-decoration: none;
  &:hover {
    text-decoration-line: underline;
    text-decoration-style: solid;
    text-decoration-thickness: 3px;
    text-underline-offset: .5rem;
  }
}

/* ADVERTISING */

.message {
  display: none;
  /*display: flex;*/
  flex-direction: row;
  gap: 1rem;
  justify-content: center;
  padding-bottom: 3rem;
  padding-top: 3rem;
  border-top: 1px solid #ccc;
}
.flex_item {
  font-size: var(--pt-long-primer);

}
.flex_item img {
  width: 128px;
  height: 128px;
  color: yellowgreen;
}
.flex_item h3 {
  font-size: var(--pt-small-pica);
  font-weight: 700;
  margin-bottom: 1rem;
}
.flex_item.words {
  width: 200px;
}

/* FOOTER */

footer p {
	font-family: var(--font-family-sans);
	font-size: var(--pt-small-pica);
	margin-bottom: 0.5rem;
}
footer a {
  color: var(--accent-color);
	text-decoration: none;
	&:hover {
		text-decoration: underline;
    text-underline-offset: 0.2rem;
	}
}
footer ul {
	display: inline-block;
	font-family: var(--font-family-sans);
	margin-block-start: 0;
	padding-inline-start: 0;
}
footer ul li {
	display: inline-block;
	margin-block-start: 1rem;
	margin-right: 1rem;
}

ul.social li {
	display: inline-block;
	border-bottom: none;
}
.analytics {
	padding-top: 1rem;
}

/* IMAGES & VIDEOS */

img {
	max-inline-size: 100%;
	height: auto;
}
figure {
	padding: 0 0 2rem 0;
}
figcaption {
	font-family: var(--font-family-sans);
	font-size: var(--pt-long-primer);
  padding-top: 0.3rem;
}
.page-image {
	padding-bottom: 3rem;
}
.video {
  padding-bottom: 3rem;
}
iframe {
  width: 100%;
  aspect-ratio: 16 / 9;
  max-width: 100%;
  height: auto;
  border: 1px solid #ccc
}

@media (max-width: 768px) {
  main {
    border-bottom: none;
  }
  .message {
    flex-direction: column;
    align-items: center;
  }
  .words {
    text-align: center;
  }
}