/* NewbieNeuro — thư viện guideline: trang danh mục, trang guideline và trình đọc PDF. Dùng token của article.css. */

/* ---------- trình đọc PDF ---------- */
.pdfv { margin: 34px 0 0; border: 1px solid var(--hair); border-radius: 2px; background: var(--panel); display: flex; flex-direction: column; height: min(88vh, 1100px); min-height: 520px; scroll-margin-top: 12px; }
.pdfv:fullscreen { height: 100vh; border: 0; border-radius: 0; }
.pdfv-head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; flex-wrap: wrap; padding: 14px 16px 0; }
.pdfv-head h2 { margin: 0; font-family: var(--display); font-variation-settings: 'wdth' 112, 'wght' 700; font-size: 19px; letter-spacing: -0.015em; }
.pdfv-head p { margin: 0; font-size: 13px; color: var(--meta); }

.pdfv-bar { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 10px; padding: 10px 12px; border-bottom: 1px solid var(--hair); font-size: 13.5px; }
.pdfv-grp { display: flex; align-items: center; gap: 4px; }
.pdfv-bar button, .pdfv-bar .pdfv-btn { display: inline-flex; align-items: center; gap: 6px; height: 34px; min-width: 34px; padding: 0 9px; justify-content: center; background: var(--bg); border: 1px solid var(--hair); border-radius: 2px; color: var(--ink); font-size: 13.5px; line-height: 1; }
.pdfv-bar button:hover:not(:disabled), .pdfv-bar .pdfv-btn:hover { border-color: var(--ink2); text-decoration: none; color: var(--ink); }
.pdfv-bar button:disabled { opacity: .4; cursor: default; }
.pdfv-bar button[aria-expanded="true"], .pdfv-bar button[aria-pressed="true"] { background: var(--coreBg); border-color: var(--core); color: var(--core); }
.pdfv-bar svg { width: 16px; height: 16px; flex-shrink: 0; }
.pdfv-page-in { width: 54px; height: 34px; padding: 0 6px; text-align: center; font: 500 13.5px var(--mono); background: var(--bg); color: var(--ink); border: 1px solid var(--hair); border-radius: 2px; -moz-appearance: textfield; }
.pdfv-page-in::-webkit-inner-spin-button, .pdfv-page-in::-webkit-outer-spin-button { -webkit-appearance: none; margin: 0; }
.pdfv-of { color: var(--meta); font-family: var(--mono); font-size: 13px; white-space: nowrap; }
.pdfv-zoom { min-width: 46px; text-align: center; font-family: var(--mono); font-size: 13px; color: var(--ink2); }
.pdfv-search { display: flex; flex: 1 1 200px; max-width: 320px; margin-left: auto; }
.pdfv-search input { flex: 1; min-width: 0; height: 34px; padding: 0 10px; font: inherit; font-size: 13.5px; background: var(--bg); color: var(--ink); border: 1px solid var(--hair); border-right: 0; border-radius: 2px 0 0 2px; }
.pdfv-search button { border-radius: 0 2px 2px 0 !important; }
.pdfv-search input:focus { outline: 2px solid var(--core); outline-offset: -1px; }

.pdfv-body { position: relative; flex: 1; display: flex; min-height: 0; }
.pdfv-side { display: none; width: 290px; flex-shrink: 0; overflow: auto; border-right: 1px solid var(--hair); background: var(--panel); font-size: 13.5px; padding: 10px 0 20px; }
.pdfv.side-open .pdfv-side { display: block; }
.pdfv-side h3 { margin: 6px 14px 6px; font-size: 12px; font-weight: 600; letter-spacing: .02em; color: var(--meta); text-transform: uppercase; }
.pdfv-side ul, .pdfv-side ol { list-style: none; margin: 0; padding: 0; }
.pdfv-side ul ul { padding-left: 12px; }
.pdfv-side button { display: block; width: 100%; padding: 6px 14px; text-align: left; background: none; border: 0; color: var(--ink2); line-height: 1.4; }
.pdfv-side button:hover { background: var(--rowHover); color: var(--ink); }
.pdfv-outline > ul > li > button { color: var(--ink); font-weight: 500; }
.pdfv-results { border-bottom: 1px solid var(--hair); padding-bottom: 10px; margin-bottom: 10px; }
.pdfv-results .mono { display: block; font-size: 11.5px; color: var(--core); margin-bottom: 2px; }
.pdfv-results .snip { display: block; font-size: 12.5px; color: var(--ink2); }
.pdfv-results mark { background: var(--amberBg); color: var(--ink); padding: 0 1px; }
.pdfv-note { margin: 4px 14px 8px; color: var(--meta); font-size: 13px; }

