:root {
  --lightOnDarkEmphasis: #57a5ff;
  --textColorGray: #636363;
  --dark-brown: #231f20;
}

footer {
  background: #f2f2f2;
  color: var(--textColorGray);
  width: 100%;

  .content-inset {
    display: grid;
    grid-template-areas:
      'subscribe'
      'footer-block';
    grid-template-columns: 1fr;
    grid-template-rows: repeat(2, auto);
  }

  ul {
    margin: 0;
  }

  .flat-list {
    font-weight: normal;
    list-style: none;
    padding: 0;

    li {
      margin: 1em;
    }

    a {
      color: var(--textColorGray);
      text-decoration: none;
      padding: 0em 0.5em;
    }

    a:hover {
      color: var(--lightOnDarkEmphasis);
    }
  }

  .social {
    background: #686869;
    grid-area: social;
    height: fit-content;
    margin: 0;
    padding: 0;

    ul {
      justify-content: center;

      li {
        padding: 0.15rem 2rem;
        display: flex;
        align-items: center;

        a {
          background-repeat: no-repeat;
          background-size: 18px 18px;
          content: '';
          display: inline-block;
          height: 18px;
          width: 18px;
        }

        .youtube-icon {
          background-image: url('../img/icons/youtube-square-white.svg');
        }

        .linkedin-icon {
          background-image: url('../img/icons/linkedin-white.svg');
        }

        a:hover {
          fill: white;
        }
      }

    }
  }

  .subscribe {
    grid-area: subscribe;
    margin: 1rem auto;
    padding: 1rem;
    padding-top: 0;

    &-heading {
      margin-top: 0.2rem;
    }

    a {
      color: var(--textColorGray);
    }

  }

  .subscribe-heading {
    color: #111;
    font-size: 1.3rem;
  }

  .footer-block-container {
    display: grid;
    grid-area: footer-block;

    @media (min-width: 768px) {
      grid-template-rows: 3fr 2fr;
    }
  }

  .footer-block-links {
    border-bottom: #fff solid 1px;
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    max-width: 1100px;
    margin: auto;

    @media (min-width: 650px) {
      flex-wrap: nowrap;
    }

    /* Two columns would sit at opposite edges under space-between. The gap is
       only wanted side by side; once they stack, their own margins suffice. */
    &.footer-block-links-pair {
      justify-content: center;

      @media (min-width: 650px) {
        gap: 4rem;
      }
    }

    .footer-block {
      text-align: center;
      margin: 1rem auto;

      p {
        color: var(--textColorGray);
        font-weight: 500;
        line-height: 24px;
        margin-bottom: 2rem;
      }

      li {
        font-size: 0.875rem;
        margin: 0.2rem 0;
      }

      .footer-heading {
        color: black;
        font-size: 1rem;
      }

      @media screen and (max-width: 1024px) {
        flex-basis: 50% !important;
      }

      @media screen and (max-width: 500px) {
        flex-basis: 100% !important;
      }
    }
  }

  /* Holds only the logo now that the sister-brand link list has gone, so it
     stays a single centred column at every width. */
  .footer-block-logo {
    display: grid;
    grid-template-columns: 1fr;
    padding: 1rem;
    height: 100%;

    &-image {
      img {
        display: block;
        margin: 0 auto;
        max-width: 300px;
        object-fit: contain;
        padding-top: 1rem;
        width: 80%;
      }
    }
  }

  .footer-logo {
    grid-area: logo;
  }

  .footer-copyright {
    background: white;
    color: var(--textColorGray);
    display: flex;
    flex-wrap: wrap;
    grid-area: copyright;
    justify-content: center;
    list-style: none;
    padding: 1rem;

    li {
      font-size: 14px;
      font-weight: bold;
      margin-right: 12px;
      white-space: nowrap;

      a {
        color: var(--textColorGray);
        width: fit-content;
      }
    }
  }

  .footer-logo {
    grid-area: logo;
  }

}

@media screen and (min-width: 1024px) {
  footer[role='contentinfo'] {
    width: 100%;

    .content-inset {
      display: grid;
      grid-template-areas: 'subscribe footer-block';
      grid-template-columns: 1fr 1fr;
    }
  }
}

.secondary-nav {
  ul {
    display: flex;
    list-style: none;
    padding: 0;
  }

  li {
    font-size: 14px;
    padding: 0 3px;
  }

  a {
    color: #7a7979;
    padding: 0.5rem;
    text-decoration: none;
    transition: 0.3s;
  }

  a:hover {
    color: var(--dark-brown);
  }
}


.footer-wrappper {
  max-width: 1500px;
}
