/* ===========================================================================
 * /canal-youtube/ — visual estilo YouTube, no design system Treasy.
 * Depende dos tokens de cor de ../assets/css/styles.css (--teal, --ink, etc.).
 * =========================================================================== */

.canal { max-width: 1280px; margin: 0 auto; padding: 0 24px 96px; }

/* ── Cabeçalho do canal ───────────────────────────────────────────────── */
.ch-banner {
  height: 160px; border-radius: 16px; margin-top: 20px;
  background: linear-gradient(115deg, #0b3b35 0%, var(--teal) 48%, var(--teal-light) 100%);
  position: relative; overflow: hidden;
}
.ch-banner::after { /* textura sutil */
  content: ""; position: absolute; inset: 0;
  background: radial-gradient(circle at 85% 20%, rgba(255,255,255,.16), transparent 42%);
}
.ch-banner-word {
  position: absolute; right: 28px; bottom: 18px; color: rgba(255,255,255,.92);
  font-family: "DM Serif Display", Georgia, serif; font-size: 1.6rem; letter-spacing: .3px;
}
.ch-head { display: flex; align-items: center; gap: 22px; padding: 22px 4px 6px; }
.ch-avatar {
  width: 112px; height: 112px; border-radius: 50%; flex-shrink: 0;
  background: #fff; border: 1px solid var(--border-lt);
  display: grid; place-items: center; box-shadow: 0 4px 18px rgba(28,128,119,.12);
}
.ch-avatar img { width: 74px; object-fit: contain; }
.ch-meta { min-width: 0; }
.ch-name { font-family: "DM Serif Display", Georgia, serif; font-size: 1.9rem; color: var(--ink); line-height: 1.1; }
.ch-sub { color: var(--muted); font-size: .9rem; margin-top: 6px; }
.ch-sub b { color: var(--ink-mid); font-weight: 600; }
.ch-desc { color: var(--muted); font-size: .9rem; margin-top: 8px; line-height: 1.5; }
.ch-actions { margin-top: 14px; display: flex; gap: 10px; align-items: center; }
.ch-subscribe {
  background: var(--ink); color: #fff; border: none; border-radius: 999px;
  padding: 9px 20px; font: 600 .9rem/1 "DM Sans", sans-serif; cursor: pointer;
  text-decoration: none; display: inline-flex; align-items: center; gap: 8px;
  transition: opacity .15s;
}
.ch-subscribe:hover { opacity: .85; }
.ch-subscribe svg { width: 18px; height: 18px; }

/* ── Aviso "sem distrações" ───────────────────────────────────────────── */
.ch-focus {
  margin: 10px 4px 0; padding: 9px 16px; border-radius: 10px;
  background: var(--teal-pale); color: var(--ink-mid); font-size: .82rem;
  display: inline-flex; align-items: center; gap: 8px;
}
.ch-focus svg { width: 16px; height: 16px; color: var(--teal); flex-shrink: 0; }

/* ── Abas (pílulas) ───────────────────────────────────────────────────── */
.ch-tabs {
  display: flex; gap: 10px; overflow-x: auto; padding: 14px 4px 12px;
  border-bottom: 1px solid var(--border-lt); margin-top: 6px;
  scrollbar-width: none;
  /* gruda logo abaixo do menu (nav sticky = 64px) ao rolar */
  position: sticky; top: 64px; z-index: 50; background: var(--bg);
}
.ch-tabs::-webkit-scrollbar { display: none; }
.ch-tab {
  flex-shrink: 0; border: none; cursor: pointer; white-space: nowrap;
  background: #eef3f1; color: var(--ink-mid); border-radius: 999px;
  padding: 8px 15px; font: 500 .87rem/1 "DM Sans", sans-serif; transition: all .15s;
}
.ch-tab:hover { background: #e2ebe8; }
.ch-tab.is-active { background: var(--ink); color: #fff; }

/* ── Prateleiras ──────────────────────────────────────────────────────── */
.shelf { padding-top: 30px; }
.shelf-head { display: flex; align-items: baseline; justify-content: space-between; gap: 16px; margin-bottom: 14px; }
.shelf-title { font-family: "DM Serif Display", Georgia, serif; font-size: 1.35rem; color: var(--ink); }
.shelf-desc { color: var(--muted); font-size: .85rem; margin-top: 2px; }
.shelf-more { color: var(--teal); font-size: .82rem; font-weight: 600; text-decoration: none; white-space: nowrap; cursor: pointer; }
.shelf-more:hover { text-decoration: underline; }

/* fileira horizontal com snap, estilo YouTube */
.shelf-rowwrap { position: relative; }
.shelf-row {
  display: grid; grid-auto-flow: column; grid-auto-columns: 300px; gap: 16px;
  overflow-x: auto; scroll-behavior: smooth; scroll-snap-type: x proximity;
  padding-bottom: 6px; scrollbar-width: none;
}
.shelf-row::-webkit-scrollbar { display: none; }
.shelf-row > * { scroll-snap-align: start; }

/* layout em grade (quando uma aba está selecionada — mostra tudo) */
.shelf-grid .shelf-row {
  grid-auto-flow: row; grid-auto-columns: auto;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  overflow: visible; row-gap: 30px;
}
.shelf-grid .shelf-arrow { display: none; }

.shelf-arrow {
  position: absolute; top: calc((300px * 9 / 16) / 2 - 20px); z-index: 3;
  width: 40px; height: 40px; border-radius: 50%; border: 1px solid var(--border-lt);
  background: #fff; color: var(--ink); cursor: pointer; display: grid; place-items: center;
  box-shadow: 0 2px 10px rgba(0,0,0,.12); transition: opacity .15s; font-size: 1.1rem;
}
.shelf-arrow:hover { background: var(--bg); }
.shelf-arrow.prev { left: -14px; }
.shelf-arrow.next { right: -14px; }
.shelf-arrow[disabled] { opacity: 0; pointer-events: none; }

/* ── Card de vídeo ────────────────────────────────────────────────────── */
.vcard { display: block; text-decoration: none; color: inherit; }
.vcard-thumb {
  position: relative; aspect-ratio: 16 / 9; border-radius: 12px; overflow: hidden;
  background: #dfe7e4;
}
.vcard-thumb img { width: 100%; height: 100%; object-fit: cover; display: block; transition: transform .25s; }
.vcard:hover .vcard-thumb img { transform: scale(1.04); }
.vcard-dur {
  position: absolute; right: 8px; bottom: 8px; background: rgba(0,0,0,.82); color: #fff;
  font: 600 .72rem/1 "DM Sans", sans-serif; padding: 3px 5px; border-radius: 5px;
}
.vcard-play {
  position: absolute; inset: 0; display: grid; place-items: center;
  background: rgba(11,40,36,.28); opacity: 0; transition: opacity .2s;
}
.vcard:hover .vcard-play { opacity: 1; }
.vcard-play span {
  width: 52px; height: 52px; border-radius: 50%; background: rgba(255,255,255,.92);
  display: grid; place-items: center; color: var(--teal); padding-left: 4px;
}
.vcard-body { padding: 11px 2px 0; }
.vcard-title {
  font: 600 .95rem/1.32 "DM Sans", sans-serif; color: var(--ink);
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
.vcard:hover .vcard-title { color: var(--teal-mid); }
.vcard-meta { color: var(--muted); font-size: .82rem; margin-top: 5px; }
.vcard-guest { color: var(--muted-light); font-size: .8rem; margin-top: 2px; }

/* ════════════════════════════════════════════════════════════════════════
 * PÁGINA DE PLAYER (/canal-youtube/assistir/?v=ID)
 * ════════════════════════════════════════════════════════════════════════ */
.watch { max-width: 1280px; margin: 0 auto; padding: 22px 24px 96px; }
.watch-back { color: var(--muted); font-size: .85rem; text-decoration: none; display: inline-flex; align-items: center; gap: 6px; margin-bottom: 16px; }
.watch-back:hover { color: var(--teal); }
.watch-grid { display: grid; grid-template-columns: 1fr 388px; gap: 28px; align-items: start; }

.player-box { position: relative; aspect-ratio: 16 / 9; border-radius: 14px; overflow: hidden; background: #000; }
.player-box iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }

.watch-title { font-family: "DM Serif Display", Georgia, serif; font-size: 1.6rem; color: var(--ink); line-height: 1.18; margin-top: 18px; }
.watch-channel { display: flex; align-items: center; gap: 12px; margin-top: 16px; padding-bottom: 16px; border-bottom: 1px solid var(--border-lt); }
.watch-channel .ch-avatar { width: 46px; height: 46px; box-shadow: none; }
.watch-channel .ch-avatar img { width: 30px; }
.watch-cname { font-weight: 600; color: var(--ink); font-size: .95rem; }
.watch-csub { color: var(--muted); font-size: .8rem; }
.watch-channel .ch-subscribe { margin-left: auto; }

.watch-desc { background: var(--teal-xpale); border: 1px solid var(--border-lt); border-radius: 12px; padding: 14px 16px; margin-top: 18px; }
.watch-desc-meta { font-weight: 600; color: var(--ink-mid); font-size: .85rem; }
.watch-desc-text { color: var(--ink-soft); font-size: .9rem; line-height: 1.6; margin-top: 6px; }

/* ── View central do post, abaixo do vídeo ──────────────────────────────── */
.watch-article { margin-top: 28px; }
.watch-article[hidden] { display: none; }
.wa-divider { height: 1px; background: var(--border-lt); margin: 8px 0 22px; }
.wa-eyebrow { font: 600 .72rem/1 "DM Sans", sans-serif; text-transform: uppercase; letter-spacing: .12em; color: var(--teal); margin-bottom: 16px; }
/* o artigo injetado reusa .post-body/.post-tldr/.post-faq de styles.css; aqui só
   liberamos as restrições de layout da coluna do blog para ele fluir nesta coluna */
.watch-article article.blog-main { width: auto; max-width: none; margin: 0; padding: 0; }
.watch-article .post-body > :first-child { margin-top: 0; }

/* coluna lateral — só conteúdo da mesma série/categoria (sem buraco de coelho) */
.related-title { font-weight: 600; color: var(--ink); font-size: 1rem; margin-bottom: 14px; }
.rcard { display: flex; gap: 11px; text-decoration: none; color: inherit; margin-bottom: 14px; }
.rcard-thumb { position: relative; width: 168px; flex-shrink: 0; aspect-ratio: 16/9; border-radius: 9px; overflow: hidden; background: #dfe7e4; }
.rcard-thumb img { width: 100%; height: 100%; object-fit: cover; }
.rcard-thumb .vcard-dur { right: 5px; bottom: 5px; font-size: .66rem; }
.rcard-info { min-width: 0; }
.rcard-title { font: 600 .86rem/1.3 "DM Sans", sans-serif; color: var(--ink); display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.rcard:hover .rcard-title { color: var(--teal-mid); }
.rcard-meta { color: var(--muted); font-size: .76rem; margin-top: 4px; }
.rcard.is-current { background: var(--teal-pale); border-radius: 10px; padding: 8px; margin: -8px -8px 6px; }
.rcard.is-current .rcard-title { color: var(--teal); }

/* CTA de trial na lateral */
.cta-card { margin-top: 26px; background: linear-gradient(135deg, var(--teal) 0%, var(--teal-mid) 100%); color: #fff; border-radius: 14px; padding: 22px; }
.cta-card h3 { font-family: "DM Serif Display", Georgia, serif; font-size: 1.25rem; line-height: 1.2; }
.cta-card p { font-size: .88rem; line-height: 1.55; color: rgba(255,255,255,.9); margin-top: 8px; }
.cta-card a { display: inline-flex; margin-top: 14px; background: #fff; color: var(--teal); font-weight: 600; font-size: .88rem; padding: 10px 18px; border-radius: 999px; text-decoration: none; }
.cta-card a:hover { background: rgba(255,255,255,.9); }

.watch-empty { text-align: center; padding: 80px 20px; color: var(--muted); }
.watch-empty a { color: var(--teal); font-weight: 600; }

/* ── Abas YouTube: grade do feed, chips de ordenação, shorts, playlists ── */

.feed-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(290px, 1fr)); gap: 16px; row-gap: 30px; padding-top: 8px; }
.feed-grid--shorts { grid-template-columns: repeat(auto-fill, minmax(168px, 1fr)); }

.sub-chips { display: flex; gap: 9px; padding: 16px 2px 2px; flex-wrap: wrap; }
.sub-chip { border: none; cursor: pointer; background: #eef3f1; color: var(--ink-mid); border-radius: 999px; padding: 7px 14px; font: 500 .85rem/1 "DM Sans", sans-serif; transition: all .15s; }
.sub-chip:hover { background: #e2ebe8; }
.sub-chip.is-active { background: var(--ink); color: #fff; }

.vcard-live { background: #c4302b; }

/* Short — card vertical 9:16 */
.scard { display: block; text-decoration: none; color: inherit; }
.scard-thumb { position: relative; aspect-ratio: 9 / 16; border-radius: 12px; overflow: hidden; background: #dfe7e4; }
/* aspect-ratio na própria img preenche a caixa vertical (height:100% não resolve contra pai aspect-ratio) */
.scard-thumb img { width: 100%; aspect-ratio: 9 / 16; height: auto; object-fit: cover; display: block; transition: transform .25s; }
.scard:hover .scard-thumb img { transform: scale(1.04); }
.scard-title { font: 600 .9rem/1.3 "DM Sans", sans-serif; color: var(--ink); margin-top: 9px; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.scard:hover .scard-title { color: var(--teal-mid); }

/* Playlist — card com contagem e efeito empilhado */
.plcard { display: block; text-decoration: none; color: inherit; }
.plcard-thumb { position: relative; aspect-ratio: 16 / 9; border-radius: 12px; overflow: hidden; background: #dfe7e4; box-shadow: 5px -5px 0 -1px #fff, 6px -6px 0 0 var(--border-lt); }
.plcard-thumb img { width: 100%; height: 100%; object-fit: cover; display: block; transition: transform .25s; }
.plcard:hover .plcard-thumb img { transform: scale(1.04); }
.plcard-count { position: absolute; right: 0; bottom: 0; top: 0; width: 42%; background: rgba(0,0,0,.72); color: #fff; font: 600 .82rem/1.2 "DM Sans", sans-serif; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px; }
.plcard .vcard-title { margin-top: 11px; }

/* Estados vazios / navegação */
.feed-empty { text-align: center; color: var(--muted); padding: 64px 20px; }
.feed-empty-link { display: inline-block; margin-top: 10px; color: var(--teal); font-weight: 600; text-decoration: none; }
.feed-back { display: inline-block; color: var(--muted); font-size: .9rem; text-decoration: none; margin: 6px 0 14px; }
.feed-back:hover { color: var(--teal); }
#canal-feed > .shelf-title { padding-top: 14px; }

/* ── Responsivo ───────────────────────────────────────────────────────── */
@media (max-width: 1024px) {
  .watch-grid { grid-template-columns: 1fr; }
}
@media (max-width: 720px) {
  .canal, .watch { padding-left: 14px; padding-right: 14px; }
  .ch-head { flex-direction: column; align-items: flex-start; gap: 14px; }
  .ch-avatar { width: 84px; height: 84px; }
  .ch-avatar img { width: 56px; }
  .ch-name { font-size: 1.5rem; }
  .shelf-row { grid-auto-columns: 78vw; }
  .shelf-arrow { display: none; }
  .watch-title { font-size: 1.3rem; }
  .rcard-thumb { width: 132px; }
}
