/* =========================================================
   HAES INSTITUTIONS PAGES (SCHOOLS, JUNIOR COLLEGES, DEGREE)
   ========================================================= */
.haes-inst-page {
  font-family: 'Poppins', 'Segoe UI', system-ui, sans-serif;
  color: #14213d;
}

/* Hero Banner */
.haes-inst-page .aims-hero {
  position: relative;
  overflow: hidden;
  background-color: #0f1c33;
}

.haes-inst-page .aims-hero-bg {
  position: absolute;
  inset: 0;
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
  z-index: 0;
}

.haes-inst-page .aims-hero-scrim {
  position: absolute;
  inset: 0;
  background: linear-gradient(
    120deg,
    rgba(15, 28, 51, 0.9) 0%,
    rgba(20, 33, 61, 0.8) 58%,
    rgba(201, 100, 73, 0.36) 100%
  );
  z-index: 1;
}

.haes-inst-page .aims-hero-inner {
  position: relative;
  z-index: 2;
}

/* Luminous Light Colorful Section */
.haes-inst-page .inst-section {
  position: relative;
  overflow: hidden;
  padding: 3.5rem 0 4.5rem;
  background: linear-gradient(
    135deg,
    #fffaf0 0%,
    #f5f8ff 36%,
    #fdf3f0 70%,
    #f2fbf7 100%
  );
}

.inst-container {
  max-width: 1280px;
  margin: 0 auto;
  padding: 0 1.5rem;
  position: relative;
  z-index: 2;
}

/* Header + Filter Toolbar */
.inst-toolbar {
  background: rgba(255, 255, 255, 0.88);
  backdrop-filter: blur(10px);
  border: 1px solid rgba(20, 33, 61, 0.08);
  border-top: 4px solid #c9a227;
  border-radius: 16px;
  padding: 1.35rem 1.5rem;
  margin-bottom: 2.25rem;
  box-shadow: 0 12px 30px rgba(15, 28, 51, 0.06);
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 1.25rem;
}

.inst-stats-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  background: #14213d;
  color: #ffffff;
  font-size: 0.82rem;
  font-weight: 600;
  padding: 0.55rem 1rem;
  border-radius: 999px;
}

.inst-stats-pill i {
  color: #c9a227;
}

.inst-controls {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.75rem;
  flex: 1;
  justify-content: flex-end;
}

.inst-search-wrap {
  position: relative;
  min-width: 250px;
  flex: 0 1 320px;
}

.inst-search-wrap i {
  position: absolute;
  left: 0.95rem;
  top: 50%;
  transform: translateY(-50%);
  color: #64748b;
  font-size: 0.88rem;
}

.inst-search-input {
  width: 100%;
  height: 42px;
  padding: 0 0.95rem 0 2.45rem;
  font-family: 'Poppins', 'Segoe UI', system-ui, sans-serif;
  font-size: 0.86rem;
  color: #14213d;
  background: #f8fafc;
  border: 1px solid rgba(20, 33, 61, 0.16);
  border-radius: 10px;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.inst-search-input:focus {
  outline: none;
  border-color: #c9a227;
  background: #ffffff;
  box-shadow: 0 0 0 3px rgba(201, 162, 39, 0.18);
}

.inst-filter-group {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
}

.inst-filter-btn {
  font-family: 'Poppins', 'Segoe UI', system-ui, sans-serif;
  font-size: 0.8rem;
  font-weight: 600;
  color: #14213d;
  background: #f1f5f9;
  border: 1px solid rgba(20, 33, 61, 0.1);
  border-radius: 999px;
  padding: 0.48rem 0.95rem;
  cursor: pointer;
  transition: all 0.2s ease;
}

.inst-filter-btn:hover {
  background: rgba(201, 162, 39, 0.2);
}

.inst-filter-btn.active {
  background: #c96449;
  color: #ffffff;
  border-color: #c96449;
}

/* Cards Grid */
.inst-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1.75rem;
}

.inst-card {
  background: #ffffff;
  border-radius: 16px;
  overflow: hidden;
  border: 1px solid rgba(20, 33, 61, 0.08);
  box-shadow: 0 10px 28px rgba(15, 28, 51, 0.07);
  display: flex;
  flex-direction: column;
  transition: transform 0.26s ease, box-shadow 0.26s ease, border-color 0.26s ease;
}

.inst-card:hover {
  transform: translateY(-6px);
  box-shadow: 0 18px 38px rgba(15, 28, 51, 0.14);
  border-color: rgba(201, 162, 39, 0.55);
}

.inst-card.is-hidden {
  display: none;
}

/* Campus Image Top */
.inst-card-media {
  position: relative;
  height: 205px;
  background: linear-gradient(135deg, #14213d 0%, #243b6b 100%);
  overflow: hidden;
}

.inst-card-media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: transform 0.45s ease;
}

