/* ===== Hero Section ===== */
.cs-hero{
  background:#0f2146;
  padding:42px 0 28px;
  color:#fff;
  border-bottom:1px solid rgba(255,255,255,.08);
}
.cs-hero h1{
  color:#fff;
  margin:0 0 18px;
}

/* Search bar */
.cs-search{
  display:flex;
  align-items:center;
  gap:8px;
  width:min(980px,100%);
  height:56px;
  margin:0;
  background:#fff;
  border:1px solid var(--stroke);
  border-radius:999px;
  padding:6px;
  box-shadow:var(--shadow-sm);
}
.cs-search input{
  flex:1 1 auto;
  min-width:0;
  height:100%;
  border:0;
  outline:0;
  padding:0 14px;
  font-size:16px;
  border-radius:999px;
  background:transparent;
  color:var(--ink);
}
.cs-search input::placeholder{ color:#8d95a6; }
.cs-search .search__btn{
  flex:0 0 44px;
  width:44px; height:44px;
  border:0;
  border-radius:50%;
  background:var(--primary);
  color:#fff;
  display:grid;
  place-items:center;
  cursor:pointer;
}
@media (max-width:640px){
  .cs-search{ width:100%; height:52px; }
}

/* ===== Layout ===== */
.cs-main{
  background:var(--offwhite);
  padding:24px 0 48px;
}
.cs-grid{
  display:grid;
  grid-template-columns:280px 1fr;
  gap:20px;
}

/* ===== Filters Sidebar ===== */
.filters{
  background:#fff;
  border:1px solid var(--stroke);
  border-radius:12px;
  padding:14px;
  position:sticky;
  top:96px;
  height:max-content;
}
.filters__head{
  display:flex;
  align-items:center;
  justify-content:space-between;
  margin-bottom:8px;
}
.filters__head h3{
  margin:0;
  font-size:18px;
  color:var(--primary);
}
.filters__reset{
  background:none;
  border:0;
  color:var(--primary);
  font-weight:600;
  cursor:pointer;
  text-decoration:underline;
  font-size:12px;
}
.filter{
  border-top:1px dashed var(--stroke);
  padding-top:10px;
  margin-top:10px;
}
.filter:first-of-type{
  border-top:0;
  padding-top:0;
  margin-top:0;
}
.filter__title{
  width:100%;
  text-align:left;
  background:#fff;
  border:0;
  cursor:pointer;
  font-weight:700;
  color:var(--ink);
  padding:8px 0;
  display:flex;
  align-items:center;
  gap:8px;
}
.filter__title::after{
  content:"▾";
  margin-left:auto;
  color:#8b93a7;
}
.filter__title.is-open::after{ content:"▴"; }
.filter__body{ padding:6px 0 10px; display:block; }
.filter__group{ display:grid; gap:8px; font-size:14px; color:var(--muted); }
.input{
  width:100%;
  height:40px;
  border:1px solid var(--stroke);
  border-radius:10px;
  padding:0 12px;
  font-size:14px;
  outline:0;
  background:#fff;
}

/* Range input */
.range input[type="range"]{ width:100%; }
.range__value{
  font-size:13px;
  color:var(--muted);
  margin-top:6px;
}

.cs-grid.no-sidebar {
  grid-template-columns: 1fr;
}

/* ===== Results Bar ===== */
.results__bar{
  background:#fff;
  border:1px solid var(--stroke);
  border-radius:12px;
  padding:10px 10px;
  display:flex;
  align-items:center;
  justify-content:space-between;
  margin-bottom:10px;
}
.results__meta{
  display:flex;
  flex-direction:column;
  gap:2px;
}
.results__meta strong{ color:var(--primary); }
.muted{ color:var(--muted); font-size:12px; }

/* ===== Cards Grid ===== */
/* UPDATED: compact grid to fit more cards and reduce card size */
.cards {
  display: grid;
  grid-template-columns: repeat(4, 1fr);  /* Force 4 columns */
  gap: 20px;  /* Slightly larger gap for balance */
}

@media (max-width:1200px) {
  .cards {
    grid-template-columns: repeat(3, 1fr);
  }
}

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

@media (max-width:600px) {
  .cards {
    grid-template-columns: 1fr;
  }
}


/* School Card */
/* UPDATED: reduced radii, shadows, media height, avatar/bookmark sizes, paddings, and font-sizes */
.school{
  background:#fff;
  border:1px solid var(--stroke);
  border-radius:16px;
  overflow:visible;
  box-shadow:0 8px 20px rgba(16,33,75,.06);
  display:flex;
  flex-direction:column;
  transition:transform .12s ease, box-shadow .12s ease;
}
.school:hover{
  transform:translateY(-4px);
  box-shadow:0 12px 28px rgba(16,33,75,.08);
}
.school__media{
  position:relative;
  aspect-ratio:16/9;
  height:clamp(140px,18vw,160px);
  border-top-left-radius:16px;
  border-top-right-radius:16px;
  overflow:visible;
}
.school__media img{
  width:100%;
  height:100%;
  object-fit:cover;
  display:block;
  background:#f2f4f7;
  border-top-left-radius:16px;
  border-top-right-radius:16px;
}

/* School logo badge */
/* UPDATED: reduced logo size */
.badge.avatar{
  position:absolute;
  left:16px;
  bottom:-18px;
  width:48px;
  height:48px;
  border-radius:10px;
  border:4px solid #fff;
  box-shadow:0 8px 18px rgba(0,0,0,.12);
  background:#fff;
  overflow:hidden;
  z-index:5;
}
.badge.avatar img{
  width:100%;
  height:100%;
  object-fit:contain;
}

/* Bookmark button */
/* UPDATED: reduced bookmark size */
.icon-btn.bookmark{
  position:absolute;
  right:12px;
  bottom:-20px;
  width:48px;
  height:48px;
  border-radius:50%;
  border:0;
  display:grid;
  place-items:center;
  cursor:pointer;
  background:#fff;
  color:#0f2146;
  box-shadow:0 8px 20px rgba(0,0,0,.12);
  transition:transform .12s ease;
  z-index:5;
}
.icon-btn.bookmark:hover{ transform:translateY(-2px); }
.icon-btn.bookmark i{ font-size:18px; }

/* Card Body */
.school__body{
  position:relative;
  z-index:1;
  padding:28px 16px 16px;
  display:grid;
  gap:8px;
}


.school__name{
  margin:6px 0 0 0;
  color:var(--primary);
  font-size:clamp(16px,1.6vw,20px);
  line-height:1.15;
  font-weight:700;
  overflow-wrap:anywhere;
}
.school__loc{
  color:#7b8497;
  font-size:14px;
  line-height:1.3;
}
.school__line{
  display:flex;
  flex-wrap:wrap;
  gap:8px 12px;
  color:#4a5568;
  font-size:13px;
  margin-top: auto;
}
.school__line .dot{
  font-style:normal;
  color:#aab1c2;
}
.school__tuition{
  font-size:14px;
  color:#2d3748;
  margin-top:2px;
  font-weight: bold;
}
.chips{
  display:flex;
  flex-wrap:wrap;
  gap:8px;
  margin-top:4px;
}
.chip{
  font-size:12px;
  padding:3px 8px;
  border-radius:999px;
  background:#ececec;
  color:#10214B;
  font-weight:600;
}
.school__foot{
  display:flex;
  justify-content:space-between;
  align-items:center;
  font-size:13px;
  color:#2f3a4d;
  margin-top:4px;
}
.school__body {
  display: flex;
  flex-direction: column;
  padding: 1rem;
  flex-grow: 1;
}

.school__cta{
  margin-top:10px;
  width:100%;
  height:44px;
  border-radius:12px;
  font-size:15px;
  background:#0f2146;
  color:#fff;
  display:inline-flex;
  align-items:center;
  justify-content:center;
  box-shadow:0 6px 14px rgba(16,33,75,.12);
}
.school__cta:hover{ filter:brightness(.98); }

/* ===== Responsive Cards ===== */
@media (max-width:760px){
  .cards{ grid-template-columns:1fr; }
  .icon-btn.bookmark{ right:16px; bottom:-28px; width:48px; height:48px; }
  .badge.avatar{ left:18px; bottom:-24px; width:48px; height:48px; border-width:4px; }
  .school__body{ padding-top:40px; }
}

/* Collapse filters/results on medium */
@media (max-width:1100px){
  .cs-grid{ grid-template-columns:1fr; }
  .filters{ position:static; order:2; }
  .results{ order:1; }
}

.results__sort select#sort{ display:none; }
.filters{ display:none !important; }
.sort-filter-btn{
  display:inline-flex;
  gap:.5rem;
  align-items:center;
  border:1px solid var(--stroke);
  background:#fff;
  color:var(--primary);
  padding:.55rem 1rem;
  border-radius:999px;
  box-shadow:var(--shadow-sm);
}
.sort-filter-btn i{ font-size:18px; }

@media (min-width:1201px){
  .results__sort select#sort{ display:inline-block; }
  .filters{ display:block !important; }
  .sort-filter-btn{ display:none; }
}

/* Small screens wrap results bar */
@media (max-width:1200px){
  .results__bar{ flex-wrap:wrap; gap:12px; }
}

/* ===== Modal Sheet ===== */
.filter-modal{
  position:fixed;
  inset:0;
  display:none;
  background:rgba(0,0,0,.35);
  z-index:1000;
}
.filter-modal.is-open{ display:block; }
.filter-sheet{
  position:fixed;
  left:0; right:0; bottom:0;
  background:#fff;
  border-top-left-radius:18px;
  border-top-right-radius:18px;
  box-shadow:0 -18px 40px rgba(16,33,75,.25);
  max-height:92vh;
  display:flex;
  flex-direction:column;
  transform:translateY(8%);
  animation:slideUp .18s ease-out forwards;
}
@keyframes slideUp{ to{ transform:translateY(0); } }
.filter-sheet__head{
  display:flex;
  align-items:center;
  justify-content:space-between;
  padding:14px 16px;
  border-bottom:1px solid var(--stroke);
}
.filter-sheet__head h3{ margin:0; color:var(--primary); }
.filter-sheet__actions{
  display:flex;
  gap:10px;
  align-items:center;
}
.filter-sheet__actions .link{
  background:none;
  border:0;
  color:var(--primary);
  font-weight:700;
  cursor:pointer;
}
.filter-sheet__body{
  overflow:auto;
  padding:14px 16px 18px;
  display:grid;
  gap:16px;
}

/* Sort section inside sheet */
.sheet-sort{ display:grid; gap:8px; }
.sheet-sort label{ font-weight:700; color:var(--primary); }

/* Filters inside sheet */
.filter-sheet .filters{
  display:block !important;
  position:static;
  border:0;
  padding:0;
  box-shadow:none;
}
.filter-sheet .filter{ border-top:1px dashed var(--stroke); }
.filter-sheet .filter:first-of-type{ border-top:0; }