/* Body styles */
body {
    font-family: Arial, sans-serif;
    margin: 0;
    padding: 20px 0 0; /* Add top padding to match About page */
    background-color: black;
    color: #333;
    overflow-x: hidden;
    position: relative;
    box-sizing: border-box;
}


/* Allow scrolling on desktop and fix modal behavior */
body.modal-open {
    overflow-y: hidden; /* Disable scrolling when modal is open */
}

@media (max-width: 768px) {
    body {
        overflow-y: auto; /* Enable scrolling on mobile */
    }
}

.container {
    max-width: 800px;
    padding: 10px;
    background-color: rgba(0, 0, 0, 0.7);
    box-shadow: 0 0 10px rgba(0, 0, 0, 0.1);
    margin: 10px auto;
    position: relative;
    z-index: 1; /* Ensure content appears above canvas */
}

h1 {
    color: #fff;
    text-align: center;
    margin: 45px 0;
}

.grid {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 20px;

}

.grid-item {
    background-color: transparent;
    box-shadow: none;
    width: 200px;
    text-align: center;
    margin: 20px;
    cursor: pointer;
    position: relative;
}

.grid-item img {
    max-width: 100%;
    height: auto;
}

.grid-item p {
    display: none;
}

/* Modal styles */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%; /* Full viewport height */
    background: rgba(0, 0, 0, 0.9);
    justify-content: center;
    align-items: center;
    z-index: 1000;
    overflow: hidden; /* Prevent the whole modal from scrolling */
}

/* Modal content */
.modal-content {
    box-sizing: border-box; /* Includes padding in width/height calculations */
    padding: 20px;
    text-align: center;
    background-color: rgba(0, 0, 0, 0.8); /* Slightly darker background */
    width: 90%;
    max-width: 1200px;
    max-height: calc(var(--vh, 1vh) * 100 - 40px); /* Dynamically calculate height minus padding */
    overflow-y: auto; /* Enable scrolling if content exceeds max height */
    border-radius: 10px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-start;
}


/* Image styles inside the modal */
.modal-content img {
    max-width: 90%; /* Ensure images do not stretch beyond 90% of the modal width */
    max-height: 60vh; /* Limit image height to 60% of the viewport height */
    object-fit: contain; /* Maintain aspect ratio */
    margin-bottom: 20px;
}

/* Heading and text styles inside the modal */
.modal-content h2, .modal-content p {
    color: #fff;
    margin: 10px 0;
    text-align: center;
    max-width: 90%; /* Limit text width to prevent it from becoming too wide */
    margin-left: auto;
    margin-right: auto;
    font-size: 14px; /* Reduce font size for better fit */
    line-height: 1.5; /* Adjust line height for readability */
    overflow-wrap: break-word; /* Allow long words to break and wrap within the container */
}

/* Close button styles */
.close-btn {
    position: absolute;
    top: 20px;
    right: 20px;
    font-size: 24px;
    color: #fff;
    cursor: pointer;
}

/* Style the Amazon link inside the modal */
.amazon-link {
    color: #ff9900; /* Amazon brand color */
    text-decoration: none;
    font-weight: bold;
}

.amazon-link:hover {
    text-decoration: underline;
}


/* Mobile-specific adjustments */
@media (max-width: 768px) {
    .modal-content {
        width: 95%; /* Slightly narrower on mobile */
        max-width: none; /* Remove fixed max-width for flexibility */
        height: auto; /* Height adjusts dynamically based on content */
    }

    .modal-content img {
        max-width: 100%; /* Ensure images scale down better on mobile */
    }

    .modal-content h2, .modal-content p {
        font-size: 12px; /* Make text even smaller on mobile */
    }
}

#canvas {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw; /* Use full viewport width */
    height: 100vh; /* Use full viewport height */
    z-index: 0;
    pointer-events: none; /* Prevent interaction */
    background-color: black; /* Ensure consistent background */
}

@media (max-width: 768px) {
    #canvas {
        height: calc(var(--vh, 1vh) * 100); /* Adjust for mobile viewport height */
    }
}