/*
 * Age by birth year page — loaded after ../../assets/css/styles.css and ../en.css.
 * Styles only what this page adds: the breadcrumb, typed-in boxes, result lines and the age chart.
 */

/* Read by screen readers, not shown. */
.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}

/* Breadcrumb */

.breadcrumb ol {
  display: flex;
  flex-wrap: wrap;
  gap: 4px 0;
  margin: 0 0 16px;
  padding: 0;
  list-style: none;
  color: var(--color-text-muted);
  font-size: 0.9375rem;
}

.breadcrumb li + li {
  margin: 0;
}

/* At least 24px tall, the WCAG 2.5.8 minimum target size for a link on its own. */
.breadcrumb a {
  display: inline-block;
  padding-block: 2px;
}

.breadcrumb-separator {
  margin-inline: 8px;
}

/* Typed-in boxes, matching the look of the date dropdowns on /en/. */

.year-form {
  margin-block-start: 20px;
}

.field input {
  display: block;
  width: 100%;
  max-width: 16rem;
  min-height: 48px;
  padding: 8px 12px;
  appearance: none;
  background-color: var(--color-surface);
  border: 1px solid var(--color-control-border);
  border-radius: var(--radius-control);
  color: var(--color-text);
  font: inherit;
  font-size: 1rem; /* 16px or more stops iPhone Safari from zooming in when the box is tapped */
}

.field input:focus-visible {
  border-color: var(--color-accent);
  border-radius: var(--radius-control);
}

.field input[aria-invalid="true"] {
  border-color: var(--color-error);
  box-shadow: 0 0 0 1px var(--color-error);
}

/* Result */

.result-lines p {
  margin: 0;
}

.result-lines p + p {
  margin-block-start: 8px;
}

/* Age chart */

.chart-search {
  margin-block-start: 16px;
}

.chart-status {
  margin: 12px 0;
  color: var(--color-text-muted);
  font-size: 0.9375rem;
  font-weight: 600;
}

.age-chart {
  width: 100%;
  margin-block-start: 12px;
  border-collapse: collapse;
  font-variant-numeric: tabular-nums;
}

.age-chart th,
.age-chart td {
  padding: 8px 10px;
  border-block-end: 1px solid var(--color-border);
  text-align: start;
}

.age-chart thead th {
  /* The heading row stays at the top of the screen while the chart scrolls. */
  position: sticky;
  top: 0;
  z-index: 1;
  background: var(--color-result-bg);
  color: var(--color-text-muted);
  font-size: 0.875rem;
  line-height: 1.35;
  vertical-align: bottom;
}

.age-chart tbody th {
  font-weight: 700;
}

@media (hover: hover) {
  .field input:hover:not([aria-invalid="true"]):not(:focus-visible) {
    border-color: var(--color-text);
  }
}
