/* General styles for the page */
body {
    font-family: Arial, sans-serif;
    margin: 0;
    padding: 0;
    line-height: 1.6;
}

/* Wrapper for the entire page */
.page-wrapper {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    min-height: 100vh; /* Ensure the page wrapper takes the full height of the viewport */
    position: relative;
}

/* Left and right ad banners */
.ad-left, .ad-right {
    width: 150px;
    background: #f9f9f9;
    border: 1px dashed #ccc;
    text-align: center;
    padding: 10px;
    margin: 10px;
    flex-shrink: 0;
}

/* Main content wrapper */
.content-wrapper {
    flex: 1;
    margin: 0 10px;
    display: flex;
    flex-direction: column;
}

/* Header */
header {
    background: #f4f4f4;
    padding: 10px 20px;
    text-align: center;
    border-bottom: 1px solid #ddd;
    position: sticky;
    top: 0;
    z-index: 1000;
}

/* Alphabet navigation */
.alphabet-nav {
    background: #333;
    color: #fff;
    padding: 0px 0;
    text-align: center;
    position: sticky;
    top: 60px;
    z-index: 999;
    overflow-x: auto; /* Allow horizontal scrolling if necessary */
    white-space: nowrap; /* Prevent wrapping of navigation items */
    max-width: 100%; /* Ensure it doesn't exceed the viewport width */
    box-sizing: border-box; /* Include padding in width calculations */
}

.alphabet-nav ul {
    list-style: none;
    margin: 0;
    padding: 0;
    display: inline-flex; /* Use inline-flex to prevent wrapping */
    justify-content: flex-start; /* Align items to the left */
    flex-wrap: wrap; /* Allow wrapping on smaller screens */
}

.alphabet-nav li {
    margin: 5px 10px;
}

.alphabet-nav a {
    color: #fff;
    text-decoration: none;
    font-weight: bold;
}

.alphabet-nav a:hover {
    text-decoration: underline;
}

main {
    padding: 20px;
}

section {
    margin-bottom: 20px;
}

.ad {
    background: #f9f9f9;
    border: 1px dashed #ccc;
    text-align: center;
    padding: 10px;
    margin: 10px auto; /* Center ads and add spacing */
    max-width: 100%; /* Ensure ads fit within the screen width */
    overflow: hidden; /* Prevent content overflow */
}

/* Footer */
footer {
    background: #333;
    color: #fff;
    text-align: center;
    padding: 10px 0;
    margin-top: auto; /* Push the footer to the bottom of the content */
    width: 100%; /* Ensure the footer spans the content area only */
    position: relative;
    z-index: 1; /* Ensure it stays above other elements */
    box-sizing: border-box;
}

/* Responsive Design: Adjust layout for smaller screens */
@media (max-width: 768px) {
    .page-wrapper {
        flex-direction: column; /* Stack content vertically */
        align-items: center; /* Center-align content */
    }

    .ad-left, .ad-right {
        display: none; /* Hide side ads on smaller screens */
    }

    .content-wrapper {
        margin: 0; /* Remove side margins */
        width: 100%; /* Ensure it takes the full width */
    }

    .alphabet-nav ul {
        flex-wrap: wrap; /* Allow wrapping of navigation items */
        justify-content: center; /* Center-align navigation links */
    }

    .alphabet-nav a {
        font-size: 14px; /* Adjust font size for smaller screens */
        padding: 5px 10px; /* Add padding for better touch targets */
    }
}

@media (max-width: 480px) {
    header {
        font-size: 18px; /* Adjust header font size for smaller screens */
    }

    .alphabet-nav a {
        font-size: 14px; /* Adjust navigation link size */
    }
}