/* ==========================================================
   SSPKM – gallery cards (home "Hostel Events" + about_sspkm)
   markup:  .effect-ming > .gcard > img + figcaption > p(title)
   ========================================================== */
.hes-gallery>.effect-ming {
    padding: 10px !important;
    background: transparent !important;
}

.gcard {
    position: relative;
    border-radius: 20px;
    overflow: hidden;
    isolation: isolate;
    cursor: pointer;
    background: #0b1f3a;
    box-shadow: 0 6px 18px rgba(11, 31, 58, .12);
    transition: transform .5s var(--ease), box-shadow .5s var(--ease);
}

.gcard img,
.hes-gallery .gcard img {
    display: block;
    width: 100% !important;
    height: 250px !important;
    margin: 0 !important;
    object-fit: cover;
    border-radius: 0 !important;
    opacity: 1 !important;
    filter: none;
    transform: scale(1.001);
    transition: transform 1s var(--ease), filter .6s !important;
    box-shadow: none !important;
}

/* dark gradient that rises from the bottom */
.gcard::before {
    content: "";
    position: absolute;
    inset: 0;
    z-index: 1;
    pointer-events: none;
    background: linear-gradient(to top, rgba(11, 31, 58, .95) 0%, rgba(11, 31, 58, .55) 38%, rgba(11, 31, 58, 0) 72%);
    opacity: 0;
    transition: opacity .5s var(--ease);
}

/* round zoom button in the centre */
.gcard::after {
    content: "\f00e";
    font-family: "Font Awesome 5 Free";
    font-weight: 900;
    font-size: 19px;
    position: absolute;
    z-index: 3;
    top: 50%;
    left: 50%;
    width: 56px;
    height: 56px;
    margin: -34px 0 0 -28px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    background: #fff;
    color: var(--brand);
    box-shadow: 0 12px 28px rgba(0, 0, 0, .35);
    opacity: 0;
    transform: scale(.4) rotate(-90deg);
    pointer-events: none;
    transition: opacity .4s var(--ease), transform .5s cubic-bezier(.34, 1.56, .64, 1);
}

.gcard figcaption {
    position: absolute !important;
    inset: 0;
    z-index: 2;
    pointer-events: none;
    background: none !important;
}

/* thin inner frame that scales in */
.gcard figcaption::before {
    content: "" !important;
    position: absolute;
    inset: 12px;
    border: 1.5px solid rgba(255, 255, 255, .6) !important;
    border-radius: 14px;
    box-shadow: none !important;
    opacity: 0;
    transform: scale(1.08) !important;
    transition: opacity .45s var(--ease), transform .6s var(--ease) !important;
}

/* title slides up (beats the old inline white box) */
.gcard figcaption p {
    position: absolute !important;
    left: 0 !important;
    right: 0 !important;
    bottom: 0 !important;
    margin: 0;
    padding: 22px 22px 20px !important;
    background: transparent !important;
    color: #fff !important;
    font-size: 16px !important;
    font-weight: 600 !important;
    line-height: 1.35;
    text-align: left;
    text-shadow: 0 2px 8px rgba(0, 0, 0, .4);
    opacity: 0 !important;
    transform: translateY(26px) !important;
    transition: opacity .5s var(--ease), transform .6s var(--ease) !important;
}

.gcard figcaption p::before {
    /* little accent bar above the title */
    content: "";
    display: block;
    width: 34px;
    height: 3px;
    margin-bottom: 9px;
    border-radius: 3px;
    background: linear-gradient(90deg, var(--accent), var(--accent-2));
    transform: scaleX(0);
    transform-origin: left;
    transition: transform .6s .15s var(--ease);
}

/* ---- hover ---- */
.gcard:hover {
    transform: translateY(-8px);
    box-shadow: 0 22px 44px rgba(11, 31, 58, .28);
}

.gcard:hover img,
.hes-gallery .gcard img:hover {
    transform: scale(1.12) !important;
    filter: saturate(1.1);
}

.gcard:hover::before {
    opacity: 1;
}

.gcard:hover::after {
    opacity: 1;
    transform: scale(1) rotate(0);
}

.gcard:hover figcaption::before {
    opacity: 1;
    transform: scale(1) !important;
}

.gcard:hover figcaption p {
    opacity: 1 !important;
    transform: translateY(0) !important;
}

.gcard:hover figcaption p::before {
    transform: scaleX(1);
}

/* touch screens have no hover: show the title strip permanently */
@media (hover:none) {
    .gcard::before {
        opacity: .85;
    }

    .gcard::after {
        display: none;
    }

    .gcard figcaption p {
        opacity: 1 !important;
        transform: none !important;
        font-size: 13px !important;
        padding: 14px !important;
    }

    .gcard figcaption p::before {
        transform: scaleX(1);
    }

    .gcard figcaption::before {
        display: none !important;
    }
}

@media (max-width:767px) {
    .hes-gallery>.effect-ming {
        padding: 5px !important;
    }

    .gcard {
        border-radius: 14px;
    }

    .gcard img,
    .hes-gallery .gcard img {
        height: 150px !important;
    }
}

@media (prefers-reduced-motion:reduce) {
    .gcard:hover {
        transform: none;
    }
}