/*
---------------------------------------------------
HTML REMINDERS (Ch. 2)
- In the head, specify charset, language, and text direction.
- Declutter the text and use the right marks.
- Designate special strings with markup.
- Mark the text up generally.
---------------------------------------------------
*/



/*
---------------------------------------------------
CSS RESET
---------------------------------------------------
*/

/* (Ch. 2) Make our text actual-size, instead of scaling the design. */
/* Remember to also use the viewport meta tag in HTML. */
/* http://wdbp.net/documentation/viewport-meta-tag-and-at-viewport-css-rule/ */
@-ms-viewport { width: device-width; }
@viewport { width: device-width; }

/* (Ch. 2) Please DO zoom text on rotate. */
* { -webkit-text-size-adjust: auto; }

/* Apply a natural box layout model to all elements, and inherit sensibly
// http://paulirish.com/2012/box-sizing-border-box-ftw
// http://css-tricks.com/inheriting-box-sizing-probably-slightly-better-best-practice/ */
html {
	-moz-box-sizing: border-box;
	-webkit-box-sizing: border-box;
	box-sizing: border-box;
}
*, *:before, *:after {
	-moz-box-sizing: inherit;
	-webkit-box-sizing: inherit;
	box-sizing: inherit;
}



/*
---------------------------------------------------
WEB FONTS

Right now this is basic.

Notes on optimization, for later: (Ch. 2)
“There’s a lot more to using webfonts than this brief description can 
cover. Again, check out Stein’s Webfont Handbook for details on various 
optimization techniques like font subsetting, conditional loading with 
unicode-range, reduced requests with browser caching, and asynchronous 
loading with the CSS Font Loading API.”

---------------------------------------------------
*/

/* @import url("https://use.typekit.net/vzs0iay.css"); :.( */
@font-face {
  src: url('/fonts/FernVariable-Roman-VF.woff2') format("woff2"),
       url('/fonts/FernVariable-Roman-VF.woff') format("woff");
  font-family: 'Fern';
/*  font-weight: 400 800;*/
  font-style: normal;
}
@font-face {
  src: url('/fonts/FernVariable-Italic-VF.woff2') format("woff2"),
       url('/fonts/FernVariable-Italic-VF.woff') format("woff");
  font-family: 'Fern';
  font-style: italic;
/*  font-weight: normal;*/
}
@font-face {
  src: url('/fonts/MalloryMP-Book.woff2') format("woff2"),
       url('/fonts/MalloryMP-Book.woff') format("woff");
  font-family: 'MalloryMP';
  font-style: normal;
  font-weight: normal;
}
@font-face {
  src: url('/fonts/MalloryNrrw-Medium.woff2') format("woff2"),
       url('/fonts/MalloryNrrw-Medium.woff') format("woff");
  font-family: 'MalloryNrrw';
  font-style: normal;
  font-weight: 500;
}
@font-face {
  src: url('/fonts/MalloryNrrw-MediumItalic.woff2') format("woff2"),
       url('/fonts/MalloryNrrw-MediumItalic.woff') format("woff");
  font-family: 'MalloryNrrw';
  font-style: italic;
  font-weight: 500;
}
@font-face {
  src: url('/fonts/MalloryXCond-Bold.woff2') format("woff2"),
       url('/fonts/MalloryXCond-Bold.woff') format("woff");
  font-family: 'MalloryXCond';
  font-style: normal;
  font-weight: 700;
}
@font-face {
  src: url('/fonts/MalloryXCond-BoldItalic.woff2') format("woff2"),
       url('/fonts/MalloryXCond-BoldItalic.woff') format("woff");
  font-family: 'MalloryXCond';
  font-style: italic;
  font-weight: 700;
}
@font-face{
  font-family: 'Source Code VF';
  font-weight: 200 900;
  font-style: normal;
  font-stretch: normal;
  src: url('/fonts/SourceCodeVF-Upright.ttf.woff2') format('woff2-variations'),
       url('/fonts/SourceCodeVF-Upright.ttf.woff') format('woff-variations');
}

