/* ---- Media library ------------------------------------------------------ */

.media {
  margin-block: var(--section-gap);
}

.media-upload {
  max-width: 34rem;
  margin-bottom: 1.25rem;
  padding: 1rem;
  border: 1px dashed var(--ta-border-strong);
  border-radius: var(--ta-r);
}

.media-empty {
  color: var(--ta-muted);
}

.media-table {
  width: 100%;
}

.media-table code {
  font-size: 0.8rem;
  color: var(--ta-muted);
  word-break: break-all;
}

/* Preview thumbnails are locked to a uniform 16:9 box so a large upload
   doesn't blow out the table or stretch the media. Images/videos keep their
   proportions via object-fit; the box stays consistent row to row. */
.media-preview {
  width: 10rem;
  min-width: 10rem;
}

.media-preview>* {
  display: block;
  width: 100%;
}

.media-preview img,
.media-preview video {
  aspect-ratio: 16 / 9;
  object-fit: cover;
  border-radius: var(--ta-r-sm);
  background: #000;
}

/* Vector SVGs get a dedicated preview: contained (never cover-cropped like
   raster images) on a checkerboard so transparent regions read clearly.
   Higher specificity than the img rule above so it wins. */
.media-preview .media-svg-preview {
  object-fit: contain;
  padding: 0.35rem;
  background-color: var(--ta-surface);
  background-image:
    linear-gradient(45deg, var(--ta-surface-2) 25%, transparent 25%, transparent 75%, var(--ta-surface-2) 75%),
    linear-gradient(45deg, var(--ta-surface-2) 25%, transparent 25%, transparent 75%, var(--ta-surface-2) 75%);
  background-size: 12px 12px;
  background-position: 0 0, 6px 6px;
}

.media-preview audio {
  object-fit: contain;
}

.media-preview object {
  aspect-ratio: 16 / 9;
  object-fit: contain;
  border: 1px solid var(--ta-border);
  border-radius: var(--ta-r-sm);
}

.media-preview .media-text-preview {
  margin: 0;
  aspect-ratio: 16 / 9;
  overflow: hidden;
  padding: 0.4rem 0.5rem;
  font-size: 0.7rem;
  line-height: 1.35;
  color: var(--ta-muted);
  background: var(--ta-surface-2);
  border: 1px solid var(--ta-border);
  border-radius: var(--ta-r-sm);
  white-space: pre-wrap;
  word-break: break-all;
}

.media-preview .media-no-preview {
  display: flex;
  align-items: center;
  justify-content: center;
  height: 100%;
  min-height: 3.5rem;
  padding: 0.4rem;
  font-size: 0.75rem;
  color: var(--ta-faint);
  border: 1px dashed var(--ta-border-strong);
  border-radius: var(--ta-r-sm);
}

/* Responsive: landing grids collapse to one column on small screens. */
@media (max-width: 720px) {

  .feature-grid.cols-3 .feature-grid-list,
  .feature-grid.cols-4 .feature-grid-list {
    grid-template-columns: 1fr;
  }

  .hero:has(.hero-media) {
    padding-block: clamp(4rem, 14vw, 6rem);
  }

  .logos .logos-row {
    gap: 1.5rem 2rem;
  }
}

