/* === base === */

html {
  scroll-behavior: smooth;
}

html[theme='dark-mode'] {
  filter: invert(1) hue-rotate(180deg);
}

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

body {
  font: 15px/1.75 'Helvetica Neue', Helvetica, Arial, sans-serif;
  color: #3a3a3a;
  background: #fff;
  margin: 0;
  -webkit-font-smoothing: antialiased;
}

::selection {
  background: #d4e8fb;
}

a, a:link, a:visited, a:active, a:focus {
  color: inherit;
  text-decoration: none;
  transition: color 0.15s;
}

a:hover {
  color: #000;
}

a:focus-visible {
  outline: 2px solid #5badf0;
  outline-offset: 2px;
  border-radius: 2px;
}

/* === nav === */

nav.navigation {
  display: flex;
  justify-content: flex-end;
  align-items: center;
  gap: 2px;
  padding: 20px 20px 0;
  background: rgba(255, 255, 255, 0.92);
}

nav.navigation a,
nav.navigation select {
  padding: 6px 12px;
  font-size: 13px;
  color: #3a3a3a;
  border-radius: 5px;
  background: transparent;
  cursor: pointer;
  transition: color 0.15s, background 0.15s;
  border: none;
}

nav.navigation a:hover {
  color: #000;
  background: #f5f5f5;
}

nav.navigation a.button {
  background: #5badf0;
  color: #fff;
  margin-left: 8px;
}

nav.navigation a.button:hover {
  background: #4a9ee0;
}

@media (max-width: 700px) {
  nav.navigation {
    padding: 16px 10px 0;
    gap: 0;
  }
  nav.navigation a,
  nav.navigation select {
    padding: 6px 8px;
    font-size: 13px;
  }
}

/* === layout === */

main.main {
  max-width: 700px;
  margin: 0 auto;
  padding: 0 16px;
}

/* === typography === */

h1, h2, h3 {
  font-weight: 400;
  line-height: 1.3;
  margin: 2em 0 0.75em;
}

p {
  margin: 1.4em 0;
}

/* === code === */

pre, code {
  font-family: 'SFMono-Regular', Consolas, 'Liberation Mono', Menlo, Courier, monospace;
  background: #f7f7f5;
  border-radius: 4px;
  font-size: 13.5px;
}

pre {
  padding: 10px 14px;
  overflow-x: auto;
  margin: 1.5em 0;
  border-left: 3px solid #5badf0;
  border-radius: 0 4px 4px 0;
}

code {
  padding: 1px 5px;
}

pre code {
  background: none;
  padding: 0;
  font-size: inherit;
}

/* === blockquote === */

blockquote {
  margin: 1.75em 0;
  padding: 0.1em 1.25em;
  border-left: 3px solid #e0e0e0;
  color: #767676;
  font-style: italic;
}

/* === hr === */

hr {
  border: none;
  height: 1px;
  background: #ebebeb;
  margin: 2.5em 0;
}

/* === table === */

table {
  width: 100%;
  border-collapse: collapse;
  margin: 2em 0;
  font-size: 14px;
}

th, td {
  text-align: left;
  padding: 9px 14px;
  border: 1px solid #e0e0e0;
}

th {
  font-weight: 500;
  background: #fafafa;
}

tr:nth-child(odd) td {
  background: #fdfdfd;
}

/* === images === */

img {
  max-width: 100%;
  height: auto;
  display: block;
  margin: 1.5em auto;
  border-radius: 4px;
}

/* === pagination === */

.pagination a {
  color: #3a3a3a;
  padding: 4px 10px;
  border-radius: 4px;
  margin: 0 2px;
  transition: background 0.15s;
}

.pagination a:hover {
  color: #000;
  background: #f0f0f0;
}

/* === footer === */

footer, #footer {
  text-align: center;
  color: #bbb;
  font-size: 14px;
  margin: 60px 0 24px;
}

#footer .split:hover path {
  fill: #ff3356;
  transition: fill 0.6s ease-out;
  cursor: pointer;
}

#social a {
  margin: 0 5px;
}

/* === profile === */

.profile {
  margin: 60px auto 0;
  text-align: center;
}

.profile .avatar {
  display: inline-block;
  width: 80px;
  height: 80px;
  border-radius: 50%;
}

.profile h1 {
  font-weight: 400;
  font-size: 20px;
  color: #3a3a3a;
  margin: 12px 0 0;
  letter-spacing: 0;
}

.profile h2 {
  font-size: 17px;
  font-weight: 300;
  color: #888;
  margin-top: 4px;
}

/* === list page === */

#list-page {
  max-width: 580px;
  margin: 0 auto;
  padding: 0 24px;
}

