/* ============================================================
   CourseMatch – Index / Home Page Styles
   ============================================================ */

/* ============================================================
   HERO
   ============================================================ */

.hero {
  background: linear-gradient(135deg, #eff6ff 0%, #f5f3ff 60%, #faf5ff 100%);
  border-radius: 20px;
  padding: 5rem 2rem 4.5rem;
  margin-bottom: 4rem;
  text-align: center;
  position: relative;
  overflow: hidden;
}

/* subtle decorative blobs */
.hero::before,
.hero::after {
  content: '';
  position: absolute;
  border-radius: 50%;
  pointer-events: none;
  opacity: .35;
  filter: blur(60px);
}
.hero::before {
  width: 400px; height: 400px;
  background: #bfdbfe;
  top: -120px; left: -100px;
}
.hero::after {
  width: 320px; height: 320px;
  background: #ddd6fe;
  bottom: -100px; right: -80px;
}

.hero-inner {
  position: relative;
  z-index: 1;
  max-width: 680px;
  margin-inline: auto;
}

.hero-eyebrow {
  display: inline-block;
  font-size: .75rem;
  font-weight: 700;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: var(--primary);
  background: var(--primary-light);
  padding: .3rem .85rem;
  border-radius: var(--radius-pill);
  margin-bottom: 1.25rem;
}

.hero-title {
  font-size: clamp(2rem, 5vw, 3.25rem);
  font-weight: 800;
  line-height: 1.15;
  letter-spacing: -0.5px;
  color: var(--text-1);
  margin-bottom: 1.25rem;
}

.hero-highlight {
  background: linear-gradient(130deg, var(--primary), var(--accent));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.hero-sub {
  font-size: 1.0625rem;
  color: var(--text-2);
  line-height: 1.75;
  margin-bottom: 2rem;
  max-width: 520px;
  margin-inline: auto;
}

.hero-actions {
  display: flex;
  gap: .875rem;
  justify-content: center;
  flex-wrap: wrap;
}

/* ============================================================
   SHARED BUTTONS  (used in hero + section CTA)
   ============================================================ */

.btn {
  display: inline-flex;
  align-items: center;
  gap: .5rem;
  font-size: .9375rem;
  font-weight: 600;
  padding: .65rem 1.5rem;
  border-radius: var(--radius-pill);
  cursor: pointer;
  transition: transform .18s ease, box-shadow .18s ease, background .18s ease, color .18s ease;
  text-decoration: none;
}

.btn-primary {
  background: linear-gradient(130deg, var(--primary), var(--accent));
  color: #fff;
  box-shadow: 0 4px 14px rgb(37 99 235 / .3);
}

.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgb(37 99 235 / .4);
  color: #fff;
}

.btn-outline {
  background: transparent;
  color: var(--primary);
  border: 2px solid var(--primary);
}

.btn-outline:hover {
  background: var(--primary);
  color: #fff;
  transform: translateY(-2px);
}

.btn-large { padding: .8rem 2rem; font-size: 1rem; }

/* ============================================================
   SECTION HEADER
   ============================================================ */

.section-header {
  text-align: center;
  margin-bottom: 2.5rem;
}

.section-title {
  font-size: clamp(1.5rem, 3vw, 2rem);
  font-weight: 800;
  color: var(--text-1);
  letter-spacing: -.3px;
  margin-bottom: .5rem;
}

.section-description {
  font-size: .9375rem;
  color: var(--text-3);
  max-width: 480px;
  margin-inline: auto;
  line-height: 1.7;
}

/* ============================================================
   OPPORTUNITIES GRID
   ============================================================ */

.opportunities-section {
  margin-bottom: 3rem;
}

.opportunities-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1.5rem;
  margin-bottom: 2.5rem;
}

/* ad row spans full width */
.grid-ad {
  grid-column: 1 / -1;
  min-height: 90px;
  background: #f9f9f9;
  border-radius: var(--radius-md);
  text-align: center;
  padding: 1rem;
}

/* ============================================================
   CARD
   ============================================================ */

.opportunity-card {
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  transition: transform .22s ease, box-shadow .22s ease, border-color .22s ease;
  /* scroll-in animation initial state */
  opacity: 0;
  transform: translateY(24px);
}

.opportunity-card.in-view {
  opacity: 1;
  transform: translateY(0);
  transition: opacity .45s ease, transform .45s ease, box-shadow .22s ease, border-color .22s ease;
}

.opportunity-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-md);
  border-color: #c7d7fe;
}

/* --- Card Image --- */
.card-image-link {
  position: relative;
  display: block;
  overflow: hidden;
  aspect-ratio: 16 / 9;
  background: var(--bg);
  flex-shrink: 0;
}

