/* MH Timeline Slider - full width, dark + light. Everything is scoped inside .mhtl. */

/* ---------- light (default) ---------- */
.mhtl {
  --mhtl-top: 100px;
  --mhtl-vw: 100vw;
  --acc: #5700ef;
  --on-acc: #ffffff;
  --fg: #15151c;
  --muted: #5f6376;
  --panel: #f3f3f9;
  --line: #e0e1ec;
  --ctl: rgba(21, 21, 28, .28);
  --shadow: 0 28px 60px -24px rgba(48, 24, 110, .42);
  --clip1: #7c4dff;
  --clip2: #ff5d73;
  --clip3: #0fb5a6;
  --clip4: #f59e0b;
  --wave: rgba(124, 77, 255, .55);
  --ruler: #6d7186;
  --nopic1: #e9e4ff;
  --nopic2: #cfc4ff;
}
/* ---------- dark ---------- */
.mhtl[data-mode="dark"],
html[data-theme="dark"] .mhtl[data-mode="auto"] {
  --acc: #7a3dff;
  --fg: #f4f4f8;
  --muted: #a0a3b6;
  --panel: #1a191f;
  --line: #2d2c37;
  --ctl: rgba(244, 244, 248, .32);
  --shadow: 0 28px 70px -24px rgba(0, 0, 0, .85);
  --clip1: #9a78ff;
  --clip2: #ff6b81;
  --clip3: #2dd4bf;
  --clip4: #fbbf24;
  --wave: rgba(154, 120, 255, .5);
  --ruler: #8e91a6;
  --nopic1: #2a2147;
  --nopic2: #3a2a74;
}
/* a light slider stays light even when the site switches to dark, and the other way round */
html[data-theme="dark"] .mhtl[data-mode="light"] {
  --acc: #5700ef;
  --fg: #15151c;
  --muted: #5f6376;
  --panel: #f3f3f9;
  --line: #e0e1ec;
  --ctl: rgba(21, 21, 28, .28);
  --shadow: 0 28px 60px -24px rgba(0, 0, 0, .6);
  --clip1: #7c4dff;
  --clip2: #ff5d73;
  --clip3: #0fb5a6;
  --clip4: #f59e0b;
  --wave: rgba(124, 77, 255, .55);
  --ruler: #6d7186;
  --nopic1: #e9e4ff;
  --nopic2: #cfc4ff;
}

