/* Programs page only */
.programs-page {
  overflow: hidden;
}

.programs-hero {
  min-height: 640px;
}

.programs-hero-grid {
  display: grid;
  align-items: center;
  gap: 3rem;
}

@media (min-width: 1024px) {
  .programs-hero-grid {
    grid-template-columns: minmax(0, 1.08fr) minmax(340px, 0.92fr);
  }
}

.programs-hero-copy h1 {
  max-width: 830px;
  font-size: clamp(2.7rem, 6vw, 5.6rem);
  font-weight: 950;
  line-height: 0.96;
  letter-spacing: -0.06em;
}

.programs-hero-copy > p:not(.section-eyebrow) {
  margin-top: 1.5rem;
  max-width: 720px;
  color: rgba(239, 246, 255, 0.88);
  font-size: 1.08rem;
  line-height: 1.9;
}

.programs-hero-actions,
.program-page-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.9rem;
}

.programs-hero-actions {
  margin-top: 2rem;
}

.hero-primary,
.hero-secondary,
.apply-pill,
.primary-action,
.secondary-action {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 3rem;
  border-radius: 999px;
  font-weight: 900;
  transition: transform 0.28s ease, box-shadow 0.28s ease, background 0.28s ease, border-color 0.28s ease;
}

.hero-primary,
.apply-pill,
.primary-action {
  color: #fff;
  background: linear-gradient(135deg, var(--blue), var(--blue-hover));
  box-shadow: 0 18px 42px rgba(37, 137, 245, 0.32);
}

.hero-primary,
.hero-secondary {
  padding: 1rem 1.65rem;
}

.hero-secondary {
  color: #fff;
  border: 1px solid rgba(255, 255, 255, 0.25);
  background: rgba(255, 255, 255, 0.1);
  backdrop-filter: blur(14px);
}

.hero-primary:hover,
.hero-secondary:hover,
.apply-pill:hover,
.primary-action:hover,
.secondary-action:hover {
  transform: translateY(-3px);
}

.programs-hero-panel {
  position: relative;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: 2rem;
  padding: clamp(1.4rem, 4vw, 2.3rem);
  background: linear-gradient(145deg, rgba(255, 255, 255, 0.15), rgba(255, 255, 255, 0.06));
  box-shadow: 0 30px 90px rgba(0, 0, 0, 0.22);
  backdrop-filter: blur(20px);
}

.programs-hero-panel::before {
  content: "";
  position: absolute;
  inset: -45% auto auto -30%;
  width: 280px;
  height: 280px;
  border-radius: 999px;
  background: rgba(37, 137, 245, 0.28);
  filter: blur(20px);
}

.panel-icon {
  position: relative;
  display: grid;
  width: 4.8rem;
  height: 4.8rem;
  place-items: center;
  border-radius: 1.5rem;
  color: #fff;
  font-size: 1.8rem;
  background: linear-gradient(135deg, var(--blue), #67e8f9);
  box-shadow: 0 20px 46px rgba(37, 137, 245, 0.34);
}

.programs-hero-panel h2 {
  position: relative;
  margin-top: 1.5rem;
  font-size: clamp(1.7rem, 3vw, 2.35rem);
  font-weight: 950;
  letter-spacing: -0.04em;
}

.programs-hero-panel p {
  position: relative;
  margin-top: 0.9rem;
  color: rgba(226, 232, 240, 0.82);
  line-height: 1.8;
}

.panel-stat-row {
  position: relative;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.8rem;
  margin-top: 1.5rem;
}

.panel-stat-row span {
  border-radius: 1.15rem;
  padding: 1rem;
  color: rgba(239, 246, 255, 0.8);
  background: rgba(255, 255, 255, 0.1);
}

.panel-stat-row strong {
  display: block;
  color: #fff;
  font-size: 1.15rem;
}

.programs-section-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 1.5rem;
}

.programs-section-subtitle {
  margin-top: 1rem;
  max-width: 650px;
  color: var(--muted);
  line-height: 1.8;
}

.apply-pill {
  flex: 0 0 auto;
  padding: 0.9rem 1.4rem;
}

