/**
 * resources/css/trends.css
 * ApplyRole — the trends page.
 *
 * The layout people already know from trends pages elsewhere: chips over one
 * chart, panels underneath. Colour arrives ONLY through the series palette
 * (--chip, set inline per term) — the page itself stays in the product's quiet
 * surface tones so five coloured lines read as data, not decoration.
 */

.trends {
  max-width: 62rem;
  margin: 0 auto;
  padding: 2.5rem 1.5rem 4rem;
}

/* ─── Head ─────────────────────────────────────────────────────────────────── */

.trends__head {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  gap: 1.5rem;
  flex-wrap: wrap;
  margin-bottom: 1.5rem;
}

.trends__title { margin: 0; font-size: 1.75rem; letter-spacing: -.03em; }
.trends__sub   { margin: .375rem 0 0; font-size: .9375rem; color: var(--muted); max-width: 34rem; }

.trends__pulse {
  margin: 0;
  font-size: .8125rem;
  color: var(--muted);
  white-space: nowrap;
}
.trends__pulse strong { color: var(--ink); font-variant-numeric: tabular-nums; }

/* The quiet heartbeat. Decorative only, and honest about it. */
.trends__pulsedot {
  display: inline-block;
  width: .5rem; height: .5rem;
  margin-right: .375rem;
  border-radius: 999px;
  background: var(--ok, #2f9e77);
  animation: trends-pulse 2.4s ease-in-out infinite;
}
@keyframes trends-pulse {
  0%, 100% { opacity: 1; }
  50%      { opacity: .35; }
}

/* ─── Compare box ──────────────────────────────────────────────────────────── */

.trends__compare { margin-bottom: 1.25rem; }

.trends__chips {
  display: flex;
  flex-wrap: wrap;
  gap: .5rem;
  align-items: center;
  padding: .75rem;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 14px;
}

.trends__chip {
  display: inline-flex;
  align-items: center;
  gap: .375rem;
  padding: .375rem .625rem;
  font-size: .8125rem;
  font-weight: 600;
  border-radius: 999px;
  background: color-mix(in srgb, var(--chip) 10%, var(--surface));
  border: 1px solid color-mix(in srgb, var(--chip) 28%, var(--surface));
}

.trends__chipdot {
  display: inline-block;
  width: .5rem; height: .5rem;
  border-radius: 999px;
  background: var(--chip);
}

.trends__chipx {
  margin-left: .125rem;
  text-decoration: none;
  color: var(--muted);
  font-weight: 400;
  line-height: 1;
}
.trends__chipx:hover { color: var(--late); }

.trends__input {
  flex: 1;
  min-width: 11rem;
  border: 0;
  background: transparent;
  font: inherit;
  font-size: .875rem;
  color: var(--ink);
  padding: .375rem .25rem;
}
.trends__input:focus { outline: none; }
.trends__chips:focus-within { border-color: var(--brand); }

/* ─── Panels ───────────────────────────────────────────────────────────────── */

.trends__panel {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 1.25rem 1.5rem;
  margin-bottom: 1.25rem;
}

.trends__panelhead {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 1rem;
  flex-wrap: wrap;
}

.trends__h2 { margin: 0 0 .75rem; font-size: 1rem; }

.trends__win     { display: flex; gap: .25rem; }
.trends__winlink {
  font-size: .75rem;
  padding: .25rem .625rem;
  border-radius: 999px;
  text-decoration: none;
  color: var(--muted);
}
.trends__winlink:hover     { background: var(--surface-2); color: var(--ink); }
.trends__winlink.is-active { background: var(--brand-soft); color: var(--brand); font-weight: 600; }

.trends__note { margin: .75rem 0 0; font-size: .75rem; color: var(--muted); }

/* ─── Chart ────────────────────────────────────────────────────────────────── */

.trends__chart { width: 100%; height: auto; display: block; margin-top: .5rem; }

.trends__grid { stroke: var(--line); stroke-width: 1; }
.trends__axis { font-size: 11px; fill: var(--muted); }

.trends__line {
  fill: none;
  stroke-width: 2.5;
  stroke-linejoin: round;
  stroke-linecap: round;
}

/* Dots are hover targets for the <title> tooltips; nearly invisible at rest so
   the lines stay the subject. */
.trends__dot        { opacity: .25; }
.trends__dot:hover  { opacity: 1; r: 5; }

/* ─── Right-now cards ──────────────────────────────────────────────────────── */

.trends__nowgrid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(13rem, 1fr));
  gap: 1rem;
  margin-bottom: 1.25rem;
}

