/* Profile photo and cover on the user profile pages, and the crop dialog. */

.profile-header .profile-avatar {
    width: 96px;
    height: 96px;
    object-fit: cover;
    background-color: #eef1f4;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.12);
    transition: filter 0.15s ease;
}

.profile-header .banner-img {
    background-color: #33a8ff;
}

.profile-avatar-wrap.viewable {
    cursor: zoom-in;
}

    .profile-avatar-wrap.viewable:hover .profile-avatar {
        filter: brightness(0.94);
    }

.profile-header .profile-edit-chip {
    backdrop-filter: blur(6px);
    background-color: rgba(255, 255, 255, 0.85);
    border: none;
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.2);
}

@media (max-width: 768px) {
    .profile-header .profile-avatar {
        width: 80px;
        height: 80px;
    }
}

/* The site styles put .modal at z-index 1000 with its own tint, under Bootstrap's backdrop (1050),
   which would cover these dialogs and swallow their clicks. */
#avatarViewModal,
#imageCropModal {
    z-index: 1060;
    background: transparent;
}

/* Larger view of the photo. The site styles give every .modal-dialog a white background. */
.avatar-view-dialog {
    max-width: min(420px, calc(100vw - 32px));
    background: transparent;
}

.avatar-view-content {
    background: transparent;
    border: none;
    cursor: zoom-out;
}

.avatar-view-img {
    width: 100%;
    aspect-ratio: 1;
    border-radius: 50%;
    object-fit: cover;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.35);
}

/* Crop dialog */
.crop-dialog {
    max-width: min(560px, calc(100vw - 16px));
    background: transparent;
}

.crop-content {
    border-radius: 16px;
    overflow: hidden;
}

.crop-stage {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 16px;
    overflow: hidden;
    background-color: #111;
    border-radius: 12px;
    touch-action: none;
    cursor: grab;
    user-select: none;
}

    .crop-stage:active {
        cursor: grabbing;
    }

.crop-frame {
    position: relative;
}

    /* Dims the image outside the frame's shape, drawn over the image. */
    .crop-frame::after {
        content: "";
        position: absolute;
        inset: 0;
        border-radius: inherit;
        box-shadow: 0 0 0 9999px rgba(17, 17, 17, 0.6);
        outline: 2px solid rgba(255, 255, 255, 0.9);
        pointer-events: none;
    }

    .crop-frame.round {
        border-radius: 50%;
    }

.crop-image {
    position: absolute;
    top: 0;
    left: 0;
    max-width: none;
    pointer-events: none;
    transform-origin: 0 0;
    will-change: transform;
}

.crop-zoom-row {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-top: 16px;
    color: #787c7e;
}

.crop-hint {
    margin: 4px 0 0;
    font-size: 13px;
    color: #787c7e;
    text-align: center;
}