@font-face{
  font-family: 'Source Code VF';
  font-weight: 200 900;
  font-style: italic;
  font-stretch: normal;
  src: url('/fonts/SourceCodeVF-Italic.ttf.woff2') format('woff2-variations'),
       url('/fonts/SourceCodeVF-Italic.ttf.woff') format('woff-variations');
}


/*
---------------------------------------------------
VARIABLES & BASICS
---------------------------------------------------
*/

/* Modular scale
https://www.modularscale.com/?0.88&rem&1.618
---------------------*/
:root {
  --ms-9: 75.999;
  --ms-8: 46.971;
  --ms-7: 29.03;
  --ms-6: 17.942;
  --ms-5: 11.089;
  --ms-4: 6.854;
  --ms-3: 4.236;
  --ms-2: 2.618;
  --ms-1: 1.618;
  --ms-0: 1;
  --ms-n1: 0.618;
  --ms-n2: 0.382;
  --ms-n3: 0.236;
  --ms-n4: 0.146;
  --ms-n5: 0.09;
  --ms-n6: 0.056;  
}

/* Color scheme
---------------------*/
:root {
  --brown-hex: #806b60;
  --dark-brown: #434331;
  --mid-brown: #6c6c57;
  --mid-gray: #666;
  --dark-gray: #333;
  --light-gray: #ccc;
  --super-light-gray: #eee;
  --off-white: #FEFEF9;
  --off-white: #f5f5eb;

  --mid-blue: #2E83CE;
  --light-blue: #70B8F6;
  --light-blue: #99ccf8;

  --light-green: rgb(224, 231, 210);
  --mid-green: rgb(172, 186, 145);
  --dark-green: rgb(122, 138, 93);

  --deep-blue: #1C3D59;
  --deep-red: #59231c;
  --black: #000;

  --dark-blue: #1C5483;
  --less-dark-blue: #3874A8;

  --mid-red: #E85851;
  --light-red: #F48C88;

  /* Masthead */
  --masthead-color: var(--black);
  
  /* Links */
  --link-default: var(--mid-blue);
  --link-default-underline:  var(--light-blue);
  --link-visited: var(--mid-gray);
  --link-visited-underline: var(--light-gray);
  --link-hover: var(--mid-red);
  --link-hover-underline: var(--light-red);

  /* Defaults */
  color: var(--mid-gray);
  background: var(--off-white);
}


/*
---------------------------------------------------
IMAGES
---------------------------------------------------
*/
figure {
  margin: 0;
}
figcaption {
  text-align: center;
}
img {
  width: 100%;
  border: 1px var(--super-light-gray) solid;
}
.story img {
  border: none;
}


/*
---------------------------------------------------
TEXT STYLES
---------------------------------------------------
*/
:root {
  font-family: fern, serif;
  font-variation-settings: "wght" 400, "opsz" 12;
  
  /* If using 3rd-party components, prefer to keep this at 100%. */
  /* (Ch. 2) Remember that here it is NOT OK to use px or units that relate to viewport/container dimensions (unless part of a calculation that resolves to font-size-relative units). */
  font-size: 88%;
}

/* Font sizes */
.about h1 {
  font-size: calc(var(--ms-0) * 1rem); }
h2 {
  font-size: calc((var(--ms-1) + var(--ms-n1)) * 1rem); }
h3 {
  font-size: calc((var(--ms-0) + var(--ms-n1)) * 1rem); }
p, q, main ul, pre {
  font-size: calc((var(--ms-0) + var(--ms-n2)) * 1rem); }

@media (min-width: 34em) {
  .about h1 {
    font-size: calc(var(--ms-0) * 1rem); }
  h2 {
    font-size: calc((var(--ms-2) + var(--ms-n1)) * 1rem); }
  h3 {
    font-size: calc((var(--ms-0) + var(--ms-n1)) * 1rem); }
  p, q, main ul, pre {
    font-size: calc(var(--ms-1) * 1rem); }
  .post {
    & p,
    & q,
    & ul {
      font-size: 1.38rem;
      font-variation-settings: "wght" 400, "opsz" 9;
    }
  }
}

  

