/* Reset default browser styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: Arial, sans-serif;
    line-height: 1.6;
    overflow-x: hidden; /* Prevent horizontal scroll */
    margin: 0;
    background-color: #fff; /* White background */
}

.container {
    max-width: 800px;
    margin: 15px auto;
    padding: 15px;
    background-color: #dcdcdc; /* Light blue background dbe9f4 */
    border-radius: 8px;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.0);
}

header {
    text-align: center;
    margin-bottom: 10px;
}

.logo {
    width: 130px;
    height: 130px;
    border-radius: 50%;
    object-fit: cover; /* Ensure the image covers the circular area */
    margin-bottom: 2px;
}

h1 {
    color: #333;
}

.links {
    width: 100%;
    text-align: center;
}

.links a {
    display: block;
    text-decoration: none;
    color: #007bff;
    padding: 15px;
    background: #fff;
    border-radius: 8px;
    text-align: center;
    margin-bottom: 20px;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
    transition: background-color 0.3s ease;
}

.links a:hover {
    background-color: rgba(255, 255, 255, 0.9);
}

/* Default Image Grid */
.image-grid {
    display: flex;
    flex-wrap: wrap;
    justify-content: center; /* Center-aligns images */
    gap: 5px; /* Adjust gap size between images */
    max-width: 800px;
    margin: 0 auto;
}

.image-grid a {
    flex: 1 1 calc(33.333% - 10px); /* Each item takes 1/3 of the row width */
    max-width: calc(33.333% - 10px); /* Limits to three images per row */
    border: 1px solid #fff;
    border-radius: 4px;
    overflow: hidden;
    transition: transform 0.2s;
    box-sizing: border-box;
}

/* Hover effect for non-mobile devices */
.image-grid a:hover {
    transform: scale(1.05);
}

.image-grid img {
    width: 100%;
    height: auto;
    display: block;
}

.image-name {
    margin: 4px 10px;
    font-size: 15px;
    color: #000080;
}

footer {
    text-align: center;
    margin-top: 20px;
    color: #fff;
}

/* Ad container */
.ad-container {
    width: 100%; /* Full width */
    margin: 20px 0; /* Margin around the ad */
    padding: 0;
    background-color: transparent; /* Transparent background */
    text-align: center; /* Center the ad */
    overflow: hidden; /* Hide any overflow */
    position: relative;
}

.ad-container img,
.ad-container iframe {
    max-width: 100%; /* Make sure the ad doesn't overflow its container */
    height: auto; /* Keep aspect ratio */
    display: block; /* Block-level element to take full width */
    margin: 0 auto;
}

/* Responsive ad container for aspect ratio handling */
.ad-container iframe,
.ad-container img {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
}

/* Media Queries for Responsiveness */
@media (max-width: 768px) {
    .container {
        padding: 15px;
    }

    .links a {
        padding: 12px;
        font-size: 16px;
    }

    /* Adjust image grid to two images per row */
    .image-grid a {
        flex: 1 1 calc(50% - 10px);
        max-width: calc(50% - 10px);
    }

    /* Remove hover effect on mobile and tablet devices */
    .image-grid a:hover {
        transform: none;
    }
}

@media (max-width: 480px) {
    .container {
        padding: 10px;
    }

    .links a {
        padding: 10px;
        font-size: 14px;
    }

    /* Apply specific .image-grid styling for mobile devices */
    .image-grid {
        display: grid;
        grid-template-columns: repeat(2, 1fr);
        gap: 1px;
        max-width: 800px;
        margin: 0 auto 1px;
    }

    /* Adjust image grid to single image per row on very small screens */
    .image-grid a {
        flex: 1 1 calc(100% - 10px);
        max-width: calc(100% - 10px);
    }

    /* Remove hover effect on smaller devices */
    .image-grid a:hover {
        transform: none;
    }
}