/* =========================================================
   MEMBER GALLERY MANAGER
========================================================= */

.member-gallery-manager {
    margin-top: 55px;
}


/* HEADER */

.gallery-manager-header {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 30px;

    margin-bottom: 25px;
}

.gallery-manager-header > div:first-child > span {
    display: block;

    margin-bottom: 8px;

    color: #9c7815;

    font-size: 11px;
    font-weight: 900;

    letter-spacing: 2px;
}

.gallery-manager-header h2 {
    margin: 0 0 8px;

    color: #07182d;

    font-size: 32px;
    font-weight: 900;
}

.gallery-manager-header p {
    margin: 0;

    max-width: 650px;

    color: #718096;

    line-height: 1.7;
}


/* COUNT */

.gallery-count {
    min-width: 90px;

    padding: 15px 20px;

    text-align: center;

    border: 1px solid #e4e8ee;

    border-radius: 15px;

    background: #ffffff;

    box-shadow: 0 8px 25px rgba(7,24,45,.06);
}

.gallery-count strong {
    display: block;

    color: #07182d;

    font-size: 25px;
}

.gallery-count small {
    color: #718096;
}


/* =========================================================
   UPLOAD CARD
========================================================= */

.gallery-upload-card {
    margin-bottom: 30px;

    padding: 40px 25px;

    text-align: center;

    border: 2px dashed #d9dfe7;

    border-radius: 22px;

    background:
        linear-gradient(
            145deg,
            #ffffff,
            #f8fafc
        );

    transition:
        border-color .25s ease,
        box-shadow .25s ease;
}

.gallery-upload-card:hover {
    border-color: #c9a227;

    box-shadow:
        0 15px 40px rgba(7,24,45,.07);
}

.gallery-upload-icon {
    width: 65px;
    height: 65px;

    margin: 0 auto 15px;

    display: flex;

    align-items: center;
    justify-content: center;

    border-radius: 50%;

    background: #faf6e9;

    font-size: 28px;
}

.gallery-upload-card h3 {
    margin: 0 0 8px;

    color: #07182d;

    font-size: 23px;
}

.gallery-upload-card > form > p {
    color: #718096;
}


.gallery-file-label {
    display: inline-flex;

    align-items: center;
    justify-content: center;

    margin-top: 15px;

    min-height: 46px;

    padding: 0 22px;

    border-radius: 10px;

    background: #07182d;

    color: #ffffff;

    font-size: 13px;

    font-weight: 800;

    cursor: pointer;

    transition:
        transform .25s ease,
        background .25s ease;
}

.gallery-file-label:hover {
    transform: translateY(-2px);

    background: #0d2a4b;
}


/* =========================================================
   SELECTED PHOTOS
========================================================= */

.selected-photos {
    display: grid;

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

    gap: 12px;

    max-width: 700px;

    margin: 25px auto 20px;
}

.selected-photo {
    position: relative;

    aspect-ratio: 1;

    overflow: hidden;

    border-radius: 12px;

    background: #e9edf2;
}

.selected-photo img {
    width: 100%;
    height: 100%;

    object-fit: cover;
}

