/*
 * Styling for the wayfinder-slider/-stat-group/-chart markup Wayfinder.Rendering.GovUk ships as
 * its own default for these three component types (no real GOV.UK Design System equivalent
 * exists). Shipped as this package's own static web asset — a host loads it the same way it
 * must load govuk-frontend's own CSS/JS for every other component, from
 * /_content/Wayfinder.Rendering.GovUk/css/wayfinder-components.css — rather than hand-copying a
 * host-local version, so every consumer (Wayfinder.ReferenceApp, Umbraco.Prism, any future host)
 * shares one file instead of drifting independently. Uses GOV.UK blue (#1d70b8) directly; a host
 * that needs a different brand colour overrides these rules after loading this file, the same
 * way it would override any other govuk-frontend default.
 *
 * govuk-frontend never sets typography via a global html/body reset — every one of its own
 * classes (govuk-body, govuk-label, govuk-link, ...) declares font-family itself. So anything
 * rendered only under a wayfinder-* class, with no govuk-* class alongside it, inherits nothing
 * and falls back to the browser's serif default. This one rule is that declaration, shared by
 * every wayfinder-* class rather than repeated per class — also covers stage-page/stage-alert
 * (GovUkStageJourney's shared render pipeline), whose classes don't match the wayfinder-*
 * pattern but need the exact same fix for the exact same reason.
 */

.stage-page,
.stage-alert,
[class^="wayfinder-"],
[class*=" wayfinder-"] {
  font-family: GDS Transport, arial, sans-serif;
}

.wayfinder-slider__row {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.wayfinder-slider__input {
  flex: 1;
  accent-color: #1d70b8;
  min-height: 2rem;
}

.wayfinder-slider__value {
  min-width: 4.5rem;
  text-align: right;
  font-size: 1.25rem;
  font-weight: 700;
  color: #1d70b8;
  font-variant-numeric: tabular-nums;
}

.wayfinder-slider__bounds {
  display: flex;
  justify-content: space-between;
  font-size: 0.8125rem;
  color: #505a5f;
  margin-top: 0.25rem;
}

.wayfinder-stat-group {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 0.75rem;
  margin-bottom: 1.5rem;
}

.wayfinder-stat-card {
  background: #ffffff;
  border: 1px solid #b1b4b6;
  border-radius: 8px;
  padding: 1rem 1.125rem;
  /* A grid item will not shrink below its content, so a long unbroken value (a pair of coordinates, an
     email address) would otherwise push out of its card. */
  min-width: 0;
}

.wayfinder-stat-card--emphasis {
  background: #1d70b8;
  border-color: #1d70b8;
  color: #ffffff;
}

.wayfinder-stat-card__label {
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  margin-bottom: 0.375rem;
  opacity: 0.85;
}

.wayfinder-stat-card__value {
  font-size: 1.5rem;
  font-weight: 800;
  font-variant-numeric: tabular-nums;
  line-height: 1.2;
  overflow-wrap: anywhere;
}

/* A tile that shows a point on a map takes the full row, and writes the coordinates smaller above it. A tile
   that asks for width "full" (a long free-text value) takes the full row too. */
.wayfinder-stat-card--full,
.wayfinder-stat-card--map {
  grid-column: 1 / -1;
}

.wayfinder-stat-card__value--point {
  font-size: 1.125rem;
}

.wayfinder-stat-card__qualifier {
  font-size: 0.75rem;
  margin-top: 0.25rem;
  opacity: 0.75;
}

.wayfinder-chart {
  margin: 0 0 1.5rem;
  background: #ffffff;
  border: 1px solid #b1b4b6;
  border-radius: 8px;
  padding: 1rem 1.25rem;
}

.wayfinder-chart__title {
  font-weight: 700;
  margin-bottom: 0.5rem;
}

.wayfinder-chart__legend {
  display: flex;
  gap: 1rem;
  flex-wrap: wrap;
  font-size: 0.75rem;
  color: #505a5f;
  margin-bottom: 0.75rem;
}

.wayfinder-chart__legend-item {
  display: inline-flex;
  align-items: center;
  gap: 0.375rem;
}

.wayfinder-chart__swatch {
  width: 10px;
  height: 10px;
  border-radius: 2px;
}

.wayfinder-chart__plot {
  display: flex;
  align-items: flex-end;
  gap: 2px;
  height: 160px;
}

.wayfinder-chart__bar {
  flex: 1;
  display: flex;
  flex-direction: column-reverse;
  gap: 1px;
  height: 160px;
  justify-content: flex-start;
}

.wayfinder-chart__bar > div {
  border-radius: 1px;
}

.wayfinder-chart__labels {
  display: flex;
  gap: 2px;
  margin-top: 0.375rem;
}

.wayfinder-chart__labels span {
  flex: 1;
  text-align: center;
  font-size: 0.625rem;
  color: #505a5f;
  min-height: 1em;
}

/*
 * Stage-shell chrome (stage-page/stage-alert — GovUkStageJourney's own shared render pipeline,
 * see Wayfinder.Umbraco/Views/Partials/_WayfinderStageRender.cshtml) and the caseworker worklist
 * table (ServiceRequestWorklistService's own markup) — neither carried any box styling at all
 * before this. Colours match this file's own established palette (GOV.UK blue/red/amber/green),
 * not hand-picked anew.
 */
.stage-page__title {
  font-weight: 700;
  font-size: 1.5rem;
  line-height: 1.25;
  margin: 0 0 1.5rem;
  color: #0b0c0c;
}

.stage-alert {
  border-left: 5px solid #b1b4b6;
  background: #f3f2f1;
  padding: 1rem 1.25rem;
  margin-bottom: 1.5rem;
}

.stage-alert p {
  margin: 0;
}

.stage-alert--error {
  border-left-color: #d4351c;
  background: #fef4f2;
  color: #d4351c;
}

.stage-alert--warn {
  border-left-color: #f47738;
  background: #fff7f0;
  color: #594d00;
}

.wayfinder-tag {
  display: inline-block;
  font-weight: 700;
  font-size: 0.875rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  padding: 0.3125rem 0.625rem;
  border-radius: 2px;
  background: #f3f2f1;
  color: #0b0c0c;
}

.wayfinder-tag--blue {
  background: #d2e2f1;
  color: #144e81;
}

.wayfinder-tag--yellow {
  background: #fff7bf;
  color: #594d00;
}

.wayfinder-tag--green {
  background: #cce2d8;
  color: #00703c;
}

.wayfinder-button {
  display: inline-block;
  font-weight: 700;
  font-size: 1rem;
  padding: 0.5rem 0.75rem;
  border: 2px solid transparent;
  border-radius: 0;
  cursor: pointer;
  background: #00703c;
  color: #ffffff;
  box-shadow: 0 2px 0 #002d18;
}

.wayfinder-button--secondary {
  background: #f3f2f1;
  color: #0b0c0c;
  box-shadow: 0 2px 0 #929191;
}

.wayfinder-visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
  /* The chart's own accessible data table (RenderChart's own genuinely-accessible fallback,
     never a substitute for the visual chart) is this class's only current user, and a <table>
     is the one element this otherwise-standard visually-hidden pattern doesn't actually
     constrain: default table-layout: auto lets a table render at its own content-driven
     intrinsic width regardless of an explicit width: 1px, since auto layout prioritises not
     truncating cell content over honouring a specified width. The table stays genuinely
     invisible (clip + 1px box) either way, but position: absolute doesn't remove it from
     contributing to an ancestor's scrollable overflow — found live, on Umbraco.Prism's mobile
     shell: a many-row chart table rendering at its full ~500px content width silently made the
     whole page horizontally scrollable, well past a ~390px phone viewport, with nothing visibly
     wrong to explain it (the table itself is invisible by design). table-layout: fixed makes the
     table actually honour the explicit width instead.
  */
  table-layout: fixed;
}

