/* The map-site shell shared by Contract Research Map and Clinical Research Map (layouts/map_site): header, footer and the
   list head. Tokens only. The ad card is a cataloged component and lives in components.css. */

/* The logo is an inline SVG with no plate behind it. Its navy parts take --color-crm-ink, which flips
   with the site theme (tokens.css); the teal and green stay fixed in both themes. */
.s-crm-logo {
  display: inline-flex;
  align-items: center;
  border-radius: var(--radius-md);
  line-height: 0;
}

.s-crm-logo:focus-visible {
  outline: 2px solid var(--color-focus);
  outline-offset: 2px;
}

.c-crm-logo__svg {
  display: block;
  width: auto;
  height: 2.25rem;
  max-width: 100%;
}

.c-crm-logo__svg .crm-ink {
  fill: var(--color-crm-ink);
  stroke: var(--color-crm-ink);
}

.c-crm-logo__svg .crm-teal {
  fill: var(--color-crm-teal);
  stroke: var(--color-crm-teal);
}

.c-crm-logo__svg .crm-green {
  fill: var(--color-crm-green);
  stroke: var(--color-crm-green);
}

.s-crm-spacer {
  flex: 1 1 auto;
}

.s-crm-footer .s-footer__inner {
  flex-wrap: wrap;
  row-gap: var(--space-3);
}

.s-crm-footer__powered {
  margin: 0;
  color: var(--color-text);
  font-size: var(--text-md);
}

.s-crm-footer__use,
.s-crm-footer__notice,
.s-crm-footer__credit {
  margin: 0;
  color: var(--color-text);
  font-size: var(--text-sm);
}

.s-crm-footer__powered a,
.s-crm-footer__use a,
.s-crm-footer__credit a,
.s-crm-footer .s-footer__links a {
  color: var(--color-link);
}

/* The content area under the map: the ad slot, then the filters, charts and list. Below 72rem the slot is a
   short strip above the filters (columns by count); from 72rem it is a narrow sticky rail in the right
   column. The slot is hidden until an ad arrives, so with no ads the main column takes the full width:
   the two-column grid only applies while a slot is showing (:has), never an empty gutter. */
.c-crm-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: var(--space-6);
  align-items: start;
}

.c-ad-slot {
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
  min-width: 0;
}

.c-ad-slot__label {
  margin: 0;
  font-size: var(--text-2xs);
  font-weight: var(--weight-semibold);
  letter-spacing: var(--tracking-wide);
  text-transform: uppercase;
  color: var(--color-text-muted);
}

