#footer {
    border-width: 0;
    border-top-width: 5px;
    border-top-style: solid;
    display: grid;
    grid-template-columns: 25% 1fr 20%;
    padding: 2em 5em;
}
#footer .title {
    display: block;
    font-size: 1.5em;
    margin-top: 0.67em;
    margin-bottom: 0.67em;
    margin-left: 0;
    margin-right: 0;
}
#footer .subtitle {
    display: block;
    font-size: 1.25em;
    margin-top: 0.83em;
    margin-bottom: 0.83em;
    margin-left: 0;
    margin-right: 0;
}

#footer #footer-header {
    display: grid;
    height: fit-content;
}
#footer #footer-header .button {
    width: fit-content;
    height: fit-content;
    padding: 0;
}

#footer-links {
    display: grid;
    grid-template-columns: 25% auto auto auto;
    grid-template-rows: auto 1fr;
    height: fit-content;
}
#footer-links > .title {
    grid-column: 1 / span 4;
    grid-row: 1;
    height: fit-content;
    text-align: center;
}
#footer-links > div:nth-of-type(1) {
    grid-column: 2;
    grid-row: 2;
}
#footer-links > div:nth-of-type(2) {
    grid-column: 3;
    grid-row: 2;
}
#footer-links > div:nth-of-type(3) {
    grid-column: 4;
    grid-row: 2;
}
#footer-links > div {
    display: inline-flex;
    flex-direction: column;
    padding: 0 1.25em;
}
#footer-links > div > a {
    margin-top: 0.25em;
    margin-bottom: 0.25em;
    color: var(--purple-highlight);
    text-decoration: underline;
}

#footer-contact-info {
    display: grid;
    grid-template-rows: repeat(4, auto);
    height: fit-content;
}
#footer-contact-info > .title {
    text-align: center;
}
#footer-contact-info > .footer-contact-card {
    display: grid;
    column-gap: 1em;
    grid-template-columns: 4em 1fr;
    grid-template-rows: auto auto;
    margin-bottom: 1em;
}
#footer-contact-info > .footer-contact-card > .img {
    display: block;
    height: 100%;
    width: 100%;
    grid-row: 1 / span 2;
}
#footer-contact-info > .footer-contact-card img {
    display: inline-block;
    height: 3em;
    width: 3em;
    position: absolute;
    top: 0;
    bottom: 0;
    left: 0;
    right: 0;
    margin: auto;
}
#footer-contact-info > .footer-contact-card > .subtitle {
    margin-top: 0;
}
#footer-contact-info > .footer-contact-card > .message {
    margin-bottom: 0;
}

#copyright {
    grid-column: span 3;
    padding: 1em;
    text-align: center;
    border-top: 2px solid var(--purple-foreground);
}

@media screen and (max-width: 768px) {
    #footer {
        padding: 2em 0;
        row-gap: 1em;
    }
    #footer #footer-header,
    #footer #footer-contact-info {
        padding: 0 3em;
    }
    #footer,
    #footer #footer-contact-info {
        grid-template-columns: auto;
    }
    #footer #footer-header {
        display: flex;
        flex-direction: column;
        justify-content: center;
        align-items: center;
    }
    #footer #footer-links {
        grid-template-columns: repeat(3, auto);
        text-align: center;
        column-gap: 0;
        padding: 0 1.5em;
    }
    #footer #footer-links > .title {
        grid-column: 1 /span 3;
    }
    #footer #copyright,
    #footer #footer-links > .item {
        grid-column: unset !important;
        grid-row: unset !important;
    }
}