/* =========================================
   GENERAL PAGE SETTINGS
   ========================================= */

* {
    box-sizing: border-box;
}

html,
body {
    margin: 0;
    padding: 0;
}

body {
    background-color: #ffffff;
    color: #000000;

    font-family: Arial, Helvetica, sans-serif;
    font-weight: bold;
}


/* =========================================
   MAIN SITE WRAPPER

   The width is based on the proportions
   of the layout in your reference image.
   ========================================= */

.site-wrapper {
    width: min(820px, 96vw);
    margin: 8px auto 20px auto;
}


/* =========================================
   IMAGE HEADER
   ========================================= */

.image-header {
    width: 100%;
    height: 82px;

    background-color: #aaaaaa;

    border-radius: 0 0 5px 5px;

    overflow: hidden;

    display: flex;
    align-items: center;
    justify-content: center;
}

.image-header img {
    width: 100%;
    height: 100%;

    object-fit: cover;

    display: block;
}


/*
   If you don't have a header image yet,
   you can temporarily hide the image:

   .image-header img {
       display: none;
   }

   The gray background will remain.
*/


/* =========================================
   NAVIGATION
   ========================================= */

.navigation {
    height: 39px;

    margin-top: 11px;
    margin-bottom: 8px;

    background-color: #aaaaaa;

    border-radius: 4px;

    display: grid;
    grid-template-columns: repeat(5, 1fr);

    overflow: hidden;
}

.navigation a {
    display: flex;

    align-items: center;
    justify-content: center;

    color: #000000;
    text-decoration: none;

    font-size: 18px;

    transition: background-color 0.2s;
}

.navigation a:hover {
    background-color: #888888;
}


/* =========================================
   MAIN GRID

   Left sidebar | Main image | Text | Right sidebar
   ========================================= */

.main-layout {
    display: grid;

    grid-template-columns:
        137px
        minmax(180px, 1fr)
        minmax(180px, 1fr)
        137px;

    gap: 10px;

    align-items: stretch;
}


/* =========================================
   SIDEBARS
   ========================================= */

.left-sidebar,
.right-sidebar {
    display: flex;

    flex-direction: column;

    gap: 10px;
}


/* =========================================
   IMAGE BUTTONS
   ========================================= */

.image-button {
    display: block;

    width: 100%;
    height: 105px;

    background-color: #aaaaaa;

    border-radius: 3px;

    overflow: hidden;

    text-decoration: none;
}

.image-button img {
    width: 100%;
    height: 100%;

    object-fit: cover;

    display: block;
}


/*
   Placeholder styling if an image doesn't load.
   The gray box will still be visible.
*/

.image-button img[src=""] {
    display: none;
}


/* =========================================
   MAIN CENTER IMAGE
   ========================================= */

.main-image {
    height: 386px;

    background-color: #aaaaaa;

    overflow: hidden;
}

.main-image img {
    width: 100%;
    height: 100%;

    object-fit: cover;

    display: block;
}


/* =========================================
   CONTENT COLUMN
   ========================================= */

.content-column {
    display: flex;

    flex-direction: column;

    gap: 9px;

    min-width: 0;
}


/* =========================================
   SCROLLABLE TEXT BOXES
   ========================================= */

.text-box {
    background-color: #aaaaaa;

    overflow-y: auto;

    padding: 15px;

    scrollbar-width: auto;

    line-height: 1.35;
}


/*
   Introduction box
   */

.introduction {
    height: 237px;

    font-size: 17px;
}


/*
   Smaller text boxes
   */

.small-text {
    height: 65px;

    padding: 10px;

    font-size: 16px;
}


/* Scrollbar styling for Chrome/Edge/Safari */

.text-box::-webkit-scrollbar {
    width: 12px;
}

.text-box::-webkit-scrollbar-track {
    background: #d0d0d0;
}

.text-box::-webkit-scrollbar-thumb {
    background: #777777;

    border: 2px solid #d0d0d0;
}

.text-box::-webkit-scrollbar-thumb:hover {
    background: #555555;
}


/* =========================================
   TEXT STYLING
   ========================================= */

.text-box h2 {
    margin-top: 0;
    margin-bottom: 10px;

    text-align: center;

    font-size: 25px;
}

.text-box p {
    margin-top: 0;
    margin-bottom: 12px;
}


/* =========================================
   TEXT FOOTER
   ========================================= */

.text-footer {
    height: 75px;

    margin-left: 147px;
    margin-right: 147px;

    margin-top: 11px;

    background-color: #aaaaaa;

    display: flex;

    align-items: center;
    justify-content: center;

    overflow: auto;
}

.text-footer p {
    margin: 0;

    font-size: 20px;
}


/* =========================================
   IMAGE FOOTER
   ========================================= */

.image-footer {
    display: grid;

    grid-template-columns: 137px 1fr 137px;

    gap: 20px;

    margin-top: 17px;

    height: 115px;
}

.footer-side-image,
.footer-center-image {
    background-color: #aaaaaa;

    overflow: hidden;

    border-radius: 4px;
}

.footer-side-image img,
.footer-center-image img {
    width: 100%;
    height: 100%;

    object-fit: cover;

    display: block;
}


/* =========================================
   MOBILE LAYOUT
   ========================================= */

@media (max-width: 700px) {

    .site-wrapper {
        width: 96vw;
    }

    /*
       Make navigation scroll horizontally
       instead of becoming unreadably small.
    */

    .navigation {
        grid-template-columns: repeat(5, 120px);

        overflow-x: auto;

        justify-content: start;
    }

    .navigation a {
        font-size: 16px;
    }


    /*
       Change the four-column desktop layout
       into a simpler mobile layout.
    */

    .main-layout {
        grid-template-columns: 1fr 1fr;

        gap: 8px;
    }

    .main-image {
        grid-column: 1 / -1;

        height: 300px;

        order: 1;
    }

    .content-column {
        grid-column: 1 / -1;

        order: 2;
    }

    .left-sidebar {
        order: 3;
    }

    .right-sidebar {
        order: 4;
    }


    .image-button {
        height: 90px;
    }


    .text-footer {
        margin-left: 0;
        margin-right: 0;
    }


    .image-footer {
        grid-template-columns: 1fr 1fr;

        height: auto;

        gap: 8px;
    }

    .footer-center-image {
        grid-column: 1 / -1;

        height: 110px;

        order: -1;
    }

    .footer-side-image {
        height: 90px;
    }
}


/* =========================================
   VERY SMALL SCREENS
   ========================================= */

@media (max-width: 400px) {

    .main-layout {
        grid-template-columns: 1fr;
    }

    .main-image,
    .content-column,
    .left-sidebar,
    .right-sidebar {
        grid-column: 1;
    }

    .left-sidebar,
    .right-sidebar {
        display: grid;

        grid-template-columns: 1fr 1fr;
    }
}
