/* Resource Hub — output by the [resource_hub] shortcode.
   Scoped under .resource-hub. Colors/spacing exposed as CSS vars so they can
   be themed without touching markup. Teal matches the CACH brand header. */
.resource-hub {
  --teal: #01706a;
  --teal-dark: #086456;
  --ink: #062647;
  --body-ink: #475569;
  --muted: #64748b;
  --line: #d8e0de;
  --card-bg: #ffffff;
  --page-max: 1200px;
  --gap: 2rem;

  font-family: Assistant, sans-serif;
  color: var(--ink);
}

/* ---------- Header band ------------------------------------------------ */
.resource-hub__header {
  position: relative;
  background: var(--teal);
  color: #fff;
  /* Angled bottom edge, echoing the Figma header. */
  clip-path: polygon(0 0, 100% 0, 100% 82%, 0 100%);
  padding: 3.5rem 0 5rem;
  margin-bottom: -2rem;
}
.resource-hub__header-inner {
  max-width: var(--page-max);
  margin: 0 auto;
  padding: 0 1.5rem;
}
.resource-hub__title {
  margin: 0 0 0.5rem;
  color: #fff !important;
  font-size: clamp(2rem, 4vw, 2.75rem);
  line-height: 1.1;
}
.resource-hub__lede {
  margin: 0 0 1.5rem;
  color: rgba(255, 255, 255, 0.9);
  font-size: 1rem;
}

/* ---------- Search ----------------------------------------------------- */
.resource-hub__search {
  position: relative;
  max-width: 720px;
}
.resource-hub__search-icon {
  position: absolute;
  left: 14px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--muted);
  font-size: 1.1rem;
  pointer-events: none;
}
.resource-hub__search-input {
  width: 100%;
  padding: 0.75rem 1rem 0.75rem 2.5rem;
  border: 1px solid transparent;
  border-radius: 6px;
  background: #fff;
  color: var(--ink);
  font-size: 1rem;
  line-height: 1.4;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
}
.resource-hub__search-input:focus {
  outline: none;
  border-color: var(--teal);
  box-shadow: 0 0 0 3px rgba(10, 125, 110, 0.25);
}

/* ---------- Standalone search ([resource_search]) --------------------- */
/* Same input look as the header search, but self-contained so it can sit in
   its own Divi section. Scoped OUTSIDE .resource-hub since it renders separately. */
.resource-search {
  position: relative;
  max-width: 720px;
  margin: 0;
}
.resource-search .resource-hub__search-icon {
  position: absolute;
  left: 14px;
  top: 50%;
  transform: translateY(-50%);
  color: #64748b;
  font-size: 1.1rem;
  pointer-events: none;
}
.resource-search .resource-hub__search-input {
  width: 100%;
  padding: 0.75rem 1rem 0.75rem 2.5rem;
  border: 1px solid #d8e0de;
  border-radius: 6px;
  background: #fff;
  color: #0f172a;
  font-size: 1rem;
  line-height: 1.4;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
}
.resource-search .resource-hub__search-input:focus {
  outline: none;
  border-color: #0a7d6e;
  box-shadow: 0 0 0 3px rgba(10, 125, 110, 0.25);
}

/* ---------- Tab bar ---------------------------------------------------- */
.resource-hub__tabs {
  position: sticky;
  top: 0;
  z-index: 10;
  display: flex;
  flex-wrap: wrap;
  gap: 0.25rem;
  max-width: var(--page-max);
  margin: 0 auto 2rem;
  padding: 0 1.5rem;
  background: #fff;
  border-bottom: 1px solid var(--line);
}
.resource-hub__tab {
  appearance: none;
  background: none;
  border: none;
  border-bottom: 2px solid transparent;
  margin-bottom: -1px;
  padding: 0.85rem 0.75rem;
  font-family: inherit;
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--body-ink);
  cursor: pointer;
  white-space: nowrap;
}
.resource-hub__tab:hover {
  color: var(--teal);
}
.resource-hub__tab.is-active {
  color: var(--teal);
  border-bottom-color: var(--teal);
}
.resource-hub__count {
  display: inline-block;
  margin-left: 0.15rem;
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--muted);
}
.resource-hub__tab.is-active .resource-hub__count {
  color: var(--teal);
}

/* ---------- Sections + grid ------------------------------------------- */
.resource-hub__results {
  max-width: var(--page-max);
  margin: 0 auto;
  padding: 0 1.5rem 3rem;
}
.resource-hub__section {
  margin-bottom: 3rem;
}
.resource-hub__section-head {
  margin-bottom: 1.5rem;
}
.resource-hub__section-title {
  margin: 0 0 0.25rem;
  font-size: 1.4rem;
  color: var(--ink);
}
.resource-hub__section-desc {
  margin: 0;
  color: var(--body-ink);
  font-size: 16px;
  font-style: normal;
  font-weight: 400;
  line-height: 20px;
}
.resource-hub__grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: var(--gap);
}
@media (max-width: 980px) {
  .resource-hub__grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}
@media (max-width: 600px) {
  .resource-hub__grid {
    grid-template-columns: 1fr;
  }
}

/* ---------- Card ------------------------------------------------------- */
.resource-card {
  display: flex;
  flex-direction: column;
  background: var(--card-bg);
  border: 1px solid var(--teal);
  border-radius: 6px;
  overflow: hidden;
}
.resource-card__media {
  aspect-ratio: 16 / 10;
  border-bottom: 1px solid var(--teal);
  background: #fff;
  overflow: hidden;
}
.resource-card__media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.resource-card__body {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 10px;
  padding: 1.1rem 1.25rem 1.25rem;
  flex: 1 1 auto;
}
h3.resource-card__title {
  padding-bottom: 0;
}

.resource-card__title {
  margin: 0;
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--ink);
}
.resource-card__desc {
  margin: 0;
  color: var(--body-ink);
  font-size: 16px;
  font-style: normal;
  font-weight: 400;
  line-height: 20px;
}
.resource-card__download {
  margin-top: auto;
  display: flex;
  padding: 7px 14px;
  justify-content: center;
  align-items: center;
  gap: 10px;
  background: var(--teal);
  color: #fff !important;
  font-size: 16px;
  font-style: normal;
  font-weight: 700;
  line-height: 20px;
  text-decoration: none;
}
.resource-card__download:hover {
  background: var(--teal-dark);
}

/* JS hide toggle — beats the author display:flex/grid rules above that would
   otherwise override the UA [hidden] rule. */
.resource-hub .resource-hub__is-hidden {
  display: none !important;
}

/* ---------- Empty states ---------------------------------------------- */
.resource-hub__no-results,
.resource-hub__empty {
  color: var(--body-ink);
  font-style: italic;
}
