/* =========================================================
   Institutes page — supplement to style.css
   ========================================================= */

/* ---- PAGE HERO ---- */
.inst-hero {
  background: linear-gradient(135deg, #0a0a0a 0%, #1a1a1a 100%);
  padding: 120px 0 72px;
  text-align: center;
  border-bottom: 1px solid #222;
}

.inst-hero-text h1 {
  font-size: var(--text-4xl);
  font-weight: 800;
  color: #fff;
  margin: 16px 0 20px;
  line-height: 1.1;
}

.inst-hero-text p {
  font-size: var(--text-lg);
  color: #aaa;
  max-width: 600px;
  margin: 0 auto 48px;
  line-height: 1.7;
}

.inst-stats {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0;
}

.inst-stat {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 0 48px;
}

.inst-stat-n {
  font-size: var(--text-2xl);
  font-weight: 800;
  color: #E8621A;
}

.inst-stat-l {
  font-size: var(--text-sm);
  color: #777;
  margin-top: 4px;
  text-transform: uppercase;
  letter-spacing: .06em;
}

.inst-stat-div {
  width: 1px;
  height: 40px;
  background: #333;
}

/* ---- TOOLBAR ---- */
.inst-toolbar {
  position: sticky;
  top: 70px;
  z-index: 90;
  background: #fff;
  border-bottom: 1px solid #eee;
  padding: 14px 0;
  box-shadow: 0 2px 8px rgba(0,0,0,.04);
}

.inst-toolbar-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.inst-search-wrap {
  position: relative;
  flex: 1;
  max-width: 480px;
}

.inst-search-wrap .ti {
  position: absolute;
  left: 14px;
  top: 50%;
  transform: translateY(-50%);
  font-size: 18px;
  color: #999;
  pointer-events: none;
}

#inst-search {
  width: 100%;
  padding: 10px 16px 10px 44px;
  border: 1.5px solid #e0e0e0;
  border-radius: 10px;
  font-size: var(--text-base);
  font-family: inherit;
  outline: none;
  transition: border-color .2s;
  background: #fafafa;
}

#inst-search:focus {
  border-color: #E8621A;
  background: #fff;
}

.inst-count {
  font-size: var(--text-sm);
  color: #888;
  white-space: nowrap;
}

/* ---- GRID ---- */
.inst-grid-section {
  padding: 56px 0 80px;
  background: #f7f7f7;
}

.inst-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 24px;
}

/* ---- CARD ---- */
.inst-card {
  background: #fff;
  border-radius: 16px;
  border: 1.5px solid #ebebeb;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  transition: box-shadow .25s, transform .25s, border-color .25s;
}

.inst-card:hover {
  box-shadow: 0 8px 32px rgba(0,0,0,.1);
  transform: translateY(-3px);
  border-color: #E8621A;
}

.inst-card-logo-wrap {
  display: flex;
  align-items: center;
  justify-content: center;
  height: 140px;
  padding: 24px;
  background: #fafafa;
  border-bottom: 1px solid #f0f0f0;
}

.inst-card-logo-wrap img {
  max-width: 100%;
  max-height: 88px;
  object-fit: contain;
  display: block;
}

.inst-logo-fallback {
  width: 64px;
  height: 64px;
  border-radius: 12px;
  background: linear-gradient(135deg, #E8621A, #ff8c4a);
  color: #fff;
  font-size: var(--text-xl);
  font-weight: 800;
  align-items: center;
  justify-content: center;
}

.inst-card-body {
  padding: 20px;
  display: flex;
  flex-direction: column;
  flex: 1;
}

.inst-name {
  font-size: var(--text-md);
  font-weight: 700;
  color: #111;
  margin: 0 0 10px;
  line-height: 1.3;
}

.inst-desc {
  font-size: var(--text-sm);
  color: #777;
  line-height: 1.6;
  flex: 1;
  margin: 0 0 16px;
  min-height: 20px;
}

/* Empty desc: show placeholder hint for editors */
.inst-desc:empty::before,
.inst-desc:has(+ .inst-link):not(:empty)::before {
  content: '';
}

.inst-link {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: var(--text-sm);
  font-weight: 600;
  color: #E8621A;
  text-decoration: none;
  margin-top: auto;
  transition: gap .2s;
}

.inst-link:hover {
  gap: 8px;
}

.inst-link .ti {
  font-size: 14px;
}

/* ---- NO RESULTS ---- */
.inst-no-results {
  text-align: center;
  padding: 80px 0;
  color: #aaa;
  grid-column: 1 / -1;
}

.inst-no-results .ti {
  font-size: 48px;
  display: block;
  margin-bottom: 16px;
  color: #ddd;
}

.inst-no-results p {
  font-size: var(--text-md);
}

/* ---- RESPONSIVE ---- */
@media (max-width: 768px) {
  .inst-hero {
    padding: 100px 0 56px;
  }

  .inst-hero-text h1 {
    font-size: var(--text-3xl);
  }

  .inst-stat {
    padding: 0 24px;
  }

  .inst-grid {
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    gap: 16px;
  }

  .inst-card-logo-wrap {
    height: 110px;
  }

  .inst-toolbar {
    top: 60px;
  }

  .inst-count {
    display: none;
  }
}

@media (max-width: 480px) {
  .inst-stats {
    gap: 0;
  }

  .inst-stat {
    padding: 0 16px;
  }

  .inst-stat-n {
    font-size: var(--text-xl);
  }

  .inst-grid {
    grid-template-columns: 1fr 1fr;
    gap: 12px;
  }

  .inst-card-logo-wrap {
    height: 90px;
    padding: 16px;
  }

  .inst-card-body {
    padding: 14px;
  }

  .inst-name {
    font-size: var(--text-sm);
  }
}
