/* ==============================================
   ENW YouTube Gallery — Widget Elementor
   Player + Playlist lateral responsivo
   ============================================== */

.enwyg-wrap {
  --enwyg-red:      #e50000;
  --enwyg-black:    #111111;
  --enwyg-gray:     #666666;
  --enwyg-border:   #e0e0e0;
  --enwyg-font:     'DM Sans', 'Helvetica Neue', Arial, sans-serif;
  --enwyg-ease:     cubic-bezier(0.4, 0, 0.2, 1);

  font-family: var(--enwyg-font);
  background: #ffffff;
  padding: 32px 0 40px;
}

/* ═══════════════════════════════════════════
   CABEÇALHO
   ═══════════════════════════════════════════ */
.enwyg-header {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 20px;
  flex-wrap: wrap;
}

.enwyg-section-title {
  /* Defaults — Tipografia pelo Elementor */
  font-family: var(--enwyg-font);
  font-size: 32px;
  font-weight: 900;
  letter-spacing: -0.01em;
  text-transform: uppercase;
  color: var(--enwyg-black);
  margin: 0;
  padding: 0;
  line-height: 1;
}

.enwyg-channel-link {
  /* Defaults — Tipografia pelo Elementor */
  font-family: var(--enwyg-font);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  text-decoration: none;
  color: var(--enwyg-red);
  white-space: nowrap;
  transition: opacity 0.2s;
}
.enwyg-channel-link:hover { opacity: 0.6; }

/* ═══════════════════════════════════════════
   GRID
   ═══════════════════════════════════════════ */
.enwyg-grid {
  display: flex;
  align-items: flex-start;
  gap: 24px;
}

/* ═══════════════════════════════════════════
   PLAYER
   ═══════════════════════════════════════════ */
.enwyg-player-col {
  flex: 0 0 68%;
  min-width: 0;
}

.enwyg-player-wrap {
  position: relative;
  width: 100%;
  height: 0;
  /* padding-bottom definido via prop pelo controle de ratio */
  padding-bottom: 56.25%;
  background: #000;
  border-radius: 6px;
  overflow: hidden;
}

.enwyg-iframe {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  border: 0;
  display: block;
}

/* Info abaixo do player */
.enwyg-now-info {
  margin-top: 14px;
}

.enwyg-now-title {
  /* Defaults — Tipografia pelo Elementor */
  font-family: var(--enwyg-font);
  font-size: 17px;
  font-weight: 700;
  line-height: 1.3;
  color: var(--enwyg-black);
  margin: 0 0 6px 0;
  padding: 0;
}

.enwyg-now-meta {
  /* Defaults — Tipografia pelo Elementor */
  font-family: var(--enwyg-font);
  font-size: 12px;
  color: var(--enwyg-gray);
  margin: 0;
  padding: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  align-items: center;
}
.enwyg-now-sep { opacity: 0.5; }

/* ═══════════════════════════════════════════
   PLAYLIST LATERAL
   ═══════════════════════════════════════════ */
.enwyg-playlist {
  flex: 1;
  min-width: 0;
  max-height: 480px;       /* altura máxima com scroll */
  overflow-y: auto;
  background: #f7f7f7;
  border-radius: 6px;
  scrollbar-width: thin;
  scrollbar-color: #ccc transparent;
}

.enwyg-playlist::-webkit-scrollbar      { width: 4px; }
.enwyg-playlist::-webkit-scrollbar-thumb { background: #ccc; border-radius: 2px; }

/* Item da playlist */
.enwyg-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 14px;
  cursor: pointer;
  border-left: 3px solid transparent;
  border-top: 1px solid var(--enwyg-border);
  transition: background 0.18s var(--enwyg-ease), border-color 0.18s;
  user-select: none;
  outline: none;
}

.enwyg-item:first-child { border-top: none; }

