/* Shared 3D course card - used everywhere a course card is rendered via
   web/functions/course-card.php (courses list, category pages, landing
   pages, More Courses, homepage, wishlist, bundle detail). Keep this file
   the single source of truth for the card look so it never drifts again. */

.wva-course-card {
    position: relative;
    margin-bottom: 34px;
    height: 100%;
}

/* Two thin stacked layers peeking below the card; they fan out on hover.
   Purely decorative, so they're aria-hidden and sit behind the card. */
.wva-cc-layer {
    position: absolute;
    left: 8%;
    right: 8%;
    bottom: -6px;
    height: 18px;
    border-radius: 14px;
    background: #ffffff;
    box-shadow: 0 10px 20px rgba(6, 41, 70, .08);
    z-index: 0;
    transition: transform .45s cubic-bezier(.22, .61, .36, 1), opacity .45s ease;
    will-change: transform;
}

.wva-cc-layer-2 {
    bottom: -13px;
    left: 13%;
    right: 13%;
    opacity: .7;
}

.wva-course-card:hover .wva-cc-layer-1,
.wva-course-card:focus-within .wva-cc-layer-1 {
    transform: translate(-12px, 5px) rotate(-5deg);
}

.wva-course-card:hover .wva-cc-layer-2,
.wva-course-card:focus-within .wva-cc-layer-2 {
    transform: translate(12px, 9px) rotate(5deg);
}

.wva-cc-tilt {
    position: relative;
    z-index: 1;
    height: 100%;
    transform: perspective(1200px) rotateX(var(--wcc-rx, 0deg)) rotateY(var(--wcc-ry, 0deg)) translateY(var(--wcc-ty, 0px));
    transition: transform .35s cubic-bezier(.22, .61, .36, 1);
    transform-style: preserve-3d;
    will-change: transform;
}

.wva-course-card:hover .wva-cc-tilt,
.wva-course-card:focus-within .wva-cc-tilt {
    --wcc-ty: -10px;
}

.wva-cc-body {
    position: relative;
    display: flex;
    flex-direction: column;
    height: 100%;
    background: #ffffff;
    border-radius: 20px;
    box-shadow: 0 2px 6px rgba(6, 41, 70, .06), 0 18px 40px rgba(6, 41, 70, .10);
    overflow: hidden;
}

/* "Deeper shadow" on hover: a second, heavier shadow layer that fades in via
   opacity rather than animating box-shadow itself (transform/opacity only). */
.wva-cc-shadow-deep {
    position: absolute;
    inset: 0;
    border-radius: 20px;
    box-shadow: 0 34px 60px rgba(6, 41, 70, .22), 0 12px 22px rgba(6, 41, 70, .14);
    opacity: 0;
    transition: opacity .35s ease;
    pointer-events: none;
    z-index: 0;
}

.wva-course-card:hover .wva-cc-shadow-deep,
.wva-course-card:focus-within .wva-cc-shadow-deep {
    opacity: 1;
}

.wva-cc-thumb {
    position: relative;
    display: block;
    aspect-ratio: 16 / 9;
    margin: 14px 14px 0;
    border-radius: 16px;
    overflow: hidden;
    background: #f3f6fa;
    transform: translateZ(28px);
    transition: transform .35s cubic-bezier(.22, .61, .36, 1);
}

.wva-course-card:hover .wva-cc-thumb,
.wva-course-card:focus-within .wva-cc-thumb {
    transform: translateZ(50px) scale(1.02);
}

.wva-cc-thumb picture,
.wva-cc-thumb img {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: contain;
    background: #ffffff;
}

.wva-cc-gloss {
    position: absolute;
    inset: 0;
    background: linear-gradient(135deg, rgba(255, 255, 255, .4) 0%, rgba(255, 255, 255, 0) 38%);
    pointer-events: none;
}

/* Add to Study List: sits over the thumbnail's top right corner, but is not
   a child of .wva-cc-thumb (which has its own transform/stacking context) -
   kept at the .wva-cc-body level and raised above the title's stretched
   link so it's always independently clickable. */
.wva-cc-studylist {
    position: absolute;
    top: 24px;
    right: 24px;
    z-index: 2;
    margin: 0;
}

.wva-cc-studylist button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 34px;
    height: 34px;
    border-radius: 999px;
    border: none;
    background: rgba(255, 255, 255, .92);
    color: var(--color-primary, #062946);
    font-size: 14px;
    box-shadow: 0 4px 12px rgba(6, 41, 70, .22);
    cursor: pointer;
    transition: background-color .2s ease, color .2s ease;
}

