:root {
  --blue: #0a469b;
  --red: #e2001f;
  --night: #0b1f47;
  --night-2: #132c5e;
  --line: #3b5691;
  --ink: #10213f;
  --ink-soft: #4d5b76;
  --on-night: #ffffff;
  --on-night-soft: #b9c9e8;
  --radius: 6px;
  --gutter: clamp(1rem, 3vw, 2rem);
  color-scheme: dark;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  background: var(--night);
  color: var(--on-night);
  font: 400 1rem/1.5 "Be Vietnam Pro", system-ui, sans-serif;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

h1, h2, p { margin: 0; }

a:focus-visible {
  outline: 3px solid #fff;
  outline-offset: 2px;
}

/* Dau trang: nen trang de 2 logo hien dung mau */
.masthead {
  background: #fff;
  color: var(--ink);
  border-bottom: 6px solid var(--red);
}

.masthead__inner {
  max-width: 1320px;
  margin: 0 auto;
  padding: 0.75rem var(--gutter);
  display: flex;
  align-items: center;
  gap: clamp(0.75rem, 2vw, 1.25rem);
}

.masthead__school {
  width: clamp(52px, 8vw, 80px);
  height: auto;
  flex: none;
}

.masthead__text { flex: 1; min-width: 0; }

.masthead h1 {
  font: 700 clamp(1.5rem, 4.2vw, 2.75rem)/1.15 "Playfair Display", Georgia, serif;
  color: var(--blue);
}

.masthead p {
  margin-top: 0.25rem;
  font-size: clamp(0.8125rem, 1.6vw, 1rem);
  color: var(--ink-soft);
}

.masthead__fifty {
  width: clamp(72px, 11vw, 124px);
  height: auto;
  flex: none;
}

/* Trinh phat + tuyen duong */
.journey {
  flex: 1;
  width: 100%;
  max-width: 1320px;
  margin: 0 auto;
  padding: var(--gutter);
  display: grid;
  gap: var(--gutter);
  align-items: start;
}

.player {
  position: relative;
  aspect-ratio: 16 / 10; /* dung ti le cua cac video, khong con dai den hai ben */
  background: #000;
  border-radius: var(--radius);
  overflow: hidden;
  scroll-margin-top: 0.5rem;
}

.player iframe {
  display: block;
  width: 100%;
  height: 100%;
  border: 0;
}

.now {
  margin-top: 1rem;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem 1.5rem;
}

.now__text { min-width: 0; }

.now h2 {
  font-size: clamp(1.25rem, 2.6vw, 1.75rem);
  font-weight: 700;
  line-height: 1.25;
}

.now p {
  margin-top: 0.125rem;
  color: var(--on-night-soft);
}

.next {
  padding: 0.625rem 1rem;
  border-radius: var(--radius);
  background: var(--red);
  color: #fff;
  font-weight: 600;
  text-decoration: none;
}

.next:hover { background: #c4001b; }
.next[hidden] { display: none; }

.fallback {
  margin-top: 0.75rem;
  font-size: 0.875rem;
  color: var(--on-night-soft);
}

.fallback a { color: #fff; }

.route__title {
  font-size: 1.125rem;
  font-weight: 700;
}

.route__hint {
  margin: 0.25rem 0 1rem;
  font-size: 0.875rem;
  color: var(--on-night-soft);
}

.stop {
  position: relative;
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.5rem;
  border-radius: var(--radius);
  color: inherit;
  text-decoration: none;
}

.stop:hover { background: var(--night-2); }

.stop[aria-current="true"] {
  background: #fff;
  color: var(--ink);
}

.stop__thumb {
  flex: none;
  width: 104px;
  height: 65px;
  object-fit: cover;
  border-radius: 4px;
  background: var(--night-2);
}

.stop__text { min-width: 0; }

.stop__name {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  column-gap: 0.5rem;
  font-weight: 600;
  line-height: 1.3;
}

.stop__note {
  display: block;
  margin-top: 0.125rem;
  font-size: 0.8125rem;
  line-height: 1.35;
  color: var(--on-night-soft);
}

.stop[aria-current="true"] .stop__note { color: var(--ink-soft); }

.stop[aria-current="true"] .stop__name::after {
  content: "Đang xem";
  padding: 0 0.375rem;
  border-radius: 3px;
  background: var(--red);
  color: #fff;
  font-size: 0.6875rem;
  font-weight: 600;
  line-height: 1.5;
  white-space: nowrap;
}

.stop--full {
  background: var(--night-2);
  margin-bottom: 0.75rem;
}

.stop--full:hover { background: #1b3a78; }
.stop--full[aria-current="true"]:hover,
.stop[aria-current="true"]:hover { background: #fff; }

/* Duong ray noi cac ga */
.line {
  list-style: none;
  margin: 0;
  padding: 0;
  position: relative;
}

.line::before {
  content: "";
  position: absolute;
  top: 1.5rem;
  bottom: 1.5rem;
  left: 0.875rem;
  width: 0.625rem;
  border-inline: 2px solid var(--line);
  background: repeating-linear-gradient(to bottom, var(--line) 0 2px, transparent 2px 8px);
}

.line .stop { padding-left: 0; }

.stop__mark {
  position: relative;
  flex: none;
  width: 2.375rem;
  height: 2.375rem;
  margin-left: 0;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: var(--blue);
  border: 2px solid var(--on-night);
  color: #fff;
  font-weight: 700;
  font-size: 0.9375rem;
}

.stop[aria-current="true"] .stop__mark {
  background: var(--red);
  border-color: var(--red);
}

.foot {
  padding: 1rem var(--gutter);
  border-top: 1px solid var(--night-2);
  text-align: center;
  font-size: 0.8125rem;
  color: var(--on-night-soft);
}

@media (min-width: 960px) {
  .journey { grid-template-columns: minmax(0, 1fr) 380px; }
}

@media (max-width: 400px) {
  .stop__thumb { width: 80px; height: 50px; }
}

/* Dien thoai va may bang: khung xem tran vien, ghim o dau man hinh */
@media (max-width: 959px) {
  .journey {
    display: block;
    padding: 0;
  }

  .stage { display: contents; }

  .player {
    position: sticky;
    top: 0;
    z-index: 10;
    border-radius: 0;
  }

  .now {
    margin: 0;
    padding: 0.75rem var(--gutter) 0;
  }

  .fallback {
    margin: 0;
    padding: 0.5rem var(--gutter) 0;
  }

  .route { padding: var(--gutter); }
}

/* Dien thoai xoay ngang: video vua dung chieu cao man hinh */
@media (max-width: 959px) and (max-height: 500px) and (orientation: landscape) {
  .player {
    position: relative;
    aspect-ratio: auto;
    height: 100vh;
    height: 100svh;
  }
}

@media (max-width: 599px) {
  .masthead { border-bottom-width: 3px; }
  .masthead__inner { padding-block: 0.375rem; }
  .masthead__school { width: 40px; }
  .masthead__fifty { width: 52px; }
  .masthead h1 { font-size: 1.25rem; }
  .masthead p { display: none; }
}
