/* CSS is how you can add style to your website, such as colors, fonts, and positioning of your
  HTML content. To learn how to do something, just try searching Google for questions like
   "how to change link color." */

:root {
  /* colours */
  --ayu-dark: 26, 26, 33;
  --ayu-blue: 123, 208, 248;
  --ayu-yellow: 255, 195, 0;
  --ayu-offwhite: 250, 250, 250;
  --ayu-blue2yellow: hue-rotate(215deg) saturate(250%);
  --bopacity: rgba(0, 0, 0, .33);
  /* layout */
  --vert-spacing: 1.33em;
  --border-rad: 1em;
  /* fonts */
  --ffsystem: system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, 'Open Sans', 'Helvetica Neue', sans-serif;
  --ffhumanist: Afacad, Seravek, 'Gill Sans Nova', Ubuntu, Calibri, 'DejaVu Sans', source-sans-pro, sans-serif;
  --ffantique: Superclarendon, 'Bookman Old Style', 'URW Bookman', 'URW Bookman L', 'Georgia Pro', Georgia, serif;
  --ffneogrot: Inter, Roboto, 'Helvetica Neue', 'Arial Nova', 'Nimbus Sans', Arial, sans-serif;
}

html, body {
  min-height: 100dvh;
  background-color: rgb(var(--ayu-dark));
  font-size: 18px;
}
body {
  background: rgb(var(--ayu-dark)) url(../img/topography.png) top center;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: var(--vert-spacing);
}
body.curatedMode {
  background: rgb(var(--ayu-dark)) url(../img/topography-curated.png) top center;
}
body, div, main, section, article {
  box-sizing: border-box; 
}

h1 {
  font-size: 3em;
  line-height: 1.25em;
  margin: .5em 0;
}
.subPage h1 {
  text-align: center;
  text-decoration: underline;
}
.subPage h2 {
  margin: 0;
  padding: 8px;
}

.twb {
  text-wrap: balance;
}

/* header image */
header img {
  width: 500px;
  max-width: 98%;
}

/* clearfix hack to prevent image overflow. check out the W3Schools page on it. */
.clearfix::after {
  content: "";
  clear: both;
  display: table;
}

/*FONTS*/

/* header font */
#showComic, header, h1, h2, h3, h4, h5 {
  font-family: var(--ffhumanist);
  /* font-family: 'Afacad', var(--ffhumanist); */
}

/* body font */
.subPage p, footer, #authorNotes {
  font-family: var(--ffsystem);
  font-weight: normal;
  font-size: 16px;
  line-height: 1.5em;
}

/* STYLING FOR SUBPAGES (about, characters, etc) */

/*general*/

.subPage {
  width: 950px;
  max-width: 100%;
  background-color: #ffffff;
  outline: 3px solid #000000;
  margin: 0 auto;
  /* margin-bottom: 10px; */
  padding: 0px 12px 12px;
}

/* for pictures displayed to the left */
.leftPic {
  clear: left;
  float:right;
  margin-left:20px;
}

/* for pictures displayed to the left */
.rightPic {
  clear: right;
  float:left;
  margin-left:20px;
}

/* specific to Characters */
.charTable, .charTable td { 
  width: 100%;
}

/* links */
a {
      color: rgb(var(--ayu-blue));
      text-decoration: none;
    }

a:hover {
      color: rgb(var(--ayu-yellow));
    }

/* HEADER */
header .logo {
  padding-right: 0;
  padding-left: .66em;
  background: var(--bopacity);
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  color: rgb(var(--ayu-offwhite));
}
header .logo a:hover {
  filter: var(--ayu-blue2yellow);
}
header .logo .logoText {
  margin:.66em;
  margin-left: 0;
  width:420px;
  aspect-ratio: 473 / 114;
  background: url('../img/logo-text.svg') no-repeat;
  background-size: contain;
  text-indent: -9999px;
  position: relative;
}
header .logo .subtitle {
  flex-grow: 1;
  overflow: hidden;
  font-size: 1.47em;
  font-weight: 400;
  font-style: italic;
  padding-bottom:.7em;
  color: rgb(var(--ayu-offwhite));
  cursor: default;
  transition: .25s font-size;
}
header .logo .subtitle:before {
  content: '(\00a0';
}
header .logo .subtitle:after {
  content: '\00a0)';
}
header #nav {
  display: flex;flex-wrap: wrap;
  font-size: 1.25em;
  font-weight: 600;
  text-transform: uppercase;
  margin: auto;
  gap:3px;
  text-align: center;
  line-height: 1.35em;
  line-height: 1em;
}
header #nav > * {
  background-color: rgb(var(--ayu-blue));
  flex-grow: 1.5;
  display: flex;
  padding: .25em .5em;
  flex-direction: column;
  justify-content: center;
}
header #nav a:hover {
  background-color: rgb(var(--ayu-yellow));
}
header #nav .navSpacer {
  flex-grow: 3;
}
header #nav a {
  color: rgb(var(--ayu-dark));
}

