/* Encyclopedia — portal knowledge hub */

.ency-page { --ency-radius: 16px; }

.imagi-hero {
  background:
    radial-gradient(ellipse 80% 60% at 100% 0%, rgba(1, 105, 111, .35) 0%, transparent 55%),
    linear-gradient(135deg, var(--in-primary-dark, #4a4580) 0%, var(--in-primary, #5D579E) 52%, #3d6b8a 100%);
  border-radius: var(--ency-radius);
  box-shadow: 0 16px 48px rgba(74, 69, 128, .28);
  position: relative;
}

.imagi-hero::after {
  content: '';
  position: absolute;
  inset: 0;
  background: url("data:image/svg+xml,%3Csvg width='60' height='60' viewBox='0 0 60 60' xmlns='http://www.w3.org/2000/svg'%3E%3Cg fill='none' fill-rule='evenodd'%3E%3Cg fill='%23ffffff' fill-opacity='0.03'%3E%3Cpath d='M36 34v-4h-2v4h-4v2h4v4h2v-4h4v-2h-4zm0-30V0h-2v4h-4v2h4v4h2V6h4V4h-4zM6 34v-4H4v4H0v2h4v4h2v-4h4v-2H6zM6 4V0H4v4H0v2h4v4h2V6h4V4H6z'/%3E%3C/g%3E%3C/g%3E%3C/svg%3E");
  pointer-events: none;
  border-radius: inherit;
}

.imagi-hero-inner { position: relative; z-index: 1; padding: 1.75rem 2rem; }

.imagi-brand {
  font-size: 1.75rem;
  letter-spacing: -.03em;
  display: flex;
  align-items: center;
  gap: .5rem;
}

.imagi-brand i { opacity: .9; font-size: 1.5rem; }

.ency-hero-stats {
  display: flex;
  flex-wrap: wrap;
  gap: .5rem;
  margin-top: 1rem;
}

.ency-stat-pill {
  display: inline-flex;
  align-items: center;
  gap: .35rem;
  padding: .3rem .75rem;
  border-radius: 999px;
  font-size: .78rem;
  font-weight: 600;
  background: rgba(255, 255, 255, .14);
  border: 1px solid rgba(255, 255, 255, .22);
  color: rgba(255, 255, 255, .95);
  backdrop-filter: blur(4px);
}

.ency-stat-pill i { font-size: .9rem; opacity: .85; }

.imagi-search-form { position: relative; }

.imagi-search-form .input-group {
  border-radius: 12px;
  overflow: hidden;
  box-shadow: 0 8px 24px rgba(0, 0, 0, .12);
}

.imagi-search-form .form-control {
  padding: .65rem 1rem;
  font-size: .95rem;
  border: none;
}

.imagi-search-form .btn-in-primary {
  padding-left: 1.25rem;
  padding-right: 1.25rem;
  font-weight: 600;
}

.ency-live-results {
  position: absolute;
  left: 0;
  right: 0;
  top: calc(100% + .35rem);
  z-index: 20;
  background: #fff;
  border-radius: 12px;
  box-shadow: 0 12px 40px rgba(45, 42, 64, .18);
  border: 1px solid #ebe8f5;
  max-height: 320px;
  overflow-y: auto;
}

.ency-live-results[hidden] { display: none !important; }

.ency-live-hit {
  display: flex;
  align-items: flex-start;
  gap: .65rem;
  padding: .7rem 1rem;
  text-decoration: none;
  color: inherit;
  border-bottom: 1px solid #f3f1fa;
  transition: background .15s ease;
}

.ency-live-hit:last-child { border-bottom: none; }

.ency-live-hit:hover { background: #f8f7fc; color: inherit; }

.ency-live-hit > i {
  color: var(--in-primary, #5D579E);
  font-size: 1.1rem;
  margin-top: .15rem;
  flex-shrink: 0;
}

.ency-live-hit strong {
  display: block;
  font-size: .88rem;
  font-weight: 700;
  color: #2d2a40;
}

.ency-live-hit small {
  display: block;
  font-size: .72rem;
  color: #888;
  margin-top: .1rem;
}

.ency-live-hit span.ency-live-excerpt {
  display: block;
  font-size: .78rem;
  color: #6b7280;
  margin-top: .2rem;
  line-height: 1.35;
}

.ency-live-empty {
  padding: 1rem;
  text-align: center;
  font-size: .85rem;
  color: #888;
}

.ency-layout {
  display: grid;
  grid-template-columns: 1fr 280px;
  gap: 1.5rem;
  align-items: start;
}

@media (max-width: 991.98px) {
  .ency-layout { grid-template-columns: 1fr; }
  .ency-sidebar { order: -1; }
}

.ency-sidebar {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  position: sticky;
  top: 1rem;
}

.ency-sidebar-block {
  background: #fff;
  border: 1px solid #ebe8f5;
  border-radius: 14px;
  padding: 1rem 1.1rem;
  box-shadow: 0 4px 16px rgba(93, 87, 158, .06);
}

.ency-sidebar-title {
  font-size: .78rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .06em;
  color: #6b7280;
  margin-bottom: .65rem;
  display: flex;
  align-items: center;
  gap: .4rem;
}

.ency-sidebar-title i { color: var(--in-primary, #5D579E); }

.ency-sidebar-list {
  list-style: none;
  margin: 0;
  padding: 0;
}

.ency-sidebar-list li + li { margin-top: .35rem; }

.ency-sidebar-list a {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: .15rem .5rem;
  padding: .45rem .5rem;
  border-radius: 8px;
  text-decoration: none;
  color: #3d3a4a;
  font-size: .84rem;
  line-height: 1.35;
  transition: background .15s ease;
}

.ency-sidebar-list a:hover {
  background: #f3f1fa;
  color: var(--in-primary, #5D579E);
}

.ency-sidebar-type {
  grid-row: span 2;
  align-self: center;
  color: var(--in-primary, #5D579E);
  opacity: .75;
}

.ency-sidebar-text { font-weight: 600; }

.ency-sidebar-cat {
  grid-column: 2;
  font-size: .7rem;
  color: #9ca3af;
}

.ency-quick-links { display: flex; flex-direction: column; gap: .4rem; }

.ency-quick-link {
  display: flex;
  align-items: center;
  gap: .5rem;
  padding: .5rem .65rem;
  border-radius: 10px;
  font-size: .84rem;
  font-weight: 600;
  text-decoration: none;
  color: #4a4580;
  background: #f8f7fc;
  border: 1px solid #ebe8f5;
  transition: all .15s ease;
}

.ency-quick-link:hover {
  background: var(--in-primary, #5D579E);
  color: #fff;
  border-color: var(--in-primary, #5D579E);
}

.ency-quick-link i { font-size: 1rem; }

.ency-results-meta {
  font-size: .85rem;
  color: #6b7280;
  margin-bottom: 1rem;
}

.ency-results-meta strong { color: #2d2a40; }

.imagi-card {
  border-radius: 14px;
  box-shadow: 0 2px 8px rgba(93, 87, 158, .06);
}

.imagi-card:hover {
  transform: translateY(-5px);
  box-shadow: 0 16px 40px rgba(93, 87, 158, .18);
}

.imagi-card-knowledge .imagi-card-icon {
  color: #5D579E;
  background: linear-gradient(160deg, #f0eef8, #e8e6f4);
}

.ency-mark {
  background: linear-gradient(120deg, #fff3b0 0%, #fde68a 100%);
  color: inherit;
  padding: 0 .12em;
  border-radius: 3px;
  font-weight: 700;
}

.imagi-related a i { margin-right: .2rem; font-size: .85em; opacity: .8; }

.ency-related-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: .75rem;
  margin-top: 1.5rem;
  padding-top: 1.25rem;
  border-top: 1px solid #ebe8f5;
}

.ency-related-card {
  display: block;
  padding: .85rem 1rem;
  border-radius: 12px;
  background: #f8f9fc;
  border: 1px solid #ebe8f5;
  text-decoration: none;
  color: inherit;
  transition: all .15s ease;
}

.ency-related-card:hover {
  background: #f0eef8;
  border-color: #d8d2ee;
  color: var(--in-primary, #5D579E);
  transform: translateY(-2px);
}

.ency-related-card .ency-related-type {
  font-size: .68rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .04em;
  color: #888;
  margin-bottom: .25rem;
}

.ency-related-card strong {
  display: block;
  font-size: .88rem;
  font-weight: 700;
  color: #2d2a40;
}

.ency-related-card:hover strong { color: var(--in-primary, #5D579E); }

.imagi-empty {
  padding: 3rem 2rem !important;
  border: 2px dashed #e0dce8;
  background: linear-gradient(180deg, #faf9fd 0%, #f3f1fa 100%);
}

.imagi-type-nav { margin-bottom: .5rem; }

.imagi-type-pill {
  box-shadow: 0 1px 3px rgba(0, 0, 0, .04);
}

.imagi-article {
  box-shadow: 0 8px 32px rgba(74, 69, 128, .1);
}

.imagi-meta .ency-view-count {
  display: inline-flex;
  align-items: center;
  gap: .25rem;
}

.imagi-hero-faq { background: linear-gradient(135deg, #2d6a6f, #01696f); }
.imagi-card-faq .imagi-card-icon { color: #01696f; background: linear-gradient(160deg, #e8f5f6, #dff0f1); }

@media (max-width: 575.98px) {
  .imagi-hero-inner { padding: 1.25rem 1.35rem; }
  .imagi-brand { font-size: 1.4rem; }
}