.inst-card:hover .inst-card-media img {
  transform: scale(1.06);
}

.inst-card-media::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(15, 28, 51, 0.08) 45%, rgba(15, 28, 51, 0.72) 100%);
  pointer-events: none;
}

.inst-type-badge {
  position: absolute;
  top: 0.9rem;
  left: 0.9rem;
  z-index: 2;
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.7px;
  text-transform: uppercase;
  padding: 0.34rem 0.78rem;
  border-radius: 999px;
  color: #ffffff;
  background: #14213d;
  border: 1px solid rgba(201, 162, 39, 0.65);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

.inst-type-badge--cbse {
  background: #c96449;
  border-color: #ffffff;
}

.inst-type-badge--gold {
  background: #c9a227;
  color: #0f1c33;
  border-color: #ffffff;
}

.inst-location-chip {
  position: absolute;
  bottom: 0.85rem;
  left: 0.95rem;
  right: 0.95rem;
  z-index: 2;
  display: inline-flex;
  align-items: center;
  gap: 0.42rem;
  color: #ffffff;
  font-size: 0.78rem;
  font-weight: 500;
}

.inst-location-chip i {
  color: #e3c766;
  flex-shrink: 0;
}

/* Card Body */
.inst-card-body {
  padding: 1.35rem 1.4rem 1.45rem;
  display: flex;
  flex-direction: column;
  flex: 1;
}

.inst-card-title {
  font-size: 1.08rem;
  font-weight: 700;
  color: #14213d;
  line-height: 1.35;
  margin-bottom: 0.75rem;
}

.inst-meta-pills {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
  margin-bottom: 1rem;
}

.inst-meta-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  font-size: 0.74rem;
  font-weight: 600;
  color: #334155;
  background: #f8fafc;
  border: 1px solid rgba(20, 33, 61, 0.1);
  border-radius: 8px;
  padding: 0.32rem 0.65rem;
}

.inst-meta-pill i {
  color: #c96449;
  font-size: 0.72rem;
}

.inst-principal-box {
  margin-top: auto;
  padding-top: 0.9rem;
  border-top: 1px dashed rgba(20, 33, 61, 0.14);
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.inst-principal-avatar {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  background: rgba(201, 162, 39, 0.18);
  color: #14213d;
  border: 1px solid rgba(201, 162, 39, 0.5);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 0.88rem;
  flex-shrink: 0;
}

.inst-principal-label {
  display: block;
  font-size: 0.66rem;
  font-weight: 700;
  letter-spacing: 0.7px;
  text-transform: uppercase;
  color: #64748b;
}

.inst-principal-name {
  display: block;
  font-size: 0.85rem;
  font-weight: 600;
  color: #14213d;
  line-height: 1.35;
}

/* Card Footer Action Buttons */
.inst-card-footer {
  margin-top: 1rem;
  padding-top: 0.85rem;
  border-top: 1px solid rgba(20, 33, 61, 0.08);
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 0.55rem;
  flex-wrap: wrap;
}

body .haes-inst-page .inst-details-btn,
body .haes-inst-page a.inst-details-btn,
body .haes-inst-page button.inst-details-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.42rem;
  font-family: 'Poppins', 'Segoe UI', system-ui, sans-serif;
  font-size: 0.78rem;
  font-weight: 700;
  line-height: 1;
  color: #ffffff;
  background: #c96449;
  border: 1px solid #c96449;
  border-bottom: 1px solid #c96449 !important;
  border-radius: 8px;
  padding: 0.48rem 0.9rem;
  cursor: pointer;
  text-decoration: none !important;
  text-decoration-line: none !important;
  box-shadow: none !important;
  background-image: none !important;
  transition: background 0.2s ease, transform 0.2s ease;
  text-decoration: none !important;
}

body .haes-inst-page .inst-details-btn:link,
body .haes-inst-page .inst-details-btn:visited,
body .haes-inst-page .inst-details-btn:hover,
body .haes-inst-page .inst-details-btn:active,
body .haes-inst-page .inst-details-btn:focus,
body .haes-inst-page .inst-details-btn:focus-visible,
body .haes-inst-page .inst-details-btn *,
body .haes-inst-page .inst-details-btn:hover *,
body .haes-inst-page .inst-details-btn:focus-visible * {
  text-decoration: none !important;
  text-decoration-line: none !important;
  border-bottom-color: transparent !important;
  box-shadow: none !important;
}

body .haes-inst-page .inst-details-btn,
body .haes-inst-page .inst-details-btn:hover,
body .haes-inst-page .inst-details-btn:focus-visible {
  border-bottom: 1px solid #b14f36 !important;
}