.trends__nowcard {
  background: var(--surface);
  border: 1px solid var(--line);
  border-top: 3px solid var(--chip);
  border-radius: 12px;
  padding: 1rem 1.125rem;
}

.trends__nowterm {
  display: flex;
  align-items: center;
  gap: .5rem;
  margin: 0 0 .625rem;
  font-size: .875rem;
}

.trends__nowstats { margin: 0; display: grid; gap: .375rem; }
.trends__nowstats div { display: flex; justify-content: space-between; gap: 1rem; }
.trends__nowstats dt  { font-size: .75rem; color: var(--muted); }
.trends__nowstats dd  { margin: 0; font-size: .8125rem; font-weight: 700;
                        font-variant-numeric: tabular-nums; }

/* ─── Browse panels ────────────────────────────────────────────────────────── */

.trends__cols {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.25rem;
  align-items: start;
}

.trends__list { list-style: none; margin: 0; padding: 0; display: grid; gap: .125rem; }

.trends__row, .trends__bar {
  display: grid;
  align-items: center;
  gap: .75rem;
  padding: .5rem .375rem;
  border-radius: 8px;
  font-size: .875rem;
}
.trends__row { grid-template-columns: 1fr auto auto auto; }
.trends__bar { grid-template-columns: 9rem 1fr auto auto; }

/* The jump from a trend to its listings. Quiet at rest, brand on hover — the
   arrow is a door, not a decoration. */
.trends__rowjobs {
  text-decoration: none;
  color: var(--muted);
  font-weight: 600;
  padding: 0 .25rem;
  border-radius: 6px;
}
.trends__rowjobs:hover { color: var(--brand); background: var(--brand-soft); }

.trends__nowjobs {
  display: inline-block;
  margin-top: .75rem;
  font-size: .8125rem;
  font-weight: 600;
  text-decoration: none;
  color: var(--brand);
}
.trends__nowjobs:hover { text-decoration: underline; }

.trends__row:hover, .trends__bar:hover { background: var(--surface-2); }

.trends__rowlink {
  text-decoration: none;
  color: var(--ink);
  font-weight: 500;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.trends__rowlink:hover { color: var(--brand); }

.trends__rowmeta {
  font-size: .8125rem;
  color: var(--muted);
  font-variant-numeric: tabular-nums;
}

.trends__badge {
  font-size: .6875rem;
  font-weight: 700;
  padding: .125rem .5rem;
  border-radius: 999px;
  background: color-mix(in srgb, var(--ok, #2f9e77) 12%, var(--surface));
  color: var(--ok, #2f9e77);
}
.trends__badge--new {
  background: var(--brand-soft);
  color: var(--brand);
}

.trends__bartrack {
  height: .5rem;
  background: var(--surface-2);
  border-radius: 999px;
  overflow: hidden;
}
.trends__barfill {
  display: block;
  height: 100%;
  background: var(--brand);
  border-radius: 999px;
}

/* ─── Small screens ────────────────────────────────────────────────────────── */

@media (max-width: 48rem) {
  .trends { padding: 1.5rem 1rem 3rem; }
  .trends__cols { grid-template-columns: 1fr; }
  .trends__bar  { grid-template-columns: 7rem 1fr auto; }
  .trends__head { align-items: flex-start; }
}

@media (prefers-reduced-motion: reduce) {
  .trends__pulsedot { animation: none; }
}

/* ─── Industry chips ───────────────────────────────────────────────────────
   Same chip vocabulary as the template gallery; .chip itself lives in app.css. */
.trends__industries {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: .4rem;
  margin-top: .875rem;
}
.trends__indlabel {
  font-size: var(--fs-xs);
  font-weight: 700;
  color: var(--muted);
  margin-right: .25rem;
}
.trends__h2scope {
  font-weight: 500;
  color: var(--muted);
  font-size: .85em;
}
