/*
 *  Fonts
 */

/*
 * Commented out until I decide to buy a licence for Input Mono.
 *
 * @font-face {
 *   font-family: "Input Mono";
 *   src: url(/fonts/InputMono-Regular.ttf);
 * }
 */

@font-face {
  font-family: Domitian;
  src: url("/fonts/Domitian-Roman.woff2") format("woff2");
}

@font-face {
  font-family: Domitian;
  src: url("/fonts/Domitian-Bold.woff2") format("woff2");
  font-weight: bold;
}

@font-face {
  font-family: Domitian;
  src: url("/fonts/Domitian-Italic.woff2") format("woff2");
  font-style: italic;
}

@font-face {
  font-family: Domitian;
  src: url("/fonts/Domitian-BoldItalic.woff2") format("woff2");
  font-weight: bold;
  font-style: italic;
}

/*
 *  Base
 */

html {
  font-size: 16px;
  color: $dark;
  background-color: $light;
  font-family: $default-font;
  font-variant-numeric: 'oldstyle-nums slashed-zero';
  writing-mode: horizontal-tb;
}

h1,
h2,
h3,
h4,
h5,
h6 {
  font-weight: normal;
  margin: 0;
}

a {
  text-decoration-skip-ink: auto;
  color: $dark;
  text-decoration: underline;
  opacity: 0.8;

  &:hover {
    text-decoration: none;
    opacity: 1;
  }
}

/*
 * Quotations
 */

q:lang(en) {
  quotes: "‘" "’" "“" "”";
}

/*
 * Citations
 */

// Legacy citations

cite,
cite.book,
cite.film,
cite.tv-show,
cite.comic,
cite.podcast,
cite.album,
cite.report {
  font-style: italic;
}

cite.book--proper-noun {
  font-style: inherit;
}

cite.legislation,
cite.smallcite,
cite.comic-strip,
cite.short-story,
cite.article,
cite.episode,
cite.video,
cite.chapter,
cite.poem,
cite.software,
cite.website,
cite.campaign,
cite.song,
cite.speech,
cite.course,
cite.presentation {
  font-style: normal;
}

cite.smallcite::before,
cite.article::before,
cite.comic-strip::before,
cite.short-story::before,
cite.episode::before,
cite.video::before,
cite.chapter::before,
cite.song::before,
cite.poem::before,
cite.campaign::before,
cite.speech::before,
cite.course::before,
cite.presentation::before {
  content: "“";
}

cite.smallcite::after,
cite.article::after,
cite.comic-strip::after,
cite.short-story::after,
cite.episode::after,
cite.video::after,
cite.chapter::after,
cite.song::after,
cite.poem::after,
cite.campaign::after,
cite.speech::after,
cite.course::after,
cite.presentation::after {
  content: "”";
}

cite.article--shortcite::before,
cite.article--shortcite::after {
  content: none;
}

// Schema.org citations

cite,
.cite {
  font-style: italic;

  &[itemtype$="Code"],
  &[itemtype$="SocialMediaPosting"],
  &[itemtype$="SoftwareApplication"],
  &[itemtype$="WebApplication"],
  &[itemtype$="MobileApplication"],
  &[itemtype$="WebSite"],
  &[itemtype$="WebContent"],
  &[itemtype$="Comment"],
  &[itemtype$="Statement"],
  &[itemtype$="CreativeWorkSeason"],
  &[itemtype$="PodcastSeason"],
  &[itemtype$="RadioSeason"],
  &[itemtype$="TVSeason"],
  &[itemtype$="CreativeWorkSeries"],
  &[itemtype$="BookSeries"],
  &[itemtype$="MovieSeries"],
  &[itemtype$="VideoGameSeries"],
  &[itemtype$="Legislation"],
  &--inherit {
    font-style: inherit;
  }

  &[itemtype$="Article"],
  &[itemtype$="BlogPosting"],
  &[itemtype$="NewsArticle"],
  &[itemtype$="AnalysisNewsArticle"],
  &[itemtype$="ReportageNewsArticle"],
  &[itemtype$="OpinionNewsArticle"],
  &[itemtype$="ScholarlyArticle"],
  &[itemtype$="TechArticle"],
  &[itemtype$="Event"],
  &[itemtype$="Chapter"],
  &[itemtype$="Clip"],
  &[itemtype$="MovieClip"],
  &[itemtype$="RadioClip"],
  &[itemtype$="TVClip"],
  &[itemtype$="VideoGameClip"],
  &[itemtype$="Course"],
  &[itemtype$="DigitalDocument"],
  &[itemtype$="NoteDigitalDocument"],
  &[itemtype$="PresentationDigitalDocument"],
  &[itemtype$="TextDigitalDocument"],
  &[itemtype$="Episode"],
  &[itemtype$="PodcastEpisode"],
  &[itemtype$="RadioEpisode"],
  &[itemtype$="TVEpisode"],
  &[itemtype$="MusicRecording"],
  &[itemtype$="MusicComposition"],
  &[itemtype$="Message"],
  &--enquote {
    font-style: inherit;

    &::before {
      content: "“";
    }

    &::after {
      content: "”";
    }
  }

  &--normal {
    font-style: normal !important;

    &::before {
      content: none !important;
    }

    &::after {
      content: none !important;
    }
  }
}

/*
 *  Code
 */

pre {
  padding-inline-start: 1em;
  border-inline-start: 2px outset $dark;
  display: inline-block;
  overflow: hidden;
  max-inline-size: 80%;
  overflow: scroll;

  @include mq("large") {
    margin-block: 1em;
    margin-inline: 2em;
  }
}

code,
samp,
var,
pre {
  font-family: $code-font;
  font-size: 1em;
}

code,
samp,
var {
  background-color: #d1d1d1;
  border-radius: 5px;
  padding: 2px;
}

samp {
  display: block;
  inline-size: 80ch;
  margin-block: 1em;
  margin-inline: 4em;
  border-inline-start: 2px solid #ccc;
  color: #333;
}

h1 code,
pre code,
pre samp,
pre var,
h1 samp,
h1 var,
.post-title code,
.post-title samp,
.post-title var {
  background-color: transparent;
  padding: 0;
}

.heading code,
.subheading code {
  background-color: transparent;
}

// Source: Stack Overflow Stylesheet
kbd {
  padding-block: 0.1em;
  padding-inline: 0.6em;
  border: 1px solid #ccc;
  font-size: 11px;
  font-family: Arial, Helvetica, sans-serif;
  background-color: #f7f7f7;
  color: #333;
  box-shadow: 0 1px 0 rgba(0, 0, 0, 0.2), 0 0 0 2px white inset;
  border-radius: 3px;
  display: inline-block;
  margin-block: 0;
  margin-inline: 0.1em;
  text-shadow: 0 1px 0 white;
  line-height: 1.4;
  white-space: nowrap;
}

/*
 *  Special Text
 */

.pre-nominals,
.post-nominals {
  font-size: 0.6em;
  font-variant: small-caps;
}

.sic::after {
  content: " [sic]";
  font-style: italic;
}

.latex {
  display: inline !important;
}

.MathJax {
  font-size: 1em !important;
}

:where([title]) {
  text-decoration: underline;
  text-decoration: underline dotted;

  &:not(a *) {
    cursor: help;
  }
}

dfn {
  font-variant: small-caps;
}