/* Transcribe extends the installed Drupal Pages theme, preserving its palette
   and typography. Logo colors stay in the original vector assets. */

:root {
  --transcribe-coral: #e65335;
}

::selection {
  color: var(--drupal-navy);
  background: var(--drupal-light-blue);
}

.md-header__button.md-logo {
  display: block;
  padding: 0.35rem 0.4rem;
}

.md-header__button.md-logo img.transcribe-logo,
.md-nav__title .md-logo img.transcribe-logo {
  width: 9.5rem;
  height: auto;
}

.md-header__title {
  visibility: hidden;
}

.md-header__button.md-logo img.transcribe-logo--dark {
  display: none;
}

[data-md-color-scheme="slate"] .md-header__button.md-logo img.transcribe-logo--light,
.md-nav__title .md-logo img.transcribe-logo--light {
  display: none;
}

[data-md-color-scheme="slate"] .md-header__button.md-logo img.transcribe-logo--dark,
.md-nav__title .md-logo img.transcribe-logo--dark {
  display: block;
}

.drupal-hero__grid {
  grid-template-columns: minmax(0, 0.85fr) minmax(0, 1.15fr);
  gap: 3rem;
}

.drupal-hero__copy > p {
  max-width: 34ch;
}

.transcribe-flow-container {
  container-type: inline-size;
  min-width: 0;
}

.md-typeset .transcribe-flow {
  width: 100%;
  min-width: 0;
  margin: 0;
  padding: 1.3rem 1.4rem;
  border-radius: var(--drupal-card-radius);
  color: var(--drupal-light-blue);
  text-align: left;
  background: var(--drupal-dark-navy);
  box-shadow: 0 1rem 2.5rem rgb(9 25 66 / 0.25);
}

.transcribe-flow__source {
  display: flex;
  gap: 0.6rem;
  align-items: center;
}

.transcribe-flow__source img {
  width: 2rem;
  height: 2rem;
  background: white;
  border-radius: 6px;
}

.transcribe-flow strong {
  display: block;
  color: white;
  font-size: 0.76rem;
  line-height: 1.5;
}

.transcribe-flow__source span,
.transcribe-flow__heading > span,
.transcribe-flow__output span {
  display: block;
  font-size: 0.6rem;
  line-height: 1.6;
}

.transcribe-flow__wave {
  width: 6.6rem;
  height: 2rem;
  margin-left: auto;
  color: #79bbff;
  overflow: visible;
}

.transcribe-flow__connector {
  height: 1.7rem;
  padding-block: 0.2rem;
  text-align: center;
  color: #79bbff;
}

.transcribe-flow__connector svg {
  width: 1rem;
  height: 1.3rem;
}

.transcribe-flow__code {
  border: 1px solid rgb(204 237 249 / 0.28);
  border-radius: 6px;
  overflow: hidden;
}

.transcribe-flow__heading {
  display: flex;
  justify-content: space-between;
  gap: 0.6rem;
  align-items: center;
  padding: 0.65rem 0.8rem;
  background: var(--drupal-navy);
}

.transcribe-flow .highlight,
.transcribe-flow .highlight pre {
  margin: 0;
}

.transcribe-flow .highlight pre > code {
  padding: 0.8rem;
  color: var(--drupal-light-blue);
  background: transparent;
  font-size: 0.63rem;
  line-height: 1.7;
}

.transcribe-flow .highlight :is(.p, .w) {
  color: var(--drupal-light-blue);
}

.transcribe-flow .highlight .nt {
  color: #79bbff;
}

.transcribe-flow .highlight :is(.s, .s1, .s2) {
  color: #ffb39b;
}

.transcribe-flow .highlight :is(.m, .mi, .mf) {
  color: var(--drupal-yellow);
}

.transcribe-flow .md-code__button {
  color: var(--drupal-light-blue);
}

.transcribe-flow__output {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  padding-block: 0.7rem;
  border-block: 1px solid rgb(204 237 249 / 0.28);
}

.transcribe-flow figcaption {
  margin-top: 0.9rem;
  text-align: left;
  font-style: normal;
  color: var(--drupal-light-blue);
  font-size: 0.6rem;
  line-height: 1.6;
}

/* Change direction when the diagram itself has room for all three stages. */
@container (min-width: 35rem) {
  .md-typeset .transcribe-flow {
    display: grid;
    grid-template-columns:
      minmax(5.25rem, 1fr) 1.2rem
      minmax(15rem, 2.6fr) 1.2rem
      minmax(6.5rem, 1.25fr);
    gap: 0.6rem;
    align-items: center;
  }

  .transcribe-flow__source {
    flex-direction: column;
    align-items: flex-start;
    gap: 0.7rem;
  }

  .transcribe-flow__wave {
    width: 100%;
    max-width: 6.6rem;
    margin-left: 0;
  }

  .transcribe-flow__connector {
    display: flex;
    align-items: center;
    justify-content: center;
    height: 1.5rem;
    padding: 0;
  }

  .transcribe-flow__connector svg {
    transform: rotate(-90deg);
  }

  .transcribe-flow__output {
    flex-direction: column;
    gap: 1.2rem;
    padding: 0;
    border: 0;
  }

  .transcribe-flow figcaption {
    grid-column: 1 / -1;
  }
}

.drupal-home .drupal-section p {
  max-width: 70ch;
}

.transcribe-links {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem 2rem;
  margin-top: 1.6rem;
}

.transcribe-links a {
  font-weight: 600;
}

.transcribe-links > p {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem 2rem;
  margin: 0;
}

/* Keep home-page tables fluid instead of narrowing to their text content. */
.drupal-home .md-typeset__table {
  display: block;
}

.drupal-home .md-typeset__table table {
  display: table;
  width: 100%;
}

@media screen and (max-width: 76.1875em) {
  .md-header__title {
    display: none;
  }

  .md-header__button.md-logo {
    flex: 1;
  }
}

@media screen and (max-width: 45em) {
  .md-header__inner {
    padding-inline: 0.2rem;
  }

  .md-header__button.md-logo img.transcribe-logo {
    width: 7.5rem;
  }

  .drupal-hero__grid {
    grid-template-columns: 1fr;
    gap: 2.2rem;
    padding-top: 6.5rem;
    padding-bottom: 2.8rem;
  }

  .drupal-hero__copy > p {
    max-width: 36ch;
    font-size: 0.9rem;
  }

  .md-typeset .transcribe-flow {
    padding: 1rem;
  }

  .transcribe-flow__wave {
    width: 4.5rem;
  }

  .transcribe-flow__output {
    flex-wrap: wrap;
  }

  .drupal-section {
    padding-block: 2.5rem;
  }
}
