/* Small additions for the My_Notes site on top of github-style. */
.nb-tabs { overflow-x: auto; scrollbar-width: none; }
.nb-tabs::-webkit-scrollbar { display: none; }
.nb-path .octicon { color: var(--color-text-secondary, #57606a); margin-right: 4px; vertical-align: middle; }
.nb-path .path-divider { margin: 0 .25em; }
.nb-icon-folder .octicon { fill: #54aeff; }
.nb-files .Box-row:hover { background-color: var(--color-bg-secondary, #f6f8fa); }
.nb-files .nb-name { max-width: 60%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.nb-desc { min-width: 0; }
@media (max-width: 767px) { .nb-desc { display: none !important; } .nb-files .nb-name { max-width: none; flex: 1 1 auto; } }
.markdown-body img { max-width: 100%; height: auto; }
.pinned-item-meta .octicon { vertical-align: text-bottom; }
.nb-desc { flex: 1 1 auto; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
@media (max-width: 767px) {
  .nb-files .nb-name { flex-shrink: 1 !important; white-space: normal; max-width: none; }
  .nb-files .Box-row > .no-wrap { display: none; }
}

/* ---------------------------------------------------------------- responsive */
.nb-lang { white-space: nowrap; flex-shrink: 0; }

/* Tabs: wrap onto a second line instead of disappearing off-screen */
@media (max-width: 1011px) {
  .nb-tabs { flex-wrap: wrap; overflow: visible; }
  .nb-tabs .UnderlineNav-item { padding: 8px 10px; margin-right: 2px; }
}
@media (max-width: 543px) {
  .nb-tabs .octicon { display: none; }
  .nb-tabs .UnderlineNav-item { font-size: 13px; padding: 6px 8px; }
  .nb-tabs .Counter { font-size: 11px; padding: 0 5px; min-width: 18px; }
}

/* Wide tables scroll sideways inside the page instead of being cut off */
.markdown-body table {
  display: block;
  width: max-content;
  max-width: 100%;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}
.markdown-body pre { overflow-x: auto; }
.markdown-body img, .markdown-body video { max-width: 100%; height: auto; }

/* Phones: less padding around notes, calmer heading sizes */
@media (max-width: 767px) {
  .Box-body.px-5, .Box-body.px-4 { padding-left: 16px !important; padding-right: 16px !important; }
  .markdown-body { font-size: 15px; overflow-wrap: break-word; }
  .markdown-body h1 { font-size: 1.6em; }
  .markdown-body h2 { font-size: 1.35em; }
  .markdown-body h3 { font-size: 1.15em; }
  .nb-path { font-size: 18px !important; }
  .container-lg.px-3 { padding-left: 8px !important; padding-right: 8px !important; }
  .pinned-item-list-item { padding: 12px !important; }
}

/* ---------------------------------------------------------------- language switch */
.nb-lang-switch { font-size: 14px; font-weight: 600; white-space: nowrap; }
.nb-lang-switch .nb-lang-link { opacity: .6; padding: 0 2px; }
.nb-lang-switch .nb-lang-link.selected { opacity: 1; text-decoration: underline; text-underline-offset: 4px; }
.nb-lang-switch .nb-lang-link:hover { opacity: 1; }
.nb-lang-switch .nb-lang-sep { opacity: .4; margin: 0 4px; color: var(--color-header-text, #fff); }

/* ---------------------------------------------------------------- topics & genres */
.nb-terms { display: flex; flex-wrap: wrap; gap: 6px; margin: 6px 0 12px; }
.nb-chip {
  display: inline-flex; align-items: center; gap: 2px;
  padding: 2px 10px; border-radius: 2em; font-size: 12px; line-height: 20px;
  background: var(--color-bg-tertiary, #ddf4ff); color: var(--color-text-link, #0969da) !important;
  border: 1px solid transparent; white-space: nowrap; text-decoration: none !important;
}
.nb-chip:hover { border-color: currentColor; }
.nb-chip-genre { background: transparent; border-color: var(--color-border-primary, #d0d7de); color: var(--color-text-primary, #24292f) !important; font-weight: 600; }
.nb-chip.selected { background: var(--color-text-link, #0969da); color: #fff !important; }
.nb-chip-count { opacity: .7; margin-left: 4px; font-weight: 400; }
.nb-term-card { color: inherit !important; text-decoration: none !important; }
.nb-term-card:hover { border-color: var(--color-text-link, #0969da); }
.nb-term-emoji { font-size: 20px; }
.nb-note-row .nb-row-meta { display: flex; flex-wrap: wrap; align-items: center; margin-left: 28px; }
.nb-note-row .nb-row-meta .nb-terms { margin: 4px 0; }
.nb-note-row .nb-row-desc { margin-left: 28px; }
@media (max-width: 767px) { .nb-note-row .nb-row-desc, .nb-note-row .nb-date { display: none; } }

/* RSS link in the footer */
.nb-rss { color: inherit; }
.nb-rss .octicon { fill: #f26522; vertical-align: text-bottom; margin-right: 2px; }
.nb-rss:hover { color: var(--color-accent-fg, #0969da); }

/* PDF download button (pdf-button.html) and PDF links in the site index */
.nb-pdf-button .octicon { vertical-align: text-bottom; margin-right: 2px; fill: currentColor; }
.nb-pdf-link { font-size: 85%; margin-left: 6px; color: var(--color-text-secondary, #57606a) !important; }
.nb-pdf-link:hover { color: var(--color-text-link, #0969da) !important; }

/* Search suggestions while typing (js/search-suggest.js) */
.nb-suggest { position: absolute; top: calc(100% + 4px); left: 0; z-index: 100;
  width: max(100%, 420px); max-width: calc(100vw - 24px); max-height: 70vh; overflow-y: auto;
  background: var(--color-bg-overlay, #fff); color: var(--color-text-primary, #24292f);
  border: 1px solid var(--color-border-overlay, #d0d7de); border-radius: 6px;
  box-shadow: var(--color-shadow-large, 0 8px 24px rgba(140,149,159,.2)); padding: 4px 0; text-align: left; }
.nb-suggest[hidden] { display: none; }
.nb-suggest-item, .nb-suggest-all { display: block; padding: 7px 12px; color: inherit !important; text-decoration: none !important; }
.nb-suggest-item + .nb-suggest-item { border-top: 1px solid var(--color-border-primary, #eaeef2); }
.nb-suggest-title { display: block; font-weight: 600; color: var(--color-text-link, #0969da); line-height: 1.3; }
.nb-suggest-where { display: block; font-size: 11px; color: var(--color-text-secondary, #57606a); margin-top: 1px; }
.nb-suggest-text { display: block; font-size: 12px; color: var(--color-text-secondary, #57606a); margin-top: 2px;
  white-space: normal; overflow: hidden; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
.nb-suggest mark { background: rgba(255, 200, 0, .35); color: inherit; padding: 0; border-radius: 2px; }
.nb-suggest .active { background: var(--color-bg-tertiary, #f6f8fa); }
.nb-suggest-all { font-size: 12px; color: var(--color-text-secondary, #57606a) !important;
  border-top: 1px solid var(--color-border-primary, #eaeef2); }
.nb-suggest-empty { padding: 8px 12px; font-size: 12px; color: var(--color-text-secondary, #57606a); }
@media (max-width: 767px) { .nb-suggest { width: 100%; } }

/* Encrypt-to-me tool on the contact page (js/pgp-encrypt.js) */
.pgp-encrypt { border: 1px solid var(--color-border-primary, #d0d7de); border-radius: 6px; padding: 16px; margin: 16px 0; }
.nb-pgp-text, .nb-pgp-out { width: 100%; font-family: SFMono-Regular, Consolas, "Liberation Mono", Menlo, monospace; font-size: 13px; }
.nb-pgp-buttons { display: flex; flex-wrap: wrap; gap: 8px; }
.nb-pgp-status { font-weight: 600; margin-bottom: 4px; }
.nb-pgp-ok { color: var(--color-text-success, #1a7f37); }
.nb-pgp-bad { color: var(--color-text-danger, #cf222e); }
.nb-pgp-key code { word-break: break-all; }
.nb-pgp-filelist { margin-top: 8px; }
.pgp-encrypt a.btn[aria-disabled="true"] { opacity: .5; pointer-events: none; }
