/* UX pass A (2026-11-28): Home, Live, Guide, Radio, Sports, header, footer, tab bar. Loaded last; fixes only. */

/* ---- header: phones. Every action stays inside the gutter at 360-430px in both languages ---- */
@media (max-width: 430px) {
  .nav { gap: 6px; }
  .nav .brand { gap: 8px; }
  .nav .nav-actions { gap: 2px; }
  .nav .ai-trigger { width: 40px; }
  .nav .premium-cta, .nav [data-signin] { margin-inline: 0; }
  .nav .lang-btn { width: 36px; }
  .nav .nav-actions > a.icon-btn { width: 40px; }
  .nav [data-signin] { padding-inline: 12px; }
}
@media (max-width: 380px) {
  .nav { gap: 4px; }
  .nav .ai-trigger, .nav .nav-actions > a.icon-btn { width: 36px; }
  .nav .premium-cta { width: 36px; height: 36px; min-height: 36px; }
  .nav .lang-btn { width: 32px; }
  .nav [data-signin] { padding-inline: 10px; font-size: 13px; }
}
/* the Arabic "ع" language button sits on the same optical centre as "EN" */
.nav .lang-btn[lang="ar"] { font-size: 17px; line-height: 1; padding-bottom: 6px; letter-spacing: 0; }

/* ---- bottom tab bar: page text must not read through the labels ---- */
@media (max-width: 960px) {
  .tabbar { background: linear-gradient(180deg, rgba(9, 10, 15, 0.9), rgba(7, 8, 12, 0.97)); }
}

/* ---- Home hero ---- */
/* portrait tablets: the hero was shorter than its own content, so the kicker slid under the header */
@media (min-width: 721px) and (max-width: 1100px) {
  .billboard { min-height: 640px; }
}
/* phones: the first rail overlaps the hero's foot; fade the video out fully beneath it */
@media (max-width: 720px) {
  .bb-scrim::after { content: ""; position: absolute; inset-inline: 0; bottom: 0; height: 200px; background: linear-gradient(to top, var(--ink-0) 42%, rgba(5, 6, 9, 0)); pointer-events: none; }
}

/* ---- category chips: the selected chip's soft shadow was cut flat by the scroller ---- */
.chips { padding-block: 4px 14px; margin-bottom: -10px; }

/* ---- Guide: a programme that started before the visible window keeps its title and time in view
        (they slide with the scroll instead of hiding under the channel column) ---- */
.epg-prog { overflow: clip; }
.epg-prog b, .epg-prog small { position: sticky; inset-inline-start: calc(var(--colw) + 12px); display: block; width: max-content; max-width: 100%; }
.epg-prog small { margin-top: 2px; }
.epg-prog b .badge-live { vertical-align: 1px; }

/* ---- Live TV, phones: the two-up cards are short, so the logo sits below the LIVE badge instead of under it ---- */
@media (max-width: 600px) {
  .grid-ch .ccard .ch-stage .ch-brand { top: 30px; bottom: 6px; height: calc(100% - 44px); width: 60%; }
}
/* off-air cards: the initials no longer ghost through a logo that did load */
.ccard.off-air .ch-stage.has-logo .ch-mono { opacity: 0; }

/* ---- Radio player screen: station name and its line under it no longer touch; Arabic marks get room ---- */
.ra-sub { margin-top: 10px; line-height: 1.6; }
:root[dir="rtl"] .ra-name { line-height: 1.45; letter-spacing: 0; }
:root[dir="rtl"] .ra-sub { margin-top: 6px; line-height: 1.8; }
@media (pointer: coarse) { .ra-btn.ra-sm { width: 44px; height: 44px; } }

/* ---- Sports ---- */
/* featured match: both teams sit next to the score (the home side was pushed to the far edge of the card) */
@media (min-width: 761px) { .mc-team:first-child { justify-content: flex-start; } }
/* sports channel tiles: logos stay inside the tile and clear of the LIVE badge (tall crests were cut at the bottom) */
.sc-logo img { position: absolute; inset: 26px 12px 8px; width: calc(100% - 24px); height: calc(100% - 34px); max-width: none; max-height: none; object-fit: contain; }
/* sport switcher: same soft-shadow room as the other chip rows, 44px targets on touch */
@media (pointer: coarse) { .sp-sw, .sp-chip, .sp-segb { min-height: 44px; } }

