/* Speech Recognition for Early Learning (/kidsasr/).
 *
 * Page-specific styles for themes/drivendata/templates/kidsasr.html. Everything is scoped to .kidsasr, so nothing here
 * touches the site nav, footer or Tailwind theme, and every color is one of the site's theme.css variables.
 *
 * Ordinary elements (paragraphs, lists, headings, tables, figures) are styled by element here, so the template only
 * carries classes for the page's components.
 */

.kidsasr {
  /* The surrounding .section-content provides the side padding. */
  max-width: 920px;
  margin-inline: auto;
  color: var(--color-default);
  line-height: 1.5;
}

/* Text */

/* Restore what Tailwind's preflight and base.css reset or change on this page. */
.kidsasr p {
  margin-block: 1em;
  font-size: 1rem;
}

.kidsasr a {
  color: var(--color-primary);
}

.kidsasr h1,
.kidsasr h2,
.kidsasr h3 {
  font-weight: 700;
  line-height: 1.15;
  text-wrap: balance;
  margin: 0;
  color: var(--color-default);
}

.kidsasr h1,
.kidsasr h2 {
  font-family: var(--font-display);
  font-weight: 300;
  letter-spacing: -0.015em;
}

.kidsasr section > h2 {
  margin-bottom: 8px;
  font-size: 2rem;
}

.kidsasr #opportunities > h2,
.kidsasr footer h2 {
  font-size: 1.6rem;
}

.kidsasr section h3 {
  margin: 36px 0 12px;
  font-size: 1.1rem;
}

/* The subheading under each section heading, styled like a blog post's summary line. */
.kidsasr p.lede {
  margin: 0 0 24px;
  font-size: var(--text-xl);
  line-height: var(--text-xl--line-height);
  color: var(--color-muted);
}

/* A paragraph after a list, figure or table gets a little more room than one after another paragraph. */
.kidsasr :is(ul, figure, .table-scroll) + p {
  margin-top: 22px;
}

.kidsasr #problem > figure + p {
  margin-top: 32px;
}

.kidsasr li b {
  color: var(--color-default);
}

/* Lists get small blue square bullets. */
.kidsasr ul {
  list-style: none;
  margin: 16px 0 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.kidsasr ul > li {
  position: relative;
  padding-left: 20px;
}

.kidsasr ul > li::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0.58em;
  width: 7px;
  height: 7px;
  border-radius: 2px;
  background: var(--color-primary);
}

/* Figures and captions */

.kidsasr figure {
  margin: 16px 0 0;
}

.kidsasr figure :is(img, svg) {
  display: block;
  width: 100%;
  height: auto;
}

.kidsasr figcaption {
  margin-top: 12px;
  font-size: var(--text-sm);
  line-height: var(--text-sm--line-height);
  color: var(--color-muted);
}

/* Charts: a bold title, the outlined chart and a caption. .chart-pair sets two side by side. */
.kidsasr .chart-pair {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 0 32px;
  margin-top: 26px;
}

.kidsasr .chart-pair.wide-right {
  grid-template-columns: minmax(0, 1fr) minmax(0, 1.25fr);
}

.kidsasr .chart-pair figcaption {
  grid-column: 1 / -1;
}

/* Paired charts get equal-height outlines; each image is centered in its box without stretching. */
.kidsasr .chart-pair > div {
  display: flex;
  flex-direction: column;
}

.kidsasr .chart-pair > div > img {
  flex: 1 1 auto;
  min-height: 0;
  object-fit: contain;
}

/* Chart titles only; bold text in captions stays inline. */
.kidsasr .chart > b,
.kidsasr .chart-pair > div > b {
  display: block;
  font-weight: 600;
}

.kidsasr :is(.chart, .chart-pair) img {
  margin-top: 10px;
  padding: 1rem;
  border: 1px solid var(--color-border-weak);
  border-radius: 0.25rem;
}

/* A single chart keeps the full-width outline but is drawn at a readable size, centered inside it. */
.kidsasr .chart img {
  box-sizing: border-box;
  padding-inline: max(1rem, calc((100% - 720px) / 2));
}

@media (max-width:760px) {
  .kidsasr .chart-pair,
  .kidsasr .chart-pair.wide-right {
    grid-template-columns: 1fr;
    gap: 24px;
  }
}

