﻿body > footer {
    grid-column: body-full-width;
    display: grid;
    grid-template-columns: [full-width-start] minmax(var(--padding-inline), 1fr) [content-start] min( 100% - (var(--padding-inline) * 2), var(--content-max-width) ) [content-end] minmax(var(--padding-inline), 1fr) [full-width-end];
}

body > footer > section {
    grid-column: content;
    display: grid;
    grid-template-columns: 1fr 1fr 1fr 1fr 1fr;
    grid-template-rows: auto auto auto auto;
    justify-content: space-evenly;
    align-content: start;
    gap: 10px;
    padding-bottom: 40px;
}

body > footer a {  /* refactor: copied from the header */
    display: block;
    /* remove default link styling */
    border: none;
    color: var(--text);
    text-decoration: none;
}

body > footer address{
    margin-top: 26px;
    color: var(--black);
    margin-bottom: 60px;
    display: flex;
    flex-direction: column;
}

.footerLinks{
    display: flex;
    flex-direction: column;
    gap: 24px;
}
.footerLinks a:hover, #policies a:hover{
    color: var(--orange);
}
.footerLinks a:hover svg path{
    fill: var(--orange);
    stroke: none;
}
.linkHeader {
    font-size: 21px;
    font-weight: 600;
}

#bottomSocials {
    grid-column: 4 / span 2;
    grid-row: 2 / span 1;
    display: flex;
    justify-content: end;
    align-items: baseline;
    gap: 30px;
    margin-bottom: 20px;
}
#bottomSocials svg path {
    fill: var(--blue);
    stroke: var(--blue);
}
@media (hover: hover) { /* if the brower supports real hovering; prevents "sticky" hovers on touch devices */
    #bottomSocials a:hover svg path {
        fill: var(--orange);
        stroke: var(--orange);
    }
}
#bottomBoilerplate {
    grid-column: 1 / span 2;
    grid-row: 4 / span 1;
    display: flex;
    flex-direction: column;
    justify-content: center;
}
#copyright{
    color: black;
    grid-column: 1 / span 2;
    grid-row: 3 / span 1;
    align-self: end;
}
#policies {
    display: flex;
    column-gap: 19px;
}

#bottomAccreditations {
    grid-column: 3 / span 3;
    grid-row: 3 / span 1;
    display: flex;
    justify-content: end;
    gap: 25px;
}

/* mobile menu styles */

#toTopButton {
    display: none;
    color: var(--blue);
    text-align: center;
}
#toTopButton svg path {
    fill: var(--blue);
    stroke: var(--blue);
}

@media (max-width: 819px) { /* breakpoint matches the header */
    body > footer > section{
        display: flex;
        flex-direction: column;
        gap: 10px;
    }
    #bottomLogoAndToTopButton{
        display: flex;
        justify-content: space-between;
    }
    #toTopButton {
        display: block;
    }
    body > footer address {
        margin-top: 26px;
        color: var(--black);
        margin-bottom: 10px;
        flex-direction: row;
        white-space: pre-wrap; /* to recognize the space in the content below */
        flex-wrap: wrap;
    }
    body > footer address span:not(:last-child)::after {
        content: ", ";
    }
    .footerLinks {
        margin-top: 24px; /* matches gap */
    }
    #bottomSocials {
        margin-top: 25px;
        justify-content: center;
    }
    #bottomAccreditations {
        justify-content: center;
        gap: 25px;
        margin-bottom: 10px;
    }
    #bottomBoilerplate {
        align-items: center;
        white-space: pre-wrap; /* to recognize the spaces around the bullet characters */
    }

}

body > footer  a.footer-mawazo {
    grid-column: 5; 
    grid-row: 4; 
    justify-self: end; 
    align-self: end;
}

a.footer-mawazo .colored {
    display: none;
}

a.footer-mawazo:hover img.colored {
    display: inline;
}

a.footer-mawazo:hover img.dark {
    display: none;
}

