/**
 * Study Material Library — purple shell + category cards.
 */

.homepage-study-library {
  padding: 14px 0 6px;
  background: #eef2f7;
}

.homepage-study-library__shell {
  margin: 0 14px;
  padding: 18px 14px 16px;
  border-radius: 22px;
  background: linear-gradient(165deg, #5a48d1 0%, #4c3bb8 38%, #3d2ea5 100%);
  box-shadow: 0 10px 28px rgba(15, 23, 42, 0.14);
}

.homepage-study-library__head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 14px;
}

.homepage-study-library__head-main {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  min-width: 0;
}

.homepage-study-library__head-icon {
  position: relative;
  flex-shrink: 0;
  width: 44px;
  height: 44px;
  display: grid;
  place-items: center;
  color: #fff;
  font-size: 1.35rem;
}

.homepage-study-library__spark {
  position: absolute;
  width: 7px;
  height: 7px;
  border-radius: 999px;
  background: #fde047;
  box-shadow: 0 0 0 2px rgba(253, 224, 71, 0.35);
}

.homepage-study-library__spark--a {
  top: 2px;
  right: 0;
}

.homepage-study-library__spark--b {
  bottom: 6px;
  left: -2px;
  width: 5px;
  height: 5px;
}

.homepage-study-library__title {
  margin: 0;
  font-family: 'Inter', sans-serif;
  font-size: clamp(1.35rem, 4.2vw, 1.65rem);
  font-weight: 800;
  line-height: 1.15;
  letter-spacing: -0.03em;
  color: #fff;
}

.homepage-study-library__title-accent {
  color: #fde047;
}

.homepage-study-library__nav {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 4px 6px;
  margin-top: 6px;
  font-family: 'Inter', sans-serif;
  font-size: 0.6875rem;
  font-weight: 500;
  line-height: 1.35;
}

.homepage-study-library__nav a {
  color: rgba(255, 255, 255, 0.95);
  text-decoration: none;
}

.homepage-study-library__nav a:hover {
  text-decoration: underline;
  text-underline-offset: 2px;
}

.homepage-study-library__nav-dot {
  color: rgba(255, 255, 255, 0.55);
  user-select: none;
}

.homepage-study-library__see-all {
  flex-shrink: 0;
  align-self: flex-start;
  padding-top: 4px;
  font-family: 'Inter', sans-serif;
  font-size: 0.8125rem;
  font-weight: 600;
  color: #fff;
  text-decoration: underline;
  text-underline-offset: 3px;
  white-space: nowrap;
}

.homepage-study-library__see-all i {
  font-size: 0.72rem;
  margin-left: 2px;
}

.homepage-study-library__grid {
  display: flex;
  flex-wrap: nowrap;
  align-items: stretch;
  justify-content: flex-start;
  gap: 10px;
  overflow-x: auto;
  overflow-y: hidden;
  scroll-snap-type: x proximity;
  scroll-padding-inline: 0;
  margin: 0;
  padding: 0 0 4px;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
}

.homepage-study-library__grid::-webkit-scrollbar {
  display: none;
}

.homepage-study-library-card {
  flex: 0 0 min(72vw, 300px);
  width: min(72vw, 300px);
  max-width: 300px;
  scroll-snap-align: start;
  display: flex;
  flex-direction: column;
  background: #fff;
  border-radius: 20px;
  overflow: hidden;
  text-decoration: none;
  color: inherit;
  box-shadow: 0 8px 22px rgba(15, 23, 42, 0.12);
  min-height: 100%;
}

.homepage-study-library-card__media {
  position: relative;
  aspect-ratio: 16 / 10;
  overflow: hidden;
}

.homepage-study-library-card__media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.homepage-study-library-card__badge {
  position: absolute;
  top: 10px;
  left: 8px;
  z-index: 2;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  max-width: calc(100% - 16px);
  padding: 5px 8px;
  border-radius: 10px;
  font-family: 'Inter', sans-serif;
  font-size: 0.5625rem;
  font-weight: 700;
  line-height: 1.2;
  color: #fff;
  box-shadow: 0 4px 12px rgba(15, 23, 42, 0.2);
}

.homepage-study-library-card__badge i {
  flex-shrink: 0;
  font-size: 0.625rem;
}

.homepage-study-library-card__badge span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.homepage-study-library-card__badge--orange {
  background: linear-gradient(135deg, #ea580c, #f97316);
}

.homepage-study-library-card__badge--green {
  background: linear-gradient(135deg, #15803d, #22c55e);
}

.homepage-study-library-card__badge--blue {
  background: linear-gradient(135deg, #2563eb, #0ea5e9);
}

.homepage-study-library-card__badge--purple {
  background: linear-gradient(135deg, #6d28d9, #7c3aed);
}

.homepage-study-library-card__badge--red {
  background: linear-gradient(135deg, #dc2626, #ef4444);
}

.homepage-study-library-card__badge--indigo {
  background: linear-gradient(135deg, #4338ca, #6366f1);
}

.homepage-study-library-card__body {
  padding: 12px 12px 11px;
  display: flex;
  flex-direction: column;
  gap: 4px;
  flex: 1;
}

.homepage-study-library-card__title {
  margin: 0;
  font-family: 'Inter', sans-serif;
  font-size: 0.875rem;
  font-weight: 800;
  line-height: 1.25;
  color: #0d1b3e;
}

.homepage-study-library-card__subtitle {
  margin: 0;
  font-family: 'Inter', sans-serif;
  font-size: 0.625rem;
  line-height: 1.35;
  color: #667085;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

@media (max-width: 991.98px) {
  .homepage-study-library {
    padding: 0 0 36px;
  }

  .homepage-study-library__shell {
    margin: 0 10px;
    padding: 18px 14px 17px;
    border-radius: 16px;
    overflow: hidden;
  }

  .homepage-study-library__head {
    margin-bottom: 14px;
  }

  .homepage-study-library__title {
    font-size: 1rem;
    line-height: 1.12;
  }

  .homepage-study-library__nav {
    font-size: 0.625rem;
    margin-top: 4px;
  }

  .homepage-study-library__see-all {
    font-size: 0.625rem;
    padding-top: 0;
  }

  .homepage-study-library-card {
    border-radius: 12px;
    box-shadow: 0 2px 6px rgba(15, 23, 42, 0.08);
  }

  .homepage-study-library-card__body {
    padding: 7px 7px 8px;
  }

  .homepage-study-library-card__title {
    font-size: 0.71875rem;
    line-height: 1.2;
  }

  .homepage-study-library-card__subtitle {
    font-size: 0.59375rem;
    line-height: 1.25;
    -webkit-line-clamp: 2;
  }

  .homepage-study-library-card__badge {
    top: 6px;
    left: 6px;
    padding: 3px 6px;
    font-size: 0.5rem;
    border-radius: 8px;
  }
}

@media (min-width: 1200px) {
  .homepage-study-library__shell {
    margin-left: 48px;
    margin-right: 48px;
  }
}

@media (max-width: 575.98px) {
  .homepage-study-library-card__badge span {
    white-space: normal;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
  }
}