.selected-photo span {
    position: absolute;

    left: 7px;
    top: 7px;

    width: 25px;
    height: 25px;

    display: flex;

    align-items: center;
    justify-content: center;

    border-radius: 50%;

    background: #07182d;

    color: #ffffff;

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


/* =========================================================
   CAPTION FIELDS
========================================================= */

.caption-fields {
    max-width: 700px;

    margin: 20px auto;

    display: grid;

    gap: 12px;

    text-align: left;
}

.caption-field label {
    display: block;

    margin-bottom: 5px;

    color: #344054;

    font-size: 12px;

    font-weight: 700;
}

.caption-field input {
    width: 100%;

    min-height: 44px;

    padding: 0 13px;

    border: 1px solid #dce2e9;

    border-radius: 9px;

    outline: none;

    background: #ffffff;

    color: #172033;
}

.caption-field input:focus {
    border-color: #c9a227;

    box-shadow:
        0 0 0 3px rgba(201,162,39,.10);
}

.gallery-upload-btn:disabled {
    opacity: .45;

    cursor: not-allowed;

    transform: none;
}


/* =========================================================
   MEMBER PHOTO GRID
========================================================= */

.member-photo-grid {
    display: grid;

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

    gap: 22px;
}

.member-photo-card {
    overflow: hidden;

    border: 1px solid #e5e9ef;

    border-radius: 18px;

    background: #ffffff;

    box-shadow:
        0 10px 30px rgba(7,24,45,.07);

    transition:
        transform .3s ease,
        box-shadow .3s ease;
}

.member-photo-card:hover {
    transform: translateY(-5px);

    box-shadow:
        0 20px 45px rgba(7,24,45,.13);
}

.member-photo-view {
    position: relative;

    display: block;

    width: 100%;

    padding: 0;

    border: 0;

    background: #edf1f5;

    cursor: pointer;
}

.member-photo-view img {
    display: block;

    width: 100%;

    aspect-ratio: 4 / 3;

    object-fit: cover;

    transition:
        transform .5s ease;
}

.member-photo-card:hover
.member-photo-view img {
    transform: scale(1.05);
}


.member-photo-overlay {
    position: absolute;

    inset: 0;

    display: flex;

    align-items: center;
    justify-content: center;

    background:
        rgba(7,24,45,.55);

    opacity: 0;

    transition: opacity .25s ease;
}

.member-photo-overlay span {
    padding: 10px 17px;

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

    border-radius: 30px;

    color: #ffffff;

    font-size: 12px;

    font-weight: 800;
}

.member-photo-card:hover
.member-photo-overlay {
    opacity: 1;
}


/* =========================================================
   PHOTO FOOTER
========================================================= */

.member-photo-footer {
    display: flex;

    align-items: center;
    justify-content: space-between;

    gap: 15px;

    padding: 14px 16px;
}

.member-photo-footer p {
    margin: 0 0 4px;

    color: #263348;

    font-size: 13px;

    font-weight: 700;
}

.member-photo-footer p.no-caption {
    color: #718096;
}

.member-photo-footer small {
    color: #98a2b3;

    font-size: 11px;
}

.photo-delete {
    width: 38px;
    height: 38px;

    flex-shrink: 0;

    border: 0;

    border-radius: 10px;

    background: #fff1f1;

    color: #d92d20;

    cursor: pointer;

    transition:
        background .2s ease,
        transform .2s ease;
}

.photo-delete:hover {
    transform: translateY(-2px);

    background: #ffe0e0;
}


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

.gallery-empty {
    padding: 60px 25px;

    text-align: center;

    border: 1px solid #e5e9ef;

    border-radius: 20px;

    background: #ffffff;
}

.gallery-empty > div {
    width: 65px;
    height: 65px;

    margin: 0 auto 15px;

    display: flex;

    align-items: center;
    justify-content: center;

    border-radius: 50%;

    background: #faf6e9;

    font-size: 27px;
}

.gallery-empty h3 {
    margin: 0 0 8px;

    color: #07182d;
}

.gallery-empty p {
    margin: 0;

    color: #718096;
}


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

.member-gallery-lightbox {
    position: fixed;

    inset: 0;

    z-index: 99999;

    display: flex;

    align-items: center;
    justify-content: center;

    padding: 30px;

    background: rgba(2,8,16,.95);

    opacity: 0;

    visibility: hidden;

    pointer-events: none;

    transition:
        opacity .25s ease,
        visibility .25s ease;
}

.member-gallery-lightbox.active {
    opacity: 1;

    visibility: visible;

    pointer-events: auto;
}

.member-lightbox-content {
    max-width: 1100px;

    width: calc(100% - 130px);

    text-align: center;
}

.member-lightbox-content img {
    display: block;

    max-width: 100%;

    max-height: 78vh;

    margin: auto;

    object-fit: contain;

    border-radius: 8px;

    box-shadow:
        0 30px 100px rgba(0,0,0,.5);
}

.member-lightbox-caption {
    margin-top: 15px;

    color: #ffffff;

    font-size: 14px;

    font-weight: 700;
}

.member-lightbox-counter {
    margin-top: 5px;

    color: #aeb8c5;

    font-size: 12px;
}


/* LIGHTBOX BUTTONS */

.member-lightbox-close,
.member-lightbox-prev,
.member-lightbox-next {
    position: fixed;

    display: flex;

    align-items: center;
    justify-content: center;

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

    background: rgba(255,255,255,.08);

    color: #ffffff;

    cursor: pointer;

    transition:
        background .2s ease,
        color .2s ease;
}

.member-lightbox-close {
    top: 20px;
    right: 25px;

    width: 48px;
    height: 48px;

    border-radius: 50%;

    font-size: 31px;
}

.member-lightbox-prev,
.member-lightbox-next {
    top: 50%;

    width: 55px;
    height: 55px;

    border-radius: 50%;

    transform: translateY(-50%);

    font-size: 40px;
}

.member-lightbox-prev {
    left: 25px;
}

.member-lightbox-next {
    right: 25px;
}

.member-lightbox-close:hover,
.member-lightbox-prev:hover,
.member-lightbox-next:hover {
    background: rgba(201,162,39,.25);

    color: #e8cf72;

    border-color: rgba(201,162,39,.6);
}


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

@media (max-width: 800px) {

    .member-photo-grid {
        grid-template-columns:
            repeat(2, minmax(0, 1fr));

        gap: 15px;
    }

    .selected-photos {
        grid-template-columns:
            repeat(4, 1fr);
    }

}


@media (max-width: 600px) {

    .gallery-manager-header {
        align-items: flex-start;

        flex-direction: column;
    }

    .gallery-manager-header h2 {
        font-size: 27px;
    }

    .gallery-count {
        min-width: 100px;
    }

    .member-photo-grid {
        grid-template-columns: 1fr;

        gap: 18px;
    }

    .member-photo-view img {
        aspect-ratio: 16 / 11;
    }

    .selected-photos {
        grid-template-columns:
            repeat(3, 1fr);

        gap: 8px;
    }

    .gallery-upload-card {
        padding: 30px 17px;
    }

    .member-gallery-lightbox {
        padding: 12px;
    }

    .member-lightbox-content {
        width: calc(100% - 20px);
    }

    .member-lightbox-content img {
        max-height: 72vh;
    }

    .member-lightbox-prev,
    .member-lightbox-next {
        width: 42px;
        height: 42px;

        font-size: 30px;
    }

    .member-lightbox-prev {
        left: 7px;
    }

    .member-lightbox-next {
        right: 7px;
    }

    .member-lightbox-close {
        top: 10px;
        right: 10px;

        width: 42px;
        height: 42px;

        font-size: 27px;
    }

}


@media (max-width: 400px) {

    .selected-photos {
        grid-template-columns:
            repeat(2, 1fr);
    }

}