/* Search */

#resource-results {
  scroll-margin-top: 140px;
}

#resource-results.jet-listing-grid[data-hkec-expanded="false"],
#resource-results[data-hkec-expanded="false"] .jet-listing-grid {
  display: none !important;
}

.hkec-search {
  width: 100%;
  margin-bottom: 32px;
}

.hkec-search label {
  display: block;
  margin-bottom: 10px;
  color: #333f48;
  font-weight: 700;
}

.hkec-search-row {
  display: flex;
  gap: 12px;
}

#hkec-resource-search {
  flex: 1;
  min-width: 0;
  padding: 16px 18px;
  border: 2px solid #005f86;
  border-radius: 12px;
  color: #333f48;
  background: #fff;
  font-size: 16px;
}

#hkec-resource-search:focus {
  outline: 3px solid rgba(0, 95, 134, 0.2);
  outline-offset: 2px;
}

#hkec-search-clear {
  padding: 12px 20px;
  border: 0;
  border-radius: 12px;
  color: #fff;
  background: #333f48;
  font-weight: 700;
  cursor: pointer;
}

#hkec-search-clear:hover {
  background: #bf5700;
}

#hkec-search-status {
  min-height: 24px;
  margin: 10px 0 0;
  color: #5e686f;
}

.hkec-results-toggle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  min-height: 56px;
  padding: 10px 14px;
  color: #333f48;
  background: #f8f7f5;
  border: 1px solid #d6d2c4;
  border-radius: 12px;
  font-size: 0.75rem;
  font-weight: 800;
  white-space: nowrap;
  cursor: pointer;
  transition:
    border-color 180ms ease,
    background 180ms ease;
}

.hkec-results-toggle:hover,
.hkec-results-toggle:focus-visible {
  background: #fff;
  border-color: #005f86;
}

.hkec-results-toggle:focus-visible {
  outline: 3px solid rgba(0, 95, 134, 0.2);
  outline-offset: 2px;
}

.hkec-results-toggle__track {
  position: relative;
  width: 38px;
  height: 22px;
  flex: 0 0 auto;
  background: #9cadb7;
  border-radius: 999px;
  transition: background 180ms ease;
}

.hkec-results-toggle__thumb {
  position: absolute;
  top: 3px;
  left: 3px;
  width: 16px;
  height: 16px;
  background: #fff;
  border-radius: 50%;
  box-shadow: 0 1px 3px rgba(51, 63, 72, 0.3);
  transition: transform 180ms ease;
}

.hkec-results-toggle[aria-checked="true"] .hkec-results-toggle__track {
  background: #005f86;
}

.hkec-results-toggle[aria-checked="true"] .hkec-results-toggle__thumb {
  transform: translateX(16px);
}

/* Hidden listing data */

.hkec-org-school,
.hkec-primary-type,
.hkec-modal-description-data,
.hkec-modal-contact-data {
  display: none !important;
}

/* Reset JetEngine grid */

#resource-results .jet-listing-grid__items {
  display: block !important;
  margin: 0 !important;
}

/* School groups */

.hkec-school-group {
  margin: 0 0 54px;
}

.hkec-school-heading-row {
  display: grid;
  grid-template-columns: auto minmax(40px, 1fr) auto;
  align-items: center;
  gap: 16px;
  margin-bottom: 20px;
}

.hkec-school-heading-row::after {
  grid-column: 2;
  grid-row: 1;
  height: 1px;
  background: #d6d2c4;
  content: "";
}

.hkec-school-heading {
  grid-column: 1;
  grid-row: 1;
  margin: 0 !important;
  color: #333f48;
  font-size: clamp(1.45rem, 2.5vw, 2rem);
  font-weight: 700;
  letter-spacing: -0.02em;
  line-height: 1;
  text-transform: uppercase;
}

.hkec-school-count {
  grid-column: 3;
  grid-row: 1;
  color: #5e686f;
  font-size: 0.68rem;
  font-weight: 700;
  white-space: nowrap;
}

/* Organization grid */

.hkec-school-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  align-items: stretch;
  gap: 18px;
}

.hkec-school-grid > .jet-listing-grid__item {
  width: 100% !important;
  max-width: none !important;
  height: 100%;
  padding: 0 !important;
}

