/* =========================================================
   IMAGE HEARTS - Overlay + Top 10 Brick Gallery
   Consolidated stable version
   ========================================================= */


/* -----------------------------
   Heart Overlay: Gallery + Blog
   ----------------------------- */

.ext-thumbwrap,
.ks-image-heart-wrap,
.ks-heart-wrap {
    position: relative !important;
    display: block !important;
}

.ks-heart-btn {
    position: absolute !important;
    right: 9px !important;
    bottom: 46px !important;
    z-index: 1000 !important;

    display: flex !important;
    flex-direction: column !important;
    align-items: center !important;
    justify-content: center !important;

    width: 24px !important;
    height: auto !important;

    padding: 0 !important;
    margin: 0 !important;

    background: transparent !important;
    border: 0 !important;
    border-radius: 0 !important;
    box-shadow: none !important;
    outline: none !important;

    cursor: pointer !important;
    text-decoration: none !important;
    -webkit-appearance: none !important;
    appearance: none !important;
}

.ks-heart-btn::-moz-focus-inner {
    border: 0 !important;
    padding: 0 !important;
}

.ks-heart-icon {
    display: block !important;
    width: 20px !important;
    height: 20px !important;

    font-size: 0 !important;
    line-height: 0 !important;

    filter: drop-shadow(0 1px 2px rgba(0,0,0,.65)) !important;
}

.ks-heart-icon::before {
    content: "" !important;
    display: block !important;

    width: 20px !important;
    height: 20px !important;

    background-color: rgba(255,255,255,.9) !important;

    -webkit-mask: url("data:image/svg+xml,%3Csvg viewBox='0 0 24 22' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M12 20.5l-1.4-1.2C5.4 14.8 2 11.8 2 7.9 2 4.8 4.4 2.5 7.5 2.5c1.7 0 3.4.8 4.5 2.1 1.1-1.3 2.8-2.1 4.5-2.1 3.1 0 5.5 2.3 5.5 5.4 0 3.9-3.4 6.9-8.6 11.4L12 20.5z'/%3E%3C/svg%3E") center / contain no-repeat !important;
    mask: url("data:image/svg+xml,%3Csvg viewBox='0 0 24 22' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M12 20.5l-1.4-1.2C5.4 14.8 2 11.8 2 7.9 2 4.8 4.4 2.5 7.5 2.5c1.7 0 3.4.8 4.5 2.1 1.1-1.3 2.8-2.1 4.5-2.1 3.1 0 5.5 2.3 5.5 5.4 0 3.9-3.4 6.9-8.6 11.4L12 20.5z'/%3E%3C/svg%3E") center / contain no-repeat !important;
}

.ks-heart-btn.is-liked .ks-heart-icon::before {
    background-color: #ff2f55 !important;
}

.ks-heart-count {
    display: block !important;

    width: 24px !important;
    margin-top: 2px !important;
    padding: 0 !important;

    text-align: center !important;
    font-size: 11px !important;
    font-weight: 600 !important;
    line-height: 1 !important;

    color: rgba(255,255,255,.96) !important;

    background: transparent !important;
    border: 0 !important;
    box-shadow: none !important;

    text-shadow:
        0 0 2px rgba(0,0,0,.95),
        0 1px 2px rgba(0,0,0,.95) !important;
}

/* Blog image placement */
.ks-image-heart-wrap .ks-heart-btn,
.ks-heart-wrap .ks-heart-btn {
    right: 18px !important;
    bottom: 58px !important;
}


/* -----------------------------
   Top 10 Brick Gallery
   ----------------------------- */

.ks-top10-page {
    max-width: 1180px;
    margin: 0 auto;
    padding: 2rem 1rem 3rem;
}

.ks-top10-header {
    margin-bottom: 1.4rem;
}

.ks-top10-header h1 {
    margin-bottom: .25rem;
}

.ks-top10-header p {
    color: #6b7280;
}

.ks-top10-brick {
    display: grid;
    grid-template-columns: repeat(6, 1fr);
    grid-auto-rows: 150px;
    gap: 14px;
}

.ks-top10-card {
    position: relative;
    overflow: hidden;
    border-radius: 18px;
    background: #f3f4f6;
    box-shadow: 0 8px 22px rgba(0,0,0,.10);
}

.ks-top10-card.rank-1 {
    grid-column: span 3;
    grid-row: span 2;
}

.ks-top10-card.rank-2,
.ks-top10-card.rank-3 {
    grid-column: span 3;
}

