/* =========================================================
   GALLERY
   ========================================================= */
/* Gallery text */

#gallery {
    color: #333;
}

#gallery .gallery-section-heading h3,
#gallery .gallery-section-heading p,
#gallery .gallery-upload-hint,
#gallery .gallery-collection-heading h3,
#gallery .gallery-collection-heading p,
#gallery .gallery-back-button {
    color: #333;
}

/* Gallery upload */

.gallery-upload {
    margin: 2.2rem 0 2.5rem;
    text-align: center;
}

.gallery-upload-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;

    padding: 0.85rem 1.7rem;

    border: 1px solid #c9a44c;
    border-radius: 999px;

    background: transparent;

    color: #b18a2d !important;

    cursor: pointer;

    font-size: 0.9rem;
    font-weight: 600;

    letter-spacing: 0.04em;

    transition:
        background 0.2s ease,
        color 0.2s ease,
        transform 0.2s ease;
}

.gallery-upload-button:hover {
    background: #c9a44c;

    color: white !important;

    transform: translateY(-1px);
}

.gallery-upload-highlight {
    animation: galleryUploadHighlight 2.5s ease;
}

@keyframes galleryUploadHighlight {
    0% {
        transform: scale(1);
    }

    20% {
        transform: scale(1.02);
    }

    40% {
        transform: scale(1);
    }

    60% {
        transform: scale(1.02);
    }

    100% {
        transform: scale(1);
    }
}

.gallery-upload-hint {
    margin-top: 0.9rem;
    margin-bottom: 1.4rem;
    font-size: 0.85rem;
    line-height: 1.6;
    opacity: 0.7;
}


/* Gallery sections */

.gallery-section {
    margin-top: 3rem;
}

.gallery-section-heading {
    margin-bottom: 1.25rem;
}

.gallery-section-heading h3 {
    margin-bottom: 0.35rem;
}

.gallery-section-heading p {
    margin: 0;

    font-size: 0.9rem;

    opacity: 0.7;
}


/* Generic media grid */

.gallery-grid {
    display: grid;

    grid-template-columns:
        repeat(2, minmax(0, 1fr));

    gap: 0.75rem;
}


/* Media item */

.gallery-media {
    position: relative;

    overflow: hidden;

    border-radius: 12px;

    aspect-ratio: 1 / 1;

    cursor: pointer;
}

.gallery-media img,
.gallery-media video {
    display: block;

    width: 100%;
    height: 100%;

    object-fit: cover;
}


/* Guest collection tiles */

.gallery-guest-grid {
    display: grid;

    grid-template-columns:
        repeat(2, minmax(0, 1fr));

    gap: 1rem;
}

.gallery-guest-tile {
    overflow: hidden;

    border-radius: 14px;

    cursor: pointer;

    background: #f7f4ef;

    transition:
        transform 0.2s ease,
        box-shadow 0.2s ease;
}

.gallery-guest-tile:hover {
    transform: translateY(-2px);

    box-shadow:
        0 8px 24px rgba(0, 0, 0, 0.08);
}

.gallery-guest-previews {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    grid-template-rows: repeat(2, 1fr);
    gap: 3px;
    aspect-ratio: 1 / 1;
    overflow: hidden;
}

.gallery-guest-preview {
    width: 100%;
    height: 100%;

    object-fit: cover;

    display: block;
}

.gallery-guest-info {
    padding: 0.9rem 1rem 1rem;
}

.gallery-guest-name {
    margin: 0;

    font-size: 0.95rem;
    font-weight: 600;
}

.gallery-guest-count {
    margin: 0.3rem 0 0;

    font-size: 0.8rem;

    opacity: 0.65;
}

.gallery-guest-preview {
    width: 100%;
    height: 100%;

    object-fit: cover;

    display: block;
}

.gallery-guest-preview:only-child {
    grid-column: 1 / -1;
    grid-row: 1 / -1;
}


/* Full collection */

.gallery-collection {
    margin-top: 2rem;
}

.gallery-back-button {
    display: inline-flex;
    align-items: center;
    gap: 0.45rem;
    margin: 0 0 1.25rem;
    padding: 0.5rem 0.85rem;
    border: 1px solid rgba(51, 51, 51, 0.18);
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.7);
    color: var(--text) !important;
    font: inherit;
    font-size: 0.8rem;
    cursor: pointer;
    transition:
        background 0.2s ease,
        border-color 0.2s ease,
        color 0.2s ease;
}

.gallery-back-button:hover {
    background: var(--gold);
    border-color: var(--gold);
    color: white !important;
}

.gallery-collection-heading {
    margin-bottom: 1.5rem;
}

.gallery-collection-heading h3 {
    margin-bottom: 0.35rem;
}

.gallery-collection-heading p {
    margin: 0;

    font-size: 0.9rem;

    opacity: 0.7;
}


/* Lightbox */