.program-toolbar {
  display: grid;
  gap: 1rem;
  margin-top: 2.2rem;
  border: 1px solid rgba(229, 231, 235, 0.9);
  border-radius: 1.7rem;
  padding: 1rem;
  background: rgba(248, 250, 252, 0.92);
  box-shadow: 0 20px 60px rgba(17, 24, 47, 0.07);
}

.program-search {
  display: flex;
  align-items: center;
  gap: 0.85rem;
  min-height: 3.55rem;
  border: 1px solid rgba(37, 137, 245, 0.18);
  border-radius: 1.25rem;
  padding: 0 1rem;
  background: #fff;
  transition: border-color 0.25s ease, box-shadow 0.25s ease, transform 0.25s ease;
}

.program-search:focus-within {
  border-color: rgba(37, 137, 245, 0.55);
  box-shadow: 0 0 0 5px rgba(37, 137, 245, 0.11);
  transform: translateY(-1px);
}

.program-search i {
  color: var(--blue);
}

.program-search input {
  width: 100%;
  border: 0;
  outline: 0;
  color: var(--dark);
  background: transparent;
  font-weight: 700;
}

.program-filter-bar {
  margin-top: 0 !important;
  padding: 0 !important;
  border: 0 !important;
  background: transparent !important;
  box-shadow: none !important;
}

.program-filter-btn {
  min-height: 2.85rem;
}

.program-results-grid {
  display: grid;
  grid-template-columns: repeat(1, minmax(0, 1fr));
  gap: 1.35rem;
  margin-top: 2rem;
  align-items: stretch;
}

