/* =========================================================
   الأخبار (تغريدات) + الأغاني (SoundCloud)
========================================================= */

/* ---------- الأخبار ---------- */
.timeline{max-width:640px; margin:0 auto; display:flex; flex-direction:column; gap:0;
  border:1px solid var(--surface-3); border-radius:16px; overflow:hidden; background:var(--surface);}
.timeline-single{border-radius:16px;}
.tw-back{padding:14px 18px 0; font-size:13px; color:var(--muted);}
.tw-back a:hover{color:var(--gold);}

.tweet{padding:16px 18px 6px; border-bottom:1px solid var(--surface-3); transition:background .2s;}
.tweet:last-child{border-bottom:0;}
.tweet:hover{background:rgba(255,255,255,.015);}
.tw-head{display:flex; align-items:center; gap:12px; margin-bottom:8px;}
.tw-avatar{width:44px; height:44px; border-radius:50%; object-fit:cover; flex:none; background:var(--surface-3);}
.tw-avatar-letter{display:grid; place-items:center; background:var(--gold); color:var(--bg); font-family:var(--font-head); font-weight:900; font-size:20px;}
.tw-name{font-family:var(--font-head); font-weight:800; font-size:15px; display:flex; align-items:center; gap:4px;}
.tw-verified{color:var(--gold); flex:none;}
.tw-handle{font-size:13px; color:var(--muted); direction:rtl;}
.tw-handle a:hover{text-decoration:underline;}
.tw-title{display:block; font-family:var(--font-head); font-weight:800; font-size:17px; margin-bottom:4px;}
.tw-title:hover{color:var(--gold);}
.tweet-single .tw-text{font-size:18px;}
.tw-text{font-size:15.5px; line-height:1.85; word-break:break-word;}
.tw-text p{margin-bottom:8px;}
.tw-text a{color:var(--teal);}
.tw-text a:hover{text-decoration:underline;}
.tw-hash{color:var(--teal);}

/* شبكة الصور بشكل تويتر */
.tw-media{position:relative; display:grid; gap:2px; margin:10px 0 4px; border-radius:16px; overflow:hidden;
  border:1px solid var(--surface-3); aspect-ratio:16/9; background:var(--surface-2);}