.enwyg-item:not(.is-active):hover { background: #eeeeee; }

.enwyg-item.is-active {
  background: #ffffff;
  border-left-color: var(--enwyg-red);
}

.enwyg-item:focus-visible { outline: 2px solid var(--enwyg-red); outline-offset: -2px; }

/* Número */
.enwyg-num {
  /* Defaults — Tipografia pelo Elementor */
  flex-shrink: 0;
  font-family: var(--enwyg-font);
  font-size: 12px;
  font-weight: 500;
  color: #bbbbbb;
  width: 18px;
  text-align: center;
  line-height: 1;
}

.enwyg-item.is-active .enwyg-num {
  color: var(--enwyg-red);
}

/* Thumbnail */
.enwyg-thumb-wrap {
  position: relative;
  flex-shrink: 0;
  width: 120px;
  height: 68px;
  border-radius: 4px;
  overflow: hidden;
  background: #1a1a1a;
}

.enwyg-thumb {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: opacity 0.2s;
}

.enwyg-item:hover .enwyg-thumb { opacity: 0.85; }

.enwyg-play-icon {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  color: #ffffff;
  opacity: 0;
  background: rgba(0,0,0,0.35);
  transition: opacity 0.18s;
  pointer-events: none;
}

.enwyg-item:hover .enwyg-play-icon,
.enwyg-item.is-active .enwyg-play-icon { opacity: 1; }

/* Texto do item */
.enwyg-item-info { flex: 1; min-width: 0; }

.enwyg-item-title {
  /* Defaults — Tipografia pelo Elementor */
  font-family: var(--enwyg-font);
  font-size: 13px;
  font-weight: 600;
  line-height: 1.35;
  color: var(--enwyg-black);
  margin: 0 0 4px 0;
  padding: 0;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.enwyg-item-channel {
  /* Defaults — Tipografia pelo Elementor */
  font-family: var(--enwyg-font);
  font-size: 11px;
  color: #888888;
  margin: 0;
  padding: 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* ═══════════════════════════════════════════
   RESPONSIVO — TABLET (≤ 1024px)
   ═══════════════════════════════════════════ */
@media (max-width: 1024px) {
  .enwyg-player-col  { flex: 0 0 58%; }
  .enwyg-section-title { font-size: 26px; }
  .enwyg-thumb-wrap  { width: 96px; height: 54px; }
  .enwyg-playlist    { max-height: 380px; }
}

/* ═══════════════════════════════════════════
   RESPONSIVO — MOBILE (≤ 767px)
   ═══════════════════════════════════════════ */
@media (max-width: 767px) {
  .enwyg-grid { flex-direction: column; }

  .enwyg-player-col { flex: none; width: 100%; }

  .enwyg-playlist {
    width: 100%;
    max-height: 360px;
  }

  .enwyg-section-title { font-size: 22px; }

  .enwyg-thumb-wrap { width: 88px; height: 50px; }
  .enwyg-item       { padding: 10px 12px; gap: 10px; }
}

/* ═══════════════════════════════════════════
   RESPONSIVO — MOBILE PEQUENO (≤ 480px)
   ═══════════════════════════════════════════ */
@media (max-width: 480px) {
  .enwyg-num        { display: none; }
  .enwyg-thumb-wrap { width: 72px; height: 40px; }
  .enwyg-item-title { font-size: 12px; }
}

/* ═══════════════════════════════════════════
   ANIMAÇÃO DE ENTRADA
   ═══════════════════════════════════════════ */
@keyframes enwyg-fade {
  from { opacity: 0; transform: translateY(10px); }
  to   { opacity: 1; transform: translateY(0); }
}

.enwyg-player-col { animation: enwyg-fade 0.4s ease both; }
.enwyg-playlist   { animation: enwyg-fade 0.45s 0.07s ease both; }

@media (prefers-reduced-motion: reduce) {
  .enwyg-player-col,
  .enwyg-playlist { animation: none !important; }
}
