/* Home-page course modal (templates/academy/_popup.html).
   Uses the shared tokens and .btn/.badge/.tag from static/aurebio/. */

.academy-popup[hidden] { display: none; }
.academy-popup { position: fixed; inset: 0; z-index: 100; display: flex; align-items: center; justify-content: center; padding: 24px; }
.academy-popup__backdrop { position: absolute; inset: 0; background: rgba(6, 22, 47, .62); }
.academy-popup__dialog { position: relative; width: min(560px, 100%); max-height: calc(100vh - 48px); overflow-y: auto; border-radius: var(--ab-radius-lg); background: #fff; box-shadow: var(--ab-shadow-lg); color: var(--ab-ink); }
.academy-popup__handle { display: none; }
.academy-popup__head { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; padding: 22px 24px 16px; }
.academy-popup__head .kicker { margin-bottom: 4px !important; }
.academy-popup__head h2 { font-size: 20px; font-weight: 800; letter-spacing: -.02em; }
.academy-popup__head h2:focus, .academy-popup__head h2:focus-visible { outline: none; box-shadow: none; }
.academy-popup .academy-popup__x { display: grid; place-items: center; flex: none; width: 44px; height: 44px; margin: -8px -10px 0 0; border: 0; border-radius: var(--ab-radius-sm); background: none; color: var(--ab-muted); font-size: 24px; cursor: pointer; }
.academy-popup__x:hover { background: var(--ab-canvas); color: var(--ab-ink); }

.academy-popup__row { display: grid; grid-template-columns: 72px minmax(0, 1fr) auto; gap: 16px; align-items: center; padding: 18px 24px; border-top: 1px solid var(--ab-line); }
.academy-popup__row h3 { margin-top: 6px !important; font-size: var(--ab-text-lg); font-weight: 800; letter-spacing: -.02em; }
.academy-popup__meta { color: var(--ab-muted); font-size: var(--ab-text-sm); line-height: 1.55; }
.academy-popup__thumb { position: relative; display: block; width: 72px; height: 96px; overflow: hidden; border: 1px solid var(--ab-line); border-radius: var(--ab-radius-sm); background: var(--ab-navy-900); }
.academy-popup__thumb img { width: 100%; height: 100%; object-fit: cover; object-position: top; }
.academy-popup__thumb--fallback { display: flex; flex-direction: column; justify-content: space-between; padding: 8px; background: linear-gradient(160deg, var(--ab-navy-800), var(--ab-navy-950)); color: #fff !important; }
.academy-popup__thumb--fallback i { width: 10px; height: 10px; border-radius: 50%; background: var(--ab-sky-300); }
.academy-popup__thumb--fallback b { font-size: 20px; line-height: 1.1; letter-spacing: -.02em; }
.academy-popup__actions { display: grid; gap: 4px; justify-items: stretch; }
.academy-popup__link { display: block; padding: 6px 0; color: var(--ab-blue-700) !important; font-size: var(--ab-text-sm); font-weight: 700; text-align: center; }
.academy-popup__link:hover { text-decoration: underline; text-underline-offset: 3px; }
.academy-popup__foot { position: sticky; bottom: 0; display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 10px 24px; border-top: 1px solid var(--ab-line); border-radius: 0 0 var(--ab-radius-lg) var(--ab-radius-lg); background: var(--ab-canvas); }

html.academy-popup-open { overflow: hidden; }

/* Mobile: bottom sheet */
@media (max-width: 640px) {
    .academy-popup { align-items: flex-end; padding: 0; }
    .academy-popup__dialog { width: 100%; max-height: 88vh; border-radius: var(--ab-radius-lg) var(--ab-radius-lg) 0 0; }
    .academy-popup__handle { display: block; width: 40px; height: 4px; margin: 10px auto 0; border-radius: 999px; background: var(--ab-line); }
    .academy-popup__head { padding: 14px 20px 12px; }
    .academy-popup__row { grid-template-columns: 56px minmax(0, 1fr); gap: 12px 14px; padding: 16px 20px; }
    .academy-popup__thumb { width: 56px; height: 75px; }
    .academy-popup__thumb--fallback b { font-size: 16px; }
    .academy-popup__actions { grid-column: 1 / -1; grid-template-columns: 1fr 1fr; gap: 8px; }
    .academy-popup__link { display: flex; align-items: center; justify-content: center; min-height: 40px; border: 1px solid var(--ab-ink); border-radius: var(--ab-radius-sm); color: var(--ab-ink) !important; font-size: 15px; }
    .academy-popup__actions .academy-popup__link:only-child { grid-column: 1 / -1; }
    .academy-popup__foot { display: grid; grid-template-columns: 1fr 1fr; padding: 10px 20px calc(10px + env(safe-area-inset-bottom)); border-radius: 0; }
}
