/*
 * wg-style.css
 *
 * Stylesheet for the Wedding Gallery plugin. Defines a responsive grid for
 * displaying images and basic styling for the upload controls. The gallery
 * uses CSS Grid to automatically adjust the number of columns based on the
 * viewport width. Images are constrained to their container with a border
 * radius for a smoother appearance. Buttons and inputs are styled to match
 * WordPress admin colours for consistency.
 */

.wg-gallery {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    grid-gap: 10px;
    margin-bottom: 20px;
}

.wg-gallery img {
    width: 100%;
    height: auto;
    display: block;
    border-radius: 4px;
    object-fit: cover;
    cursor: pointer; /* allow clicking to open the lightbox */
}

.wg-upload-section {
    margin-top: 10px;
}

.wg-upload-section button {
    background-color: #0073aa;
    color: #ffffff;
    border: none;
    padding: 8px 12px;
    border-radius: 3px;
    cursor: pointer;
    margin-right: 5px;
    font-size: 14px;
}

.wg-upload-section button:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.wg-upload-section input[type="password"],
.wg-upload-section input[type="file"] {
    margin-top: 5px;
    margin-right: 5px;
}

.wg-message {
    margin-top: 10px;
    color: #0073aa;
    font-weight: bold;
}

/* Lightbox overlay styling */
.wg-lightbox-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    z-index: 9999;
    display: flex;
    justify-content: center;
    align-items: center;
}

.wg-lightbox-content {
    position: relative;
    max-width: 90%;
    max-height: 90%;
    text-align: center;
    padding: 0;
}

.wg-lightbox-image {
    max-width: 100%;
    max-height: 100%;
    border-radius: 4px;
    box-shadow: 0 4px 8px rgba(0,0,0,0.3);
}

.wg-lightbox-prev,
.wg-lightbox-next {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    font-size: 40px;
    color: #ffffff;
    cursor: pointer;
    user-select: none;
    padding: 10px;
    background: rgba(0,0,0,0.3);
    border-radius: 50%;
}

.wg-lightbox-prev {
    left: -60px;
}

.wg-lightbox-next {
    right: -60px;
}

.wg-lightbox-close {
    position: absolute;
    top: -40px;
    right: -40px;
    font-size: 30px;
    color: #ffffff;
    cursor: pointer;
    user-select: none;
    background: rgba(0,0,0,0.3);
    border-radius: 50%;
    padding: 5px 10px;
}