.card-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform .4s ease;
}

.opportunity-card:hover .card-img { transform: scale(1.04); }

.card-img-placeholder {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 2.5rem;
  font-weight: 800;
  color: var(--primary);
  background: linear-gradient(135deg, #dbeafe, #ede9fe);
}

.card-badge {
  position: absolute;
  top: .65rem;
  left: .65rem;
  background: var(--primary);
  color: #fff;
  font-size: .7rem;
  font-weight: 700;
  letter-spacing: .04em;
  text-transform: uppercase;
  padding: .25rem .6rem;
  border-radius: var(--radius-pill);
  pointer-events: none;
}

/* --- Card Body --- */
.card-body {
  padding: 1.25rem;
  display: flex;
  flex-direction: column;
  flex: 1;
  gap: .6rem;
}

.card-meta {
  display: flex;
  align-items: center;
  gap: .875rem;
  font-size: .78rem;
  color: var(--text-3);
}

.meta-date,
.meta-views {
  display: flex;
  align-items: center;
  gap: .3rem;
}

.card-title {
  font-size: 1rem;
  font-weight: 700;
  line-height: 1.4;
  color: var(--text-1);
}

.card-title a {
  color: inherit;
  text-decoration: none;
  transition: color var(--ease);
}

.card-title a:hover { color: var(--primary); }

.card-excerpt {
  font-size: .875rem;
  color: var(--text-2);
  line-height: 1.65;
  flex: 1;
}

.card-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: .5rem;
  padding-top: .75rem;
  border-top: 1px solid var(--border);
  margin-top: auto;
  flex-wrap: wrap;
}

.card-author {
  display: flex;
  align-items: center;
  gap: .35rem;
  font-size: .8rem;
  color: var(--text-3);
  text-decoration: none;
  transition: color var(--ease);
}

.card-author:hover { color: var(--primary); }
.card-author i { font-size: .95rem; }

.card-read-more {
  display: flex;
  align-items: center;
  gap: .3rem;
  font-size: .8rem;
  font-weight: 600;
  color: var(--primary);
  text-decoration: none;
  transition: gap var(--ease);
}

.card-read-more:hover { gap: .55rem; }
.card-read-more i { font-size: .7rem; }

/* ============================================================
   PAGINATION
   ============================================================ */

.pagination {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: .5rem;
  margin: 2.5rem 0 1rem;
  flex-wrap: wrap;
}

.page-numbers {
  display: flex;
  align-items: center;
  gap: .375rem;
  flex-wrap: wrap;
}

.page-num,
.page-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 40px;
  height: 40px;
  padding: 0 .75rem;
  border-radius: var(--radius-sm);
  font-size: .875rem;
  font-weight: 500;
  color: var(--text-2);
  border: 1px solid var(--border);
  background: var(--white);
  text-decoration: none;
  transition: background var(--ease), color var(--ease), border-color var(--ease), transform .15s ease;
  cursor: pointer;
}

.page-num:hover,
.page-btn:hover:not(.disabled) {
  background: var(--primary-light);
  color: var(--primary);
  border-color: #93c5fd;
  transform: translateY(-1px);
}

.page-num.active {
  background: var(--primary);
  color: #fff;
  border-color: var(--primary);
  font-weight: 700;
  box-shadow: 0 2px 8px rgb(37 99 235 / .3);
  pointer-events: none;
}

.page-btn.disabled {
  opacity: .38;
  cursor: not-allowed;
  pointer-events: none;
}

.page-ellipsis {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 30px;
  height: 40px;
  color: var(--text-3);
  font-size: .875rem;
}

/* ============================================================
   SECTION CTA
   ============================================================ */

.section-cta {
  text-align: center;
  margin-top: 2rem;
}

/* ============================================================
   EMPTY STATE
   ============================================================ */

.empty-state {
  text-align: center;
  padding: 4rem 2rem;
  color: var(--text-3);
}

.empty-icon {
  font-size: 3.5rem;
  margin-bottom: 1rem;
}

.empty-state h3 {
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--text-1);
  margin-bottom: .5rem;
}

.empty-state p { font-size: .9375rem; }

/* ============================================================
   RESPONSIVE
   ============================================================ */

@media (max-width: 900px) {
  .opportunities-grid { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 600px) {
  .hero {
    padding: 3.5rem 1.25rem 3rem;
    border-radius: var(--radius-lg);
    margin-bottom: 2.5rem;
  }

  .opportunities-grid { grid-template-columns: 1fr; }

  .card-footer { flex-direction: column; align-items: flex-start; }

  .pagination { gap: .375rem; }
  .page-num, .page-btn { min-width: 36px; height: 36px; font-size: .8125rem; }
}
