/* Testimonials page ------------------------------------------------- */

.tm-form {
  padding-top: calc(var(--nav-h) + clamp(2.5rem, 6vw, 4.5rem));
}

.tm-form__inner {
  max-width: 42rem;
}

.tm-form__title {
  font-size: clamp(2.25rem, 1.4rem + 3.6vw, 4rem);
  font-weight: 200;
  line-height: 1.06;
  letter-spacing: -0.03em;
}

.tm-form .lede {
  margin-top: 1rem;
}

.tm-fields {
  display: grid;
  gap: 1.25rem;
  margin-top: 2.25rem;
}

.tm-row {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1.25rem;
}

.tm-field {
  display: grid;
  gap: 0.5rem;
  min-width: 0;
}

.tm-field label,
.tm-rating legend {
  padding: 0;
  font-size: 0.9375rem;
  color: var(--dim-on-ink);
}

.tm-field input,
.tm-field textarea {
  width: 100%;
  min-height: 3.25rem;
  padding: 0.75rem 1.1rem;
  border: 1px solid rgba(244, 245, 246, 0.3);
  border-radius: 12px;
  background: rgba(244, 245, 246, 0.06);
  color: var(--text-on-ink);
  font: inherit;
  font-weight: 300;
}

.tm-field textarea {
  min-height: 9rem;
  line-height: 1.5;
  resize: vertical;
}

.tm-field input::placeholder {
  color: #8d9399;
}

.tm-field [aria-invalid="true"] {
  border-color: var(--error-on-ink);
}

/* Star rating: five outlined stars that fill in when chosen */

.tm-rating {
  min-width: 0;
  margin: 0;
  padding: 0;
  border: 0;
}

.tm-rating legend {
  margin-bottom: 0.4rem;
}

.tm-stars {
  display: inline-flex;
  flex-direction: row-reverse;
  justify-content: flex-end;
  gap: 0.15rem;
}

.tm-stars input {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
  pointer-events: none;
}

.tm-stars label {
  display: block;
  padding: 0.2rem;
  border-radius: 8px;
  color: var(--orange-hi);
  cursor: pointer;
}

.tm-stars svg {
  display: block;
  width: 2.25rem;
  height: 2.25rem;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.4;
  stroke-linejoin: round;
  transition: fill 0.12s ease;
}

.tm-stars input:checked ~ label svg,
.tm-stars label:hover svg,
.tm-stars label:hover ~ label svg {
  fill: currentColor;
}

.tm-stars input:focus-visible + label {
  outline: 2px solid var(--orange);
  outline-offset: 2px;
}

.tm-rating[data-invalid="true"] .tm-stars label {
  color: var(--error-on-ink);
}

/* Spam trap: kept off screen, not display:none */
.tm-hp {
  position: absolute;
  left: -10000px;
  width: 1px;
  height: 1px;
  overflow: hidden;
}

.tm-status {
  min-height: 1.6em;
  font-size: 0.9375rem;
  color: var(--text-on-ink);
}

.tm-status[data-state="error"] {
  color: var(--error-on-ink);
}

.tm-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
}

.tm-actions .btn,
.tm-btn {
  min-height: 3.25rem;
  padding-inline: 2rem;
}

.tm-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid rgba(244, 245, 246, 0.4);
  border-radius: 980px;
  background: transparent;
  color: var(--text-on-ink);
  font: inherit;
  font-weight: 500;
  line-height: 1.2;
  cursor: pointer;
  transition: background-color 0.2s ease;
}

.tm-btn:hover {
  background: rgba(244, 245, 246, 0.1);
}

.tm-btn:disabled,
.tm-actions .btn:disabled {
  opacity: 0.6;
  cursor: default;
}

.tm-fine {
  max-width: 36rem;
  color: var(--dim-on-ink);
  font-size: 0.875rem;
}

/* List -------------------------------------------------------------- */

.tm-list__head {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  justify-content: space-between;
  gap: 1rem 2rem;
  margin-bottom: 1.5rem;
}

.tm-summary {
  margin-top: 0.4rem;
  color: var(--dim);
}

.tm-sort {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  color: var(--dim);
  font-size: 0.9375rem;
}

.tm-sort[hidden] {
  display: none;
}

.tm-sort select {
  min-height: 2.75rem;
  padding: 0.5rem 2.25rem 0.5rem 1rem;
  border: 1px solid var(--line);
  border-radius: 12px;
  background-color: var(--paper);
  color: var(--text-on-paper);
  font: inherit;
  font-size: 0.9375rem;
}

.tm-scroll {
  max-height: min(38rem, 75vh);
  overflow-y: auto;
  overscroll-behavior: contain;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: var(--fog);
}

.tm-items {
  display: grid;
  margin: 0;
  padding: 0;
  list-style: none;
}

.tm-item {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 0.25rem 1rem;
  padding: 1.35rem clamp(1rem, 3vw, 1.75rem);
  border-top: 1px solid var(--line);
}

.tm-item:first-child {
  border-top: 0;
}

.tm-avatar {
  display: grid;
  place-items: center;
  width: 3rem;
  height: 3rem;
  border-radius: 50%;
  background: var(--ink);
  color: var(--text-on-ink);
  font-size: 1rem;
  font-weight: 400;
  letter-spacing: 0.04em;
}

.tm-who {
  min-width: 0;
}

.tm-name {
  font-weight: 500;
}

.tm-where {
  color: var(--dim);
  font-size: 0.9375rem;
}

.tm-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0 0.75rem;
  margin-top: 0.15rem;
}

.tm-rated {
  display: inline-flex;
  gap: 0.1rem;
  color: var(--orange-deep);
}

.tm-rated svg {
  width: 1.05rem;
  height: 1.05rem;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.6;
  stroke-linejoin: round;
}

.tm-rated svg.on {
  fill: currentColor;
}

.tm-date {
  color: var(--dim);
  font-size: 0.875rem;
}

.tm-body {
  grid-column: 2;
  margin-top: 0.6rem;
}

.tm-head {
  font-size: 1.0625rem;
  font-weight: 500;
  overflow-wrap: anywhere;
}

.tm-text {
  margin-top: 0.35rem;
  line-height: 1.6;
  white-space: pre-line;
  overflow-wrap: anywhere;
}

.tm-empty {
  padding: 2rem clamp(1rem, 3vw, 1.75rem);
  color: var(--dim);
}

.tm-empty[hidden] {
  display: none;
}

@media (max-width: 36rem) {
  .tm-row {
    grid-template-columns: minmax(0, 1fr);
  }

  .tm-actions .btn,
  .tm-btn {
    flex: 1 1 8rem;
    padding-inline: 1rem;
  }

  .tm-body {
    grid-column: 1 / -1;
  }

  .tm-sort {
    width: 100%;
  }

  .tm-sort select {
    flex: 1;
  }
}
