/* Mobile layout first */
body {
    width: 100%;
}
#outer {
    display: flex;
    flex-direction: column;
    gap: .5rem;
}

#topHeader {
    display: none;
}

/* Left banners displayed on top for mobile and tablet */
#left-hangar, #right-hangar {
    /*min-height: 1200px;*/
    /*width: 300px;*/
}
#rightBanners {
    display: none;
}
#left-bims a, #right-bims a{
    display: inline-block;
    margin: 5px 0 2px 0;
}


#main {
    display: flex;
    flex-direction: column;
    position: relative;
    padding: .5rem;
    width:100%;
    min-height: calc(100vh - 100px);
    gap: .5rem;
    margin-bottom: 80px;
}
.menu-buttons-container {
    min-height:60px;
    display: flex;
    position: fixed;
    left: 0;
    top: 0;
    padding: 0 20px;
    height: 85px;
    width: 100%;
    z-index: 97;
    background-color: rgb(245, 245, 245);
    box-shadow: var(--bs-light);
}
/* 2. Hard-code the space for the Font Awesome 2x icons */
.top-menu-button i.fa-2x {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 32px;  /* Reserves width for the icon */
    min-height: 32px; /* Reserves height for the icon */
}

/* 3. Handle the smaller icons (like the 'Create Advert' button) */
.top-menu-button i:not(.fa-2x) {
    display: inline-flex;
    min-width: 20px;
    min-height: 20px;
}




@media screen and (max-width: 480px) {
    .menu-buttons-container {
        height: 70px;
    }
}

.top-menu-toggle,
.top-menu-cta {
    display: flex;
    align-items: center;
    justify-content: center;

}
@media screen and (min-width: 600px) {
    .top-menu-cta {
        gap: 20px;
    }
}

.menu-buttons-container .top-menu-button {
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    width: calc(100vw / 5);
    height: 100%;
    gap: 7px;
    padding: 0;
    min-width: fit-content;
}

.menu-buttons-container .top-menu-button > i,
.menu-buttons-container .top-menu-button > svg {
    font-size: xx-large;
}
.menu-buttons-container .top-menu-button .menu-button-text {
    font-size: 0.8rem;
    color: #1e1e1e;
}
@media screen and (max-width: 525px) {
    .menu-buttons-container .top-menu-button {
        width: calc(100vw / 6);
        height: 100%;
        gap: 7px;
    }
    .menu-buttons-container .top-menu-button > i,
    .menu-buttons-container .top-menu-button > svg {
        font-size: x-large;
        height: 32px;
    }
    .menu-buttons-container .top-menu-button .menu-button-text {
        font-size: 0.6rem;
        text-align: center;
    }
}

.top-menu-text {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: 0 20px;
}
.top-menu-text .short-name {
    display: none;
}
@media screen and (max-width: 850px) {
    .top-menu-text .short-name {
        text-transform: uppercase;
        display: inline-flex;
    }
    .top-menu-text .long-name {
        display: none;
    }
    .menu-buttons-container {
        padding: 0;
    }
}

@media screen and (max-width: 750px) {
    .menu-buttons-container .top-menu-button.latest-listings,
    .menu-buttons-container .fa-avmoz-mfors,
    .menu-buttons-container .top-menu-text {
        display: none;
    }
}


#main>nav {
    order:1;
    display: flex;
    flex-direction: column;
    align-items: center;
    width: 180px;
}
#main>article {
    order:2;
    flex-direction: column;
    width: 100%;
    flex: 1;
    max-width: 1500px;
    margin: 0 auto;
    overflow: scroll;
    z-index: 1;
}
#main>article>h1:first-of-type {
    margin: 20px 0;
}
#footer {
    display: none;
}
/* 1. Force all ad links to act as rigid block containers */
.bims a {
    display: block;
    width: 100%;
    background-color: #f8f9fa; /* Optional: slight grey placeholder before ad loads */
    position: relative;
    overflow: hidden;
}

/* 2. Side Hangars: Reserve the 300x440 vertical space */
/*.pos-left-hangar .bims a,*/
/*.pos-right-hangar .bims a {*/
/*    aspect-ratio: 300 / 440;*/
/*}*/

/* 3. Leaderboards: Reserve the horizontal space */
.leaderboard-hangar .bims a {
    /*aspect-ratio: 728 / 90; !* Adjust if your primary leaderboard size is different *!*/
    max-height: 150px;      /* Honors your existing mobile styling */
}

/* 4. Force the image to elegantly fill the reserved box without stretching */
.bims img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: contain;
}
/* Tablets and larger phones */
@media screen and (min-width: 481px) {
    #main {
        margin-bottom: 0;
        padding-top: 0;
    }
    #topHeader {
        display: flex;
        align-items: center;
        height: 90px;
    }
    .menu-buttons-container {
        top: 0;
        justify-content: space-between;
    }
    .menu-buttons-container .top-menu-button {
        width: 80px;
    }
}
@media screen and (max-width: 480px){
    #main {
        margin-top: 80px;
    }

}
/* Laptops, desktops and larger tablets */
@media screen and (min-width: 769px) {
    #main {
        flex-direction: row;
        margin-top: 0;
        padding-left: 0;
    }

    #leftBanners , #rightBanners { width: 250px;    }
}

/* Larger desktops and monitors */
@media screen and (min-width: 1330px) {
    #rightBanners, #leftBanners {
        display: flex;
        flex-direction: column;
        width: 300px;
    }
}

@media screen and (max-width: 769px) {
    #leftBanners {
        max-height: 230px;
        width: 100%;
        padding: 0;
    }

    #left-bims {
        display: flex;
        flex-wrap: nowrap;
        overflow-x: auto;
        overflow-y: hidden;
        scroll-behavior: smooth;
        -webkit-overflow-scrolling: touch;
        gap: 5px;
        scroll-snap-type: x mandatory;
        border-radius: 7px;
    }

    .bim-container,
    .bims {
        flex-shrink: 0;
        max-width: 769px;
        height: 229px;
        scroll-snap-align: start;
        display: flex;
        flex-direction: column;
        justify-content: space-between;
    }
    #left-bims a {
        margin: 0;
    }
    .bims img {
        height: 230px;
        width: auto;
        object-fit: cover;
    }



}
