/* =======================================================
   KiraEdu — Modern Classic Course Card
   Load this after the older card stylesheet, or replace
   the complete existing .ke-course-* section with it.
======================================================= */

.ke-course-card {
    position: relative;
    display: flex;
    min-width: 0;
    height: 100%;
    overflow: hidden;
    flex-direction: column;
    border: 1px solid #e7e1d6;
    border-radius: 1px;
    background: #fff;
    box-shadow: 0 10px 30px rgba(15, 23, 42, .07);
    transition: border-color .25s ease, box-shadow .25s ease;
}

@media (hover: hover) and (pointer: fine) {
    .ke-course-card:hover {
        /* The card stays composed instead of jumping upward. */
        transform: none;
        border-color: rgba(177, 132, 36, .48);
        box-shadow: 0 18px 42px rgba(15, 23, 42, .11);
    }
}

.ke-course-image {
    position: relative;
    width: 100%;
    min-height: 445px;
    overflow: hidden;
    border-bottom: 1px solid #eee8dc;
    background-color: #f3f0e9;
    background-position: center;
    background-repeat: no-repeat;
    background-size: cover;
}

/* Quiet lower gradient keeps tags readable without hiding the photograph. */
.ke-course-image::after {
    position: absolute;
    inset: 0;
    z-index: 1;
    background: linear-gradient(
        180deg,
        rgba(10, 16, 27, .04) 42%,
        rgba(10, 16, 27, .28) 100%
    );
    content: "";
    pointer-events: none;
}

.ke-course-tags {
    position: absolute;
    inset: 14px 14px auto;
    z-index: 2;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
}

.ke-course-live,
.ke-course-level {
    position: static;
    display: inline-flex;
    min-height: 28px;
    align-items: center;
    gap: 6px;
    padding: 0 10px;
    border-radius: 999px;
    font-size: 8px;
    font-weight: 800;
    letter-spacing: .08em;
    line-height: 1;
    text-transform: uppercase;
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
}

.ke-course-live {
    border: 1px solid rgba(255, 255, 255, .72);
    background: rgba(255, 255, 255, .92);
    color: #72530e;
    box-shadow: 0 5px 16px rgba(15, 23, 42, .10);
}

.ke-course-live i {
    color: #2f855a;
    font-size: 6px;
}

.ke-course-level {
    border: 1px solid rgba(209, 171, 79, .40);
    background: rgba(20, 23, 29, .82);
    color: #f4d98e;
}

.ke-course-body {
    display: flex;
    flex: 1;
    flex-direction: column;
    padding: 22px 22px 18px;
}

.ke-course-top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    margin: 0 0 14px;
    color: #98721f;
    font-size: 8px;
    font-weight: 800;
    letter-spacing: .11em;
    text-transform: uppercase;
}

