
@media (prefers-color-scheme: light) {
  :root {
    --primary-text: #000;
    --secondary-text: #333;
    --primary-bkg: #FFF;
    --aside-bkg: #F5F5F5;
    --aside-highlight: #8c7430;
    --link-text: #8c7430;
  }
}

@media (prefers-color-scheme: dark) {
  :root {
    --primary-text: #EEE;
    --secondary-text: #BBB;
    --primary-bkg: #141414;
    --aside-bkg: #222;
    --aside-highlight: #E7CD78;
    --link-text: #E7CD78;
  }
}

:root {
  --max-width: 800px;
}

/* Colors */

a {
  color: var(--link-text);
  text-decoration: none;
}

a:visited {
  color: var(--link-text);
}

a:hover {
  color: var(--link-text);
  text-decoration: underline;
}

html {
  font-family: system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, 'PT Sans', 'Open Sans', 'Fira Sans', 'Droid Sans', 'Helvetica Neue', Helvetica, Arial, sans-serif;
  color: var(--primary-text);
  background-color: var(--primary-bkg);
  line-height: 1.5;
  font-size: 21px;
}

body {
  margin: 1.2em;
}

/* Align body elements */

p, h1, h2, h3, h4, h5, h6, ol, ul, header, footer, aside, blockquote, pre, nav, section, table, .title-row {
  margin-left: auto;
  margin-right: auto;
  margin-top: 0px;
  margin-bottom: 1em;
  max-width: var(--max-width);

  pre {
    max-width: initial;
  }
}

p img {
  max-width: var(--max-width);
}

/* Don't leave a big gap between one line and another, just because it's a list element */
p + ul, p + ol {
  /* margin-top: -1em; */
}

th, td {
  padding: 0px 16px;
}

blockquote {
  margin-bottom: 0px;
}

pre {
  max-width: 960px;
  padding: 4px 0px;
}

/* Typography */

h1, h2, h3, h4, h5, h6 {
  font-family: "Iowan Old Style", "Sitka Text", Palatino, "Book Antiqua", serif;
  line-height: 1.3;
  margin-bottom: 0px;
}

h1 {
  font-size: 32px;
}

h2 {
  font-size: 29px;
  padding-top: 4px;
}

h3 {
  font-size: 26px;
  padding-top: 4px;
}


aside p {
  border-left: 3px solid var(--aside-highlight);
  padding: 16px;
  background-color: var(--aside-bkg);
}

blockquote {
  padding: 4px 0px;
  font-style: italic;
  margin-bottom: 1em;
  border-left: 2px solid var(--secondary-text);

  p {
    padding: 0px 16px;
  }
}

blockquote > *:last-child {
  margin-bottom: 0px;
}



/* Header area */

.title-row {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 4px;
}

h1 {
  margin: 0px 0px;
}

.title-row img {
  width: 48px;
  height: 48px;
  border-radius: 8px;
}
.date-header {
  display: flex;
  gap: 8px;
  align-items: center;

  margin-left: auto;
  margin-right: auto;
  max-width: calc(var(--max-width) + 32px);
}

.date-header hr {
  flex-grow: 1;
  height: 0px;
}

.footnotes-sep {
  max-width: calc(var(--max-width) + 16px);
}

/* Comments */

.comentario-root {
  margin-left: auto;
  margin-right: auto;
  max-width: var(--max-width);
}

/* Reposts */

.repost-embed {
  max-width: var(--max-width);
  /** No need for bottom padding because bottom element has margin */
  padding: 16px 16px 0px 16px;
  border: 1px var(--secondary-text) solid;
  border-radius: 24px;
  margin: 8px auto;
  box-sizing: border-box;
}

.repost-embed-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 8px;
}

@media only screen and (max-width: 768px) {
  .repost-embed-header {
    align-items: start;
    flex-direction: column;
    gap: 4px;
  }
}

.repost-embed-byline {
  display: flex;
  align-items: center;
  gap: 8px;
}
.repost-embed-author {
  display: flex;
  align-items: end;
  gap: 8px;
}

.repost-embed-header img {
  width: 48px;
  height: 48px;
  border-radius: 4px;
}

.repost-embed-header h3 {
  font-size: 26px;
}

.repost-embed-header a {
  color: var(--secondary-text);
}
