/* First three memorial photos */
.memorial-photos {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 20px;
    margin: 30px auto;
    max-width: 1100px;
}

.memorial-photos img {
    display: block;
    width: 100%;
    height: 320px;
    object-fit: cover;
    object-position: center;
    border-radius: 8px;
    box-shadow: 0 4px 14px rgba(0, 0, 0, 0.12);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

/* Subtle hover effect */
.memorial-photos img:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 22px rgba(0, 0, 0, 0.18);
}


















/* Show popup when active */
.memorial-lightbox.active {
    display: flex;
}

/* Larger image */
.memorial-lightbox img {
    display: block;
    width: auto;
    height: auto;
    max-width: 100%;
    max-height: calc(100vh - 100px);
    max-height: calc(100dvh - 100px);
    object-fit: contain;
    margin: auto;
}


/* Indicate that photos can be clicked */
.memorial-photos img {
    cursor: zoom-in;
    transition: opacity 0.2s ease;
}

.memorial-photos img:hover {
    opacity: 0.88;
}



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

/* Memorial YouTube video */
.memorial-video {
    width: 100%;
    max-width: 900px;
    margin: 45px auto 2px;
    position: relative;
    aspect-ratio: 16 / 9;
    overflow: hidden;
    background: #000;
    border-radius: 4px;
}

.memorial-video iframe {
    display: block;
    width: 100%;
    height: 100%;
    border: 0;
}
/* Description below the memorial video */
.memorial-video-description {
    max-width: 760px;
    margin: 25px auto 45px;
    text-align: center;
    padding: 0 15px;
    box-sizing: border-box;
}

.memorial-video-description h2 {
    font-family: 'Cormorant Garamond', serif;
    font-size: 30px;
    font-weight: 400;
    color: #333333;
    margin-bottom: 15px;
}

.memorial-video-description p {
    font-family: 'Nunito', sans-serif;
    font-size: 18px;
    font-weight: 300;
    line-height: 1.8;
    color: #000000;
    margin: 0;
}




/* Memorial page heading */
.memorial-heading {
    text-align: center;
    max-width: 900px;
    margin: 35px auto 40px;
    padding: 0 15px;
    box-sizing: border-box;
}

.memorial-heading h1 {
    font-family: 'Cormorant Garamond', serif;
    font-size: 42px;
    font-weight: 400;
    line-height: 1.25;
    color: #B58B45;
    margin: 0 0 15px;
}

.memorial-heading .memorial-subtitle {
    font-family: 'Nunito', sans-serif;
    font-size: 19px;
    font-weight: 300;
    line-height: 1.7;
    color: #5F574D;
    margin: 0 0 18px;
}

.memorial-heading .memorial-date {
    font-family: 'Oswald', sans-serif;
    font-size: 14px;
    font-weight: 300;
    letter-spacing: 2px;
    text-transform: uppercase;
    color: #756957;
    margin: 0;
}

/* Tablet */
@media (max-width: 768px) {
    .memorial-photos {
        grid-template-columns: repeat(2, 1fr);
        gap: 14px;
    }

    .memorial-photos img {
        height: 250px;
    }
}
/* Mobile spacing */
@media screen and (max-width: 768px) {
    .memorial-video {
        width: 100%;
        margin: 30px auto 20px;
        border-radius: 3px;
    }
}

/* Mobile */
@media (max-width: 480px) {
    .memorial-photos {
        grid-template-columns: 1fr;
        gap: 18px;
    }

    .memorial-photos img {
        height: auto;
        max-height: 420px;
        object-fit: contain;
    }
}


@media screen and (max-width: 600px) {
    .memorial-video-description h2 {
        font-size: 25px;
    }

    .memorial-video-description p {
        font-size: 16px;
        line-height: 1.7;
    }
    .memorial-heading {
        margin: 25px auto 30px;
    }

    .memorial-heading h1 {
        font-size: 32px;
    }

    .memorial-heading .memorial-subtitle {
        font-size: 16px;
    }

    .memorial-heading .memorial-date {
        font-size: 12px;
        letter-spacing: 1.5px;
    }
}








#memorial-lightbox {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100vh;
    z-index: 999999;
    background: rgba(0, 0, 0, 0.92);
    box-sizing: border-box;
    padding: 55px 20px 20px;
    align-items: center;
    justify-content: center;
    overflow: auto;
}

#memorial-lightbox.active {
    display: flex;
}

#lightbox-image {
    display: block;
    max-width: 95%;
    max-height: calc(100vh - 100px);
    width: auto;
    height: auto;
    object-fit: contain;
    margin: auto;
}

#memorial-lightbox .lightbox-close {
    position: absolute;
    top: 10px;
    right: 15px;
    z-index: 1000000;
    color: #f5f0e6;
    background: transparent;
    border: none;
    font-size: 42px;
    line-height: 1;
    cursor: pointer;
    pointer-events: auto;
}