.hkec-school-grid > .jet-listing-grid__item > .elementor,
.hkec-school-grid
  > .jet-listing-grid__item
  > .elementor
  > .elementor-element {
  height: 100%;
}

/* Organization card */

.hkec-school-grid .hkec-org-card {
  box-sizing: border-box;
  width: 100%;
  min-height: 210px;
  height: 100%;
  padding: 30px !important;
  gap: 0 !important;
  color: #333f48;
  background: #fff;
  border-top: 6px solid #bf5700 !important;
  border-radius: 22px !important;
  box-shadow: 0 14px 38px rgba(51, 63, 72, 0.12);
  cursor: pointer;
  transition:
    box-shadow 180ms ease,
    transform 180ms ease;
}

.hkec-org-card:hover,
.hkec-org-card:focus-visible {
  outline: none;
  transform: translateY(-4px);
  box-shadow: 0 22px 52px rgba(51, 63, 72, 0.2);
}

.hkec-org-card:focus-visible {
  box-shadow:
    0 0 0 4px rgba(0, 95, 134, 0.25),
    0 22px 52px rgba(51, 63, 72, 0.2);
}

/* Dynamic card colors */

.hkec-org-card[data-hkec-primary-type="mentorship"] {
  border-top-color: #005f86 !important;
}

.hkec-org-card[data-hkec-primary-type="community"] {
  border-top-color: #579d42 !important;
}

.hkec-org-card[data-hkec-primary-type="funding"] {
  border-top-color: #bf5700 !important;
}

.hkec-org-card[data-hkec-primary-type="technical-talent"] {
  border-top-color: #00a9b7 !important;
}

/* Organization title */

.hkec-org-title {
  margin: 0 0 12px !important;
}

.hkec-org-title,
.hkec-org-title * {
  margin-top: 0 !important;
  color: #333f48 !important;
  font-size: 1.45rem !important;
  font-weight: 700 !important;
  letter-spacing: -0.025em;
  line-height: 1.25 !important;
  overflow-wrap: normal;
  word-break: normal;
  hyphens: none;
  text-transform: uppercase;
}

/* Resource-type labels */

