/* --- Album menu --- */
#root-albums-menu,
#subalbums-menu {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-bottom: 20px;
    padding: 10px;
}

.album-button {
    padding: 8px 16px;
    background-color: #f0f0f0;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.2s ease;
    font-size: 14px;
}

.album-button:hover {
    background-color: #e0e0e0;
    transform: translateY(-1px);
}

.album-button.active {
    background-color: #007bff;
    color: white;
}

/* --- Gallery images --- */
.gallery-item {
    cursor: pointer;
    margin: 2px;
    border-radius: 4px;
    transition: transform 0.2s ease;
    max-height: 200px; /* Desktop default height limit */
    width: auto;        /* Keep aspect ratio */
    object-fit: cover;  /* Crop to fit */
    display: inline-block;
}
.gallery-item:hover {
    transform: scale(1.03);
}

/* --- Mobile portrait: 1 image per row --- */
@media (max-width: 767px) {
    .gallery-item {
        max-height: 180px;
    }
}

/* --- Mobile landscape: limit to ~3 images per row --- */
@media (max-width: 1024px) and (orientation: landscape) {
    .gallery-item {
        max-height: 150px;
    }
}

/* --- JustifiedGallery row container tweaks --- */
.justified-gallery-row {
    display: flex;
    flex-wrap: nowrap;
}

/* --- Lightbox --- */
.custom-lightbox {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 9999;
    display: flex;
    justify-content: center;
    align-items: center;
}

.lightbox-backdrop {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: rgba(0, 0, 0, 0.95);
}

.lightbox-container {
    position: relative;
    width: 100%;
    height: 100%;
    display: grid;
    grid-template-columns: auto 1fr auto;
    grid-template-rows: auto 1fr auto;
    gap: 20px;
    padding: 20px;
}

.lightbox-content {
    grid-column: 2;
    grid-row: 2;
    display: flex;
    justify-content: center;
    align-items: center;
    max-height: 100%;
}

.lightbox-content img {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
}

/* Common styles for Material Icons */
.material-icons {
    font-family: 'Material Icons';
    font-weight: normal;
    font-style: normal;
    font-size: 24px;
    line-height: 1;
    letter-spacing: normal;
    text-transform: none;
    display: inline-block;
    white-space: nowrap;
    word-wrap: normal;
    direction: ltr;
    font-feature-settings: 'liga';
    -webkit-font-feature-settings: 'liga';
    -webkit-font-smoothing: antialiased;
}

/* Navigation buttons */
.nav-button {
    grid-row: 2;
    align-self: center;
    background: rgba(0, 0, 0, 0.5);
    border: none;
    color: white;
    width: 48px;
    height: 48px;
    cursor: pointer;
    transition: all 0.3s ease;
    z-index: 2;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.nav-button.prev {
    grid-column: 1;
    margin-left: 20px;
}

.nav-button.next {
    grid-column: 3;
    margin-right: 20px;
}

.nav-button:hover {
    background: rgba(0, 0, 0, 0.8);
    transform: scale(1.1);
}

/* Control buttons */
.custom-lightbox .lightbox-controls {
    position: fixed;
    top: 20px;
    right: 20px;
    display: flex;
    z-index: 10001;
    background: rgba(0, 0, 0, 0.6);
    border-radius: 4px;
    overflow: hidden;
}

.custom-lightbox .lightbox-button {
    background: transparent;
    border: none;
    color: white;
    width: 40px;
    height: 40px;
    padding: 0;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 4px;
}

.custom-lightbox .lightbox-button:hover {
    background: rgba(255, 255, 255, 0.2);
    transform: scale(1.1);
}

.custom-lightbox .lightbox-fullscreen {
    border-left: 1px solid rgba(255, 255, 255, 0.2);
}

.custom-lightbox .lightbox-share {
    background: rgba(0, 0, 0, 0.5);
    margin-left: 12px;
    border-radius: 50%;
    width: 36px;
    height: 36px;
}

/* Caption */
.caption-container {
    grid-column: 1 / -1;
    grid-row: 3;
    justify-self: center;
    background: transparent;
    padding: 10px 20px;
    color: white;
    display: flex;
    align-items: center;
    gap: 20px;
}

.caption-text {
    color: white;
    font-size: 16px;
}

/* --- Caption --- */
.lightbox-caption {
    margin-top: 10px;
    padding: 6px 10px;
    background: rgba(0, 0, 0, 0.8);
    color: #fff;
    font-size: 1rem;
    border-radius: 4px;
}
/* --- Share button --- */
.lightbox-share {
    color: #fff;
    cursor: pointer;
}
.lightbox-share:hover {
    background: rgba(0, 0, 0, 0.8);
}



/* --- Prev/Next buttons --- */
.lightbox-prev,
.lightbox-next {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    font-size: 2rem;
    color: #fff;
    background: rgba(0,0,0,0.6);
    border: none;
    padding: 8px 12px;
    cursor: pointer;
    border-radius: 4px;
    user-select: none;
    z-index: 10000;
}
.lightbox-prev {
    left: 10px;
}
.lightbox-next {
    right: 10px;
}
.lightbox-prev:hover,
.lightbox-next:hover {
    background: rgba(0,0,0,0.8);
}

/* --- Responsive adjustments --- */
@media (max-width: 767px) {
    .lightbox-prev,
    .lightbox-next {
        font-size: 1.5rem;
        padding: 6px 10px;
    }
    .lightbox-caption {
        font-size: 0.9rem;
    }
}