.gallery-lightbox {
    position: fixed;

    inset: 0;

    z-index: 1000;

    display: flex;

    align-items: center;
    justify-content: center;

    padding: 1rem;

    background: rgba(0, 0, 0, 0.9);
}

.gallery-lightbox-content {
    max-width: 95vw;
    max-height: 90vh;
}

.gallery-lightbox-content img,
.gallery-lightbox-content video {
    display: block;

    max-width: 95vw;
    max-height: 85vh;

    object-fit: contain;
}

.gallery-lightbox-close {
    position: absolute;

    top: 1rem;
    right: 1rem;

    width: 42px;
    height: 42px;

    border: 0;
    border-radius: 50%;

    background: rgba(255, 255, 255, 0.15);

    color: white;

    font-size: 1.8rem;

    line-height: 1;

    cursor: pointer;
}


/* Larger screens */

@media (min-width: 700px) {

    .gallery-grid {
        grid-template-columns:
            repeat(3, minmax(0, 1fr));
    }

    .gallery-guest-grid {
        grid-template-columns:
            repeat(3, minmax(0, 1fr));
    }

}

/* Keep hidden Gallery elements hidden */

#gallery [hidden] {
    display: none !important;
}

/* =========================================================
   GALLERY TOAST
   ========================================================= */

.gallery-toast {
    position: fixed;

    left: 50%;
    bottom: 30px;

    transform: translate(-50%, 20px);

    z-index: 2000;

    padding: 12px 20px;

    border: 1px solid var(--gold);
    border-radius: 999px;

    background: rgba(255, 255, 255, 0.96);

    color: var(--text);

    font-size: 0.85rem;
    font-weight: 500;

    box-shadow:
        0 8px 25px rgba(0, 0, 0, 0.12);

    opacity: 0;

    pointer-events: none;

    transition:
        opacity 0.3s ease,
        transform 0.3s ease;
}

.gallery-toast.show {
    opacity: 1;

    transform:
        translate(-50%, 0);
}

/* Gallery lightbox navigation */

.gallery-lightbox {
    z-index: 3000;
}

.gallery-lightbox-close,
.gallery-lightbox-prev,
.gallery-lightbox-next {
    position: absolute;

    width: 48px;
    height: 48px;

    padding: 0;

    border: 1px solid rgba(255, 255, 255, 0.35);
    border-radius: 50%;

    background: rgba(0, 0, 0, 0.45);

    color: white !important;

    display: flex;
    align-items: center;
    justify-content: center;

    cursor: pointer;

    z-index: 3001;
}

.gallery-lightbox-close {
    top: 20px;
    right: 20px;

    font-size: 1.8rem;
    line-height: 1;
}

.gallery-lightbox-prev {
    left: 20px;
    top: 50%;

    transform: translateY(-50%);

    font-size: 2.4rem;
    line-height: 1;
}

.gallery-lightbox-next {
    right: 20px;
    top: 50%;

    transform: translateY(-50%);

    font-size: 2.4rem;
    line-height: 1;
}

.gallery-lightbox-close:hover,
.gallery-lightbox-prev:hover,
.gallery-lightbox-next:hover {
    background: rgba(0, 0, 0, 0.7);
}

.gallery-lightbox-close {
    position: fixed !important;

    top: 20px !important;
    right: 20px !important;

    width: 48px !important;
    height: 48px !important;

    padding: 0 !important;
    margin: 0 !important;

    display: flex !important;
    align-items: center !important;
    justify-content: center !important;

    border: 1px solid rgba(255, 255, 255, 0.5) !important;
    border-radius: 50% !important;

    background: rgba(0, 0, 0, 0.65) !important;

    color: white !important;

    font-family: Arial, sans-serif !important;
    font-size: 28px !important;
    font-weight: 400 !important;
    line-height: 1 !important;

    opacity: 1 !important;
    visibility: visible !important;

    z-index: 9999 !important;

    cursor: pointer;
}

@media (max-width: 700px) {

    .gallery-lightbox-close {
        top: 110px !important;
        right: 20px !important;
    }

}

.gallery-collection-title-row {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 1rem;
}

.gallery-select-button,
.gallery-selection-cancel,
.gallery-delete-selected {
    padding: 0.6rem 1rem;
    border: 1px solid var(--gold);
    border-radius: 999px;
    background: transparent;
    color: var(--text) !important;
    font: inherit;
    font-size: 0.8rem;
    cursor: pointer;
    white-space: nowrap;
}

.gallery-select-button:hover,
.gallery-selection-cancel:hover {
    background: var(--gold);
    color: white !important;
}

.gallery-selection-actions {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    margin-top: 1rem;
}

.gallery-delete-selected {
    background: var(--gold);
    color: white !important;
}

.gallery-delete-selected:disabled {
    opacity: 0.4;
    cursor: not-allowed;
}

