/* =========================================================================
   VIDEO BROWSE — Netflix/Areena-tyylinen arkistosivu
   Tumma elokuvateatteriteema: hero-banneri + horisontaaliset karusellit
   Tiedosto: video-browse.css — enqueue vain /videot/ -arkistossa
   ========================================================================= */

/* ---- Browse container ---- */
.video-browse {
  background: var(--dark-bg);
  min-height: 100vh;
}

/* =========================================================================
   HERO BANNER
   ========================================================================= */
.vb-hero {
  position: relative;
  width: 100%;
  min-height: 520px;
  display: flex;
  align-items: flex-end;
  overflow: hidden;
}

@media (min-width: 861px) {
  .vb-hero { min-height: 600px; }
}

@media (max-width: 480px) {
  .vb-hero { min-height: 400px; }
}

.vb-hero__bg {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center 20%;
}

/* Gradient overlay — vahva alhaalta */
.vb-hero__overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(
    to top,
    var(--dark-bg) 0%,
    rgba(11, 22, 40, 0.92) 20%,
    rgba(11, 22, 40, 0.5) 50%,
    rgba(11, 22, 40, 0.2) 75%,
    rgba(11, 22, 40, 0.35) 100%
  );
}

/* Vinjetti — reunojen fade */
.vb-hero__vignette {
  position: absolute;
  inset: 0;
  background: radial-gradient(
    ellipse 80% 100% at 50% 50%,
    transparent 50%,
    rgba(11, 22, 40, 0.6) 100%
  );
}

.vb-hero__content {
  position: relative;
  z-index: 2;
  width: 100%;
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 clamp(16px, 4vw, 32px) 48px;
}

.vb-hero__inner {
  max-width: 600px;
}

.vb-hero__category {
  display: inline-block;
  padding: 4px 12px;
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--color-orange);
  border: 1px solid rgba(247, 148, 29, 0.4);
  border-radius: 3px;
  margin-bottom: 14px;
}

.vb-hero__title {
  font-size: clamp(2rem, 5vw, 3.25rem);
  font-weight: 700;
  color: #fff;
  line-height: 1.1;
  margin: 0 0 14px;
  text-shadow: 0 2px 16px rgba(0, 0, 0, 0.5);
}

.vb-hero__desc {
  font-size: 1rem;
  line-height: 1.6;
  color: rgba(255, 255, 255, 0.75);
  margin: 0 0 16px;
  max-width: 520px;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.vb-hero__meta {
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 0.85rem;
  color: rgba(255, 255, 255, 0.55);
  margin-bottom: 24px;
}

.vb-hero__meta span + span::before {
  content: "·";
  margin-right: 12px;
}

.vb-hero__badge {
  display: inline-block;
  padding: 2px 8px;
  font-size: 0.65rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  background: linear-gradient(135deg, var(--color-orange-start), var(--color-orange-end));
  color: #fff;
  border-radius: 3px;
}

.vb-hero__badge::before {
  content: none;
}

.vb-hero__cta {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 14px 32px 14px 24px;
  border: none;
  border-radius: var(--radius-pill);
  background: linear-gradient(135deg, var(--color-orange-start), var(--color-orange-end));
  color: #fff;
  font-family: var(--font);
  font-size: 1rem;
  font-weight: 600;
  text-decoration: none;
  cursor: pointer;
  box-shadow: 0 4px 24px rgba(241, 90, 36, 0.35);
  transition: box-shadow 0.3s ease, transform 0.2s ease;
}

.vb-hero__cta:hover {
  box-shadow: 0 6px 32px rgba(241, 90, 36, 0.5);
  transform: scale(1.02);
  color: #fff;
}

.vb-hero__cta:focus-visible {
  outline: 2px solid var(--color-orange);
  outline-offset: 3px;
}

/* =========================================================================
   KARUSELLIRIVIT
   ========================================================================= */
.vb-rows {
  position: relative;
  z-index: 3;
  padding: 8px 0 64px;
  margin-top: -32px;
}

/* ---- Karusellirivi ---- */
.vb-row {
  position: relative;
  margin-bottom: 36px;
}

.vb-row:last-child {
  margin-bottom: 0;
}

.vb-row__header {
  max-width: var(--max-width);
  margin: 0 auto 14px;
  padding: 0 clamp(16px, 4vw, 32px);
}

.vb-row__title {
  font-size: 1.3rem;
  font-weight: 600;
  color: var(--dark-text);
  margin: 0;
}

/* ---- Karuselli — scroll-container ---- */
.vb-carousel {
  overflow-x: auto;
  scrollbar-width: none;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior-x: contain;
}

.vb-carousel::-webkit-scrollbar {
  display: none;
}

/* Track — flex-rivi, padding-left linjaa containerin kanssa */
.vb-carousel__track {
  display: flex;
  gap: 14px;
  width: max-content;
  padding-left: max(clamp(16px, 4vw, 32px), calc((100vw - var(--max-width)) / 2 + clamp(16px, 4vw, 32px)));
  padding-right: clamp(16px, 4vw, 32px);
}

/* ---- Nuolipainikkeet (vb-row-tasolla, absolute) ---- */
.vb-row {
  position: relative;
}

.vb-carousel__arrow {
  position: absolute;
  top: 0;
  bottom: 0;
  width: 48px;
  z-index: 4;
  display: flex;
  align-items: center;
  justify-content: center;
  border: none;
  cursor: pointer;
  color: #fff;
  opacity: 0;
  transition: opacity 0.2s ease;
}

.vb-row:hover .vb-carousel__arrow:not([hidden]) {
  opacity: 1;
}

.vb-carousel__arrow:focus-visible {
  opacity: 1;
  outline: 2px solid var(--color-orange);
  outline-offset: -2px;
}

.vb-carousel__arrow--left {
  left: 0;
  background: linear-gradient(to right, rgba(11, 22, 40, 0.85), transparent);
}

.vb-carousel__arrow--right {
  right: 0;
  background: linear-gradient(to left, rgba(11, 22, 40, 0.85), transparent);
}

@media (max-width: 860px) {
  .vb-carousel__arrow { display: none; }
}

/* =========================================================================
   BROWSE-KORTTI (vb-card)
   ========================================================================= */
.vb-card {
  flex: 0 0 auto;
  width: 280px;
  text-decoration: none;
  color: inherit;
  scroll-snap-align: start;
  transition: transform 0.2s ease;
}

.vb-card:hover {
  transform: translateY(-4px);
}

.vb-card:focus-visible {
  outline: 2px solid var(--color-orange);
  outline-offset: 4px;
  border-radius: var(--radius-sm);
}

@media (max-width: 480px) {
  .vb-card { width: 220px; }
}

/* ---- Kuva ---- */
.vb-card__image {
  position: relative;
  aspect-ratio: 16 / 9;
  overflow: hidden;
  background: #0a1220;
  border-radius: 8px;
}

.vb-card__img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.35s ease;
}

