/*
 * EGE-School materials listing (design B-blog): category archive and the
 * posts page /materialy/. The hero base (.es-page-hero) is in page.css.
 * Colours only from base.css tokens.
 */

/* ---------- hero ---------- */
.es-blog-hero__head {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  justify-content: space-between;
  gap: var(--es-s-6) var(--es-s-8);
}

.es-blog-hero__text {
  display: flex;
  flex-direction: column;
  gap: 18px;
  min-width: 0;
  max-width: 760px;
}

.es-blog-hero .es-page-hero__title {
  font-size: clamp(32px, 4.8vw, 60px);
  line-height: 1;
}

.es-blog-hero__lead {
  color: var(--es-on-dark);
  font-size: clamp(16px, 1.5vw, 19px);
  line-height: 1.5;
}

.es-blog-hero__lead > * {
  margin: 0;
}

.es-blog-hero__lead > * + * {
  margin-top: 10px;
}

.es-blog-hero__lead a {
  color: var(--es-white);
  text-decoration: underline;
  text-underline-offset: 3px;
}

.es-blog-hero__lead a:hover {
  color: var(--es-acc);
}

.es-blog-hero__stat {
  display: flex;
  flex-direction: column;
  margin: 0;
  padding: 20px 24px;
  border-radius: 24px;
  background: color-mix(in srgb, var(--es-white) 10%, transparent);
  color: var(--es-on-dark);
  font-size: 14px;
}

.es-blog-hero__stat b {
  color: var(--es-white);
  font-family: var(--es-font-display);
  font-size: 28px;
  font-weight: 800;
  line-height: 1.2;
}

.es-blog-tags {
  display: flex;
  flex-wrap: wrap;
  gap: var(--es-s-2);
}

@media (max-width: 640px) {
  .es-blog-hero__stat {
    display: none;
  }

  /* one scrolling row of tags, as in the mobile mockup */
  .es-blog-tags {
    flex-wrap: nowrap;
    margin-inline: calc(-1 * var(--es-gutter));
    padding-inline: var(--es-gutter);
    overflow-x: auto;
    scrollbar-width: none;
  }

  .es-blog-tags::-webkit-scrollbar {
    display: none;
  }

  .es-blog-tags .es-tag--glass {
    height: 36px;
    padding: 0 16px;
  }
}

/* ---------- featured card ---------- */
.es-blog-featured {
  padding-top: clamp(24px, 4vw, 56px);
}

.es-featured {
  display: grid;
  grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr);
  overflow: hidden;
  border-radius: 36px;
  background: var(--es-white);
  color: var(--es-ink);
}

a.es-featured:hover {
  color: var(--es-ink);
}

a.es-featured:hover .es-featured__title {
  color: var(--es-link-h);
}

.es-featured__body {
  display: flex;
  flex-direction: column;
  gap: 18px;
  padding: clamp(24px, 3.2vw, 40px);
}

.es-featured__title {
  font-family: var(--es-font-display);
  font-size: clamp(22px, 2.6vw, 34px);
  font-weight: 800;
  line-height: 1.1;
  letter-spacing: -0.02em;
}

.es-featured__excerpt {
  color: var(--es-muted-2);
  font-size: clamp(15px, 1.3vw, 17px);
  line-height: 1.6;
}

.es-featured .es-post__meta {
  margin-top: 0;
}

.es-featured__more {
  align-self: flex-start;
}

a.es-featured:hover .es-featured__more {
  color: var(--es-acc);
}

.es-featured__media {
  position: relative;
  display: flex;
  align-items: center;
  min-height: 240px;
  background: var(--chip, var(--es-ground));
}

.es-featured__media img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.es-featured__label {
  padding: clamp(24px, 3.2vw, 40px);
  color: var(--es-ink);
  font-family: var(--es-font-display);
  font-size: clamp(22px, 2.4vw, 30px);
  font-weight: 800;
  line-height: 1.15;
}

@media (max-width: 900px) {
  .es-featured {
    grid-template-columns: minmax(0, 1fr);
    border-radius: var(--es-r-lg);
  }

  /* the picture first on phones, as in the mobile mockup */
  .es-featured__media {
    order: -1;
    min-height: 0;
    aspect-ratio: 16 / 9;
  }

  .es-featured__media--plain {
    aspect-ratio: auto;
  }

  .es-featured__label {
    padding: 20px;
    font-size: 18px;
  }
}

/* ---------- grid ---------- */
.es-blog-list,
.es-blog-more {
  display: flex;
  flex-direction: column;
  gap: var(--es-s-6);
  padding-top: clamp(32px, 4vw, 56px);
}

.es-blog-more {
  padding-top: clamp(20px, 3vw, 40px);
}

.es-blog-list__title {
  margin: 0;
  font-family: var(--es-font-display);
  font-size: clamp(24px, 2.8vw, 34px);
  font-weight: 800;
  line-height: 1.05;
  letter-spacing: -0.02em;
}

@media (min-width: 641px) and (max-width: 900px) {
  .es-blog .es-posts {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

/* ---------- subject promo ---------- */
.es-blog-promo {
  padding-top: clamp(20px, 4vw, 56px);
}

.es-blog-promo__box {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: var(--es-s-6) var(--es-s-8);
  padding: clamp(22px, 3.4vw, 44px);
  border-radius: clamp(28px, 3vw, 40px);
  background: var(--es-ink);
  color: var(--es-white);
}

.es-blog-promo__text {
  display: flex;
  flex-direction: column;
  gap: 12px;
  min-width: 0;
  max-width: 620px;
}

.es-blog-promo__kicker {
  align-self: flex-start;
  margin: 0;
  padding: 7px 14px;
  border-radius: var(--es-r-pill);
  background: color-mix(in srgb, var(--es-white) 12%, transparent);
  color: var(--es-acc);
  font-size: 13px;
  font-weight: 700;
  line-height: 1.2;
}

.es-blog-promo__title {
  margin: 0;
  color: var(--es-white);
  font-family: var(--es-font-display);
  font-size: clamp(20px, 2.4vw, 32px);
  font-weight: 800;
  line-height: 1.15;
}

@media (max-width: 640px) {
  .es-blog-promo__box .es-btn {
    width: 100%;
  }
}

/* ---------- pager ---------- */
.es-blog-pager {
  padding-top: var(--es-s-8);
  padding-bottom: clamp(48px, 6vw, 88px);
}

.es-blog-pager .es-pager {
  justify-content: center;
}
