/* ═══════════════════════════════════════════════════════
   GALLERY STYLESHEET
   Photo Album, Collections & Lightbox Viewer Modal
   ═══════════════════════════════════════════════════════ */

/* ── Gallery Grid ── */
.gallery-container {
    display: grid;
    flex: 1;
    grid-template-columns: repeat(4, 250px);
    gap: 20px;
    width: fit-content;
    margin: 20px auto 0;
}

/* ── Photo Card ── */
.gallery-item {
    width: 250px;
    display: flex;
    flex-direction: column;
    height: 100%;
    background: rgba(20, 0, 20, 0.6);
    border: 2px groove #630063;
    border-radius: 4px;
    overflow: hidden;
    transition: transform 0.2s ease, border-color 0.2s ease;
}

.gallery-item:hover {
    transform: translateY(-3px);
    border-color: red;
}

/* ── Thumbnail ── */
.gallery-thumb {
    width: 100%;
    height: 250px;
    object-fit: cover;
    border-bottom: 1px solid #630063;
}

/* ── Card Details ── */
.gallery-info {
    display: flex;
    flex-direction: column;
    flex: 1;
    padding: 12px;
    gap: 8px;
}

.gallery-title {
    margin: 0;
    font-family: 'Elementary_Gothic_Scaled', serif;
    color: #9e9e9e;
    cursor: pointer;
    font-size: 1.2rem;
    transition: color 0.3s ease;
}

.gallery-title:hover {
    color: red;
}

.gallery-desc {
    margin: 0;
    font-size: 1rem;
    line-height: 1.4;
    color: #d6d6d6;
}

.gallery--truncate-descriptions .gallery-desc {
    display: -webkit-box;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 3;
    overflow: hidden;
}

.gallery-date {
    margin-top: auto;
    font-size: 0.9rem;
    color: #888;
    font-style: italic;
    text-align: right;
}

/* ── Lightbox Viewer Overlay ── */
.viewer-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.9);
    z-index: 1000;
    display: flex;
    justify-content: center;
    align-items: center;
}

.viewer-overlay.hidden {
    display: none;
}

.viewer-content {
    position: relative;
    width: min(90%, 1000px);
    background-color: #080808;
    border: 3px double #630063;
    padding: 20px;
    display: flex;
    flex-direction: column;
    align-items: stretch;
}

.viewer-stage {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr) auto;
    align-items: center;
}

.viewer-main {
    display: flex;
    justify-content: center;
    align-items: center;
}

#viewer-image-link {
    display: flex;
    justify-content: center;
    cursor: zoom-in;
}

#viewer-image {
    max-width: 100%;
    max-height: 60vh;
    border: 2px solid;
}

.viewer--photo-frame #viewer-image {
    border-image-source: url('../images/decorative/photo.png');
    border-image-slice: 23 22 87 20;
    border-image-width: 20px 20px 82px 20px;
    border-width: 20px 20px 73px 20px;
    border-image-outset: 0;
    border-image-repeat: stretch stretch;
    background-color: #d7dbdf;
    border-style: solid;
}

#viewer-image.viewer-image--transition {
    animation: viewer-image-fade 1s ease;
}

@keyframes viewer-image-fade {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

.viewer-details {
    text-align: center;
    margin-top: 15px;
}

#viewer-title {
    font-family: 'Elementary_Gothic_Scaled', serif;
    color: #9e9e9e;
    margin: 5px 0;
}

#viewer-desc {
    font-size: 1.2em;
    margin: 5px 0;
    text-align: justify;
}

#viewer-date,
#viewer-camera {
    margin: 2px 0;
    font-size: 1em;
    color: #8c8c8c;
    font-style: italic;
}

#viewer-counter {
    margin-top: 15px;
    font-size: 1.1em;
    color: #630063;
}

.viewer-close {
    position: absolute;
    top: 10px;
    right: 15px;
    background: none;
    border: none;
    color: red;
    font-size: 1.5em;
    font-family: 'Elementary_Gothic_Scaled', serif;
    cursor: pointer;
}

.viewer-prev,
.viewer-next {
    background: none;
    border: none;
    color: #9e9e9e;
    font-size: 3em;
    cursor: pointer;
    padding: 0 35px;
}

.viewer-prev:hover,
.viewer-next:hover,
.viewer-close:hover {
    color: red;
}

/* ── Responsive ── */
@media (max-width: 1100px) {
    .gallery-container {
        grid-template-columns: repeat(auto-fit, 250px);
    }
}

@media (max-width: 600px) {
    .gallery-container {
        grid-template-columns: 1fr;
        width: 100%;
    }

    .gallery-item {
        width: 100%;
    }

    .viewer-content {
        width: calc(100% - 24px);
        padding: 12px;
    }

    .viewer-prev,
    .viewer-next {
        padding: 0 8px;
        font-size: 2em;
    }
}
