:root {
    --vl-card-thumb-bg: #e9ecef;
    --vl-card-thumb-fg: #495057;
}

[data-bs-theme="dark"] {
    --vl-card-thumb-bg: #2b3035;
    --vl-card-thumb-fg: #adb5bd;
}

/* Strong, always-visible focus ring; some Bootstrap components soften the
   default outline, which fails WCAG 2.2's focus-visibility expectations. */
a:focus-visible,
button:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible,
.btn:focus-visible,
.nav-link:focus-visible,
.form-check-input:focus-visible {
    outline: 3px solid #0d6efd;
    outline-offset: 2px;
}

.skip-link {
    z-index: 1080;
}

.video-card {
    /* Clips the thumbnail's square corners to the card's own rounded corners -
       without this, a thumbnail image pokes past the card's rounded edge. */
    overflow: hidden;
}

.video-card-thumb {
    aspect-ratio: 16 / 9;
    background-color: var(--vl-card-thumb-bg);
    color: var(--vl-card-thumb-fg);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2.5rem;
    overflow: hidden;
}

.video-card-thumb img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.video-card-title {
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.video-card-desc {
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* Minimum 24x24 CSS px target size for icon-only controls (WCAG 2.2 SC 2.5.8),
   sized to match the .btn-sm buttons it typically sits next to (e.g. in the nav). */
.btn-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 2rem;
    min-height: 2rem;
}

.category-pill.active {
    font-weight: 600;
}

.library-card {
    transition: transform 0.15s ease-in-out, box-shadow 0.15s ease-in-out;
    overflow: visible;
}

.library-card:hover,
.library-card:focus-within {
    transform: translateY(-4px);
    box-shadow: 0 0.75rem 1.5rem rgba(0, 0, 0, 0.15) !important;
}

.library-card-header {
    /* ~45% of the card's own height (the card is a flex column, so this
       flex-basis resolves against its height) rather than a fixed aspect
       ratio, so the image reliably reads as a proper header, not a sliver. */
    flex: 0 0 45%;
    min-height: 8rem;
    background: linear-gradient(135deg, #0d6efd, #6610f2);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 3rem;
    overflow: hidden;
    position: relative;
    border-radius: var(--bs-card-inner-border-radius) var(--bs-card-inner-border-radius) 0 0;
}

.library-card-header-img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.library-card-header-icon-img {
    width: 4rem;
    height: 4rem;
    object-fit: contain;
}

.library-card-lock {
    position: absolute;
    top: 0.5rem;
    right: 0.5rem;
    background: rgba(0, 0, 0, 0.55);
    color: #fff;
    border-radius: 50%;
    width: 2rem;
    height: 2rem;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.9rem;
}

.library-card-icon-badge {
    width: 3.25rem;
    height: 3.25rem;
    margin: -1.75rem 0 0 1rem;
    background: var(--bs-body-bg);
    border: 2px solid var(--bs-body-bg);
    border-radius: 50%;
    box-shadow: 0 0.125rem 0.5rem rgba(0, 0, 0, 0.2);
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    position: relative;
    z-index: 1;
}

.library-card-icon-badge img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

@media (prefers-reduced-motion: reduce) {
    * {
        transition-duration: 0.001ms !important;
        animation-duration: 0.001ms !important;
    }
}