/* Hero */

.kidsasr .hero {
  padding-top: 40px;
}

.kidsasr .hero h1 {
  font-size: clamp(2.25rem, 5.5vw, 3.4rem);
}

.kidsasr .hero-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr);
  gap: 40px;
  align-items: center;
  margin-bottom: 28px;
}

/* Subtitle: the display font at a larger size, light and airy, so the one-line claim reads as a headline. */
.kidsasr .hero-grid p {
  margin: 20px 0 0;
  font-family: var(--font-display);
  font-weight: 300;
  font-size: 1.5rem;
  line-height: 1.35;
  color: var(--color-muted);
  text-wrap: balance;
}

.kidsasr .hero-grid figure {
  margin: 0;
  border: 1px solid var(--color-border-weak);
  border-radius: 0.25rem;
  overflow: hidden;
  background: var(--color-placeholder);
}

.kidsasr .hero > .chart-pair + p {
  margin-top: 30px;
}

/* Project phases: a title and date line above each description. */
.kidsasr .hero li > div {
  display: flex;
  align-items: baseline;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 4px;
}

.kidsasr .hero li span {
  font-size: 0.875rem;
  color: var(--color-muted);
  white-space: nowrap;
}

@media (max-width:959px) {
  .kidsasr .hero-grid {
    grid-template-columns: 1fr;
    gap: 20px;
  }

  .kidsasr .hero-grid figure {
    order: -1;
  }
}

/* Sections */

.kidsasr section {
  padding-block: 40px;
  border-top: 1px solid var(--color-border-weak);
}

.kidsasr section:first-of-type {
  border-top: none;
}

/* Lists of links, each with a one-line description. .boxed puts each item on a tinted card. */
.kidsasr .links {
  margin: 0;
  gap: 10px;
}

.kidsasr .links > li {
  padding-left: 0;
}

.kidsasr .links > li::before {
  content: none;
}

.kidsasr .links a {
  font-weight: 600;
  text-decoration: none;
}

.kidsasr .links a:hover {
  text-decoration: underline;
}

.kidsasr .links span {
  display: block;
  margin-top: 2px;
  font-size: 0.875rem;
  color: var(--color-muted);
}

.kidsasr .boxed > li {
  border: 1px solid var(--color-border-weak);
  border-radius: 0.25rem;
  padding: 1.25rem;
  background: var(--color-placeholder);
}

.kidsasr .boxed a {
  font-size: var(--text-xl);
  line-height: var(--text-xl--line-height);
}

.kidsasr .boxed span {
  margin-top: 4px;
  font-size: var(--text-base);
  line-height: var(--text-base--line-height);
}

/* Word vs. phonetic use cases, side by side. */
.kidsasr .usecase-cols {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 48px;
  margin-top: 22px;
}

.kidsasr .usecase-cols p {
  margin-top: 0;
}

@media (max-width:760px) {
  .kidsasr .usecase-cols {
    grid-template-columns: 1fr;
    gap: 8px;
  }
}

/* Data stats: three big numbers in the site's display font, each over a short label. */
.kidsasr .stats {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 56px;
  margin-top: 6px;
}

.kidsasr .stats > div {
  font-size: var(--text-sm);
  line-height: var(--text-sm--line-height);
  color: var(--color-muted);
}

.kidsasr .stats b {
  display: block;
  margin-bottom: 4px;
  font-family: var(--font-display);
  font-size: 2.5rem;
  line-height: 1.1;
  font-weight: 600;
  color: var(--color-primary);
}

@media (max-width:640px) {
  .kidsasr .stats {
    grid-template-columns: 1fr;
    gap: 16px;
  }
}

/* Tables: a rounded box with a light-blue header row and rules between rows. Each sits in a .table-scroll box;
 * .examples, .datasets and .prizes adjust it. */
.kidsasr .table-scroll {
  overflow-x: auto;
  border: 1px solid var(--color-border-weak);
  border-radius: 0.25rem;
}

.kidsasr table {
  width: 100%;
  border-collapse: collapse;
}

