/* Source Serif 4 variable font. */
@font-face {
  font-family: "Source Serif 4";
  src: url("/assets/fonts/Source_Serif_4/SourceSerif4-subset.woff2") format("woff2");
  font-weight: 200 900;
  font-style: normal;
  font-display: block;
}

@font-face {
  font-family: "Source Serif 4";
  src: url("/assets/fonts/Source_Serif_4/SourceSerif4-Italic-subset.woff2") format("woff2");
  font-weight: 200 900;
  font-style: italic;
  font-display: block;
}

:root {
  --color-bg: rgb(235, 235, 230);
  --color-paper: rgb(252, 250, 245);
  --color-text: rgb(35, 35, 35);
  --color-text-muted: rgb(120, 115, 105);
  --color-link: rgb(100, 60, 30);
  --color-link-hover: rgb(160, 90, 30);
  --color-shadow: rgb(0, 0, 0);

  --font-body: "Source Serif 4", Georgia, serif;
  --font-size: 18px;
  --line-height: 1.7;
  --paper-width: 61rem;
  --paper-padding: 4rem;
}

*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  font-family: var(--font-body);
  font-size: var(--font-size);
  line-height: var(--line-height);
  color: var(--color-text);
  background-color: var(--color-bg);
  -webkit-font-smoothing: antialiased;
  /* Equal gap top and bottom around the paper. */
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  position: relative;
  padding: 3rem 0;
}

/* Paper container. */
.paper {
  max-width: var(--paper-width);
  width: 100%;
  margin: 0 auto;
  padding: var(--paper-padding);
  background-color: var(--color-paper);
  border-radius: 3px;
  box-shadow:
    0 1px 3px rgba(0, 0, 0, 0.08),
    0 4px 12px rgba(0, 0, 0, 0.06);
  flex: 1;
}

/* Typography. */
h1 {
  font-size: 2rem;
  font-weight: 700;
  margin-bottom: 0.25rem;
  line-height: 1.2;
}

h1 + p {
  margin-bottom: 0;
}

hr {
  border: none;
  border-top: 1px solid rgb(210, 205, 195);
  margin: 1.25rem 0 1.5rem;
}

h2 {
  font-size: 1.4rem;
  font-weight: 600;
  margin-top: 2rem;
  margin-bottom: 0.75rem;
  line-height: 1.3;
}

p {
  margin-bottom: 1rem;
}

strong {
  font-weight: 700;
}

em {
  font-style: italic;
}

.subtitle-link {
  color: inherit;
  text-decoration: none;
}

/* Post list on index. */
.post-list {
  list-style: none;
  padding: 0;
}

.post-list li {
  margin-bottom: 0.75rem;
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 2rem;
}

.post-list a {
  color: var(--color-link);
  text-decoration: none;
  font-weight: 500;
  transition: color 0.15s ease;
}

.post-list a:hover {
  color: var(--color-link-hover);
}

.post-meta {
  display: flex;
  gap: 0.5rem;
  white-space: nowrap;
  font-size: 0.85rem;
  color: var(--color-text-muted);
  font-style: italic;
}


/* Post content styles. */
.post-header {
  position: relative;
}

.header-actions {
  display: flex;
  gap: 0.75rem;
  position: absolute;
  top: 0.25rem;
  right: 0;
}

.back-link {
  color: var(--color-link);
  text-decoration: none;
  font-size: var(--font-size);
  transition: color 0.15s ease;
}

.back-link:hover {
  color: var(--color-link-hover);
}

.post-header {
  margin-bottom: 2rem;
}

.post-content.justified {
  text-align: justify;
}

.post-header .post-date {
  color: var(--color-text-muted);
  font-size: 0.9rem;
}

.post-content a {
  color: var(--color-link);
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 2px;
}

.post-content a:hover {
  color: var(--color-link-hover);
}

.post-content blockquote {
  border-left: 3px solid var(--color-text-muted);
  padding-left: 1.25rem;
  margin: 1.5rem 0;
  color: var(--color-text-muted);
  font-style: italic;
}

.post-content ul,
.post-content ol {
  margin: 1rem 0;
  padding-left: 1.5rem;
}

.post-content li {
  margin-bottom: 0.35rem;
}

/* Footer. */
.site-footer {
  text-align: center;
  position: absolute;
  bottom: 0.75rem;
  left: 0;
  right: 0;
  color: rgb(160, 155, 145);
  font-size: 0.8rem;
  font-style: italic;
}

/* Responsive. */
@media (max-width: 700px) {
  :root {
    --paper-padding: 1.75rem;
    --font-size: 16px;
  }

  body {
    padding: 1rem;
  }

  .site-footer {
    position: static;
    margin-top: 1rem;
  }

  .post-header {
    text-align: center;
  }

  .header-actions {
    position: static;
    margin-top: 0.5rem;
    justify-content: center;
  }
}
