/* Subject pages (/learn and /learn/<subject>). Typography and sections come from help-faq.css and content-page.css. */

.subject-page .blog-breadcrumb {
  max-width: 100%;
  margin-bottom: 1.25rem;
}

/* The teacher cards use the Explore card styles (explore-common.css); this just gives them room. */
.subject-page {
  max-width: 1100px;
}

.subject-page > .help-faq-page__section:not(.subject-page__teachers),
.subject-page > .content-cta,
.subject-page > .help-faq-page__intro,
.subject-page > .help-faq-page__title {
  max-width: 760px;
  margin-left: auto;
  margin-right: auto;
}

.subject-page .subject-page__cards {
  padding: 0;
}

.subject-card-teacher__name-link {
  color: inherit;
  text-decoration: none;
}

.subject-card-teacher__name-link:hover,
.subject-card-teacher__name-link:focus-visible {
  color: #f94e10;
  text-decoration: underline;
}

.subject-page__explore-link {
  margin-top: 1.25rem;
}

.subject-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem;
  margin: 0;
  padding: 0;
  list-style: none;
}

.subject-chips__link {
  display: inline-block;
  padding: 0.45rem 1rem;
  border-radius: 999px;
  background: #fff;
  border: 1px solid rgba(19, 15, 25, 0.12);
  color: #130f19;
  font-weight: 600;
  text-decoration: none;
}

.subject-chips__link:hover,
.subject-chips__link:focus-visible {
  border-color: #f94e10;
  color: #f94e10;
  text-decoration: none;
}

/* /learn hub */
.subject-letters {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  margin: 0 0 1.75rem;
}

.subject-letters a {
  min-width: 2.2rem;
  padding: 0.35rem 0.5rem;
  border-radius: 10px;
  background: #fff3ec;
  text-align: center;
  font-weight: 700;
  color: #d9550f;
  text-decoration: none;
}

.subject-letters a:hover,
.subject-letters a:focus-visible {
  background: #f94e10;
  color: #fff;
  text-decoration: none;
}

.subject-page .subject-letter-heading {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 2.6rem;
  height: 2.6rem;
  margin: 0 0 0.9rem;
  padding: 0;
  border-radius: 12px;
  background: #f94e10;
  font-size: 1.3rem;
  font-weight: 800;
  line-height: 1;
  color: #fff;
}

.subject-list {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 0.35rem 1.25rem;
  margin: 0;
  padding: 0;
  list-style: none;
}

.subject-list a {
  color: #130f19;
  font-weight: 600;
  text-decoration: none;
}

.subject-list a:hover,
.subject-list a:focus-visible {
  color: #f94e10;
  text-decoration: underline;
}

.subject-list span {
  color: #8a8a8a;
  font-size: 0.9rem;
}

.subject-card-teacher .subject-card-teacher__name-link {
  color: inherit;
  text-decoration: none;
}

.subject-card-teacher .subject-card-teacher__name-link:hover,
.subject-card-teacher .subject-card-teacher__name-link:focus-visible {
  color: #f94e10;
  text-decoration: underline;
}

/* Subject hub: popular subject cards (photo banner, see below), A-Z groups as cards */
.subject-hub-popular .content-links__item {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  border-radius: 16px;
}


.subject-hub-all {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 1rem;
}

.subject-hub-all > .help-faq-page__section-title,
.subject-hub-all > .subject-letters {
  grid-column: 1 / -1;
  margin-bottom: 0;
}

.subject-group {
  padding: 1.1rem 1.25rem;
  border-radius: 16px;
  background: #fff;
  border: 1px solid rgba(19, 15, 25, 0.08);
  box-shadow: 0 4px 16px rgba(19, 15, 25, 0.04);
}

.subject-group .subject-list {
  grid-template-columns: 1fr;
}

/* Subject photos (images/subjects/, see docs/seo/subject-images.md) */
.subject-hub-popular .content-links__item {
  overflow: hidden;
}

.subject-hub-popular__photo {
  display: block;
  width: calc(100% + 2.2rem);
  max-width: none;
  height: auto;
  aspect-ratio: 16 / 9;
  margin: -1rem -1.1rem 0.85rem;
  object-fit: cover;
  background: #f3f0ee;
}

.subject-photo-credits,
.subject-photo-credit {
  font-size: 0.78rem;
  line-height: 1.5;
  color: #8a8a8a;
}

.subject-photo-credits {
  max-width: 760px;
  margin: -1.5rem auto 0;
}

.subject-photo-credits a,
.subject-photo-credit a {
  color: inherit;
  text-decoration: underline;
}

.subject-hero {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 440px);
  align-items: center;
  gap: 2rem;
  margin: 0 0 2.5rem;
}

.subject-page .subject-hero .help-faq-page__title,
.subject-page .subject-hero .help-faq-page__intro {
  max-width: none;
  text-align: left;
}

.subject-hero__figure {
  margin: 0;
}

.subject-hero__photo {
  display: block;
  width: 100%;
  height: auto;
  aspect-ratio: 16 / 9;
  object-fit: cover;
  border-radius: 20px;
  box-shadow: 0 10px 30px rgba(19, 15, 25, 0.12);
  background: #f3f0ee;
}

.subject-photo-credit {
  margin-top: 0.4rem;
  text-align: right;
}

@media (max-width: 767px) {
  .subject-hero {
    grid-template-columns: 1fr;
    gap: 1.25rem;
  }

  .subject-hero__figure {
    order: -1;
  }

  .subject-page .subject-hero .help-faq-page__title,
  .subject-page .subject-hero .help-faq-page__intro {
    text-align: center;
  }
}