/*article {
  -webkit-hyphens: auto;
  hyphens: auto;
}*/
.about h1 {
  font-family: MalloryMP, fern, serif;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  margin-block-start: 3.5em;
  padding-block-end: 0.5em;
  border-block-end: 1px rgba(0,0,0,0.2) solid;
  margin-block-end: 1em;
}
h2 {
  font-family: MalloryNrrw, sans-serif;
  font-weight: 500;
  line-height: 1.2;
  color: #000;
  margin-block-end: 0.2em;
  margin-inline-start: -0.05em;
}
h3 {
  font-family: fern, sans-serif;
  font-weight: 400;
  font-style: italic;
  line-height: 1.2;
  color: var(--dark-green);
  margin-block-start: calc(var(--ms-2) * 1rem);
  margin-block-end: calc(var(--ms-0) * 1rem);
}

.story h3 {
  margin-block-start: calc(var(--ms-4) * 1rem);
}

p, q,
main ul {
  line-height: 1.41;
  margin-block-end: 1em;
}

abbr {
  font-feature-settings: "c2sc" 1;
  letter-spacing: 0.05em;
}
main ul,
main ol {
  margin-inline-start: calc(var(--ms-n3) * 1rem);
}
main li + li {
  margin-block-start: calc(var(--ms-0) * 1rem);
}
blockquote {
  margin-inline-start: 0;
  margin-inline-end: 0;
  border-left: 3px var(--light-blue) solid;
  border-left: 1px var(--super-light-gray) solid;
  /*color: #666;*/
  padding-inline-start: calc(var(--ms-0) * 1rem);
  /*margin-inline-start: calc(var(--ms-2) * 1rem);*/

  &.loud {
    margin: 4rem 5%;
    padding: 0;
    border: 0;
    text-align: center;
    font-style: italic;

    p {
      margin-bottom: calc(var(--ms-0) * 1rem);
      font-size: calc(var(--ms-2) * 1rem);
    }
  }
}
cite {
  /*margin-left: 0.5em;*/
  white-space: nowrap;
  font-family: malloryMP, sans-serif;
  font-size: calc(var(--ms-0) * 1rem);
  font-style: normal;
  font-variant-caps: all-small-caps;
  letter-spacing: 0.05em;
  color: var(--brown-hex);
}
q {
  display: block;
  font-style: italic;
}
/* .post p {
  font-size: 1.38rem;
  color: purple !important;
  font-variation-settings: "wght" 400, "opsz" 9;
} */
em {
  /*background-color: #F1F788;*/
  font-style: italic;
}
strong {
/*  font-weight: 700;*/
  font-weight: normal;
  font-variation-settings: "wght" 700, "opsz" 12;
}
p.timestamp + p,
p.timestamp + blockquote {
  margin-block-start: calc(var(--ms-2) * 1rem);
}
p + p {
  margin-block-start: calc(var(--ms-n1) * 1rem);
}
p + cite {
  margin-block-start: calc(var(--ms-0) * -1rem);
}
p code {
  display: inline-block;
  padding: 0 .3em;
  background-color: rgba(0,0,0,0.05);
  font-family: "Source Code VF", monospace;
  font-size: .9em;
}
pre {
  display: block;
  width: 100%;
  padding: 1em;
  background-color: rgba(0,0,0,0.05);
}
pre code {
  font-family: "Source Code VF", monospace;
  font-size: 1.2rem;
}

.about p,
.about ul,
p.timestamp {
  font-family: MalloryMP, sans-serif;
  font-feature-settings: "onum" 1;
  font-size: 0.9375rem;
  line-height: 1.5;
  color: var(--brown-hex);
}
.about ul {
  list-style: none;
  margin: 0;
  padding: 0;
}
.about li {
  margin: calc(var(--ms-n2) * 1rem) 0;
}