.kidsasr th {
  padding: 10px 14px;
  border-bottom: 1px solid var(--color-border-weak);
  text-align: left;
  font-weight: 700;
  background: var(--color-placeholder);
}

.kidsasr td {
  padding: 10px 14px;
  border-bottom: 1px solid var(--color-border-weak);
  vertical-align: top;
}

.kidsasr tbody tr:last-child td {
  border-bottom: none;
}

.kidsasr td small {
  display: block;
  font-size: 0.875rem;
  color: var(--color-muted);
}

/* Word vs. phonetic transcript examples: keep each transcript on one line. */
.kidsasr .examples td {
  white-space: nowrap;
}

/* Dataset directory */
.kidsasr .datasets table {
  min-width: 880px;
  table-layout: fixed;
  font-size: 0.875rem;
}

.kidsasr .datasets th {
  position: sticky;
  top: 0;
}

.kidsasr .datasets th:first-child {
  width: 15%;
}

.kidsasr .datasets th:nth-child(2) {
  width: 22%;
}

.kidsasr .datasets td:first-child {
  font-weight: 700;
  color: var(--color-default);
}

.kidsasr .datasets td a {
  font-weight: 600;
}

.kidsasr .datasets td small,
.kidsasr .datasets td div + div {
  margin-top: 6px;
}

/* Prize table: each cell is an amount over the winners. */
.kidsasr .prizes td {
  color: var(--color-default);
}

.kidsasr .prizes :is(th, td):first-child {
  white-space: nowrap;
}

.kidsasr .prizes td > span {
  display: block;
}

/* Numbered lists, e.g. the competition steps. */
.kidsasr ol {
  margin: 16px 0 0;
  padding-left: 1.5rem;
  list-style: decimal;
}

.kidsasr ol > li + li {
  margin-top: 10px;
}

/* Competition steps: four columns, each a numbered bold title with a thin rule under it, then its text. */
.kidsasr ol.steps {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 24px;
  padding: 0;
  list-style: none;
  counter-reset: step;
}

.kidsasr ol.steps > li {
  margin: 0;
  counter-increment: step;
}

.kidsasr ol.steps b {
  display: block;
  margin-bottom: 8px;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--color-border-weak);
}

.kidsasr ol.steps b::before {
  content: counter(step) ". ";
  color: var(--color-primary);
}

@media (max-width:760px) {
  .kidsasr ol.steps {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

/* Resources: two columns of light gray link groups. */
.kidsasr .res-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.kidsasr .res-col {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.kidsasr .res-group {
  border: 1px solid var(--color-border-weak);
  border-radius: 0.25rem;
  padding: 14px 16px;
  background: var(--color-gray-50);
}

.kidsasr .res-group h3 {
  margin: 0 0 10px;
  font-size: 1rem;
  line-height: 1.5;
}

@media (max-width:760px) {
  .kidsasr .res-grid {
    grid-template-columns: 1fr;
  }
}

/* Future opportunities, each followed by a "What we've heard" line. */
.kidsasr .opp-list {
  margin: 0;
  gap: 18px;
}

.kidsasr .opp-list p {
  margin: 0;
}

.kidsasr .opp-list p + p {
  margin-top: 6px;
  padding-left: 12px;
  border-left: 2px solid var(--color-primary);
  font-size: var(--text-sm);
  line-height: var(--text-sm--line-height);
  font-style: italic;
  color: var(--color-muted);
}

.kidsasr .opp-list p + p b {
  font-style: normal;
  font-weight: 600;
  color: var(--color-default);
}

/* Acknowledgements */

.kidsasr footer {
  border-top: 1px solid var(--color-border-weak);
  padding-block: 32px 48px;
  margin-top: 8px;
}

.kidsasr footer h2 {
  margin-bottom: 10px;
  font-size: 1.6rem;
}

/* Acknowledgements read as small print, as in the original design. */
.kidsasr footer :is(p, ul) {
  font-size: var(--text-sm);
  line-height: var(--text-sm--line-height);
  color: var(--color-muted);
}

.kidsasr footer ul {
  list-style: disc;
  margin-top: 10px;
  padding-left: 1.2em;
  gap: 6px;
}

.kidsasr footer li {
  padding-left: 0;
  color: inherit;
}

.kidsasr footer li::before {
  content: none;
}
