* {
    box-sizing: border-box;
}

html {
    height: 100%;
}

body {
    display: flex;
    flex-direction: column;
    margin: 0;
    min-height: 100%;
    padding: 0;
    font-family: Arial, sans-serif;
    overflow-x: hidden;
}

header {
    position: static;
    height: 60px;
    background-color: #053b7d;
    padding: 0;
}

.header-content {
    max-width: 1400px;
    margin: 0 auto;
    display: flex;
    align-items: center;
    justify-content: space-between;
    color: #fff
}

.search-bar-wrapper {
    position: relative;
    height: 100%;
}

.search-bar {
    position: absolute;
    width: 200px;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    padding: 20px;
}

.search-bar-input {
    width: 200px;
    padding: 5px;
    border-radius: 4px;
    border: 1px solid #ccc;
    font-size: 14px !important;
    color: #333;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.2);
}

.dropdown-menu {
    position: absolute;
    background-color: #f9f9f9;
    border: 1px solid #000000;
    border-radius: 4px;
    min-width: 160px;
    max-height: 200px;
    overflow-y: auto;
    z-index: 1;
    display: none;
}

.dropdown-menu div {
    color: black;
    padding: 6px 16px;
    text-decoration: none;
    display: block;
}

#searchResults a {
    text-decoration: none;
    color: black;
    font-size: 14px;
    margin: 1px 0;
}

#searchResults a:hover {
    color: grey;
}

::placeholder {
    font-size: 14px;
    text-align: center;
}

.logo {
    padding: 18px 0;
    width: 325px;
    float: left;
    margin-left: 110px;
}

.container {
    flex: 1 0 auto;
    padding: 10px 20px 10px 10px;
    margin: 0 auto;
    display: grid;
    grid-template-areas: "left right" "left blog-feed" "left extra";
    grid-gap: 5px;
    grid-template-rows: auto 300px min-content;
    max-width: 1280px;
}

.left-section,
.ad-container,
.blog-feed,
.extra-section {
    padding: 20px;
    max-width: 100%;
    overflow-x: auto;
}

.left-section {
    grid-area: left;
    margin-top: 0px;
}

.ad-container {
    grid-area: right;
    padding: 10px 5px 5px 10px;
    max-width: 100%;
    overflow-x: auto;
    justify-content: center;
    align-items: flex-start;
    height: 330px;
}

.extra-section {
    grid-area: extra;
    border: 1px solid #ccc;
    padding: 0px;
    display: grid;
    grid-template-rows: auto 1fr auto;
    grid-template-columns: 1fr;
    gap: 5px;
    align-self: flex-start;
    height: 230px;
    overflow: hidden;
    border-radius: 5px;
    text-decoration: none;
    color: #000;
    margin-top: 160px;
}

.extra-section a {
    color: #053b7d;
}

.extra-section a:visited {
    color: #053b7d;
}

.extra-section a:hover {
    text-decoration: underline;
}

.blog-feed {
    grid-area: blog-feed;
    border: 1px solid lightgray;
    padding: 0px;
    display: grid;
    grid-template-rows: auto 1fr auto;
    grid-template-columns: 1fr;
    gap: 5px;
    align-self: flex-start;
    height: 450px !important;
    border-radius: 5px;
    text-decoration: none;
    color: #000;
    margin-bottom: 5px;
}

.blog-feed .post {
    padding: 5px;
    margin-bottom: 1px;
    border-bottom: 1px solid #ccc;
    max-width: 275px;
    max-height: 450px !important;
    overflow: auto;
    font-size: 14px;
}

.blog-feed .post h2 {
    font-size: 16px;
}

.small-text {
    font-size: 14px;
}

.bottom-row {
    background-color: #f2f2f2;
    padding: 0px;
    text-align: center;
    border: 1px solid #ccc;
}

.bottom-row a {
    margin-bottom: 0 !important;
    padding-bottom: 0 !important;
    line-height: 1;
}

.top-row {
    height: 30px;
    background-color: #053b7d;
    padding: 5px 10px;
    border: 1px solid #ccc;
    text-align: center;
    font-size: 18px;
    font-weight: bold;
    color: white;
}

.top-row a {
    color: white;
}

