/* ============================================================
   RaceLink — tablet (≥768) e desktop (≥1024).
   Tudo aqui é aditivo: nenhuma regra mobile é sobrescrita fora
   destas media queries. Custom property NÃO funciona em @media,
   por isso os valores estão em px literal.
   ============================================================ */

/* ---------- tablet ---------- */
@media (min-width: 768px) {
  :root { --gut: 26px; }

  .app { width: 100%; max-width: 100%; }
  .feed { padding-bottom: calc(var(--safe-b) + var(--nav-h) + 64px); }

  .shell { width: min(100%, var(--shell-w)); margin-inline: auto; }
  .app { background: transparent; }

  .vgrid { grid-template-columns: repeat(auto-fill, minmax(min(100%, 230px), 1fr)); gap: 18px 14px; }
  .sgrid { grid-template-columns: repeat(auto-fill, minmax(min(100%, 150px), 1fr)); }
  .cgrid { grid-template-columns: repeat(auto-fill, minmax(min(100%, 180px), 1fr)); }
  .cgrid.cgrid-cover { grid-template-columns: repeat(auto-fill, minmax(min(100%, 250px), 1fr)); gap: 18px; }
  .cgrid.cgrid-cover .ccard { min-height: 190px; }
  .pgrid { grid-template-columns: repeat(auto-fill, minmax(min(100%, 110px), 1fr)); }

  .hero { padding: 30px 34px; }
  .hero h2 { font-size: 30px; }

  /* Destaque com peso: 2x2 na grade. O thumb precisa esticar em vez de
     manter 16/9, senão sobra altura e a meta descola dos vizinhos. */
  .vgrid.feat .vcard.big { grid-column: span 2; grid-row: span 2;
    display: flex; flex-direction: column; }
  .vgrid.feat .vcard.big .vthumb { flex: 1; aspect-ratio: auto; min-height: 0; }
  .vgrid.feat .vcard.big .vmeta { flex: none; }
  .vgrid.feat .vcard.big .vmeta .t { font-size: 17px; -webkit-line-clamp: 2; }
  .vgrid.feat .vcard.big .vmeta .m { font-size: 12.5px; }
  .vgrid.feat .vcard.big .vmeta .vbar { max-width: 320px; }
}

/* ---------- desktop ---------- */
@media (min-width: 1024px) {
  :root { --gut: 24px; }

  /* a navegação mobile dá lugar ao header próprio */
  .topbar, .nav, .navfade { display: none; }

  /* conteúdo numa coluna centrada em vez de sangrar até a borda da tela */
  .feed { width: min(100%, var(--shell-w)); margin-inline: auto; padding-bottom: 80px;
    background: var(--bg); }

  .vgrid { grid-template-columns: repeat(auto-fill, minmax(min(100%, 290px), 1fr)); gap: 32px 8px; }
  .sgrid { grid-template-columns: repeat(auto-fill, minmax(min(100%, 200px), 1fr)); gap: 16px; }

  /* carrosséis viram grade: no mouse não há swipe */
  .vstrip, .sstrip, .pstrip, .bstrip {
    display: grid; overflow: visible;
    grid-template-columns: repeat(auto-fill, minmax(min(100%, 290px), 1fr));
    gap: 32px 8px;
  }
  .sstrip { grid-template-columns: repeat(auto-fill, minmax(min(100%, 200px), 1fr)); }
  .pstrip { grid-template-columns: repeat(auto-fill, minmax(min(100%, 110px), 1fr)); }
  .vstrip > .vcard, .sstrip > .scard, .pstrip > .pcard, .bstrip > .bmini { width: auto; }

  /* carrossel arrastável (Continue assistindo): volta a ser faixa horizontal */
  .vstrip.dragstrip {
    display: flex; overflow-x: auto; grid-template-columns: none; gap: 16px;
    scroll-snap-type: x proximity; cursor: grab; scrollbar-width: none;
    scroll-padding-left: var(--gut);
  }
  .vstrip.dragstrip::-webkit-scrollbar { display: none; }
  .vstrip.dragstrip.grabbing { cursor: grabbing; scroll-snap-type: none; }
  .vstrip.dragstrip > .vcard {
    flex: none; width: clamp(230px, 22vw, 280px); scroll-snap-align: start;
  }
  .vstrip.dragstrip.grabbing a { pointer-events: none; }

  .shead { padding-top: 30px; }
  .vmeta .t { font-size: 18px; font-weight: 700; }
  .vmeta .byline { font-size: 14px; }
}

