/* Import Crimson Text font for captions */
@import url("https://fonts.googleapis.com/css2?family=Crimson+Text:ital,wght@0,300;0,400;0,500;1,500;1,600;1,700&display=swap");
@import url("https://fonts.googleapis.com/css2?family=Outfit:wght@300,400,500&display=swap");

body {
    font-family: outfit, "Helvetica Neue", Arial, Verdana, sans-serif;
    background-color: #fffefa; /* bone/off-white color */
    color: #333;
    margin: 0;
    font-weight: 400;
    padding: 20px;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
}

h1 {
    font-size: 2.8rem;
    color: rgb(28, 30, 33);
    font-weight: 500;
    margin-bottom: 0.5rem;
}

.header_image {
    width: 0.75em;
    height: 0.75em;
    margin: 5px 10px -7px 3px;
}

.subtitle {
    margin-bottom: 2rem;
    color: #668;
    font-weight: 400;
    font-size: 0.95rem;
}

.gallery {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    grid-auto-rows: 200px;
    grid-auto-flow: dense;
    gap: 15px;
    margin-bottom: 40px;
}

.gallery-item {
    position: relative;
    overflow: hidden;
    border: 10px solid white;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.12);
    cursor: pointer;
    /* Define fixed aspect ratio container based on size class */
    display: flex;
    justify-content: center;
    align-items: center;
}

.gallery-item img {
    transition: transform 0.3s ease;
    will-change: transform; /* Optimize for animations */
    object-fit: cover; /* Ensure images cover their container, cropping as needed */
    width: 100%;
    height: 100%;
}

/* Create a class for the aspect ratio container */
.aspect-container {
    position: relative;
    width: 100%;
    height: 100%;
    overflow: hidden;
    display: flex;
    justify-content: center;
    align-items: center;
}

.gallery-item:hover img {
    transform: scale(1.05);
}

/* Different thumbnail sizes */
.gallery-item.wide {
    grid-column: span 2;
}

.gallery-item.tall {
    grid-row: span 2;
}

.gallery-item.large {
    grid-column: span 2;
    grid-row: span 2;
}

/* PhotoSwipe caption styling */
.pswp__dynamic-caption {
    max-width: 100%;
    margin: 0 auto;
    text-align: left;
    line-height: 1.5;
    background-color: white;
    padding: 15px 20px;
    border-radius: 0;
    font-weight: 500;
    font-family: "Crimson Text", "Times New Roman", serif;
    color: #333;
    box-shadow: 0px 1px 1px rgba(0, 0, 0, 0.1);
}

.pswp__dynamic-caption h3 {
    margin: 0px 10px 0 0;
    font-size: 1.4rem;
    line-height: 1.3;
    font-weight: 600;
    color: #000;
    font-style: italic;
    display: inline;
}

.pswp__dynamic-caption p {
    margin: 0 0 10px 0;
    font-size: 1rem;
}

.photo-meta {
    font-size: 0.97rem;
    color: #668;
    line-height: 1.4;
    font-family: "Crimson Text", "Times New Roman", serif;
    font-weight: 500;
    display: inline;
}

/* Footer Styling */
.footer {
    margin-top: 40px;
    margin-bottom: 30px;
    width: 100%;
}

.footer-line {
    width: 100%;
    height: 1px;
    background-color: #ddd;
    margin-bottom: 20px;
}

.copyright {
    font-size: 0.8rem;
    color: #888;
    text-align: left;
    font-family: outfit, sans-serif;
    font-weight: 300;
}

@media (max-width: 768px) {
    .gallery {
        grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
        grid-auto-rows: 150px;
        gap: 10px;
    }

    .gallery-item {
        border-width: 5px;
    }

    /* Adjust caption width for mobile */
    .pswp__dynamic-caption {
        max-width: 80% !important;
        height: 100% !important;
    }

    .pswp__dynamic-caption--mobile {
        width: 100% !important;
        max-width: 100% !important;
        height: auto !important;
        bottom: 0;
        left: 0;
        padding: 10px;
    }
}