body .haes-inst-page .inst-details-btn:hover,
body .haes-inst-page .inst-details-btn:focus-visible {
  background: #b14f36;
  border-color: #b14f36;
  color: #ffffff;
  transform: translateY(-1px);
  outline: none;
}

.inst-details-btn i {
  font-size: 0.74rem;
}

body .haes-inst-page .inst-website-link,
body .haes-inst-page a.inst-website-link {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  font-family: 'Poppins', 'Segoe UI', system-ui, sans-serif;
  font-size: 0.78rem;
  font-weight: 700;
  line-height: 1;
  color: #14213d;
  text-decoration: none !important;
  text-decoration-line: none !important;
  border-bottom: 1px solid rgba(201, 162, 39, 0.45) !important;
  box-shadow: none !important;
  background-image: none !important;
  padding: 0.48rem 0.9rem;
  border-radius: 8px;
  background-color: rgba(201, 162, 39, 0.14);
  border: 1px solid rgba(201, 162, 39, 0.45);
  transition: background 0.2s ease, color 0.2s ease, transform 0.2s ease;
}

body .haes-inst-page .inst-website-link:link,
body .haes-inst-page .inst-website-link:visited,
body .haes-inst-page .inst-website-link:hover,
body .haes-inst-page .inst-website-link:focus-visible,
body .haes-inst-page .inst-website-link * {
  text-decoration: none !important;
  text-decoration-line: none !important;
  box-shadow: none !important;
}

body .haes-inst-page .inst-website-link:hover,
body .haes-inst-page .inst-website-link:focus-visible {
  background-color: #14213d;
  color: #ffffff;
  border-color: #14213d;
  border-bottom-color: #14213d !important;
  transform: translateY(-1px);
  outline: none;
}

.inst-website-link i {
  font-size: 0.72rem;
  color: #c96449;
  transition: color 0.2s ease;
}

.inst-website-link:hover i,
.inst-website-link:focus-visible i {
  color: #e3c766;
}

/* Details Modal */
.inst-modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(15, 28, 51, 0.65);
  backdrop-filter: blur(4px);
  z-index: 1300;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 1rem;
}

.inst-modal-backdrop.is-open {
  display: flex;
}

.inst-modal-card {
  width: 100%;
  max-width: 540px;
  background: #ffffff;
  border-radius: 18px;
  overflow: hidden;
  border-top: 4px solid #c9a227;
  box-shadow: 0 24px 60px rgba(15, 28, 51, 0.35);
  font-family: 'Poppins', 'Segoe UI', system-ui, sans-serif;
  color: #14213d;
}

.inst-modal-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
  padding: 1.25rem 1.4rem;
  background: #f8fafc;
  border-bottom: 1px solid rgba(20, 33, 61, 0.08);
}

.inst-modal-badge {
  display: inline-block;
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.7px;
  text-transform: uppercase;
  color: #c96449;
  background: rgba(201, 100, 73, 0.12);
  padding: 0.24rem 0.65rem;
  border-radius: 999px;
  margin-bottom: 0.35rem;
}

.inst-modal-title {
  font-size: 1.15rem;
  font-weight: 700;
  color: #14213d;
  margin: 0;
}

.inst-modal-close {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  border: 1px solid rgba(20, 33, 61, 0.14);
  background: #ffffff;
  color: #14213d;
  font-size: 0.95rem;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  transition: background 0.2s ease, color 0.2s ease;
}

.inst-modal-close:hover {
  background: #14213d;
  color: #ffffff;
}

.inst-modal-body {
  padding: 1.35rem 1.4rem;
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
}

.inst-modal-row {
  display: flex;
  align-items: flex-start;
  gap: 0.75rem;
  font-size: 0.88rem;
}

.inst-modal-row i {
  color: #c9a227;
  margin-top: 0.2rem;
  width: 16px;
  text-align: center;
}

.inst-modal-row strong {
  display: block;
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.6px;
  color: #64748b;
}

.inst-modal-footer {
  padding: 1rem 1.4rem 1.3rem;
  border-top: 1px solid rgba(20, 33, 61, 0.08);
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 0.65rem;
}

/* Empty Search State */
.inst-empty-state {
  display: none;
  text-align: center;
  background: rgba(255, 255, 255, 0.9);
  border-radius: 16px;
  padding: 2.5rem 1.5rem;
  border: 1px dashed rgba(20, 33, 61, 0.2);
  margin-top: 1rem;
}

.inst-empty-state.visible {
  display: block;
}

.inst-empty-state i {
  font-size: 2rem;
  color: #c96449;
  margin-bottom: 0.6rem;
}

/* Responsive */
@media (max-width: 1080px) {
  .inst-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

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

  .inst-toolbar {
    padding: 1.1rem;
  }

  .inst-controls {
    justify-content: stretch;
  }

  .inst-search-wrap {
    flex: 1 1 100%;
  }
}