body, html {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    background-color: #e2e1dd;
    height: 100vh;
}

h2 {
    text-align: center;
    color: black;
    font-family:'Trebuchet MS', 'Lucida Sans Unicode', 'Lucida Grande', 'Lucida Sans', Arial, sans-serif;
    font-size: large;
}

.image-bar {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 12vw;
    margin-top: 3vh;
}

.youtube-embed-garden-song {
    display: flex; flex-direction: column;
    position: static;        
    width: 24vw;             
    height: auto;            
    padding: 0;  
    border: 2px solid black; 
}
.youtube-embed-garden-song iframe,
.youtube-embed-garden-song embed {
    width: 100%;
    height: 100%;
}

.reference-holder {
    display: flex;
    justify-content: center;
    flex-direction: row;
    align-items: flex-start;
    gap: 3vw;
    margin: 20px 0;
}
.number-ref-sheet {
    display: flex;
    flex-direction: column;
    align-items: center;
    width: 100%;
    max-width: 420px;
}

.links {
    justify-content: center;
    align-items: center;
    flex-direction: column;
}
.articles-list {
    justify-content: center;
    align-items: flex-start;
    flex-direction: column;
    background-color: rgba(255, 255, 255, 0.555);
}
.out-links {
    justify-content: center;
    align-items: center;
    text-align: center;
    background-color: rgba(255, 255, 255, 0.555);
    padding: 4px;
}

.seaberry-article {
    text-align: center;
    border: 2px solid black;
    background-color: rgba(0, 0, 0, 0.822);
    margin: 2vh;
    padding: 4px;
}
#wtf-1971 {
    background-color: rgba(0, 0, 0, 0.822);
}
.law-thumbnail { 
    align-items: center;
    justify-content: center;
    margin-top: 1vh;
}
.pdf-thumb-img {
    width: auto;
    height: auto;
    max-width: 200px;
    cursor: pointer;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
}
#refSheetTitle {
    margin-top: 15px;
    margin-bottom: 20px;
    text-align: center;
}

.number-ref-sheet, .law-thumbnail {
    flex: 0 1 auto;
    text-align: center;
}
.numRefSheet {
    display: flex;
    width: 27vw;
    max-width: 100%;
    z-index: 2;
    cursor: pointer;
    border: 2px solid black;
}
.image-overlay.active + .numRefSheet {
    display: none;
}
.image-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(0, 0, 0, 0.8);
    justify-content: center;
    align-items: center;
    cursor: grab;
    z-index: 1000;
}
.image-overlay.active {
    display: flex;
}
.full-image {
    width: auto;
    height: auto;
    max-width: none; 
    max-height: none; 
    cursor: grab;
}
.close-btn {
    position: absolute;
    top: 40px; 
    right: 40px; 
    font-size: 72px; 
    background: white;
    border: 5px solid black;
    cursor: pointer;
    z-index: 10;
    display: block;
}

@media (max-width: 768px) {
    .image-bar {
        flex-direction: column;
        align-items: center;
        gap: 30px; 
    }
    .reference-holder {
        flex-direction: column; 
        align-items: center;
        gap: 6vh;
        margin: 0;
    }
    .number-ref-sheet {
        width: 80%; 
        max-width: 420px;
        margin-top: 50px;
    }
    .numRefSheet {
        width: 100%;
        height: auto; 
        max-width: 100%;
    }
    .articles-list {
        width: 90%;
        align-items: center;
    }
    .law-thumbnail {
        width: 100%; 
        margin-top: 25px;
    }
    .pdf-thumb-img {
        max-width: 100%;
        height: auto;
    }
    .sun-video-holder {
        width: 80%;
        max-width: 420px;
    }
}

.pdf-modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0,0,0,0.8);
    z-index: 1000;
    justify-content: center;
    align-items: center;
}
.pdf-modal-content {
    position: relative;
    width: 80%;
    max-width: 600px;
    aspect-ratio: 8.5 / 11;
    background-color: white;
    box-shadow: 0 4px 10px rgba(0,0,0,0.2);
    overflow: hidden;
}
.pdf-modal-content embed {
    width: 100%;
    height: 100%;
    border: none;
}
@media (max-width: 768px) {
    .pdf-modal-content {
        width: 90%;
        max-width: none;
    }
    .pdf-thumb-img {
        max-width: 150px;
    }
}

.sun-video-holder {
    position: static;
    width: 15vw;
    height: auto;
    border: 2px solid #000;
    border-radius: 5px;
}
video {
    position: relative;
    width: 100%;
    max-width: 720px;
    height: auto;
}
@media (max-width: 768px) {
    .youtube-embed-garden-song,
    .number-ref-sheet {
        width: 80%;
        height: 12vh;
        display: flex;
        flex-direction: column;
        justify-content: center;
        align-items: center;
        max-width: 420px;
    }
    .youtube-embed-garden-song { height: auto; }
    .numRefSheet { width: 100%; }
    .sun-video-holder { width: 80%; }
}

.grid-container {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(252px, 1fr));
    gap: 16px;
    width: 100%;
    padding: 40px 10px 10px; 
    background-color: #e2e1dd;
}
.grid-item {
    position: relative;
    overflow: hidden;
    aspect-ratio: 1;
    border: 2px solid black;
    display: flex;
    align-items: center;
    justify-content: center;
}
/* image styling */
.grid-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}
.overlay-link {
    text-align: center;
    position: absolute;
    justify-content: center;
    transform: translate(0, 8vh);
    color: white;
    background: rgba(0, 0, 0, 0.6);
    padding: 2px 5px;
    border-radius: 5px;
    text-decoration: none;
    font-family: Arial, sans-serif;
    font-weight: bold;
    z-index: 2;
    transition: background 0.3s ease;
}
.overlay-link:hover {
    background: rgba(255, 255, 255, 0.6);
    color: black;
}