#list-page .item {
  margin: 10px 0;
}

#list-page .title {
  display: inline;
  color: #3a3a3a;
  font-size: 18px;
  font-weight: 400;
  margin: 0;
  width: 78%;
}

#list-page .title a {
  color: inherit;
}

#list-page .title a:hover {
  color: #000;
}

#list-page .date {
  width: 22%;
  float: right;
  text-align: right;
  color: #bbb;
  font-size: 13px;
  padding-top: 3px;
}

#list-page .summary {
  color: #888;
  font-size: 14px;
  margin-top: 6px;
  margin-bottom: 28px;
  overflow-wrap: anywhere;
}

#list-page .pagination {
  margin: 48px 0;
  width: 100%;
  height: 32px;
}

#list-page .tags {
  display: inline;
  margin-left: 7px;
}

#list-page .tags a {
  background: #f3f3f3;
  padding: 3px 7px;
  color: #aaa;
  font-size: 13px;
  border-radius: 4px;
  margin-right: 3px;
}

#list-page .tags a:hover {
  color: #333;
}

#list-page .pagination .prev { float: left; }
#list-page .pagination .next { float: right; }

/* === single post === */

#single {
  max-width: 660px;
  margin: 60px auto 0;
  padding: 0 48px;
}

#single .title {
  text-align: center;
  font-size: 30px;
  font-weight: 400;
  line-height: 1.3;
  margin-bottom: 0;
}

@media (max-width: 700px) {
  #single {
    padding: 0 18px;
    margin: 24px auto 0;
  }
  #single .title {
    font-size: 22px;
  }
}

#single .tip {
  text-align: center;
  color: #999;
  margin-top: 12px;
  font-size: 13px;
}

#single .tip .split {
  margin: 0 4px;
}

#single .content {
  margin-top: 40px;
}

#single .tags {
  margin-top: 28px;
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

#single .tags a {
  background: #f3f3f3;
  padding: 4px 9px;
  color: #888;
  font-size: 13px;
  border-radius: 4px;
  transition: color 0.15s, background 0.15s;
}

#single .tags a:hover {
  background: #ebebeb;
  color: #333;
}

/* === archive === */

#archive {
  max-width: 580px;
  margin: 0 auto;
  padding: 0 24px;
}

#archive .total {
  font-size: 15px;
  color: #888;
}

#archive .group {
  margin: 28px auto;
}

#archive .group .key {
  font-size: 18px;
  font-weight: 400;
  margin-bottom: 10px;
}

#archive .group .value {
  display: block;
  font-size: 15px;
  margin-bottom: 10px;
}

#archive .group .value .date {
  display: inline-block;
  color: #bbb;
  min-width: 52px;
  font-size: 13px;
}

#archive .group .value .title {
  display: inline;
}

#archive .group .value .title a {
  color: #3a3a3a;
}

#archive .group .value .title a:hover {
  color: #000;
}

#archive .group .value .tags {
  display: inline;
  margin-left: 7px;
}

#archive .group .value .tags a {
  background: #f3f3f3;
  padding: 3px 7px;
  color: #aaa;
  font-size: 13px;
  border-radius: 4px;
  margin-right: 3px;
}

#archive .group .value .tags a:hover {
  color: #333;
}

/* === tags === */

#tags {
  max-width: 700px;
  margin: 48px auto 0;
  padding: 0 12px;
  text-align: center;
}

#tags .tag {
  display: inline-block;
  margin: 5px;
}

@media (max-width: 700px) {
  #tags {
    margin-top: 24px;
  }
  #tags .tag {
    margin: 3px 4px;
  }
}

#tags .tag a {
  background: #f3f3f3;
  padding: 4px 9px;
  color: #3a3a3a;
  font-size: 14px;
  border-radius: 4px;
  transition: background 0.15s, color 0.15s;
}

#tags .tag a:hover {
  background: #ebebeb;
  color: #000;
}

/* === section === */

#section {
  max-width: 580px;
  margin: 48px auto 0;
  padding: 0 12px;
}

/* === 404 === */

#page-404 {
  max-width: 580px;
  margin: 0 auto;
  padding: 0 24px;
}

#page-404 .item {
  margin: 12px 0 0;
}

#page-404 .title {
  display: inline-block;
  color: #3a3a3a;
  font-size: 15px;
  font-weight: 400;
  margin: 0;
  width: 78%;
}

#page-404 .text {
  text-align: center;
  margin-top: 60px;
}

#page-404 .read-more {
  font-weight: 300;
  font-size: 20px;
  margin-top: 48px;
  margin-bottom: 12px;
}

#page-404 .date {
  width: 22%;
  float: right;
  text-align: right;
  color: #bbb;
  font-size: 13px;
}
