@layer components {
  /* ==========================================================================
   * KairSun Web v5 · Single-Row Shorts Carousel (WS6)
   * All 12 videos in a single horizontal row (flex-wrap: nowrap), ordered
   * newest first, with mouse drag-to-scroll, visible 52px prev/next circular
   * buttons, and counter "1 / 12".
   * ========================================================================== */

  .ks-videos {
    position: relative;
    padding-block: clamp(1.75rem, 3.5vw, 3rem);
  }

  .ks-videos__header {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-end;
    justify-content: space-between;
    gap: 1rem;
    margin-bottom: 1.15rem;
  }

  .ks-videos__heading {
    max-width: 640px;
  }

  .ks-videos__controls {
    display: flex;
    align-items: center;
    gap: 0.75rem;
  }

  .ks-videos__counter {
    font-family: var(--ks-font-mono, "JetBrains Mono", monospace);
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--ks-text-2, #A8B5C8);
    padding: 0.45rem 0.85rem;
    border-radius: 999px;
    background: rgba(15, 22, 36, 0.75);
    border: 1px solid rgba(255, 255, 255, 0.12);
    font-variant-numeric: tabular-nums;
    white-space: nowrap;
  }

  .ks-videos__arrow {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 52px;
    height: 52px;
    border-radius: 999px;
    background: rgba(15, 22, 36, 0.88);
    border: 1px solid rgba(242, 193, 78, 0.42);
    color: var(--ks-text-1, #F4F6FA);
    cursor: pointer;
    box-shadow:
      0 10px 26px rgba(0, 0, 0, 0.42),
      0 0 0 1px rgba(255, 255, 255, 0.04) inset;
    transition:
      transform 180ms cubic-bezier(0.22, 1, 0.36, 1),
      background-color 180ms cubic-bezier(0.22, 1, 0.36, 1),
      border-color 180ms cubic-bezier(0.22, 1, 0.36, 1),
      opacity 180ms ease;
  }

  .ks-videos__arrow:hover:not(:disabled),
  .ks-videos__arrow:focus-visible:not(:disabled) {
    background: rgba(242, 193, 78, 0.18);
    border-color: var(--ks-gold-400, #F2C14E);
    color: #FFFDF7;
    transform: translateY(-2px);
  }

  .ks-videos__arrow:active:not(:disabled) {
    transform: translateY(0) scale(0.96);
  }

  .ks-videos__arrow:disabled,
  .ks-videos__arrow[aria-disabled="true"] {
    opacity: 0.34;
    cursor: not-allowed;
    border-color: rgba(255, 255, 255, 0.12);
  }

  .ks-videos__viewport {
    position: relative;
  }

  .ks-videos__rail {
    display: flex;
    flex-direction: row;
    flex-wrap: nowrap;
    gap: 20px;
    overflow-x: auto;
    overflow-y: hidden;
    scroll-snap-type: x mandatory;
    scroll-padding-inline: 4px;
    padding: 8px 4px 20px;
    scrollbar-width: none;
    -ms-overflow-style: none;
    cursor: grab;
    user-select: none;
    -webkit-overflow-scrolling: touch;
  }

  .ks-videos__rail::-webkit-scrollbar {
    display: none;
  }

  .ks-videos__rail.is-dragging {
    cursor: grabbing;
    scroll-snap-type: none;
    scroll-behavior: auto;
  }

  .ks-videos__rail .ks-video-card {
    flex: 0 0 clamp(236px, 21vw, 264px);
    width: clamp(236px, 21vw, 264px);
    max-width: clamp(236px, 21vw, 264px);
    scroll-snap-align: start;
    display: flex;
    flex-direction: column;
    border-radius: 20px;
    background: linear-gradient(180deg, rgba(15, 22, 36, 0.92), rgba(10, 15, 26, 0.96));
    border: 1px solid rgba(255, 255, 255, 0.1);
    box-shadow: 0 14px 34px rgba(0, 0, 0, 0.38);
    overflow: hidden;
    transition:
      transform 220ms cubic-bezier(0.22, 1, 0.36, 1),
      border-color 220ms cubic-bezier(0.22, 1, 0.36, 1);
  }

  .ks-videos__rail .ks-video-card:hover {
    border-color: rgba(242, 193, 78, 0.35);
    transform: translateY(-3px);
  }

  .ks-videos__rail .ks-media-player {
    position: relative;
    width: 100%;
    height: 250px;
    aspect-ratio: auto;
    background: #050811;
    overflow: hidden;
  }

  .ks-videos__rail .ks-media-player img,
  .ks-videos__rail .ks-media-player iframe {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    pointer-events: none;
  }

  .ks-videos__rail .ks-media-player iframe {
    pointer-events: auto;
    border: 0;
  }

  .ks-videos__rail .ks-video-meta {
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    gap: 0.4rem;
    padding: 0.65rem 0.85rem 0.45rem;
    flex: 1 1 auto;
  }

  .ks-videos__rail .ks-media-kicker {
    font-size: 0.68rem;
    font-weight: 700;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    color: var(--ks-gold-400, #F2C14E);
    margin: 0 0 0.18rem;
  }

  .ks-videos__rail .ks-video-meta h3 {
    font-size: 0.9rem;
    font-weight: 700;
    line-height: 1.22;
    color: var(--ks-text-1, #F4F6FA);
    margin: 0 0 0.22rem;
  }

  .ks-videos__rail .ks-video-meta p {
    font-size: 0.76rem;
    line-height: 1.34;
    color: var(--ks-text-2, #A8B5C8);
    margin: 0;
  }

  .ks-videos__rail .ks-media-channel {
    font-size: 0.74rem;
    min-height: 28px;
    padding: 0;
    margin: 0;
  }

  .ks-videos__rail .ks-video-social-nav {
    padding: 0 0.85rem 0.6rem;
  }

  .ks-videos__rail .ks-video-socials {
    display: flex;
    flex-wrap: nowrap;
    align-items: center;
    gap: 0.35rem;
    list-style: none;
    margin: 0;
    padding: 0;
  }

  .ks-videos__rail .ks-video-socials a {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 30px;
    height: 30px;
    min-height: 30px;
    padding: 0;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: var(--ks-text-2, #A8B5C8);
  }

  .ks-videos__footer {
    margin-top: 1.5rem;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    padding: 1rem 1.25rem;
    border-radius: 20px;
    background: rgba(15, 22, 36, 0.68);
    border: 1px solid rgba(255, 255, 255, 0.08);
  }

  .ks-videos__socials-inline {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.6rem;
    list-style: none;
    margin: 0;
    padding: 0;
  }

  .ks-videos__socials-inline a {
    display: inline-flex;
    align-items: center;
    gap: 0.45rem;
    padding: 0.42rem 0.8rem;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: var(--ks-text-1, #F4F6FA);
    font-size: 0.82rem;
    font-weight: 600;
    text-decoration: none;
    transition: border-color 160ms ease, background-color 160ms ease;
  }

  .ks-videos__socials-inline a:hover {
    border-color: rgba(242, 193, 78, 0.4);
    background: rgba(242, 193, 78, 0.12);
  }
}