.wva-cc-studylist button:hover,
.wva-cc-studylist button:focus-visible {
    background: var(--color-primary, #062946);
    color: #ffffff;
}

.wva-cc-ribbon {
    position: absolute;
    top: 12px;
    left: -6px;
    z-index: 2;
    background: var(--color-extra05, #f8941f);
    color: #ffffff;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: .02em;
    padding: 4px 12px;
    border-radius: 0 4px 4px 0;
    box-shadow: 0 4px 10px rgba(0, 0, 0, .15);
}

.wva-cc-content {
    display: block;
    padding: 16px 20px 0;
}

.wva-cc-category {
    display: inline-block;
    font-size: 11.5px;
    font-weight: 700;
    letter-spacing: .04em;
    text-transform: uppercase;
    color: var(--color-primary, #062946);
    background: rgba(6, 41, 70, .07);
    padding: 3px 10px;
    border-radius: 999px;
    margin-bottom: 8px;
}

.wva-cc-title {
    display: block;
    font-family: "Poppins", sans-serif;
    font-weight: 700;
    font-size: 18px;
    line-height: 1.35;
    color: var(--color-primary, #062946);
    margin-bottom: 8px;
}

/* Stretched link: the title is the only real navigation link that wraps
   text. Its ::after is absolutely positioned to cover the whole card (the
   nearest positioned ancestor is .wva-cc-body), so the whole card is
   clickable without nesting any element inside this anchor. Everything
   that must stay independently clickable (footer links/buttons, the study
   list button) is raised above it with z-index. */
.wva-cc-title-link {
    position: static;
    display: inline;
    color: inherit;
    text-decoration: none;
}

.wva-cc-title-link::after {
    content: "";
    position: absolute;
    inset: 0;
    z-index: 1;
}

.wva-cc-title-link:hover,
.wva-cc-title-link:focus-visible {
    text-decoration: underline;
}

.wva-cc-desc {
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
    font-size: 14px;
    line-height: 1.6;
    color: #5b6470;
    min-height: calc(14px * 1.6 * 3);
}

.wva-cc-accent {
    display: block;
    width: 36px;
    height: 3px;
    border-radius: 2px;
    background: var(--color-extra05, #f8941f);
    margin: 14px 20px 0;
}

.wva-cc-footer {
    position: relative;
    z-index: 2;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    padding: 14px 20px 18px;
    margin-top: auto;
}

.wva-cc-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 9px 18px;
    border-radius: 8px;
    border: 1.5px solid var(--color-primary, #062946);
    color: var(--color-primary, #062946);
    font-size: 14px;
    font-weight: 600;
    text-decoration: none;
    background: transparent;
    transition: background-color .2s ease, color .2s ease;
}

.wva-cc-btn:hover,
.wva-cc-btn:focus-visible {
    background: var(--color-primary, #062946);
    color: #ffffff;
}

.wva-cc-remove {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    border-radius: 8px;
    border: 1.5px solid #e2e6ec;
    background: transparent;
    color: #8a97a8;
    transition: border-color .2s ease, color .2s ease;
}

.wva-cc-remove:hover {
    border-color: #d33;
    color: #d33;
}

/* Touch: no tilt, just the resting shadow plus a small press effect. */
@media (hover: none), (pointer: coarse) {
    .wva-cc-tilt {
        transform: none !important;
    }

    .wva-course-card:active .wva-cc-body {
        transform: scale(.985);
        transition: transform .12s ease;
    }

    .wva-course-card:active .wva-cc-shadow-deep {
        opacity: 1;
    }

    .wva-course-card:active .wva-cc-thumb {
        transform: none;
    }
}

@media (prefers-reduced-motion: reduce) {

    .wva-cc-tilt,
    .wva-cc-layer,
    .wva-cc-shadow-deep,
    .wva-cc-thumb,
    .wva-cc-btn,
    .wva-cc-body {
        transition: none !important;
    }

    .wva-cc-tilt {
        transform: none !important;
    }
}

@media (max-width: 575px) {
    .wva-cc-title {
        font-size: 16px;
    }

    .wva-cc-content {
        padding: 14px 16px 0;
    }

    .wva-cc-footer {
        padding: 12px 16px 16px;
    }

    .wva-cc-accent {
        margin: 12px 16px 0;
    }

    .wva-cc-thumb {
        margin: 12px 12px 0;
    }

    .wva-cc-studylist {
        top: 20px;
        right: 20px;
    }
}