.pdfv-scroll { flex: 1; overflow: auto; background: var(--sunk); overscroll-behavior: contain; }
.pdfv-scroll:focus-visible { outline-offset: -2px; }
.pdfv-pages { padding: 20px 24px 40px; }
.pdfv-page { position: relative; margin: 0 auto 14px; background: #fff; box-shadow: 0 1px 3px var(--shadow); }
.pdfv-page canvas { position: absolute; inset: 0; width: 100%; height: 100%; display: block; }
.pdfv-page.flash { animation: pdfv-flash 1.4s ease-out; }
@keyframes pdfv-flash { 0%, 30% { box-shadow: 0 0 0 3px var(--core); } 100% { box-shadow: 0 1px 3px var(--shadow); } }
.pdfv-link { position: absolute; z-index: 2; }
.pdfv-link:hover { background: rgba(168, 17, 79, .12); text-decoration: none; }
.pdfv-msg { padding: 40px 20px; text-align: center; color: var(--ink2); }
.pdfv:not(.ready) .pdfv-bar > * { visibility: hidden; }
.pdfv-loading { padding: 60px 20px; text-align: center; color: var(--meta); font-size: 14px; }

/* Lớp chữ của PDF.js (rút gọn từ pdf_viewer.css) để chọn và sao chép chữ. */
.textLayer { position: absolute; text-align: initial; inset: 0; overflow: clip; opacity: 1; line-height: 1; letter-spacing: normal; word-spacing: normal; text-size-adjust: none; -webkit-text-size-adjust: none; forced-color-adjust: none; transform-origin: 0 0; caret-color: CanvasText; z-index: 0;
  --min-font-size: 1; --text-scale-factor: calc(var(--total-scale-factor) * var(--min-font-size)); --min-font-size-inv: calc(1 / var(--min-font-size)); --scale-round-x: 1px; --scale-round-y: 1px; }
.textLayer :is(span, br) { color: transparent; position: absolute; white-space: pre; cursor: text; transform-origin: 0% 0%; user-select: text; }
.textLayer > :not(.markedContent), .textLayer .markedContent span:not(.markedContent) { z-index: 1; --font-height: 0; font-size: calc(var(--text-scale-factor) * var(--font-height)); --scale-x: 1; --rotate: 0deg; transform: rotate(var(--rotate)) scaleX(var(--scale-x)) scale(var(--min-font-size-inv)); }
.textLayer .markedContent { display: contents; }
.textLayer span[role="img"] { user-select: none; cursor: default; }
.textLayer ::selection { background: rgba(0, 0, 255, .25); color: transparent; }
.textLayer br::selection { background: transparent; }
.textLayer .endOfContent { display: block; position: absolute; inset: 100% 0 0; z-index: 0; cursor: default; user-select: none; }

@media (max-width: 899px) {
  .pdfv { height: 82vh; }
  .pdfv-side { position: absolute; inset: 0 auto 0 0; z-index: 5; width: min(320px, 86%); box-shadow: 4px 0 18px var(--shadow); }
  .pdfv-hide-sm { display: none !important; }
  .pdfv-pages { padding: 10px 8px 30px; }
  .pdfv-search { max-width: none; order: 10; flex-basis: 100%; }
}

/* ---------- trang guideline ---------- */
.gl-status { display: inline-block; padding: 3px 9px; font-size: 12.5px; font-weight: 600; border-radius: 2px; }
.gl-status--ok { color: var(--pen); background: var(--penBg); }
.gl-status--warn { color: var(--amber); background: var(--amberBg); }
.gl-status--off { color: var(--meta); background: var(--sunk); }
.gl-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 18px; }
.gl-actions a { display: inline-flex; align-items: center; gap: 6px; padding: 8px 14px; font-size: 14px; font-weight: 500; border: 1px solid var(--hair); border-radius: 2px; color: var(--ink); background: var(--panel); }
.gl-actions a:hover { border-color: var(--core); color: var(--core); text-decoration: none; }
.gl-actions a.primary { background: var(--core); border-color: var(--core); color: var(--coreOn); }
.gl-actions a.primary:hover { background: var(--coreH); color: var(--coreOn); }
.gl-body { max-width: 820px; margin-top: 10px; }
.gl-body .rel-list ul { padding-left: 0; list-style: none; }
.gl-rel li { display: flex; gap: 12px; padding: 9px 0; border-bottom: 1px solid var(--hair); margin: 0; }
.gl-rel .code-ref { flex-shrink: 0; min-width: 88px; }
.gl-rel .soon { color: var(--meta); font-size: 13px; margin-left: auto; white-space: nowrap; }

/* ---------- trang danh mục /guideline/ ---------- */
.gl-filters { display: flex; flex-wrap: wrap; gap: 6px; margin: 28px 0 14px; }
.gl-filters button { padding: 7px 13px; font-size: 13.5px; background: var(--panel); border: 1px solid var(--hair); border-radius: 2px; }
.gl-filters button[aria-pressed="true"] { background: var(--ink); color: var(--bg); border-color: var(--ink); }
.gl-list { list-style: none; margin: 0; padding: 0; border-top: 2px solid var(--strong); }
.gl-item a { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 6px 20px; padding: 18px 4px; border-bottom: 1px solid var(--hair); color: var(--ink); }
.gl-item a:hover { background: var(--rowHover); text-decoration: none; }
.gl-item .gl-code { font-size: 12.5px; color: var(--core); }
.gl-item b { display: block; font-family: var(--display); font-variation-settings: 'wdth' 108, 'wght' 650; font-size: 19px; line-height: 1.3; margin: 3px 0 4px; }
.gl-item .gl-sub { font-size: 14px; color: var(--meta); }
.gl-item .gl-side { text-align: right; font-size: 13px; color: var(--ink2); display: flex; flex-direction: column; gap: 6px; align-items: flex-end; }
.gl-count { margin-top: 18px; }
@media (max-width: 640px) { .gl-item a { grid-template-columns: 1fr; } .gl-item .gl-side { align-items: flex-start; text-align: left; flex-direction: row; flex-wrap: wrap; } }
