@import url("/styles/css/colours.css");
@import url("/styles/css/fonts-general.css");
@import url("/styles/css/fonts-titles.css");
@import url("/styles/css/cursors.css");
@import url("/styles/css/links.css");
@import url("/styles/css/code.css");
@import url("/styles/css/printing.css");
@import url("/styles/css/gallery.css");
@import url("/styles/css/bog.css");
@import url("/styles/css/podcasts.css");
@import url("/styles/css/mtg.css");

:root {
 /* widths */
  --page-width: 48rem;
  --avatar-width: 64px;
  --navbar-margin: 10rem;
  --tile-width: 384px;

  --link-icon-width: 2rem;
  --link-icon-margin: 0.3rem;
}




ins {
  text-decoration: none;
}

ins, h1, h2, h3, h4, h5, h6 {
  color: var(--text-emphasised);
}

del {
  color: var(--text-deemphasised);
  text-decoration-color: var(--text-deemphasised);
}

body {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  margin: 0;
  padding: 0;
  font-size: 1.4rem;
  background: var(--background-colour);

  font-variant-numeric: oldstyle-nums;

  color: var(--text-colour);
  background: linear-gradient(135deg, var(--background-colour), var(--background-gradient) 2160px);

  .page-wrapper {
    flex: 1 0 auto;
    padding-bottom: 180px;
    background-image: url(/styles/background/background-footer-mountains.png);
    background-repeat: repeat-x;
    background-position: left bottom;
  }
}


article {
  video {
    background-color: var(--p8-black);
  }

  video, iframe {
    max-width: 100%;
  }

  audio {
    width: 100%;
  }

  /* styling images and image captions */
  img {
    max-width: 100%;
  }

  figure {
    margin-left: 0;
    margin-right: 0;

    img, video {
      display: block;
      margin: auto;
    }

    table {
      margin: auto;
    }

    figcaption {
      text-align: center;
      font-size: 0.9em;
    }
  }
}

img.fill-image {
  width: 100%;
}

blockquote {
  color: var(--text-deemphasised);
  border-left: 2px solid var(--text-deemphasised);
  padding-left: 0.5em;
  margin: 0;
  cite {
    font-style: italic;
    font-weight: bold;
    em, i {
      font-style: italic;
    }
  }
}


h1, h2, h3 {
  font-weight: normal;
  margin-bottom: 0;
}

h1 {
  font-size: 3rem;
}

h2 {
  font-size: 2.5rem;
}

h3 {
  font-size: 2rem;
}

h4 {
  font-weight: bold;
  font-size: 1.5rem;
}

table {
  border-collapse: collapse;
}

th, td {
  border: 1px solid;
  padding: 0.3rem;
}

sup {
  vertical-align: baseline;
  position: relative;
  top: -0.4em;
}

sub {
  vertical-align: baseline;
  position: relative;
  top: 0.4em; 
}


details {
  summary {
    font-weight: bold;
  }
  p, ol, ul {
    margin-top: 0;
  }
  p {
    padding-left: 1em;
  }
}

ul {
	list-style-type: '⬖ ';
}

kbd {
  border-radius: 3px;
  display: inline-block;
  font-size: 0.7em;
  font-weight: 700;
  font-style: normal;
  line-height: 1;
  padding: 2px 4px;
  white-space: nowrap;
  color: #333;
  background-color: #eee;
  border: 1px solid #b4b4b4;
  box-shadow:
      0 1px 1px rgba(0, 0, 0, 0.2),
      0 2px 0 0 rgba(255, 255, 255, 0.7) inset;
  font-variant-numeric: tabular-nums;
}

samp kbd {
  background-color: inherit;
  border: none;
  box-shadow: none;
}



ordinal {
  font-variant-numeric: oldstyle-nums ordinal;
}


::selection, ::-moz-selection {
  text-shadow: none;
  background: var(--p8-wine);
  color: var(--text-colour-dark);
  text-decoration-color: var(--text-colour-dark);
}


