/*! HTML5 Boilerplate v6.0.1 | MIT License | https://html5boilerplate.com/ */

/*
 * What follows is the result of much research on cross-browser styling.
 * Credit left inline and big thanks to Nicolas Gallagher, Jonathan Neal,
 * Kroc Camen, and the H5BP dev community and team.
 */

/* ==========================================================================
   Base styles: opinionated defaults
   ========================================================================== */

html {
  color: var(--color-text);
  font-family: "yrsa";
  font-size: 1.5em;
  font-weight: 300;
  font-style: normal;
  line-height: 1.5;
  max-width: 50em;
  margin: 0 auto;
  background-color: var(--color-background);
}

/*
 * Remove text-shadow in selection highlight:
 * https://twitter.com/miketaylr/status/12228805301
 *
 * Vendor-prefixed and regular ::selection selectors cannot be combined:
 * https://stackoverflow.com/a/16982510/7133471
 *
 * Customize the background color to match your design.
 */

::-moz-selection {
  background: #b3d4fc;
  text-shadow: none;
}

::selection {
  background: #b3d4fc;
  text-shadow: none;
}

/*
 * A better looking default horizontal rule
 */

hr {
  display: block;
  height: 1px;
  border: 0;
  border-top: 1px solid #ccc;
  margin: 1em 0;
  padding: 0;
}

/*
 * Remove the gap between audio, canvas, iframes,
 * images, videos and the bottom of their containers:
 * https://github.com/h5bp/html5-boilerplate/issues/440
 */

audio,
canvas,
iframe,
img,
svg,
video {
  vertical-align: middle;
}

/*
 * Remove default fieldset styles.
 */

fieldset {
  border: 0;
  margin: 0;
  padding: 0;
}

/*
 * Allow only vertical resizing of textareas.
 */

textarea {
  resize: vertical;
}

/* ==========================================================================
   Browser Upgrade Prompt
   ========================================================================== */

.browserupgrade {
  margin: 0.2em 0;
  background: #ccc;
  color: #000;
  padding: 0.2em 0;
}

/* ==========================================================================
   Author's custom styles
   ========================================================================== */

@font-face {
  font-family: "EstiloText-Regular";
  src: url("../fonts/EstiloText-Regular.otf");
  font-weight: normal;
  font-style: normal;
}

@font-face {
  font-family: "EstiloText-Bold";
  src: url("../fonts/EstiloText-Bold.otf");
  font-weight: normal;
  font-style: normal;
}

@font-face {
  font-family: "EstiloText-Light";
  src: url("../fonts/EstiloText-Light.otf");
  font-weight: normal;
  font-style: normal;
}

@font-face {
  font-family: "FiraCode-Light";
  src: url("../fonts/FiraCode-Light.otf");
  font-weight: normal;
  font-style: normal;
}

@font-face {
  font-family: "FiraCode-Regular";
  src: url("../fonts/FiraCode-Regular.otf");
  font-weight: normal;
  font-style: normal;
}

@font-face {
  font-family: "FiraCode-Retina";
  src: url("../fonts/FiraCode-Retina.otf");
  font-weight: normal;
  font-style: normal;
}

body {
  padding: 2em 4em 6em 4em;
  background-image: url("../img/avatar.png");
  background-repeat: no-repeat;
  background-position: bottom;
}

a {
  text-decoration: none;
  color: var(--color-link);
  transition: background-color 0.15s ease-in-out,
    border-bottom 0.15s ease-in-out;
  background-color: transparent;
}

blockquote {
  font-style: italic;
  padding-left: 0.5em;
  margin-bottom: 2em;
  border-left: 0.15em solid var(--color-sand);
}

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

pre {
  font-family: "FiraCode-Regular", "Andale Mono", Monaco, monospace;
  font-size: 0.8em;
  white-space: pre-wrap;
  background-color: var(--color-code-background);
  overflow-x: scroll;
}