/*
---------------------------------------------------
MASTHEAD
---------------------------------------------------
*/
.masthead h1 {
  margin: calc(var(--ms-1) * 1rem) 0;
  /*padding-inline: calc(
    (var(--ms-0) + var(--ms-n1)) * 1rem);*/
  font-family: MalloryXCond, fern, serif;
  font-weight: 700;
  font-size: calc((var(--ms-3) + var(--ms-0)) * 1rem);
  line-height: 1;
  text-align: center;
  color: var(--masthead-color);

  @media (min-width: 40em) {
    font-size: calc(var(--ms-2) * 3.8vw);
    line-height: 1.2;
  }
  @media (min-width: 60em) {
    margin: 0;
    font-size: calc(var(--ms-5) * 0.95vw);
  }
  @media (min-width: 84em) {
    font-size: calc(var(--ms-5) * 1rem);
  }
}

.masthead h1 span {
  display: block;

  @media (min-width: 40em) {
    display: inline;
    &::after {
      content: " · ";
    }
  }
}
.masthead h1 em {
  color: var(--deep-blue);
}
@media (min-width: 60em) {
  .masthead {
    padding-inline: 0;
  }
}


/*
---------------------------------------------------
LAYOUT
---------------------------------------------------
*/

/* Add some room at the bottom of the composition 
body { margin-block-end: calc(var(--ms-5) * 1rem); }*/

