:root {
  --color-base: #f8f9fa;
  --color-primary: #212529;
  --color-accent: #ff6b6b;
  --color-accent-hover: #e03131;
}

.dark-mode {
  --color-base: #212529;
  --color-primary: #f8f9fa;
}

.theme-switch {
  height: 50px;
  width: 50px;
  padding: 0;
  border-radius: 50%;
  background-color: var(--color-base);
  display: flex;
  justify-content: center;
  align-items: center;
  position: absolute;
  top: 20px;
  right: 20px;
  cursor: pointer;
  border: 0;
}

.theme-switch:hover,
.theme-switch:active,
.theme-switch:focus{
  border-color: var(--color-primary);
  border: 0;
  box-shadow: none;
  outline: none;
}

.theme-switch svg {
  fill: var(--color-primary)
}

.theme-switch svg:last-child {
  display: none;
}

.dark-mode .theme-switch svg:first-child {
  display: none;
}

.dark-mode .theme-switch svg:last-child {
  display: block;
}

body {
  font-family: system-ui, sans-serif;
  line-height: 1.5;
  margin: 0 auto;
  padding: 5em 2em 2em;
  background-color: var(--color-base);
  color: var(--color-primary);

  font-size: 1.2rem;
}

.site {
  max-width: 800px;
  margin: 0 auto;
  text-align: center;
}

.site-nav {
  margin-bottom: 1.5em;
}

.navbar {
  list-style: none;
  padding: 0;
  margin: 0 0 2em;
}

.navbar a,
.site-footer a {
  color: var(--color-primary);
}

.site-header {
  margin-bottom: 2em;
}

.avatar {
  width: 210px;
  border-radius: 50%;
}

.navbar li {
  display: inline-block;
  margin: 0 0.75em;
}

.site-header h1 {
  margin-bottom: 0.25em;
}

.tagline {
  margin: 0;
}

.latest-section {
  margin-bottom: 3em;
}

.latest-section h2 {
}

.latest-posts {
  list-style: none;
  text-align: left;
  margin: 0 auto;
  width: fit-content;
}

.latest-posts li {
  display: grid;
  grid-template-columns: 1fr auto auto;
  gap: 0.5em;
  align-items: baseline;
}

.latest-posts a {
  text-decoration: none;
  color: var(--color-accent);
}

.latest-posts a:hover {
  text-decoration: none;
  color: var(--color-accent-hover);
}

.latest-posts time {
  white-space: nowrap;
  font-size: 0.9em;
}

.site-footer {
  font-size: 0.9em;
}

/* Post */

.post-header h1 {
  margin-bottom: 0.25em;
}

.post-header {
  margin-bottom: 3em;
}

.post-content {
  text-align: left;
}

.post-content p:has(img) {
  text-align: center;
}

.post-content p:has(img) img {
  display: block;
  margin: 2em auto 0.75em;
  max-width: min(100%, 640px);
  max-height: min(70vh, 400px);
}

.post-content p:has(img) em {
  display: block;
  max-width: min(100%, 640px);
  margin: 0 auto 2em;
  font-size: 0.9em;
  color: var(--color-primary);
  opacity: 0.75;
}

.post-content a {
  color: var(--color-accent);
  text-decoration: none;
}

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

.post-return {
  margin-bottom: 2em;
}

.post-return a {
  color: var(--color-primary);
}

/* Posts */

.post-header {
  margin-bottom: 1.5em;
}

.all_posts-section {
  margin-bottom: 2.5em;
}

/* Mobile devices compatibility */
@media (max-width: 600px) {
  body {
    padding: 2em 1em;
    font-size: 1rem;
  }

  .site {
    max-width: 100%;
  }

  .avatar {
    width: 190px ;
  }

  .theme-switch {
    top: 1em;
    right: 1em;
    width: 40px;
    height: 40px;
  }

  .site-header .tagline {
    font-size: 0.95rem;
  }
}
