/* programmes.css — Professional polish for Programmes catalogue & details
   Uses brand vars from theme.css with safe fallbacks. */

/* ---------- Brand vars (safe fallbacks) ---------- */
:root{
  --brand:      #E46AA3;
  --brand-700:  #D42677;
  --brand-900:  #A91E5F;
  --muted:      #6c757d;
  --soft:       rgba(228,106,163,.08);
  --soft-b:     rgba(228,106,163,.22);
  --card-b:     rgba(16,24,40,.08);
}

/* ---------- Cards (grid) ---------- */
.programme-card{
  border: 1px solid var(--card-b);
  transition: transform .18s ease, box-shadow .18s ease, border-color .18s ease;
  overflow: hidden;
  border-radius: 1rem;
}
.programme-card:hover{
  transform: translateY(-2px);
  box-shadow: 0 12px 28px rgba(16,24,40,.12);
  border-color: rgba(16,24,40,.14);
}
.programme-card .card-img-top{
  object-fit: cover;
  border-bottom: 1px solid rgba(16,24,40,.06);
}

/* Subtle code badge using brand */
.programme-card .brand-soft{
  background: var(--soft);
  color: var(--brand-900);
  border: 1px solid var(--soft-b);
}

/* ---------- Filters bar ---------- */
.programmes-filters .form-check-input:checked{
  background-color: var(--brand-700);
  border-color: var(--brand-700);
}
.programmes-filters .form-label{ font-weight: 600; }

/* ---------- Result meta + chips ---------- */
.btn.btn-outline-secondary.btn-sm{ border-color: rgba(16,24,40,.18); }
.btn.btn-outline-secondary.btn-sm:hover{
  border-color: var(--brand-700); color: var(--brand-700);
}

/* ---------- Pagination ---------- */
.pagination .page-link{ border-radius: .5rem; }
.pagination .page-item.active .page-link{
  background-color: var(--brand-700); border-color: var(--brand-700);
}
.pagination .page-link:focus{ box-shadow: 0 0 0 .2rem rgba(212,38,119,.22); }

/* ---------- Programme detail ---------- */
.programme-detail .programme-hero{ max-width: 720px; }
@media (min-width: 992px){ .sticky-aside{ position: sticky; top: 92px; } }

/* Tab set */
.programme-detail .nav-tabs .nav-link{
  font-weight: 600;
  border-top-left-radius: .75rem;
  border-top-right-radius: .75rem;
}
.programme-detail .nav-tabs .nav-link.active{
  color: var(--brand-900);
  border-color: transparent transparent #dee2e6;
}

/* Tables inside Curriculum tab */
.programme-detail table.table{ border-color: rgba(16,24,40,.08); }
.programme-detail table.table thead th{
  font-weight: 700; color: #0f172a; background: #fafafa;
}
.programme-detail table.table tbody td{ vertical-align: middle; }

/* Fact lists */
.fact-row dt{ color: var(--muted); font-weight: 600; }
.fact-row dd{ margin-bottom: .5rem; }

/* ---------- Buttons (scoped, strong overrides to avoid white pills) ---------- */
main .btn-primary{
  background: var(--brand-700) !important;
  border-color: var(--brand-700) !important;
  color: #fff !important;
}
main .btn-primary:hover{
  background: var(--brand-900) !important;
  border-color: var(--brand-900) !important;
}
main .btn-outline-secondary{
  border-color: var(--brand-700) !important;
  color: var(--brand-700) !important;
  background: transparent !important;
}
main .btn-outline-secondary:hover{
  border-color: var(--brand-900) !important;
  color: var(--brand-900) !important;
}

/* ---------- Compare Feature ---------- */
.compare-fab .btn{ border-radius: 999px; font-weight: 600; }

/* Visible disabled state */
.compare-fab .btn.disabled,
.compare-fab .btn[aria-disabled="true"]{
  background-color:#f1f3f5; color:#6c757d !important; border-color:#dee2e6; cursor:not-allowed;
}

/* Compare primary */
.compare-fab .btn-primary{
  background-color: var(--brand-700) !important;
  border-color: var(--brand-700) !important;
  color:#fff !important;
}
.compare-fab .btn-primary:hover{
  background-color: var(--brand-900) !important;
  border-color: var(--brand-900) !important;
}

/* Compare clear */
.compare-fab .btn-outline-secondary{
  border-color: var(--brand-700) !important; color: var(--brand-700) !important;
}
.compare-fab .btn-outline-secondary:hover{
  border-color: var(--brand-900) !important; color: var(--brand-900) !important;
}

/* Compare page buttons — harden against any theme overrides */
.compare-table .btn{ border-radius: 999px; font-weight: 600; }
.compare-table .btn-primary{
  background-color: var(--brand-700) !important;
  border-color: var(--brand-700) !important;
  color: #fff !important;
}
.compare-table .btn-primary:hover{
  background-color: var(--brand-900) !important;
  border-color: var(--brand-900) !important;
}
.compare-table .btn-outline-secondary{
  border-color: var(--brand-700) !important;
  color: var(--brand-700) !important;
}
.compare-table .btn-outline-secondary:hover{
  border-color: var(--brand-900) !important;
  color: var(--brand-900) !important;
}

/* Always readable checkbox label */
.form-check-label{ color:#212529; }

/* ---------- Small utilities ---------- */
.object-fit-cover{ object-fit: cover; }
.ratio-21x9{ --bs-aspect-ratio: calc(9 / 21 * 100%); }

/* Improve multi-select height in filters */
#dept.form-select{ min-height: 3rem; }

/* Light border around images when no visual edge */
.programme-detail img{ border-radius: .75rem; }
