/* =========================================================
   EDITOR - GALLERY
========================================================= */

.editor-gallery-grid {
    display: grid;

    grid-template-columns:
        repeat(3, minmax(0, 1fr));

    gap: 9px;

    margin-top: 10px;
}

.editor-gallery-item {
    overflow: hidden;

    background: #f8fafc;

    border: 1px solid #e2e8f0;
    border-radius: 11px;
}

.editor-gallery-photo {
    width: 100%;

    aspect-ratio: 1 / 1;

    overflow: hidden;

    background: #edf2f7;
}

.editor-gallery-photo img {
    width: 100%;
    height: 100%;

    display: block;

    object-fit: cover;

    user-select: none;
    -webkit-user-select: none;

    -webkit-user-drag: none;
}

.editor-gallery-content {
    padding: 8px;
}

.gallery-caption-input {
    width: 100%;
    height: 34px;

    padding: 0 8px;

    color: #334155;
    background: #ffffff;

    border: 1px solid #dbe3ec;
    border-radius: 8px;

    outline: none;

    font-size: 8px;
}

.gallery-caption-input:focus {
    border-color: #5b5ce2;
}

.gallery-image-buttons {
    margin-top: 7px;

    display: flex;
    align-items: center;

    gap: 5px;
}

.gallery-mini-button {
    min-width: 28px;
    height: 28px;

    padding: 0 7px;

    display: inline-flex;
    align-items: center;
    justify-content: center;

    color: #5b5ce2;
    background: #f0efff;

    border: 1px solid #ddd9ff;
    border-radius: 7px;

    cursor: pointer;

    font-size: 8px;
    font-weight: 800;
}

.gallery-mini-button.delete {
    margin-left: auto;

    color: #dc2626;
    background: #fff;

    border-color: #fecaca;
}

.gallery-mini-button:disabled {
    color: #cbd5e1;
    background: #f8fafc;

    border-color: #edf1f5;

    cursor: not-allowed;
}

.gallery-additional-upload {
    margin-top: 15px;
    padding-top: 15px;

    border-top: 1px solid #edf1f5;
}


/* =========================================================
   PREVIEW
========================================================= */

.preview-gallery-grid {
    margin-top: 7px;

    display: grid;

    grid-template-columns:
        repeat(2, 1fr);

    gap: 4px;
}

.preview-gallery-image {
    overflow: hidden;

    aspect-ratio: 1 / 1;

    background: #edf2f7;

    border-radius: 6px;
}

.preview-gallery-image img {
    width: 100%;
    height: 100%;

    display: block;

    object-fit: cover;

    pointer-events: none;

    user-select: none;
    -webkit-user-select: none;

    -webkit-user-drag: none;
}


/* =========================================================
   PUBLIC GALLERY
========================================================= */

.public-gallery-section {
    margin-top: 23px;

    text-align: left;
}

.public-gallery-heading {
    margin-bottom: 11px;
}

.public-gallery-heading h2 {
    margin: 0;

    color: #0f172a;

    font-size: 15px;
    letter-spacing: -.02em;
}

.public-gallery-heading p {
    margin: 5px 0 0;

    color: #64748b;

    font-size: 10px;
    line-height: 1.55;
}

.public-gallery-grid {
    display: grid;

    grid-template-columns:
        repeat(2, minmax(0, 1fr));

    gap: 8px;
}

.public-gallery-button {
    position: relative;

    overflow: hidden;

    width: 100%;
    padding: 0;

    background: #edf2f7;

    border: 0;
    border-radius: 13px;

    cursor: zoom-in;

    aspect-ratio: 1 / 1;

    user-select: none;
    -webkit-user-select: none;
}

.public-gallery-button img {
    width: 100%;
    height: 100%;

    display: block;

    object-fit: cover;

    /*
    |--------------------------------------------------------------------------
    | Casual Download / Drag Deterrence
    |--------------------------------------------------------------------------
    |
    | The image itself does not receive pointer interaction.
    | Clicks still reach the gallery button and open the lightbox.
    |--------------------------------------------------------------------------
    */

    pointer-events: none;

    user-select: none;
    -webkit-user-select: none;

    -webkit-user-drag: none;

    transition:
        transform .2s ease;
}

.public-gallery-button:hover img {
    transform: scale(1.025);
}

.public-gallery-caption {
    position: absolute;

    right: 6px;
    bottom: 6px;
    left: 6px;

    padding: 7px 8px;

    overflow: hidden;

    color: #ffffff;

    background:
        rgba(15, 23, 42, .68);

    border-radius: 8px;

    pointer-events: none;

    user-select: none;
    -webkit-user-select: none;

    white-space: nowrap;
    text-overflow: ellipsis;

    font-size: 8px;
    font-weight: 700;

    backdrop-filter: blur(8px);
}


/* =========================================================
   LIGHTBOX
========================================================= */

.raih-lightbox {
    width: min(94vw, 900px);

    padding: 0;

    overflow: hidden;

    background: #0f172a;

    border: 0;
    border-radius: 18px;

    box-shadow:
        0 35px 90px
        rgba(0, 0, 0, .35);
}

.raih-lightbox::backdrop {
    background:
        rgba(15, 23, 42, .82);

    backdrop-filter: blur(4px);
}

.raih-lightbox-inner {
    position: relative;

    user-select: none;
    -webkit-user-select: none;
}

.raih-lightbox img {
    width: 100%;
    max-height: 82vh;

    display: block;

    object-fit: contain;

    background: #020617;

    /*
    |--------------------------------------------------------------------------
    | Lightbox Download / Drag Deterrence
    |--------------------------------------------------------------------------
    */

    pointer-events: none;

    user-select: none;
    -webkit-user-select: none;

    -webkit-user-drag: none;
}

.raih-lightbox-caption {
    padding: 12px 15px;

    color: #e2e8f0;

    font-size: 10px;
    line-height: 1.5;

    user-select: none;
    -webkit-user-select: none;
}

.raih-lightbox-close {
    position: absolute;

    top: 12px;
    right: 12px;

    width: 38px;
    height: 38px;

    display: grid;
    place-items: center;

    color: #ffffff;

    background:
        rgba(15, 23, 42, .72);

    border: 1px solid
        rgba(255, 255, 255, .18);

    border-radius: 50%;

    cursor: pointer;

    font-size: 20px;

    backdrop-filter: blur(8px);
}


/* =========================================================
   EXISTING BLOCK SPACING
========================================================= */

.public-raih-card
> .public-block {
    margin-top: 10px;
}


/* =========================================================
   RESPONSIVE
========================================================= */

@media (max-width: 650px) {

    .editor-gallery-grid {
        grid-template-columns:
            repeat(2, minmax(0, 1fr));
    }

}