code {
  display: inline-block;
  font-family: "FiraCode-Regular", "Andale Mono", Monaco, monospace;
  font-size: 0.8em;
  background: #fff;
  color: var(--color-code);
  background-color: var(--color-code-background);
  padding: 0 0.2em 0 0.2em;
}

pre > code {
  margin: 0.5em;
  background-color: transparent;
  max-width: none;
  width: 51em;
}

/* ==================
   Custom Brand Color
   ================== */

:root {
  --color-chocolate: #383127;
  --color-orange: #f16529;
  --color-turquoise: #66a99c;
  --color-sand: #e4dbc0;
  --color-sepia: #f9f3e8;
  --color-aluminum: #666;
  --color-link: #c58407;
  --color-tagline: #66a99c;
  --color-code: #785d3d;
  --color-code-background: #f6eedc;
  --color-background: #fff;
  --color-text: #222;
}

/* =================
   Navigation Styles
   ================= */

nav {
  max-width: 25em;
  float: right;
  padding-top: 0.5em;
}

nav ul {
  list-style: none;
  margin: 0.2em;
  padding: 0;
  text-align: right;
}

nav ul li {
}

nav ul li a {
  font-family: "EstiloText-Light";
  display: inline-block;
  padding: 0.4em;
}

/* ===========
   Text Styles
   =========== */

.brand {
  margin-bottom: 2em;
  overflow: auto;
}

.logo {
  float: left;
}

.title {
  font-family: "EstiloText-Light";
  font-size: 2.7em;
  color: var(--color-orange);
  margin: 0;
}

.title > a {
  text-decoration: none;
  color: var(--color-orange);
}

.tagline {
  font-family: "EstiloText-Light";
  font-size: 1em;
  color: var(--color-tagline);
  margin: 0;
}

.heading > h1 {
  margin: 0;
  font-weight: 400;
}

.byline {
  font-size: 0.8em;
  color: var(--color-aluminum);
  margin: 0;
}

.footnotes {
  margin-top: 0.5em;
  border-top: 0.1em solid var(--color-sepia);
  font-size: 0.8em;
}

.summary {
  margin-bottom: 1em;
  border-bottom: 0.1em solid var(--color-code-background);
}

.footer {
  text-align: center;
  margin-top: 4em;
  margin-bottom: 5em;
}

.copyright {
  font-family: "EstiloText-Light";
  font-size: 0.8em;
  color: var(--color-aluminum);
}

.progress {
    padding: 0 0 0 1em;
    font-size: 2em;
}

article > h3,
article > h4 {
  font-weight: 400;
}

article:not(.summary) > p:first-of-type:first-letter {
  color: var(--color-orange);
  float: left;
  font-family: "pt-serif";
  font-size: 5.5em;
  line-height: 0.7em;
  padding-top: 0.05em;
  padding-right: 0.1em;
  padding-left: 0.04em;
}

/* ==========================================================================
   Helper classes
   ========================================================================== */

/*
 * Hide visually and from screen readers
 */

.hidden {
  display: none !important;
}

/*
 * Hide only visually, but have it available for screen readers:
 * https://snook.ca/archives/html_and_css/hiding-content-for-accessibility
 *
 * 1. For long content, line feeds are not interpreted as spaces and small width
 *    causes content to wrap 1 word per line:
 *    https://medium.com/@jessebeach/beware-smushed-off-screen-accessible-text-5952a4c2cbfe
 */

.visuallyhidden {
  border: 0;
  clip: rect(0 0 0 0);
  -webkit-clip-path: inset(50%);
  clip-path: inset(50%);
  height: 1px;
  margin: -1px;
  overflow: hidden;
  padding: 0;
  position: absolute;
  width: 1px;
  white-space: nowrap; /* 1 */
}

/*
 * Extends the .visuallyhidden class to allow the element
 * to be focusable when navigated to via the keyboard:
 * https://www.drupal.org/node/897638
 */