body {

  /* Set up a flex container to hold the header, main, and footer */
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

main {
  /* Give the main text area horizontal padding */
  padding-inline: calc(var(--ms-n1) * 1rem);
  padding-inline: 0;

  /* Flex the main area to fill the space between header and footer */
  flex-grow: 1;
}

/* Put space + line between posts, and not after last */
article {
  padding-block-end: calc(var(--ms-3) * 1rem);
  border-block-end: 1px var(--light-green) solid;
  margin-block-end: calc(var(--ms-3) * 1rem);
}
article:last-of-type {
  padding-block-end: 0;
  border-block-end: none;
}

.blog {
  /*max-width: 54rem;*/
  margin-inline: auto;

  background-color: #fff;
  margin-block-start: calc(var(--ms-2) * 1rem);
  /*border-top: 3px var(--light-green) solid;*/
  padding-block-start: calc(var(--ms-2) * 1rem);
  padding-block-end: calc((var(--ms-3) + var(--ms-n1)) * 1rem);
  padding-inline: calc((var(--ms-0) + var(--ms-n1)) * 1rem);  

  --shadow-color: 60deg 20% 62%;
  box-shadow: 0px 0.1px 0.1px hsl(var(--shadow-color) / 0.34),
  0px 0.5px 0.6px -0.4px hsl(var(--shadow-color) / 0.34),
  0px 1px 1.1px -0.7px hsl(var(--shadow-color) / 0.34),
  0px 1.6px 1.8px -1.1px hsl(var(--shadow-color) / 0.34),
  0px 2.6px 2.9px -1.4px hsl(var(--shadow-color) / 0.34),
  0px 4.1px 4.6px -1.8px hsl(var(--shadow-color) / 0.34),
  0.1px 6.2px 7px -2.1px hsl(var(--shadow-color) / 0.34),
  0.1px 9.1px 10.2px -2.5px hsl(var(--shadow-color) / 0.34);
  box-shadow: 0 0.2em 0.3em rgba(23,46,71,0.2);
}

.stories {
  margin-block: calc(var(--ms-4) * 1rem);
  margin-inline: auto;
  padding-inline: calc(var(--ms-0) * 1rem);
  max-width: 30em;
}

.about {
  max-width: 25rem;
  margin-inline: auto;
  padding-inline: calc(var(--ms-0) * 1rem);
}

@media (min-width: 40em) {
  .blog {
    padding-block-start: calc(var(--ms-2) * 1rem);
    padding-inline: calc(var(--ms-2) * 1rem);
    margin-inline: calc(var(--ms-1) * 1rem);
  }
}

@media (min-width: 45em) {
  .blog {
    padding-inline: calc(var(--ms-3) * 1rem);
  }
  .about {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr;
    gap: calc(var(--ms-2) * 1rem);
    padding-inline: calc(var(--ms-2) * 1rem);
    max-width: none;
  }
}

@media (min-width: 62em) {
  main {
    display: grid;
    max-inline-size: 78rem;
    margin-inline: auto;
    grid-template-columns: 5fr 15rem;
    gap: calc(var(--ms-2) * 1rem);
    padding-inline: calc(var(--ms-2) * 1rem);
  }
  .masthead {
    grid-row-start: 1;
    grid-column: 1 / -1;
  }
  .stories {
    grid-row-start: 3;
    grid-column: 1 / -1;
    margin-block: calc(var(--ms-2) * 1rem);
  }
  .blog {
    grid-column: 1 / span 1;
    margin-top: 0;
    border-top: none;
    padding-inline: calc((var(--ms-3) + var(--ms-n1)) * 1rem);
    margin-inline: 0;
  }
  .about {
    display: block;
    grid-column: 2 / span 1;
    padding-inline: 0;
  }
}

@media (min-width: 80em) {
  main {
    display: grid;
    grid-template-columns: 2fr 5fr 15rem;
    gap: calc(var(--ms-2) * 1rem);
    margin: calc(var(--ms-0) * 1rem);
    max-inline-size: 100rem;
    margin-inline: auto;
    border-block-start: none;
    padding-inline: calc(var(--ms-2) * 1rem);
  }
  .masthead {
    grid-row-start: 1;
    grid-column: 1 / -1;
  }
  .stories {
    grid-row-start: 2;
    grid-column: 1 / span 1;
  }
  .blog {
    grid-column: 2 / span 1;
    margin-top: 0;
    border-top: none;
    padding-inline: calc((var(--ms-3) + var(--ms-n1)) * 1rem);  
  }
  .about {
    grid-column: 3 / span 1;
  }
}


/*
---------------------------------------------------
STORIES SIDEBAR
---------------------------------------------------
*/
.stories {
  text-align: center;
  color: var(--dark-green);
}
.stories h2 {
  font-family: fern;
  font-style: italic;
  color: olivedrab;
  font-variation-settings: "wght" 400, "opsz" 12;
  font-size: calc(var(--ms-1) * 1rem);
  /*text-transform: uppercase;*/
  letter-spacing: 0.03em;
  border-block-end: 1px var(--light-gray) solid;
  margin-block-end: calc(var(--ms-2) * 1rem);
}
.stories p + p {
  margin-block-start: calc(var(--ms-3) * 1rem);
}


/*
---------------------------------------------------
HEADER AREA (MAP)
---------------------------------------------------
*/
header {
  /* margin-block-end: 7.5rem; */
  width: 100%;
  height: 13.7325rem;
  background: #1C3D59 url("https://assets.codepen.io/4764/Slice+1_1.png");
  background-size: contain;
  background-position: center;
  border-bottom: calc(var(--ms-n1) * 1rem) #A1CFF7 solid;
}
header h1 {
  font-family: MalloryMP;
  font-size: 1em;
  text-align: center;
}
header h1 a:link,
header h1 a:visited,
header h1 a:hover,
header h1 a:active {
  color: rgba(255,255,255,0.8);
  text-decoration: none;
}

/* Nav
---------------------*/
.skip {
  position: absolute;
  inset-block-start: -9999px;
}
nav {
  position: absolute;
  inset-block-start: 0;
  height: 13.7325rem;
  width: 100vw;
}
nav ul {
  position: absolute;
  width: 100vw;
  inset-block-end: -0.5rem;
  list-style-type: none;

  display: flex;
  justify-content: center;
  gap: calc(var(--ms-n3) * 1rem);
  
  padding-inline-start: 0;
  font-family: fern, adobe-caslon-pro, serif;
  font-style: italic;
  font-size: calc(var(--ms-1) * 1rem);
  /*font-size: 1.667rem;*/
}
nav li {
  padding: 0.889rem;
  /*order: 1;*/
  color: var(--light-blue);
  /*opacity: 0.3;*/
}
nav a {
  text-decoration: none;
  color: var(--light-blue);
  opacity: 0.6;
}
nav li.nav-now a {
  color: #fff;
  opacity: 1;
  text-decoration: underline;
  text-underline-offset: 0.2em;
  text-decoration-thickness: 1px;
}
nav a:hover,
nav a:active {
  color: #fff;
  opacity: 1;
  text-decoration: underline;
  text-underline-offset: 0.2em;
  text-decoration-thickness: 1px;
}


/*
---------------------------------------------------
FOOTER
---------------------------------------------------
*/
footer {
  margin-block-start: calc(var(--ms-3) * 1rem);
  padding-block-start: calc(var(--ms-n2) * 1rem);
  padding-inline: calc(var(--ms-0) * 1rem);
  width: 100%;
  height: 13.7325rem;
  background-color: var(--light-green);
  text-align: center;
}
footer p {
  font-family: malloryMP, sans-serif;
  font-size: calc(var(--ms-0) * 1rem);
  line-height: 1.5;
  color: var(--dark-green);

  span {
    white-space: nowrap;
  }
}


/*
---------------------------------------------------
LINK STYLES
---------------------------------------------------
*/
main a,
footer a {
  text-decoration: underline;
  text-decoration-thickness: 0.05em;
  text-underline-offset: 0.1em;
}
main a:link,
footer a:link {
  color: var(--link-default);
  text-decoration-color: var(--link-default-underline);
}
main a:visited,
footer a:visited {
  color: var(--link-visited);
  text-decoration-color: var(--link-visited-underline);
}
main a:hover,
main a:active,
footer a:hover,
footer a:active {
  color: var(--link-hover);
  text-decoration-color: var(--link-hover-underline);
  text-decoration-thickness: 0.1em;
}
p.timestamp a {
  text-decoration: none;
  &:link,
  &:visited {
    color: var(--brown-hex);
  }
  &:hover,
  &:active {
    color: var(--link-hover);
    text-decoration: underline;
  }
}
.stories a {
  &:link,
  &:visited {
    color: var(--dark-greeen);
    text-decoration-color: var(--mid-green);
  }
  &:hover,
  &:active {
    color: var(--link-hover);
    text-decoration: underline;
    text-decoration-color: var(--link-hover-underline);
  }
}


/*
---------------------------------------------------
INDIVIDUAL POST PAGES
---------------------------------------------------
*/
/*.note {
  background-color: #fff;
}

.note .blog {
  box-shadow: none;
}

.note .blog:before {
  display: none;
  content: "";
  height: 30px;
  width: 30px;
  position: fixed;
  top: 50dvh; left: 400px;
  border-radius: 100px;
  background-color: red;
}*/

.note .blog {
  margin-block-start: calc(var(--ms-2) * 1rem);
}

@media (min-width: 40em) {
  .note main {
    max-inline-size: 51em;
    margin-inline: auto;
  }
}
@media (min-width: 60em) {
  .note main {
    display: block;
    max-inline-size: 51em;
    margin-inline: auto;
  }
}
@media (min-width: 80em) {
  .note main {
    display: grid;
    grid-template-columns: 2fr 5fr 15rem;
    gap: calc(var(--ms-2) * 1rem);
    margin: calc(var(--ms-0) * 1rem);
    max-inline-size: 100rem;
    margin-inline: auto;
    border-block-start: none;
    padding-inline: calc(var(--ms-2) * 1rem);
  }
  /*.note .blog {
    box-shadow: none;
    border-left: 2em gray solid;
    margin-left: -2em;
  }*/
}

/* Consider adding knee/bed/breakfast settings
https://alistapart.com/article/a-simpler-page/ 
.switcher {
  position: absolute;
  top: 200px;
  left: 10px;
}
:root:has(#t1:checked) {
  font-size: 88%;
  --mq-1: 40em;
  --mq-2: 45em;
  --mq-3: 60em;
  --mq-4: 62em;
  --mq-5: 80em;
}
:root:has(#t2:checked) {
  font-size: 100%;
}
:root:has(#t3:checked) {
  font-size: 150%;
}*/






/*
---------------------------------------------------
BUG FIXES TO ORGANIZE LATER
---------------------------------------------------
*/

/* Fix a strange gap surrounding the whole composition.
This should be part of reset styles, right? */
body {
  margin: 0;
}
header {
  padding-top: 1px;
}