/* Kezdőlapi hero: szerkesztőségi elrendezés (bal oldalt szöveg, jobb oldalt diaválasztó sáv) */
.hv-hero {
  --hv-red: #e10600;
  --hv-bg: #121212;
  --hv-h: clamp(480px, 68vh, 640px);
  position: relative;
  background: var(--hv-bg);
  overflow: hidden;
}

/* A régi #heroCarousel szabályok (aspect-ratio, min-height) felülírása */
#heroCarousel.hv-hero .carousel-inner,
#heroCarousel.hv-hero .carousel-item {
  height: var(--hv-h);
  min-height: 0;
  aspect-ratio: auto;
}

.hv-slide {
  position: relative;
  height: 100%;
  display: flex;
  align-items: flex-end;
}

.hv-slide__img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center 35%;
  z-index: 0;
}

/* Balról sötét a szöveg alatt, középen látszik a kép, alul beleolvad az oldal hátterébe */
.hv-slide__shade {
  position: absolute;
  inset: 0;
  z-index: 1;
  pointer-events: none;
  background:
    linear-gradient(180deg, rgba(18, 18, 18, 0) 55%, rgba(18, 18, 18, 0.85) 90%, var(--hv-bg) 100%),
    linear-gradient(90deg, rgba(10, 10, 10, 0.94) 0%, rgba(10, 10, 10, 0.78) 32%, rgba(10, 10, 10, 0.2) 62%, rgba(10, 10, 10, 0.55) 100%);
}

.hv-slide__body {
  position: relative;
  z-index: 2;
  padding-bottom: 64px;
}

.hv-slide__text {
  max-width: 620px;
  padding-left: 22px;
  border-left: 4px solid var(--hv-red);
}

.hv-slide__meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px;
  margin-bottom: 14px;
  font-family: 'Rajdhani', 'Arial Narrow', Arial, sans-serif;
  font-size: 0.95rem;
  font-weight: 600;
  color: #c9c9c9;
}

.hv-chip {
  display: inline-block;
  padding: 3px 10px;
  background: var(--hv-red);
  color: #fff;
  font-size: 0.8rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  border-radius: 3px;
}

.hv-chip--championship {
  background: #ffc107;
  color: #111;
}

.hv-chip--race {
  background: #fff;
  color: #111;
}

.hv-slide__title {
  margin: 0 0 14px;
  font-family: 'Rajdhani', 'Arial Narrow', Arial, sans-serif;
  font-size: clamp(1.9rem, 4.2vw, 3.5rem);
  font-weight: 700;
  line-height: 1.05;
  text-wrap: balance;
}

.hv-slide__title a {
  color: #fff;
  text-decoration: none;
}

.hv-slide__title a:hover {
  color: #fff;
  text-decoration: underline;
  text-decoration-color: var(--hv-red);
  text-underline-offset: 6px;
}

.hv-slide__excerpt {
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
  overflow: hidden;
  margin: 0 0 22px;
  max-width: 54ch;
  font-size: 1.05rem;
  line-height: 1.5;
  color: #cfcfcf;
}

.hv-btn {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 12px 22px;
  background: var(--hv-red);
  color: #fff;
  font-family: 'Rajdhani', 'Arial Narrow', Arial, sans-serif;
  font-size: 1.05rem;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  text-decoration: none;
  border-radius: 4px;
  transition: background-color 0.2s ease, transform 0.2s ease;
}

.hv-btn:hover {
  background: #ff1a14;
  color: #fff;
  transform: translateX(3px);
}

.hv-btn:focus-visible,
.hv-rail button:focus-visible {
  outline: 2px solid #fff;
  outline-offset: 2px;
}

/* Diaválasztó sáv: a Bootstrap .carousel-indicators viselkedését használja, saját kinézettel */
.hv-hero__rail {
  position: absolute;
  inset: 0;
  z-index: 3;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  pointer-events: none;
}

.hv-hero .hv-rail {
  position: static;
  display: flex;
  flex-direction: column;
  gap: 6px;
  width: 340px;
  margin: 0;
  padding: 0;
  pointer-events: auto;
}