.vb-card:hover .vb-card__img {
  transform: scale(1.05);
}

.vb-card__gradient {
  position: absolute;
  inset: 0;
  background: linear-gradient(to top, rgba(10, 18, 32, 0.3) 0%, transparent 40%);
  pointer-events: none;
}

.vb-card__placeholder {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: 100%;
  color: var(--dark-text-dim);
}

/* Play */
.vb-card__play {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(0, 0, 0, 0.5);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  color: #fff;
  border-radius: 50%;
  opacity: 0;
  transition: opacity 0.2s ease, background 0.2s ease;
}

.vb-card__play svg {
  margin-left: 2px;
}

.vb-card:hover .vb-card__play {
  opacity: 1;
}

/* Duration */
.vb-card__duration {
  position: absolute;
  bottom: 8px;
  right: 8px;
  padding: 3px 7px;
  background: rgba(0, 0, 0, 0.75);
  color: #fff;
  font-size: 0.7rem;
  font-weight: 600;
  border-radius: 3px;
  z-index: 2;
  letter-spacing: 0.02em;
}

/* Tilaajille badge */
.vb-card__badge {
  position: absolute;
  top: 8px;
  left: 8px;
  padding: 3px 8px;
  font-size: 0.6rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  background: linear-gradient(135deg, var(--color-orange-start), var(--color-orange-end));
  color: #fff;
  border-radius: 4px;
  z-index: 2;
}

/* ---- Teksti ---- */
.vb-card__body {
  padding: 10px 2px 4px;
}

.vb-card__cat {
  display: block;
  font-size: 0.7rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--color-orange);
  margin-bottom: 4px;
}

.vb-card__title {
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--dark-text);
  line-height: 1.35;
  margin: 0;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.vb-card__sub {
  display: block;
  font-size: 0.75rem;
  color: var(--dark-text-muted);
  margin-top: 3px;
}

/* ---- Sarjakortti ---- */
.vb-card--series .vb-card__image {
  border-radius: 10px;
}

/* =========================================================================
   REDUCED MOTION
   ========================================================================= */
@media (prefers-reduced-motion: reduce) {
  .vb-card,
  .vb-card__img,
  .vb-card__play,
  .vb-hero__cta,
  .vb-carousel__track {
    transition: none;
  }
  .vb-carousel__track {
    scroll-behavior: auto;
  }
}
