/*
 * Rumah Pena Foundation
 * Galeri Poto
 */


/* =========================================================
   GALERI PAGE
   ========================================================= */

.rp-gallery-page {
    width: 100%;
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

.rp-gallery-section {
    width: 100%;
    margin: 0;
    padding: 50px 0;
    background: #000;
    color: #fff;
    box-sizing: border-box;
}

.rp-gallery-container {
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 40px;
    box-sizing: border-box;
}


/* =========================================================
   HEADER
   ========================================================= */

.rp-gallery-header {
    width: 100%;
    margin: 0 0 25px;
    padding: 0;
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 20px;
    box-sizing: border-box;
}

.rp-gallery-heading {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    margin: 0;
    padding: 0;
}

.rp-gallery-title {
    margin: 0;
    padding: 0;
    color: #fff;
    font-family: Arial, Helvetica, sans-serif;
    font-size: 18px;
    line-height: 1.3;
    font-weight: 700;
    text-transform: uppercase;
}

.rp-gallery-title-line {
    display: block;
    width: 35px;
    height: 2px;
    margin-top: 5px;
    background: #e00000;
}

.rp-gallery-description {
    margin: 0;
    padding: 0;
}

.rp-gallery-description p {
    margin: 0;
    padding: 0;
    color: #aaa;
    font-family: Arial, Helvetica, sans-serif;
    font-size: 12px;
    line-height: 1.4;
}


/* =========================================================
   GALLERY GRID
   ========================================================= */

.rp-gallery-grid {
    width: 100%;
    margin: 0;
    padding: 0;
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 15px;
    box-sizing: border-box;
}

.rp-gallery-item {
    width: 100%;
    margin: 0;
    padding: 0;
    overflow: hidden;
    border-radius: 8px;
    background: #111;
    box-sizing: border-box;
}

.rp-gallery-image-button {
    position: relative;
    display: block;
    width: 100%;
    margin: 0;
    padding: 0;
    border: 0;
    background: #111;
    cursor: pointer;
    overflow: hidden;
    aspect-ratio: 1 / 1;
    box-sizing: border-box;
}

.rp-gallery-image-button img {
    display: block;
    width: 100%;
    height: 100%;
    margin: 0;
    padding: 0;
    object-fit: cover;
    transition: transform 0.3s ease;
}

.rp-gallery-image-button:hover img {
    transform: scale(1.04);
}

.rp-gallery-image-button:focus {
    outline: 2px solid #fff;
    outline-offset: -2px;
}


/* =========================================================
   EMPTY
   ========================================================= */

.rp-gallery-empty {
    width: 100%;
    min-height: 180px;
    grid-column: 1 / -1;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 30px;
    border: 1px solid #222;
    box-sizing: border-box;
}

.rp-gallery-empty p {
    margin: 0;
    padding: 0;
    color: #888;
    font-family: Arial, Helvetica, sans-serif;
    font-size: 14px;
}


/* =========================================================
   IMAGE VIEWER
   ========================================================= */

.rp-gallery-viewer {
    position: fixed;
    z-index: 999999;
    top: 0;
    right: 0;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 100%;
    margin: 0;
    padding: 0;
    background: rgba(0, 0, 0, 0.97);
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transition: opacity 0.2s ease, visibility 0.2s ease;
    box-sizing: border-box;
}

.rp-gallery-viewer.is-open {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
}

.rp-gallery-viewer-inner {
    position: relative;
    width: 100%;
    height: 100%;
    margin: 0;
    padding: 50px 30px 55px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    box-sizing: border-box;
}


/* =========================================================
   CLOSE BUTTON
   ========================================================= */

.rp-gallery-close {
    position: absolute;
    z-index: 10;
    top: 18px;
    right: 22px;
    width: 42px;
    height: 42px;
    margin: 0;
    padding: 0;
    border: 0;
    border-radius: 50%;
    background: transparent;
    color: #fff;
    font-family: Arial, Helvetica, sans-serif;
    font-size: 34px;
    line-height: 42px;
    font-weight: 300;
    text-align: center;
    cursor: pointer;
    box-sizing: border-box;
}

.rp-gallery-close:hover {
    background: rgba(255, 255, 255, 0.10);
}

.rp-gallery-close:focus {
    outline: 1px solid #fff;
    outline-offset: 2px;
}


/* =========================================================
   VIEWER IMAGE
   ========================================================= */

.rp-gallery-viewer-stage {
    width: 100%;
    height: calc(100% - 25px);
    margin: 0;
    padding: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    touch-action: pan-y;
    box-sizing: border-box;
}

.rp-gallery-viewer-stage img {
    display: block;
    max-width: 100%;
    max-height: 100%;
    width: auto;
    height: auto;
    margin: 0;
    padding: 0;
    object-fit: contain;
    user-select: none;
    -webkit-user-drag: none;
    box-sizing: border-box;
}


/* =========================================================
   DOTS
   ========================================================= */

.rp-gallery-dots {
    position: absolute;
    z-index: 5;
    left: 0;
    right: 0;
    bottom: 20px;
    width: 100%;
    min-height: 12px;
    margin: 0;
    padding: 0 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 7px;
    box-sizing: border-box;
}

.rp-gallery-dot {
    display: block;
    width: 7px;
    height: 7px;
    margin: 0;
    padding: 0;
    border: 0;
    border-radius: 50%;
    background: #777;
    cursor: pointer;
    opacity: 0.7;
    transition: transform 0.2s ease, opacity 0.2s ease;
    box-sizing: border-box;
}

.rp-gallery-dot.is-active {
    background: #fff;
    opacity: 1;
    transform: scale(1.25);
}

.rp-gallery-dot:hover {
    opacity: 1;
}


/* =========================================================
   BODY LOCK
   ========================================================= */

body.rp-gallery-viewer-open {
    overflow: hidden;
}


/* =========================================================
   TABLET
   ========================================================= */

@media (max-width: 900px) {

    .rp-gallery-section {
        padding: 40px 0;
    }

    .rp-gallery-container {
        padding-left: 25px;
        padding-right: 25px;
    }

    .rp-gallery-grid {
        grid-template-columns: repeat(3, minmax(0, 1fr));
        gap: 12px;
    }

}


/* =========================================================
   MOBILE
   ========================================================= */

@media (max-width: 767px) {

    .rp-gallery-section {
        padding: 30px 0;
    }

    .rp-gallery-container {
        max-width: none;
        padding-left: 20px;
        padding-right: 20px;
    }


    .rp-gallery-header {
        margin-bottom: 18px;
        gap: 12px;
    }

    .rp-gallery-title {
        font-size: 15px;
    }

    .rp-gallery-title-line {
        width: 30px;
        height: 2px;
        margin-top: 4px;
    }

    .rp-gallery-description p {
        font-size: 10px;
    }


    .rp-gallery-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 10px;
    }

    .rp-gallery-item {
        border-radius: 6px;
    }


    .rp-gallery-viewer-inner {
        padding: 45px 15px 50px;
    }

    .rp-gallery-close {
        top: 10px;
        right: 12px;
        width: 38px;
        height: 38px;
        font-size: 30px;
        line-height: 38px;
    }

    .rp-gallery-viewer-stage {
        height: calc(100% - 20px);
    }

    .rp-gallery-dots {
        bottom: 18px;
        gap: 6px;
    }

    .rp-gallery-dot {
        width: 6px;
        height: 6px;
    }

}


/* =========================================================
   SMALL MOBILE
   ========================================================= */

@media (max-width: 400px) {

    .rp-gallery-container {
        padding-left: 15px;
        padding-right: 15px;
    }

    .rp-gallery-grid {
        gap: 8px;
    }

    .rp-gallery-header {
        margin-bottom: 15px;
    }

    .rp-gallery-description p {
        font-size: 9px;
    }

}