/* ============================================================
   QUL WADAL - Social feeds v2 (X newsroom feed + TikTok people)
   ============================================================ */

/* ================= X — newsroom feed ================= */
.xw-shell{background:var(--surface);border:1px solid var(--line);border-radius:24px;box-shadow:var(--shadow);
  padding:1.6rem;position:relative;overflow:hidden}
.xw-shell:before{content:'';position:absolute;inset-inline:0;top:0;height:4px;
  background:linear-gradient(90deg,var(--hdr-a),var(--primary),#B77CE8)}

.xw-head{display:flex;align-items:center;justify-content:space-between;gap:1rem;margin-bottom:1.4rem;flex-wrap:wrap}
.xw-id{display:flex;align-items:center;gap:.85rem}
.xw-logo{width:48px;height:48px;border-radius:14px;background:#0F0F14;display:grid;place-items:center;flex:0 0 auto;
  box-shadow:0 6px 16px rgba(15,15,20,.18)}
.xw-logo svg{width:22px;height:22px;fill:#fff}
.xw-title{font-family:var(--head);font-weight:700;font-size:1.6rem;color:var(--primary-deep);margin:0;line-height:1.3}
.xw-sub{margin:.15rem 0 0;display:flex;align-items:center;gap:.5rem;color:var(--ink3);font-size:.82rem;font-weight:600}
.xw-sub bdi{color:var(--ink2)}
.xw-dot{width:3px;height:3px;border-radius:50%;background:var(--ink3)}
.xw-live{display:inline-flex;align-items:center;gap:.35rem;color:#15803D}
.xw-live i{width:7px;height:7px;border-radius:50%;background:#22C55E;box-shadow:0 0 0 3px rgba(34,197,94,.18)}
.xw-follow{display:inline-flex;align-items:center;gap:.5rem;padding:.65rem 1.25rem;border-radius:30px;background:#0F0F14;color:#fff;
  font-weight:700;font-size:.9rem;transition:transform .2s,box-shadow .2s}
.xw-follow:hover{transform:translateY(-1px);box-shadow:0 8px 20px rgba(15,15,20,.22);color:#fff}
.xw-follow svg{width:15px;height:15px;fill:currentColor}

.xw-body{display:grid;grid-template-columns:minmax(0,1.1fr) minmax(0,1fr);gap:1.4rem;align-items:stretch}

/* ---- featured ---- */
.xw-feat{position:relative;display:flex;flex-direction:column;gap:1rem;background:var(--bg);border:1px solid var(--line);
  border-radius:20px;padding:1.25rem;transition:border-color .2s,box-shadow .25s}
.xw-feat:hover{border-color:#D9C6EA;box-shadow:var(--shadow-lg)}
.xw-hit{position:absolute;inset:0;z-index:1;border-radius:inherit}
.xw-author{display:flex;align-items:center;gap:.7rem}
.xw-av{width:46px;height:46px;border-radius:50%;flex:0 0 auto;background:var(--surface);border:1px solid var(--line);
  display:grid;place-items:center;overflow:hidden;font-family:var(--head);font-weight:700;color:var(--primary)}
.xw-av img{width:76%;height:76%;object-fit:contain}
.xw-who{display:flex;flex-direction:column;flex:1;min-width:0;line-height:1.4}
.xw-who b{font-size:.98rem;color:var(--ink)}
.xw-who small{font-size:.78rem;color:var(--ink3)}
.xw-badge{font-size:.7rem;font-weight:800;color:var(--primary);background:var(--primary-soft);padding:.3rem .75rem;border-radius:20px}

.xw-feat-media{position:relative;border-radius:16px;overflow:hidden;aspect-ratio:16/9;background:var(--primary-soft)}
.xw-feat-media img{position:absolute;inset:0;width:100%;height:100%;object-fit:cover;transition:transform .6s ease}
.xw-feat:hover .xw-feat-media img{transform:scale(1.03)}
.xw-feat-text{font-size:1.06rem;line-height:1.9;color:var(--ink);overflow-wrap:anywhere;
  display:-webkit-box;-webkit-line-clamp:6;-webkit-box-orient:vertical;overflow:hidden}
.xw-feat-text a,.xw-item-text a{position:relative;z-index:2;color:var(--primary);font-weight:600}
.xw-feat-text a:hover,.xw-item-text a:hover{text-decoration:underline}

/* text-only featured: editorial quote panel */
.xw-feat.is-quote{background:linear-gradient(150deg,var(--hdr-a),var(--hdr-b) 60%,#6B2E8F);border-color:transparent;color:#fff}
.xw-feat.is-quote .xw-who b{color:#fff}
.xw-feat.is-quote .xw-who small{color:rgba(255,255,255,.7)}
.xw-feat.is-quote .xw-av{background:rgba(255,255,255,.95);border-color:transparent}
.xw-feat.is-quote .xw-badge{background:rgba(255,255,255,.14);color:#fff}
.xw-feat.is-quote .xw-feat-text{flex:1;display:flex;align-items:center;font-family:var(--head);font-weight:500;font-size:1.45rem;
  line-height:1.8;color:#fff;-webkit-line-clamp:unset;padding:.5rem 0}
.xw-feat.is-quote .xw-feat-text a{color:#E9D5FF}
.xw-feat.is-quote .xw-metrics,.xw-feat.is-quote .xw-open{color:rgba(255,255,255,.8)}
.xw-feat.is-quote .xw-feat-foot{border-color:rgba(255,255,255,.16)}

.xw-article{display:flex;flex-direction:column;gap:.55rem}
.xw-kicker{align-self:flex-start;font-size:.72rem;font-weight:800;color:#fff;background:var(--primary);padding:.25rem .7rem;border-radius:6px}
.xw-art-title{font-family:var(--head);font-weight:700;font-size:1.3rem;line-height:1.6;color:var(--ink);margin:0}
.xw-readmore{color:var(--primary);font-weight:700;font-size:.9rem}

.xw-feat-foot{display:flex;align-items:center;justify-content:space-between;gap:1rem;margin-top:auto;padding-top:.9rem;border-top:1px solid var(--line)}
.xw-open{display:inline-flex;align-items:center;gap:.35rem;font-size:.82rem;font-weight:700;color:var(--primary);white-space:nowrap}
.xw-open svg{width:14px;height:14px;fill:none;stroke:currentColor;stroke-width:2;stroke-linecap:round;stroke-linejoin:round}

.xw-metrics{display:flex;flex-wrap:wrap;gap:1rem;color:var(--ink3);font-size:.8rem;font-weight:700}
.xw-metrics span{display:inline-flex;align-items:center;gap:.3rem}
.xw-metrics svg{width:15px;height:15px;fill:none;stroke:currentColor;stroke-width:1.9;stroke-linecap:round;stroke-linejoin:round}
.xw-metrics.sm{gap:.8rem;font-size:.72rem}
.xw-metrics.sm svg{width:13px;height:13px}

.xw-play{position:absolute;top:50%;left:50%;transform:translate(-50%,-50%);width:56px;height:56px;border-radius:50%;
  background:rgba(255,255,255,.94);display:grid;place-items:center;box-shadow:0 10px 26px rgba(0,0,0,.28);z-index:1}
.xw-play svg{width:22px;height:22px;fill:var(--primary);margin-inline-start:3px}
.xw-play.sm{width:28px;height:28px;box-shadow:0 4px 10px rgba(0,0,0,.25)}
.xw-play.sm svg{width:12px;height:12px;margin-inline-start:2px}
.xw-count{position:absolute;bottom:10px;inset-inline-end:10px;background:rgba(0,0,0,.62);color:#fff;font-size:.75rem;font-weight:800;padding:2px 10px;border-radius:8px}

/* ---- timeline ---- */
.xw-list-wrap{position:relative;min-height:0}
.xw-list{position:absolute;inset:0;overflow-y:auto;padding-inline-end:.4rem;
  scrollbar-width:thin;scrollbar-color:#D9C6EA transparent;
  -webkit-mask-image:linear-gradient(180deg,#000 88%,transparent);mask-image:linear-gradient(180deg,#000 88%,transparent)}
.xw-list::-webkit-scrollbar{width:6px}
.xw-list::-webkit-scrollbar-thumb{background:#D9C6EA;border-radius:6px}

.xw-item{position:relative;display:flex;gap:.9rem;align-items:flex-start;padding:.95rem .85rem .95rem .6rem;border-radius:14px;
  transition:background .2s}
.xw-item+.xw-item:before{content:'';position:absolute;top:0;inset-inline:.6rem;height:1px;background:var(--line)}
.xw-item:hover{background:var(--primary-soft)}
.xw-item:hover:before,.xw-item:hover+.xw-item:before{opacity:0}
.xw-item-main{flex:1;min-width:0;display:flex;flex-direction:column;gap:.35rem}
.xw-item-time{display:flex;align-items:center;gap:.45rem;font-size:.74rem;font-weight:700;color:var(--ink3)}
.xw-item-time i{width:7px;height:7px;border-radius:50%;border:2px solid var(--primary);background:var(--surface)}
.xw-item:first-child .xw-item-time i{background:var(--primary)}
.xw-tag{font-size:.66rem;font-weight:800;color:var(--primary);background:var(--primary-soft);padding:.1rem .5rem;border-radius:5px}
.xw-item:hover .xw-tag{background:var(--surface)}
.xw-item-text{margin:0;font-size:.92rem;line-height:1.75;color:var(--ink);overflow-wrap:anywhere;
  display:-webkit-box;-webkit-line-clamp:3;-webkit-box-orient:vertical;overflow:hidden}
.xw-item-text b{font-family:var(--head);font-weight:600}
.xw-thumb{position:relative;width:96px;aspect-ratio:1;border-radius:12px;overflow:hidden;flex:0 0 auto;background:var(--primary-soft)}
.xw-thumb img{position:absolute;inset:0;width:100%;height:100%;object-fit:cover}
.xw-expand{display:none}

/* dark */
html[data-theme=dark] .xw-logo,html[data-theme=dark] .xw-follow{background:#F2EEF5}
html[data-theme=dark] .xw-logo svg{fill:#141116}
html[data-theme=dark] .xw-follow{color:#141116}
html[data-theme=dark] .xw-feat{background:var(--surface2)}
html[data-theme=dark] .xw-feat:hover{border-color:#3A3242}
html[data-theme=dark] .xw-live{color:#4ADE80}
html[data-theme=dark] .xw-list{scrollbar-color:#3A3242 transparent}

/* tablet / mobile */
@media(max-width:980px){
  .xw-body{grid-template-columns:1fr}
  .xw-list{position:static;overflow:visible;-webkit-mask-image:none;mask-image:none;padding:0}
  .xw-more{display:none}
  .xw-list-wrap.open .xw-more{display:flex}
  .xw-expand{display:block;width:100%;margin-top:.6rem;padding:.8rem;border-radius:12px;border:1px solid var(--line);
    background:var(--bg);color:var(--primary);font-family:var(--body);font-weight:700;font-size:.9rem;cursor:pointer}
  .xw-expand:hover{border-color:var(--primary)}
}
@media(max-width:640px){
  .xw-shell{padding:1.1rem;border-radius:20px}
  .xw-head{flex-direction:column;align-items:stretch}
  .xw-follow{justify-content:center}
  .xw-title{font-size:1.3rem}
  .xw-logo{width:42px;height:42px}
  .xw-feat{padding:1rem}
  .xw-feat.is-quote .xw-feat-text{font-size:1.2rem}
  .xw-thumb{width:76px}
  .xw-open{display:none}
}

/* ================= TikTok — home people row ================= */
.pp-row{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:1.1rem}
.pp-card{display:flex;flex-direction:column;gap:.7rem;color:inherit}
.pp-media{position:relative;aspect-ratio:9/16;border-radius:18px;overflow:hidden;background:linear-gradient(150deg,#2A1638,#0E0A18);
  box-shadow:var(--shadow);transition:transform .3s,box-shadow .3s}
.pp-media img{position:absolute;inset:0;width:100%;height:100%;object-fit:cover;transition:transform .6s ease}
.pp-media:after{content:'';position:absolute;inset:0;background:linear-gradient(180deg,rgba(14,10,24,.25),transparent 22%,transparent 70%,rgba(14,10,24,.35));pointer-events:none}
.pp-card:hover .pp-media{transform:translateY(-4px);box-shadow:var(--shadow-lg)}
.pp-card:hover .pp-media img{transform:scale(1.04)}
.pp-src{position:absolute;top:12px;inset-inline-start:12px;z-index:2;width:30px;height:30px;border-radius:9px;background:rgba(0,0,0,.55);
  display:grid;place-items:center;backdrop-filter:blur(6px)}
.pp-src svg{width:15px;height:15px;fill:#fff}
.pp-dur{position:absolute;top:12px;inset-inline-end:12px;z-index:2;background:rgba(0,0,0,.6);color:#fff;font-size:.72rem;font-weight:800;
  padding:4px 9px;border-radius:8px;backdrop-filter:blur(6px)}
.pp-play{position:absolute;top:50%;left:50%;transform:translate(-50%,-50%) scale(.9);z-index:2;width:56px;height:56px;border-radius:50%;
  background:rgba(255,255,255,.92);display:grid;place-items:center;box-shadow:0 10px 26px rgba(0,0,0,.3);opacity:0;transition:opacity .25s,transform .25s}
.pp-play svg{width:20px;height:20px;fill:var(--primary);margin-inline-start:3px}
.pp-card:hover .pp-play{opacity:1;transform:translate(-50%,-50%) scale(1)}
@media(hover:none){.pp-play{opacity:1;transform:translate(-50%,-50%) scale(.85)}}
.pp-cap{display:flex;flex-direction:column;gap:.2rem;padding:0 .2rem}
.pp-cap b{font-family:var(--head);font-weight:600;font-size:.95rem;line-height:1.6;color:var(--ink);
  display:-webkit-box;-webkit-line-clamp:2;-webkit-box-orient:vertical;overflow:hidden}
.pp-cap small{font-size:.76rem;color:var(--ink3)}
.pp-card:hover .pp-cap b{color:var(--primary)}
.pp-foot{display:flex;justify-content:center;margin-top:1.4rem}
@media(max-width:900px){.pp-row{grid-template-columns:repeat(2,minmax(0,1fr));gap:.9rem}}

/* ================= TikTok — people page ================= */
.pv-grid{gap:1.7rem 1.2rem}
.pv-grid .pv-card,.pv-grid .pv-card:hover{background:transparent;border:0;box-shadow:none;overflow:visible;transform:none;border-radius:0}
.pv-grid .pv-card .pv-media{border-radius:18px;overflow:hidden;box-shadow:var(--shadow);transition:box-shadow .3s,transform .3s}
.pv-grid .pv-card:hover .pv-media{box-shadow:var(--shadow-lg);transform:translateY(-3px)}
.pv-grid .pv-card .pv-info,.pv-grid .pv-card.loaded .pv-info{position:static;background:none;color:var(--ink);padding:.75rem .2rem 0;pointer-events:auto;text-shadow:none}
.pv-grid .pv-card .pv-info b{display:-webkit-box;-webkit-line-clamp:2;-webkit-box-orient:vertical;overflow:hidden;
  font-family:var(--head);font-weight:600;font-size:.95rem;line-height:1.6;color:var(--ink)}
.pv-grid .pv-card .pv-info small{color:var(--ink3);margin-top:.15rem}
.pv-grid .pv-card .pv-dur{top:12px;inset-inline-end:12px}

.tt-more{display:flex;flex-direction:column;align-items:center;gap:.8rem;margin-top:2.4rem;text-align:center}
.tt-more-note{margin:0;color:var(--ink3);font-size:.85rem}
.tt-more-btns{display:flex;flex-wrap:wrap;gap:.7rem;justify-content:center}
.tt-btn{gap:.5rem}
.tt-btn svg{width:18px;height:18px;fill:currentColor}
.tt-btn svg.ico-line{fill:none;stroke:currentColor;stroke-width:2;stroke-linecap:round;stroke-linejoin:round}

/* ================= X داخل قسم الأخبار (بدون عنوان) ================= */
.news-x{margin-top:0}
.news-x.has-rail{margin-top:1.6rem;padding-top:1.6rem;border-top:1px solid var(--line)}
.xw-bare{margin:0}
.news-x .xw-feat{background:var(--surface)}
html[data-theme=dark] .news-x .xw-feat{background:var(--surface2)}
.news-x.on-page{margin-top:2rem}