.hkec-org-types .jet-listing-dynamic-terms__value {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.hkec-org-types .jet-listing-dynamic-terms__delimiter {
  display: none;
}

.hkec-org-types .jet-listing-dynamic-terms__link {
  display: inline-flex;
  align-items: center;
  padding: 5px 9px !important;
  color: #5e686f;
  background: #f8f7f5;
  border-left: 3px solid #005f86;
  border-radius: 0 8px 8px 0;
  font-size: 0.58rem !important;
  font-weight: 700;
  text-decoration: none;
  pointer-events: none;
}

.hkec-org-types [data-hkec-type="mentorship"] {
  border-left-color: #005f86;
}

.hkec-org-types [data-hkec-type="community"] {
  border-left-color: #579d42;
}

.hkec-org-types [data-hkec-type="funding"] {
  border-left-color: #bf5700;
}

.hkec-org-types [data-hkec-type="technical-talent"] {
  border-left-color: #00a9b7;
}

/* Resource CTA */

.hkec-org-link {
  margin-top: auto;
  padding-top: 22px;
}

.hkec-org-link .jet-listing-dynamic-link__icon {
  display: none !important;
}

.hkec-org-link a {
  color: #333f48;
  font-size: 0.68rem !important;
  font-weight: 800;
  text-decoration: none;
}

.hkec-org-link::before,
.hkec-org-link *::before,
.hkec-org-link a::after {
  display: none !important;
  content: none !important;
}

.hkec-cta-arrow {
  display: inline-block;
  margin-left: 7px;
  color: #bf5700;
  font-size: 1rem;
  font-weight: 800;
  transition: transform 180ms ease;
}

.hkec-org-link a:hover {
  color: #bf5700;
}

.hkec-org-link a:hover .hkec-cta-arrow {
  transform: translate(3px, -3px);
}

/* Timeline active filter */

.hkec-clickable-timeline .timeline-item__card {
  transition:
    box-shadow 180ms ease,
    transform 180ms ease;
}

.hkec-clickable-timeline .timeline-item__card.hkec-filter-active {
  box-shadow: 0 0 0 4px rgba(0, 95, 134, 0.3);
  transform: translateY(-3px);
}

/* Modal */

.hkec-resource-modal {
  width: min(calc(100% - 32px), 720px);
  max-height: min(82vh, 760px);
  padding: 0;
  overflow: auto;
  scrollbar-width: none;
  color: #333f48;
  background: #fff;
  border: 0;
  border-top: 8px solid #bf5700;
  border-radius: 26px;
  box-shadow: 0 30px 90px rgba(22, 28, 32, 0.35);
}

.hkec-resource-modal::-webkit-scrollbar {
  display: none;
}

.hkec-resource-modal::backdrop {
  background: rgba(24, 33, 39, 0.72);
  backdrop-filter: blur(3px);
}

.hkec-resource-modal[open] {
  animation: hkec-modal-enter 260ms cubic-bezier(0.22, 1, 0.36, 1);
}

@keyframes hkec-modal-enter {
  from {
    opacity: 0;
    transform: translateY(24px) scale(0.96);
  }

  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

.hkec-modal-content {
  padding: 52px;
}

.hkec-modal-close {
  position: absolute;
  z-index: 2;
  top: 18px;
  right: 18px;
  width: 42px;
  height: 42px;
  display: grid;
  place-items: center;
  padding: 0;
  color: #333f48;
  background: #f8f7f5;
  border: 1px solid #d6d2c4;
  border-radius: 50%;
  cursor: pointer;
  font-size: 1.45rem;
  line-height: 1;
}

.hkec-modal-close:hover {
  color: #fff;
  background: #bf5700;
  border-color: #bf5700;
}

.hkec-modal-school {
  max-width: calc(100% - 48px);
  margin: 0 0 10px;
  color: #bf5700;
  font-size: 0.68rem;
  font-weight: 800;
  letter-spacing: 0.09em;
  text-transform: uppercase;
}

.hkec-resource-modal h2 {
  max-width: 570px;
  margin: 0 0 16px;
  color: #333f48;
  font-size: clamp(2rem, 5vw, 3rem);
  font-weight: 700;
  letter-spacing: -0.045em;
  line-height: 1.05;
  text-transform: uppercase;
}

.hkec-modal-types {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 28px;
}

.hkec-modal-type {
  padding: 5px 9px;
  color: #5e686f;
  background: #f8f7f5;
  border-left: 3px solid #005f86;
  border-radius: 0 8px 8px 0;
  font-size: 0.68rem;
  font-weight: 700;
}

.hkec-modal-type[data-type="community"] {
  border-left-color: #579d42;
}

.hkec-modal-type[data-type="funding"] {
  border-left-color: #bf5700;
}

.hkec-modal-type[data-type="technical-talent"] {
  border-left-color: #00a9b7;
}

.hkec-modal-description {
  margin: 0;
  color: #5e686f;
  font-size: 0.94rem;
  line-height: 1.8;
}

.hkec-modal-contact {
  display: flex;
  align-items: flex-start;
  flex-direction: column;
  gap: 10px;
  margin-top: 30px;
  padding: 24px;
  background: #f8f7f5;
  border-radius: 14px;
}

.hkec-modal-contact h3 {
  margin: 0 0 4px;
  color: #333f48;
  font-size: 0.7rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.hkec-modal-contact a {
  color: #005f86;
  font-size: 0.8rem;
  font-weight: 700;
  overflow-wrap: anywhere;
  text-underline-offset: 4px;
}

.hkec-modal-source {
  margin: 24px 0 0;
  color: #9cadb7;
  font-size: 0.64rem;
}

/* Tablet */

@media (max-width: 1024px) {
  .hkec-school-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

/* Mobile */

@media (max-width: 767px) {
  .hkec-school-grid {
    grid-template-columns: 1fr;
  }

  .hkec-school-grid .hkec-org-card {
    min-height: 210px;
    padding: 23px !important;
  }

  .hkec-school-heading-row {
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 10px;
  }

  .hkec-school-heading-row::after {
    display: none;
  }

  .hkec-school-heading {
    font-size: 1.35rem;
  }

  .hkec-school-count {
    grid-column: 2;
  }
}

@media (max-width: 600px) {
  .hkec-search-row {
    flex-direction: column;
  }

  .hkec-modal-content {
    padding: 48px 24px 28px;
  }
}