/* forced styles carry their own background; Auto keeps the site's background */
.mhtl[data-mode="dark"] { background: #111013; }
.mhtl[data-mode="light"] { background: #ffffff; }

/* ---------- frame: full width, starts under the menu ---------- */
.mhtl {
  position: relative;
  box-sizing: border-box;
  width: var(--mhtl-vw);
  max-width: none;
  margin-left: calc(50% - var(--mhtl-vw) / 2);
  padding: var(--mhtl-top) clamp(16px, 4vw, 64px) clamp(28px, 4vw, 56px);
  color: var(--fg);
  font-family: inherit;
  font-size: 16px;
  line-height: 1.4;
  text-align: start;
}
.mhtl:not(.is-ready) { min-height: calc(var(--mhtl-top) + 520px); }
.mhtl *, .mhtl *::before, .mhtl *::after { box-sizing: border-box; }
.mhtl noscript ul { margin: 0; padding: 0; list-style: none; }
.mhtl button { font: inherit; letter-spacing: normal; text-transform: none; -webkit-appearance: none; appearance: none; }
.mhtl .mhtl-ic { width: 1.2em; height: 1.2em; flex: none; display: block; }

.mhtl .mhtl-top {
  display: grid;
  grid-template-columns: minmax(0, 1.85fr) minmax(0, 1fr);
  gap: clamp(18px, 2.6vw, 40px);
  align-items: stretch;
}

/* ---------- video area (no text on top of the picture) ---------- */
.mhtl .mhtl-viewer {
  position: relative; display: block; width: 100%; margin: 0; padding: 0; border: 0;
  aspect-ratio: 16 / 9; border-radius: 20px; overflow: hidden; cursor: pointer;
  background: #000; box-shadow: var(--shadow); isolation: isolate; color: #fff;
}
.mhtl .mhtl-viewer:focus-visible { outline: 3px solid var(--acc); outline-offset: 4px; }
.mhtl .mhtl-scr { position: absolute; inset: 0; opacity: 0; transform: scale(1.045); transition: opacity .6s ease, transform 1.4s cubic-bezier(.2, .7, .2, 1); }
.mhtl .mhtl-scr.on { opacity: 1; transform: none; z-index: 1; }
.mhtl .mhtl-scr img { display: block; width: 100%; height: 100%; max-width: none; object-fit: cover; margin: 0; border: 0; border-radius: 0; }
.mhtl .mhtl-scr.mhtl-nopic { background: linear-gradient(135deg, var(--nopic1), var(--nopic2)); }
.mhtl .mhtl-viewer::after { content: ""; position: absolute; inset: 0; z-index: 2; pointer-events: none; background: linear-gradient(180deg, rgba(0, 0, 0, 0) 55%, rgba(0, 0, 0, .28)); }
.mhtl .mhtl-corners { position: absolute; inset: 16px; z-index: 3; pointer-events: none; opacity: .7;
  background:
    linear-gradient(#fff, #fff) left top / 22px 2px no-repeat, linear-gradient(#fff, #fff) left top / 2px 22px no-repeat,
    linear-gradient(#fff, #fff) right top / 22px 2px no-repeat, linear-gradient(#fff, #fff) right top / 2px 22px no-repeat,
    linear-gradient(#fff, #fff) left bottom / 22px 2px no-repeat, linear-gradient(#fff, #fff) left bottom / 2px 22px no-repeat,
    linear-gradient(#fff, #fff) right bottom / 22px 2px no-repeat, linear-gradient(#fff, #fff) right bottom / 2px 22px no-repeat; }
.mhtl .mhtl-vplay {
  position: absolute; z-index: 4; left: 50%; top: 50%; width: clamp(60px, 7vw, 92px); height: clamp(60px, 7vw, 92px); margin: calc(clamp(60px, 7vw, 92px) / -2) 0 0 calc(clamp(60px, 7vw, 92px) / -2);
  display: grid; place-items: center; border-radius: 50%; background: var(--acc); color: var(--on-acc); font-size: clamp(22px, 2.6vw, 34px);
  box-shadow: 0 10px 34px rgba(0, 0, 0, .4); transition: transform .3s cubic-bezier(.2, .8, .2, 1);
}
.mhtl .mhtl-viewer:hover .mhtl-vplay { transform: scale(1.1); }

/* ---------- text side ---------- */
/* the text box never makes the row taller than the video, so nothing can overlap */
.mhtl .mhtl-side { position: relative; min-width: 0; min-height: 0; }
.mhtl .mhtl-sidein { position: absolute; inset: 0; display: flex; flex-direction: column; justify-content: space-between; gap: 18px; overflow: hidden; padding: 2px 0; }
.mhtl .mhtl-txt { min-height: 0; overflow: hidden; display: flex; flex-direction: column; align-items: flex-start; gap: 14px; }
.mhtl .mhtl-txt.swap > * { animation: mhtlIn .5s cubic-bezier(.2, .7, .2, 1) both; }
.mhtl .mhtl-txt.swap > *:nth-child(2) { animation-delay: .04s; }
.mhtl .mhtl-txt.swap > *:nth-child(3) { animation-delay: .08s; }
.mhtl .mhtl-txt.swap > *:nth-child(4) { animation-delay: .12s; }
@keyframes mhtlIn { from { opacity: 0; transform: translateY(14px); } to { opacity: 1; transform: none; } }
.mhtl .mhtl-idx { margin: 0; font-size: 14px; font-weight: 700; letter-spacing: .12em; color: var(--acc); font-variant-numeric: tabular-nums; }
.mhtl .mhtl-title {
  margin: 0; padding: 0; color: var(--fg); font-family: inherit; text-transform: none; letter-spacing: -.02em; line-height: 1.06; font-weight: 800;
  font-size: clamp(28px, 3.3vw, 56px); overflow-wrap: anywhere;
  display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 4; line-clamp: 4; overflow: hidden;
}
.mhtl .mhtl-title.m { font-size: clamp(26px, 2.8vw, 46px); }
.mhtl .mhtl-title.l { font-size: clamp(22px, 2.2vw, 36px); }
.mhtl .mhtl-sub { margin: 0; padding: 0; color: var(--muted); font-size: clamp(15px, 1.25vw, 20px); font-weight: 500; line-height: 1.45; display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 3; line-clamp: 3; overflow: hidden; }
.mhtl .mhtl-tags { display: flex; flex-wrap: wrap; gap: 8px; }
.mhtl .mhtl-tag { padding: 6px 14px; border-radius: 999px; font-size: 13px; font-weight: 700; line-height: 1.2;
  background: color-mix(in srgb, var(--tc) 16%, transparent); color: color-mix(in srgb, var(--tc) 72%, var(--fg));
  box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--tc) 38%, transparent); }
.mhtl [hidden] { display: none !important; }

.mhtl .mhtl-ctl { display: flex; align-items: center; flex-wrap: wrap; gap: 12px; }
.mhtl .mhtl-arrow {
  width: 52px; height: 52px; margin: 0; padding: 0; display: grid; place-items: center; border-radius: 50%; cursor: pointer;
  background: transparent; color: var(--fg); border: 1.5px solid var(--ctl); font-size: 20px; box-shadow: none;
  transition: background .2s, color .2s, border-color .2s, transform .2s;
}
.mhtl .mhtl-arrow:hover { background: var(--fg); color: var(--panel); border-color: var(--fg); }
.mhtl .mhtl-arrow:active { transform: scale(.94); }
.mhtl .mhtl-watch {
  height: 52px; margin: 0; padding: 0 26px 0 20px; display: inline-flex; align-items: center; gap: 10px; border-radius: 999px; border: 0; cursor: pointer;
  background: var(--acc); color: var(--on-acc); font-size: 17px; font-weight: 700; line-height: 1; box-shadow: 0 10px 26px -10px var(--acc);
  transition: transform .2s, filter .2s;
}
.mhtl .mhtl-watch:hover { filter: brightness(1.12); transform: translateY(-1px); }
.mhtl .mhtl-arrow:focus-visible, .mhtl .mhtl-watch:focus-visible, .mhtl .mhtl-lanes:focus-visible { outline: 3px solid var(--acc); outline-offset: 3px; }

/* ---------- timeline ---------- */
.mhtl .mhtl-panel {
  margin-top: clamp(16px, 2vw, 28px); display: grid; grid-template-columns: 46px minmax(0, 1fr);
  background: var(--panel); border: 1px solid var(--line); border-radius: 16px; overflow: hidden; user-select: none; -webkit-user-select: none;
}
.mhtl .mhtl-heads { display: grid; grid-template-rows: 28px 60px 44px; border-right: 1px solid var(--line); }
.mhtl .mhtl-h { display: grid; place-items: center; font-size: 11px; font-weight: 800; letter-spacing: .08em; color: var(--muted); border-top: 1px solid var(--line); }
.mhtl .mhtl-lanes { position: relative; display: grid; grid-template-rows: 28px 60px 44px; cursor: ew-resize; touch-action: pan-y; }
.mhtl .mhtl-ruler { position: relative; }
.mhtl .mhtl-rl { position: absolute; top: 8px; padding-left: 6px; font-size: 10px; font-weight: 600; letter-spacing: .04em; color: var(--ruler); white-space: nowrap; font-variant-numeric: tabular-nums; }
.mhtl .mhtl-rl::before { content: ""; position: absolute; left: 0; top: -8px; width: 1px; height: 16px; background: var(--line); }
.mhtl .mhtl-rl.end { transform: translateX(-100%); padding: 0 6px 0 0; }
.mhtl .mhtl-rl.end::before { left: auto; right: 0; }
.mhtl .mhtl-lane { position: relative; border-top: 1px solid var(--line); }
.mhtl .mhtl-lane canvas { position: absolute; inset: 0; width: 100%; height: 100%; display: block; }
.mhtl .mhtl-clip {
  position: absolute; top: 5px; bottom: 5px; margin-left: 2px; border-radius: 9px; overflow: hidden; background-color: var(--c);
  background-size: cover; background-position: center; opacity: .7; transition: opacity .3s, box-shadow .3s;
}
.mhtl .mhtl-clip::before { content: ""; position: absolute; inset: 0; background: linear-gradient(180deg, color-mix(in srgb, var(--c) 30%, transparent), color-mix(in srgb, var(--c) 62%, #000 20%)); }
.mhtl .mhtl-clip.on { opacity: 1; box-shadow: 0 0 0 2px var(--c), 0 6px 18px -6px var(--c); }
.mhtl .mhtl-cn { position: absolute; left: 10px; right: 8px; bottom: 6px; font-size: 12px; font-weight: 700; line-height: 1.2; color: #fff; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; text-shadow: 0 1px 3px rgba(0, 0, 0, .55); }
.mhtl .mhtl-ph { position: absolute; top: 0; bottom: 0; width: 0; z-index: 5; pointer-events: none; }
.mhtl .mhtl-ph::before { content: ""; position: absolute; top: 0; bottom: 0; left: -1px; width: 2px; background: var(--acc); }
.mhtl .mhtl-ph i { position: absolute; top: 3px; left: -8px; width: 16px; height: 20px; background: var(--acc); clip-path: polygon(0 0, 100% 0, 100% 55%, 50% 100%, 0 55%); display: block; }

/* ---------- tablet and phone ---------- */
@media (max-width: 960px) {
  .mhtl .mhtl-top { grid-template-columns: minmax(0, 1fr); }
  .mhtl .mhtl-side { position: static; }
  .mhtl .mhtl-sidein { position: static; overflow: visible; gap: 20px; }
  .mhtl .mhtl-title { font-size: clamp(26px, 6vw, 40px); }
  .mhtl .mhtl-title.m { font-size: clamp(24px, 5.4vw, 36px); }
  .mhtl .mhtl-title.l { font-size: clamp(21px, 4.6vw, 30px); }
}
@media (max-width: 640px) {
  .mhtl .mhtl-viewer { border-radius: 14px; }
  .mhtl .mhtl-panel { grid-template-columns: 34px minmax(0, 1fr); border-radius: 12px; }
  .mhtl .mhtl-heads, .mhtl .mhtl-lanes { grid-template-rows: 26px 50px 36px; }
  .mhtl .mhtl-cn { font-size: 11px; left: 6px; right: 4px; }
  .mhtl .mhtl-rl { font-size: 11px; }
  .mhtl .mhtl-arrow, .mhtl .mhtl-watch { height: 48px; }
  .mhtl .mhtl-arrow { width: 48px; }
}
@media (prefers-reduced-motion: reduce) {
  .mhtl .mhtl-scr, .mhtl .mhtl-txt.swap > * { transition: none; animation: none; }
}

/* ---------- popup player (always dark) ---------- */
.mhtl-lb { position: fixed; inset: 0; z-index: 2147483000; display: grid; place-items: center; opacity: 0; transition: opacity .2s; }
.mhtl-lb[hidden] { display: none; }
.mhtl-lb.on { opacity: 1; }
.mhtl-lb *, .mhtl-lb *::before, .mhtl-lb *::after { box-sizing: border-box; }
.mhtl-lb-bg { position: absolute; inset: 0; background: rgba(6, 6, 10, .88); backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px); }
.mhtl-lb-box { position: relative; width: min(92vw, 1180px); max-height: 94vh; display: flex; flex-direction: column; gap: 12px; }
.mhtl-lb-frame { position: relative; width: min(100%, calc(80vh * 16 / 9)); aspect-ratio: 16 / 9; margin: 0 auto; background: #000; border-radius: 14px; overflow: hidden; box-shadow: 0 30px 80px rgba(0, 0, 0, .6); }
.mhtl-lb-frame.v { aspect-ratio: 9 / 16; width: auto; height: min(80vh, 780px); max-width: 92vw; }
.mhtl-lb-frame iframe, .mhtl-lb-frame video { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; background: #000; }
.mhtl-lb-cap { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 12px; color: #f4f4f8; font-family: inherit; }
.mhtl-lb-cap strong { font-size: 17px; font-weight: 700; }
.mhtl-lb-cap span { font-size: 14px; color: #b3b5c6; }
.mhtl-lb-x { position: absolute; top: 18px; right: 18px; width: 46px; height: 46px; margin: 0; padding: 0; display: grid; place-items: center; border-radius: 50%; border: 1.5px solid rgba(255, 255, 255, .4); background: rgba(0, 0, 0, .4); color: #fff; cursor: pointer; font-size: 20px; }
.mhtl-lb-x:hover { background: #fff; color: #000; }
.mhtl-lb-x:focus-visible { outline: 3px solid #9a78ff; outline-offset: 3px; }
.mhtl-lb .mhtl-ic { width: 1.2em; height: 1.2em; display: block; }
html.mhtl-lb-open, html.mhtl-lb-open body { overflow: hidden !important; }
