/**
 * Thư viện kỹ thuật — archive of a library category (root / Series / model / lesson branch). Template: template-parts/tech-library-archive.php.
 * Same tokens as /thu-vien-ky-thuat/ (tech-library.css). Everything is scoped under .tlarc-page so Flatsome / the blog can not leak in or out.
 */
.tlarc-page { --red: #9d0718; --red2: #bd1026; --ink: #1c2532; --muted: #667085; --line: #e8eaf0; --bg: #f5f6f9; --tint: #fdecee; background: var(--bg); color: var(--ink); font: 15px/1.55 system-ui, -apple-system, 'Segoe UI', sans-serif; }
.tlarc-page *, .tlarc-page *::before, .tlarc-page *::after { box-sizing: border-box; }
.tlarc-page h1, .tlarc-page h2, .tlarc-page h3 { width: auto; margin: 0; font-family: inherit; font-weight: 700; line-height: 1.35; letter-spacing: 0; text-transform: none; color: inherit; }
.tlarc-page p, .tlarc-page ul, .tlarc-page ol { margin: 0; padding: 0; }
.tlarc-page ul, .tlarc-page ol { list-style: none; }
.tlarc-page li { margin: 0; }
.tlarc-page a { color: inherit; text-decoration: none; }
.tlarc-page img { display: block; max-width: 100%; height: auto; }
.tlarc-page .screen-reader-text { position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
.tlarc-page :focus-visible { outline: 2px solid var(--red); outline-offset: 2px; }

.tlarc-wrap { max-width: 1240px; margin: 0 auto; padding: 18px 18px 70px; }

/* breadcrumb */
.tlarc-crumbs ol { display: flex; flex-wrap: wrap; align-items: center; gap: 2px 0; font-size: 14px; color: var(--muted); }
.tlarc-crumbs li { display: inline-flex; align-items: center; min-width: 0; }
.tlarc-crumbs li + li::before { content: ''; width: 6px; height: 6px; margin: 0 11px 0 9px; border-top: 1.5px solid #98a2b3; border-right: 1.5px solid #98a2b3; transform: rotate(45deg); flex: none; }
.tlarc-crumbs a:hover { color: var(--red); }
.tlarc-crumbs [aria-current] { color: var(--ink); font-weight: 600; }

/* grid */
.tlarc-grid { display: grid; grid-template-columns: minmax(0, 1fr) 340px; gap: 24px; align-items: start; margin-top: 14px; }
.tlarc-main { min-width: 0; }

/* title block */
.tlarc-head { display: flex; align-items: center; gap: 18px; background: #fff; border: 1px solid var(--line); border-radius: 16px 16px 0 0; border-bottom: 0; padding: 22px 24px 8px; }
.tlarc-head__ico { flex: none; display: flex; align-items: center; justify-content: center; width: 72px; height: 72px; border-radius: 18px; background: var(--tint); color: var(--red); }
.tlarc-page .tlarc-title { font-size: 36px; line-height: 1.18; font-weight: 800; color: var(--ink); overflow-wrap: anywhere; }
.tlarc-desc { margin-top: 6px; color: var(--muted); font-size: 17px; line-height: 1.5; }

/* search + quick filters (same white card as the title) */
.tlarc-search { display: flex; margin: 0; padding: 14px 24px 0; background: #fff; border: 1px solid var(--line); border-top: 0; border-bottom: 0; }
.tlarc-page .tlarc-search input[type="search"] { flex: 1; min-width: 0; height: 54px; margin: 0; padding: 0 16px 0 18px; border: 1px solid var(--line); border-right: 0; border-radius: 10px 0 0 10px; background: #fff; color: var(--ink); font-size: 16px; box-shadow: none; -webkit-appearance: none; appearance: none; }
.tlarc-page .tlarc-search input[type="search"]:focus { border-color: #d7a1a9; outline: 0; box-shadow: 0 0 0 3px #9d071814; }
.tlarc-page .tlarc-search input[type="search"]::placeholder { color: #8a93a3; opacity: 1; }
.tlarc-page .tlarc-search button { display: inline-flex; align-items: center; gap: 9px; flex: none; height: 54px; margin: 0; padding: 0 26px; border: 0; border-radius: 0 10px 10px 0; background: var(--red); color: #fff; font-size: 16px; font-weight: 700; line-height: 1; text-transform: none; letter-spacing: 0; box-shadow: none; cursor: pointer; }
.tlarc-page .tlarc-search button:hover { background: var(--red2); }
.tlarc-filter { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; padding: 16px 24px 20px; background: #fff; border: 1px solid var(--line); border-top: 0; border-radius: 0 0 16px 16px; }
.tlarc-filter__lbl { color: var(--ink); font-weight: 500; margin-right: 2px; }
.tlarc-chip { display: inline-flex; align-items: center; gap: 7px; min-height: 42px; padding: 0 20px; border: 1px solid var(--line); border-radius: 999px; background: #fff; color: var(--ink); font-size: 15px; line-height: 1; box-shadow: 0 1px 2px #1018280a; }
.tlarc-chip span { color: var(--muted); font-size: 13px; font-variant-numeric: tabular-nums; }
.tlarc-chip:hover { border-color: #d7a1a9; color: var(--red); }
.tlarc-chip.is-active { background: var(--red); border-color: var(--red); color: #fff; font-weight: 600; }
.tlarc-chip.is-active span { color: #ffd9de; }
/* without a chip row the search block closes the card itself (class set by the template only in that state) */
.tlarc-search.tlarc-search--solo { padding-bottom: 20px; border-bottom: 1px solid var(--line); border-radius: 0 0 16px 16px; }
.tlarc-search + .tlarc-results { margin-top: 20px; }
.tlarc-filter + .tlarc-results { margin-top: 20px; }

/* results */
.tlarc-results { background: #fff; border: 1px solid var(--line); border-radius: 16px; overflow: hidden; }
.tlarc-results__head { display: flex; align-items: center; gap: 14px; padding: 16px 20px; background: #fafbfc; border-bottom: 1px solid var(--line); }
.tlarc-results__ico { flex: none; display: flex; align-items: center; justify-content: center; width: 50px; height: 50px; border-radius: 14px; background: var(--tint); color: var(--red); }
.tlarc-results__txt { flex: 1; min-width: 0; }
.tlarc-page .tlarc-results__txt h2 { font-size: 20px; line-height: 1.3; font-weight: 750; overflow-wrap: anywhere; }
.tlarc-results__txt p { margin-top: 2px; color: var(--muted); font-size: 14px; }
.tlarc-results__sort { flex: none; padding: 9px 14px; border: 1px solid var(--line); border-radius: 10px; background: #fff; color: var(--muted); font-size: 14px; white-space: nowrap; }
.tlarc-results__sort b { color: var(--ink); font-weight: 600; }

.tlarc-item { position: relative; display: grid; grid-template-columns: 214px minmax(0, 1fr) 36px; gap: 20px; align-items: center; padding: 16px 20px; border-top: 1px solid var(--line); }
.tlarc-list > .tlarc-item:first-child { border-top: 0; }
.tlarc-item:hover { background: #fffafb; }
.tlarc-item__thumb { display: block; width: 214px; aspect-ratio: 2 / 1; border-radius: 10px; overflow: hidden; background: linear-gradient(135deg, #f3f4f7, #e6e8ee); }
.tlarc-item__thumb img { width: 100%; height: 100%; object-fit: cover; }
.tlarc-item__thumb.is-empty { position: relative; }
.tlarc-item__thumb.is-empty::after { content: ''; position: absolute; left: 50%; top: 50%; width: 34px; height: 34px; margin: -17px 0 0 -17px; border: 2px solid #c3c8d4; border-radius: 8px; }
.tlarc-item__body { min-width: 0; }
.tlarc-item__tag { display: inline-block; max-width: 100%; margin-bottom: 4px; padding: 2px 11px; border-radius: 6px; background: var(--tint); color: var(--red); font-size: 13px; font-weight: 600; line-height: 1.5; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tlarc-page .tlarc-item h3 { font-size: 20px; line-height: 1.32; font-weight: 750; overflow-wrap: anywhere; }
.tlarc-item h3 a:hover { color: var(--red); }
.tlarc-item__body p { margin-top: 5px; color: var(--muted); font-size: 15px; line-height: 1.5; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.tlarc-item__date { display: block; margin-top: 8px; color: var(--muted); font-size: 14px; font-variant-numeric: tabular-nums; }
.tlarc-item__go { display: flex; align-items: center; justify-content: center; width: 36px; height: 36px; color: var(--ink); border-radius: 50%; }
.tlarc-item__go:hover { background: var(--tint); color: var(--red); }

/* pagination */
.tlarc-pager { padding: 18px 20px 22px; border-top: 1px solid var(--line); }
.tlarc-pager ul { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; }
.tlarc-pager .page-numbers { display: inline-flex; align-items: center; justify-content: center; min-width: 42px; height: 42px; padding: 0 12px; border: 1px solid var(--line); border-radius: 10px; background: #fff; color: var(--ink); font-size: 15px; font-weight: 600; font-variant-numeric: tabular-nums; }
.tlarc-pager a.page-numbers:hover { border-color: #d7a1a9; color: var(--red); }
.tlarc-pager .page-numbers.current { background: var(--red); border-color: var(--red); color: #fff; }
.tlarc-pager .page-numbers.dots { border-color: transparent; background: transparent; min-width: 24px; padding: 0 2px; }

/* empty state */
.tlarc-empty { display: flex; flex-direction: column; align-items: flex-start; gap: 8px; padding: 34px 24px 38px; }
.tlarc-empty strong { font-size: 19px; line-height: 1.35; }
.tlarc-empty p { color: var(--muted); }
.tlarc-btn { display: inline-flex; align-items: center; min-height: 44px; margin-top: 8px; padding: 0 20px; border-radius: 10px; background: var(--red); color: #fff !important; font-weight: 700; }
.tlarc-btn:hover { background: var(--red2); }

/* sidebar */
.tlarc-side { display: flex; flex-direction: column; gap: 20px; min-width: 0; }
.tlarc-card { background: #fff; border: 1px solid var(--line); border-radius: 16px; padding: 20px 14px 14px; min-width: 0; }
.tlarc-page .tlarc-card__title { display: flex; align-items: center; gap: 12px; padding: 0 6px; font-size: 21px; line-height: 1.3; font-weight: 750; }
.tlarc-card__ico { flex: none; display: flex; align-items: center; justify-content: center; width: 40px; height: 40px; border-radius: 12px; background: var(--tint); color: var(--red); }
.tlarc-card__ico.is-fire { background: transparent; color: #e0481b; }

.tlarc-tree__list { position: relative; max-height: 470px; margin-top: 14px; overflow-y: auto; overscroll-behavior: contain; scrollbar-width: thin; scrollbar-color: #d5d9e2 transparent; padding-right: 2px; }
.tlarc-tree__list::-webkit-scrollbar { width: 6px; }
.tlarc-tree__list::-webkit-scrollbar-thumb { background: #d5d9e2; border-radius: 6px; }
.tlarc-tree__item { position: relative; }
.tlarc-tree__item > .tlarc-tree__caret, .tlarc-tree__item > .tlarc-tree__row { }
.tlarc-tree__item:not(.has-kids) { display: flex; align-items: stretch; }
.tlarc-tree__item details > summary { display: flex; align-items: stretch; list-style: none; cursor: default; }
.tlarc-tree__item details > summary::-webkit-details-marker { display: none; }
.tlarc-tree__item details > summary::marker { content: ''; }
.tlarc-tree__caret { flex: none; position: relative; width: 28px; cursor: pointer; border-radius: 8px 0 0 8px; }
.tlarc-tree__caret::before { content: ''; position: absolute; left: 10px; top: 50%; width: 7px; height: 7px; margin-top: -4px; border-top: 1.8px solid #667085; border-right: 1.8px solid #667085; transform: rotate(45deg); transition: transform .15s ease; }
.tlarc-tree__caret.is-blank { cursor: default; }
.tlarc-tree__caret.is-blank::before { display: none; }
.tlarc-tree__item details[open] > summary > .tlarc-tree__caret::before { transform: rotate(135deg); margin-top: -6px; }
.tlarc-tree__item details > summary:hover > .tlarc-tree__caret { background: #f5f6f9; }
.tlarc-tree__row { flex: 1; min-width: 0; display: flex; align-items: center; gap: 10px; min-height: 42px; padding: 0 12px 0 4px; border-radius: 0 8px 8px 0; border-left: 3px solid transparent; color: var(--ink); font-size: 15.5px; line-height: 1.3; }
.tlarc-tree__row:hover { background: #f8f9fb; color: var(--red); }
.tlarc-tree__name { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tlarc-tree__n { flex: none; min-width: 42px; padding: 3px 10px; border-radius: 999px; background: #f2f4f7; color: var(--ink); font-size: 14px; font-weight: 600; text-align: center; font-variant-numeric: tabular-nums; }
.tlarc-tree__row.is-current { background: var(--tint); border-left-color: var(--red); color: var(--red); font-weight: 650; }
.tlarc-tree__row.is-current .tlarc-tree__n { background: #fff; color: var(--red); }
.tlarc-tree__sub { margin: 0 0 4px 28px; padding-left: 8px; border-left: 1px solid var(--line); }
.tlarc-tree__sub .tlarc-tree__row { min-height: 38px; font-size: 14.5px; }

.tlarc-feat__head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 6px 10px; }
.tlarc-page .tlarc-feat .tlarc-card__title { flex: 0 1 auto; min-width: 0; gap: 8px; font-size: 19px; white-space: nowrap; }
.tlarc-feat .tlarc-card__ico { width: 30px; height: 30px; }
.tlarc-feat__all { flex: none; margin-left: auto; white-space: nowrap; color: var(--red); font-size: 14px; font-weight: 600; padding-right: 6px; }
.tlarc-feat__all:hover { text-decoration: underline; }
.tlarc-feat__list { margin-top: 12px; }
.tlarc-feat__list li { display: flex; gap: 12px; align-items: flex-start; padding: 12px 6px; border-top: 1px solid var(--line); }
.tlarc-feat__list li:first-child { border-top: 0; }
.tlarc-feat__thumb { flex: none; width: 84px; height: 64px; border-radius: 8px; overflow: hidden; background: linear-gradient(135deg, #f3f4f7, #e6e8ee); }
.tlarc-feat__thumb img { width: 100%; height: 100%; object-fit: cover; }
.tlarc-feat__list li > div { min-width: 0; }
.tlarc-feat__name { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; font-size: 15px; font-weight: 650; line-height: 1.4; overflow-wrap: anywhere; }
.tlarc-feat__name:hover { color: var(--red); }
.tlarc-feat__list time { display: block; margin-top: 4px; color: var(--muted); font-size: 13.5px; font-variant-numeric: tabular-nums; }

/* tablet / phone */
@media (max-width: 1100px) {
	.tlarc-grid { grid-template-columns: minmax(0, 1fr) 300px; gap: 18px; }
	.tlarc-item { grid-template-columns: 180px minmax(0, 1fr) 32px; gap: 16px; }
	.tlarc-item__thumb { width: 180px; }
	.tlarc-page .tlarc-title { font-size: 32px; }
}
@media (min-width: 1024px) and (max-width: 1100px) { /* narrow sidebar (300px): keep "Bài viết nổi bật" + "Xem tất cả →" on one row */
	.tlarc-page .tlarc-feat .tlarc-card__title { gap: 6px; padding: 0 2px; font-size: 17px; }
	.tlarc-feat .tlarc-card__ico { width: 26px; height: 26px; }
	.tlarc-feat__all { font-size: 13px; padding-right: 2px; }
}
@media (max-width: 1023px) {
	.tlarc-grid { grid-template-columns: minmax(0, 1fr); }
	.tlarc-tree__list { max-height: 360px; }
}
@media (max-width: 700px) {
	.tlarc-wrap { padding: 14px 14px 56px; }
	.tlarc-head { gap: 14px; padding: 16px 16px 6px; }
	.tlarc-head__ico { width: 56px; height: 56px; border-radius: 14px; }
	.tlarc-page .tlarc-title { font-size: 26px; }
	.tlarc-desc { font-size: 15px; }
	.tlarc-search { padding: 12px 16px 0; }
	.tlarc-page .tlarc-search input[type="search"] { height: 48px; font-size: 15px; padding: 0 12px; }
	.tlarc-page .tlarc-search button { height: 48px; padding: 0 16px; }
	.tlarc-page .tlarc-search button span { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
	.tlarc-filter { padding: 14px 16px 16px; gap: 8px; overflow-x: auto; flex-wrap: nowrap; scrollbar-width: none; }
	.tlarc-filter::-webkit-scrollbar { display: none; }
	.tlarc-filter > * { flex: none; }
	.tlarc-chip { min-height: 38px; padding: 0 16px; font-size: 14px; }
	.tlarc-results__head { flex-wrap: wrap; padding: 14px 16px; gap: 10px 12px; }
	.tlarc-results__ico { width: 42px; height: 42px; }
	.tlarc-page .tlarc-results__txt h2 { font-size: 17px; }
	.tlarc-results__txt { flex: 1 1 200px; }
	.tlarc-results__sort { margin-left: 54px; padding: 6px 12px; font-size: 13px; }
	.tlarc-item { grid-template-columns: 112px minmax(0, 1fr); gap: 12px; padding: 14px 16px; align-items: flex-start; }
	.tlarc-item__thumb { width: 112px; border-radius: 8px; }
	.tlarc-item__go { display: none; }
	.tlarc-page .tlarc-item h3 { font-size: 16.5px; }
	.tlarc-item__body p { font-size: 14px; -webkit-line-clamp: 2; }
	.tlarc-item__tag { font-size: 12px; padding: 1px 9px; }
	.tlarc-pager { padding: 16px 12px 20px; }
	.tlarc-pager .page-numbers { min-width: 38px; height: 38px; padding: 0 8px; }
	.tlarc-card { padding: 16px 10px 10px; }
	.tlarc-page .tlarc-card__title { font-size: 19px; }
}
@media (prefers-reduced-motion: reduce) {
	.tlarc-tree__caret::before { transition: none; }
}
