/* =========================================================
   S-RIDE – Nền tảng: reset, chữ, bố cục khung trang
   ========================================================= */
*, *::before, *::after { box-sizing: border-box; }

html {
  font-size: 17px;               /* điện thoại */
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
  scroll-behavior: smooth;
  scroll-padding-top: calc(var(--header-h) + 12px);
}
@media (min-width: 768px) { html { font-size: 18px; } }   /* máy tính bảng, máy tính */

/* Chế độ giáo viên / trình chiếu: chữ to thêm 25% */
html.trinh-chieu { font-size: 21.25px; }
@media (min-width: 768px) { html.trinh-chieu { font-size: 22.5px; } }
html.trinh-chieu .phu { display: none !important; }

body {
  margin: 0;
  min-height: 100vh;
  font-family: var(--font);
  font-size: var(--fs-body);
  line-height: var(--lh-body);
  color: var(--ink);
  background-color: var(--sky-50);
  overflow-x: hidden;
  font-synthesis: none;
  text-rendering: optimizeLegibility;
}

/* Họa tiết nền mờ: đồi, mây, đường uốn lượn (SVG trong index.html) */
.nen-hoa-tiet {
  position: fixed; inset: 0; z-index: -1; pointer-events: none;
  background: linear-gradient(180deg, #E6F6FF 0%, var(--sky-50) 45%, #F3FAF4 100%);
}
.nen-hoa-tiet svg { position: absolute; left: 0; bottom: 0; width: 100%; height: 55vh; opacity: .55; }
.nen-hoa-tiet .may { position: absolute; width: 180px; opacity: .7; }

img { max-width: 100%; display: block; }
button, input, select, textarea { font: inherit; color: inherit; }
a { color: var(--sky-800); text-underline-offset: 3px; }
a:hover { color: var(--sky-700); }

h1, h2, h3, h4 { line-height: var(--lh-head); margin: 0 0 .5em; color: var(--sky-800); font-weight: 800; }
h1 { font-size: var(--fs-h1); }
h2 { font-size: var(--fs-h2); }
h3 { font-size: var(--fs-h3); }
p { margin: 0 0 1em; }
strong, b { font-weight: 700; }
small { font-size: var(--fs-small); }

/* Viền focus rõ ràng cho bàn phím: vàng 3px */
:focus { outline: none; }
:focus-visible {
  outline: 3px solid var(--helmet);
  outline-offset: 3px;
  box-shadow: 0 0 0 6px rgba(15, 42, 61, .55);
  border-radius: 8px;
}

.an-di, .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;
}
.bo-qua {
  position: absolute; left: 12px; top: -60px; z-index: 100;
  background: var(--ink); color: #fff; padding: 12px 18px; border-radius: 12px; font-weight: 700;
}
.bo-qua:focus { top: 12px; }

/* ---------- Khung trang ---------- */
.khung { width: 100%; max-width: var(--container); margin: 0 auto; padding: 0 16px; }
@media (min-width: 768px) { .khung { padding: 0 24px; } }
@media (min-width: 1600px) { :root { --container: 1440px; } }

main#app { min-height: 60vh; padding: 20px 0 calc(48px + var(--bottom-nav-h)); }
main#app:focus { outline: none; }

/* ---------- Thanh trên cùng ---------- */
.thanh-tren {
  position: sticky; top: 0; z-index: 40;
  background: rgba(255, 255, 255, .94);
  backdrop-filter: blur(8px);
  border-bottom: var(--bd) solid var(--sky-300);
  box-shadow: 0 4px 0 rgba(125, 211, 252, .35);
}
.thanh-tren .khung { display: flex; align-items: center; gap: 16px; min-height: var(--header-h); }
.logo { display: flex; align-items: center; gap: 10px; text-decoration: none; color: var(--sky-800); flex-shrink: 0; }
.logo img, .logo .anh-giu-cho { width: 48px; height: 48px; border-radius: 12px; }
/* Logo chữ S-Ride (ảnh ngang ~2:1) ở thanh trên */
.logo .logo-hinh, .logo img.logo-hinh { width: auto; height: calc(var(--header-h) - 6px); aspect-ratio: 1774 / 887; border-radius: 0; object-fit: contain; }
.logo-chu { font-weight: 800; font-size: 1.6rem; letter-spacing: .5px; line-height: 1.1; }
.logo-chu .s { color: var(--helmet); -webkit-text-stroke: 1.5px var(--sky-800); paint-order: stroke fill; text-shadow: 0 2px 0 var(--sky-800); }
.logo-phu { display: block; font-size: .72rem; font-weight: 600; color: var(--ink-2); letter-spacing: 0; }