@media (min-width: 768px) {
  .program-results-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (min-width: 1180px) {
  .program-results-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

.program-page-card {
  display: flex;
  min-height: 100%;
  overflow: hidden;
  flex-direction: column;
  border: 1px solid rgba(229, 231, 235, 0.95);
  border-radius: 1.8rem;
  background: #fff;
  box-shadow: 0 20px 54px rgba(17, 24, 47, 0.08);
  transition: opacity 0.32s ease, transform 0.32s ease, box-shadow 0.32s ease, border-color 0.32s ease;
}

.program-page-card:hover {
  border-color: rgba(37, 137, 245, 0.42);
  box-shadow: 0 30px 80px rgba(37, 137, 245, 0.16);
  transform: translateY(-8px);
}

.program-page-card.is-hidden {
  display: none;
}

.program-page-card.is-filtering {
  opacity: 0.15;
  transform: scale(0.98);
}

.program-page-media {
  position: relative;
  min-height: 220px;
  overflow: hidden;
}

.program-page-media img {
  width: 100%;
  height: 100%;
  min-height: 220px;
  object-fit: cover;
  transition: transform 0.6s ease, filter 0.4s ease;
}

.program-page-card:hover .program-page-media img {
  transform: scale(1.08);
  filter: saturate(1.12) contrast(1.04);
}

.program-page-badge {
  position: absolute;
  left: 1rem;
  bottom: 1rem;
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  border-radius: 999px;
  padding: 0.65rem 0.9rem;
  color: #fff;
  font-size: 0.82rem;
  font-weight: 900;
  background: rgba(17, 24, 47, 0.72);
  backdrop-filter: blur(12px);
}

.program-page-body {
  display: flex;
  flex: 1;
  flex-direction: column;
  padding: 1.35rem;
}

.program-page-body h3 {
  color: var(--dark);
  font-size: 1.3rem;
  font-weight: 950;
  letter-spacing: -0.03em;
}

.program-page-body p {
  margin-top: 0.75rem;
  color: var(--muted);
  line-height: 1.75;
}

.program-page-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  margin-top: 1.15rem;
}

.program-page-meta span {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  border-radius: 999px;
  padding: 0.55rem 0.75rem;
  color: #1f3a5f;
  font-size: 0.82rem;
  font-weight: 800;
  background: rgba(37, 137, 245, 0.08);
}

.program-page-actions {
  margin-top: auto;
  padding-top: 1.4rem;
}

.primary-action,
.secondary-action {
  min-width: 105px;
  padding: 0.78rem 1.1rem;
  font-size: 0.9rem;
}

.secondary-action {
  color: var(--blue);
  border: 1px solid rgba(37, 137, 245, 0.22);
  background: #fff;
}

.program-empty-state {
  margin-top: 2rem;
  border: 1px dashed rgba(37, 137, 245, 0.35);
  border-radius: 1.5rem;
  padding: 2.5rem 1.5rem;
  text-align: center;
  background: rgba(37, 137, 245, 0.05);
}

.program-empty-state i {
  color: var(--blue);
  font-size: 2.3rem;
}

.program-empty-state h3 {
  margin-top: 1rem;
  color: var(--dark);
  font-size: 1.25rem;
  font-weight: 950;
}

.program-empty-state p {
  margin-top: 0.4rem;
  color: var(--muted);
}

html[data-theme="dark"] .programs-explorer {
  background: #0d1326 !important;
}

html[data-theme="dark"] .program-toolbar,
html[data-theme="dark"] .program-search,
html[data-theme="dark"] .program-page-card,
html[data-theme="dark"] .program-empty-state {
  border-color: rgba(103, 232, 249, 0.16);
  background: rgba(17, 24, 47, 0.82);
}

html[data-theme="dark"] .program-search input,
html[data-theme="dark"] .program-page-body h3,
html[data-theme="dark"] .program-empty-state h3 {
  color: #f8fafc;
}

html[data-theme="dark"] .programs-section-subtitle,
html[data-theme="dark"] .program-page-body p,
html[data-theme="dark"] .program-empty-state p {
  color: rgba(226, 232, 240, 0.76);
}

html[data-theme="dark"] .program-page-meta span {
  color: rgba(239, 246, 255, 0.84);
  background: rgba(37, 137, 245, 0.16);
}

html[data-theme="dark"] .secondary-action {
  color: #93c5fd;
  border-color: rgba(147, 197, 253, 0.25);
  background: rgba(255, 255, 255, 0.06);
}

@media (max-width: 767px) {
  .programs-section-head {
    align-items: flex-start;
    flex-direction: column;
  }
  .apply-pill,
  .hero-primary,
  .hero-secondary {
    width: 100%;
  }
  .programs-hero-actions,
  .program-page-actions {
    width: 100%;
  }
  .primary-action,
  .secondary-action {
    flex: 1;
  }
}

/* Final card alignment pass: uniform image/card sizing like the reference card */
.program-results-grid {
  grid-auto-rows: 1fr;
}

.program-page-card {
  min-height: 100%;
  border-radius: 2rem;
}

.program-page-media {
  height: 280px;
  min-height: 280px;
  flex: 0 0 280px;
  background: #0f172a;
}

.program-page-media::after {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background: linear-gradient(180deg, rgba(15,23,42,.06), rgba(15,23,42,.38));
}

.program-page-media img {
  position: absolute;
  inset: 0;
  display: block;
  width: 100%;
  height: 100%;
  min-height: 0;
  object-fit: cover;
  object-position: center;
}

.program-page-badge {
  top: 1.1rem;
  bottom: auto;
  z-index: 2;
  border: 1px solid rgba(255,255,255,.18);
  background: rgba(15, 23, 42, 0.58);
  box-shadow: 0 14px 34px rgba(0,0,0,.18);
}

.program-page-body {
  min-height: 310px;
  padding: 1.5rem;
}

.program-page-body h3 {
  min-height: 3.1rem;
  display: flex;
  align-items: flex-start;
}

.program-page-body p {
  min-height: 5.25rem;
}

.program-page-meta {
  margin-top: 1.25rem;
}

.program-page-actions {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: .75rem;
  width: 100%;
}

.primary-action,
.secondary-action {
  width: 100%;
}

.program-search input::-webkit-search-cancel-button {
  cursor: pointer;
}

@media (min-width: 1180px) {
  .program-page-media {
    height: 300px;
    min-height: 300px;
    flex-basis: 300px;
  }
}

@media (max-width: 640px) {
  .program-page-card {
    border-radius: 1.55rem;
  }

  .program-page-media {
    height: 230px;
    min-height: 230px;
    flex-basis: 230px;
  }

  .program-page-body {
    min-height: auto;
    padding: 1.15rem;
  }

  .program-page-body h3,
  .program-page-body p {
    min-height: 0;
  }

  .program-page-actions {
    grid-template-columns: 1fr;
  }
}
