/* GRID ITEM */
.sc-grid-item {
    position: relative;
    overflow: hidden;
}

/* Badge wrapper (position + keskitys) */
.sc-grid-badge-wrapper {
    position: absolute;
    left: 0;
    right: 0;
    text-align: center;
    z-index: 5;
    box-sizing: border-box;
    white-space: normal;
}

/* Varsinainen badge */
.sc-grid-title {
    display: inline-block;
    max-width: 90%;
    padding: 6px 12px;
    border-radius: 6px;
    margin: 0;
    box-sizing: border-box;
    white-space: normal;
    line-height: 1.3;
}

/* Thumbnail + placeholder */
.sc-thumb-wrap {
    width: 100%;
    height: 100%;
}

.sc-thumb {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.sc-thumb-placeholder {
    width: 100%;
    height: 100%;
    display: block;
}

/* Modal perus */
.sc-modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.6);
    display: none;
    justify-content: center;
    align-items: center;
    z-index: 99999;
    padding: 20px;
}

.sc-modal {
    background: #fff;
    max-width: 700px;
    width: 100%;
    border-radius: 6px;
    overflow: hidden;
    position: relative;
}

.sc-modal-inner {
    padding: 20px;
}

.sc-modal-content {
    max-height: 80vh;
    overflow-y: auto;
}

.sc-modal-close {
    position: absolute;
    top: 6px;
    right: 8px;
    font-size: 28px;
    color: #333;
    background: transparent;
    border: none;
    cursor: pointer;
    line-height: 1;
    padding: 0;
}

/* Category header / footer modaalissa */
.sc-cat-header {
    margin-bottom: 20px;
    padding-bottom: 10px;
    border-bottom: 1px solid #eeeeee;
}

.sc-cat-footer {
    margin-top: 20px;
    padding-top: 10px;
    border-top: 1px solid #eeeeee;
}

/* Varmistetaan että modalin varsinainen sisältö pysyy omassa blokissaan */
.sc-main-content {
    margin: 10px 0;
}

/* Responsiivinen hienosäätö */
@media (max-width: 600px) {
    .sc-grid-title {
        max-width: 95%;
        padding: 6px 10px;
    }

    .sc-modal-inner {
        padding: 15px;
    }
}
