/* Shared states and helpers for the static prototype. Artboards use inline styles, so
   state rules that must win use !important. */
:root { --accent-red: #e23a4e; --focus: #1e6fd9; }
[hidden] { display: none !important; }
.mbar, .toast, .to-top, .site-search { font-family: "Be Vietnam Pro", system-ui, sans-serif; }
header:not(.m5h) > div:first-child a { display: inline-flex; align-items: center; min-height: 32px; }
html.ready { scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) { html.ready { scroll-behavior: auto; } *, *::before, *::after { animation: none !important; transition: none !important; } }

.skip { position: absolute; left: -9999px; top: 8px; z-index: 100; background: #ffffff; color: #0b3d91; padding: 10px 14px; border-radius: 6px; font-weight: 700; }
.skip:focus { left: 16px; }
.visually-hidden { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
main:focus, h1:focus { outline: none; }

:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; }
header:not(.m5h) > div:first-child :focus-visible, footer :focus-visible, [style*="#0b2a5b"] :focus-visible, .hero-img :focus-visible { outline-color: #9cc3ff; }

/* section eyebrow with a short red rule from the logo */
.eyebrow { font-size: 14px; font-weight: 700; letter-spacing: 1.5px; text-transform: uppercase; color: #1e5bc6; }
.eyebrow::before { content: ""; display: block; width: 48px; height: 4px; background: var(--accent-red); margin-bottom: 12px; }
.eyebrow-dark { color: #b9d3ff; }

/* links and targets */
nav[aria-label="Vị trí trang"] a { text-decoration: underline; text-underline-offset: 2px; display: inline-flex; align-items: center; min-height: 24px; }
header a[aria-label]:has(svg), footer a[aria-label]:has(svg) { min-width: 44px; min-height: 44px; display: inline-flex !important; align-items: center; justify-content: center; }
a.more { display: inline-flex; align-items: center; min-height: 44px; }
.nav-main a[aria-current="page"] { font-weight: 700 !important; }

/* cards */
.card { transition: border-color .15s, transform .15s, box-shadow .15s; }
a.card:hover, article.card:hover { border-color: #0b3d91 !important; transform: translateY(-2px); }

/* chips and tabs: inline styles are swapped by ix.js; these add hover/active */
.chip:hover { border-color: #0b3d91 !important; }
.chip:active { transform: scale(.97); }
.chip[aria-disabled="true"] { opacity: .5; }
.tab:hover { color: #0b3d91 !important; background: #e8f0fc !important; }
.js [role="tabpanel"][hidden] { display: none !important; }
[role="tabpanel"] { scroll-margin-top: 16px; }
@media (prefers-reduced-motion: no-preference) { .js [role="tabpanel"]:not([hidden]) { animation: fade .15s ease-out; } }
@keyframes fade { from { opacity: 0; } }

/* badges */
.new-badge { display: inline-block; font-size: 12px; font-weight: 800; letter-spacing: .5px; text-transform: uppercase; color: #ffffff; background: #b3132b; padding: 2px 8px; border-radius: 999px; }
.deadline-badge { display: inline-block; margin-top: 4px; font-size: 13px; font-weight: 700; padding: 3px 9px; border-radius: 999px; white-space: nowrap; }
.deadline-badge.soon { color: #8a5a00; background: #fff4d6; }
.deadline-badge.today { color: #ffffff; background: #b3261e; }
.deadline-badge.later { color: #0b3d91; background: #e8f0fc; }
.deadline-badge.past { color: #45556e; background: #eef1f6; }
.item.expired { opacity: .55; }
mark { background: #fff1a8; color: inherit; padding: 0 1px; border-radius: 2px; }

/* search, counts, empty state */
.js-search:focus { border-color: #0b3d91 !important; }
.empty { margin: 16px 0 0; padding: 20px; border: 1px dashed #8fa3c2; border-radius: 12px; color: #2a3a55; font-size: 16px; }
.empty button { margin-top: 10px; min-height: 44px; padding: 0 16px; border: 1px solid #0b3d91; border-radius: 8px; background: #ffffff; color: #0b3d91; font: inherit; font-weight: 700; cursor: pointer; }

/* forms */
.field-err { margin: -4px 0 4px; font-size: 14px; color: #b3261e; }
[aria-invalid="true"] { border-color: #b3261e !important; box-shadow: 0 0 0 1px #b3261e; }
footer .field-err { color: #ffb4ab; }
.form-ok { padding: 18px; border-radius: 10px; background: #e7f6ec; color: #0f5132; font-size: 16px; line-height: 1.5; }
footer .form-ok { background: #13305f; color: #ffffff; }

/* toast, back to top, sticky mobile bar */
.toast { position: fixed; left: 50%; bottom: calc(24px + env(safe-area-inset-bottom, 0px)); transform: translateX(-50%); z-index: 60; background: #0b2a5b; color: #ffffff; padding: 12px 18px; border-radius: 8px; font-weight: 600; box-shadow: 0 6px 24px rgba(8, 27, 61, .25); }
.to-top { position: fixed; right: calc(16px + env(safe-area-inset-right, 0px)); bottom: calc(24px + env(safe-area-inset-bottom, 0px)); z-index: 50; width: 48px; height: 48px; border: 0; border-radius: 50%; background: #0b3d91; color: #ffffff; display: inline-flex; align-items: center; justify-content: center; cursor: pointer; box-shadow: 0 4px 16px rgba(8, 27, 61, .25); }
.mbar { display: none; }
footer nav a, footer form + * a, footer > div > div > a { display: inline-flex; align-items: center; min-height: 32px; }
@media (pointer: coarse) { .site-search .hint { display: none; } }
#site-r a > span:first-child, #site-r a { overflow-wrap: anywhere; }
.sr-title { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
img[loading="lazy"] { background: #e8eef7; }
main p a:not([class]), main li > a:not([class]):not([style*="display"]) { text-decoration: underline; text-underline-offset: 2px; }
@media (forced-colors: active) { .tab[aria-selected="true"], .chip[aria-pressed="true"] { outline: 3px solid CanvasText; outline-offset: -3px; } }
.search-btn-m { display: none !important; }
.stack-table td { align-items: center; }
@media (max-width: 760px) {
  .mbar { display: flex; position: fixed; left: 0; right: 0; bottom: 0; z-index: 55; gap: 8px; padding: 10px max(12px, env(safe-area-inset-right, 0px)) calc(10px + env(safe-area-inset-bottom, 0px)) max(12px, env(safe-area-inset-left, 0px)); background: #ffffff; border-top: 1px solid #d9e2ef; box-shadow: 0 -4px 16px rgba(8, 27, 61, .08); }
  .mbar[hidden] { display: none; }
  .mbar a { flex: 1 1 0; display: inline-flex; align-items: center; justify-content: center; min-height: 44px; border-radius: 8px; font-weight: 700; font-size: 15px; text-decoration: none; }
  .mbar a:first-child { background: #0b3d91; color: #ffffff; }
  .mbar a + a { border: 2px solid #0b3d91; color: #0b3d91; }
  body.has-mbar { padding-bottom: 72px; }
  header { position: sticky; top: 0; z-index: 45; transition: transform .2s ease; }
  header.hdr-hide { transform: translateY(-100%); }
  body.has-mbar .to-top { display: none !important; }
  .search-btn-m { display: inline-flex !important; }
  .to-top { bottom: calc(84px + env(safe-area-inset-bottom, 0px)); }
  /* topic table becomes cards */
  .stack-table { min-width: 0 !important; }
  .stack-table thead { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
  .stack-table tr { display: block; padding: 14px 16px; }
  .stack-table td { display: flex; gap: 10px; padding: 4px 0 !important; }
  .stack-table td { min-width: 0; overflow-wrap: anywhere; }
  .stack-table td::before { content: attr(data-label); flex: 0 0 96px; font-size: 13px; font-weight: 700; color: #5a6880; }
}
@media (max-width: 480px) {
  header:not(.m5h) > div:first-child a[aria-label]:has(svg) { display: none !important; }
}
@media (max-width: 400px) {
  header:not(.m5h) > div:nth-child(2) > a > span { border-left: 0 !important; padding-left: 0 !important; }
  header:not(.m5h) > div:nth-child(2) > a > span > span { display: none !important; }
  header:not(.m5h) > div:nth-child(2) > a > span > .wordmark-short { display: inline !important; white-space: nowrap; }
  header:not(.m5h) > div:nth-child(2) > a > span { flex-shrink: 0; }
  header:not(.m5h) > div:nth-child(2) > a img { height: 34px !important; }
}
@media (max-width: 600px) {
  .area-grid > a:nth-child(n+5) { display: none !important; }
  .notice-list > li:nth-child(n+4) { display: none !important; }
  .face-strip { display: flex !important; overflow-x: auto; scroll-snap-type: x mandatory; gap: 14px !important; padding-bottom: 8px; margin-left: -16px; margin-right: -16px; padding-left: 16px; padding-right: 16px; scrollbar-width: thin; }
  .face-strip > a { flex: 0 0 104px; scroll-snap-align: start; }
}
img[width][height] { height: auto; }
/* French labels are longer: keep the nav on one row beside the logo */
@media (min-width: 961px) {
  html[lang="fr"] header:not(.m5h) > div:nth-child(2) { flex-wrap: nowrap !important; gap: 14px !important; }
  html[lang="fr"] .nav-main { flex-wrap: nowrap !important; gap: 0 !important; }
  html[lang="fr"] .nav-main > a { padding: 0 7px !important; font-size: 15px !important; white-space: nowrap; }
  html[lang="fr"] .nav-main > a[data-cta] { margin-left: 6px !important; padding: 0 14px !important; }
}
@media (min-width: 961px) and (max-width: 1099px) { html[lang="fr"] .nav-main > a { padding: 0 5px !important; font-size: 14px !important; } }
#tong-quan, #cong-bo, #de-tai-sach, #overview, #publications, #projects { scroll-margin-top: 64px; }
.profile-jump a:hover { background: #eef3fb; border-radius: 6px; }
#pubs-p li, #projects li, #de-tai-sach li { overflow-wrap: anywhere; }
@media (max-width: 760px) { .tabs.profile-jump { flex-wrap: wrap !important; overflow: visible !important; gap: 0 !important; } .profile-jump a { min-height: 44px !important; padding: 0 10px !important; font-size: 15px !important; } }
.more-btn { display: flex; margin: 24px auto 0; min-height: 48px; padding: 0 28px; align-items: center; border: 2px solid #0b3d91; border-radius: 8px; background: #ffffff; color: #0b3d91; font: inherit; font-size: 16px; font-weight: 700; cursor: pointer; }
.more-btn[hidden] { display: none !important; }
#people a[href^="ho-so-"] { align-items: flex-start !important; }
/* all widths: header stays reachable, slides away on scroll-down, returns on scroll-up */
header { position: sticky; top: 0; z-index: 45; transition: transform .2s ease; }
header.hdr-hide { transform: translateY(-100%); }
@media (prefers-reduced-motion: reduce) { header { transition: none; } }
.js-q[aria-pressed="true"] { background: #0b3d91 !important; color: #ffffff !important; border-color: #0b3d91 !important; }
@media (max-width: 760px) { html { scroll-padding-bottom: 88px; } .stack-table td > * { grid-column: 2; } .stack-table td { align-items: baseline !important; } }
[role="tabpanel"]:focus:not(:focus-visible), main:focus:not(:focus-visible) { outline: none; }
@media (min-width: 761px) { footer > div:first-child { padding-right: 96px !important; } }
@media (max-width: 600px) { .hero-more { display: none; } .hero-img a[style*="min-height"] { justify-content: center; text-align: center; } }
@media (max-width: 760px) { .nav-main.open > a[data-cta] { margin-left: 0 !important; justify-content: center; } }
/* laptops 761–1279: one-row utility bar, nav beside the logo */
@media (min-width: 761px) and (max-width: 1279px) {
  .util-crumb { display: none !important; }
  header:not(.m5h) > div:first-child > div { justify-content: flex-end !important; }
}
/* small tablets 761–960: hamburger menu, like phones */
@media (min-width: 761px) and (max-width: 960px) {
  .menu-btn { display: inline-flex !important; }
  .search-btn-m { display: inline-flex !important; }
  .nav-main { display: none !important; }
  .nav-main.open { display: flex !important; flex-direction: column; align-items: stretch !important; order: 9; flex: 0 0 100% !important; max-height: calc(100vh - 140px); overflow-y: auto; }
  .nav-main .search-btn { display: none !important; }
  .nav-main.open > a[data-cta] { margin-left: 0 !important; justify-content: center; }
  header:not(.m5h) > div:nth-child(2) { gap: 12px !important; }
  header:not(.m5h) > div:nth-child(2) > a { margin-right: auto; }
  header { z-index: 45; }
}
@media (min-width: 961px) and (max-width: 1279px) {
  header:not(.m5h) > div:nth-child(2) { flex-wrap: nowrap !important; gap: 16px !important; padding-left: 24px !important; padding-right: 24px !important; }
  header:not(.m5h) > div:nth-child(2) > a > span { display: none !important; }
  .nav-main { flex-wrap: nowrap !important; gap: 0 !important; }
  .nav-main > a { padding: 0 8px !important; font-size: 15px !important; white-space: nowrap; }
  .nav-main > a[data-cta] { margin-left: 6px !important; padding: 0 14px !important; }
}
@media (min-width: 1280px) { .util-crumb { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; min-width: 0; } }
.nav-main .m-util a { display: inline-flex; align-items: center; min-height: 44px; padding: 0 4px; }
.menu-backdrop { position: fixed; inset: 0; z-index: 30; background: rgba(4, 14, 33, .68); }
header:has(.nav-main.open) { box-shadow: 0 14px 28px rgba(4, 14, 33, .35); }
@media (max-width: 400px) {
  header:not(.m5h) > div:first-child { display: none !important; }
  header:not(.m5h) > div:nth-child(2) { gap: 8px !important; flex-wrap: nowrap !important; }
  header:not(.m5h) > div:nth-child(2) > a { min-width: 0; flex: 1 1 auto; gap: 8px !important; }
  header:not(.m5h) > div:nth-child(2) > a > span { min-width: 0; flex-shrink: 1 !important; overflow: hidden; }
  header:not(.m5h) > div:nth-child(2) > a > span > .wordmark-short { overflow: hidden; text-overflow: ellipsis; }
  .nav-main .m-util { display: flex !important; }
  header:not(.m5h) > div:nth-child(2):has(.nav-main.open) { flex-wrap: wrap !important; }
  .nav-main.open { order: 9; flex: 0 0 100% !important; }
}
@media (max-width: 360px) {
  .tabs { gap: 0 !important; padding-left: 12px !important; padding-right: 12px !important; }
  .tabs .tab { padding: 0 7px !important; font-size: 14px !important; }
}


@media (max-width: 760px) {
  .mbar a { white-space: nowrap; text-align: center; padding: 0 8px; }
  .nav-main .search-btn { display: none !important; }
  .nav-main.open { max-height: calc(100vh - 140px); overflow-y: auto; }
  .stack-table td { display: grid !important; grid-template-columns: 92px minmax(0, 1fr); align-items: start !important; justify-items: start; text-align: left; gap: 8px; }
  .tabs { flex-wrap: nowrap !important; overflow-x: auto; padding-left: 16px !important; padding-right: 16px !important; scrollbar-width: none; }
  .tabs .tab { flex: 0 0 auto; padding: 0 10px !important; min-height: 48px !important; font-size: 15px !important; }
}
/* full text of archived posts */
.post-body p{margin:0 0 14px}.post-body h2,.post-body h3,.post-body h4{margin:22px 0 10px;color:#0b2a5b;line-height:1.35}
.post-body img{max-width:100%;height:auto;border-radius:6px;margin:8px 0}
.post-body table{border-collapse:collapse;font-size:15px;line-height:1.45;margin:10px 0 18px;min-width:100%}
.post-body td,.post-body th{border:1px solid #c9d6ea;padding:6px 8px;vertical-align:top}
.post-body tr:first-child td{background:#f2f6fc;font-weight:600}
.post-body ul,.post-body ol{padding-left:22px;margin:0 0 14px}
.post-body a{text-decoration:underline;text-underline-offset:2px}
