@import "./reset.css";
@import "./typography.css";

:root {
  color-scheme: light dark;
  --paper: light-dark(#fffaf0,#212121);
  --gloss: light-dark(white, black);
  --ink: light-dark(#212121, #fffaf0);
  --accent: #a4dded;

  --link: light-dark(#00f, #42b4ff);
  --visited: light-dark(#7500eb, #c994ff);
  --active: light-dark(#b60000, #ff8989);
  
  --Old-Style: "Iowan Old Style", "Palatino Linotype", "URW Palladio L", P052,
    serif;
  --Humanist: Seravek, "Gill Sans Nova", Ubuntu, Calibri, "DejaVu Sans",
    source-sans-pro, sans-serif;
    --Monospace-Code: ui-monospace, "Cascadia Code", "Source Code Pro", Menlo,
    Consolas, "DejaVu Sans Mono", monospace;
}

html {
  background-image: radial-gradient(circle, var(--gloss) 75%, var(--paper));
  background-attachment: scroll;
  color: var(--ink);
  font-size: 20px;
  text-size-adjust: none;
}

* {
  max-width: 100%;
}

*,:after,:before {
    box-sizing: border-box
}

/* BEGIN Hyperlink colors that pass WCAG AAA with 7.1:1 based on color scheme */
a:link {
  color: var(--link);
}
a:visited {
  color: var(--visited);
}
a:focus,
a:hover,
a:active,
a:hover svg {
  color: var(--active);
}
/* END Hyperlink colors */

a > svg {
  color: var(--ink);
}

a.u-url {
  display: block;
  width: fit-content;
}

.visually-hidden {
  border: 0;
  clip: rect(0 0 0 0);
  height: auto;
  margin: 0;
  overflow: hidden;
  padding: 0;
  position: absolute;
  white-space: nowrap;
  width: 1px;
}

body {
  display: flex;
  flex-direction: column;
  margin: 0;
}

header,
footer {
  padding: 2rem;
}

header {
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
}

nav ul {
  padding-inline-start: 0;
}

.home .h-card {
  align-items: center;
  justify-content: center;
  display: flex;
  flex-direction: column;
}

ul.nav {
  display: flex;
  gap: 1em;
  flex-wrap: wrap;
  justify-content: center;
  align-items: center;
  list-style-type: none;
}

main {
  flex: 2;
}

main > .content,
article > .content,
aside {
  margin: 1rem auto;
  padding: 0 2rem;
  max-width: 50rem;
}

time,
aside {
  font-size: smaller;
  font-style: italic;
}

blockquote {
  font-style: italic;
}

blockquote,
figcaption {
  margin: 0 auto;
  max-width: 30rem;
}

footer blockquote,
footer blockquote + figcaption {
  text-align: center;
}

blockquote + figcaption::before {
  content: "\2014";
  padding-inline-end: 0.2rem;
}

.hero {
  height: auto;
  max-height: 25rem;
  object-fit: contain;
  width: 100%;
}

.content picture {
  box-shadow: 0 0 0.8em var(--dark);
  margin: 1em auto;
  outline: 1px solid var(--light);
  display: flex;
  justify-content: center;
}

picture img:not(.hero) {
    outline: .125em solid;
}

.webrings > .row {
  display: flex;
  flex-wrap: wrap;
  align-items: start;
  justify-content: space-around;
  font-size: smaller;
}

/* Blockquotes */
blockquote::before {
  content: open-quote;
}
blockquote::after {
  content: close-quote;
}
blockquote {
  quotes: "“" "”" "‘" "’";
  margin: 1rem auto
}

blockquote + figcaption {
  text-align: right
}

footer blockquote {
  margin: 0 auto;
}

/* Avatar on homepage */
.stacker > :first-child {
  grid-area: main;
}

.stacker > :last-child {
  grid-area: sidebar;
  margin: 0 auto;
}

.stacker {
  display: grid;
  grid-gap: 1em;
}

.stacker img.round {
  border-radius: 50%;
  object-fit: contain;
  height: fit-content;
}

@media (orientation: landscape) {
  .stacker {
    grid-template-areas: "main main sidebar";
  }
}

@media (orientation: portrait) {
  .stacker {
    grid-template-areas:
      "sidebar"
      "main";
  }

  .stacker img.round {
    margin-block-start: 1.75em;
    width: 50vw;
  }
}

/* Pagefind */
.pagefind-ui {
  --pagefind-ui-font: inherit;
  --pagefind-ui-scale: 1.2;
  --pagefind-ui-text: var(--ink);
}

input.pagefind-ui__search-input,
button.pagefind-ui__search-clear {
  color: var(--paper) !important;
}

.pagefind-ui__form::before {
  background-color: var(--paper) !important;
}

.summary {
  border-inline-start: .25em solid;
  font-style: italic;
  padding: 1em;
}

/* More readable lists */
:is(ol, ul):not([class]) li + li {
    margin-block-start: .6em;
}

article.story {
  border: 1px solid #ffffff80;
  margin: 2rem 0;
  padding: 1rem 2rem 3rem;
}

.webmentions {
  display: flex;
      align-items: center;
      flex-wrap: wrap;
      gap: 1em;
      justify-content: flex-end;
  font-size: .8em;
  list-style: none;
}

.heading {
    display: flex;
    align-items: center;
}

.heading h1 {
    margin-top: 0;
}

.heading a:link {
    text-decoration: none;
    padding: .25em;
}

ol.gallery {
  display: flex;
  flex-wrap: wrap;
  gap: 2em;
  list-style-type: none;
  align-items: center;
  justify-content: space-around;
  padding-left: 0;
}

ol.gallery li {
  margin-left: none;
  width: 10em;
}

.post-list span.tag {
    background: var(--accent);
    color: canvas;
    border-radius: .25em;
    padding: 0 .3em;
    font-size: .75em;
    vertical-align: middle;
}

span.post-date {
    font-size: .8em;
}

pre {
    white-space: pre-wrap;
    background: canvasText;
    color: canvas;
    padding: .25em .5em;
}

code {
    background: canvasText;
    color: canvas;
    font-size: .75em;
    padding: .125em .25em;
}

ol.notes {
    list-style-type: none;
    padding-inline-start: 0;
}

ol.notes time + p {
    margin-block-start: 0;
}

ol.notes li p {
    margin: 0
}

ol.notes li + li {
    margin-block-start: 2em
}

article + aside.row {
    text-align: right;
}