.tw-media .tw-img{position:relative; display:block; padding:0; border:0; background:none; overflow:hidden; cursor:zoom-in; min-width:0; min-height:0;}
.tw-media img{width:100%; height:100%; object-fit:cover; transition:transform .3s;}
.tw-media .tw-img:hover img{transform:scale(1.03);}
.tw-media.n1{aspect-ratio:auto; max-height:560px;}
.tw-media.n1 img{height:auto; max-height:560px;}
.tw-media.n2{grid-template-columns:1fr 1fr;}
.tw-media.n3{grid-template-columns:1fr 1fr; grid-template-rows:1fr 1fr;}
.tw-media.n3 .tw-img:first-child{grid-row:1 / span 2;}
.tw-media.n4{grid-template-columns:1fr 1fr; grid-template-rows:1fr 1fr;}
.tw-more{position:absolute; inset:0; display:grid; place-items:center; background:rgba(11,14,20,.62);
  color:#fff; font-family:var(--font-head); font-weight:900; font-size:30px;}
.tw-count{position:absolute; bottom:8px; left:8px; background:rgba(11,14,20,.78); color:#fff; font-size:12px; padding:2px 9px; border-radius:20px; pointer-events:none;}

.tw-actions{display:flex; align-items:center; justify-content:space-between; max-width:340px; padding:6px 0 8px; color:var(--muted);}
.tw-act{display:inline-flex; align-items:center; gap:6px; font-size:13px; background:none; border:0; color:inherit; padding:6px 8px; border-radius:20px; transition:.15s;}
a.tw-act:hover, button.tw-act:hover{color:var(--teal); background:rgba(47,191,166,.1);}
.tw-share:hover{color:var(--gold) !important; background:rgba(232,181,77,.1) !important;}

/* عارض الصور */
.lb{position:fixed; inset:0; z-index:1000; background:rgba(5,7,11,.94); display:flex; align-items:center; justify-content:center;}
.lb[hidden]{display:none;}
.lb-img{max-width:94vw; max-height:88vh; object-fit:contain; border-radius:6px; user-select:none;}
.lb-close{position:absolute; top:14px; right:16px; font-size:34px; line-height:1; background:rgba(255,255,255,.1); color:#fff; border:0; width:42px; height:42px; border-radius:50%;}
.lb-nav{position:absolute; top:50%; transform:translateY(-50%); font-size:38px; line-height:1; background:rgba(255,255,255,.1); color:#fff; border:0; width:46px; height:60px; border-radius:10px;}
.lb-nav:hover,.lb-close:hover{background:var(--gold); color:var(--bg);}
.lb-prev{right:12px;} .lb-next{left:12px;}
.lb.single .lb-nav, .lb.single .lb-count{display:none;}
.lb-count{position:absolute; bottom:16px; left:50%; transform:translateX(-50%); color:#fff; font-size:13px; background:rgba(255,255,255,.12); padding:3px 14px; border-radius:20px;}
html.lb-open{overflow:hidden;}

/* قسم الأخبار في الصفحة الرئيسية */
.home-news{max-width:640px; margin:0;}

/* ---------- الأغاني ---------- */
.tracklist{display:flex; flex-direction:column; gap:14px; max-width:860px;}
.track{display:flex; gap:16px; background:var(--surface); border:1px solid var(--surface-3); border-radius:14px; padding:14px; transition:border-color .2s, background .2s;}
.track:hover{border-color:var(--surface-3); background:var(--surface-2);}
.track.playing{border-color:var(--gold);}
.track-cover{width:108px; height:108px; flex:none; border-radius:10px; overflow:hidden; background:var(--surface-3);}
.track-cover img{width:100%; height:100%; object-fit:cover;}
.track-cover-ph{display:grid; place-items:center; width:100%; height:100%; font-size:40px; color:var(--muted);}
.track-body{flex:1; min-width:0; display:flex; flex-direction:column; gap:8px;}
.track-top{display:flex; align-items:center; gap:12px;}
.track-play{flex:none; width:46px; height:46px; border-radius:50%; border:0; background:var(--gold); color:var(--bg); display:grid; place-items:center; transition:transform .15s, background .15s;}
.track-play:hover{background:#f2c463; transform:scale(1.06);}
.track-info{min-width:0; flex:1;}
.track-artist{font-size:12.5px; color:var(--muted); white-space:nowrap; overflow:hidden; text-overflow:ellipsis;}
.track-title{display:block; font-family:var(--font-head); font-weight:800; font-size:17px; white-space:nowrap; overflow:hidden; text-overflow:ellipsis;}
.track-title:hover{color:var(--gold);}
.track-credit{font-size:12px; color:var(--teal); white-space:nowrap; flex:none;}
.ico-pause{display:none;}
.playing .track-play .ico-play, .is-playing #scToggle .ico-play{display:none;}
.playing .track-play .ico-pause, .is-playing #scToggle .ico-pause{display:block;}

.wave{position:relative; height:52px; cursor:pointer; border-radius:6px;}
.wave canvas{width:100%; height:100%; display:block;}
.wave-time{position:absolute; bottom:0; left:0; font-size:11px; color:#fff; background:rgba(11,14,20,.8); padding:0 6px; border-radius:4px;}
.wave:focus-visible{outline:2px solid var(--teal);}
.track-meta{display:flex; align-items:center; gap:14px; font-size:12.5px; color:var(--muted);}
.track-share{background:none; border:1px solid var(--surface-3); color:var(--muted); font-size:12px; padding:2px 12px; border-radius:20px;}
.track-share:hover{color:var(--gold); border-color:var(--gold);}
.track-embed{margin-top:4px;}
.track-embed[hidden]{display:none;}

.song-single .tracklist{margin-bottom:10px;}
.song-excerpt{color:var(--muted); max-width:860px; margin:12px 0;}
.song-lyrics{white-space:normal; line-height:2.1; font-size:16px;}

/* المشغّل السفلي */
.sc-player{position:fixed; inset-inline:0; bottom:0; z-index:900; background:rgba(18,23,33,.97); backdrop-filter:blur(10px); border-top:1px solid var(--surface-3);}
.sc-player[hidden]{display:none;}
.sc-progress{height:5px; background:var(--surface-3); cursor:pointer; direction:rtl;}
.sc-progress span{display:block; height:100%; width:0; background:var(--gold);}
.sc-inner{max-width:var(--maxw); margin:0 auto; padding:8px 20px; display:flex; align-items:center; gap:14px;}
.sc-cover{width:48px; height:48px; border-radius:8px; object-fit:cover; background:var(--surface-3);}
.sc-text{flex:1; min-width:0;}
.sc-title{font-family:var(--font-head); font-weight:800; font-size:15px; white-space:nowrap; overflow:hidden; text-overflow:ellipsis;}
.sc-artist{font-size:12px; color:var(--muted); white-space:nowrap; overflow:hidden; text-overflow:ellipsis;}
.sc-ctrl{display:flex; align-items:center; gap:6px; direction:ltr;}
.sc-ctrl button{background:none; border:0; color:var(--text); width:38px; height:38px; border-radius:50%; display:grid; place-items:center;}
.sc-ctrl button:hover{color:var(--gold);}
.sc-ctrl .sc-main{background:var(--gold); color:var(--bg); width:44px; height:44px;}
.sc-ctrl .sc-main:hover{background:#f2c463; color:var(--bg);}
.sc-time{font-size:12px; color:var(--muted); min-width:84px; text-align:center; direction:ltr;}
.sc-close{background:none; border:0; color:var(--muted); font-size:24px; width:32px;}
.sc-close:hover{color:var(--danger);}
body.has-sc-player{padding-bottom:72px;}

/* قسم الأغاني في الرئيسية */
.home-tracks .tracklist{max-width:none; display:grid; grid-template-columns:repeat(auto-fill, minmax(min(380px,100%),1fr)); gap:14px;}
.home-tracks .track-cover{width:88px; height:88px;}
.home-tracks .wave{height:40px;}

@media (max-width:640px){
  .timeline{border-radius:12px;}
  .tweet{padding-inline:14px;}
  .track{padding:10px; gap:10px;}
  .track-cover{width:78px; height:78px;}
  .track-credit{display:none;}
  .track-play{width:40px; height:40px;}
  .sc-time{display:none;}
  .sc-inner{padding:8px 12px; gap:10px;}
  .home-tracks .tracklist{grid-template-columns:minmax(0,1fr);}
  .tw-actions{max-width:none;}
}

.tw-text .tw-h{font-family:var(--font-head); font-size:17px; margin:14px 0 6px; color:var(--gold);}
.tw-readmore{display:inline-block; margin-top:2px; color:var(--gold) !important; font-size:14px; font-weight:700;}

/* ---- منع تمدد الصفحة أفقيًا على الجوال (يمنع الحاجة لتحريك الشاشة) ---- */
.timeline, .tweet, .tracklist, .track, .track-body, .track-info, .track-top, .tw-media, .tw-text, .song-single{min-width:0; max-width:100%;}
.tracklist > *, .timeline > *{min-width:0;}
.track-title, .track-artist{max-width:100%;}
.tw-text, .tw-title, .track-embed{overflow-wrap:anywhere;}
.track-embed iframe{max-width:100%;}
.tw-media img{max-width:100%;}
.lb-img{max-width:94vw;}

/* ---------- الرياضة (فيديو تويتر) ---------- */
.sport-feed{max-width:640px; margin:0 auto; display:flex; flex-direction:column; gap:18px;}
.sport-card{background:var(--surface); border:1px solid var(--surface-3); border-radius:16px; overflow:hidden;}
.sport-media{position:relative; background:#000; aspect-ratio:var(--r,1.7778); width:min(100%, calc(78vh * var(--r,1.7778))); margin-inline:auto; display:grid; place-items:center; overflow:hidden;}
.sport-media video,.sport-media img{width:100%; height:100%; max-height:78vh; object-fit:contain !important; background:#000; display:block;}
.sport-sound{position:absolute; bottom:12px; inset-inline-end:12px; width:42px; height:42px; border-radius:50%; border:0; cursor:pointer;
  background:rgba(0,0,0,.65); color:#fff; font-size:18px;}
.sport-body{padding:12px 16px 14px;}
.sport-title{display:block; font-family:var(--font-head); font-weight:800; font-size:17px; line-height:1.6; overflow-wrap:anywhere; margin:0 0 6px;}
a.sport-title:hover{color:var(--gold);}
.sport-single .sport-title{font-size:20px;}
.sport-meta{display:flex; align-items:center; justify-content:space-between; gap:10px; font-size:13px; color:var(--muted);}
.sport-wrap{max-width:640px; margin:0 auto;}
.sport-grid{display:grid; grid-template-columns:repeat(auto-fill,minmax(min(220px,100%),1fr)); gap:14px;}
.sport-tcard{display:block; background:var(--surface); border:1px solid var(--surface-3); border-radius:14px; overflow:hidden; min-width:0;}
.sport-tthumb{position:relative; display:block; aspect-ratio:16/9; background:var(--surface-2);}
.sport-tthumb img{width:100%; height:100%; object-fit:cover; display:block;}
.sport-tplay{position:absolute; inset:0; margin:auto; width:44px; height:44px; border-radius:50%; background:rgba(0,0,0,.6); color:#fff;
  display:grid; place-items:center; font-style:normal; font-size:16px;}
.sport-ttitle{display:block; padding:10px 12px; font-weight:700; font-size:14px; line-height:1.6; overflow-wrap:anywhere;
  display:-webkit-box; -webkit-line-clamp:2; -webkit-box-orient:vertical; overflow:hidden;}

/* فيديو داخل الخبر */
.sport-inline{margin-top:12px; border-radius:16px; overflow:hidden; border:1px solid var(--surface-3);}
.tweet .sport-inline{border-radius:16px;}
