.yt-layout {
  display: grid;
  grid-template-columns: 2fr 1fr;
  gap: 24px;
  align-items: start;
}

.video-wrapper {
  position: relative;
  width: 100%;
  padding-bottom: 56.25%; /* 16:9 ratio */
  height: 0;
}

.video-wrapper iframe,
.video-wrapper div {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  border: 0;
}

.yt-main h3 {
  margin: 20px 0px 10px 0px;
  font-size: 30px;
  font-weight: bold;
}

.video-description {
  font-size: 16px;
  line-height: 1.6;
  padding: 0px 0 20px;
  transition: opacity 0.25s ease;
}

/* Sidebar */
.yt-sidebar {
  max-height: 80vh;
  overflow-y: auto;
  margin: 20px 0 0 0;
}

/* Playlist items */
.playlist-item {
  display: flex;
  gap: 12px;
  padding: 10px;
  border-radius: 10px;
  cursor: pointer;
  transition: all 0.2s ease;
}

.playlist-item:hover {
  background: rgba(0,0,0,0.05);
}

.playlist-item img {
  width: 240px;
  height: auto; /* exact 16:9 */
  object-fit: cover;
  border-radius: 8px;
  flex-shrink: 0;
}

.playlist-item p {
    font-size: 12px;
    margin: 0;
    line-height: 1.5;
    font-weight: bold;
}

/* Active video */
.playlist-item.active {
  background: rgba(0,0,0,0.08);
  font-weight: 600;
  border-left: 3px solid red;
}
/* Scrollbar (optional polish) */
.yt-sidebar::-webkit-scrollbar {
  width: 6px;
}

.yt-sidebar::-webkit-scrollbar-thumb {
  background: rgba(0,0,0,0.2);
  border-radius: 3px;
}

.video-title-text {
  font-size: 25px;
}

.video-date {
  font-size: 13px;
  color: #777;
  margin-top: 4px;
}

.playlist-date {
  display: block;
  font-size: 12px;
  color: #999;
  margin-top: 4px;
}

.live-wrapper {
  padding: 0;
  margin-bottom: 20px;
}

.live-banner {
  color: #d00;
  font-weight: 700;
  font-size: 13px;
  margin-bottom: 6px;
  margin-top: 15px;
}

.live-title {
  font-size: 14px;
  margin-top: 6px;
}

.yt-live-only {
  width: 100%;
  height: 400px;
}

.live-placeholder {
  padding: 40px;
  text-align: center;
  background: #111;
  color: #fff;
  border-radius: 8px;
}

.live-offline {
  font-size: 20px;
  margin-bottom: 10px;
}

.yt-card-link {
  text-decoration: none;
  color: inherit;
}

.yt-card {
  display: flex;
  gap: 16px;
  border-radius: 12px;
  overflow: hidden;
  border: 1px solid #e5e5e5;
  transition: 0.2s ease;
  background: #fff;
}

.yt-card:hover {
  transform: translateY(-3px);
  box-shadow: 0 8px 20px rgba(0,0,0,0.08);
}

.yt-card img {
  width: 200px;
  height: 112px;
  object-fit: cover;
}

.yt-card-content {
  padding: 14px;
}

.yt-card-content h3 {
    margin: 0 0 6px;
    font-size: 18px;
    font-weight: 900;
    color: #000;
}

.yt-card-content p {
    font-size: 13px;
    font-weight: 600;
    color: #000;
}

.yt-date {
  font-size: 12px;
  color: #888;
  margin-bottom: 8px;
}


/* tablet */
@media (max-width: 1240px) {
  .playlist-item img {
    width: 90px;
    height: 50px;
  }
}

/* Mobile */
@media (max-width: 900px) {
  .yt-card {flex-flow: row wrap; margin: 0 30px;}
  .yt-card img {width: 100%;}

  .yt-layout {
    grid-template-columns: 1fr;
  }
  .playlist-item img {
    width: 90px;
    height: 50px;
  }
  .yt-sidebar {
    max-height: none;
  }
}


/* 📱 iPhone / Mobile Fix Layer */
@media (max-width: 768px) {

  /* Force full single column cleanly */
  .yt-layout {
    display: block;
  }

  /* Main video spacing */
  .yt-main h3,
  .video-title-text {
    font-size: 18px;
    margin: 10px 0;
  }

  .video-description {
    font-size: 14px;
    padding: 10px 0;
  }

  /* Kill sidebar scroll issues on iOS */
  .yt-sidebar {
    max-height: none;
    overflow: visible;
    margin-top: 15px;
  }

  /* Playlist items tighter + cleaner */
  .playlist-item {
    padding: 8px;
    gap: 10px;
  }

  .playlist-item img {
    width: 90px;
    height: 50px;
  }

  .playlist-item p {
    font-size: 13px;
  }

  /* Card fix */
  .yt-card {
    flex-flow: column;
    margin: 0;
  }

  .yt-card img {
    width: 100%;
    height: auto;
  }

  /* Live player fix */
  .yt-live-only {
    height: 220px;
  }

  /* Prevent overflow bugs */
  .video-wrapper {
    border-radius: 8px;
    overflow: hidden;
  }
}