.hv-hero .hv-rail button {
  position: relative;
  display: flex;
  align-items: center;
  gap: 12px;
  flex: 0 0 auto;
  width: 100%;
  height: auto;
  margin: 0;
  padding: 8px 12px 8px 8px;
  text-indent: 0;
  text-align: left;
  color: #d6d6d6;
  background: rgba(18, 18, 18, 0.72);
  background-clip: border-box;
  border: 0;
  border-left: 3px solid transparent;
  border-radius: 4px;
  opacity: 1;
  overflow: hidden;
  transform: none;
  transition: background-color 0.2s ease, border-color 0.2s ease;
  -webkit-backdrop-filter: blur(6px);
  backdrop-filter: blur(6px);
}

.hv-hero .hv-rail button:hover {
  background: rgba(40, 40, 40, 0.85);
}

.hv-hero .hv-rail button.active {
  color: #fff;
  background: rgba(30, 30, 30, 0.92);
  border-left-color: var(--hv-red);
  transform: none;
}

.hv-rail__thumb {
  flex: 0 0 64px;
  width: 64px;
  height: 44px;
  object-fit: cover;
  border-radius: 3px;
}

.hv-rail__text {
  min-width: 0;
}

.hv-rail__type {
  display: block;
  font-family: 'Rajdhani', 'Arial Narrow', Arial, sans-serif;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: #ff5a55;
}

.hv-rail__title {
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
  overflow: hidden;
  font-size: 0.88rem;
  font-weight: 600;
  line-height: 1.25;
}

/* Haladásjelző az aktív dián: annyi idő alatt telik meg, amennyi a váltásig van */
.hv-rail__bar {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 2px;
  background: transparent;
}

.hv-rail button.active .hv-rail__bar::after {
  content: '';
  display: block;
  height: 100%;
  background: var(--hv-red);
  transform-origin: left;
  animation: hv-progress var(--hv-interval, 8000ms) linear forwards;
}

@keyframes hv-progress {
  from { transform: scaleX(0); }
  to { transform: scaleX(1); }
}

@media (min-width: 992px) {
  .hv-slide__body {
    /* hely a jobb oldali sávnak */
    padding-right: 380px;
  }
}

/* Tablet és mobil: a sávból csak a haladásjelző csíkok maradnak a hero alján */
@media (max-width: 991.98px) {
  .hv-hero {
    --hv-h: clamp(420px, 62vh, 560px);
  }

  .hv-slide__shade {
    background: linear-gradient(180deg, rgba(10, 10, 10, 0.35) 0%, rgba(10, 10, 10, 0.55) 40%, rgba(18, 18, 18, 0.95) 85%, var(--hv-bg) 100%);
  }

  .hv-slide__body {
    padding-bottom: 52px;
  }

  .hv-slide__text {
    padding-left: 16px;
  }

  .hv-hero__rail {
    align-items: flex-end;
    justify-content: stretch;
    padding-bottom: 22px;
  }

  .hv-hero .hv-rail {
    flex-direction: row;
    width: 100%;
    gap: 6px;
  }

  .hv-hero .hv-rail button {
    flex: 1 1 0;
    height: 4px;
    padding: 0;
    border-left: 0;
    border-radius: 2px;
    background: rgba(255, 255, 255, 0.28);
    -webkit-backdrop-filter: none;
    backdrop-filter: none;
  }

  .hv-hero .hv-rail button.active {
    background: rgba(255, 255, 255, 0.28);
  }

  .hv-rail__thumb,
  .hv-rail__text {
    display: none;
  }

  .hv-rail__bar {
    height: 100%;
  }
}

@media (max-width: 575.98px) {
  .hv-slide__excerpt {
    display: none;
  }

  .hv-slide__title {
    margin-bottom: 18px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .hv-rail button.active .hv-rail__bar::after {
    animation: none;
  }

  .hv-btn {
    transition: none;
  }
}
