* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: Arial, sans-serif;
    background-color: #241a15;
    color: #A19266;
    overscroll-behavior: none; /* Prevent pull-to-refresh */
}

header {
    background: url('images/bg_cover_cropped.webp') no-repeat center center/cover;
    background-size: cover;
    color: #fff;
    text-align: center;
    padding: 4rem 0;
}

header p {
    font-size: 1.2rem;
    margin-top: 0.5rem;
}

.gallery {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 1rem;
    padding: 2rem;
    margin: 0 auto;
    max-width: 1200px;
}

@media (max-width: 768px) {
    .gallery {
        grid-template-columns: repeat(3, 1fr);
        gap: 0.5rem;
        padding: 1rem;
    }
}

.gallery img {
    aspect-ratio: 1/1;
    width: 100%;
    height: auto;
    object-fit: cover;
    border-radius: 0;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
    transition: transform 0.3s, box-shadow 0.3s;
    -webkit-tap-highlight-color: transparent;
    color: transparent; /* Hide alt text while image is loading */
    background-color: #241a15; /* Match background color to hide alt text */
    position: relative;
}

/* Only apply hover effects on devices that support hover */
@media (hover: hover) {
    .gallery img:hover {
        transform: scale(1.05);
        box-shadow: 0 8px 16px rgba(0, 0, 0, 0.2);
    }
}

/* Simple Modal */
#modal-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.9);
    z-index: 1000;
    touch-action: none;
}

#modal-container {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 90%;
    max-width: 800px;
    text-align: center;
}

#modal-image {
    max-width: 100%;
    max-height: 80vh;
    border-radius: 5px;
    object-fit: contain;
}

#modal-close {
    position: absolute;
    top: 20px;
    right: 20px;
    color: white;
    font-size: 40px;
    font-weight: bold;
    cursor: pointer;
    z-index: 1001;
    width: 40px;
    height: 40px;
    line-height: 40px;
    text-align: center;
}

#modal-prev, #modal-next {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    color: white;
    font-size: 30px;
    font-weight: bold;
    cursor: pointer;
    background: none;
    width: 40px;
    height: 60px;
    line-height: 60px;
    text-align: center;
    border: none;
    outline: none;
}

#modal-prev {
    left: 20px;
}

#modal-next {
    right: 20px;
}

@media (max-width: 768px) {
    #modal-close {
        font-size: 50px;
        top: 10px;
        right: 10px;
        width: 50px;
        height: 50px;
    }
    
    /* Hide navigation arrows on mobile devices */
    #modal-prev, #modal-next {
        display: none;
    }
}

/* Only show navigation arrows on devices that support hover (typically desktop) */
@media (hover: hover) {
    #modal-prev, #modal-next {
        display: block;
    }
}

.modal-caption {
    color: #8B5A2B; /* Burnt stone color */
    font-size: 1rem;
    text-align: center;
    margin-top: 10px;
}
