/*
 * Airwright CMS – Radio player module.
 * Adds to the player bar of the template: cover, channel menu, pop-up player,
 * channel cards and the list "recently played". Uses the --aw-… colours of the template.
 */
/* ---- the bar: flat, full width, square cells ---- */
body.has-player { --aw-player-h: 64px; }
body.has-player.aw-player-collapsed { padding-bottom: 0; }
.player.apb { height: var(--aw-player-h); background: var(--aw-surface, #0d0f14); border-top: 1px solid var(--aw-line, rgba(255, 255, 255, .09)); backdrop-filter: none; -webkit-backdrop-filter: none; transition: transform .25s ease; box-shadow: 0 -14px 40px -22px rgba(0, 0, 0, .8); }
.apb-row { display: flex; align-items: stretch; height: 100%; }
.apb-play { width: var(--aw-player-h); flex: none; border: 0; padding: 0; display: grid; place-items: center; cursor: pointer; color: #fff; background: var(--aw-accent, #ff3d6e); transition: filter .15s; }
.apb-play:hover { filter: brightness(1.12); }
.apb .ico-stop, .apb.is-playing .ico-play { display: none; }
.apb.is-playing .ico-stop { display: block; }
.apb.is-loading .apb-play svg { animation: apb-wait .8s ease-in-out infinite alternate; }
@keyframes apb-wait { to { opacity: .35; } }
.apb-cover { width: var(--aw-player-h); height: 100%; flex: none; display: grid; place-items: center; overflow: hidden; background: var(--aw-surface-2, #171a22); }
.apb-cover img { width: 100%; height: 100%; object-fit: cover; display: block; }
.apb-cover img:not([hidden]) + .player-eq { display: none; }
.apb-meta { flex: 1; min-width: 0; display: flex; flex-direction: column; justify-content: center; padding: 0 18px; line-height: 1.3; }
.apb-title { font-size: 16px; font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.apb-sub { display: flex; align-items: center; gap: 8px; font-size: 13px; color: var(--aw-muted, #98a2b6); white-space: nowrap; overflow: hidden; }
.apb-sub > span:last-child { overflow: hidden; text-overflow: ellipsis; }
.apb-time { align-self: center; padding: 0 18px; font-size: 13px; font-weight: 600; letter-spacing: .06em; font-variant-numeric: tabular-nums; color: var(--aw-muted, #98a2b6); white-space: nowrap; }
.apb-tool { min-width: 56px; flex: none; display: inline-flex; align-items: center; justify-content: center; gap: 9px; padding: 0 14px; border: 0; border-left: 1px solid var(--aw-line, rgba(255, 255, 255, .09)); background: none; color: var(--aw-muted, #98a2b6); font: inherit; font-size: 14px; font-weight: 600; text-decoration: none; cursor: pointer; }
.apb-tool:hover, .apb-tool[aria-expanded="true"] { background: var(--aw-surface-2, #171a22); color: var(--aw-text, #eef1f7); }
.apb-vol { display: flex; align-items: center; gap: 10px; padding: 0 16px; border-left: 1px solid var(--aw-line, rgba(255, 255, 255, .09)); color: var(--aw-muted, #98a2b6); flex: none; }
.apb-vol input { width: 96px; accent-color: var(--aw-accent, #ff3d6e); }
.apb-progress { position: absolute; left: 0; right: 0; top: -2px; height: 2px; pointer-events: none; }
.apb-progress i { display: block; height: 100%; width: 0; background: var(--aw-accent, #ff3d6e); transition: width 1s linear; }

/* folded away: only a small tab stays */
.player.apb.is-collapsed { transform: translateY(100%); box-shadow: none; }
.apb-reopen { position: absolute; right: 18px; bottom: 100%; display: none; align-items: center; gap: 8px; height: 34px; padding: 0 14px; border: 1px solid var(--aw-line, rgba(255, 255, 255, .09)); border-bottom: 0; border-radius: 10px 10px 0 0; background: var(--aw-surface, #0d0f14); color: var(--aw-text, #eef1f7); cursor: pointer; }
.apb.is-collapsed .apb-reopen { display: inline-flex; }
.apb.is-collapsed .apb-progress { display: none; }

/* channels: a panel that opens above the bar */
.apb-drawer { position: absolute; left: 0; right: 0; bottom: 100%; max-height: 62vh; overflow-y: auto; background: var(--aw-surface, #0d0f14); border-top: 1px solid var(--aw-line, rgba(255, 255, 255, .09)); box-shadow: 0 -24px 60px -24px rgba(0, 0, 0, .85); }
.apb-drawer-in { display: grid; grid-template-columns: repeat(auto-fill, minmax(270px, 1fr)); }
.apb-drawer button { display: flex; align-items: center; gap: 14px; padding: 12px 18px; border: 0; border-right: 1px solid var(--aw-line, rgba(255, 255, 255, .09)); border-bottom: 1px solid var(--aw-line, rgba(255, 255, 255, .09)); background: none; color: inherit; font: inherit; text-align: left; cursor: pointer; }
.apb-drawer button:hover { background: var(--aw-surface-2, #171a22); }
.apb-drawer button.active { box-shadow: inset 3px 0 0 var(--aw-accent, #ff3d6e); background: var(--aw-surface-2, #171a22); }
.apb-drawer img, .apb-drawer-mark { width: 46px; height: 46px; object-fit: cover; flex: none; }
.apb-drawer-mark { display: grid; place-items: center; font-weight: 800; color: #fff; background: var(--aw-accent, #ff3d6e); }
.apb-drawer span:not(.apb-drawer-mark) { display: flex; flex-direction: column; flex: 1; min-width: 0; line-height: 1.3; }
.apb-drawer small { color: var(--aw-muted, #98a2b6); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.apb-drawer svg { color: var(--aw-muted, #98a2b6); flex: none; }
.apb-drawer button.active svg { color: var(--aw-accent, #ff3d6e); }

/* button in the header of the site */
.btn-webplayer { gap: 8px; }

/* channel cards */
.channel-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 16px; }
.channel-card { display: flex; align-items: center; gap: 14px; padding: 14px; border-radius: var(--aw-radius, 18px); border: 1px solid var(--aw-line, rgba(255, 255, 255, .09)); background: var(--aw-surface, #10131b); color: inherit; font: inherit; text-align: left; cursor: pointer; transition: transform .15s, border-color .15s; }
.channel-card:hover, .channel-card.is-playing { border-color: var(--aw-accent, #ff3d6e); transform: translateY(-2px); }
.channel-card img, .channel-card-mark { width: 64px; height: 64px; border-radius: 14px; object-fit: cover; flex: none; }
.channel-card-mark { display: grid; place-items: center; font-size: 26px; font-weight: 800; color: #fff; background: linear-gradient(135deg, var(--aw-accent, #ff3d6e), var(--aw-accent-2, #7c5cff)); }
.channel-card-text { display: flex; flex-direction: column; flex: 1; min-width: 0; line-height: 1.3; }
.channel-card-text b { font-size: 18px; }
.channel-card-text small { color: var(--aw-muted, #98a2b6); }
.channel-card-play { width: 42px; height: 42px; border-radius: 50%; display: grid; place-items: center; flex: none; color: #fff; background: linear-gradient(120deg, var(--aw-accent, #ff3d6e), var(--aw-accent-2, #7c5cff)); }
.channel-card .ico-stop, .channel-card.is-playing .ico-play { display: none; }
.channel-card.is-playing .ico-stop { display: block; }

/* recently played */
.played { list-style: none; margin: 0 auto; padding: 0; max-width: 780px; }
.played li { display: flex; align-items: center; gap: 16px; padding: 12px 4px; border-bottom: 1px solid var(--aw-line, rgba(255, 255, 255, .09)); }
.played time { width: 52px; flex: none; color: var(--aw-muted, #98a2b6); font-variant-numeric: tabular-nums; font-weight: 600; }
.played img, .played-nocover { width: 48px; height: 48px; border-radius: 10px; object-fit: cover; flex: none; background: var(--aw-surface-2, #171b26); display: grid; place-items: center; color: var(--aw-muted, #98a2b6); }
.played span:last-child { display: flex; flex-direction: column; min-width: 0; line-height: 1.35; }
.played small { color: var(--aw-muted, #98a2b6); }
.played-empty { color: var(--aw-muted, #98a2b6); justify-content: center; border: 0 !important; padding: 40px 0 !important; }
.played-small li { padding: 8px 0; gap: 12px; font-size: 15px; }
.played-small time { width: 44px; font-size: 13px; }
.played-small img { width: 38px; height: 38px; border-radius: 8px; }

/* pop-up player */
.popup-body { padding: 0 !important; min-height: 100vh; background:
    radial-gradient(70% 50% at 20% 0, color-mix(in srgb, var(--aw-accent, #ff3d6e) 30%, transparent), transparent 70%),
    radial-gradient(70% 50% at 100% 10%, color-mix(in srgb, var(--aw-accent-2, #7c5cff) 30%, transparent), transparent 70%), var(--aw-bg, #07080c); }
.player.player-popup { position: static; height: auto; background: none; border: 0; backdrop-filter: none; -webkit-backdrop-filter: none; max-width: 420px; margin: 0 auto; padding: 26px 22px 30px; display: flex; flex-direction: column; align-items: center; text-align: center; }
.popup-cover { width: min(260px, 70vw); aspect-ratio: 1; border-radius: 26px; margin: 18px 0 20px; display: grid; place-items: center; overflow: hidden; background: linear-gradient(135deg, var(--aw-accent, #ff3d6e), var(--aw-accent-2, #7c5cff)); box-shadow: 0 30px 70px -30px var(--aw-accent, #ff3d6e); }
.popup-cover img { width: 100%; height: 100%; object-fit: cover; }
.popup-cover img:not([hidden]) + .player-eq { display: none; }
.popup-cover .player-eq { height: 70px; gap: 8px; }
.popup-cover .player-eq i { width: 10px; background: #fff; border-radius: 5px; }
.popup-now { font-size: 20px; font-weight: 700; margin: 0 0 20px; min-height: 1.5em; }
.popup-controls { display: flex; align-items: center; gap: 20px; }
.player-popup .player-btn { width: 72px; height: 72px; }
.player-popup .player-vol { display: flex; }
.popup-channels { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; margin-top: 24px; }
.popup-channels button { padding: 7px 14px; border-radius: 999px; border: 1px solid var(--aw-line, rgba(255, 255, 255, .09)); background: var(--aw-surface, #10131b); color: inherit; font: inherit; font-size: 14px; font-weight: 600; cursor: pointer; }
.popup-channels button.active { border-color: var(--aw-accent, #ff3d6e); background: color-mix(in srgb, var(--aw-accent, #ff3d6e) 18%, var(--aw-surface, #10131b)); }
.popup-h { font-size: 13px; text-transform: uppercase; letter-spacing: .12em; color: var(--aw-muted, #98a2b6); margin: 30px 0 6px; }
.player-popup .played { width: 100%; text-align: left; }

/* home: on-air card (player/onair.html) */
.onair { display: grid; grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr); gap: 22px; }
.onair-card { display: flex; gap: 22px; align-items: center; padding: 22px; border-radius: calc(var(--aw-radius, 18px) + 6px); border: 1px solid var(--aw-line, rgba(255, 255, 255, .09)); background: linear-gradient(140deg, color-mix(in srgb, var(--aw-accent, #ff3d6e) 20%, var(--aw-surface, #10131b)), var(--aw-surface, #10131b) 60%); }
.onair-cover { width: clamp(120px, 22vw, 210px); aspect-ratio: 1; border-radius: 18px; overflow: hidden; flex: none; display: grid; place-items: center; background: linear-gradient(135deg, var(--aw-accent, #ff3d6e), var(--aw-accent-2, #7c5cff)); box-shadow: 0 24px 60px -28px var(--aw-accent, #ff3d6e); }
.onair-cover img { width: 100%; height: 100%; object-fit: cover; }
.onair-text { min-width: 0; flex: 1; display: flex; flex-direction: column; gap: 6px; }
.onair-now { font-size: clamp(22px, 2.8vw, 34px); font-weight: 800; letter-spacing: -.02em; line-height: 1.15; overflow-wrap: anywhere; }
.onair-next { color: var(--aw-muted, #98a2b6); margin: 4px 0 12px; }
.onair-next b { color: var(--aw-text, #eef1f7); font-weight: 600; }
.onair-side { padding: 20px 22px; border-radius: calc(var(--aw-radius, 18px) + 6px); border: 1px solid var(--aw-line, rgba(255, 255, 255, .09)); background: var(--aw-surface, #10131b); }
.onair-side h2 { font-size: 13px; text-transform: uppercase; letter-spacing: .14em; color: var(--aw-muted, #98a2b6); margin-bottom: 6px; }
.onair-side .more { display: inline-block; margin-top: 12px; font-size: 14.5px; }

@media (max-width: 860px) {
    .onair { grid-template-columns: 1fr; }
    .onair-card { flex-direction: column; align-items: flex-start; }
    .apb-hide-s, .apb-time { display: none; }
    .apb-tool-wide span { display: none; }
    .apb-tool { min-width: 50px; padding: 0 10px; }
    .apb-meta { padding: 0 12px; }
    .btn-webplayer span { display: none; }
    .btn-webplayer { width: 40px; height: 40px; padding: 0; }
}

/* the loose block "Recently played" (templates/player/recent.html) */
.recent-block { padding: 18px 20px; border-radius: var(--aw-radius, 14px); background: var(--aw-surface, #151a26); border: 1px solid var(--aw-line, rgba(255, 255, 255, .09)); }
.recent-head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; margin-bottom: 6px; }
.recent-head h2 { margin: 0; font-size: 18px; }
.recent-head a { font-size: 13.5px; font-weight: 700; white-space: nowrap; color: var(--aw-accent, #ff3d6e); text-decoration: none; }
.recent-block .played { max-width: none; }
.recent-block .played li:last-child { border-bottom: 0; }
.recent-block .played-empty { padding: 18px 0 !important; }
