/* The units' public pages (apps/site/pages/units.ts, SEO-2), on top of landing.css (header, column,
   cards, discs, eyebrow, lead, footer): tokens only (apps/site/src/tokens.css). One breakpoint,
   layout.wide-min (900px — a media query cannot read a custom property). */

.unit-page {
  padding-top: var(--space-6);
}

/* Breadcrumb */

.crumbs ol {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  color: var(--color-text-muted);
  font-size: var(--type-callout-size);
  line-height: var(--type-callout-line);
  font-weight: var(--type-callout-weight);
}

.crumbs li + li::before {
  content: "›";
  content: "›" / "";
  padding: 0 var(--space-2);
}

.crumbs a {
  display: inline-flex;
  align-items: center;
  min-height: var(--size-touch-min);
  color: var(--color-text-muted);
}

.crumbs a[aria-current="page"] {
  color: var(--color-text);
  text-decoration: none;
}

/* The unit's head: its illustration disc, "Nível A1 · Unidade n", the H1, the Dutch title. */

.unit-head {
  display: flex;
  align-items: flex-start;
  gap: var(--space-4);
  margin-top: var(--space-4);
}

.unit-head .illustration {
  width: var(--size-unit-illustration);
  filter: var(--filter-illustration);
}

.unit-head-text {
  min-width: 0;
}

.unit-page h1 {
  margin-top: var(--space-1);
  font-family: var(--type-web-title-font);
  font-weight: var(--type-web-title-weight);
  font-size: var(--type-web-title-size);
  line-height: var(--type-web-title-line);
  letter-spacing: var(--type-web-title-tracking);
}

.unit-title-nl {
  margin-top: var(--space-2);
  color: var(--color-text-muted);
  font-weight: var(--type-body-strong-weight);
}

.unit-page .lead {
  max-width: var(--layout-column-max);
}

/* Sections */

.unit-section {
  margin-top: var(--space-12);
}

.unit-section h2 {
  font-family: var(--type-heading-font);
  font-weight: var(--type-heading-weight);
  font-size: var(--type-heading-size);
  line-height: var(--type-heading-line);
  letter-spacing: var(--type-heading-tracking);
}

.section-lead {
  max-width: var(--layout-column-max);
  margin-top: var(--space-2);
  color: var(--color-text-muted);
}

.goal-list {
  margin-top: var(--space-4);
  padding-left: var(--space-5);
  list-style: disc;
}

.goal-list li + li {
  margin-top: var(--space-2);
}

/* Words and phrases: one card each, its Dutch, the plural, the translation, the clip buttons. */

.entries {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, var(--size-web-unit-card-min)), 1fr));
  gap: var(--layout-card-gap);
  margin-top: var(--space-5);
}

.entries-wide {
  grid-template-columns: 1fr;
}

.entry {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  min-height: var(--size-row-unit);
  padding: var(--space-3) var(--space-4);
  border-radius: var(--radius-lg);
}

.entry-text {
  flex: 1;
  min-width: 0;
}

.entry-nl {
  font-weight: var(--type-body-strong-weight);
  overflow-wrap: anywhere;
}

.entry-nl .article {
  color: var(--color-text-muted);
  font-weight: var(--type-body-weight);
}

.entry-extra,
.entry-pt {
  color: var(--color-text-muted);
  font-size: var(--type-callout-size);
  line-height: var(--type-callout-line);
  font-weight: var(--type-callout-weight);
}

.entry-play {
  display: flex;
  flex: none;
  align-items: center;
  gap: var(--space-2);
}

.play,
.play-slow {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: var(--size-play-button);
  min-height: var(--size-play-button);
  margin: 0;
  border-radius: var(--radius-full);
  font: inherit;
  cursor: pointer;
}

.play {
  padding: 0;
  border: none;
  background: var(--color-accent);
  color: var(--color-on-accent);
}

.play .icon {
  width: var(--size-icon);
  height: var(--size-icon);
}

.play:hover {
  background: var(--color-accent-pressed);
}

.play-slow {
  padding: 0 var(--space-3);
  border: var(--size-ring) solid var(--color-border);
  background: var(--color-surface-raised);
  color: var(--color-text);
  font-size: var(--type-callout-size);
  line-height: var(--type-callout-line);
  font-weight: var(--type-body-strong-weight);
}

.play-slow:hover {
  background: var(--color-surface-pressed);
}

.play:focus-visible,
.play-slow:focus-visible {
  outline: var(--size-ring-strong) solid var(--color-focus);
  outline-offset: var(--size-ring-gap);
}

/* The play script's states: loading/playing ringed, a clip that did not come muted. */
.play[data-state="loading"],
.play[data-state="playing"],
.play-slow[data-state="loading"],
.play-slow[data-state="playing"] {
  box-shadow: 0 0 0 var(--size-ring-strong) var(--color-accent-surface);
}

.play[data-state="error"],
.play-slow[data-state="error"] {
  opacity: var(--opacity-disabled);
}

/* The one call to action */

.unit-cta {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: var(--space-4);
  margin-top: var(--space-12);
  padding: var(--layout-card-padding);
}

.unit-cta p {
  max-width: var(--layout-column-max);
}

/* Full width on a phone, where its text takes two lines; its own width from 900px. */
.unit-page .button-primary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  align-self: stretch;
  min-height: var(--size-button-height);
  padding: var(--space-2) var(--space-6);
  text-align: center;
  border-radius: var(--radius-button);
  background: var(--color-accent);
  box-shadow: var(--shadow-card);
  color: var(--color-on-accent);
  font-weight: var(--type-button-weight);
  font-size: var(--type-button-size);
  line-height: var(--type-button-line);
  text-decoration: none;
}

.unit-page .button-primary:hover {
  background: var(--color-accent-pressed);
}

/* Previous / next unit */

.unit-nav {
  display: grid;
  gap: var(--layout-card-gap);
  margin-top: var(--space-8);
}

.unit-link {
  display: flex;
  flex-direction: column;
  justify-content: center;
  min-height: var(--size-row-unit);
  padding: var(--space-3) var(--space-4);
  border-radius: var(--radius-lg);
  text-decoration: none;
}

.unit-link:hover {
  background: var(--color-surface-pressed);
}

.unit-link-title {
  font-weight: var(--type-body-strong-weight);
}

.unit-link-next {
  text-align: end;
}

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}

/* layout.wide-min */
@media (min-width: 900px) {
  .unit-page h1 {
    font-size: var(--type-web-title-wide-size);
    line-height: var(--type-web-title-wide-line);
    letter-spacing: var(--type-web-title-wide-tracking);
  }

  .entries {
    grid-template-columns: repeat(3, 1fr);
  }

  .entries-wide {
    grid-template-columns: repeat(2, 1fr);
  }

  .unit-page .button-primary {
    align-self: flex-start;
  }

  .unit-nav {
    grid-template-columns: 1fr 1fr;
  }

  .unit-link-next {
    grid-column: 2;
  }
}