.pageWrapper {
  display: flex;
  flex-direction: column;
  align-items: center;
}

/* HOMEPAGE */

/* style nav button images */
.comicNav {
  display: flex;
  justify-content: center;
  gap: min(.75em, 3vw);
  width:min(760px, 100%);
  margin: 0 auto;
}
.navIcon {
  background-position: center;
  background-size: contain;
  background-repeat: no-repeat;
  text-indent: -9999px;
  overflow: hidden;
  width:min(calc(15%), 3em);
  aspect-ratio: 1;
}
.navIcon:not(a){
  opacity: .3;
}
a.navIcon:hover, a.navIcon:active {
  filter: var(--ayu-blue2yellow);
}
.navFirst {
  background-image: url('../img/comicnav/skip.png');
  transform: scaleX(-1);
}
.navPrev {
  background-image: url('../img/comicnav/play.png');
  transform: scaleX(-1);
}
.navRandom {
  background-image: url('../img/comicnav/shuffle.png');
}
.navNext {
  background-image: url('../img/comicnav/play.png');
}
.navLast {
  background-image: url('../img/comicnav/skip.png');
}

/* style comic page image */
.comicPage {
  margin: var(--vert-spacing) 0;
}
.comicPage img {
  width: auto;
  max-width: 100%;
  display: block;
}

/* style author notes */
#authorNotes {
  margin: auto;
  width: 760px;
  max-width: 100%;
}
.notes {
  background-color:#fff;
  margin: auto;
  padding: .5em 1em;
}
.originalNotes {
  padding-top: 0px;
  border-radius: 1em 1em 0 0;
  transition: .5s border-radius;
}

.writePageTitle {
  margin: 0;
  padding:.2em 0;
  border-bottom: 5px solid #000;
  line-height: 1em;

}

.writeAltText {
  color: rgb(var(--ayu-dark));
  font-family: var(--ffantique);
  font-size: 1.3em;
  font-style: italic;
  font-weight: 400;
  line-height: 1.5em;
  text-align: center;
  margin:1em auto;
  width: calc(100% - 8em);
  min-width: 75%;
  opacity: .9;
  overflow: hidden;
}
.writeAltText:before, .writeAltText:after {
  font-style: normal;
  font-weight: 900;
  display: inline-block;
  vertical-align: bottom;
  color: rgb(var(--ayu-dark));
  opacity: .25;
  font-size: 3em;
  top: .2em;
  position: relative;
  padding:0 .1em;
}
.writeAltText:before {
  content: open-quote;
}
.writeAltText:after {
  content: close-quote;
}

.writeComicDate, .writeCommentaryDate {
  font-family: var(--ffhumanist);
  font-size: 1.3em;
  font-weight: 700;
  display: flex;
  flex-wrap: wrap;
  /* text-decoration: underline; */
}

.writeAuthorNotes {
  border: 1px solid #000;
  margin: .66em 0;
  padding: 0 .66em;
  background: rgb(var(--ayu-dark));
  color: rgb(var(--ayu-offwhite));
  border-radius: calc(var(--border-rad) * .5);
  /* text-indent: .33em; */
}
.writeAuthorNotes p:first-child {
  margin-top: .66em;
}
.writeAuthorNotes p:last-child {
  margin-bottom: .66em;
}
/* Using Collapsible Notes */
.collapsibleNote .writeAuthorNotes {
  border-top: 1px solid rgba(var(--ayu-offwhite), .5);
  margin:0;
  border-radius: 0;
}
.collapsibleNote {
  border: 1px solid #000;
  margin: .66em 0;
  background: rgb(var(--ayu-dark));
  color: rgb(var(--ayu-offwhite));
  border-radius: calc(var(--border-rad) * .66);
  overflow: hidden;
}
.collapsibleNote summary {
  padding: 0 .66em;
  padding: .6em;
  cursor: pointer;
  display: block;
  font-weight: 700;
  text-decoration: underline;
}
.collapsibleNote summary:before {
  content: '►';
  color: rgb(var(--ayu-blue));
  text-decoration: none;
  display: inline-block;
  margin-right: .33em;
}
.collapsibleNote[open] summary:before {
  content: '▼';
}
.collapsibleNote summary:hover, .collapsibleNote summary:hover:before, .collapsibleNote[open] summary:hover:before {
  color: rgb(var(--ayu-yellow));
  text-decoration: none;
}

