/*
 * Homepage certifications and responsive article layout.
 * Preserves the original Yat framework, banner and sidebar.
 */

/* Desktop certification sidebar */

.home-framework > .home-credentials {
  flex: 0 0 144px;
  min-width: 0;
  margin-right: 28px;
  padding-top: 2px;
  align-self: flex-start;
  text-align: left;
  color: inherit;
}

/* Section headings */

.home-credentials h2,
.home-framework .home-articles-heading {
  font-size: 1rem;
  font-weight: 600;
  line-height: 1.4;
  margin: 0 0 16px;
  text-align: left;
  color: inherit;
}

/* Hide the Articles heading on desktop */

.home-framework .home-articles-heading {
  display: none;
}

/* Certification badge list */

.home-credentials .home-credentials-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 17px;
}

  .home-credentials .home-credentials-list li {
    margin: 0;
    padding: 0;
    list-style: none;
  }

/* Individual certification badge */

.home-credentials .home-credential {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 4px;
  color: inherit;
  font-size: 0.82rem;
  line-height: 1.4;
  text-decoration: none;
}

  .home-credentials .home-credential img {
    display: block;
    width: 96px;
    height: 96px;
    max-width: 100%;
    object-fit: contain;
    margin: 0;
    padding: 0;
    border: none;
    border-radius: 0;
    box-shadow: none;
    background: transparent !important;
  }

  /* Accessibility */

  .home-credentials .home-credential:hover span {
    text-decoration: underline;
  }

.home-credentials a:focus-visible {
  outline: 2px solid currentColor;
  outline-offset: 4px;
}

/* All certifications link */

.home-credentials .home-credentials-more {
  display: inline-block;
  margin-top: 20px;
  font-size: 0.8rem;
  color: inherit;
  text-decoration: underline;
  text-underline-offset: 3px;
}

/* Prevent article column overflow */

.home-framework > .main {
  min-width: 0;
}

/* Large desktop: utilise the left gutter */

@media screen and (min-width: 1360px) {
  .framework.home-framework {
    margin-left: -172px;
  }
}

/* Smaller desktops and tablets */

@media screen and (max-width: 1150px) {

  .framework.home-framework {
    flex-wrap: wrap;
  }

  .home-framework > .home-credentials {
    flex: 0 0 100%;
    max-width: 100%;
    margin: 0 0 28px;
    padding-bottom: 18px;
    box-sizing: border-box;
    border-bottom: 1px solid rgba(128, 128, 128, 0.3);
  }

  .home-credentials .home-credentials-list {
    flex-direction: row;
    flex-wrap: wrap;
    justify-content: flex-start;
    align-items: center;
    gap: 14px 20px;
  }

  .home-credentials .home-credential img {
    width: 72px;
    height: 72px;
  }

  .home-credentials .home-credentials-more {
    margin-top: 12px;
  }
}

/* Mobile layout: match Yat's 800px breakpoint */

@media screen and (max-width: 800px) {

  /* Stack the homepage sections vertically */

  .framework.home-framework {
    display: flex;
    flex-direction: column;
    flex-wrap: nowrap;
    align-items: stretch;
    margin-left: 0;
    margin-right: 0;
    width: 100%;
    min-width: 0;
    box-sizing: border-box;
  }

  /* Certifications section */

  .home-framework > .home-credentials {
    flex: 0 0 auto;
    width: 100%;
    max-width: 100%;
    margin: 0 0 24px;
    padding: 0 0 18px;
    box-sizing: border-box;
    align-self: stretch;
    text-align: left;
  }

  /* Horizontal, left-aligned certification badges */

  .home-credentials .home-credentials-list {
    flex-direction: row;
    flex-wrap: wrap;
    justify-content: flex-start;
    align-items: center;
    gap: 12px;
    margin: 0;
    padding: 0;
  }

  .home-credentials .home-credential {
    align-items: center;
  }

    .home-credentials .home-credential img {
      width: 64px;
      height: 64px;
      max-width: 100%;
    }

  /* Full-width article feed */

  .home-framework > .main {
    flex: 0 0 auto;
    width: 100%;
    max-width: 100%;
    min-width: 0;
    margin: 0;
    box-sizing: border-box;
  }

  /* Display the Articles heading on mobile only */

  .home-framework .home-articles-heading {
    display: block;
  }
}
