/* Hack font */

@import url('/fonts/hack/hack.css');

/* Body, header, and footer */

html, body, div, p, blockquote {
  padding: 0;
  margin: 0;
}

body {
  font-size: 1rem;
  font-family: "游ゴシック", YuGothic, "Zen Kaku Gothic New", "Noto Sans JP", "ヒラギノ角ゴ Pro", "Hiragino Kaku Gothic Pro", "メイリオ", "Meiryo", sans-serif;
  font-weight: normal;
  background: rgb(255, 255, 255);
  color: rgb(69, 65, 81);
}

header {
  margin-bottom: 3rem;
}

#site-title {
  font-size: 1rem;
  line-height: 1rem;
  margin: 4rem 0;
}

#site-title a:link,
#site-title a:visited {
  color: rgb(112, 111, 142);
}

#site-section,
#article-title,
article h2 {
  line-height: 2rem;
  color: rgb(43, 36, 96);
}

header > h2,
#article-title {
  font-size: 2rem;
}

footer {
  color: rgb(131, 129, 137);
  padding: 4rem 2rem;
}

footer p {
  text-align: center;
  width: 80%;
  display: inline-block;
}

footer ul {
  float: right;
  width: 20%;
}

footer li {
  display: inline-block;
  margin: 0 0 1rem 1rem;
}

footer svg {
  height: 1.5rem;
  width: 1.5rem;
  fill: rgb(113, 97, 239);
  opacity: 0.5;
}

footer a:hover svg,
footer a:visited svg {
  opacity: 1.0;
}

/* Monospace elements */

time, code, .mono {
  font-family: monospace, "Hack";
  font-weight: normal;
}

/* Content */

time, .mono {
  color: rgb(173, 169, 186);
}

ol time {
  margin-right: 1rem;
}

p, pre {
  margin-top: 2rem;
  margin-bottom: 2rem;
  line-height: 1.65rem;
}

a:link, a:visited {
  text-decoration: none;
  color: rgb(166, 67, 253);
}

a:active, a:hover {
  text-decoration: underline;
}

#article-title {
  margin: 1.5rem 0;
}

article h2 {
  margin: 2rem 0 1.5rem;
}

#article-content {
  margin: 2rem auto;
  padding: 0 2rem;
  max-width: 43rem;
}

article header {
  display: block;
  height: auto;
}

#article-list {
  padding: 0;
}

#article-list li {
  list-style: none;
  font-weight: bold;
  line-height: 3rem;
}

.content {
  h1 {
    font-size: 1.8rem;
    border-bottom: 1px solid #e5e5e5;
    padding-bottom: 1rem;
    margin-top: 1.5rem;
    margin-bottom: 1.3rem;
  }
  h2 {
    font-size: 1.5rem;
    margin-top: 1.5rem;
    margin-bottom: 1.3rem;
  }
}

/* Code blocks */

code {
  white-space: pre;
  background: rgb(248, 248, 251);
  border-radius: 0.25rem;
  padding: 0.1rem 0.25rem;
  /* font-size: 0.9rem; */
  color: rgb(34, 30, 46);
}

pre code {
  display: block;
  white-space: pre; /* Preserve line breaks within code block */
  word-wrap: normal; /* Disable default word wrapping */
  overflow-x: auto; /* Enable horizontal scrolling if needed */
  line-height: 1.5;
  padding: 0.5rem 1rem; /* Add padding on all sides */
  margin: 0; /* Avoid duplicate margin with pre tag */
  font-family: 'Hack', Consolas, Monaco, 'Andale Mono', 'Ubuntu Mono', monospace;
  font-size: 0.9rem;
  tab-size: 4; /* Standardize tab width */
  -moz-tab-size: 4; /* Firefox compatibility */
}

blockquote {
  p {
    margin: 0.5rem;
  }
  font-style: italic;
  background-color: #f4f4f4;
  border-left: 4px solid #999;
  border-radius: .2rem;
  color: #999;
  padding: 1.2rem;
}

#avatar {
  display: block;
  height: 8rem;
  width: 8rem;
  border-radius: 4rem;
  overflow: hidden;
}

#avatar img {
  display: block;
  height: 150%;
  width: 150%;
  top: -5rem;
}

figure, p {
  img {
    max-width: 100%;
  }
  figcaption > p {
    font-size: 0.875rem;
    margin-top: 0;
    color: #999999;
  }
}

ul, li {
  margin-top: 0.2em;
  margin-bottom: 0.2rem;
}

table {
  border-collapse: collapse;
  width: 100%;
}

tr:last-child {
  border-width: 0;
}

tr {
  border-color: #dcdcdc;
  border-style: solid;
  border-width: 0.1em 0;
}

th {
  text-align: start;
  border-color: #808080;
  border-bottom-style: solid;
  border-bottom-width: 0.12rem;
  padding: 1px 0px 8px 8px;
}

th:first-child {
  padding: 1px 8px 8px 0px;
}

td {
  vertical-align: baseline;
  padding: 8px 8px 8px 0px;
}

.table-container {
  overflow-x: scroll;
}

.footnotes {
  hr {
    margin-top: 3rem;
    border: none;
    border-top: 1px #808080 solid
  }
  ol {
    padding-inline-start: 2rem;
    color: #999999;
    p {
      font-size: 0.9rem;
      margin-top: 0.5rem;
      margin-bottom: 0.5rem;
      line-height: 1.5rem;
    }
  }
}

/* Code comments */

.c1 {
  color: rgb(130, 127, 137);
}

/* Mobile sizing */

@media (max-width: 600px) {
  #article-list time {
    display: block;
  }

  #article-list li {
    line-height: 2rem;
    padding: 0.5rem 0 1rem;
  }
}

/* Dark-mode colors */

@media (prefers-color-scheme: dark) {
  body {
    background: #22222E;
    background: rgb(34, 34, 46);
    color: rgb(220, 220, 220);
  }

  #site-section,
  #article-title,
  article h2 {
    color: rgb(255, 255, 255);
  }

  code {
    background: rgba(13, 13, 28);
    color: rgb(233, 233, 233);
  }

  .content h1 {
    border-bottom: 1px solid #808080;
  }

  blockquote {
    background-color: #4d4d4d;
    border-left: 4px solid #f0f0f0;
    color: #f0f0f0;
  }

  tr {
    border-color: #4d4d4d;
  }

  th {
    border-color: #808080;
  }
}