.gallery-delete-selected:not(:disabled):hover {
    opacity: 0.85;
}

@media (max-width: 550px) {

    .gallery-collection-title-row {
        align-items: center;
    }

    .gallery-selection-actions {
        flex-direction: column;
        align-items: stretch;
    }

    .gallery-selection-actions button {
        width: 100%;
    }

}

.gallery-media-selected {
    outline: 3px solid var(--gold);
    outline-offset: -3px;
}

.gallery-media-selected::after {
    content: "✓";
    position: absolute;
    top: 10px;
    right: 10px;
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    background: var(--gold);
    color: white;
    font-size: 1rem;
    font-weight: 600;
}

.gallery-media-delete,
.gallery-media-highlight {
    position: absolute;
    top: 8px;
    width: 32px;
    height: 32px;
    padding: 0;
    border: 1px solid rgba(255, 255, 255, 0.7);
    border-radius: 50%;
    background: rgba(0, 0, 0, 0.65);
    color: white !important;
    font-family: Arial, sans-serif;
    font-size: 18px;
    font-weight: 400;
    line-height: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    z-index: 5;
}

.gallery-media-delete {
    right: 8px;
    font-size: 22px;
}

.gallery-media-highlight {
    right: 48px;
}

.gallery-media-delete:hover,
.gallery-media-highlight:hover {
    background: rgba(0, 0, 0, 0.85);
}

.gallery-highlight-reel {
    position: relative;
    width: 100%;
    max-width: 700px;
    margin: 0 auto;
    display: flex;
    align-items: center;
    justify-content: center;
}

.gallery-highlight-stage {
    width: 100%;
    max-width: 620px;
}

.gallery-highlight-slide {
    position: relative;
    width: 100%;
    aspect-ratio: 4 / 3;
    overflow: hidden;
    border-radius: 16px;
    cursor: pointer;
}

.gallery-highlight-slide img,
.gallery-highlight-slide video {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.gallery-highlight-prev,
.gallery-highlight-next {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 42px;
    height: 42px;
    padding: 0;
    border: 1px solid rgba(255,255,255,.7);
    border-radius: 50%;
    background: rgba(0,0,0,.45);
    color: white !important;
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: Arial, sans-serif;
    font-size: 2rem;
    line-height: 1;
    cursor: pointer;
    z-index: 5;
}

.gallery-highlight-prev {
    left: 10px;
}

.gallery-highlight-next {
    right: 10px;
}

.gallery-highlight-prev:hover,
.gallery-highlight-next:hover {
    background: rgba(0,0,0,.7);
}

.gallery-highlight-dots {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 7px;
    margin-top: 1rem;
}

.gallery-highlight-dot {
    width: 7px;
    height: 7px;
    padding: 0;
    border: 0;
    border-radius: 50%;
    background: rgba(51,51,51,.3);
    cursor: pointer;
}

.gallery-highlight-dot.active {
    background: var(--gold);
    transform: scale(1.35);
}

@media (max-width: 600px) {

    .gallery-highlight-reel {
        max-width: 100%;
    }

    .gallery-highlight-stage {
        max-width: none;
    }

    .gallery-highlight-slide {
        aspect-ratio: 4 / 3;
        border-radius: 12px;
    }

    .gallery-highlight-prev,
    .gallery-highlight-next {
        width: 36px;
        height: 36px;
        font-size: 1.7rem;
    }

    .gallery-highlight-prev {
        left: 8px;
    }

    .gallery-highlight-next {
        right: 8px;
    }
}

.gallery-lightbox-content {
    position: relative;
}

.gallery-lightbox-uploader {
    position: absolute;
    left: 12px;
    bottom: 12px;
    z-index: 2;
    padding: 6px 10px;
    border-radius: 999px;
    background: rgba(0, 0, 0, 0.45);
    color: rgba(255, 255, 255, 0.85);
    font-size: 0.7rem;
    font-weight: 400;
    pointer-events: none;
}

.gallery-manage-button {
    margin-top: 0.75rem;
    padding: 0.5rem 1rem;
    border: 1px solid var(--gold);
    border-radius: 999px;
    background: transparent;
    color: var(--text) !important;
    font: inherit;
    font-size: 0.75rem;
    font-weight: 500;
    letter-spacing: 0.03em;
    cursor: pointer;
    transition:
        background 0.2s ease,
        color 0.2s ease,
        opacity 0.2s ease;
}

.gallery-manage-button:hover {
    background: var(--gold);
    color: white !important;
}

.gallery-manage-button.admin-active {
    background: var(--gold);
    color: white !important;
}

.gallery-manage-button:focus-visible {
    outline: 2px solid var(--gold);
    outline-offset: 3px;
}

@media (max-width: 550px) {
    .gallery-manage-button {
        margin-top: 0.6rem;
        padding: 0.45rem 0.9rem;
        font-size: 0.72rem;
    }
}