@import url('https://fonts.googleapis.com/css2?family=Noto+Sans+JP:wght@400;600&display=swap');

:root, .markdown-body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "Noto Sans", "Noto Sans JP", Helvetica, Arial, sans-serif, "Apple Color Emoji", "Segoe UI Emoji" !important;
}

/* 1. Use a more-intuitive box-sizing model */
*, *::before, *::after {
  box-sizing: border-box;
}

/* 2. Remove default margin */
*:not(dialog) {
  margin: 0;
}

/* 3. Enable keyword animations */
@media (prefers-reduced-motion: no-preference) {
  html {
    interpolate-size: allow-keywords;
  }
}

body {
  /* 4. Add accessible line-height */
  line-height: 1.5;
  /* 5. Improve text rendering */
  -webkit-font-smoothing: antialiased;
}

/* 6. Improve media defaults */
/* img, picture, video, canvas, svg {
  display: block;
  max-width: 100%;
} */

/* 7. Inherit fonts for form controls */
input, button, textarea, select {
  font: inherit;
}

/* 8. Avoid text overflows */
p, h1, h2, h3, h4, h5, h6 {
  overflow-wrap: break-word;
}

/* 9. Improve line wrapping */
p {
  text-wrap: pretty;
}
h1, h2, h3, h4, h5, h6 {
  text-wrap: balance;
}

/*
  10. Create a root stacking context
*/
#root, #__next {
  isolation: isolate;
}

body {
  background-color: #0d1117;
  color: #c9d1d9;
}

/* Markdown body wrapper */
.markdown-body-wrapper {
  box-sizing: border-box;
  min-width: 200px;
  max-width: 980px;
  margin: 0 auto;
  padding: 45px 45px 0;
}

@media (max-width: 768px) {
  .markdown-body-wrapper {
    padding: 24px 16px 0;
  }
}

/* Pagination styles */
.pagination {
  display: flex;
  gap: 1rem;
  align-items: center;
  justify-content: space-between;
  margin-top: 2rem;
  padding-top: 1rem;
  border-top: 1px solid #30363d;
}

.pagination-nav {
  display: flex;
  gap: 1rem;
}

.pagination a {
  color: #58a6ff;
  text-decoration: none;
}

.pagination a:hover {
  text-decoration: underline;
}

.pagination .disabled {
  color: #6e7681;
  cursor: not-allowed;
}

/* Footer styles */
.site-footer {
  margin-top: 6rem;
  padding: 2rem 0;
  border-top: 1px solid #30363d;
}

.footer-content {
  box-sizing: border-box;
  min-width: 200px;
  max-width: 980px;
  margin: 0 auto;
  padding: 0 45px;
  text-align: center;
  color: #8b949e;
  font-size: 0.875rem;
}

.footer-content p {
  margin-bottom: 0.5rem;
}

.footer-links {
  display: flex;
  gap: 0.5rem;
  justify-content: center;
  align-items: center;
}

.footer-links a {
  color: #58a6ff;
  text-decoration: none;
}

.footer-links a:hover {
  text-decoration: underline;
}

/* Hash highlight animation */
@keyframes hash-highlight-fade {
  0% {
    background-color: rgba(88, 166, 255, 0.3);
  }
  100% {
    background-color: transparent;
  }
}

.hash-highlight {
  animation: hash-highlight-fade 1.5s cubic-bezier(0.1, 0, 0.9, 0.2) forwards;
}

/* Ruby annotation styles */
ruby {
  ruby-align: center;
}

rt {
  font-size: 0.6em;
  margin-bottom: 0.2em;
  opacity: 0;
  transition: opacity 0.2s ease;
  user-select: none;
}

/* Hovering the ruby-group reveals all rt elements inside */
.rg:hover rt {
  opacity: 1;
}

/* TLN (Translator's Note) footnote styles */
.tln-footnote {
  font-size: 0.85em;
  color: #8b949e;
  padding: 0.5rem 0.75rem;
  padding-left: calc(0.75rem + 2.5em);
  text-indent: -2.5em;
  margin-top: -0.5rem;
  margin-bottom: 1rem;
  border-left: 2px solid #30363d;
  background-color: rgba(48, 54, 61, 0.3);
}

.tln-label {
  font-weight: 600;
  color: #58a6ff;
}

@media (max-width: 768px) {
  .tln-footnote {
    padding-left: 0.75rem;
    text-indent: 0;
  }

  .tln-label {
    display: none;
  }
}