body {
    font-family: Arial, sans-serif;
    margin: 20px;
    padding: 0;
    background-color: #f4f4f4;
}

header {
    background: linear-gradient(rgba(0, 0, 0, 0.5), rgba(0, 0, 0, 0.5)), 
                url('../images/tel-aviv.jpg');
    background-size: cover;
    background-position: center;
    color: #fff;
    padding: 40px 0;
    text-align: center;
}

header h1 {
    text-shadow: 0 0 15px rgba(255, 255, 255, 0.9),
                 0 0 25px rgba(255, 255, 255, 0.7);
    display: inline-block;
    padding: 15px 30px;
    background-color: rgba(0, 0, 0, 0.3);
    border-radius: 8px;
    font-size: 2.5em;
    margin-bottom: 20px;
}

nav {
    margin: 20px 0;
}

nav ul {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    justify-content: center;
    gap: 25px;
}

nav li {
    display: inline-block;
}

nav a {
    color: #fff;
    text-decoration: none;
    padding: 10px 15px;
    border-radius: 4px;
    transition: background-color 0.3s ease;
}

nav a:hover {
    background-color: rgba(255, 255, 255, 0.1);
    text-decoration: none;
}

.container {
    width: 80%;
    margin: auto;
    overflow: hidden;
}

.gallery {
    margin: 20px 0;
}

.gallery-scroll {
    display: flex;
    overflow-x: auto;
    gap: 15px;
    padding: 20px 0;
    scrollbar-width: thin;
    scrollbar-color: #888 transparent;
}

.gallery-scroll img {
    width: 200px;
    height: 200px;
    border-radius: 12px;
    object-fit: cover;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 8px 16px rgba(0, 0, 0, 0.2);
    border: 3px solid white;
    margin: 0 10px;
    flex-shrink: 0;
}

/* Special handling for portrait-oriented images */
.gallery-scroll img[data-orientation="portrait"] {
    max-width: 200px;
    max-height: 300px;
}

.gallery-scroll img:hover {
    transform: scale(1.1);
    box-shadow: 0 8px 12px rgba(0, 0, 0, 0.3);
    z-index: 100;
}

/* Custom scrollbar styling */
.gallery-scroll::-webkit-scrollbar {
    height: 8px;
}

.gallery-scroll::-webkit-scrollbar-track {
    background: transparent;
}

.gallery-scroll::-webkit-scrollbar-thumb {
    background: #888;
    border-radius: 4px;
}

.gallery-scroll::-webkit-scrollbar-thumb:hover {
    background: #666;
}

#random-image-container {
    display: flex;
    gap: 20px;
    justify-content: center;
    margin: 20px 0;
}

.gallery-link {
    display: block;
    width: 45%;
    max-width: 400px;
    text-decoration: none;
    color: #333;
    text-align: center;
}

.random-painting {
    width: 100%;
    height: 300px;
    object-fit: cover;
    border-radius: 8px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    transition: transform 0.2s ease;
}

.random-painting:hover {
    transform: scale(1.02);
}

.gallery-cta {
    margin-top: 10px;
    font-weight: bold;
    font-size: 0.9em;
}

h1, h2, h3 {
    color: #333;
    font-family: 'Playfair Display', serif;
}

.explanation-text {
    font-family: 'Merriweather', serif;
    line-height: 1.6;
    max-width: 800px;
    margin: 20px auto;
    padding: 0 20px;
}

.explanation-image {
    width: 100%;
    max-width: 600px;
    max-height: 400px;
    object-fit: cover;
    border-radius: 12px;
    border: 3px solid white;
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.3);
    margin: 20px auto;
    background: #f0f0f0;
    display: flex;
    justify-content: center;
    align-items: center;
}

/* Gallery Grid Layout */
.gallery-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 16px;
    justify-content: center;
}

.gallery-grid img {
    display: block;
    object-fit: cover;
    width: 220px;      /* Set a fixed width for all images */
    height: 300px;     /* Set a fixed height for all images */
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.15);
    background: #eee;
    transition: transform 0.2s;
}

.gallery-grid img:hover {
    transform: scale(1.04);
    z-index: 2;
}

/* Lightbox styling */
.lightbox {
    display: none; /* Hidden by default */
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.8); /* Semi-transparent black background */
    justify-content: center;
    align-items: center;
    z-index: 1000;
}

.lightbox-content {
    position: relative;
    max-width: 90%;
    max-height: 90%;
    display: flex;
    justify-content: center;
    align-items: center;
}

.lightbox-content img {
    max-width: 100%;
    max-height: 100%;
    display: block;
    border-radius: 8px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.3);
}

.lightbox .close {
    position: absolute;
    top: 10px;
    right: 10px;
    font-size: 24px;
    color: white;
    cursor: pointer;
    z-index: 1001;
}

#magnifier {
    display: none;
    position: fixed;
    pointer-events: none;
    border: 2px solid #fff;
    border-radius: 50%;
    width: 250px;      /* Increased from 150px to 250px */
    height: 250px;     /* Increased from 150px to 250px */
    box-shadow: 0 2px 8px rgba(0,0,0,0.3);
    z-index: 1002;
    background-repeat: no-repeat;
    background-size: 200% 200%;
    transition: left 0.05s, top 0.05s;
}

.zoom-box {
    display: none;
    position: fixed;
    width: 300px;
    height: 300px;
    border: 2px solid #ccc;
    background-repeat: no-repeat;
    background-size: 200% 200%;
    z-index: 1003;
    box-shadow: 0 2px 8px rgba(0,0,0,0.15);
}

.gallery-item {
    position: relative; /* Needed for absolute positioning of zoom box */
}

footer {
    text-align: center;
    padding: 20px 0;
    background: #333;
    color: #fff;
    position: relative;
    bottom: 0;
    width: 100%;
}

/* Mobile Responsive Styles */
@media (max-width: 768px) {
    nav ul {
        flex-direction: column;
        gap: 10px;
    }
    
    nav a {
        padding: 8px;
    }
    
    #random-image-container {
        flex-direction: column;
        align-items: center;
    }
    
    .gallery-link {
        width: 90%;
        max-width: none;
    }
    
    .gallery-scroll img {
        max-width: 180px;
        max-height: 120px;
    }
    
    .gallery-scroll img[data-orientation="portrait"] {
        max-width: 120px;
        max-height: 180px;
    }
    
    .gallery-grid {
        grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    }
    
    .lightbox-content {
        max-width: 95%;
        padding: 10px;
    }
    
    .close {
        top: -20px;
        right: -20px;
        font-size: 30px;
    }
}