/* ============================================================
   Header de desktop — só existe acima de 1024px.
   ============================================================ */
.dhead { display: none; }

@media (min-width: 1024px) {
  .dhead {
    display: block; position: sticky; top: 0; z-index: 50;
    background: var(--header);
    border-bottom: 1px solid var(--line-2);
  }
  /* barra superior — cores exatas da networkbar do Pornhub
     (mainBg #000, tabColor #C6C6C6, tabHoverColor #fff, tabHoverBg #333) */
  .dtopbar { background: #000; }
  .dtopbar-in { display: flex; align-items: center; justify-content: center; gap: 0;
    min-height: 22px; padding: 0 var(--gut); overflow-x: auto; scrollbar-width: none; }
  .dtopbar-in::-webkit-scrollbar { display: none; }
  .dtop-l { flex: none; padding: 5px 24px; font-size: 11px; font-weight: 400;
    text-transform: uppercase; color: #C6C6C6; white-space: nowrap;
    transition: color .12s ease, background .12s ease; }
  .dtop-l:hover { color: #fff; background: #333; }

  .dhead-in { display: flex; align-items: center; gap: 13px; padding: 8px var(--gut); }
  .dburger { flex: none; width: 34px; height: 34px; display: grid; place-items: center;
    color: var(--acc); }
  .dburger .mi { font-size: 26px; }
  .dic.sm { width: 30px; height: 30px; color: var(--acc); }
  .dic.sm .mi { font-size: 19px; }
  .dcta { flex: none; margin-left: 6px; font-size: 12px; letter-spacing: .02em; }
  .dhead .logo { font-size: 23px; flex: none; }

  .dsearch {
    flex: 1; max-width: 522px; display: flex; align-items: center; gap: 8px;
    height: 37px; padding: 0 12px; border-radius: 20px;
    background: var(--input); border: 0;
    transition: border-color .18s var(--ease), background .18s var(--ease);
  }
  .dsearch:focus-within { border-color: var(--acc-line); background: var(--surface-3); }
  .dsearch .mi { font-size: 19px; color: var(--txt-3); }
  .dsearch input {
    flex: 1; min-width: 0; background: none; border: 0; outline: none;
    font-size: 14px; color: var(--txt);
  }
  .dsearch .mi { font-size: 18px }
  .dsearch input::placeholder { color: var(--txt-3); }

  /* ---------- painel da busca ---------- */
  .dsearch-wrap { position: relative; flex: 1; max-width: 522px; }
  .dsearch-wrap .dsearch { max-width: none; width: 100%; }
  .dsearch-x { display: grid; place-items: center; width: 22px; height: 22px; border-radius: 50%;
    color: var(--txt-3); transition: background .14s var(--ease), color .14s var(--ease); }
  .dsearch-x:hover { background: var(--surface-3); color: #fff; }
  .dsearch-x .mi { font-size: 16px; }

  .dsug {
    position: absolute; top: calc(100% + 8px); left: 0; right: 0; z-index: 70;
    background: #151515; border: 1px solid var(--line);
    border-radius: 12px; box-shadow: 0 24px 50px rgba(0,0,0,.7);
    opacity: 0; transform: translateY(-6px);
    transition: opacity .16s var(--ease), transform .18s var(--ease);
  }
  .dsug.on { opacity: 1; transform: translateY(0); }
  .dsug-in { display: flex; gap: 22px; padding: 18px 18px 20px; max-height: 70vh; overflow-y: auto; }
  .dsug-col { flex: 1; min-width: 0; }
  .dsug-col.wide { flex: 1.4; }
  .dsug-h {
    display: block; margin-bottom: 10px; font-size: 13px; font-weight: 800;
    letter-spacing: -.01em; color: #fff;
  }

  .dsug-terms { display: flex; flex-direction: column; gap: 1px; }
  .dsug-terms a {
    display: flex; align-items: center; gap: 9px; padding: 7px 9px; border-radius: 7px;
    font-size: 13px; color: var(--txt-2);
    transition: background .13s var(--ease), color .13s var(--ease);
  }
  .dsug-terms a .mi { font-size: 16px; color: var(--txt-3); }
  .dsug-terms a:hover { background: var(--surface-2); color: #fff; }
  .dsug-terms a:hover .mi { color: var(--acc); }

  .dsug-people { display: flex; flex-direction: column; gap: 2px; }
  .dsug-people a {
    display: grid; grid-template-columns: 34px 1fr auto; align-items: center; gap: 10px;
    padding: 6px 9px; border-radius: 7px;
    transition: background .13s var(--ease);
  }
  .dsug-people a:hover { background: var(--surface-2); }
  .dsug-people b { font-size: 13px; font-weight: 650; color: var(--txt); }
  .dsug-people span:last-child { font-size: 11px; color: var(--txt-3); }
  .dsug-av { width: 34px; height: 34px; border-radius: 50%; overflow: hidden; display: block; background: var(--surface-2); }
  .dsug-av img { width: 100%; height: 100%; object-fit: cover; }
  .dsug-av i {
    width: 100%; height: 100%; display: grid; place-items: center; font-style: normal;
    font-size: 14px; font-weight: 800; color: #000;
    background: linear-gradient(150deg, hsl(var(--h, 30) 70% 62%), hsl(var(--h, 30) 60% 40%));
  }

  .dsug-vids { display: grid; grid-template-columns: 1fr 1fr; gap: 12px 10px; }
  .dsug-v { display: block; min-width: 0; }
  .dsug-vt {
    position: relative; display: block; aspect-ratio: 16/9; border-radius: 5px;
    overflow: hidden; background: var(--surface-2);
  }
  .dsug-vt img { width: 100%; height: 100%; object-fit: cover; transition: transform .25s var(--ease); }
  .dsug-v:hover .dsug-vt img { transform: scale(1.05); }
  .dsug-vt b {
    position: absolute; right: 4px; bottom: 4px; padding: 1px 4px; border-radius: 3px;
    background: rgba(0,0,0,.8); font-size: 10px; font-weight: 700;
  }
  .dsug-vn {
    display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
    margin-top: 5px; font-size: 12px; font-weight: 600; line-height: 1.3; color: var(--txt);
  }
  .dsug-v:hover .dsug-vn { color: var(--acc); }
  .dsug-vm { display: block; font-size: 10.5px; color: var(--txt-3); }
  .dsug-vazio { padding: 22px 4px; font-size: 13px; color: var(--txt-3); }

  .dactions { flex: none; display: flex; align-items: center; gap: 10px; }
  .dic {
    position: relative; width: 42px; height: 42px; border-radius: 50%;
    display: grid; place-items: center; color: var(--txt-2);
    transition: background .18s var(--ease), color .18s var(--ease);
  }
  .dic:hover { background: var(--surface-2); color: var(--txt); }
  .dic .mi { font-size: 22px; }
  .dav { display: block }

  /* overflow visível: os menus com seta abrem para fora da barra e seriam
     recortados por um overflow-x de rolagem — no desktop os itens cabem */
  .dnav { border-top: 1px solid rgba(255,255,255,.06); background: var(--header); overflow: visible; }
  .dnav-in {
    display: flex; align-items: center; gap: 22px; padding: 0 var(--gut);
    overflow: visible;
  }
  .dnav-i {
    position: relative; flex: 1; display: flex; align-items: center;
    justify-content: center; gap: 3px; height: 39px; padding: 0;
    font-size: 11px; font-weight: 700; letter-spacing: 0; text-transform: uppercase;
    color: var(--txt-2); white-space: nowrap;
    border-bottom: 2px solid transparent;
    transition: color .18s var(--ease), border-color .18s var(--ease);
  }
  .dnav-i:hover { color: var(--txt); }
  .dnav-i.on { color: #fff; }
  .dnav-i.on { border-bottom-color: var(--acc); }
  .dnav-i.sub { font-weight: 500; color: var(--txt-3); font-size: 12px;
    letter-spacing: 0; text-transform: none; }
  .dnav-i.sub:hover { color: var(--txt-2); }
  .dnav-sep { flex: none; width: 1px; height: 16px; background: var(--line); }

  /* ---------- rodapé ---------- */
  .dfoot-in { display: grid; grid-template-columns: repeat(4, 1fr) 220px; gap: 30px; padding: 40px var(--gut) 34px; }
  .dfoot-col.lang { grid-column: auto; }   /* no mobile ela ocupa a linha inteira */
  .dfoot-legal { padding-bottom: 26px; }
  .dfoot-col { display: flex; flex-direction: column; gap: 9px; }
  .dfoot-col b { margin-bottom: 3px; font-size: 13px; font-weight: 800; color: #fff; }
  .dfoot-col a { font-size: 12.5px; color: var(--txt-3); transition: color .14s var(--ease); }
  .dfoot-col a:hover { color: var(--acc); }
  .dfoot-lang {
    display: inline-flex; align-items: center; gap: 7px; padding: 8px 12px; border-radius: 7px;
    background: var(--surface-2); font-size: 12.5px; color: var(--txt-2); width: max-content;
  }
  .dfoot-lang .mi { font-size: 16px; }
  .dfoot-logo { margin-top: 6px; font-size: 20px; }

  /* ---------- mega-menu ----------
     O painel ocupa a largura toda e já vem no HTML: abrir não pede nada ao
     servidor. Ancorar no .dnav (e não no item) é o que permite o full-width. */
  .dnav { position: relative; }
  .dmenu { position: static; flex: 1; display: flex; }
  .dmenu > .dnav-i { flex: 1; }
  .dmenu > .dnav-i .mi { font-size: 15px; opacity: .55; transition: transform .2s var(--ease); }

  /* aba aberta: fundo mais claro e traço âmbar em cima, como na referência */
  .dmenu.open > .dnav-i {
    color: #fff; background: var(--bg);
    box-shadow: inset 0 2px 0 var(--acc);
  }
  .dmenu.open > .dnav-i .mi { transform: rotate(180deg); opacity: 1; }

  .dmega {
    position: absolute; top: 100%; left: 0; right: 0; z-index: 60;
    background: var(--bg); border-top: 1px solid rgba(255,255,255,.06);
    box-shadow: 0 24px 48px rgba(0,0,0,.6);
    opacity: 0; visibility: hidden; pointer-events: none;
    transform: translateY(-8px);
    transition: opacity .2s var(--ease), transform .22s var(--ease), visibility .22s;
  }
  .dmega.on {
    opacity: 1; visibility: visible; pointer-events: auto; transform: translateY(0);
  }
  .dmega-in {
    display: flex; align-items: flex-start; gap: 34px;
    padding: 26px var(--gut) 30px;
    max-height: calc(100vh - 150px); overflow-y: auto; scrollbar-width: thin;
  }

  /* escurece a página atrás, para o painel ficar em primeiro plano */
  .dmega::after {
    content: ""; position: fixed; left: 0; right: 0; top: 100%; height: 100vh;
    background: rgba(0,0,0,.55); pointer-events: none;
  }
  /* as colunas entram escalonadas, dando o movimento de abertura */
  .dmega.on .mm-col { animation: mmIn .26s var(--ease) both; }
  .dmega.on .mm-col:nth-child(2) { animation-delay: .04s; }
  .dmega.on .mm-col:nth-child(3) { animation-delay: .08s; }
  .dmega.on .mm-col:nth-child(4) { animation-delay: .12s; }
  @keyframes mmIn { from { opacity: 0; transform: translateY(7px); } to { opacity: 1; transform: none; } }

  .mm-col { flex: 1; min-width: 0; }
  .mm-col.narrow { flex: 0 0 210px; }
  .mm-col.wide { flex: 1.6; }

  .mm-h {
    display: flex; align-items: center; gap: 4px; margin-bottom: 14px;
    font-size: 15px; font-weight: 800; letter-spacing: -.02em; color: #fff;
  }
  .mm-h .mi { font-size: 19px; color: var(--acc); transition: transform .16s var(--ease); }
  a.mm-h:hover .mi { transform: translateX(3px); }
  .mm-h.plain { color: var(--txt); }

  .mm-links { display: flex; flex-direction: column; gap: 2px; }
  .mm-links a {
    display: flex; align-items: center; gap: 10px; padding: 8px 10px; border-radius: 8px;
    font-size: 13.5px; font-weight: 600; color: var(--txt-2);
    transition: background .14s var(--ease), color .14s var(--ease), transform .14s var(--ease);
  }
  .mm-links a .mi { font-size: 18px; color: var(--txt-3); transition: color .14s var(--ease); }
  .mm-links a:hover { background: var(--surface-2); color: #fff; transform: translateX(2px); }
  .mm-links a:hover .mi { color: var(--acc); }

  .mm-thumbs { display: grid; grid-template-columns: 1fr 1fr; gap: 14px 12px; }
  .mm-thumbs.vert { grid-template-columns: repeat(4, 1fr); gap: 10px; }
  .mm-thumbs.vert .mm-vn { -webkit-line-clamp: 1; font-size: 11.5px; }
  .mm-thumbs.vert .mm-vm { display: none; }
  .mm-v { display: block; min-width: 0; }
  .mm-vt {
    position: relative; display: block; aspect-ratio: 16/9; border-radius: 6px;
    overflow: hidden; background: var(--surface-2);
  }
  .mm-vt.vert { aspect-ratio: 3/4; }
  .mm-vt img {
    width: 100%; height: 100%; object-fit: cover;
    transition: transform .3s var(--ease), filter .2s var(--ease);
  }
  .mm-v:hover .mm-vt img { transform: scale(1.06); filter: brightness(1.08); }
  .mm-dur {
    position: absolute; right: 5px; bottom: 5px; padding: 1px 5px; border-radius: 3px;
    background: rgba(0,0,0,.78); font-size: 10.5px; font-weight: 700; color: #fff;
  }
  .mm-vn {
    display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
    margin-top: 6px; font-size: 12.5px; font-weight: 650; line-height: 1.3; color: var(--txt);
  }
  .mm-v:hover .mm-vn { color: var(--acc); }
  .mm-vm { display: block; margin-top: 2px; font-size: 11px; color: var(--txt-3); }

  .mm-cats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px 10px; }
  .mm-cats a {
    display: flex; flex-direction: column; gap: 1px; padding: 9px 11px; border-radius: 8px;
    background: var(--surface-2); transition: background .14s var(--ease), transform .14s var(--ease);
  }
  .mm-cats a:hover { background: var(--surface-3); transform: translateY(-2px); }
  .mm-cats b { font-size: 13px; font-weight: 700; color: var(--txt); }
  .mm-cats span { font-size: 11px; color: var(--txt-3); }

  .mm-people { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; }
  .mm-people a { display: flex; flex-direction: column; align-items: center; gap: 5px; text-align: center; }
  .mm-av {
    width: 62px; height: 62px; border-radius: 50%; overflow: hidden; display: block;
    border: 2px solid transparent; transition: border-color .16s var(--ease), transform .16s var(--ease);
  }
  .mm-people a:hover .mm-av { border-color: var(--acc); transform: scale(1.05); }
  .mm-av img { width: 100%; height: 100%; object-fit: cover; }
  .mm-av i {
    width: 100%; height: 100%; display: grid; place-items: center; font-style: normal;
    font-size: 22px; font-weight: 850; color: #000;
    background: linear-gradient(150deg, hsl(var(--h) 70% 62%), hsl(var(--h) 60% 40%));
  }
  .mm-people b { font-size: 12.5px; font-weight: 700; color: var(--txt); }
  .mm-people span { font-size: 11px; color: var(--txt-3); }

  .mm-pills { display: flex; flex-wrap: wrap; gap: 7px; }
  .mm-pills a {
    padding: 7px 13px; border-radius: var(--r-pill); background: var(--surface-2);
    font-size: 12px; font-weight: 650; color: var(--txt-2);
    transition: background .14s var(--ease), color .14s var(--ease);
  }
  .mm-pills a:hover { background: var(--acc); color: #000; }
}

/* ============================================================
   Página do vídeo em duas colunas — só no desktop.
   ============================================================ */
@media (min-width: 1024px) {
  .watch {
    display: grid; gap: 28px; align-items: start;
    grid-template-columns: minmax(0, 1fr) 340px;
    padding: 24px var(--gut) 0;
  }
  .watch-main { min-width: 0; }
  .watch-side { min-width: 0; position: sticky; top: 116px; }

  /* dentro do grid as seções não repetem o gutter da página */
  .watch-main > .wtitle,
  .watch-main > .wbar,
  .watch-main > .wmeta,
  .watch-main > .wmore,
  .watch-main > .wowner,
  .watch-main > .vtabs .utabs,
  .watch-main > .vtabs .tpanel,
  .watch-main > .planlist,
  .watch-main > .shead { padding-left: 0; padding-right: 0; }
  .watch-main > .wtitle,
  .watch-main > .wmeta,
  .watch-main > .wmore,
  .watch-main > .wowner,
  .watch-main > .bmini { margin-left: 0; margin-right: 0; }
  .watch-main > .wmore { width: 100%; }
  .watch-main .vgrid, .watch-main .sgrid { padding: 0; }

  .watch .player { border-radius: var(--r-lg); overflow: hidden; }
  .watch .wtitle { font-size: 20px; }
  .watch .vtabs { margin-top: 24px; }

  /* coluna lateral: cards empilhados, como as sugestões do tube */
  .watch-side .wside-h { padding: 0 0 12px; }
  .watch-side .wside-list { padding: 0; gap: 16px; }
  .watch-side .vcard .vmeta .t { font-size: 14px; -webkit-line-clamp: 2; }
  .watch-side .vcard .vmeta .byline { font-size: 12px; }
  .watch-side .sgrid { grid-template-columns: 1fr 1fr; padding: 0; gap: 12px; }

  /* a grade de relacionados embaixo segue o padrão do catálogo */
  .watch-main .vgrid { grid-template-columns: repeat(auto-fill, minmax(min(100%, 240px), 1fr)); gap: 24px 10px; }
}


/* ============================================================
   Ajustes finos para bater com o tube de referência.
   ============================================================ */
@media (min-width: 1024px) {
  /* menu espalhado na largura, como no original */
  .dnav-in { justify-content: space-between; gap: 0; }

  .dnav-i .mi { font-size: 15px; opacity: .6; }
  .dnav-sep { display: none; }

  /* grade mais apertada: os cards quase se encostam */
  .vgrid { gap: 32px 8px; }
  .vstrip, .bstrip { gap: 32px 8px; }

  /* barra de promo centrada acima do conteúdo */
  .promo {
    display: block; margin: 16px var(--gut) 4px; padding: 13px 20px;
    border-radius: var(--r-lg); background: #2b2b2b;
    font-size: 13px; color: #fff; text-align: center;
  }
  .promo span { color: var(--acc); margin-left: 5px; }
  .promo:hover { background: #333; }
}

/* três pontos no card, igual ao original */
.vmeta .trow { display: flex; align-items: flex-start; gap: 6px; margin-top: 3px; }
.vmeta .trow .t { flex: 1; min-width: 0; margin-top: 0; }
.vmeta .vdots { flex: none; font-size: 17px; color: var(--txt-3); }
.vcard:hover .vmeta .vdots { color: var(--txt-2); }
