html, body {
    margin: 0;
    padding: 0;
    background: white;
}

body {
    font-family: 'Titillium Web', 'Helvetica Neue', Helvetica, Geneva, Arial, sans-serif;
    font-size: 18px;
    padding: 20px 50px;
}

a {
    color: #1385cb;
}

a:visited {
    color: #0e74bc;
}

.page {
    padding: 0 20%;
}

h1 {
    font-size: 24px;
    margin-bottom: 20px;
}

.back-link {
    margin-bottom: 20px;
    display: block;
}

.albums {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: 20px;
}

.album {
    position: relative;
    overflow: hidden;
    height: 200px;
    border-radius: 4px;
    transition: transform 0.3s ease;
}

.album:hover {
    transform: scale(1.02);
}

.album img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.album-title {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    background-color: rgba(255, 255, 255, 0.8);
    color: #555;
    padding: 8px;
    font-size: 16px;
}

.photos {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: 15px;
}

.photo {
    overflow: hidden;
    border-radius: 4px;
    transition: transform 0.3s ease;
    /* height: 200px; Fixed height for thumbnail grid */
}

.photo:hover {
    transform: scale(1.02);
}

.photo img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    cursor: pointer;
}

/* Lightbox effect */
.lightbox {
    display: none;
    position: fixed;
    z-index: 1000;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(255, 255, 255, 0.95);
    justify-content: center;
    align-items: center;
}

.lightbox.active {
    display: flex;
}

/* Lightbox layout with navigation */
.lightbox.active {
    display: flex;
    flex-direction: row;
    justify-content: center;
    align-items: center;
}

.lightbox-content {
    max-width: calc(100% - 60px); /* Account for minimum nav widths (30px each side) */
    max-height: 90%;
    position: relative;
    z-index: 1001;
    display: flex;
    justify-content: center;
    flex-grow: 1;
    flex-shrink: 1;
}

.lightbox-content img {
    max-width: 100%;
    max-height: 90vh;
    width: auto; /* Let the width adjust automatically based on height */
    height: auto; /* Let the height adjust automatically based on width */
    object-fit: contain;
    image-rendering: high-quality; /* Ensure high quality image rendering */
    image-rendering: -webkit-optimize-contrast; /* Improve clarity on WebKit browsers */
}

.lightbox-title {
    color: white;
    text-align: center;
    margin-bottom: 10px;
    font-size: 20px;
}

.lightbox-close {
    position: absolute;
    top: 20px;
    right: 20px;
    color: #aaa;
    font-size: 30px;
    cursor: pointer;
    z-index: 1002;
}

.lightbox-close:hover {
    color: #555;
}

/* Navigation buttons */
.lightbox-prev,
.lightbox-next {
    position: relative; /* Changed from absolute to relative */
    display: flex;
    align-items: center;
    justify-content: center;
    color: rgba(80, 80, 80, 0.5);
    font-size: 30px;
    cursor: pointer;
    z-index: 1002;
    min-width: 30px; /* Minimum width */
    max-width: 10%; /* Maximum width */
    flex-basis: 10%;
    flex-grow: 0;
    flex-shrink: 1;
    height: 100%;
    transition: all 0.3s ease;
}

.lightbox-prev {
    padding-right: 10px;
    text-align: center;
}

.lightbox-next {
    padding-left: 10px;
    text-align: center;
}

.lightbox-prev:hover,
.lightbox-next:hover {
    color: rgba(80, 80, 80, 0.9);
    background-color: rgba(230, 230, 230, 0.3);
}

.lightbox-prev.disabled,
.lightbox-next.disabled {
    color: rgba(80, 80, 80, 0.2);
    cursor: default;
}

.lightbox-prev.disabled:hover,
.lightbox-next.disabled:hover {
    background-color: transparent;
}
