/* Resources Page - Card Grid (Horizontal Carousel) */
.resource-grid {
  display: flex;
  gap: 1.5rem;
  max-width: 1600px;
  margin: 0 auto;
  overflow-x: auto;
  scroll-behavior: smooth;
  scrollbar-width: none;
  -ms-overflow-style: none;
  padding: 1rem 0.5rem 1rem;
  position: relative;
}

.resource-grid::-webkit-scrollbar {
  display: none;
}

.resource-card {
  background: #fff;
  border-radius: 25px;
  border: 1px solid #c3c3c3;
  box-shadow: 0px 8px 15px rgb(0 0 0 / 18%);
  overflow: hidden;
  transition: transform 0.3s ease, box-shadow 0.3s ease;
  display: flex;
  flex-direction: column;
  text-decoration: none;
  color: inherit;
  min-width: 280px;
  max-width: 280px;
  flex-shrink: 0;
}

.resource-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 12px 24px rgb(0 0 0 / 22%);
}

.resource-card-image {
  height: 120px;
  background: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.5rem 2rem;
  border-bottom: 1px solid #e0e0e0;
}

.resource-card-image img {
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
}

.resource-card-body {
  padding: 1.25rem 1.5rem;
  flex: 1;
  display: flex;
  flex-direction: column;
}

.resource-card-body h3 {
  font-size: 1.15rem;
  margin: 0 0 0.5rem;
  color: #1c375b;
}

.resource-card-body p {
  font-size: 0.95rem;
  color: #444;
  line-height: 1.5;
  margin: 0 0 0.75rem;
  flex: 1;
}

/* Resource Card Badges */
.resource-card-badge {
  display: inline-block;
  font-size: 0.8rem;
  font-weight: 600;
  padding: 0.2rem 0.6rem;
  border-radius: 6px;
  width: fit-content;
}

.resource-card-badge.badge-blue {
  background-color: #e0edff;
  color: #1c375b;
}

.resource-card-badge.badge-green {
  background-color: #dcfce7;
  color: #166534;
}

.resource-card-badge.badge-purple {
  background-color: #f3e8ff;
  color: #6b21a8;
}

.resource-card-badge.badge-gold {
  background-color: #fef9c3;
  color: #854d0e;
}

.resource-card-badge.badge-red {
  background-color: #ffe4e1;
  color: #991b1b;
}

/* ── Resource Section Bands ── */
/* Each section wraps title + grid in a full-bleed colored band */
.resource-section {
  position: relative;
  margin-left: -1rem;
  margin-right: -1rem;
  padding: 2.5rem 2.5rem 2rem;
}

/* Alternating section backgrounds */
.resource-section.section-ebooks-digital-media {
  background-color: #ffffff;
}

.resource-section.section-research {
  background-color: #ececec;
}

.resource-section.section-local {
  background-color: #ffffff;
}

.resource-section.section-kids {
  background-color: #ececec;
}

/* Section Titles */
.resource-section-title {
  max-width: 1600px;
  margin: 0 auto 0;
}

.resource-section-title h2 {
  font-size: 1.5rem;
  color: #222;
  margin: 0;
}

.resource-section-title i {
  font-size: 1.5rem;
  color: #222;
}

.resource-section-divider {
  max-width: 1600px;
  margin: 0.5rem auto 1.25rem;
  border: none;
  border-top: 2px solid rgb(0 0 0 / 10%);
}

/* Override grid bottom margin inside sections */
.resource-section .resource-grid {
  margin-bottom: 0;
}

/* Carousel wrapper */
.resource-carousel {
  position: relative;
  max-width: 1600px;
  margin: 0 auto;
}

.resource-carousel::after {
  content: "";
  position: absolute;
  top: 0;
  right: 0;
  width: 40px;
  height: 100%;
  pointer-events: none;
  z-index: 5;
  background: linear-gradient(to left, var(--section-bg, #ffffff), transparent);
  opacity: 0.7;
  transition: opacity 0.3s ease;
}

.resource-carousel.scrolled-end::after {
  opacity: 0;
}

.resource-carousel-btn {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  z-index: 10;
  background: rgba(255, 255, 255, 0.95);
  border: 1px solid #ddd;
  border-radius: 50%;
  width: 48px;
  height: 48px;
  font-size: 1.8rem;
  line-height: 1;
  color: #333;
  cursor: pointer;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
  transition: opacity 0.2s ease, background 0.2s ease, box-shadow 0.2s ease;
  display: flex;
  align-items: center;
  justify-content: center;
}

.resource-carousel-btn:hover {
  background: #fff;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.25);
}

.resource-carousel-btn.hidden {
  opacity: 0;
  pointer-events: none;
}

.resource-carousel-prev {
  left: -24px;
}

.resource-carousel-next {
  right: -24px;
}

@media (max-width: 768px) {
  .resource-carousel-btn {
    width: 42px;
    height: 42px;
    font-size: 1.6rem;
  }

  .resource-carousel-prev {
    left: 8px;
  }

  .resource-carousel-next {
    right: 8px;
  }
}

@media (max-width: 768px) {
  .resource-section {
    padding: 2rem 1rem 1.5rem;
  }
}