.originalNotes .datePre:before {
  content: 'Originally ';
}
.originalNotes:has(.collapsibleNote) .datePre:before {
  content: '';
}

.newNotes {
  border-top: 5px solid #000;
  padding:0;
  border-radius: 0 0 var(--border-rad) var(--border-rad);
  transition: .5s border-radius;
}
.writeCommentaryDate {
  background: rgb(var(--ayu-yellow));
  padding: .5rem 1rem;
}
.writeCommentaryNotes {
  padding: .5em 1em;
  padding: 0 1em;
  font-weight: 500;
  color: rgb(var(--ayu-dark));
}
.writeCommentaryNotes a {
  color: rgb(var(--ayu-dark));
  font-weight: 700;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0) 0%, rgb(var(--ayu-yellow)) 0%) no-repeat;
  background-position: 0 1.2em;
  transition: background-position .12s ease;
}
.writeCommentaryNotes a:hover {
  background-position: 0 0;
}

.noComment .originalNotes {
  border-radius: var(--border-rad);
}
.noComment .newNotes {
  display: none;
}

#authorNotes div:empty, #authorNotes summary:empty {
  display: none;
}
#authorNotes details:has(.writeAuthorNotes:empty) {
  display: none;
}
#authorNotes img {
  display: block;
  margin: 0 auto;
  max-width: 100%;
}

/* ARCHIVE PAGE */
.archivePage {
  text-align: center;
}
.archiveWrapper, .archiveHeader {
  width:90%;
  margin: 0 auto;
}
.archiveHeader {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  border-bottom: 3px solid black;
}
.archivePage .reverseButton {
  cursor: pointer;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0) 0%, rgb(var(--ayu-yellow)) 0%) no-repeat;
  background-position: 0 2em;
  box-shadow: inset 0 -3px rgb(var(--ayu-yellow));
  transition: background-position .12s ease;
}
.archivePage .reverseButton:hover {
  background-position: 0 0;
}
.archivePage .reverseButton:after {
  content:' ⇅ ';
  position: relative;
  font-size: .9em;
  top:.1em;
}

#chronoWrapper {
  display: none;
}

/* style table in which archive is displayed */
.archiveTable {
  width: 100%;
  height:1px;
  border-collapse:collapse;
  font-family: var(--ffhumanist);
  font-size: 1.25em;
  text-wrap: balance;
}

/* style archive table cells */
.archiveTable td {
  padding: 8px;
  padding: 0;
  vertical-align: center;
  position: relative;
}

.archiveRow {
  border-bottom: 1px solid var(--bopacity);
  box-sizing: border-box;
}
.archiveRow:last-child {
  border-bottom: none;
}
/* highlight a table row and make pointer into hand when moused over */
.archiveRow:hover {
  background-color: rgb(var(--ayu-yellow));
  cursor: pointer;
}

/* style table cell in which page title is displayed */
.archiveCellTitle:not(.leftAlignTableText) {
  max-width: 300px;
  text-align: center;
}
.archiveCellTitle {
  font-weight: 700;
  max-width:500px;
  text-align: left;
}

.archiveCellDate {
  text-align: right;
  min-width: 120px;
  font-weight: 400;
}

.archiveCellNum {
  text-align: center;
  min-width: 30px;
  font-weight: 400;
}

/* style the thumbnails on the archive page */
.archiveCellThumb {
    width: 500px;
    max-width: 60px;
}
.archiveCellThumb img {
    max-width: 100%;
    display: block;
    border: 1px solid rgb(var(--ayu-dark));
  }

/* for left aligning the text in a table cell */
.leftAlignTableText td {
  text-align: left;
}

.archiveTable a {
  display: block;
  padding: 8px;
  color: rgb(var(--ayu-dark));
}

/* FOOTER */
.writeFooter {
  width: 100%;
  padding: .5em;
  text-align: center;
  color: rgb(var(--ayu-offwhite));
  background: var(--bopacity);
}
footer {
  float: left;
  width: 100%;
  font-size: .66em;
}

footer p {
  margin: auto;
}

.contentSpacer {
  margin-top: calc(var(--vert-spacing) * -1);
  flex-grow: 1;
}

