/*
 * Trí Lữ · Điểm vào học v2
 * Chỉ áp dụng cho các khối .tl-entry trên trang chủ, JLPT và hub N1–N5.
 * Mục tiêu: đưa hành động học quan trọng lên màn hình đầu, không làm thay đổi
 * nội dung điện ảnh/giới thiệu đang nằm phía dưới.
 */

.tl-entry,
.tl-entry * {
  box-sizing: border-box;
}

.tl-entry {
  --tl-bg: #fffdf8;
  --tl-surface: #f3f6f8;
  --tl-surface-hover: #eaf0f4;
  --tl-text: #10213b;
  --tl-muted: #526174;
  --tl-line: #d7e0e7;
  --tl-accent: #1b3a6b;
  --tl-accent-text: #ffffff;
  position: relative;
  z-index: 5;
  width: 100%;
  margin: 0;
  padding: clamp(28px, 4vw, 52px) clamp(18px, 4vw, 48px);
  background: var(--tl-bg);
  color: var(--tl-text);
  font-family: "Be Vietnam Pro", "Inter Tight", Inter, system-ui, -apple-system, sans-serif;
  line-height: 1.5;
  letter-spacing: 0;
}

.tl-entry--dark {
  --tl-bg: #0d1726;
  --tl-surface: #152438;
  --tl-surface-hover: #1b2d45;
  --tl-text: #fbf8f1;
  --tl-muted: #c2ccda;
  --tl-line: #33455b;
  --tl-accent: #f5d18b;
  --tl-accent-text: #152238;
  border-bottom: 1px solid var(--tl-line);
}

html[data-mode="dark"] .tl-entry--course {
  --tl-bg: #0d1726;
  --tl-surface: #152438;
  --tl-surface-hover: #1b2d45;
  --tl-text: #fbf8f1;
  --tl-muted: #c2ccda;
  --tl-line: #33455b;
  --tl-accent: #f5d18b;
  --tl-accent-text: #152238;
}

.tl-main-v2--home .tl-entry--home,
.tl-main-v2--cinema .tl-entry--cinema {
  padding-top: calc(clamp(88px, 10vw, 112px) + env(safe-area-inset-top));
}

.tl-entry__inner {
  width: min(100%, 1180px);
  margin-inline: auto;
}

.tl-entry__eyebrow {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 0 0 12px;
  color: var(--tl-muted) !important;
  font-family: "JetBrains Mono", ui-monospace, monospace;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.1em;
  line-height: 1.4;
  text-transform: uppercase;
}

.tl-entry__eyebrow::before {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--tl-accent);
  content: "";
  flex: 0 0 auto;
}

.tl-entry__head {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: end;
  gap: 20px 32px;
}

.tl-entry__title {
  max-width: 18ch;
  margin: 0;
  color: var(--tl-text) !important;
  font-family: "Cormorant Garamond", Georgia, serif;
  font-size: clamp(36px, 5vw, 62px);
  font-style: normal;
  font-weight: 600;
  letter-spacing: -0.025em;
  line-height: 0.98;
  text-wrap: balance;
}

.tl-entry--course .tl-entry__title {
  color: var(--tl-accent) !important;
  font-size: clamp(38px, 5vw, 58px);
}

.tl-entry__description {
  max-width: 58ch;
  margin: 14px 0 0;
  color: var(--tl-muted) !important;
  font-size: clamp(15px, 1.25vw, 18px);
  font-weight: 400;
  line-height: 1.6;
}

.tl-entry__primary {
  display: inline-flex;
  min-height: 52px;
  align-items: center;
  justify-content: center;
  gap: 18px;
  padding: 13px 20px;
  border: 1px solid var(--tl-accent);
  border-radius: 12px;
  background: var(--tl-accent);
  color: var(--tl-accent-text);
  font-size: 15px;
  font-weight: 700;
  line-height: 1.2;
  text-decoration: none;
  white-space: nowrap;
  transition: background-color 160ms ease, border-color 160ms ease, transform 160ms ease;
}

.tl-entry__primary:hover {
  transform: translateY(-1px);
  filter: brightness(1.04);
}

.tl-entry__primary span[aria-hidden="true"] {
  font-size: 20px;
  line-height: 1;
}

.tl-entry__levels {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 8px;
  margin-top: clamp(22px, 3vw, 34px);
}

.tl-entry__level {
  display: flex;
  min-height: 50px;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--tl-line);
  border-radius: 10px;
  background: transparent;
  color: var(--tl-text);
  font-size: 15px;
  font-weight: 700;
  text-decoration: none;
  transition: background-color 160ms ease, border-color 160ms ease;
}

.tl-entry__level:hover,
.tl-entry__level[aria-current="page"] {
  border-color: var(--tl-accent);
  background: var(--tl-surface-hover);
}