.ks-top10-card.rank-4,
.ks-top10-card.rank-5,
.ks-top10-card.rank-6,
.ks-top10-card.rank-7,
.ks-top10-card.rank-8,
.ks-top10-card.rank-9,
.ks-top10-card.rank-10 {
    grid-column: span 2;
}

.ks-top10-card a {
    display: block;
    width: 100%;
    height: 100%;
    color: inherit;
}

.ks-top10-card img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform .25s ease;
}

.ks-top10-card:hover img {
    transform: scale(1.04);
}

.ks-top10-card::after {
    content: "";
    position: absolute;
    inset: 0;
    background: linear-gradient(to top, rgba(0,0,0,.55), rgba(0,0,0,0) 55%);
    pointer-events: none;
}

.ks-top10-rank,
.ks-top10-hearts {
    position: absolute;
    z-index: 2;
    color: #fff;
    text-shadow: 0 1px 4px rgba(0,0,0,.75);
}

.ks-top10-rank {
    top: 10px;
    left: 12px;
    font-weight: 800;
    font-size: 1.1rem;
}

.ks-top10-hearts {
    right: 12px;
    bottom: 42px;
    font-weight: 700;
}

.ks-top10-meta {
    position: absolute;
    z-index: 2;
    left: 12px;
    right: 12px;
    bottom: 10px;
    color: #fff;
}

.ks-top10-meta strong {
    display: block;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.ks-top10-meta a,
.ks-top10-meta span {
    color: rgba(255,255,255,.86);
    font-size: .8rem;
}

.ks-top10-empty {
    padding: 1rem;
    border-radius: 14px;
    background: #f3f4f6;
    color: #6b7280;
}


/* -----------------------------
   Tablet
   ----------------------------- */

@media (max-width: 900px) {
    .ks-top10-brick {
        grid-template-columns: repeat(2, 1fr);
        grid-auto-rows: 170px;
    }

    .ks-top10-card,
    .ks-top10-card.rank-2,
    .ks-top10-card.rank-3,
    .ks-top10-card.rank-4,
    .ks-top10-card.rank-5,
    .ks-top10-card.rank-6,
    .ks-top10-card.rank-7,
    .ks-top10-card.rank-8,
    .ks-top10-card.rank-9,
    .ks-top10-card.rank-10 {
        grid-column: span 1;
        grid-row: span 1;
    }

    .ks-top10-card.rank-1 {
        grid-column: span 2;
        grid-row: span 2;
    }
}


/* -----------------------------
   Mobile / iOS
   ----------------------------- */

@media (max-width: 768px) {

    .ks-heart-btn {
        right: 8px !important;
        bottom: 40px !important;
    }

    .ks-image-heart-wrap .ks-heart-btn,
    .ks-heart-wrap .ks-heart-btn {
        right: 18px !important;
        bottom: 58px !important;
    }

    .ks-heart-icon,
    .ks-heart-icon::before {
        width: 20px !important;
        height: 20px !important;
    }

    .ks-heart-count {
        width: 24px !important;
        font-size: 11px !important;
        margin-top: 2px !important;
    }

    .ks-top10-page {
        padding: 1rem .75rem 2rem;
    }

    .ks-top10-brick {
        display: grid;
        grid-template-columns: repeat(2, minmax(0,1fr));
        grid-auto-rows: 110px;
        gap: 10px;
    }

    .ks-top10-card,
    .ks-top10-card.rank-2,
    .ks-top10-card.rank-3,
    .ks-top10-card.rank-4,
    .ks-top10-card.rank-5,
    .ks-top10-card.rank-6,
    .ks-top10-card.rank-7,
    .ks-top10-card.rank-8,
    .ks-top10-card.rank-9,
    .ks-top10-card.rank-10 {
        grid-column: span 1 !important;
        grid-row: span 1 !important;
    }

    .ks-top10-card.rank-1 {
        grid-column: span 2 !important;
        grid-row: span 2 !important;
    }

    .ks-top10-card a,
    .ks-top10-card img {
        width: 100%;
        height: 100%;
    }

    .ks-top10-card img {
        object-fit: cover;
    }

    .ks-top10-rank {
        top: 8px;
        left: 9px;
        font-size: .95rem;
    }

    .ks-top10-hearts {
        right: 9px;
        bottom: 36px;
        font-size: .85rem;
    }

    .ks-top10-meta {
        left: 9px;
        right: 9px;
        bottom: 8px;
    }

    .ks-top10-meta strong {
        font-size: .82rem;
    }

    .ks-top10-meta a,
    .ks-top10-meta span {
        font-size: .7rem;
    }
}
