/* =====================================================================
   CSE COMPUTER EDUCATION — HOMEPAGE HERO STABLE V5
   Fixes clipped statistics, blank space, and hero/search section spacing.
   This file is loaded after style.css, red-theme.css and page polish CSS.
===================================================================== */

/* ---------------------------------------------------------------------
   HERO SHELL
------------------------------------------------------------------------ */
.cse-home-hero-v4 {
    position: relative !important;
    isolation: isolate;
    overflow: hidden !important;
    min-height: 0 !important;
    padding: 64px 0 34px !important;
    margin: 0 !important;
    background:
        radial-gradient(circle at 92% 8%, rgba(215, 25, 32, 0.12), transparent 28%),
        radial-gradient(circle at 5% 88%, rgba(215, 25, 32, 0.05), transparent 27%),
        linear-gradient(135deg, #ffffff 0%, #ffffff 57%, #fff6f6 57%, #fff9f9 100%) !important;
}

.cse-home-hero-v4::before {
    display: none !important;
}

.cse-home-hero-v4-bg {
    position: absolute;
    inset: 0;
    z-index: -1;
    pointer-events: none;
    opacity: 0.44;
    background-image:
        linear-gradient(rgba(215, 25, 32, 0.033) 1px, transparent 1px),
        linear-gradient(90deg, rgba(215, 25, 32, 0.033) 1px, transparent 1px);
    background-size: 34px 34px;
    -webkit-mask-image: linear-gradient(90deg, #000 0%, rgba(0, 0, 0, .45) 48%, transparent 82%);
    mask-image: linear-gradient(90deg, #000 0%, rgba(0, 0, 0, .45) 48%, transparent 82%);
}

.cse-home-hero-v4-grid {
    position: relative;
    z-index: 2;
    min-height: 0 !important;
    display: grid !important;
    grid-template-columns: minmax(0, 0.94fr) minmax(500px, 1.06fr) !important;
    align-items: center !important;
    gap: clamp(38px, 4.8vw, 72px) !important;
}

/* ---------------------------------------------------------------------
   HERO COPY
------------------------------------------------------------------------ */
.cse-home-hero-v4-copy {
    min-width: 0;
    padding: 18px 0 24px !important;
}

.cse-home-hero-v4-kicker {
    width: fit-content;
    display: inline-flex;
    align-items: center;
    gap: 9px;
    padding: 9px 14px;
    border: 1px solid #efc7ca;
    border-radius: 999px;
    background: rgba(255, 255, 255, .94);
    color: #8f1016 !important;
    box-shadow: 0 12px 30px rgba(90, 15, 20, .07);
    font-size: 11px;
    font-weight: 850;
    letter-spacing: .02em;
}

.cse-home-hero-v4-kicker i {
    color: #e01b24;
    font-size: 8px;
}

.cse-home-hero-v4-copy h1 {
    max-width: 720px;
    margin: 20px 0 20px !important;
    color: #13151c !important;
    font-size: clamp(52px, 5.7vw, 78px) !important;
    font-weight: 850 !important;
    line-height: 1 !important;
    letter-spacing: -.064em !important;
}

.cse-home-hero-v4-copy > p {
    max-width: 650px;
    margin: 0 !important;
    color: #4e5663 !important;
    font-size: 17px !important;
    line-height: 1.78 !important;
}

.cse-home-hero-v4-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 13px;
    margin-top: 28px;
}

.cse-home-hero-v4-primary,
.cse-home-hero-v4-secondary {
    min-height: 54px !important;
    padding: 0 23px !important;
    border-radius: 13px !important;
    font-size: 13px !important;
    font-weight: 850 !important;
}

.cse-home-hero-v4-primary {
    background: linear-gradient(135deg, #e11922, #c81018) !important;
    color: #ffffff !important;
    border-color: #d71920 !important;
    box-shadow: 0 18px 38px rgba(215, 25, 32, .25) !important;
}

.cse-home-hero-v4-primary:hover {
    background: linear-gradient(135deg, #b80f16, #8f0b11) !important;
    color: #ffffff !important;
}

.cse-home-hero-v4-secondary {
    background: #ffffff !important;
    color: #161820 !important;
    border-color: #e2d8da !important;
    box-shadow: 0 14px 34px rgba(43, 19, 22, .08) !important;
}

.cse-home-hero-v4-secondary:hover {
    color: #c81018 !important;
    border-color: #efb6ba !important;
    background: #fff8f8 !important;
}

.cse-home-hero-v4-trust {
    display: flex;
    flex-wrap: wrap;
    gap: 11px 20px;
    margin-top: 26px;
}

.cse-home-hero-v4-trust span {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    color: #3f4652 !important;
    font-size: 11px;
    font-weight: 800;
}

.cse-home-hero-v4-trust i {
    color: #d71920;
}

/* ---------------------------------------------------------------------
   IMAGE PANEL
------------------------------------------------------------------------ */
.cse-home-hero-v4-media {
    min-width: 0;
    padding: 0 !important;
    margin: 0 !important;
}

.cse-home-hero-v4-image-card {
    position: relative;
    overflow: hidden;
    border: 1px solid #eedcdf;
    border-radius: 28px;
    background: #ffffff;
    box-shadow: 0 30px 76px rgba(77, 20, 27, .16);
}

.cse-home-hero-v4-image-card::before {
    content: "";
    position: absolute;
    inset: 10px;
    z-index: 5;
    border: 1px solid rgba(255, 255, 255, .38);
    border-radius: 20px;
    pointer-events: none;
}

.cse-home-hero-v4-image-topbar {
    min-height: 54px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 18px;
    padding: 0 20px;
    background: linear-gradient(100deg, #850b11, #d71920 68%, #ef3640);
    color: #ffffff;
}

.cse-home-hero-v4-image-topbar span,
.cse-home-hero-v4-image-topbar strong {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    color: #ffffff !important;
    white-space: nowrap;
}

.cse-home-hero-v4-image-topbar span {
    font-size: 11px;
    font-weight: 800;
}

.cse-home-hero-v4-image-topbar strong {
    font-size: 10px;
    font-weight: 800;
    letter-spacing: .04em;
    text-transform: uppercase;
}

.cse-home-hero-v4-image-wrap {
    position: relative;
    height: 405px;
    overflow: hidden;
    background: #eee7e7;
}

.cse-home-hero-v4-image-wrap img {
    width: 100%;
    height: 100%;
    display: block;
    object-fit: cover;
    object-position: center;
    transition: transform .7s ease;
}

.cse-home-hero-v4-image-card:hover .cse-home-hero-v4-image-wrap img {
    transform: scale(1.025);
}

.cse-home-hero-v4-image-shade {
    position: absolute;
    inset: 0;
    background:
        linear-gradient(to top, rgba(34, 4, 7, .30), transparent 42%),
        linear-gradient(90deg, rgba(17, 4, 5, .05), transparent 34%);
    pointer-events: none;
}

.cse-home-hero-v4-placeholder {
    height: 100%;
    display: grid;
    place-items: center;
    background: linear-gradient(135deg, #fff0f1, #f4e8e9);
    color: #d71920;
    font-size: 76px;
}

.cse-home-hero-v4-badge {
    position: absolute;
    right: 20px;
    bottom: 20px;
    z-index: 3;
    display: grid;
    grid-template-columns: 42px minmax(0, 1fr);
    align-items: center;
    gap: 11px;
    max-width: 265px;
    padding: 12px 15px;
    border: 1px solid rgba(255, 255, 255, .72);
    border-radius: 14px;
    background: rgba(255, 255, 255, .95);
    box-shadow: 0 18px 46px rgba(37, 10, 13, .18);
    backdrop-filter: blur(14px);
    -webkit-backdrop-filter: blur(14px);
}

.cse-home-hero-v4-badge > span {
    width: 42px;
    height: 42px;
    display: grid;
    place-items: center;
    border-radius: 12px;
    background: #fff0f1;
    color: #d71920;
}

.cse-home-hero-v4-badge strong,
.cse-home-hero-v4-badge small {
    display: block;
}

.cse-home-hero-v4-badge strong {
    color: #15171d !important;
    font-size: 11px;
    font-weight: 850;
}

.cse-home-hero-v4-badge small {
    margin-top: 3px;
    color: #737b88 !important;
    font-size: 9px;
    line-height: 1.4;
}

.cse-home-hero-v4-image-bottombar {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    background: #ffffff;
}

.cse-home-hero-v4-image-bottombar > div {
    min-width: 0;
    min-height: 88px;
    display: grid;
    grid-template-columns: 37px minmax(0, 1fr);
    align-items: center;
    gap: 10px;
    padding: 15px 14px;
    border-right: 1px solid #eee3e5;
}

.cse-home-hero-v4-image-bottombar > div:last-child {
    border-right: 0;
}

.cse-home-hero-v4-image-bottombar > div > span {
    width: 37px;
    height: 37px;
    display: grid;
    place-items: center;
    border-radius: 11px;
    background: #fff0f1;
    color: #d71920;
    font-size: 14px;
}

.cse-home-hero-v4-image-bottombar strong,
.cse-home-hero-v4-image-bottombar small {
    display: block;
}

.cse-home-hero-v4-image-bottombar strong {
    color: #171920 !important;
    font-size: 10px;
    font-weight: 850;
    line-height: 1.3;
}

.cse-home-hero-v4-image-bottombar small {
    margin-top: 3px;
    color: #777f8d !important;
    font-size: 8px;
    line-height: 1.35;
}

/* ---------------------------------------------------------------------
   STATISTICS — NORMAL DOCUMENT FLOW, NO TRANSLATE, NO CLIPPING
------------------------------------------------------------------------ */
.cse-home-hero-v4-stats {
    position: relative;
    z-index: 6;
    width: min(calc(100% - 40px), var(--container, 1240px));
    display: grid !important;
    grid-template-columns: repeat(4, minmax(0, 1fr)) !important;
    align-items: stretch;
    margin-top: 30px !important;
    margin-bottom: 0 !important;
    transform: none !important;
    overflow: hidden !important;
    height: auto !important;
    min-height: 0 !important;
    border: 1px solid #eadfe1;
    border-radius: 18px;
    background: #ffffff;
    box-shadow: 0 20px 54px rgba(55, 15, 20, .11);
}

.cse-home-hero-v4-stats > div {
    min-width: 0;
    min-height: 100px !important;
    display: grid !important;
    grid-template-columns: 48px minmax(0, 1fr) !important;
    align-items: center !important;
    align-content: center !important;
    gap: 13px;
    padding: 18px 22px !important;
    overflow: visible !important;
    border-right: 1px solid #eee3e5;
}

.cse-home-hero-v4-stats > div:last-child {
    border-right: 0;
}

.cse-home-hero-v4-stats > div > span {
    width: 48px;
    height: 48px;
    display: grid;
    place-items: center;
    flex: 0 0 48px;
    border-radius: 14px;
    background: #fff0f1;
    color: #d71920;
    font-size: 17px;
}

.cse-home-hero-v4-stats strong,
.cse-home-hero-v4-stats small {
    display: block !important;
    position: static !important;
    height: auto !important;
    max-height: none !important;
    overflow: visible !important;
    white-space: normal !important;
    text-overflow: clip !important;
}

.cse-home-hero-v4-stats strong {
    color: #171920 !important;
    font-family: "Sora", sans-serif;
    font-size: 21px !important;
    font-weight: 850;
    line-height: 1.15 !important;
}

.cse-home-hero-v4-stats small {
    margin-top: 5px !important;
    color: #697280 !important;
    font-size: 11px !important;
    font-weight: 750;
    line-height: 1.4 !important;
}

/* ---------------------------------------------------------------------
   SECTION TRANSITION — REMOVE THE EMPTY WHITE GAP
------------------------------------------------------------------------ */
.cse-home-hero-v4 + .rse-search-section,
.rse-home .cse-home-hero-v4 + .rse-search-section {
    min-height: 0 !important;
    margin: 0 !important;
    padding: 28px 0 38px !important;
    background: #ffffff !important;
}

.cse-home-hero-v4 + .rse-search-section .rse-search-box {
    margin: 0 !important;
}

.cse-home-hero-v4 + .rse-search-section + .rse-featured-courses {
    margin-top: 0 !important;
}

/* ---------------------------------------------------------------------
   RESPONSIVE
------------------------------------------------------------------------ */
@media (max-width: 1120px) {
    .cse-home-hero-v4-grid {
        grid-template-columns: minmax(0, .94fr) minmax(430px, 1.06fr) !important;
        gap: 34px !important;
    }

    .cse-home-hero-v4-copy h1 {
        font-size: clamp(48px, 5.8vw, 67px) !important;
    }

    .cse-home-hero-v4-image-wrap {
        height: 375px;
    }

    .cse-home-hero-v4-image-bottombar small {
        display: none;
    }

    .cse-home-hero-v4-stats > div {
        padding-inline: 17px !important;
    }
}

@media (max-width: 900px) {
    .cse-home-hero-v4 {
        padding: 52px 0 30px !important;
        background: linear-gradient(180deg, #ffffff 0%, #ffffff 55%, #fff7f7 100%) !important;
    }

    .cse-home-hero-v4-grid {
        grid-template-columns: 1fr !important;
        gap: 34px !important;
    }

    .cse-home-hero-v4-copy {
        padding: 0 !important;
    }

    .cse-home-hero-v4-copy h1 {
        max-width: 760px;
        font-size: clamp(47px, 9vw, 70px) !important;
    }

    .cse-home-hero-v4-image-card {
        max-width: 760px;
        margin: 0 auto;
    }

    .cse-home-hero-v4-image-wrap {
        height: 455px;
    }

    .cse-home-hero-v4-stats {
        grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
        margin-top: 28px !important;
    }

    .cse-home-hero-v4-stats > div:nth-child(2) {
        border-right: 0;
    }

    .cse-home-hero-v4-stats > div:nth-child(-n + 2) {
        border-bottom: 1px solid #eee3e5;
    }

    .cse-home-hero-v4 + .rse-search-section,
    .rse-home .cse-home-hero-v4 + .rse-search-section {
        padding: 24px 0 34px !important;
    }
}

@media (max-width: 620px) {
    .cse-home-hero-v4 {
        padding: 40px 0 24px !important;
    }

    .cse-home-hero-v4-copy h1 {
        font-size: clamp(41px, 13vw, 56px) !important;
        letter-spacing: -.056em !important;
    }

    .cse-home-hero-v4-copy > p {
        font-size: 15px !important;
        line-height: 1.7 !important;
    }

    .cse-home-hero-v4-actions {
        flex-direction: column;
    }

    .cse-home-hero-v4-actions .btn {
        width: 100% !important;
    }

    .cse-home-hero-v4-image-topbar {
        min-height: 50px;
        padding: 0 14px;
    }

    .cse-home-hero-v4-image-topbar strong {
        display: none;
    }

    .cse-home-hero-v4-image-wrap {
        height: 345px;
    }

    .cse-home-hero-v4-badge {
        left: 14px;
        right: 14px;
        bottom: 14px;
        max-width: none;
    }

    .cse-home-hero-v4-image-bottombar {
        grid-template-columns: 1fr;
    }

    .cse-home-hero-v4-image-bottombar > div {
        min-height: 70px;
        padding: 12px 14px;
        border-right: 0;
        border-bottom: 1px solid #eee3e5;
    }

    .cse-home-hero-v4-image-bottombar > div:last-child {
        border-bottom: 0;
    }

    .cse-home-hero-v4-image-bottombar small {
        display: block;
    }

    .cse-home-hero-v4-stats {
        grid-template-columns: 1fr !important;
        width: min(calc(100% - 28px), var(--container, 1240px));
        margin-top: 22px !important;
    }

    .cse-home-hero-v4-stats > div,
    .cse-home-hero-v4-stats > div:nth-child(2) {
        min-height: 86px !important;
        padding: 14px !important;
        border-right: 0;
        border-bottom: 1px solid #eee3e5;
    }

    .cse-home-hero-v4-stats > div:last-child {
        border-bottom: 0;
    }

    .cse-home-hero-v4 + .rse-search-section,
    .rse-home .cse-home-hero-v4 + .rse-search-section {
        padding: 20px 0 30px !important;
    }
}
