.ytpl-wrap {
  width: 100%;
  display: grid;
  gap: 16px;
}

.ytpl-iframe-wrap {
  position: relative;
  width: 100%;
  padding-top: 56.25%;
  background: #000;
  border-radius: 12px;
  overflow: hidden;
}

.ytpl-iframe {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
}

.ytpl-featured-title {
  margin-top: 10px;
  font-weight: 600;
  line-height: 1.3;
  font-size: 30px;
  margin-bottom: 20px;
}

.ytpl-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
}

@media (max-width: 1024px) {
  .ytpl-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
@media (max-width: 700px) {
  .ytpl-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .ytpl-featured-title {
    font-size: 20px;
  }
}

.ytpl-thumb {
  text-align: left;
  border: 1px solid rgba(0,0,0,0.08);
  border-radius: 12px;
  padding: 10px;
  background: #333;
  cursor: pointer;
  display: grid;
  gap: 8px;
  transition: transform 120ms ease, box-shadow 120ms ease, border-color 120ms ease;
}

.ytpl-thumb:hover {
  transform: translateY(-1px);
  box-shadow: 0 8px 20px rgba(0,0,0,0.08);
}

.ytpl-thumb.is-active {
  border-color: rgba(0,0,0,0.25);
  box-shadow: 0 10px 26px rgba(0,0,0,0.12);
  background: #05e502;
}

button.ytpl-thumb.is-active .ytpl-thumb-title {
    color: #000;
    font-weight: bold;
}

.ytpl-thumb-img {
  position: relative;
  border-radius: 10px;
  overflow: hidden;
  background: #111;
}

.ytpl-thumb-img img {
  width: 100%;
  height: auto;
  display: block;
}

.ytpl-thumb-play {
  position: absolute;
  inset: auto auto 10px 10px;
  width: 34px;
  height: 34px;
  border-radius: 999px;
  background: rgba(0,0,0,0.65);
}

.ytpl-thumb-play::before {
  content: "";
  position: absolute;
  inset: 0;
  margin: auto;
  width: 0;
  height: 0;
  border-left: 10px solid #fff;
  border-top: 7px solid transparent;
  border-bottom: 7px solid transparent;
  left: 4px;
  top: 1px;
}

.ytpl-thumb-title {
  font-size: 14px;
  line-height: 1.25;
  max-height: 2.5em;
  overflow: hidden;
  color: #fff;
}

.ytpl-error {
  padding: 12px 14px;
  border: 1px solid rgba(255,0,0,0.2);
  background: rgba(255,0,0,0.05);
  border-radius: 10px;
}


/* Jannah: remove EXTRA GAP above the module, but keep the 16:9 player height */
.entry-content .ytpl-wrap {
  margin-top: 0 !important;
}

/* If Jannah adds margin to iframes/images inside content */
.entry-content .ytpl-player {
  margin-top: 0 !important;
}

/* Use modern aspect-ratio instead of padding-top hack */
.entry-content .ytpl-iframe-wrap{
  position: relative;
  width: 100%;
  aspect-ratio: 16 / 9;
  padding-top: 0 !important; /* prevent the 56.25% gap */
  height: auto !important;
  overflow: hidden;
}

.entry-content .ytpl-iframe{
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  display: block;
  margin: 0 !important;
}


/* Kill empty paragraphs/spacers right above the shortcode output */
.entry-content p:empty {
  display: none;
}
.entry-content p:has(br):empty {
  display: none;
}