.wayfinder-bulk-review__summary {
  margin-bottom: 1rem;
}

.wayfinder-bulk-review__sync-status {
  font-weight: 700;
  color: #00703c;
}

.wayfinder-bulk-review__sync-status--dirty {
  color: #d4351c;
}

.wayfinder-bulk-review__controls {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 1rem;
}

.wayfinder-bulk-review__revert {
  margin-bottom: 1rem;
}

.wayfinder-bulk-review__revert [data-wayfinder-bulk-review-revert-panel] {
  margin-top: 1rem;
}

.wayfinder-bulk-review__rows {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  margin-bottom: 1rem;
}

.wayfinder-bulk-review__card {
  background: #ffffff;
  border: 1px solid #b1b4b6;
  border-left-width: 6px;
  border-radius: 4px;
  padding: 1rem 1.25rem;
}

.wayfinder-bulk-review__card--error {
  border-left-color: #d4351c;
}

.wayfinder-bulk-review__card--warning {
  border-left-color: #f47738;
}

.wayfinder-bulk-review__card-header {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin-bottom: 0.75rem;
}

.wayfinder-bulk-review__card-title {
  /* govuk-heading-s supplies weight/size/colour; its own bottom margin would misalign it
     against the tag beside it in this flex row, so it's zeroed here. */
  margin: 0;
}

.wayfinder-bulk-review__structural-issue {
  color: #d4351c;
  font-weight: 700;
}

.wayfinder-bulk-review__fields {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 0.75rem 1.5rem;
  margin-bottom: 1rem;
}

.wayfinder-bulk-review__field-label {
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: #505a5f;
  margin-bottom: 0.25rem;
}

.wayfinder-bulk-review__field-value--error {
  color: #d4351c;
  font-weight: 700;
}

.wayfinder-bulk-review__field-value--warning {
  color: #f47738;
  font-weight: 700;
}

.wayfinder-bulk-review__save-status {
  margin: 0.5rem 0 0;
  font-weight: 700;
  min-height: 1.25em;
}

.wayfinder-bulk-review__save-status--pending {
  color: #505a5f;
}

.wayfinder-bulk-review__save-status--saved {
  color: #00703c;
}

.wayfinder-bulk-review__save-status--error {
  color: #d4351c;
}

.wayfinder-bulk-review__page-status {
  font-variant-numeric: tabular-nums;
  margin-top: -0.5rem;
}

/* Cards are the whole point on narrow viewports — fields already stack via the auto-fit grid
   above, this just tightens spacing so the controls row doesn't feel cramped on a phone. */
@media (max-width: 40.0625em) {
  .wayfinder-bulk-review__controls {
    flex-direction: column;
    align-items: flex-start;
  }
}

/* The picture shown beneath an image file input once a file is chosen (wayfinder-file-preview.js). */
.wayfinder-file-preview {
  margin-top: 0.75rem;
}

.wayfinder-file-preview__image {
  display: block;
  max-width: 100%;
  max-height: 16rem;
  border: 1px solid #b1b4b6;
}

/* display: block above would otherwise beat the hidden attribute and leave an empty broken-image box. */
.wayfinder-file-preview__image[hidden] {
  display: none;
}

.wayfinder-file-preview__caption {
  margin-top: 0.5rem;
  margin-bottom: 0;
}
