/* =========================================================
   Mers Lojistik — Timed Cards Opening hero
   Adapted from CodePen by @dilums (NWodZMd)
   Inspiration: "Timed Cards Opening" by Giulio Cuscito (Dribbble)
   Scoped under #mers-hero to avoid conflicts with v4 stack
   ========================================================= */
#mers-hero {
  position: relative;
  height: 100vh;
  height: 100svh;
  min-height: 620px;
  width: 100%;
  overflow: hidden;
  background: #0A0F1A;
  color: rgba(255, 255, 255, 0.87);
  font-family: "Sarabun", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
}
@media (max-width: 640px) {
  #mers-hero { min-height: 560px; }
}

#mers-hero .card {
  position: absolute;
  left: 0;
  top: 0;
  background-position: center;
  background-size: cover;
  box-shadow: 6px 6px 24px 4px rgba(0, 0, 0, 0.45);
  border-radius: 0;
  overflow: hidden;
}
#mers-hero .card video {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  pointer-events: none;
}

#mers-hero .card-content {
  position: absolute;
  left: 0;
  top: 0;
  color: rgba(255, 255, 255, 0.87);
  padding-left: 16px;
  font-family: inherit;
}

#mers-hero .content-place {
  margin-top: 0;
  margin-bottom: 8px;
  font-size: 10.5px;
  font-weight: 600;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--c-primary-l, #BFE4F0);
}

#mers-hero .content-title-1,
#mers-hero .content-title-2 {
  font-weight: 700;
  font-size: 18px;
  letter-spacing: -0.02em;
  line-height: 1.08;
}

#mers-hero .content-start {
  display: none; /* removed per "no eyebrow decoration" rule */
}

#mers-hero .details {
  z-index: 22;
  position: absolute;
  top: clamp(140px, 22vh, 240px);
  /* Align with header logo edge (matches .header__row: container-wide + pad-x) */
  left: calc(max(0px, (100vw - var(--container-wide, 1680px)) / 2) + var(--pad-x, 56px));
  /* Constrain width to prevent overflow on narrow viewports */
  max-width: min(560px, calc(100vw - 40px));
  /* Full-height box doesn't capture clicks; only the CTA does */
  pointer-events: none;
}
#mers-hero .details > .cta { pointer-events: auto; }

/* Vertically center the text block on wide screens — cards sit clear on the right.
   Below 1280px the text stays top-anchored so it can't collide with the cards. */
@media (min-width: 1280px) {
  #mers-hero .details {
    top: 0;
    height: 100vh;
    height: 100svh;
    display: flex;
    flex-direction: column;
    justify-content: center;
  }
}
@media (max-width: 1024px) {
  #mers-hero .details { left: clamp(20px, 5vw, 56px); }
}
@media (max-width: 640px) {
  #mers-hero .details {
    top: clamp(112px, 16vh, 160px);
    max-width: calc(100vw - 32px);
  }
}
#mers-hero .details .place-box {
  height: 26px;
  overflow: hidden;
  position: relative;
}
#mers-hero .details .place-box .text {
  padding-top: 0;
  font-size: clamp(12px, 1.2vw, 14px);
  letter-spacing: var(--tr-wide, 0.32em);
  text-transform: uppercase;
  font-weight: 600;
  color: var(--c-primary-l, #BFE4F0);
  position: relative;
}
#mers-hero .details .title-1,
#mers-hero .details .title-2 {
  font-weight: 800;
  font-size: clamp(1.9rem, 5.6vw, 5rem);
  letter-spacing: -0.04em;
  line-height: 1.0;
  font-family: inherit;
}
#mers-hero .details .title-box-1,
#mers-hero .details .title-box-2 {
  margin-top: 2px;
  height: clamp(40px, 6.5vw, 92px);
  overflow: hidden;
}
#mers-hero .details > .desc {
  margin-top: 18px;
  width: 100%;
  max-width: 500px;
  font-size: clamp(13px, 1.1vw, 14.5px);
  line-height: 1.6;
  color: rgba(255, 255, 255, 0.78);
}
#mers-hero .details > .cta {
  width: 100%;
  max-width: 500px;
  margin-top: 24px;
  display: flex;
  align-items: center;
  gap: 14px;
  flex-wrap: wrap;
}
#mers-hero .details > .cta > .bookmark {
  border: none;
  background-color: var(--c-primary, #2998BF);
  width: 40px;
  height: 40px;
  border-radius: 99px;
  color: white;
  display: grid;
  place-items: center;
  cursor: pointer;
  transition: background 200ms ease, transform 200ms ease;
}
#mers-hero .details > .cta > .bookmark:hover {
  background-color: var(--c-primary-d, #1F7A99);
  transform: translateY(-1px);
}
#mers-hero .details > .cta > .bookmark svg {
  width: 18px;
  height: 18px;
}
#mers-hero .details > .cta > .discover {
  border: 1px solid rgba(255, 255, 255, 0.32);
  background-color: transparent;
  height: 40px;
  border-radius: 99px;
  color: #ffffff;
  padding: 0 22px;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  cursor: pointer;
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  transition: background 200ms ease, color 200ms ease, border-color 200ms ease;
  font-family: inherit;
}
#mers-hero .details > .cta > .discover:hover {
  background: #ffffff;
  color: #0A0F1A;
  border-color: #ffffff;
}