.visuallyhidden.focusable:active,
.visuallyhidden.focusable:focus {
  clip: auto;
  -webkit-clip-path: none;
  clip-path: none;
  height: auto;
  margin: 0;
  overflow: visible;
  position: static;
  width: auto;
  white-space: inherit;
}

/*
 * Hide visually and from screen readers, but maintain layout
 */

.invisible {
  visibility: hidden;
}

/*
 * Clearfix: contain floats
 *
 * For modern browsers
 * 1. The space content is one way to avoid an Opera bug when the
 *    `contenteditable` attribute is included anywhere else in the document.
 *    Otherwise it causes space to appear at the top and bottom of elements
 *    that receive the `clearfix` class.
 * 2. The use of `table` rather than `block` is only necessary if using
 *    `:before` to contain the top-margins of child elements.
 */

.clearfix:before,
.clearfix:after {
  content: " "; /* 1 */
  display: table; /* 2 */
}

.clearfix:after {
  clear: both;
}

/* ==========================================================================
   EXAMPLE Media Queries for Responsive Design.
   These examples override the primary ('mobile first') styles.
   Modify as content requires.
   ========================================================================== */

@media (prefers-color-scheme: dark) {
  :root {
    --color-chocolate: #383127;
    --color-orange: #f16529;
    --color-turquoise: #66a99c;
    --color-sand: #e4dbc0;
    --color-sepia: #f9f3e8;
    --color-aluminum: #ccc;
    --color-link: #c58407;
    --color-tagline: #66a99c;
    --color-code: #ccba74;
    --color-code-background: none;
    --color-background: #202020;
    --color-text: #d0d0d0;
  }
}

@media only screen and (min-width: 35em) {
  /* Style adjustments for viewports that meet the condition */
}

@media only screen and (max-width: 640px) and (orientation: portrait) {

  body {
    padding: 1em 1em 6em 1em;
  }

  .brand {}

  .logo {
    float: none;
  }

  .title {
    font-size: 2em;
  }

  nav {
    max-width: 25em;
    padding-top: 0.5em;
    width: 100%;
  }

  nav ul {
    list-style: none;
    margin: 0.2em;
    padding: 0;
    text-align: center;
  }

  nav ul li {
    display: inline-block;
  }

  nav ul li a {
    font-family: "EstiloText-Light";
    display: inline-block;
    padding: 0.4em;
  }
}

@media print,
  (-webkit-min-device-pixel-ratio: 1.25),
  (min-resolution: 1.25dppx),
  (min-resolution: 120dpi) {
  /* Style adjustments for high resolution devices */
}

/* ==========================================================================
   Print styles.
   Inlined to avoid the additional HTTP request:
   http://www.phpied.com/delay-loading-your-print-css/
   ========================================================================== */

@media print {
  *,
  *:before,
  *:after {
    background: transparent !important;
    color: #000 !important; /* Black prints faster:
                                   http://www.sanbeiji.com/archives/953 */
    box-shadow: none !important;
    text-shadow: none !important;
  }

  a,
  a:visited {
    text-decoration: underline;
  }

  a[href]:after {
    content: " (" attr(href) ")";
  }

  abbr[title]:after {
    content: " (" attr(title) ")";
  }

  /*
     * Don't show links that are fragment identifiers,
     * or use the `javascript:` pseudo protocol
     */

  a[href^="#"]:after,
  a[href^="javascript:"]:after {
    content: "";
  }

  pre {
    white-space: pre-wrap !important;
  }
  pre,
  blockquote {
    border: 1px solid #999;
    page-break-inside: avoid;
  }

  /*
     * Printing Tables:
     * http://css-discuss.incutio.com/wiki/Printing_Tables
     */

  thead {
    display: table-header-group;
  }

  tr,
  img {
    page-break-inside: avoid;
  }

  p,
  h2,
  h3 {
    orphans: 3;
    widows: 3;
  }

  h2,
  h3 {
    page-break-after: avoid;
  }
}