kbd.key {
  background-color: inherit;
  border: none;
  box-shadow: none;
  font-family: PromptFont, monospace, sans-serif;
  padding: 0;
  font-size: 2em;
  font-weight: normal;
  font-style: normal;
}

kbd.key.inline {
  font-size: revert;
}


.jupiter {
  border-radius: 50%;
  box-shadow: var(--p8-orange) 0px 0px 1rem;
}

article.single-column {
  overflow-wrap: break-word;
  max-width: var(--page-width);
  margin: auto;

  margin-top: 5rem;



  p {
    text-align: justify;
  }
}

.thumb-grid img {
  width: 100px;
}



i.translation {
  font-style: normal;
}

.translation, .ipa, abbr {
  text-decoration: underline dotted;
  position: relative;
}


.post-meta {
  display: inline-block;
  font-size: 1rem;
  color: var(--text-deemphasised);
  a {
    color: var(--text-deemphasised) !important;
  }
  p {
    margin: 0;
  }
}

.infobox, .notebox {
  display: block;
  font-weight: normal;
  border-radius: 8px;
  padding: 1em;
  background-color: var(--p8-lemon);
  border: 2px solid var(--p8-black);
  color: var(--p8-black);
}

.infobox {
  padding-left: 2em;
  padding-top: 0.5em;
}

.infobox::before {
  content: 'ⓘ';
  position: relative;
  right: 1.5em;
  display: inline-block;
  width: 0;
  height: 0;
  font-weight: bold;
}

.preheader {
  margin-bottom: 0;
}

ul.tags {
  list-style: none;
  display: inline-block;
  li {
    vertical-align: bottom;
    display: inline-block;
    padding-right: 10px;
    line-height: 40px;
    height: 40px;
    img {
      height: 40px;
    }
    a:hover {
      text-decoration: none;
    }
  }
}

.tag-emoji, .tag-emoji span {
  display: inline-block;
  font-size: 40px;
  line-height: 40px;
}

.icon-hover:hover {
  filter: sepia(1) hue-rotate(328deg);
  -webkit-filter: sepia(1) hue-rotate(328deg);
}

@media (prefers-color-scheme: dark) {
  .icon-hover:hover {
    filter: sepia(1) hue-rotate(250deg);
    -webkit-filter: sepia(1) hue-rotate(250deg);
  }
}


.header-icon {
  padding-right: 10px;
}


.pixelart {
  image-rendering: pixelated
}

.emote {
  max-width: 32px;
  max-height: 32px;
  image-rendering: pixelated;
  margin: 0;
  vertical-align: middle;
}



.hidden-without-js {
  display: none;
}


/*  fancy text */

/* homepage headers */
.sonic-2 {
  font-family: "Rocodecoco";
  text-transform: lowercase;
  color: var(--p8-wine);
  text-shadow: 5px 5px var(--p8-silver);
}

.grudge {
  font-family: Impacted, Impact, sans-serif;
  color: var(--p8-crimson);
  font-style: normal;
  text-transform: uppercase;
}

.cohost {
  font-family: "Atkinson Hyperlegible Cohost logo", ui-sans-serif, system-ui, sans-serif;
}

.the-ring {
  font-family:'SOME RINGS';
  text-transform: lowercase;
  text-shadow: 1px 1px 2px var(--p8-silver);
}

.the-ring::after {
  content: "*";
  position: relative;
  right: 2em;
  top: 0.1em;
  opacity: 50%;
  display: inline-block;
  width: 0;
  height: 0;
}

.tate, .tate a {
  font-family: "Tate";
  background-clip: border-box;
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  -webkit-text-stroke-width: 2px;
  -webkit-text-stroke-color: var(--p8-ember);
  text-shadow: 0px 0px 6px var(--p8-pink);     
}



.piocó {
  font-family: "Cló Piocó-8", monospace !important;
}

.piocó-v1 {
  font-family: "Cló Piocó-8 v1", monospace !important;
}

.v-ogham {
  writing-mode: vertical-rl;
  transform: rotate(180deg);
  @supports (writing-mode: sideways-lr) {
      writing-mode: sideways-lr;
      transform: rotate(0);
  }
}

