/**
 * @file
 * Resource Hub listing page styling (resource_hub_listing view, page_1).
 *
 * Covers the whole listing region, not just the row variants: the exposed
 * filter form, the results list, the per-row treatments produced by
 * resource_hub_preprocess_views_view_fields() (resource_hub module), and the
 * mini-pager. Attached by resource_hub on the view via hook_views_pre_render.
 *
 * Everything here is scoped under the view's `resource-hub-listing` wrapper
 * class (Views css_class) or the BEM `hub-row*` classes so it cannot leak onto
 * the rest of the site. Colors and fonts follow the ahla_v2 brand palette
 * (brand red #b30125, ink #232323, navy #02254a) used across the theme.
 *
 * Design Component 7 / Component 8; Requirements 11.4, 12.2, 14.1.
 */

.toolbar-fixed .resource-hub-listing {
  --rh-sticky-offset: 80px;
}

.resource-hub-listing {
  /* Component-scoped tokens so the palette/spacing stay consistent and easy
     to tune. The theme has no global custom properties, so these are local. */
  --rh-brand: #b30125;
  --rh-ink: #232323;
  --rh-muted: #707070;
  --rh-border: #e4e4e4;
  --rh-navy: #02254a;
  --rh-surface: #f5f5f5;
  --rh-radius: 6px;
  --rh-sticky-offset: 0;

  max-width: 1180px;
  margin: 0 auto;
  padding: 0 1rem;
  color: var(--rh-ink);
  font-family: "Poppins", "Helvetica Neue", Arial, sans-serif;
}

/* -------------------------------------------------------------------------
 * Exposed filter bar.
 *
 * Both View displays render the same stable form wrapper, but their controls
 * differ by display configuration. The desktop/tablet presentation is a dark
 * navy horizontal bar. Its opaque background and sticky positioning keep the
 * active controls readable above long result lists; the mobile media query
 * below restores normal document flow and stacks controls.
 * ---------------------------------------------------------------------- */
.resource-hub-listing .resource-hub-filter-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  gap: 0.9rem 1rem;
  margin-bottom: 1.5rem;
  padding: 1.25rem;
  background: var(--rh-navy);
  border: 1px solid var(--rh-navy);
  border-radius: var(--rh-radius);
  color: #fff;

  /* Sticky at the established desktop/tablet widths. The mobile override
     below intentionally returns the filter bar to normal document flow. */
  position: -webkit-sticky;
  position: sticky;
  top: var(--rh-sticky-offset);
  z-index: 20;
}

.resource-hub-listing .resource-hub-filter-bar .form-item {
  flex: 1 1 170px;
  min-width: 0;
  margin: 0;
}