/* ================= Phone tab bar v2: five items, raised Live in the centre, "More" sheet ================= */
@media (max-width: 960px) {
  #tabbar { grid-template-columns: repeat(5, minmax(0, 1fr)); align-items: end; overflow: visible;
    padding: 6px max(8px, env(safe-area-inset-left)) calc(6px + env(safe-area-inset-bottom)) max(8px, env(safe-area-inset-right)); }
  #tabbar .tb { position: relative; appearance: none; border: 0; background: none; font: inherit; cursor: pointer; display: grid; justify-items: center; align-content: end; gap: 4px;
    min-width: 0; min-height: 56px; padding: 4px 2px 2px; color: rgba(236, 238, 243, 0.6); -webkit-tap-highlight-color: transparent; transition: color 0.2s; }
  #tabbar .tb .tb-ic { display: grid; place-items: center; width: 56px; height: 32px; border-radius: 99px; transition: background 0.25s, transform 0.2s; }
  #tabbar .tb svg { width: 24px; height: 24px; }
  #tabbar .tb .tb-label { max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 11.5px; font-weight: 500; line-height: 1.35; letter-spacing: 0; padding-inline: 2px; }
  :root[dir="rtl"] #tabbar .tb .tb-label { font-size: 12px; line-height: 1.5; }
  #tabbar .tb:active .tb-ic { transform: scale(0.92); }
  #tabbar .tb:focus-visible { outline: 2px solid #fff; outline-offset: -2px; border-radius: 14px; }
  #tabbar .tb[aria-current="page"], #tabbar .tb-more[data-current], #tabbar .tb-more[aria-expanded="true"] { color: #fff; }
  #tabbar .tb[aria-current="page"] .tb-label, #tabbar .tb-more[data-current] .tb-label { font-weight: 700; }
  #tabbar .tb-more[data-current] .tb-ic, #tabbar .tb-more[aria-expanded="true"] .tb-ic { background: rgba(225, 29, 42, 0.16); box-shadow: inset 0 0 0 1px rgba(255, 90, 100, 0.28); }
  #tabbar .tb-more[data-current] svg { color: var(--red-ink); }
  #tabbar .tb::before, #tabbar .tb-item::before { display: none; }
  #tabbar .tb { z-index: 1; }

  /* centre item: Live, raised out of the bar */
  #tabbar .tb-main .tb-ic { width: 60px; height: 60px; margin-top: -24px; border-radius: 50%; color: #fff; background: var(--grad-signal);
    box-shadow: 0 0 0 5px var(--ink-0), 0 10px 24px -8px rgba(225, 29, 42, 0.7); animation: none; }
  #tabbar .tb-main svg, #tabbar .tb-main[aria-current="page"] svg { width: 28px; height: 28px; color: #fff; filter: none; }
  #tabbar .tb-main[aria-current="page"] .tb-ic { background: var(--grad-signal); box-shadow: 0 0 0 5px var(--ink-0), inset 0 0 0 2px rgba(255, 255, 255, 0.9), 0 10px 28px -6px rgba(225, 29, 42, 0.9); }
  #tabbar .tb-main .tb-label { color: #fff; font-weight: 600; }

  /* "More" sheet */
  #tabbar .tb-scrim { position: absolute; inset-inline: 0; bottom: 100%; height: 100vh; background: rgba(3, 4, 6, 0.6); }
  #tabbar .tb-sheet { position: absolute; inset-inline: max(10px, env(safe-area-inset-left)); bottom: calc(100% + 30px); display: grid; gap: 2px; padding: 8px 8px 10px;
    border-radius: 22px; background: #12141b; box-shadow: inset 0 0 0 1px var(--line-2), 0 30px 70px -20px #000; }
  #tabbar .tb-sheet[hidden], #tabbar .tb-scrim[hidden] { display: none; }
  #tabbar .tb-grip { justify-self: center; width: 38px; height: 4px; border-radius: 4px; background: rgba(255, 255, 255, 0.22); margin: 2px 0 6px; }
  #tabbar .tb-item { display: flex; align-items: center; gap: 14px; min-height: 54px; padding: 0 12px; border-radius: 14px; color: var(--text); font-size: 16px; font-weight: 600; line-height: 1.5; }
  #tabbar .tb-item:active, #tabbar .tb-item:focus-visible { background: rgba(255, 255, 255, 0.08); outline: none; }
  #tabbar .tb-item-ic { flex: none; width: 40px; height: 40px; border-radius: 12px; display: grid; place-items: center; background: rgba(255, 255, 255, 0.06); color: var(--text-2); }
  #tabbar .tb-item svg { width: 22px; height: 22px; }
  #tabbar .tb-item[aria-current="page"] { background: rgba(225, 29, 42, 0.14); }
  #tabbar .tb-item[aria-current="page"] .tb-item-ic { color: var(--red-ink); background: rgba(225, 29, 42, 0.18); }

  main { padding-bottom: calc(96px + env(safe-area-inset-bottom)); }
  .radio-mini { bottom: calc(100px + env(safe-area-inset-bottom)); }
  body.has-radio-mini main { padding-bottom: calc(184px + env(safe-area-inset-bottom)); }

  /* Radio page: the TV / Radio switch comes first in the hero, full width, so the Live tab's two halves are one tap apart */
  .hero-radio .th-actions > .seg { order: -1; flex: 1 1 100%; display: flex; }
  .hero-radio .th-actions > .seg a { flex: 1; justify-content: center; min-height: 48px; }
  .page-actions > .seg a { min-height: 48px; }
}
@media (max-width: 960px) and (prefers-reduced-motion: no-preference) {
  #tabbar .tb-sheet { animation: tbSheet 0.22s cubic-bezier(0.2, 0.8, 0.2, 1) both; }
  #tabbar .tb-scrim { animation: tbFade 0.2s ease both; }
}
@keyframes tbSheet { from { transform: translateY(14px); opacity: 0; } }
@keyframes tbFade { from { opacity: 0; } }
/* sports channel strip: snapping keeps the first tile inside the row's padding instead of flush on the screen edge */
.sc-row { scroll-padding-inline: var(--s4); }
@media (max-width: 720px) { .sc-row { scroll-padding-inline: var(--s3); } }