.top-row a:visited {
    color: white;
}

.top-row a:hover,
.top-row a:focus,
.top-row a:active {
    color: white;
}

.middle-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
    background-color: white;
    padding: 5px;
}

footer {
    background-color: #053b7d;
    padding: 20px;
    text-align: center;
    color: #fff;
}

footer a {
    color: #fff;
    text-decoration: none;
}

footer a:hover {
    color: #fff;
}

nav {
    display: flex;
    gap: 10px;
    margin-right: 200px
}

.nav-button {
    background-color: #053b7d;
    color: #fff;
    border: none;
    padding: 10px 5px;
    text-align: center;
    text-decoration: none;
    display: inline-block;
    font-size: 18px;
    cursor: pointer
}

.nav-button:hover {
    background-color: #298bac
}

.nav-toggle {
    display: none;
    flex-direction: column;
    justify-content: space-around;
    width: 2rem;
    height: 2rem;
    background: 0 0;
    border: none;
    cursor: pointer;
    padding: 0;
    box-sizing: border-box
}

.nav-toggle div {
    width: 2rem;
    height: .25rem;
    background: #fff
}

.duplicate-ad-container {
    display: none;
}


@media (max-width: 768px) {
    .container {
        grid-template-areas: "left" "calculator" "right" "content" "extra";
        grid-template-rows: auto 0px min-content;
    }

    .calculator-container {
        grid-area: calculator;
    }

    .content {
        grid-area: content;
    }

    .ad-container {
        display: none;
    }

    nav {
        margin-right: 0;
    }

    .nav-toggle {
        display: flex;
    }

    #nav-menu {
        flex-direction: column;
        position: fixed;
        top: 60px;
        right: 0;
        background: #333;
        padding: 20px;
        transform: translateX(100%);
        width: 40%;
        height: auto;
        z-index: 1000;
    }

    #nav-menu.show {
        transform: translateX(0);
    }

    .logo {
        margin-left: 0;
    }

    .duplicate-ad-container {
        display: block;
        margin: 0 auto;
        width: 250px;
        height: 250px;
    }

    .ad-section {
        display: none;
    }

    .blog-feed {
        display: none;
    }

    .breadcrumb {
        display: none;
    }

    .horizontal_ad {
        display: none;
    }

    #homecalc_main {
        width: 90%;
    }

    #homecalc_main table {
        display: flex;
        flex-wrap: wrap;
        justify-content: space-between;
        width: 100%;
    }

    #homecalc_main .btn {
        width: calc(20% - 10px);
        margin: 5px;
    }

    #input-box {
        width: 100%;
    }

    header {
        position: relative;
    }
    .input-half {
        width: 100%;
        margin-bottom: 10px; /* Add some margin to separate the stacked inputs */
    }

    .search-bar-wrapper {
        position: absolute;
        top: 60px;
        left: 0;
        right: 0;
        z-index: 999;
        padding: 0 20px;
    }

    .search-bar {
        position: absolute;
        width: 300px;
        top: 50%;
        left: 50%;
        transform: translate(-50%, -50%);
        padding: 20px;
    }

    .search-bar-input {
        width: 100%;
        padding: 5px;
        border-radius: 4px;
        border: 1px solid #ccc;
        font-size: 14px !important;
        color: #333;
        box-shadow: 0 1px 3px rgba(0, 0, 0, 0.2);
    }

    .dropdown-menu {
        width: 100%;
    }
    .extra-section {
        margin-top: 0; 
    }
}

.first-sub-container {
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    text-align: center;
}

.calculator-container {
    background-color: #adcfdc;
    width: 100%;
    max-width: 500px;
    margin: 40px auto;
    border-radius: 10px;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.3), 0 15px 15px rgba(0, 0, 0, 0.3);
    border: 1px solid #333;
    background: linear-gradient(to right, #f8f9fa, #e0eafc);
    padding: 20px;
    text-align: center;
}

.breadcrumb {
    font-size: 14px;
    padding: 0px;
    position: absolute;
    width: 100%;
    z-index: 1;
    margin-left: 110px;
}

.breadcrumb a {
    color: #0438a0;
    text-decoration: none;
}
