/* helpers/home.css */
.contents-page .grade-badge {
  font-size: 0.9rem;
  background: #f8f9fa;
  border: 1px solid #e9ecef;
  padding: 0.25rem 0.5rem;
  border-radius: 0.5rem;
  color: #495057;
}
.contents-page .subj-heading {
  font-size: 1.1rem;
  font-weight: 700;
}
.contents-page .vocab-item small {
  color: #6c757d;
}
.contents-page .sticky-tools {
  position: sticky;
  top: 64px;
  z-index: 3;
  background: #fff;
  border-bottom: 1px solid #eee;
  padding: 0.5rem 0;
}
.contents-page .search-input {
  max-width: 420px;
}
.subj-icon {
  width: 1.2rem;
  height: 1.2rem;
  display: inline-block;
}

.subject-card {
  border: 1px solid #e9ecef;
  border-radius: 0.5rem;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.03);
}
.subject-card .card-header {
  background: #f8f9fa;
  border-bottom: 1px solid #e9ecef;
  font-weight: 700;
}
.vocab-link {
  text-decoration: none;
}
.vocab-col {
  min-height: 1rem;
}

.subject-card .accordion-body {
  max-height: 320px;
  overflow: auto;
  overscroll-behavior: contain;
  padding-top: 0.25rem;
  padding-bottom: 0.25rem;
}
.subject-card .accordion-button {
  padding: 0.5rem 0.75rem;
  font-size: 0.975rem;
}
.subject-card .accordion-button::after {
  transform: scale(0.9);
}
.subject-card .list-group-item {
  padding-top: 0.4rem;
  padding-bottom: 0.4rem;
}
.subject-card .vocab-col .vocab-link {
  display: inline-block;
  max-width: 100%;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  vertical-align: bottom;
}
.subject-card .card-body {
  padding: 0.75rem 0.75rem;
}

.subject-card .accordion-body::-webkit-scrollbar {
  width: 8px;
}
.subject-card .accordion-body::-webkit-scrollbar-thumb {
  background-color: rgba(0, 0, 0, 0.15);
  border-radius: 8px;
}
.subject-card .accordion-body::-webkit-scrollbar-track {
  background: transparent;
}

@media (prefers-reduced-motion: reduce) {
  .accordion .collapse {
    transition: none !important;
  }
}

/* === Updates banner === */
.updates-banner {
  width: 100%;
  background: rgb(225 242 255);
  border-bottom: 1px solid rgba(15, 28, 46, 0.08);
  height: 180px;
  padding: 6px 0;
  display: flex;
  justify-content: center;
  align-items: center;
}
.updates-banner .carousel {
  max-width: 1400px;
  height: 180px;
  padding: 6px 0;
  display: flex;
  justify-content: center;
  align-items: center;
}
.updates-row {
  display: flex;
  align-items: center;
  gap: 20px;
  text-decoration: none;
  padding: 6px 0;
  color: inherit;
  transition: background 0.2s ease-in-out;
}
.updates-row:hover {
  background: rgba(27, 117, 188, 0.06);
}
.updates-thumb {
  flex: 0 0 150px;
  height: 150px;
  border-radius: 10px;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
}
.updates-thumb img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}
.updates-info {
  min-width: 0;
  flex: 1;
}
.updates-meta {
  display: flex;
  align-items: center;
  gap: 10px;
  color: #5b6b83;
  font-size: 1rem;
  margin-bottom: 2px;
}
.updates-chip {
  padding: 4px 10px;
  border-radius: 999px;
  background: #e9f1ff;
  color: #27457e;
  font-weight: 600;
  font-size: 0.9rem;
}
.updates-title-row {
  display: flex;
  align-items: center;
  gap: 16px;
}
.updates-title {
  font-weight: 700;
  color: #0f1c2e;
  font-size: 1.5rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  flex: 1;
}
.updates-cta {
  margin-left: 12px;
  font-weight: 700;
  color: #1b75bc;
  font-size: 1rem;
}
#updatesBanner .carousel-control-prev,
#updatesBanner .carousel-control-next {
  width: 40px;
  height: 40px;
  top: 50%;
  transform: translateY(-50%);
  background: rgba(255, 255, 255, 0.9);
  border-radius: 50%;
  box-shadow: 0 4px 8px rgba(15, 28, 46, 0.15);
}
#updatesBanner .carousel-control-prev {
  left: -50px;
}
#updatesBanner .carousel-control-next {
  right: -50px;
}
#updatesBanner .carousel-control-prev-icon,
#updatesBanner .carousel-control-next-icon {
  filter: invert(1) grayscale(1);
}

/* Reading passage badge */
.rp-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  margin-left: 0.4rem;
  font-size: 0.72rem;
  line-height: 1;
  padding: 0.15rem 0.35rem;
  border-radius: 0.35rem;
  background: #e9f1ff;
  color: #27457e;
  border: 1px solid #cfe0ff;
  vertical-align: middle;
}
.rp-badge .rp-text {
  font-weight: 600;
}

/* Subject toggle header */
.subject-toggle {
  background: #f8f9fa;
  border: 0;
  width: 100%;
  text-align: left;
  font-weight: 700;
  font-size: 1rem;
}
.subject-toggle:focus {
  outline: none;
}
.subject-toggle .chev {
  transition: transform 0.2s ease;
}
.subject-toggle[aria-expanded="true"] .chev {
  transform: rotate(180deg);
}

/* Responsive tweaks */
@media (max-width: 575.98px) {
  .subject-card .card-body {
    padding: 0.5rem 0.5rem;
  }
  .subject-card .accordion-button {
    padding: 0.5rem 0.6rem;
    font-size: 0.95rem;
  }
  .subject-card .list-group-item {
    padding-top: 0.35rem;
    padding-bottom: 0.35rem;
  }
  .subject-card .accordion-body {
    max-height: 60vh;
  }
  .grade-badge {
    font-size: 0.85rem;
  }
  .vocab-col .vocab-link {
    max-width: 100%;
  }
}
@media (min-width: 576px) and (max-width: 991.98px) {
  .subject-card .accordion-body {
    max-height: 420px;
  }
}
/* Blur the main page while modal is up */
.blurred {
  filter: blur(3px);
  pointer-events: none;
  user-select: none;
}