/* Live speed dial (phone): the centre button opens two round choices, TV and Radio */
#tabbar .tb-dial { position: absolute; left: 50%; bottom: calc(100% + 14px); transform: translateX(-50%); display: flex; gap: 18px; pointer-events: none; z-index: 3; }
#tabbar .tb-dial-btn { display: grid; justify-items: center; gap: 6px; color: #fff; font-size: 12.5px; font-weight: 600; text-decoration: none;
  opacity: 0; transform: translateY(18px) scale(.6); transition: opacity .22s ease, transform .3s cubic-bezier(.2,.9,.3,1.25); transition-delay: calc(var(--i) * 40ms); }
#tabbar .tb-dial-ic { width: 60px; height: 60px; border-radius: 50%; display: grid; place-items: center; background: rgba(18,19,26,.92); box-shadow: 0 10px 28px -8px rgba(0,0,0,.7), inset 0 0 0 1px rgba(255,255,255,.16); -webkit-backdrop-filter: blur(14px); backdrop-filter: blur(14px); }
#tabbar .tb-dial-ic svg { width: 26px; height: 26px; }
#tabbar .tb-dial-btn span:last-child { padding: 3px 10px; border-radius: 999px; background: rgba(10,11,15,.72); }
#tabbar.dial-open .tb-dial { pointer-events: auto; }
#tabbar.dial-open .tb-dial-btn { opacity: 1; transform: none; }
#tabbar.dial-open .tb-main .tb-ic { transform: scale(.92); box-shadow: 0 0 0 5px var(--ink-0), inset 0 0 0 2px rgba(255,255,255,.9); }
#tabbar .tb-main .tb-ic { transition: transform .25s ease; }
@media (prefers-reduced-motion: reduce) { #tabbar .tb-dial-btn, #tabbar .tb-main .tb-ic { transition: none; } }