.resource-hub-listing .resource-hub-filter-bar label {
  display: block;
  margin-bottom: 0.35rem;
  color: #fff;
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.resource-hub-listing .resource-hub-filter-bar input[type="text"],
.resource-hub-listing .resource-hub-filter-bar input[type="search"],
.resource-hub-listing .resource-hub-filter-bar select {
  width: 100%;
  box-sizing: border-box;
  min-height: 2.55rem;
  padding: 0.5rem 0.65rem;
  border: 1px solid transparent;
  border-radius: 3px;
  background-color: #fff;
  color: var(--rh-ink);
  font: inherit;
}

.resource-hub-listing .resource-hub-filter-bar input[type="checkbox"] {
  width: 1rem;
  height: 1rem;
  margin-right: 0.4rem;
  accent-color: var(--rh-brand);
}

.resource-hub-listing .resource-hub-filter-bar input:focus-visible,
.resource-hub-listing .resource-hub-filter-bar select:focus-visible,
.resource-hub-listing .resource-hub-filter-bar a:focus-visible {
  outline: 3px solid #fff;
  outline-offset: 2px;
  box-shadow: 0 0 0 5px rgba(179, 1, 37, 0.75);
}

/* BEF's single checkbox keeps its accessible label beside the control rather
   than using the standard stacked input layout. */
.resource-hub-listing .resource-hub-filter-bar .bef-checkboxes,
.resource-hub-listing .resource-hub-filter-bar .form-type-checkbox {
  display: flex;
  align-items: center;
  min-height: 2.55rem;
}

.resource-hub-listing .resource-hub-filter-bar .bef-checkboxes label,
.resource-hub-listing .resource-hub-filter-bar .form-type-checkbox label {
  margin: 0;
  color: #fff;
  font-size: 0.8125rem;
  font-weight: 600;
  letter-spacing: 0;
  text-transform: none;
}

/* Clear All remains visible even when no filter is active. Apply is hidden by
   BEF auto-submit, while this reset action restores only the active display's
   configured controls. */
.resource-hub-listing .resource-hub-filter-bar .form-actions {
  display: flex;
  flex: 0 0 auto;
  align-items: flex-end;
  min-height: 2.55rem;
  margin: 0;
}

.resource-hub-listing .resource-hub-filter-bar .form-actions input,
.resource-hub-listing .resource-hub-filter-bar .form-actions button,
.resource-hub-listing .resource-hub-filter-bar .form-actions a {
  min-height: 2.55rem;
  padding: 0.5rem 1rem;
  border: 1px solid #fff;
  border-radius: 3px;
  background: transparent;
  color: #fff;
  font: inherit;
  font-weight: 700;
  line-height: 1.4;
  text-decoration: none;
  cursor: pointer;
}

.resource-hub-listing .resource-hub-filter-bar .form-actions input:hover,
.resource-hub-listing .resource-hub-filter-bar .form-actions button:hover,
.resource-hub-listing .resource-hub-filter-bar .form-actions a:hover,
.resource-hub-listing .resource-hub-filter-bar .form-actions a:focus-visible {
  background: #fff;
  color: var(--rh-navy);
  text-decoration: none;
}

/* -------------------------------------------------------------------------
 * Full matched-result status.
 *
 * This element sits outside the Views Infinite Scroll content wrapper. Filter
 * AJAX replaces it with the newly matched total; page append AJAX leaves the
 * one existing full-total status in place instead of counting loaded rows.
 * ---------------------------------------------------------------------- */
.resource-hub-listing .resource-hub-listing__status {
  margin: 0 0 1rem;
  color: var(--rh-navy);
  font-size: 0.9375rem;
  font-weight: 600;
  line-height: 1.4;
}

/* -------------------------------------------------------------------------
 * Results list and presentation-ready cards.
 * ---------------------------------------------------------------------- */
.resource-hub-listing .views-row {
  margin: 0 0 2rem;
}

.hub-row {
  box-sizing: border-box;
  padding: 1.25rem;
  border-radius: var(--rh-radius);
  background: #fff;
  box-shadow: 0 6px 15px rgba(0, 0, 0, 0.1);
}

.hub-row__header,
.hub-row__header-meta,
.hub-row__meta {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.hub-row__header {
  justify-content: space-between;
}

.hub-row__header-meta {
  justify-content: flex-end;
  flex-wrap: wrap;
}

.hub-row__type,
.hub-row__topic-labels {
  color: #555;
  font-size: 0.875rem;
  font-weight: 600;
  letter-spacing: 0.01em;
  text-transform: uppercase;
}

.hub-row__author {
  color: var(--rh-muted);
  font-size: 0.875rem;
  font-weight: 500;
}

/* Linked author names remain visually distinct while sharing row metadata. */
.hub-row__author .resource-hub-author__link {
  color: var(--rh-brand);
  /* text-decoration: underline; */
  text-decoration-thickness: 1px;
  text-underline-offset: 0.15em;
}

.hub-row__author .resource-hub-author__link:hover,
.hub-row__author .resource-hub-author__link:focus-visible {
  color: var(--rh-brand);
  text-decoration-thickness: 2px;
}

.hub-row__new {
  padding: 0.2rem 0.65rem;
  border: 1px solid rgba(22, 179, 1, 0.5);
  border-radius: 999px;
  background: rgba(22, 179, 1, 0.1);
  color: #168b01;
  font-size: 0.75rem;
  font-weight: 600;
  line-height: 1;
}

/**
 * Normalize the canonical and outbound title render arrays without modifying
 * either destination or its GTM/outbound attributes.
 */
.hub-row__title {
  margin-top: 0.75rem;
  color: #072c45;
  font-family: "Playfair Display", Georgia, serif;
  font-size: 1.5rem;
  font-weight: 700;
  line-height: 1.1;
}

.hub-row__title h3,
.hub-row__title .resource-hub-listing__title {
  margin: 0;
  font: inherit;
  color: inherit;
}

.hub-row__title a {
  color: inherit;
  text-decoration: none;
}

.hub-row__title a:hover,
.hub-row__title a:focus-visible {
  color: var(--rh-brand);
  text-decoration: underline;
}

.hub-row__teaser {
  display: -webkit-box;
  margin-top: 0.6rem;
  overflow: hidden;
  color: var(--rh-ink);
  font-size: 1rem;
  line-height: 1.5;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}

.hub-row__divider {
  height: 1px;
  margin: 1rem 0 0.75rem;
  background: var(--rh-border);
}

.hub-row__meta {
  justify-content: space-between;
  color: var(--rh-muted);
  font-size: 0.875rem;
  line-height: 1.4;
}

.hub-row__metadata {
  display: flex;
  flex: 1 1 auto;
  flex-wrap: wrap;
  gap: 0.4rem 0.75rem;
  min-width: 0;
}

.hub-row__date {
  font-style: italic;
}

.hub-row__lock {
  flex: 0 0 auto;
  color: var(--rh-navy);
  font-size: 1.25rem;
}

/**
 * Featured state is strictly topic-scoped in preprocessing; these visual
 * rules do not affect the View's fixed Hub_Date descending sort.
 */
.hub-row--featured {
  border-left: 7px solid var(--rh-brand);
  background: linear-gradient(90deg, rgba(179, 1, 37, 0.07), rgba(179, 1, 37, 0) 45%), #fff;
}

/**
 * Standardized outbound-arrow indicator. Attached via a stable class rather
 * than inline markup so it can be styled/targeted once (Requirement 14.1).
 */
.hub-row__outbound-link::after {
  content: "\e82c"; /* Feather's arrow-up-right glyph. */
  display: inline-block;
  margin-left: 0.25rem;
  font-family: feather;
  font-size: 0.85em;
  font-style: normal;
  font-weight: normal;
  line-height: 1;
  text-decoration: none;
}

/* -------------------------------------------------------------------------
 * Topic header pinned region.
 * The same hub-row vocabulary is reused inside a responsive two-up region;
 * cards stack naturally on narrow screens.
 * ---------------------------------------------------------------------- */
.resource-hub-topic-header__pinned-region {
  margin: 1.5rem -2rem -2rem;
  padding: 1.75rem 2rem 2rem;
  overflow: hidden;
  background-color: #eaf5ff;
  background-image: url("../img/resource-hub-pinned-background.svg"), linear-gradient(78deg, #ebf5ff 0.7%, #a1d0ff 99.7%);
  background-position: center, center;
  background-repeat: no-repeat, no-repeat;
  background-size: auto 180%, cover;
}

.resource-hub-topic-header__pinned-heading {
  margin: 0 0 1.25rem;
  color: var(--rh-ink);
  font-family: "Playfair Display", Georgia, serif;
  font-size: 1.5625rem;
  font-weight: 700;
  line-height: 1.1;
}

.resource-hub-topic-header__pinned {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1.25rem;
}

.resource-hub-topic-header__pinned .hub-row--pinned {
  box-sizing: border-box;
  min-width: 0;
  padding: 1.875rem;
  border: 0;
  border-left: 7px solid var(--rh-brand);
  border-radius: 4px;
  background: #fff;
  box-shadow: 0 6px 15px rgba(0, 0, 0, 0.1);
}

/* -------------------------------------------------------------------------
 * Mini pager.
 * ---------------------------------------------------------------------- */
.resource-hub-listing .pager {
  margin-top: 1.5rem;
}

.resource-hub-listing .pager__items {
  display: flex;
  gap: 0.5rem;
  align-items: center;
  justify-content: center;
  list-style: none;
  margin: 0;
  padding: 0;
}

.resource-hub-listing .pager__item a {
  display: inline-block;
  padding: 0.4rem 0.8rem;
  border: 1px solid var(--rh-border);
  border-radius: var(--rh-radius);
  color: var(--rh-navy);
  text-decoration: none;
  font-weight: 600;
}

.resource-hub-listing .pager__item a:hover,
.resource-hub-listing .pager__item a:focus-visible {
  border-color: var(--rh-brand);
  color: var(--rh-brand);
}

/* Views AJAX appends its fullscreen progress element directly to <body>, not
 * inside the pager. On Resource Hub pages, replace that default circle with a
 * fixed, clearly labelled loading toast. */
body:has(.resource-hub-listing) .ajax-progress-fullscreen {
  align-items: center;
  bottom: 1.5rem;
  box-sizing: border-box;
  display: inline-flex !important;
  height: auto !important;
  left: 50%;
  max-width: calc(100vw - 2rem);
  min-height: 4.75rem;
  opacity: 1;
  padding: 0.9rem 1.25rem;
  position: fixed;
  top: auto !important;
  transform: translateX(-50%);
  width: auto !important;
  z-index: 1000;
  border: 1px solid #d7a3af;
  border-radius: 6px;
  background: #f5f5f5 none;
  box-shadow: 0 6px 15px rgba(35, 35, 35, 0.15);
}

body:has(.resource-hub-listing) .ajax-progress-fullscreen::before {
  animation: resource-hub-loader-spin 0.75s linear infinite;
  border: 4px solid rgba(2, 37, 74, 0.18);
  border-radius: 50%;
  border-top-color: #a52a42;
  box-sizing: border-box;
  content: "";
  flex: 0 0 2.75rem;
  height: 2.75rem;
  width: 2.75rem;
}

body:has(.resource-hub-listing) .ajax-progress-fullscreen::after {
  color: #02254a;
  content: "Loading more resources…";
  font-family: "Poppins", "Helvetica Neue", Arial, sans-serif;
  font-size: 1rem;
  font-weight: 700;
  margin-left: 1rem;
  white-space: nowrap;
}

@keyframes resource-hub-loader-spin {
  to {
    transform: rotate(360deg);
  }
}

@media (prefers-reduced-motion: reduce) {
  body:has(.resource-hub-listing) .ajax-progress-fullscreen::before {
    animation: none;
  }
}

/* -------------------------------------------------------------------------
 * Small screens.
 * ---------------------------------------------------------------------- */
@media (max-width: 767px) {
  .resource-hub-topic-header__pinned-region {
    margin: 1.25rem -1.25rem -1.25rem;
    padding: 1.5rem 1.25rem;
    background-position: center, center;
    background-size: auto 145%, cover;
  }

  .resource-hub-topic-header__pinned {
    grid-template-columns: 1fr;
  }

  .resource-hub-topic-header__pinned .hub-row--pinned {
    padding: 1.25rem;
    border-left-width: 5px;
  }

  .resource-hub-listing .resource-hub-filter-bar {
    flex-direction: column;
    align-items: stretch;
    padding: 1rem;

    /* Mobile controls are deliberately non-sticky: the full stacked form stays
       in normal document flow so it cannot conceal the topic header or rows. */
    position: static;
    top: auto;
  }

  .resource-hub-listing .resource-hub-filter-bar .form-item,
  .resource-hub-listing .resource-hub-filter-bar .form-actions {
    width: 100%;
    flex: 1 1 auto;
  }

  .resource-hub-listing .resource-hub-filter-bar .form-actions input,
  .resource-hub-listing .resource-hub-filter-bar .form-actions button {
    width: 100%;
  }

  .hub-row {
    padding: 1.25rem;
  }

  .hub-row__header,
  .hub-row__meta {
    align-items: flex-start;
    flex-direction: column;
  }

  .hub-row__header-meta {
    justify-content: flex-start;
  }

  .hub-row__meta {
    gap: 0.6rem;
  }

  .hub-row__lock {
    align-self: flex-end;
  }

  .hub-row--featured {
    border-left-width: 5px;
  }
}

/* -------------------------------------------------------------------------
 * Topic detail header.
 * The area plugin supplies this component ahead of the shared listing/filter
 * surface. It keeps Topic_Type, count, Updated date, long description, and
 * the optional alert in the approved semantic hierarchy.
 * ---------------------------------------------------------------------- */
.resource-hub-topic-header {
  --rh-brand: #b30125;
  --rh-ink: #232323;
  --rh-border: #e4e4e4;
  --rh-navy: #02254a;
  margin: 0 0 2rem;
  padding: 2rem;
  border: 1px solid var(--rh-border);
  background: #fff;
}

.resource-hub-topic-header__type,
.resource-hub-topic-header__metadata,
.resource-hub-topic-header__metadata-item {
  display: flex;
  align-items: center;
}

.resource-hub-topic-header__type {
  gap: 0.55rem;
  color: var(--rh-navy);
  font-size: 0.8125rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.resource-hub-topic-header__type-icon-wrapper {
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.resource-hub-topic-header__type-icon {
  display: block;
  width: 2rem;
  height: 2rem;
  object-fit: contain;
}

.resource-hub-topic-header__title {
  margin: 0.6rem 0 0;
  color: var(--rh-navy);
  font-family: "Playfair Display", Georgia, serif;
  font-size: clamp(2rem, 4vw, 3.25rem);
  line-height: 1.08;
  overflow-wrap: anywhere;
}

.resource-hub-topic-header__description {
  margin-top: 1rem;
  /* border-bottom: 1px solid var(--rh-border); */
}

.resource-hub-topic-header__description-summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.75rem 0;
  color: var(--rh-navy);
  cursor: pointer;
  font-weight: 700;
  list-style: none;
}

.resource-hub-topic-header__description-summary::-webkit-details-marker {
  display: none;
}

.resource-hub-topic-header__description-summary::after {
  content: "+";
  flex: 0 0 auto;
  font-size: 1.35rem;
  line-height: 1;
}

.resource-hub-topic-header__description[open] .resource-hub-topic-header__description-summary::after {
  content: "−";
}

.resource-hub-topic-header__description-summary:focus-visible {
  outline: 3px solid rgba(179, 1, 37, 0.45);
  outline-offset: 3px;
}

.resource-hub-topic-header__description-content {
  padding: 0 0 1rem;
  color: var(--rh-ink);
  line-height: 1.65;
}

.resource-hub-topic-header__metadata {
  flex-wrap: wrap;
  gap: 0.5rem 1.25rem;
  margin-top: 1.25rem;
  color: var(--rh-navy);
  font-size: 0.9375rem;
  font-weight: 600;
}

.resource-hub-topic-header__metadata-item {
  gap: 0.45rem;
}

.resource-hub-topic-header__metadata-icon {
  color: var(--rh-brand);
}

.resource-hub-topic-header__alert {
  margin-top: 1.25rem;
  padding: 1rem 1.15rem;
  border-left: 4px solid var(--rh-brand);
  background: #f9eded;
  color: var(--rh-ink);
  line-height: 1.55;
}

.resource-hub-topic-header__alert > :first-child {
  margin-top: 0;
}

.resource-hub-topic-header__alert > :last-child {
  margin-bottom: 0;
}

@media (max-width: 767px) {
  .resource-hub-topic-header {
    padding: 1.25rem;
  }

  .resource-hub-topic-header__metadata {
    align-items: flex-start;
    flex-direction: column;
    gap: 0.65rem;
  }
}

/* -------------------------------------------------------------------------
 * Figma topic-detail composition.
 * ---------------------------------------------------------------------- */
.resource-hub-listing--topic {
  max-width: 86.25rem;
  padding: 0;
}

.resource-hub-listing--topic .resource-hub-listing__header {
  margin: 0;
}

.resource-hub-listing--topic .resource-hub-topic-header {
  margin: 0 calc(50% - 50vw);
  padding: 3.125rem 1.5rem 4.375rem;
  border: 0;
  background: var(--rh-surface);
}

.resource-hub-topic-header__content,
.resource-hub-topic-featured__content,
.resource-hub-filter-bar__inner {
  width: min(100%, 86.25rem);
  margin: 0 auto;
}

.resource-hub-topic-header__title {
  margin: 0;
  color: var(--rh-navy);
  font-family: "Playfair Display", Georgia, serif;
  font-size: clamp(2.75rem, 3.61vw, 4.375rem);
  font-weight: 700;
  line-height: 1.1;
}

.resource-hub-topic-header__description {
  margin-top: 1.5625rem;
  color: #181818;
  font-size: 1.25rem;
  font-weight: 400;
  line-height: 1.5;
}

.resource-hub-topic-header__description > :first-child {
  margin-top: 0;
}

.resource-hub-topic-header__description > :last-child {
  margin-bottom: 0;
}

.resource-hub-topic-header__metadata {
  justify-content: space-between;
  gap: 1.25rem;
  margin-top: 1.5625rem;
  color: #181818;
  font-size: 1.25rem;
  font-weight: 500;
}

.resource-hub-topic-header__metadata-item {
  gap: 0.1875rem;
}

.resource-hub-topic-header__metadata-icon {
  width: 2.125rem;
  color: var(--rh-brand);
  font-size: 1.625rem;
  text-align: center;
}

.resource-hub-topic-header__alert {
  display: flex;
  gap: 1.25rem;
  align-items: flex-start;
  margin-top: 1.5625rem;
  padding: 1.25rem;
  border: 1px solid #d57387;
  border-radius: 0.125rem;
  background: #f7e6e9;
  color: var(--rh-brand);
  font-size: 1.25rem;
  font-weight: 600;
  line-height: 1.5;
}

.resource-hub-topic-header__alert-icon {
  display: inline-flex;
  flex: 0 0 2.125rem;
  align-items: center;
  justify-content: center;
  width: 2.125rem;
  height: 2.125rem;
  border: 2px solid currentColor;
  border-radius: 50%;
  font-weight: 700;
  line-height: 1;
}

.resource-hub-topic-header__alert-content {
  min-width: 0;
}

.resource-hub-topic-header__alert-content > :first-child {
  margin-top: 0;
}

.resource-hub-topic-header__alert-content > :last-child {
  margin-bottom: 0;
}

/* The topic filter band spans the viewport, but all controls retain the
   approved 1,380px content column. */
.resource-hub-listing--topic .resource-hub-filter-bar {
  margin: 0 calc(50% - 50vw);
  padding: 2.125rem 1.5rem;
  border: 0;
  border-radius: 0;
  background: #03254a;
}

.resource-hub-listing--topic .resource-hub-filter-bar__inner {
  display: grid;
  grid-template-columns: max-content minmax(0, 1fr) max-content max-content;
  gap: 1.875rem;
  align-items: center;
}

.resource-hub-listing--topic .resource-hub-filter-bar__heading {
  margin: 0;
  color: #fff;
  font-family: "Playfair Display", Georgia, serif;
  font-size: 1.5625rem;
  font-weight: 700;
  line-height: 1.1;
}

.resource-hub-listing--topic .resource-hub-filter-bar__selects {
  display: flex;
  gap: 1.875rem;
  min-width: 0;
}

.resource-hub-listing--topic .resource-hub-filter-bar .form-item {
  flex: 0 1 18.75rem;
  width: 18.75rem;
  margin: 0;
}

.resource-hub-listing--topic .resource-hub-filter-bar label {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}

.resource-hub-listing--topic .resource-hub-filter-bar select {
  min-height: 3rem;
  padding: 0.625rem 2.75rem 0.625rem 1.25rem;
  border: 0;
  border-radius: 0.25rem;
  box-shadow: 0 0.5rem 0.71875rem rgba(0, 0, 0, 0.14);
  color: #181818;
  font-size: 1rem;
  font-weight: 500;
}

.resource-hub-listing--topic .resource-hub-filter-bar__actions {
  justify-self: end;
}

.resource-hub-listing--topic .resource-hub-filter-bar .form-actions {
  display: block;
  min-height: 0;
}

.resource-hub-listing--topic .resource-hub-filter-bar .form-actions a {
  min-height: 0;
  padding: 0;
  border: 0;
  color: #fff;
  font-size: 1rem;
  font-weight: 500;
  text-decoration: underline;
}

.resource-hub-listing--topic .resource-hub-filter-bar .form-actions a:hover,
.resource-hub-listing--topic .resource-hub-filter-bar .form-actions a:focus-visible {
  background: transparent;
  color: #fff;
}

.resource-hub-listing--topic .resource-hub-filter-bar__members-only .form-item {
  display: flex;
  align-items: center;
  width: auto;
}

.resource-hub-listing--topic .resource-hub-filter-bar__members-only .form-type-checkbox,
.resource-hub-listing--topic .resource-hub-filter-bar__members-only .bef-checkboxes {
  min-height: 0;
}

.resource-hub-listing--topic .resource-hub-filter-bar__members-only label {
  position: static;
  width: auto;
  height: auto;
  overflow: visible;
  clip: auto;
  color: #fff;
  font-size: 16px;
  font-weight: 500;
  line-height: 24px;
  white-space: nowrap;
}

.resource-hub-listing--topic .resource-hub-filter-bar input[type="checkbox"] {
  width: 1.375rem;
  height: 1.375rem;
  margin-right: 0.5625rem;
  accent-color: #fff;
}

/* Featured pins are a View footer so the section appears after filters but
   ahead of result status and ordinary rows. */
.resource-hub-topic-featured {
  margin: 0 calc(50% - 50vw) 3.25rem;
  padding: 2.625rem 1.5rem 4rem;
  overflow: hidden;
  background-color: #eaf5ff;
  background-image: url("../img/resource-hub-pinned-background.svg"), linear-gradient(78deg, #ebf5ff 0.7%, #a1d0ff 99.7%);
  background-position: center, center;
  background-repeat: no-repeat, no-repeat;
  background-size: auto 180%, cover;
}

.resource-hub-topic-featured__heading {
  margin: 0 0 1.5625rem;
  color: #181818;
  font-family: "Playfair Display", Georgia, serif;
  font-size: 1.5625rem;
  font-weight: 700;
  line-height: 1.1;
}

.resource-hub-topic-featured__cards {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1.8125rem;
}

.resource-hub-listing--topic .hub-row {
  min-height: 18.6875rem;
  padding: 1.875rem;
  border-radius: 0.25rem;
  box-shadow: 0 0.375rem 0.9375rem rgba(0, 0, 0, 0.1);
}

.resource-hub-listing--topic .hub-row--pinned {
  min-width: 0;
  border-left: 0.4375rem solid var(--rh-brand);
}

.resource-hub-listing--topic .hub-row__header {
  align-items: flex-start;
}

.resource-hub-listing--topic .hub-row__header,
.resource-hub-listing--topic .hub-row__header-meta,
.resource-hub-listing--topic .hub-row__meta {
  gap: 1.25rem;
}

.resource-hub-listing--topic .hub-row__type,
.resource-hub-listing--topic .hub-row__topic-labels,
.resource-hub-listing--topic .hub-row__author {
  color: #555;
  font-size: 1rem;
  font-weight: 500;
}

.resource-hub-listing--topic .hub-row__type,
.resource-hub-listing--topic .hub-row__topic-labels {
  letter-spacing: -0.01em;
}

.resource-hub-listing--topic .hub-row__type {
  word-break: normal;
}

.resource-hub-listing--topic .hub-row__author {
  color: var(--rh-muted);
}

.resource-hub-listing--topic .hub-row__new {
  padding: 0.375rem 0.75rem;
  color: #16b301;
  font-size: 0.875rem;
}

.resource-hub-listing--topic .hub-row__title {
  margin-top: 1.25rem;
  font-size: 2rem;
}

.resource-hub-listing--topic .hub-row__teaser {
  margin-top: 0.625rem;
  color: #181818;
  font-size: 1.25rem;
  line-height: 1.5;
  -webkit-line-clamp: 2;
}

.resource-hub-listing--topic .hub-row__divider {
  display: none;
}

.resource-hub-listing--topic .hub-row__meta {
  align-items: flex-end;
  margin-top: 1.25rem;
  color: #181818;
  font-size: 1.125rem;
}

.resource-hub-listing--topic .hub-row__metadata {
  gap: 0.3125rem 0.75rem;
}

.resource-hub-listing--topic .hub-row__lock {
  color: var(--rh-brand);
  font-size: 2rem;
}

.resource-hub-listing--topic .hub-row--featured {
  border-left: 0.4375rem solid var(--rh-brand);
  background: linear-gradient(101deg, rgba(234, 245, 255, 0.3) 1.7%, rgba(167, 211, 255, 0.3) 100%), #fff;
}

.resource-hub-listing--topic .resource-hub-listing__status {
  margin: 3rem 0 2.3125rem;
  color: #181818;
  font-family: "Playfair Display", Georgia, serif;
  font-size: 1.5625rem;
  font-weight: 700;
  line-height: 1.1;
}

@media (max-width: 767px) {
  .resource-hub-listing--topic {
    padding: 0;
  }

  .resource-hub-listing--topic .resource-hub-topic-header {
    padding: 2.5rem 1.25rem 3rem;
  }

  .resource-hub-topic-header__title {
    font-size: 2.5rem;
  }

  .resource-hub-topic-header__description,
  .resource-hub-topic-header__metadata,
  .resource-hub-topic-header__alert {
    font-size: 1rem;
  }

  .resource-hub-topic-header__metadata {
    align-items: flex-start;
    flex-direction: column;
  }

  .resource-hub-listing--topic .resource-hub-filter-bar {
    padding: 1.5rem 1.25rem;
  }

  .resource-hub-listing--topic .resource-hub-filter-bar__inner,
  .resource-hub-listing--topic .resource-hub-filter-bar__selects {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    align-items: stretch;
  }

  .resource-hub-listing--topic .resource-hub-filter-bar__heading {
    font-size: 1.375rem;
  }

  .resource-hub-listing--topic .resource-hub-filter-bar .form-item {
    width: 100%;
  }

  .resource-hub-listing--topic .resource-hub-filter-bar__actions,
  .resource-hub-listing--topic .resource-hub-filter-bar__members-only {
    align-self: flex-start;
  }

  .resource-hub-topic-featured {
    margin-bottom: 2.5rem;
    padding: 2.5rem 1.25rem;
    background-size: auto 145%, cover;
  }

  .resource-hub-topic-featured__cards {
    grid-template-columns: 1fr;
  }

  .resource-hub-listing--topic .hub-row {
    min-height: 0;
    padding: 1.25rem;
  }

  .resource-hub-listing--topic .hub-row__header,
  .resource-hub-listing--topic .hub-row__meta {
    align-items: flex-start;
    flex-direction: column;
  }

  .resource-hub-listing--topic .hub-row__title {
    font-size: 1.625rem;
  }

  .resource-hub-listing--topic .hub-row__teaser {
    font-size: 1rem;
  }
}

/* Figma values are specified in pixels. The base theme uses a 14px root,
   so keep the topic-detail scale independent of that global typography. */
.resource-hub-listing--topic {
  width: min(80vw, 1380px);
  max-width: none;
}

.resource-hub-topic-header__content,
.resource-hub-topic-featured__content,
.resource-hub-filter-bar__inner {
  width: min(80vw, 1380px);
}

.resource-hub-listing--topic .resource-hub-topic-header {
  padding-top: 50px;
  padding-bottom: 70px;
}

.resource-hub-topic-header__description,
.resource-hub-topic-header__metadata,
.resource-hub-topic-header__alert {
  font-size: 20px;
}

.resource-hub-topic-header__metadata-icon {
  width: 34px;
  font-size: 26px;
}

.resource-hub-topic-header__alert {
  gap: 20px;
  padding: 20px;
}

.resource-hub-topic-header__alert-icon {
  flex-basis: 34px;
  width: 34px;
  height: 34px;
}

.resource-hub-listing--topic .resource-hub-filter-bar {
  padding-top: 32px;
  padding-bottom: 32px;
}

.resource-hub-listing--topic .resource-hub-filter-bar__inner {
  gap: 30px;
}

.resource-hub-listing--topic .resource-hub-filter-bar__selects {
  gap: 30px;
}

.resource-hub-listing--topic .resource-hub-filter-bar .form-item {
  width: 300px;
}

.resource-hub-listing--topic .resource-hub-filter-bar select {
  min-height: 48px;
  padding: 10px 44px 10px 20px;
}

.resource-hub-listing--topic .resource-hub-filter-bar__members-only .description {
  display: none;
}

.resource-hub-topic-featured {
  padding-top: 42px;
  padding-bottom: 64px;
}

.resource-hub-topic-featured__heading,
.resource-hub-listing--topic .resource-hub-listing__status {
  font-size: 25px;
}

.resource-hub-topic-featured__heading {
  margin-bottom: 25px;
}

.resource-hub-topic-featured__cards {
  gap: 29px;
}

.resource-hub-listing--topic .hub-row {
  min-height: 299px;
  padding: 30px;
}

.resource-hub-listing--topic .hub-row__header,
.resource-hub-listing--topic .hub-row__header-meta,
.resource-hub-listing--topic .hub-row__meta {
  gap: 20px;
}

.resource-hub-listing--topic .hub-row__type,
.resource-hub-listing--topic .hub-row__topic-labels,
.resource-hub-listing--topic .hub-row__author {
  font-size: 16px;
}

.resource-hub-listing--topic .hub-row__new {
  font-size: 14px;
}

.resource-hub-listing--topic .hub-row__title {
  margin-top: 20px;
  font-size: 32px;
}

.resource-hub-listing--topic .hub-row__teaser {
  margin-top: 10px;
  font-size: 20px;
}

.resource-hub-listing--topic .hub-row__meta {
  margin-top: 20px;
  font-size: 18px;
}

.resource-hub-listing--topic .hub-row__lock {
  font-size: 32px;
}

/* The Figma desktop composition uses a control cluster of 300px selects, a
   clear link, then a right-aligned member filter. The selects sit in their own
   content-sized track so they keep 300px whenever the bar has room, and only
   share the track evenly once a third select (the topic page's subtopics)
   would otherwise push the cluster past the content width. */
@media (min-width: 768px) {
  .resource-hub-topic-header__title {
    font-size: 70px;
  }

  .resource-hub-topic-header__description,
  .resource-hub-topic-header__metadata,
  .resource-hub-topic-header__alert {
    margin-top: 25px;
  }

  .resource-hub-listing--topic .resource-hub-filter-bar__inner {
    grid-template-columns: 79px minmax(0, max-content) max-content minmax(max-content, 1fr);
  }

  .resource-hub-listing--topic .resource-hub-filter-bar__heading {
    font-size: 25px;
  }

  .resource-hub-listing--topic .resource-hub-filter-bar .form-item {
    flex: 0 1 300px;
    width: 300px;
    min-width: 0;
  }

  .resource-hub-listing--topic .resource-hub-filter-bar select {
    height: 48px;
    min-height: 48px;
    margin: 0;
    font-size: 16px;
  }

  .resource-hub-listing--topic .resource-hub-filter-bar .form-actions {
    margin: 0;
  }

  .resource-hub-listing--topic .resource-hub-filter-bar__members-only {
    justify-self: end;
  }

  .resource-hub-listing--topic .resource-hub-filter-bar__members-only .form-item {
    width: auto;
  }
}

@media (max-width: 767px) {
  .resource-hub-listing--topic,
  .resource-hub-topic-header__content,
  .resource-hub-topic-featured__content,
  .resource-hub-filter-bar__inner {
    width: 100%;
  }

  /* Desktop uses a 300px flex basis for horizontal filter controls. Reset it
     when the controls stack so it cannot become an unintended row height. */
  .resource-hub-listing--topic .resource-hub-filter-bar__inner,
  .resource-hub-listing--topic .resource-hub-filter-bar__selects {
    gap: 1rem;
  }

  .resource-hub-listing--topic .resource-hub-filter-bar .form-item,
  .resource-hub-listing--topic .resource-hub-filter-bar .form-actions {
    flex: 0 1 auto;
    width: 100%;
    margin: 0;
  }

  .resource-hub-listing--topic .resource-hub-filter-bar__members-only .form-item {
    width: auto;
  }

  /* The exposed-form display class is assigned by the module and is stable
     independently of the View wrapper. Keep the topic controls content-sized
     when stacked, even if a cached wrapper does not carry its modifier. */
  .resource-hub-filter-bar--page_topic .resource-hub-filter-bar__inner,
  .resource-hub-filter-bar--page_topic .resource-hub-filter-bar__selects {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    align-items: stretch;
  }

  .resource-hub-filter-bar--page_topic.resource-hub-filter-bar .resource-hub-filter-bar__selects .form-item {
    flex: 0 0 auto !important;
    width: 100% !important;
    min-height: 0;
    margin: 0;
  }

  .resource-hub-filter-bar--page_topic .resource-hub-filter-bar__actions .form-actions {
    width: auto;
    margin: 0;
  }

  .resource-hub-filter-bar--page_topic .resource-hub-filter-bar__members-only .form-item {
    width: auto;
    margin: 0;
  }

  .resource-hub-listing--topic .hub-row {
    min-height: 0;
    padding: 20px;
  }

  .resource-hub-listing--topic .hub-row__title {
    font-size: 26px;
  }

  .resource-hub-listing--topic .hub-row__teaser {
    font-size: 16px;
  }
}


/* Three selects cannot share one row with the heading, clear link, and member
   filter until the content column is wide enough to keep them readable. Below
   that the selects fill the first row and the clear link and member filter
   move to a second row, which keeps the visual order the same as the tab
   order. Two-select topics (no subtopics) keep the single-row composition. */
@media (min-width: 1025px) and (max-width: 1599px) {
  .resource-hub-listing--topic .resource-hub-filter-bar__inner:has(.resource-hub-filter-bar__selects > .form-item:nth-child(3)) {
    grid-template-columns: 79px max-content minmax(0, 1fr);
    row-gap: 16px;
  }

  .resource-hub-listing--topic .resource-hub-filter-bar__inner:has(.resource-hub-filter-bar__selects > .form-item:nth-child(3)) .resource-hub-filter-bar__selects {
    grid-row: 1;
    grid-column: 2 / -1;
  }

  .resource-hub-listing--topic .resource-hub-filter-bar__inner:has(.resource-hub-filter-bar__selects > .form-item:nth-child(3)) .resource-hub-filter-bar__selects > .form-item {
    flex: 1 1 0;
    width: auto;
  }

  .resource-hub-listing--topic .resource-hub-filter-bar__inner:has(.resource-hub-filter-bar__selects > .form-item:nth-child(3)) .resource-hub-filter-bar__actions {
    grid-row: 2;
    grid-column: 2;
    justify-self: start;
  }

  .resource-hub-listing--topic .resource-hub-filter-bar__inner:has(.resource-hub-filter-bar__selects > .form-item:nth-child(3)) .resource-hub-filter-bar__members-only {
    grid-row: 2;
    grid-column: 3;
    justify-self: end;
  }
}

/* Some mobile browsers retain a tablet-sized layout viewport. Keep this
   topic-only form stacked through that range so desktop control bases cannot
   turn into vertical whitespace. */
@media (max-width: 1024px) {
  .resource-hub-filter-bar--page_topic {
    display: block;
    padding: 24px 20px;
    position: static;
  }

  .resource-hub-filter-bar--page_topic .resource-hub-filter-bar__inner,
  .resource-hub-filter-bar--page_topic .resource-hub-filter-bar__selects {
    display: flex;
    flex-direction: column;
    gap: 16px;
    align-items: stretch;
    width: 100%;
  }

  .resource-hub-filter-bar--page_topic .resource-hub-filter-bar__selects > .form-item {
    flex: 0 0 auto !important;
    width: 100% !important;
    height: auto;
    min-height: 0;
    margin: 0;
  }

  .resource-hub-filter-bar--page_topic .resource-hub-filter-bar__actions,
  .resource-hub-filter-bar--page_topic .resource-hub-filter-bar__members-only {
    align-self: flex-start;
  }

  .resource-hub-filter-bar--page_topic .resource-hub-filter-bar__actions .form-actions,
  .resource-hub-filter-bar--page_topic .resource-hub-filter-bar__members-only .form-item {
    width: auto;
    margin: 0;
  }
}


/* Exact icon assets exported from Figma node 83:1108. */
.resource-hub-topic-header__metadata-icon {
  display: inline-block;
  width: 34px;
  height: 33px;
  background-position: center;
  background-repeat: no-repeat;
  font-size: 0;
}

.resource-hub-topic-header__metadata-icon--count {
  background-image: url("../img/resource-hub-topic-layers.svg");
  background-size: 26px 26px;
}

.resource-hub-topic-header__metadata-icon--updated {
  background-image: url("../img/resource-hub-topic-calendar.svg");
  background-size: 24px 26px;
}

.resource-hub-listing--topic .hub-row__lock {
  display: block;
  width: 34px;
  height: 33px;
  background: url("../img/resource-hub-topic-lock.svg") center / 22.75px 26px no-repeat;
  color: transparent;
  font-size: 0;
}

/* Keep Drupal's native checkbox for semantics and filtering while rendering
   a consistent design-controlled visual state beside its label. */
.resource-hub-listing--topic .resource-hub-filter-bar--page_topic .resource-hub-filter-bar__members-only .form-item {
  position: relative;
  min-height: 22px;
}

.resource-hub-listing--topic .resource-hub-filter-bar--page_topic input.resource-hub-filter-bar__control[type="checkbox"] {
  position: absolute;
  top: 50%;
  left: 0;
  z-index: 1;
  box-sizing: border-box;
  width: 23px;
  height: 22px;
  margin: 0;
  padding: 0;
  transform: translateY(-50%);
  opacity: 0;
}

.resource-hub-listing--topic .resource-hub-filter-bar--page_topic .resource-hub-filter-bar__members-only label {
  position: relative;
  display: block;
  min-height: 22px;
  padding-left: 32px;
  color: #fff;
  font-size: 16px;
  font-weight: 500;
  line-height: 24px;
  letter-spacing: 0;
  text-transform: none;
  cursor: pointer;
}

.resource-hub-listing--topic .resource-hub-filter-bar--page_topic input.resource-hub-filter-bar__control[type="checkbox"] + label::before {
  position: absolute;
  top: 50%;
  left: 0;
  box-sizing: border-box;
  width: 23px;
  height: 22px;
  border: 2px solid #fff;
  border-radius: 2px;
  transform: translateY(-50%);
  background: transparent;
  content: "";
}

.resource-hub-listing--topic .resource-hub-filter-bar--page_topic input.resource-hub-filter-bar__control[type="checkbox"] + label::after {
  position: absolute;
  top: 50%;
  left: 4px;
  width: 15px;
  height: 14px;
  transform: translateY(-50%) scale(0) rotate(12deg);
  transform-origin: center;
  clip-path: polygon(14% 44%, 0 65%, 50% 100%, 100% 16%, 80% 0%, 43% 62%);
  background-color: #fff;
  content: "";
  transition: transform 120ms ease-in-out;
}

.resource-hub-listing--topic .resource-hub-filter-bar--page_topic input.resource-hub-filter-bar__control[type="checkbox"]:checked + label::before {
  border-color: #c32644;
  background-color: #c32644;
}

.resource-hub-listing--topic .resource-hub-filter-bar--page_topic input.resource-hub-filter-bar__control[type="checkbox"]:checked + label::after {
  transform: translateY(-50%) scale(1) rotate(12deg);
}

.resource-hub-listing--topic .resource-hub-filter-bar--page_topic input.resource-hub-filter-bar__control[type="checkbox"]:focus-visible + label::before {
  outline: 3px solid #fff;
  outline-offset: 2px;
  box-shadow: 0 0 0 5px rgba(179, 1, 37, 0.75);
}
