/* Chỉnh hiển thị cho điện thoại. Không đổi chữ, chỉ đổi cách bày.
   File này không nằm trong @layer nên thắng các lớp Tailwind ở chinh-sach-bao-mat.*.css. */

/* ---------- chung mọi khổ màn hình ---------- */
a, button, summary { touch-action: manipulation; -webkit-tap-highlight-color: transparent }
.btn { transition-property: color, background-color, border-color, box-shadow, transform }
/* menu điện thoại đang đóng thì ẩn hẳn khung menu */
details:not([open]) > div { display: none }
/* dòng căn giữa nằm trong khối chữ căn đều */
.chu-deu .text-center { text-align: center }
/* tên cạnh logo trên cùng: in hoa, đậm; dòng "Đặc sản phở bò" dàn đều cho bằng đúng bề ngang tên */
header .leading-tight { display: inline-block }
header .leading-tight > :first-child { font-size: 1.5rem; font-weight: 800; text-transform: uppercase; letter-spacing: .03em; margin-right: -.03em }
header .leading-tight > :last-child { margin-top: .2em; margin-right: -.2em; font-size: 13px; letter-spacing: .2em; text-align: justify; text-align-last: justify }
/* đầu trang nền kem, logo bên trái có bóng nhẹ, vạch xanh – vàng – cam ở mép dưới theo màu logo (kiểu A, người dùng chọn 04/11/2026) */
header { border-bottom-width: 0; box-shadow: 0 6px 16px -10px #1c191740 }
header::after { content: ""; position: absolute; left: 0; right: 0; bottom: 0; height: 2px; background: linear-gradient(90deg, var(--color-forest), var(--color-gold) 50%, var(--color-brand)); pointer-events: none }
header > .container-x > a:first-child > img { border-radius: .6rem; box-shadow: 0 4px 10px -4px #0c3a1f80 }

/* ---------- điện thoại và máy tính bảng dọc ---------- */
@media (max-width: 767px) {
  /* khoảng cách giữa các khối */
  .section { padding-block: 3.5rem }

  /* các nhãn nhỏ: không dưới 13px cho dễ đọc */
  main .text-xs { font-size: .8125rem }

  /* nhãn nhỏ có 2 gạch hai bên: thu gọn để không rớt dòng */
  .eyebrow { font-size: .8125rem; letter-spacing: .1em }
  .bg-cream-2 .eyebrow { color: var(--color-brand-dark) }
  .eyebrow::before, .eyebrow::after { width: 1.25rem }

  /* tiêu đề trang: nhỏ lại một chút để không vỡ 4–5 dòng */
  /* (một số h1 ghi line-height ngay trong thẻ nên cần !important) */
  main h1 { font-size: clamp(1.625rem, 7.4vw, 2.25rem); line-height: 1.22 !important }

  /* thanh "Trang chủ / ...": giữ 1 dòng, tên dài thì cắt "…" */
  nav[aria-label="Breadcrumb"] ol { flex-wrap: nowrap }
  nav[aria-label="Breadcrumb"] li:first-child { flex-shrink: 0; white-space: nowrap }
  nav[aria-label="Breadcrumb"] li:last-child { min-width: 0 }
  nav[aria-label="Breadcrumb"] [aria-current] { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap }

  /* trang chủ: khối đầu trang (cỡ chữ tiêu đề tự khít bề ngang, xem lớp hero-khit trong index.html) */
  .hero-chu > .container-x { padding-bottom: 4.5rem; gap: 2.75rem }

  /* trang chủ: thẻ thư mục (kính mờ, ảnh lọt trong khung; thêm .thu-muc để thắng style trong index.html) */
  .thu-muc-luoi { gap: 1.25rem }
  .thu-muc-luoi > .thu-muc { padding: .5rem; border-radius: 1.25rem }
  .thu-muc .thu-muc-anh { border-radius: .875rem }
  .thu-muc .thu-muc-than { padding: 1.125rem .75rem .625rem }
  .thu-muc-ten { font-size: 1.25rem }

  /* khối ảnh nền tối (Về chúng tôi): bớt khoảng trống trên đầu */
  .section.bg-ink .mt-12 { margin-top: 0 }

  /* Khóa học: 13 ý rộng chữ hơn */
  ol.chu-deu.grid > li { gap: .875rem; padding: 1.125rem 1.125rem 1.125rem 1rem }
  ol.chu-deu.grid > li > span:first-child { width: 2.25rem; height: 2.25rem; font-size: 1rem }

  /* Liên hệ, Cửa hàng: thẻ bớt đệm */
  .card.p-7 { padding: 1.375rem }

  /* chân trang gọn lại */
  footer > .container-x { gap: 2.25rem; padding-block: 3rem }
  footer .border-t .container-x { font-size: .8125rem; padding-bottom: 1.25rem }
}

/* ---------- khi có nút menu (dưới 1024px) ---------- */
@media (max-width: 1023px) {
  /* đầu trang: logo + tên bên trái, nút menu bên phải; thanh cao hơn cho logo to */
  header > .container-x { height: 4.5rem }
  header > .container-x > a:first-child { gap: .75rem; white-space: nowrap }
  header > .container-x > a:first-child > img { width: 3.25rem; height: 3.25rem }
  /* thanh có thêm dòng địa chỉ phía trên (từ 768px) thì menu xổ xuống thấp hơn tương ứng */
  @media (min-width: 768px) {
    details[open] > summary::before, details > div.fixed { top: 6.75rem !important }
  }

  /* menu mở: phủ mờ phần trang phía sau, chạm vào đó là đóng menu
     (header có backdrop-filter nên "fixed" tính theo header, phải tự cho chiều cao) */
  details[open] > summary::before {
    content: ""; position: fixed; left: 0; right: 0; top: 4.5rem; height: 100vh;
    background: #1c191759; cursor: default;
  }
  /* khung menu xổ xuống ngay dưới thanh đầu trang */
  details > div.fixed { top: 4.5rem }
}

/* ---------- riêng điện thoại (dưới 640px) ---------- */
@media (max-width: 639px) {
  /* Về chúng tôi: dòng thời gian 4 thế hệ, nới thẻ cho chữ đỡ thưa */
  ol.chu-deu:not(.grid) { margin-top: 0 }
  ol.chu-deu:not(.grid) > li { padding-left: 3.25rem; margin-bottom: 2rem }
  ol.chu-deu:not(.grid) > li > span.absolute { width: 2.5rem; height: 2.5rem; font-size: 1rem }
  ol.chu-deu:not(.grid) > div.absolute { left: 1.25rem }
  ol.chu-deu:not(.grid) .card { padding: 1.25rem }
}

/* ---------- điện thoại rất hẹp (dưới 360px) ---------- */
@media (max-width: 359px) {
  /* trang chủ: nút dưới mỗi thẻ ("Xem thông tin liên lạc"…) bớt đệm cho vừa 1 dòng */
  .thu-muc .thu-muc-xem { padding-inline: 1rem; gap: .375rem }
}

/* ---------- điện thoại khổ hẹp (dưới 480px) ---------- */
@media (max-width: 479px) {
  /* trang chủ: dòng chữ nhỏ dưới tiêu đề tách 2 dòng, dòng trên dàn đều, dòng dưới căn giữa có gạch vàng 2 bên (khách yêu cầu căn giữa 07/11/2026) */
  /* (thêm .hero-khit để thắng phần style viết trong index.html, nạp sau file này) */
  .hero-khit .hero-phu-de { margin-right: -.15em; font-size: min(calc(100cqi / 19.8), 1.25rem); letter-spacing: .15em; white-space: normal; text-align: center; text-align-last: auto }
  .hero-khit .hero-phu-de > span { display: block }
  .hero-khit .hero-phu-de > span:first-child { text-align: justify; text-align-last: justify }
  .hero-khit .hero-phu-de > span:last-child { display: flex; align-items: center; gap: .7em }
  .hero-khit .hero-phu-de > span:last-child::before { content: ""; flex: 1; height: 1px; background: linear-gradient(90deg, #f5d68a80, #f5d68a) }
  /* bù khoảng giãn chữ sau chữ cuối cho 2 gạch dài bằng nhau */
  .hero-khit .hero-phu-de > span:last-child::after { content: ""; flex: 1; height: 1px; margin-left: -.15em; margin-right: .15em; background: linear-gradient(90deg, #f5d68a, #f5d68a80) }
}
