/* Noto Sans TC for Chinese text: Inter keeps the Latin letters and digits, and the browser
   falls back to Noto Sans TC for the characters Inter doesn't have. Google Fonts splits the
   font by character range, so a page downloads only the parts its text uses. */
@import url("https://fonts.googleapis.com/css2?family=Noto+Sans+TC:wght@400;500;700&display=swap");

:root {
  --md-text-font: "Inter", "Noto Sans TC";
}

/* Screenshots open larger on click (javascripts/lightbox.js). */
.md-typeset img.rgtw-zoomable {
  cursor: zoom-in;
}

.rgtw-lightbox {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0;
  padding: 2vmin;
  background: rgba(0, 0, 0, 0.92);
  cursor: zoom-out;
}

.rgtw-lightbox img {
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
  box-shadow: 0 4px 24px rgba(0, 0, 0, 0.5);
}

.rgtw-lightbox figcaption {
  position: fixed;
  bottom: 1.2vmin;
  left: 0;
  right: 0;
  padding: 0 3.2rem;
  color: #fff;
  font-size: 0.8rem;
  text-align: center;
}

.rgtw-lightbox__close {
  position: fixed;
  top: 0.6rem;
  right: 0.6rem;
  width: 2.6rem;
  height: 2.6rem;
  border: 0;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.2);
  color: #fff;
  font-size: 1.8rem;
  line-height: 2.6rem;
  cursor: pointer;
}

.rgtw-lightbox__close:hover,
.rgtw-lightbox__close:focus-visible {
  background: rgba(255, 255, 255, 0.35);
}

/* Phones: the screenshot keeps a readable size and scrolls sideways. */
.rgtw-lightbox--pan {
  overflow: auto;
  justify-content: flex-start;
  padding: 3.6rem 0 2.6rem;
}

.rgtw-lightbox--pan img {
  max-width: none;
  max-height: none;
  margin: auto 0;
}

/* "Report a mistake on this page" link at the end of each page (javascripts/errata.js). */
.md-typeset .rgtw-errata {
  margin-top: 2.5em;
  padding-top: 0.8em;
  border-top: 1px solid var(--md-default-fg-color--lightest);
  color: var(--md-default-fg-color--light);
  font-size: 0.7rem;
}

/* "I finished this lesson" checkbox (javascripts/progress.js). */
.md-typeset .rgtw-progress {
  margin-top: 2em;
  padding: 0.6em 0.9em;
  border-radius: 0.3em;
  background: var(--md-code-bg-color);
  font-size: 0.75rem;
}

.md-typeset .rgtw-progress input {
  margin-right: 0.3em;
  vertical-align: middle;
}

/* Glossary filter box (javascripts/glossary-filter.js). */
.md-typeset .rgtw-filter input {
  width: 100%;
  max-width: 28rem;
  padding: 0.5em 0.7em;
  border: 1px solid var(--md-default-fg-color--lighter);
  border-radius: 0.3em;
  background: var(--md-default-bg-color);
  color: var(--md-default-fg-color);
  font: inherit;
}

/* "Nothing matches" note under the glossary filter (javascripts/glossary-filter.js). */
.md-typeset .rgtw-filter-empty {
  padding: 0.6em 0.8em;
  border-left: 0.2rem solid var(--md-accent-fg-color);
  background: var(--md-code-bg-color);
}

/* "Back to top" stays visible once the page is scrolled well down (javascripts/back-to-top.js). */
.rgtw-show-top .md-top[hidden] {
  pointer-events: auto;
  opacity: 1;
  transform: translate(-50%);
}

/* Footer: licence line, then owner, contact and visit count (overrides/partials/copyright.html). */
.md-copyright.rgtw-footer {
  width: 100%;
  margin: 0;
  /* Room below for the floating "back to top" and table-of-contents buttons. */
  padding: 0.8rem 0 4.2rem;
  font-size: 0.68rem;
  line-height: 1.8;
  text-align: center;
}

.rgtw-footer__license {
  color: var(--md-footer-fg-color--lighter);
}

.rgtw-footer__made {
  margin-left: 0.6em;
}

.rgtw-footer__meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 0.3rem 1.2rem;
  margin-top: 0.3rem;
  color: var(--md-footer-fg-color--light);
}

.rgtw-footer__note {
  font-weight: 700;
}

.md-copyright.rgtw-footer a.rgtw-footer__link {
  display: inline-flex;
  align-items: center;
  gap: 0.3em;
  color: var(--md-footer-fg-color);
  text-decoration: underline;
}

.md-copyright.rgtw-footer a.rgtw-footer__fb {
  text-decoration: none;
}

.rgtw-footer__visits {
  font-weight: 700;
  color: var(--md-footer-fg-color);
}

.rgtw-footer__visits[hidden] {
  display: none;
}