.tl-entry__label {
  margin: 26px 0 10px;
  color: var(--tl-muted) !important;
  font-size: 13px;
  font-weight: 600;
}

.tl-entry__actions {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
}

.tl-entry__actions--core {
  grid-template-columns: repeat(4, minmax(0, 1fr));
  margin-top: clamp(22px, 3vw, 34px);
}

.tl-entry__action {
  display: flex;
  min-width: 0;
  min-height: 76px;
  align-items: center;
  gap: 14px;
  padding: 14px 16px;
  border: 1px solid var(--tl-line);
  border-radius: 12px;
  background: var(--tl-surface);
  color: var(--tl-text);
  text-align: left;
  text-decoration: none;
  transition: background-color 160ms ease, border-color 160ms ease, transform 160ms ease;
}

.tl-entry__action:hover {
  border-color: var(--tl-accent);
  background: var(--tl-surface-hover);
  transform: translateY(-1px);
}

.tl-entry__action-jp {
  display: grid;
  width: 42px;
  height: 42px;
  flex: 0 0 42px;
  place-items: center;
  border: 1px solid var(--tl-line);
  border-radius: 10px;
  background: var(--tl-bg);
  color: var(--tl-accent);
  font-family: "Noto Serif JP", serif;
  font-size: 17px;
  font-weight: 600;
}

.tl-entry__action-copy {
  min-width: 0;
}

.tl-entry__action-title {
  display: block;
  color: inherit;
  font-size: 15px;
  font-weight: 700;
  line-height: 1.25;
}

.tl-entry__action-note {
  display: block;
  margin-top: 3px;
  overflow: hidden;
  color: var(--tl-muted);
  font-size: 12px;
  line-height: 1.35;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.tl-entry__secondary {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 12px;
}

.tl-entry__secondary a {
  display: inline-flex;
  min-height: 44px;
  align-items: center;
  padding: 9px 14px;
  border: 1px solid var(--tl-line);
  border-radius: 999px;
  color: var(--tl-muted) !important;
  font-size: 13px;
  font-weight: 600;
  text-decoration: none;
  transition: border-color 160ms ease, color 160ms ease;
}

.tl-entry__secondary a:hover {
  border-color: var(--tl-accent);
  color: var(--tl-text) !important;
}

.tl-entry a:focus-visible {
  outline: 3px solid var(--tl-accent);
  outline-offset: 3px;
}

/* Phần kể chuyện vẫn còn nguyên, nhưng không còn chiếm toàn bộ quyết định đầu tiên. */
.tl-main-v2--cinema .hero {
  min-height: 58vh;
}

@media (max-width: 760px) {
  .tl-entry {
    padding-inline: 16px;
  }

  .tl-main-v2--home .tl-entry--home,
  .tl-main-v2--cinema .tl-entry--cinema {
    padding-top: calc(112px + env(safe-area-inset-top));
  }

  .tl-entry__head {
    grid-template-columns: 1fr;
    align-items: start;
  }

  .tl-entry__title,
  .tl-entry--course .tl-entry__title {
    max-width: 20ch;
    font-size: clamp(33px, 10.5vw, 44px);
    line-height: 1;
  }

  .tl-entry__description {
    margin-top: 10px;
    font-size: 15px;
  }

  .tl-entry__primary {
    width: 100%;
    justify-content: space-between;
  }

  .tl-entry__levels {
    gap: 6px;
    margin-top: 20px;
  }

  .tl-entry__level {
    min-height: 46px;
    font-size: 14px;
  }

  .tl-entry__actions {
    grid-template-columns: 1fr;
  }

  .tl-entry__actions--core {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
    margin-top: 20px;
  }

  .tl-entry__actions--core .tl-entry__action {
    min-height: 92px;
    align-items: flex-start;
    flex-direction: column;
    gap: 9px;
    padding: 12px;
  }

  .tl-entry__actions--core .tl-entry__action-jp {
    width: 34px;
    height: 34px;
    flex-basis: 34px;
    font-size: 15px;
  }

  .tl-entry__secondary {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .tl-entry__secondary a {
    justify-content: center;
    padding-inline: 7px;
    text-align: center;
  }

  .tl-main-v2--cinema .hero {
    min-height: 460px;
  }

  .tl-main-v2--course .cine-banner {
    display: none;
  }

  .tl-main-v2--course main.page > .container:first-of-type + .section {
    padding-top: 34px;
  }
}

@media (max-width: 390px) {
  .tl-entry__secondary {
    grid-template-columns: 1fr;
  }

  .tl-entry__secondary a {
    justify-content: flex-start;
    padding-inline: 13px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .tl-entry *,
  .tl-entry *::before,
  .tl-entry *::after {
    scroll-behavior: auto !important;
    transition-duration: 0.01ms !important;
  }
}