#mers-hero .indicator {
  position: absolute;
  left: 0;
  right: 0;
  top: 0;
  height: 4px;
  z-index: 60;
  background-color: var(--c-primary, #2998BF);
}

#mers-hero .pagination {
  position: absolute;
  left: 0px;
  top: 0px;
  display: inline-flex;
  align-items: center;
}
#mers-hero .pagination > .arrow {
  z-index: 60;
  width: 48px;
  height: 48px;
  border-radius: 999px;
  border: 1.5px solid rgba(255, 255, 255, 0.33);
  display: grid;
  place-items: center;
  cursor: pointer;
  transition: background 200ms ease, border-color 200ms ease;
  background: rgba(10, 15, 26, 0.25);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
}
#mers-hero .pagination > .arrow:hover {
  background: var(--c-primary, #2998BF);
  border-color: var(--c-primary, #2998BF);
}
#mers-hero .pagination > .arrow:nth-child(2) {
  margin-left: 16px;
}
#mers-hero .pagination > .arrow svg {
  width: 20px;
  height: 20px;
  stroke-width: 2;
  color: rgba(255, 255, 255, 0.85);
}

#mers-hero .progress-sub-container {
  margin-left: 24px;
  z-index: 60;
  width: clamp(180px, 32vw, 500px);
  height: 48px;
  display: flex;
  align-items: center;
}
#mers-hero .progress-sub-background {
  width: 100%;
  height: 2px;
  background-color: rgba(255, 255, 255, 0.2);
}
#mers-hero .progress-sub-foreground {
  height: 2px;
  background-color: var(--c-primary, #2998BF);
  width: 0;
}

#mers-hero .slide-numbers {
  width: 50px;
  height: 48px;
  overflow: hidden;
  z-index: 60;
  position: relative;
  margin-left: 16px;
}
#mers-hero .slide-numbers .item {
  width: 50px;
  height: 48px;
  position: absolute;
  color: white;
  top: 0;
  left: 0;
  display: grid;
  place-items: center;
  font-size: 26px;
  font-weight: 700;
  letter-spacing: -0.02em;
}

#mers-hero .cover {
  position: absolute;
  left: 0;
  top: 0;
  width: 100vw;
  height: 100%;
  background-color: #0A0F1A;
  z-index: 100;
}

/* Dim overlay over the active card — z-index 21 sits above active card (20),
   below details (22). Lighter pass — image dominant, text just barely contrasted. */
#mers-hero::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 21;
  background:
    linear-gradient(180deg, rgba(10,15,26,0.55) 0%, rgba(10,15,26,0.20) 20%, rgba(10,15,26,0.06) 50%, rgba(10,15,26,0.40) 100%),
    linear-gradient(90deg, rgba(10,15,26,0.42) 0%, rgba(10,15,26,0) 50%);
  pointer-events: none;
}

/* Light theme variant — keep hero dark (image-bg) for video/photo legibility */
[data-theme="dark"] #mers-hero { background: #0A0F1A; }

@media (max-width: 900px) {
  #mers-hero .pagination > .arrow { width: 40px; height: 40px; }
  #mers-hero .pagination > .arrow svg { width: 16px; height: 16px; }
}
@media (max-width: 640px) {
  #mers-hero .pagination > .arrow { width: 36px; height: 36px; }
  #mers-hero .pagination > .arrow svg { width: 14px; height: 14px; }
  #mers-hero .pagination > .arrow:nth-child(2) { margin-left: 8px; }
  #mers-hero .progress-sub-container {
    width: clamp(120px, 28vw, 240px);
    margin-left: 14px;
    height: 36px;
  }
  #mers-hero .slide-numbers {
    width: 36px; height: 36px;
    margin-left: 10px;
  }
  #mers-hero .slide-numbers .item {
    width: 36px; height: 36px;
    font-size: 20px;
  }
  #mers-hero .details > .cta > .discover {
    padding: 0 16px;
    font-size: 11px;
  }
  #mers-hero .details > .cta > .bookmark {
    width: 36px; height: 36px;
  }
}
