/* ==========================================================
   ALL VIDEOS SECTION  (all selectors prefixed with .av-)
   Palette taken from style-new.css:
   #604652 plum · #917281 mauve · #B790A2 light mauve
   #E6B65C / #F4D06F gold · #F6F5F2 warm off-white
   Play button uses YouTube red (#FF0000).
   ========================================================== */

.av-section {
  --av-gap: 32px;
  --av-thumb-h: 280px;  /* every thumbnail shares this height; width follows 16:9 / 9:16 */
  background: #F6F5F2;
  padding: 20px 7vw 20px;
  color: #2E2B2B;
  position: relative;
}

.av-header {
  text-align: center;
}

.av-title {
  font-size: 3rem;
  font-weight: 900;
  color: #604652;
  letter-spacing: -1px;
  line-height: 1.2;
  margin-bottom: 12px;
  position: relative;
  display: inline-block;
}

.av-title::after {
  content: '';
  position: absolute;
  left: 50%;
  bottom: -12px;
  transform: translateX(-50%);
  width: 80px;
  height: 4px;
  border-radius: 2px;
  background: linear-gradient(90deg, #604652, #917281, #E6B65C);
}

.av-subtitle {
  font-size: 1.2rem;
  font-weight: 500;
  color: #604652;
  opacity: 0.8;
  margin-top: 28px;
}

/* ---------- Carousel ---------- */
.av-viewport {
  overflow: hidden;
  padding: 36px 0 44px;           /* room for hover lift + shadows */
  -webkit-mask-image: linear-gradient(to right, transparent 0, #000 5%, #000 95%, transparent 100%);
  mask-image: linear-gradient(to right, transparent 0, #000 5%, #000 95%, transparent 100%);
}

.av-track {
  display: flex;
  width: max-content;
  animation: av-scroll var(--av-duration, 40s) linear infinite;
  will-change: transform;
}

@keyframes av-scroll {
  from { transform: translateX(0); }
  to   { transform: translateX(-50%); }
}

/* stop on hover, keyboard focus, or while a video is playing */
.av-viewport:hover .av-track,
.av-viewport:focus-within .av-track,
.av-section.av-paused .av-track {
  animation-play-state: paused;
}

.av-group {
  display: flex;
  align-items: stretch;           /* all cards line up top and bottom, equal height */
  gap: var(--av-gap);
  padding-right: var(--av-gap);   /* keeps group widths identical for a seamless loop */
  list-style: none;
}

.av-item {
  flex: 0 0 auto;
  width: calc(var(--av-thumb-h) * 16 / 9);
  display: flex;
}

.av-item.av-short {
  width: calc(var(--av-thumb-h) * 9 / 16);
}

/* ---------- Card ---------- */
.av-card {
  appearance: none;
  border: 2px solid transparent;
  background: #ffffff;
  padding: 0;
  width: 100%;
  text-align: left;
  cursor: pointer;
  border-radius: 20px;
  overflow: hidden;
  box-shadow: 0 12px 30px rgba(96, 70, 82, 0.15);
  transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
  font-family: 'Montserrat', sans-serif;
  display: flex;
  flex-direction: column;
  height: 100%;
}

.av-card:hover,
.av-card:focus-visible {
  transform: translateY(-10px) scale(1.02);
  box-shadow: 0 20px 50px rgba(96, 70, 82, 0.35);
  border-color: #917281;
}

.av-card:focus-visible {
  outline: 3px solid #E6B65C;
  outline-offset: 4px;
}

.av-thumb {
  position: relative;
  width: 100%;
  aspect-ratio: 16 / 9;
  background: linear-gradient(135deg, #604652 0%, #917281 100%);
  overflow: hidden;
}

.av-short .av-thumb {
  aspect-ratio: 9 / 16;
}

.av-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: transform 0.6s ease;
}

.av-card:hover .av-thumb img {
  transform: scale(1.05);
}

/* soft plum fade so the play icon always reads */
.av-thumb::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(to bottom, rgba(96, 70, 82, 0) 50%, rgba(96, 70, 82, 0.45));
  pointer-events: none;
}

/* thumbnail failed to load: plum gradient tile + play icon remain */
.av-thumb.av-thumb-error img {
  display: none;
}

/* YouTube-red play button */
.av-play {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 68px;
  height: 68px;
  border-radius: 50%;
  background: #FF0000;
  box-shadow: 0 10px 30px rgba(255, 0, 0, 0.4);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 2;
  transition: transform 0.4s ease, box-shadow 0.4s ease, background 0.3s ease;
}

.av-play::before {
  content: '';
  margin-left: 5px;
  border-style: solid;
  border-width: 11px 0 11px 18px;
  border-color: transparent transparent transparent #ffffff;
}

.av-card:hover .av-play,
.av-card:focus-visible .av-play {
  transform: translate(-50%, -50%) scale(1.12);
  background: #CC0000;
  box-shadow: 0 15px 40px rgba(204, 0, 0, 0.55);
}

.av-short .av-play {
  width: 56px;
  height: 56px;
}

.av-short .av-play::before {
  border-width: 9px 0 9px 15px;
}

.av-info {
  flex: 1;
  display: block;
  padding: 20px 22px 22px;
  border-top: 4px solid #604652;
}

.av-card-title {
  display: block;
  font-size: 17px;
  font-weight: 800;
  color: #604652;
  line-height: 1.4;
  letter-spacing: -0.3px;
}

.av-card-title {
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;          /* long YouTube titles stop at 2 lines */
  overflow: hidden;
}

.av-short .av-card-title {
  -webkit-line-clamp: 3;          /* shorts cards are narrower */
}

.av-short .av-info {
  padding: 16px 16px 18px;
}

.av-short .av-card-title {
  font-size: 13px;
  line-height: 1.35;
}

.av-card-cta {
  display: inline-block;
  margin-top: 6px;
  font-size: 13px;
  font-weight: 600;
  color: #917281;
  transition: color 0.3s ease;
}

.av-card:hover .av-card-cta {
  color: #604652;
}

.av-status {
  text-align: center;
  font-size: 14px;
  font-weight: 600;
  color: #604652;
  min-height: 1em;
}

/* ---------- Modal ---------- */
.av-modal {
  position: fixed;
  inset: 0;
  z-index: 9999;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 24px;
  background: rgba(60, 44, 51, 0.88);
}

.av-modal.av-open {
  display: flex;
}

.av-modal-dialog {
  position: relative;
  width: min(960px, 100%);
  background: #000;
  border-radius: 20px;
  border: 3px solid #604652;
  box-shadow: 0 30px 60px rgba(0, 0, 0, 0.5);
}

.av-modal-frame {
  position: relative;
  width: 100%;
  aspect-ratio: 16 / 9;
  border-radius: 17px;
  overflow: hidden;
}

/* portrait player for Shorts, sized to fit the screen height */
.av-modal-short .av-modal-dialog {
  width: min(400px, 100%, calc((100vh - 170px) * 9 / 16));
}

.av-modal-short .av-modal-frame {
  aspect-ratio: 9 / 16;
}

.av-modal-frame iframe {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  border: 0;
}

.av-modal-close {
  position: absolute;
  top: -50px;
  right: 0;
  appearance: none;
  border: 2px solid #F6F5F2;
  background: transparent;
  color: #F6F5F2;
  width: 38px;
  height: 38px;
  border-radius: 50%;
  font-size: 22px;
  line-height: 1;
  cursor: pointer;
  transition: all 0.3s ease;
}

.av-modal-close:hover,
.av-modal-close:focus-visible {
  background: #FF0000;
  border-color: #FF0000;
  color: #ffffff;
  outline: none;
}

.av-modal-link {
  display: block;
  margin-top: 16px;
  padding-bottom: 4px;
  text-align: center;
  font-size: 14px;
  font-weight: 600;
  color: #F4D06F;
  text-decoration: none;
}

.av-modal-link:hover,
.av-modal-link:focus-visible {
  text-decoration: underline;
  outline: none;
}

body.av-no-scroll {
  overflow: hidden;
}

/* ---------- Responsive ---------- */
@media (max-width: 1024px) {
  .av-section {
    --av-thumb-h: 240px;
    --av-gap: 26px;
    padding: 64px 5vw 72px;
  }

  .av-title {
    font-size: 2.5rem;
  }
}

@media (max-width: 768px) {
  .av-section {
    --av-thumb-h: 210px;
    --av-gap: 22px;
    padding: 48px 20px 56px;
  }

  .av-header {
    margin-bottom: 36px;
  }

  .av-title {
    font-size: 2rem;
  }

  .av-subtitle {
    font-size: 1rem;
  }

  .av-card:hover {
    transform: none;
  }
}

@media (max-width: 480px) {
  .av-section {
    --av-thumb-h: 200px;
    --av-gap: 18px;
    padding: 40px 16px 48px;
  }

  .av-title {
    font-size: 1.7rem;
  }

  .av-play {
    width: 56px;
    height: 56px;
  }

  .av-play::before {
    border-width: 9px 0 9px 15px;
  }

  .av-short .av-play {
    width: 46px;
    height: 46px;
  }

  .av-short .av-play::before {
    border-width: 7px 0 7px 12px;
  }

  .av-card-title {
    font-size: 15px;
  }

  .av-short .av-card-title {
    font-size: 12px;
  }

  .av-info {
    padding: 16px 16px 18px;
  }

  .av-modal {
    padding: 12px;
  }

  .av-modal-close {
    top: -46px;
  }
}

/* Reduced motion: no auto-scroll; visitors swipe/scroll the row themselves */
@media (prefers-reduced-motion: reduce) {
  .av-viewport {
    overflow-x: auto;
    -webkit-mask-image: none;
    mask-image: none;
  }

  .av-track {
    animation: none;
  }

  .av-group[aria-hidden="true"] {
    display: none;
  }

  .av-card,
  .av-thumb img,
  .av-play,
  .av-card-cta {
    transition: none;
  }
}