@import "reset.css";
@import "variables.css";

.dark {
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body {
  background: var(--bg);
  color: var(--fg);
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  line-height: 1.6;
  font-size: 1.1rem;
}

main {
  flex-grow: 1;
}

button {
  cursor: pointer;
}

a {
  cursor: pointer;
  opacity: 0.8;
  color: var(--accent);
}

a:hover {
  opacity: 1;
  text-decoration: underline;
}

.contained {
  max-width: 88em;
  margin-inline: auto;
  width: 100%;
  padding-left: 1em;
  padding-right: 1em;
}

header,
footer {
  padding-top: 1.6em;
  padding-bottom: 1.6em;
}

header {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;

  line-height: 1;

  & .logo-title {
    display: flex;
    align-items: flex-end;
    font-size: x-large;
  }

  & .logo {
    width: 35px;
    padding-bottom: 2px;
  }
}

.logo-title {
  & a {
    opacity: 1;
    color: inherit;
  }
}

footer {
  display: flex;
  align-content: center;
  gap: 1em;
}

#theme-toggle {
  width: 18px;
}

#moon-icon {
  display: none;
}

.dark #sun-icon {
  display: none;
}

.dark #moon-icon {
  display: block;
}

.home-section {
  margin-bottom: 4em;

  & h1 {
    font-size: x-large;
    font-weight: bold;
    margin-bottom: 1em;
  }

  & h2 {
    margin-bottom: 1em;
    font-size: 1.4rem;
    opacity: 0.9;
  }
}

.post-list .post-item {
  display: flex;
  align-items: baseline;
  margin-bottom: 0.5em;
}

.post-list time {
  flex-shrink: 0;
  width: 8em;
  font-variant-numeric: tabular-nums;
  opacity: 0.7;
  font-size: 0.95em;
}

.post-list a {
  color: var(--fg);
  text-decoration: none;
}

.post-list a:hover {
  text-decoration: underline;
  color: var(--accent);
}

.category-list li {
  margin-bottom: 0.8em;
}

.category-list a {
  color: var(--fg);
  text-decoration: none;
  font-weight: 500;
}

.category-list a:hover {
  color: var(--accent);
  text-decoration: underline;
}

.category-desc {
  display: block;
  font-size: 0.9em;
  opacity: 0.7;
  margin-top: 0.2em;
  margin-left: 1em;
}

.more-link {
  margin-top: 1.5em;
  font-size: 0.95em;
}

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

.more-link a:hover {
  text-decoration: underline;
}

article {
  max-width: 48em;
  margin-inline: auto;
  line-height: 1.7;
  font-size: 1.1rem;

  & h1 {
    font-size: 2rem;
    margin-block: 0em 0.8em;
    font-weight: 600;
    line-height: 1.3;
  }

  & h2 {
    font-size: 1.6rem;
    margin-block: 2em 0.8em;
    font-weight: 600;
    scroll-margin-top: 2em;
  }

  & h3 {
    font-size: 1.35rem;
    margin-block: 1.8em 0.6em;
    font-weight: 600;
  }

  & h4,
  & h5,
  & h6 {
    font-size: 1.15rem;
    margin-block: 1.6em 0.5em;
    font-weight: 600;
  }

  & p {
    margin-block: 1.2em;
  }

  & ul,
  & ol {
    margin-block: 1.2em;
    padding-left: 1.5em;
  }

  & ul {
    list-style: disc outside;
  }

  & ol {
    list-style: decimal outside;
  }

  & li {
    margin-block: 0.4em;
  }

  & blockquote {
    margin-block: 1.8em;
    padding-left: 1.5em;
    border-left: 4px solid var(--accent);
    opacity: 0.9;
    font-style: italic;
  }

  & hr {
    margin-block: 3em;
    border: none;
    border-top: 1px solid var(--border);
  }

  & img {
    max-width: 100%;
    height: auto;
    border-radius: 0.5em;
    margin-block: 2em;
    display: block;
    margin-inline: auto;
  }

  & figure {
    margin-block: 2.5em;
  }

  & figcaption {
    text-align: center;
    font-size: 0.95em;
    opacity: 0.8;
    margin-top: 0.8em;
  }

  & a {
    color: var(--accent);
    text-decoration: underline;
    text-underline-offset: 0.15em;
  }

  & a:hover {
    opacity: 0.8;
  }

  & table {
    width: 100%;
    border-collapse: collapse;
    margin-block: 2em;
  }

  & th,
  & td {
    padding: 0.8em 1em;
    text-align: left;
    border-bottom: 1px solid var(--border);
  }

  & th {
    font-weight: 600;
    background: var(--muted);
  }
}

.zola-anchor {
  transition: opacity 0.2s ease;
  color: var(--accent);
  text-decoration: none;
  font-weight: normal;
  font-size: 0.9em;
}

article pre {
  max-width: 100%;
  padding: 1em;
  border-radius: 0.5em;
  overflow-x: auto;
  background: var(--muted);
  margin-block: 1.5em;
  white-space: pre;
  tab-size: 4;
}

article pre code {
  display: block;
  white-space: inherit;
  font-family:
    ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas, "Liberation Mono",
    monospace;
}

html {
  overflow-y: scroll;
}

::-webkit-scrollbar {
  width: 10px;
}

::-webkit-scrollbar-track {
  background: transparent;
}

::-webkit-scrollbar-thumb {
  background: var(--muted);
  border-radius: 5px;
}

::-webkit-scrollbar-thumb:hover {
  background: var(--accent);
}

#profile {
  max-width: 18em;
}

#avatar {
  aspect-ratio: 1/1;
  max-width: 12em;
  border-radius: 100%;
}

.links-list {
  display: flex;
  flex-direction: column;
  width: 100%;
  align-content: center;
  list-style: none;

  & a {
    display: block;
    text-align: center;
  }
}

.pagination {
  display: flex;
  gap: 1em;
}

.post-tags {
  display: flex;
  flex-direction: row;
  gap: 1em;
  max-width: 48em;
  margin-inline: auto;
  font-weight: bold;
  width: 100%;
}

.breadcrumbs {
  align-content: center;

  & ol {
    display: flex;
    gap: 0.3em;
    align-content: center;
  }
}

.search-section {
  width: 100%;
  display: flex;
  flex-direction: column;
  flex-wrap: wrap;
  align-content: center;

  & input {
    width: 100%;
    max-width: 40em;
    padding: 0.6em;
    border-style: solid;
    border-color: var(--border);
    border-width: 2px;
    border-radius: 0.4em;
    margin-bottom: 2em;
  }
}

.photo-gallery {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 2em;
  margin-block: 3em;

  & img {
    width: 100%;
    height: auto;
    border-radius: 0.5em;
  }

  & a {
    opacity: 1;
  }
}

@media (max-width: 640px) {
  .photo-gallery {
    grid-template-columns: 1fr;
    gap: 1.5em;
  }
}