.menu-chinh { display: none; margin-left: auto; gap: 6px; }
.menu-chinh a {
  display: inline-flex; align-items: center; min-height: 48px; padding: 8px 13px;
  border-radius: var(--r-pill); font-weight: 700; text-decoration: none; color: var(--ink);
  border: var(--bd) solid transparent; white-space: nowrap;
}
.menu-chinh a:hover { background: var(--sky-100); color: var(--sky-800); }
.menu-chinh a[aria-current="page"] {
  background: var(--sky-700); color: #fff; border-color: var(--sky-800);
  box-shadow: 0 4px 0 var(--sky-800);
}
.nut-trinh-chieu { margin-left: auto; white-space: nowrap; }
@media (max-width: 1499.98px) { .logo-phu { display: none; } }  /* menu 6 mục cần chỗ */
@media (max-width: 420px) { .nut-trinh-chieu span { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; } } /* ẩn chữ nhưng vẫn đọc được bằng trình đọc màn hình */
@media (min-width: 1024px) {
  .menu-chinh { display: flex; }
  .nut-trinh-chieu { margin-left: 8px; }
}

/* ---------- Thanh điều hướng dưới đáy (điện thoại, máy tính bảng) ---------- */
.menu-duoi {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 45;
  display: grid; grid-template-columns: repeat(5, 1fr);
  background: #fff; border-top: var(--bd) solid var(--sky-300);
  box-shadow: 0 -6px 18px rgba(7, 89, 133, .12);
  padding: 6px 4px calc(6px + env(safe-area-inset-bottom));
}
.menu-duoi a {
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px;
  min-height: 60px; padding: 4px 2px; border-radius: 14px;
  text-decoration: none; color: var(--ink-2); font-size: .74rem; font-weight: 700; line-height: 1.25;
}
.menu-duoi a img, .menu-duoi a .anh-giu-cho { width: 32px; height: 32px; border-radius: 8px; font-size: 0; }
.menu-duoi a[aria-current="page"] { background: var(--sky-100); color: var(--sky-800); box-shadow: inset 0 0 0 2px var(--sky-300); }
@media (max-width: 1023.98px) { :root { --bottom-nav-h: 78px; } }
@media (min-width: 1024px) { .menu-duoi { display: none; } }

/* ---------- Chân trang ---------- */
.chan-trang { padding: 24px 0 calc(24px + var(--bottom-nav-h)); color: var(--ink-2); font-size: var(--fs-small); border-top: 2px dashed var(--sky-300); }
.chan-trang p { margin: 0 0 .4em; }

/* ---------- Tiện ích ---------- */
.luoi { display: grid; gap: 20px; }
.hang { display: flex; flex-wrap: wrap; gap: var(--gap); align-items: center; }
.giua { text-align: center; }
.muted { color: var(--ink-2); }
.mt-0 { margin-top: 0 } .mb-0 { margin-bottom: 0 } .mt-3 { margin-top: 16px } .mt-4 { margin-top: 24px } .mt-5 { margin-top: 32px }
.tieu-de-trang { margin: 8px 0 20px; }
.tieu-de-trang h1 { margin-bottom: 6px; }
.tieu-de-trang p { color: var(--ink-2); max-width: 70ch; }

/* ---------- Giảm chuyển động ---------- */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: .001ms !important; animation-iteration-count: 1 !important;
    transition-duration: .001ms !important; scroll-behavior: auto !important;
  }
}

/* Tiêu đề nhận tiêu điểm bằng code (để trình đọc màn hình đọc) – không cần viền */
[tabindex="-1"]:focus, [tabindex="-1"]:focus-visible { outline: none; box-shadow: none; }
.luoi > * { min-width: 0; } /* không để nội dung dài đẩy cột lưới rộng quá màn hình */

/* Màn hình vừa (máy tính bảng ngang, laptop nhỏ): thu logo và menu để nút Trình chiếu không tràn */
@media (max-width: 1199px) {
  .logo .logo-hinh, .logo img.logo-hinh { height: 54px; }
  .thanh-tren .khung { gap: 10px; }
  .menu-chinh { gap: 2px; }
  .menu-chinh a { padding: 8px 9px; font-size: .95rem; }
}