.piocó-ogham {
  font-family: "Cló Piocó-8" !important;
  letter-spacing: -1px;
  margin-left: auto;
}

/* Not an actual historical numerical system, just me messing around */
@counter-style ogham-numerals {
  system: additive;
  additive-symbols:
  120 ᚙ,
  60 ᚘ,
  12 ᚖ,
  6 ᚕ,
  5 ᚏ,
  4 ᚎ,
  3 ᚍ,
  2 ᚌ,
  1 ᚋ;
  suffix: " ";
}

ol.ogham-numerals {
	  list-style: ogham-numerals;
}

.hobo {
  font-family: "Hobo" !important;
}

.mono {
  font-family: var(--monospace-font-family);
}

.gaelic {
  font-family: var(--irish-font-family);
  font-feature-settings: 'ss01';
}

.bog, .bog a, .bog a:visited {
  font-family: var(--irish-font-family);
  color: var(--p8-amber);
  text-shadow: 0.05em 0.05em black;
  text-transform: lowercase;
}

.sans {
  font-family: var(--sans-font-family);
}



/*  navbar */

.nav-back ul {
  list-style-type: none;
}

.nav-prev a, .nav-next a {
  display: flex;
  max-width: 16rem;
}

.nav-title {
  display: -webkit-box;
  -webkit-line-clamp: 3;
  line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.nav-next {
  display: flex;
  justify-content: right;
}


.translation-icon {
  fill: var(--text-colour);
}

.nav-back {
  li:nth-child(2) {
    padding-left: 1rem;
  }
  li:nth-child(3) {
    padding-left: 2rem;
  }
  li:nth-child(4) {
    padding-left: 3rem;
  }
}

.navbar {
  width: var(--page-width);
  max-width: 100%;
  margin-left: auto;
  margin-right: auto;
  
  display: flex;
  flex-wrap: wrap;

  >div {
    width: 50%;
    align-content: center;
  }

  .nav-back ul {
    padding: 0;
  }
  
  .nav-lang, .nav-next {
    text-align: right;
  }
}





.credits, .footnotes {
  list-style: none;
  padding-left: 0;
  margin-left: 0;
  font-size: 16px;

  li p {
    text-align: left;
  }
}

.footnotes {
  margin-top: 4rem;
}

.media-container {
  height: 0px;
  padding-top: 25px;
  padding-bottom: 56.2%;
  position: relative;
  margin-bottom: 3rem;
}

.media-container iframe {
  width: 100%;
  height: 100%;
  position: absolute;
}

.media-container video {
  width: 100%;
  height: 100%;
  position: absolute;
}


.review-stars {
  color: var(--p8-orange);
}


@media (prefers-color-scheme: dark) {
  body {
    color: var(--text-colour-dark);
    background: var(--p8-midnight);
    background: linear-gradient(135deg, var(--background-colour-dark), rgb(0,0,0,0) 4320px), url(/styles/background/background-stars.png), var(--background-gradient-dark);
    background-attachment: local, fixed;

    .page-wrapper {
      background-image: url(/styles/background/background-footer-city.png);
    }
  }

  del {
    color: var(--text-deemphasised-dark);
    text-decoration-color: var(--text-deemphasised-dark);
  }

  ins, h1, h2, h3, h4, h5, h6 {
    color: var(--text-emphasised-dark);
  }

  blockquote {
    color: var(--text-deemphasised-dark);
    border-left-color: var(--text-deemphasised-dark);
  }

  kbd {
    color: #eee;
    background-color: #333;
    border: 1px solid #4b4b4b;
    box-shadow:
        0 1px 1px rgba(255, 255, 255, 0.7),
        0 2px 0 0 rgba(0, 0, 0, 0.2) inset;
  }


  ::selection, ::-moz-selection {
    background: var(--p8-moss);
    color: var(--text-colour);
    text-decoration-color: var(--text-colour);
  }

  .post-meta {
    color: var(--text-deemphasised-dark);
    a {
      color: var(--text-deemphasised-dark) !important;
    }
  }

  .translation-icon {
    fill: var(--text-colour-dark);
  }

  .infobox, .notebox {
    background-color: var(--p8-black);
    border-color: var(--p8-coral);
    color: var(--p8-coral);
  }



  /*  fancy text */

  /* homepage headers */

  .sonic-2 {
    color: white;
    text-shadow: 5px 5px black;
  }

  .grudge {
    color: var(--p8-ember);
  }

  .the-ring {
    text-shadow: 1px 1px 2px black;
  }

  .tate, .tate a {
    -webkit-text-stroke-color: var(--p8-pink);
    text-shadow: 0px 0px 6px var(--p8-ember); 
  }


  .bog, .bog a, .bog a:visited {
    color: var(--p8-lemon);
  }

  .review-stars {
    color: var(--p8-lemon);
  }
}


/* Collapse nav elements from sides to under post */
@media screen and (min-width: 90rem) {
  .navbar:not(.wide) {
    width: unset;
    max-width: unset;
    margin-left: unset;
    margin-right: unset;
    display: unset;
    flex-wrap: unset;

    .nav {
      position: fixed;
      max-width: calc((100vw - var(--page-width) - var(--navbar-margin))/2);
    }

    .nav-back {
      padding-left: 3rem;
      top: 10rem;
      margin: 0;
      ul {
        margin: 0;
      }
    }

    .nav-lang {
      position: fixed;
      padding-right: 3rem;
      top: 10rem;
      right: 0;
    }

    .nav-prev {
      position: fixed;
      padding-left: 3rem;
      top: 50%;
    }

    .nav-next {
      position: fixed;
      padding-right: 3rem;
      top: 50%;
      right: 0;
      text-align: right;
    }
  }
}

/* Collapse avatar inline with header when no more room in the margins */
@media screen and (max-width: calc(48rem + 12rem)) {
  article.bog-post {
    header {
      display: flex;
      flex-wrap: wrap;

      h1 {
        order: 1;
        width: 100%;
      }

      .avatar-container {
        order: 2;
        position: revert;
        height: var(--avatar-width);
        margin-right: 1rem;
        align-self: center;
      }

      .post-meta {
        order: 3;
      }
    }
  }

  .bog-page {
    max-width: var(--page-width);
    margin:auto
  }
}

/* When the screen is nearly as narrow as the column then collapse out to meet it */
@media screen and (max-width: calc(48rem + 2rem)) {
  article.single-column {
    margin-left: 0;
    margin-right: 0;
    max-width: unset;

    p, h1, h2, h3, h4, h5, .avatar-container {
      margin-left: 1rem;
      margin-right: 1rem;
    }

    p {
      text-align: unset;
    }

    .infobox, p:has(.infobox) {
      margin-left: 0;
      margin-right: 0;
    }
  }

  .navbar {
    margin: 0;
  }

  .nav-back, .nav-prev {
    a {
      margin-left: 1rem;
    }
  }
  .nav-next, .nav-lang {
    a {
      margin-right: 1rem;
    }
  }
}

/* When the screen is really narrow put post metadata over avatar */
@media screen and (max-width: 32rem) {
  article.single-column {
    header {
      .post-meta {
        order: 2;
        width: 100%;
      }

      .avatar-container {
        order: 3;
      }
    }
  }
}

@media screen and (max-width: 600px) {
  header.exhibit-header {
    #git-repo-box {
      white-space : normal;
    }
  }
}


@media (hover: none) {
  .ipa:hover::after, .translation:hover::after, abbr:hover::after {
    pointer-events: none;
    content: attr(title);
    position: absolute;
    bottom: calc(100% + 5px);
    transform: translate(-50%);
    left: 50%;
    white-space: nowrap;
    background-color: var(--background-colour);
    border: 1px solid var(--text-colour);
    padding: 0.5em;
    font-style: normal;
    border-radius: 0.5em;
  }

  @media (prefers-color-scheme: dark) {
    .ipa:hover::after, .translation:hover::after, abbr:hover::after {
      background-color: var(--background-colour-dark);
      border-color: var(--text-colour-dark);
    }
  }
}