/* take away margins from the edges of the screen */
html, body {
  margin: 0;
}

@keyframes fadeIn {
  0% { opacity: 0; }
  100% { opacity: 1; }
}
.loadErrorCatcher {
  opacity: 0;
  animation: fadeIn 2s ease 1s forwards;
}
#authorNotes {
  opacity: 0;
  animation: fadeIn .5s ease .5s forwards;
}

.introPage .originalNotes, .introPage .datePre {
  display: none;
}
.introPage .dateDate:before {
  content: 'Hello Again — ';
}
.introPage .newNotes {
  margin-top: 0;
  border-top: none;
  border-radius: var(--border-rad);
  overflow: hidden;
}

.curatedMode #nav {
  /* border: 3px solid rgb(var(--ayu-dark));
  border-right: none; border-left: none; */
  outline: 2px solid rgb(var(--ayu-yellow));
  outline-offset: 3px;
}
/* .curatedMode #nav > * {
  border-bottom: 2px solid rgb(var(--ayu-yellow));
  border-top: 2px solid rgb(var(--ayu-yellow));
} */
.curatedMode header .logoText:after {
  content:'';
  background: url('../img/logo-text-curated.png');
  background-size: contain;
  position: absolute;
  top:0; right: 0; bottom: 0; left: 0;
}
.curatedMode header .logoText:hover:after {
  filter: saturate(0%) brightness(10);
}
.curatedMode .comicPage {
  outline: 2px solid rgb(var(--ayu-yellow));
  outline-offset: 3px;
}
.curatedMode .notes {
  outline: 2px solid rgb(var(--ayu-yellow));
  outline-offset: 3px;
}
.curatedMode:not(.introPage) .newNotes {
  border-top: none;
  /* margin-top: calc(var(--vert-spacing) * .66); */
  margin-top: 8px;
}

.forneverPage header .logo .logoText {
  background: url('/img/misc/goofs/ayu-forever.png') no-repeat;
  background-position: 33% 0;
  background-size:contain;
}
.forneverPage header .logo .logoText:hover {
  filter:drop-shadow(0 .25em 1em rgba(255, 220, 140, .2)) brightness(1.3) contrast(1.1);
}
.forneverPage.curatedMode header .logoText:after {
  background: none;
}
.forneverPage .logo {
  flex-wrap: wrap-reverse;
  align-items: end;
  margin-top: -1em;
  padding: .66em;
}
.forneverPage .logo .logoText {
  margin-top:1em;
  margin: 1em .66em 0 0;
}
.forneverPage .logo .subtitle {
  margin-top: -9999px;
  padding-bottom:0;
}


@media screen and (width <= 760px) {
  #authorNotes .originalNotes, #authorNotes .newNotes, .curatedMode .comicPage {
    border-radius: 0;
    border-left: none; border-right: none;
  }
}
@media screen and (width <= 640px) {
  .writePageTitle {
    /* font-size: clamp(2.5em, 5.5vw + 1em, 3em); */
    font-size: clamp(2.5em, 5.2vw + 1em, 3em);
  }
  .writeAltText {
    min-width: 100%;
    font-size: clamp(10px, 5.5vw + 1em, 1.3em);
  }
  #nav .navSpacer {
    display: none;
  }
  .archiveWrapper, .archiveHeader {
    width: 100%;
  }
  .archiveHeader {
    font-size: clamp(16px, 2.5dvw + .3em, 1em);
  }
  .archiveTable {
    font-size: clamp(16px, 2.5dvw + .3em, 1.15em);
  }
}
@media screen and (width <= 460px) {
  header .logo .subtitle {
    /* font-size: clamp(10px, .8vw + 1em, 1.47em); */
    font-size: clamp(10px, 1.1vw + 1em, 1.47em);
  }
  .archiveRow .archiveCellNum {
    display: none;
  }
  .archiveRow .archiveCellDate a {
    padding-left: 0;
  }
}
@media screen and (width <= 380px) {
  .archiveRow .archiveCellDate {
    display: none;
  }
}
@media screen and (width <= 320px) {
  header .logo .subtitle {
    display: none;
  }
}

header .infoBanner {
  background-color: rgb(var(--ayu-offwhite));
  text-align: center;
  font-style: italic;
  font-size: 1em;
  line-height: 1em;
  padding: .3em 2%;
  margin-top: var(--vert-spacing);
  border: 1px solid rgb(var(--ayu-dark));
  outline: 2px solid rgb(var(--ayu-yellow));
  /* display: none; */
}