@media (min-width: 40rem) and (max-width: 71.99rem) {
  .c-ad-slot .c-ad-list {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .c-ad-slot .c-ad-list[data-count="1"] {
    grid-template-columns: minmax(0, 24rem);
  }

  .c-ad-slot .c-ad-list[data-count="3"] {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

@media (min-width: 64rem) and (max-width: 71.99rem) {
  .c-ad-slot .c-ad-list[data-count="4"] {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }
}

@media (min-width: 72rem) {
  .c-crm-layout:has(.c-ad-slot:not([hidden])) {
    grid-template-columns: minmax(0, 1fr) 17rem;
  }

  .c-crm-layout__main {
    grid-column: 1;
    grid-row: 1;
    min-width: 0;
  }

  .c-ad-slot {
    grid-column: 2;
    grid-row: 1;
    position: sticky;
    top: var(--space-4);
  }
}

/* The /agents page of both map sites (views/map_site/agents): a hero band (connect URL in the cataloged
   copy snippet beside one illustrative screenshot) over a client picker card and the sample queries. */
.p-map-agents__frame {
  max-width: 72rem;
  margin-inline: auto;
}

/* Row A: full-bleed hero band. Under 64rem one column, capped at the prose measure and centred. */
.p-map-agents__hero {
  background: var(--color-surface);
  border-bottom: 1px solid var(--color-border);
  padding-block: var(--space-8) var(--space-6);
}

.p-map-agents__hero-grid,
.p-map-agents__body {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: var(--space-8);
}

.p-map-agents__intro,
.p-map-agents__figure,
.p-map-agents__samples {
  min-width: 0;
}

.p-map-agents__intro > .u-overline { margin: 0 0 var(--space-3); }

.p-map-agents__intro h1 {
  margin: 0 0 var(--space-4);
  font-family: var(--font-display);
  font-size: var(--text-2xl);
  line-height: var(--leading-tight);
  letter-spacing: var(--tracking-tight);
}

.p-map-agents__lede {
  margin: 0 0 var(--space-6);
  color: var(--color-text-muted);
  font-size: var(--text-base);
  line-height: var(--leading-snug);
}

.p-map-agents__samples h2 {
  margin: 0 0 var(--space-3);
}

.p-map-agents__sample-list {
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
}

.p-map-agents__figure {
  display: grid;
  gap: var(--space-3);
  margin: 0;
}

.p-map-agents__figure-query {
  margin: 0;
  font-size: var(--text-base);
  color: var(--color-text-strong);
}

/* On a phone the picker card gives its width to the copy snippets inside it. */
@media (max-width: 39.99rem) {
  #agents-client .c-card__body {
    padding-inline: var(--space-3);
  }
}

@media (min-width: 40rem) {
  .p-map-agents__hero {
    padding-block: var(--space-12) var(--space-10);
  }

  .p-map-agents__hero-grid,
  .p-map-agents__body {
    max-width: var(--container-prose);
  }

  .p-map-agents__intro h1 {
    font-size: var(--text-3xl);
  }

  .p-map-agents__lede {
    font-size: var(--text-lg);
  }
}

@media (min-width: 64rem) {
  .p-map-agents__hero-grid,
  .p-map-agents__body {
    max-width: 72rem;
    gap: var(--space-10);
  }

  /* Both rows share one column pair (text, then a 32rem figure column) so their column edges line up. */
  .p-map-agents__hero-grid,
  .p-map-agents__body {
    grid-template-columns: minmax(0, 1fr) minmax(0, 32rem);
  }

  .p-map-agents__hero-grid { align-items: center; }
  .p-map-agents__body { align-items: start; }

  /* Sticks below the sticky top bar, which is --topbar-height plus its 1px border tall. */
  .p-map-agents__samples {
    position: sticky;
    top: calc(var(--topbar-height) + var(--space-4));
  }
}

/* components/themed_image swaps the light and dark picture; the frame below applies to whichever shows. */
.p-map-agents__img {
  display: block;
  width: 100%;
  height: auto;
  border: 1px solid var(--color-border-strong);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
}

.p-map-agents__caption {
  color: var(--color-text-muted);
  font-size: var(--text-sm);
}

.p-map-agents__note {
  display: block;
  font-style: italic;
}

/* A PNG wordmark (Trial Insights): a light and a dark file, one shown per theme (components/themed_image, whose rules set the display, so none here). */
img.c-crm-logo__img {
  width: auto;
  height: 2.5rem;
  max-width: 100%;
}

/* Trial Insights home (trial_insights_site/index): the start-year range form in the filter rail, and the
   previous / next line under the capped list. Tokens only. */
.c-ti-years {
  display: grid;
  gap: var(--space-2);
}

.c-ti-years__row {
  display: flex;
  gap: var(--space-2);
  align-items: end;
}

.c-ti-years__field {
  display: grid;
  gap: var(--space-1);
  min-width: 0;
  flex: 1;
}

.c-ti-pager {
  display: flex;
  gap: var(--space-3);
  align-items: center;
  flex-wrap: wrap;
}

/* Find Support For home (advocacy_site/index): the disease search box, kept to a readable line length. */
.c-advocacy-search {
  max-width: 40rem;
}

/* Find Support For home hero (#6575). The text column carries the search and the secondary actions (the Public hero's `body:` slot); the motif
   is decoration in the hero's figure panel. Fills are the semantic accent token at three opacities, so the theme toggle and the OS setting both
   work with one drawing. Static: no animation. On a phone the panel is a short band so the search stays on the first screen. */
.c-advocacy-hero-body {
  display: flex;
  flex-direction: column;
  gap: var(--space-4);
}

.c-advocacy-hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-3);
}

.c-advocacy-motif {
  display: block;
  width: 100%;
  height: 16rem;
}

.c-advocacy-motif svg {
  display: block;
  width: 100%;
  height: 100%;
}

.c-advocacy-motif__t1 { fill: var(--color-text-accent); }
.c-advocacy-motif__t2 { fill: var(--color-text-accent); fill-opacity: 0.6; }
.c-advocacy-motif__t3 { fill: var(--color-text-accent); fill-opacity: 0.3; }

/* The hero's figure panel pads itself; the motif fills it. Only the home hero carries this motif. */
.c-public-hero__figure:has(.c-advocacy-motif) {
  padding: var(--space-3);
}

/* A phone gets no motif: a short band under the actions read as an empty box, and the search stays on the first screen without it. */
@media (max-width: 40rem) {
  .c-public-hero__figure:has(.c-advocacy-motif) {
    display: none;
  }
}

/* The map-site bar (logo, Agents, theme toggle) fits one line at 390px: the shared public-bar rule wraps it under 48rem for the section links
   other layouts carry, which this one does not have. */
@media (max-width: 48rem) {
  .s-topbar--public .s-topbar__inner:has(.s-crm-spacer) {
    flex-wrap: nowrap;
    height: var(--topbar-height);
    gap: var(--space-2);
    padding-block: 0;
  }

  .s-topbar--public .s-topbar__inner:has(.s-crm-spacer) .s-crm-logo {
    min-width: 0;
  }
}
