@media (max-width: 1000px) {

    .header {
        justify-content: space-between;
    }

    .header * {
        margin: 0 7px
    }

    h1 {
        font-size: 2em;
    }

    p {
        font-size: 0.9em;
    }

    p.note {
        font-size: 0.8em;
    }

    .vertical_delimiter {
        width: 80%;
    }

    .content ,.news{
        padding: 0px;
        margin: 0px;
    }

    .about_info {
        width: 90%;
    }

    .footer_links {
            display: grid;
            grid-template-columns: repeat(3, 1fr);
            grid-gap: 1rem;
            justify-items: center;
            align-items: center;
            text-align: center;
            padding: 15px;
    }
    
    /* Center the X link specifically when it's in the last row */
    .footer_links a:nth-last-child(1):nth-child(3n-2) {
        grid-column: 1 / span 3;
        justify-self: center;
    }

    /* If X isn't the only item in the last row but needs centering */
    .footer_links a:last-child {
        justify-self: center;
    }
}

@media only screen and (max-device-width: 1000px) {
    .footer_links {
        justify-content: space-around;
    }
}

/* Specific media query for mobile devices */
@media only screen and (max-device-width: 600px) {
    .footer_links {
        display: grid;
        grid-template-columns: repeat(3, 1fr);
        grid-gap: 1rem;
        justify-items: center;
        align-items: center;
        text-align: center;
        padding: 10px;
    }
    
    /* Center the X link specifically when it's in the last row */
    .footer_links a:nth-last-child(1):nth-child(3n-2) {
        grid-column: 1 / span 3;
        justify-self: center;
    }
    
    /* If X isn't the only item in the last row but needs centering */
    .footer_links a:last-child {
        justify-self: center;
    }

    .photo-section {
        max-width:100%;
        margin: 20px 10px 20px 10px;
        padding: 10px 10px 15px 10px;
    }

    .photo-item {
        margin-bottom: 0px;
    }

    .photo-grid {
        display: grid;
        grid-template-columns: repeat(2, 1fr);
        justify-content: center;
        gap: 4px;
    }

    .photo-grid img {
        width: 100%;
        height: auto;
        object-fit: cover;
    }

    #toc li {
        width: 40%;
        min-width: 10em;
    }
}

/* Hide modal navigation arrows on mobile devices */
@media (max-width: 768px) {
    #image-modal .prev,
    #image-modal .next {
        transform: translateY(-50%) translateX(-100px);
    }
    
    #image-modal .next {
        transform: translateY(-50%) translateX(100px);
    }
}