﻿/* =========================================================================
   NgoiSaoXanh — base: reset, typography mặc định, a11y
   Nạp sau tokens.css. KHÔNG nạp chung với style.css cũ / bootstrap.
   ========================================================================= */
/* Font chữ toàn site: SVN-Avo tự host ở Contents/Styles/font/ (một họ, 2 độ đậm: 400 = SVN-Avo, 700 = SVN-Avo-bold, kèm bản nghiêng).
   Các độ đậm trung gian 500/600 trong token sẽ hiển thị bằng file gần nhất (500 → thường, 600 → đậm). */
@font-face { font-family: "SVN-Avo"; src: url("../font/UTM-Avo.ttf") format("truetype"); font-weight: 400; font-style: normal; font-display: swap; }
@font-face { font-family: "SVN-Avo"; src: url("../font/UTM-Avo.ttf") format("truetype"); font-weight: 400; font-style: italic; font-display: swap; }
@font-face { font-family: "SVN-Avo"; src: url("../font/UTM-AvoBold.ttf") format("truetype"); font-weight: 700; font-style: normal; font-display: swap; }
@font-face { font-family: "SVN-Avo"; src: url("../font/UTM-AvoBold.ttf") format("truetype"); font-weight: 700; font-style: italic; font-display: swap; }
/* Roboto (Contents/Styles/font/Roboto-*.ttf) cho chữ nhỏ hơn 1rem mà in đậm — biến --font-sm-bold.
   600–900 dùng chung file Bold; trình duyệt chỉ tải file nào thực sự được dùng. */
@font-face { font-family: "Roboto"; src: url("../font/Roboto-Regular.ttf") format("truetype"); font-weight: 400; font-style: normal; font-display: swap; }
@font-face { font-family: "Roboto"; src: url("../font/Roboto-Medium.ttf") format("truetype"); font-weight: 500; font-style: normal; font-display: swap; }
@font-face { font-family: "Roboto"; src: url("../font/Roboto-Bold.ttf") format("truetype"); font-weight: 600 900; font-style: normal; font-display: swap; }
@font-face { font-family: "Roboto"; src: url("../font/Roboto-BoldItalic.ttf") format("truetype"); font-weight: 600 900; font-style: italic; font-display: swap; }

*, *::before, *::after { box-sizing: border-box; }

html {
    -webkit-text-size-adjust: 100%;
    text-size-adjust: 100%;
    scroll-behavior: smooth;
    scroll-padding-top: calc(var(--header-h) + var(--sp-4));
}

body {
    margin: 0;
    min-height: 100vh;
    /* background-color: var(--bg-0); */
    color: var(--text-2);
    font-family: var(--font);
    font-size: var(--fs-base);
    font-weight: var(--fw-regular);
    line-height: var(--lh-base);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    text-rendering: optimizeLegibility;
}

h1, h2, h3, h4, h5, h6 {
    margin: 0 0 var(--sp-4);
    color: var(--text);
    font-weight: var(--fw-bold);
    line-height: var(--lh-heading);
    letter-spacing: var(--tracking-tight);
    text-wrap: balance;
}
h1 { font-size: var(--fs-h1); }
h2 { font-size: var(--fs-h2); }
h3 { font-size: var(--fs-h3); }
h4 { font-size: var(--fs-h4); }
h5, h6 { font-size: var(--fs-base); }

p { margin: 0 0 var(--sp-4); text-wrap: pretty; }
p:last-child { margin-bottom: 0; }

a {
    color: inherit;
    text-decoration: none;
    transition: color var(--dur-fast) var(--ease);
}
a:hover { color: var(--accent); }

strong, b { font-weight: var(--fw-semibold); color: var(--text); }
small { font-size: var(--fs-sm); }

ul, ol { margin: 0; padding: 0; }
ul[class], ol[class] { list-style: none; }

img, picture, video, svg, iframe { display: block; max-width: 100%; }
img, video { height: auto; }
img { border: 0; }

hr {
    margin: var(--sp-8) 0;
    border: 0;
    border-top: 1px solid var(--border);
}

table { border-collapse: collapse; width: 100%; }

button, input, select, textarea {
    font: inherit;
    color: inherit;
    letter-spacing: inherit;
}
button { cursor: pointer; background: none; border: 0; padding: 0; }
button:disabled { cursor: not-allowed; }

::selection { background: var(--accent); color: var(--accent-ink); }

/* ---- Focus: chỉ hiện khi dùng bàn phím ---- */
:focus { outline: none; }
:focus-visible {
    outline: 2px solid var(--accent);
    outline-offset: 3px;
    border-radius: var(--radius-sm);
}

/* Thuộc tính hidden phải thắng mọi class display (.flex, .cluster, .grid…): panel tab, nút trượt đang ẩn */
[hidden] { display: none !important; }

/* ---- A11y helpers ---- */
.sr-only {
    position: absolute !important;
    width: 1px; height: 1px;
    padding: 0; margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}
.skip-link {
    position: absolute;
    top: var(--sp-2); left: var(--sp-2);
    z-index: var(--z-toast);
    padding: var(--sp-2) var(--sp-4);
    background: var(--accent);
    color: var(--accent-ink);
    font-weight: var(--fw-semibold);
    border-radius: var(--radius);
    transform: translateY(-200%);
    transition: transform var(--dur-fast) var(--ease);
}
.skip-link:focus { transform: none; color: var(--accent-ink); }
main:focus, main:focus-visible { outline: none; }  /* <main tabindex="-1"> nhận focus từ skip-link */

/* Honeypot chống bot trong form (không dùng display:none để bot vẫn điền) */
.hp-field { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }

/* ---- Giảm chuyển động ---- */
@media (prefers-reduced-motion: reduce) {
    html { scroll-behavior: auto; }
    *, *::before, *::after {
        animation-duration: .01ms !important;
        animation-iteration-count: 1 !important;
    }
    /* Trừ Swiper: tốc độ chuyển slide do JS đặt inline (tham số speed), !important ở đây sẽ đè mất. */
    *:not(.swiper-wrapper):not(.swiper-slide), *::before, *::after {
        transition-duration: .01ms !important;
    }
}