.ke-course-top > span {
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.ke-course-top strong {
    display: inline-flex;
    flex: 0 0 auto;
    align-items: center;
    gap: 5px;
    padding: 0;
    border: 0;
    border-radius: 0;
    background: transparent;
    color: #69645a;
    font-size: 8px;
    font-weight: 700;
    letter-spacing: .04em;
}

.ke-course-top strong i { color: #b48727; }

.ke-course-card h3 {
    min-height: 0;
    max-height: none;
    margin: 0 0 10px;
    overflow: visible;
    color: #15181e;
    font-family: var(--font-heading, "Cormorant Garamond", Georgia, serif);
    font-size: clamp(24px, 2.2vw, 30px);
    font-weight: 650;
    letter-spacing: -.025em;
    line-height: 1.08;
}

.ke-course-card p {
    display: -webkit-box;
    min-height: 0;
    max-height: none;
    margin: 0;
    overflow: hidden;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 3;
    color: #6c6f76;
    font-size: 12px;
    line-height: 1.62;
}

.ke-course-meta {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 0;
    max-height: none;
    margin-top: auto;
    padding-top: 19px;
    overflow: visible;
}

.ke-course-meta span {
    display: flex;
    min-width: 0;
    min-height: 51px;
    align-items: center;
    justify-content: center;
    gap: 5px;
    padding: 7px 8px;
    border: 0;
    border-right: 1px solid #ebe6dc;
    border-radius: 0;
    background: transparent;
    color: #696d75;
    font-size: 9px;
    font-weight: 650;
    line-height: 1.25;
    text-align: center;
}

.ke-course-meta span:last-child { border-right: 0; }
.ke-course-meta i { color: #aa7d20; font-size: 11px; }
.ke-course-meta b { color: #252931; }

.ke-course-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    margin-top: 0;
    padding: 14px 16px 14px 22px;
    border-top: 1px solid #e9e3d8;
    background: #fbfaf7;
}

.ke-course-footer-note {
    display: inline-flex !important;
    align-items: center;
    gap: 7px;
    color: #747168 !important;
    font-size: 8px !important;
    font-weight: 750 !important;
    letter-spacing: .06em !important;
    text-transform: uppercase;
}

.ke-course-footer-note i { color: #ad8124; font-size: 11px; }

.ke-course-btn {
    display: inline-flex;
    min-height: 39px;
    align-items: center;
    justify-content: center;
    gap: 10px;
    padding: 0 14px;
    border: 1px solid #1d2128;
    border-radius: 9px;
    background: #1d2128;
    box-shadow: none;
    color: #fff;
    font-size: 9px;
    font-weight: 800;
    letter-spacing: .025em;
    text-decoration: none;
    white-space: nowrap;
    transition: background .2s ease, border-color .2s ease, color .2s ease;
}

@media (hover: hover) and (pointer: fine) {
    .ke-course-btn:hover {
        transform: none;
        border-color: #b88a2e;
        background: #b88a2e;
        box-shadow: none;
        color: #171717;
    }

    .ke-course-btn:hover i { transform: translateX(2px); }
}

.ke-course-btn i { transition: transform .2s ease; }

@media (max-width: 700px) {
    .ke-course-card {
        border-radius: 0.2px;
        box-shadow: 0 7px 22px rgba(15, 23, 42, .065);
    }

    .ke-course-image {
        height: auto;
        max-height: 350px;
        background-size: cover;
    }

    .ke-course-body { padding: 18px 17px 14px; }
    .ke-course-top { margin-bottom: 12px; }
    .ke-course-card h3 { font-size: 25px; }
    .ke-course-card p { font-size: 11px; -webkit-line-clamp: 3; }
    .ke-course-meta { padding-top: 15px; }
    .ke-course-meta span { min-height: 45px; padding: 6px 4px; font-size: 8px; }
    .ke-course-footer {
        flex-direction: row;
        align-items: center;
        padding: 11px 12px 11px 17px;
    }
    .ke-course-btn { width: auto; min-height: 37px; }
}

@media (max-width: 390px) {
    .ke-course-image { min-height: 195px; }
    .ke-course-level { display: none; }
    .ke-course-top { display: block; }
    .ke-course-top strong { margin-top: 7px; }
    .ke-course-meta { grid-template-columns: 1fr; }
    .ke-course-meta span {
        min-height: 34px;
        justify-content: flex-start;
        border-right: 0;
        border-bottom: 1px solid #eee9df;
        text-align: left;
    }
    .ke-course-meta span:last-child { border-bottom: 0; }
    .ke-course-footer-note { display: none !important; }
    .ke-course-btn { width: 100%; }
}

@media (prefers-reduced-motion: reduce) {
    .ke-course-card,
    .ke-course-btn,
    .ke-course-btn i { transition: none !important; }
}


/* =========================================================
   COURSE CARD — FULL CARD EXPLORATION TARGET

   The existing "Explore Program" link becomes a stretched
   link so image, heading, content and whitespace can all
   open the program without invalid nested anchors.
========================================================= */

.ke-course-card {
    position: relative;
    cursor: pointer;
}

/*
   Stretch the existing Explore Program link across
   the complete card.
*/
.ke-course-btn::after {
    content: "";
    position: absolute;
    inset: 0;
    z-index: 1;
}

/*
   Keep the visible button itself visually above the
   stretched clickable surface.
*/
.ke-course-btn {
    position: relative;
    z-index: 2;
}

/*
   Decorative/content elements do not need to intercept
   pointer events. The stretched link receives the tap.
*/
.ke-course-image,
.ke-course-body,
.ke-course-meta,
.ke-course-top {
    pointer-events: none;
}


/* Desktop interaction feedback */
@media (hover: hover) and (pointer: fine) {

    .ke-course-card {
        transition:
            transform .22s ease,
            box-shadow .22s ease,
            border-color .22s ease;
    }

    .ke-course-card:hover {
        transform: translateY(-3px);
    }

    .ke-course-card:hover h3 {
        color: #b8860b;
    }
}


/* Keyboard accessibility */
.ke-course-card:focus-within {
    outline: 2px solid #d4af37;
    outline-offset: 3px;
}


/* =========================================================
   COURSE CARD — FULL CARD LINK FIX
========================================================= */

.ke-course-card {
    position: relative !important;
    cursor: pointer;
}


/*
   IMPORTANT:
   The button must NOT establish the containing block for
   ::after. The card itself is the containing block.
*/
.ke-course-card .ke-course-btn {
    position: static !important;
}


/*
   Existing Explore Program anchor now owns an invisible
   clickable layer covering the complete card.
*/
.ke-course-card .ke-course-btn::after {
    content: "";
    position: absolute;
    inset: 0;
    z-index: 5;
}


/*
   Restore normal pointer behavior removed by the previous
   experiment.
*/
.ke-course-card .ke-course-image,
.ke-course-card .ke-course-body,
.ke-course-card .ke-course-meta,
.ke-course-card .ke-course-top {
    pointer-events: auto !important;
}


/* Visual button contents remain visible. */
.ke-course-card .ke-course-btn > * {
    position: relative;
    z-index: 6;
    pointer-events: none;
}


/* Keyboard focus should identify the whole card. */
.ke-course-card:focus-within {
    outline: 2px solid #d4af37;
    outline-offset: 3px;
}


/* Desktop feedback */
@media (hover: hover) and (pointer: fine) {

    .ke-course-card:hover {
        transform: translateY(-3px);
    }

    .ke-course-card:hover h3 {
        color: #b8860b;
    }
}
