/* Trending · parte de abajo: filtros (tipo, buscador, categoría) y mosaico mezclado de fotos, vídeos, audios, textos y encuestas */
.trd-page { --tn: #061B38; --tg: #F0C12C; }

/* ── barra de filtros ── */
.trd-fbar { display: flex; flex-wrap: wrap; gap: 12px; align-items: center; margin: 20px 0 16px; }
.trd-kinds { flex: 1 1 100%; display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 10px; }
.trd-kind { --k: #5B6F86; display: flex; align-items: center; justify-content: center; gap: 9px; min-width: 0; height: 54px; padding: 0 12px 0 8px; border: 1px solid #e1e9f2; border-radius: 99px; background: var(--ice, #fff); color: #12304f; font: 700 14.5px Lato, Arial, sans-serif; cursor: pointer; box-shadow: 0 4px 14px rgba(6, 27, 56, .07); transition: background .18s, border-color .18s, box-shadow .18s, transform .18s; }
.trd-kind span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.trd-kind i:first-child { flex: 0 0 auto; width: 36px; height: 36px; border-radius: 50%; display: grid; place-items: center; font-size: 15px; color: #fff; background: var(--k); }
.trd-kn { font-style: normal; font-weight: 600; opacity: .72; font-size: 13.5px; white-space: nowrap; }
.trd-kind:hover { border-color: #b9cde2; transform: translateY(-1px); }
.trd-kind:focus-visible, .trd-fil-b:focus-visible { outline: 3px solid var(--tg); outline-offset: 2px; }
.trd-kind.on { background: linear-gradient(180deg, #0F3A6B, #061B38); border-color: #061B38; color: #fff; box-shadow: 0 8px 20px rgba(6, 27, 56, .32); }
.trd-kind.on .trd-kn { opacity: .85; }
.trd-kind.k-all { --k: #E3A71B; }
.trd-kind.k-photo { --k: #2E7BEA; }
.trd-kind.k-video { --k: #2E7BEA; }
.trd-kind.k-audio { --k: #8B4BE0; }

.trd-search { flex: 1 1 260px; position: relative; display: flex; align-items: center; height: 50px; }
.trd-search i { position: absolute; left: 18px; color: #4a6585; font-size: 16px; pointer-events: none; }
.trd-search input { width: 100%; height: 100%; padding: 0 18px 0 46px; border: 1px solid #e1e9f2; border-radius: 99px; background: var(--ice, #fff); box-shadow: 0 4px 14px rgba(6, 27, 56, .07); font: 600 14.5px Lato, Arial, sans-serif; color: #12304f; outline: 0; -webkit-appearance: none; appearance: none; }
.trd-search input::placeholder { color: #7b8ea5; font-weight: 500; }
.trd-search input:focus { border-color: var(--tg); box-shadow: 0 0 0 3px rgba(240, 193, 44, .35); }
.trd-search input::-webkit-search-cancel-button { cursor: pointer; }

.trd-fil { position: relative; flex: 0 0 auto; }
.trd-fil-b { display: inline-flex; align-items: center; gap: 10px; height: 50px; padding: 0 20px; border: 1px solid #e1e9f2; border-radius: 99px; background: var(--ice, #fff); color: #12304f; font: 800 14.5px Lato, Arial, sans-serif; cursor: pointer; box-shadow: 0 4px 14px rgba(6, 27, 56, .07); max-width: 240px; }
.trd-fil-b span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.trd-fil-b.on { border-color: var(--tg); background: #FFF8E1; }
.trd-fil-ch { font-size: 12px; transition: transform .2s; }
.trd-fil-b[aria-expanded="true"] .trd-fil-ch { transform: rotate(180deg); }
.trd-fil-m { position: absolute; right: 0; top: 58px; z-index: 40; width: 250px; max-height: 340px; overflow: auto; padding: 8px; border-radius: 16px; background: var(--ice, #fff); border: 1px solid #e1e9f2; box-shadow: 0 18px 44px rgba(6, 27, 56, .22); display: grid; gap: 2px; }
.trd-fil-m[hidden] { display: none; }
.trd-fil-m b { padding: 6px 10px 4px; font-size: 12px; letter-spacing: .06em; text-transform: uppercase; color: #6c8099; }
.trd-fil-m button { text-align: left; border: 0; background: none; padding: 9px 12px; border-radius: 10px; font: 600 14px Lato, Arial, sans-serif; color: #12304f; cursor: pointer; }
.trd-fil-m button:hover { background: #f1f6fb; }
.trd-fil-m button.on { background: #FFF2C4; font-weight: 800; }

/* ── mosaico ── */
.trd-grid { display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); grid-auto-rows: clamp(230px, 19vw, 340px); gap: 14px; grid-auto-flow: dense; }
.trd-tile { grid-column: span var(--w, 4); }
.trd-tile { position: relative; overflow: hidden; border-radius: 18px; background: #0b2342; cursor: pointer; outline: 0; isolation: isolate; contain: paint; color: #fff; box-shadow: 0 8px 22px rgba(6, 27, 56, .16); transition: transform .25s, box-shadow .25s; }
.trd-tile:hover { transform: translateY(-3px); box-shadow: 0 14px 30px rgba(6, 27, 56, .28); }
.trd-tile:focus-visible { box-shadow: 0 0 0 3px var(--tg); }
.trd-tile-img, .trd-tile-vid { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; object-position: var(--fx, 50% 50%); transform: scale(var(--z, 1)); transform-origin: var(--fx, 50% 50%); transition: transform .4s; }
.trd-tile:hover .trd-tile-img, .trd-tile:hover .trd-tile-vid { transform: scale(calc(var(--z, 1) * 1.05)); }
.trd-tile-ov { position: absolute; inset: 0; z-index: 3; padding: 11px 13px; display: flex; flex-direction: column; justify-content: space-between; pointer-events: none;
  background: linear-gradient(180deg, rgba(5, 15, 30, .62) 0%, rgba(5, 15, 30, 0) 30%, rgba(5, 15, 30, 0) 58%, rgba(5, 15, 30, .8) 100%); }
.trd-ov-top, .trd-tt-top { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.trd-who { display: inline-flex; align-items: center; gap: 8px; min-width: 0; text-shadow: 0 1px 5px rgba(0, 0, 0, .55); }
.trd-who .pfx-avatar { border: 2px solid #fff; flex: 0 0 auto; }
.trd-who b { font-weight: 800; font-size: 14px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 150px; }
.trd-who .pfx-verified { font-size: 13px; }
.trd-ago { flex: 0 0 auto; font-size: 12px; font-weight: 800; padding: 3px 9px; border-radius: 99px; background: rgba(8, 20, 36, .5); backdrop-filter: blur(4px); }
.trd-ov-bot, .trd-tt-bot { display: flex; align-items: center; gap: 10px; }
.trd-kc { padding: 4px 12px; border-radius: 99px; font-size: 12.5px; font-weight: 800; background: linear-gradient(180deg, #1FCDB4, #0F9C88); box-shadow: 0 3px 10px rgba(0, 0, 0, .3); }
.trd-kc.vid { background: linear-gradient(180deg, #4C97F5, #2467D6); }
.trd-ov-n { display: inline-flex; align-items: center; gap: 5px; font-size: 13px; font-weight: 800; text-shadow: 0 1px 4px rgba(0, 0, 0, .55); }
.trd-ov-n i { font-size: 12px; } .trd-ov-n i + b + i { margin-left: 8px; }
.trd-ov-n .fa-heart { color: #FFC72E; }
.trd-sp { flex: 1; }
.trd-dur { font-size: 14px; font-weight: 800; text-shadow: 0 1px 4px rgba(0, 0, 0, .6); }
.trd-bm { pointer-events: auto; flex: 0 0 auto; width: 34px; height: 34px; border: 0; border-radius: 10px; background: rgba(8, 20, 36, .45); backdrop-filter: blur(4px); color: #fff; font-size: 15px; cursor: pointer; display: grid; place-items: center; transition: background .15s, transform .15s; }
.trd-bm:hover { background: rgba(8, 20, 36, .7); transform: scale(1.07); }
.trd-bm.on { background: var(--tg); color: #1c2733; }
.trd-bm:focus-visible { outline: 2px solid var(--tg); outline-offset: 2px; }
.trd-play { position: absolute; left: 50%; top: 50%; width: 62px; height: 62px; margin: -31px 0 0 -31px; border-radius: 50%; display: grid; place-items: center; background: rgba(255, 255, 255, .16); border: 2.5px solid #fff; backdrop-filter: blur(3px); box-shadow: 0 6px 20px rgba(0, 0, 0, .35); font-size: 22px; padding-left: 3px; transition: transform .25s; }
.trd-tile:hover .trd-play { transform: scale(1.08); }
.trd-tile.is-video:has(video) .trd-play { opacity: .0; }

/* audios (los textos y las encuestas ya no salen en Trending) */
.trd-tt { display: flex; flex-direction: column; justify-content: space-between; gap: 8px; padding: 12px 14px; }
.trd-tt::after { display: none !important; }
.trd-tt.k-audio { background: linear-gradient(145deg, #3A1B93 0%, #6A35CF 58%, #9B52E4 100%); }
.trd-tt-in > * { flex: 0 0 auto; }
.trd-tt-in { flex: 1; min-height: 0; display: flex; flex-direction: column; justify-content: center; gap: 10px; overflow: hidden; }
.trd-tt-in p { margin: 0; font-size: 16px; line-height: 1.35; font-weight: 700; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; word-break: break-word; text-shadow: 0 1px 2px rgba(0, 0, 0, .25); }
.trd-tt-bot .trd-bm { margin-left: auto; }
.trd-au { display: flex; align-items: center; gap: 12px; }
.trd-au-p { flex: 0 0 auto; width: 48px; height: 48px; border-radius: 50%; display: grid; place-items: center; background: linear-gradient(180deg, #FFD76A, #E8A91C); color: #1c2733; font-size: 17px; padding-left: 3px; box-shadow: 0 4px 14px rgba(0, 0, 0, .35); }
.trd-au b { font-size: 15px; font-variant-numeric: tabular-nums; }
.trd-au.disc .trd-au-p { width: 62px; height: 62px; padding: 0; font-size: 12px; color: #1c2733; background: radial-gradient(circle, #F5C542 0 15%, #101010 16% 38%, #2b2b2b 39% 41%, #101010 42% 62%, #2b2b2b 63% 65%, #101010 66%); box-shadow: 0 4px 14px rgba(0, 0, 0, .45); }
.trd-au.disc .trd-au-p i { margin-left: 1px; }
.trd-tt-wave { flex: 1; min-width: 0; display: flex; align-items: center; gap: 3px; height: 34px; }
.trd-tt-wave i { flex: 1; min-width: 2px; height: var(--h); border-radius: 3px; background: rgba(255, 255, 255, .8); }

.trd-empty { display: grid; justify-items: center; gap: 10px; }

/* ── adaptación ── */
@media (max-width: 1100px) {
  .trd-kind { font-size: 13.5px; gap: 6px; padding: 0 8px 0 6px; height: 50px; } .trd-kind i:first-child { width: 32px; height: 32px; font-size: 13px; } .trd-kn { font-size: 12px; }
  .trd-grid { gap: 10px; }
}
@media (max-width: 720px) {
  .trd-fbar { gap: 10px; margin: 14px 0 12px; }
  .trd-kinds { display: flex; overflow-x: auto; gap: 8px; margin: 0 -10px; padding: 2px 10px 6px; scrollbar-width: none; scroll-snap-type: x proximity; }
  .trd-kinds::-webkit-scrollbar { display: none; }
  .trd-kind { flex: 0 0 auto; scroll-snap-align: start; height: 46px; padding: 0 14px 0 6px; font-size: 14px; }
  .trd-search { flex: 1 1 150px; height: 46px; min-width: 0; } .trd-fil-b { height: 46px; padding: 0 14px; max-width: 150px; } .trd-fil-b > i:first-child { display: none; }
  .trd-fil-m { right: 0; width: min(250px, calc(100vw - 24px)); }
  .trd-grid { gap: 8px; grid-auto-rows: 190px; }
  .trd-tile { border-radius: 14px; }
      .trd-who b { max-width: 96px; font-size: 13px; } .trd-tile-ov { padding: 9px 10px; } .trd-tt { padding: 10px 12px; }
  .trd-tile[data-w="6"] .trd-ov-n { font-size: 12px; } .trd-tile[data-w="6"] .trd-kc, .trd-tile[data-w="6"] .trd-ago { display: none; }
  .trd-bm { width: 30px; height: 30px; font-size: 13px; }
}
@media (prefers-reduced-motion: reduce) { .trd-tile, .trd-tile-img, .trd-kind, .trd-play { transition: none !important; } .trd-tile:hover { transform: none; } }
