/* ==========================================================================
   reset.css — Chuẩn hoá mặc định trình duyệt
   NEWTRANSPORT LOGISTICS
   ========================================================================== */

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

html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
  scroll-behavior: smooth;
  /* Bù chiều cao header sticky khi nhảy tới anchor */
  scroll-padding-top: var(--nt-header-offset, 96px);
}

body {
  margin: 0;
  min-height: 100%;
  font-family: var(--nt-font-body);
  font-size: var(--nt-fs-base);
  line-height: var(--nt-lh-normal);
  color: var(--nt-ink-700);
  background-color: var(--nt-bg);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
  /* KHÔNG đặt overflow-x: hidden ở đây.
     Nó che lỗi tràn ngang thật và có thể phá `position: sticky` của header.
     Tràn ngang được xử lý tại gốc trong components.css / responsive.css. */
}

h1,
h2,
h3,
h4,
h5,
h6,
p,
figure,
blockquote,
dl,
dd {
  margin: 0;
}

h1,
h2,
h3,
h4,
h5,
h6 {
  font-family: var(--nt-font-heading);
  font-weight: 700;
  line-height: var(--nt-lh-tight);
  color: var(--nt-ink-900);
  text-wrap: balance;
}

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

a {
  color: inherit;
  text-decoration: none;
}

img,
svg,
video {
  display: block;
  max-width: 100%;
}

/* --------------------------------------------------------------------------
   <picture> PHẢI là `display: contents`
   --------------------------------------------------------------------------
   Nếu để <picture> thành một box (block/inline) thì nó chen vào giữa khung
   chứa và <img>, làm đứt chuỗi tính `height: 100%`:
     .nt-hero__figure (aspect-ratio 4/3, cao 398px)
       └ picture  -> cao 285px (tự suy ra từ tỉ lệ ảnh)
           └ img    -> cao 285px  ==> hụt 113px ở đáy khung
   và ở chiều ngược lại, ảnh vuông (about.jpg) lại CAO HƠN khung -> bị cắt.

   `display: contents` loại <picture> khỏi cây hộp, <img> trở thành con trực
   tiếp của khung chứa => `width/height: 100%` + `object-fit: cover` chạy đúng.
   <picture> không có ý nghĩa với trình đọc màn hình nên không ảnh hưởng a11y.
   -------------------------------------------------------------------------- */
picture {
  display: contents;
}

img {
  height: auto;
  border-style: none;
}

input,
button,
textarea,
select {
  font: inherit;
  color: inherit;
}

button {
  cursor: pointer;
  background: none;
  border: 0;
  padding: 0;
}

textarea {
  resize: vertical;
}

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

/* Loại bỏ delay 300ms khi tap trên mobile */
a,
button,
input,
select,
textarea,
label {
  touch-action: manipulation;
}

/* Ẩn khỏi màn hình nhưng vẫn cho screen reader đọc */
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

/* Tôn trọng cài đặt giảm chuyển động của người dùng */
@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  *,
  *::before,
  *::after {
    animation-duration: 0.01ms;
    animation-iteration-count: 1;
    transition-duration: 0.01ms;
  }
}
