/**
 * Video catalog on /learn and the homepage grid.
 *
 * Kept apart from content.css so a change to the catalog layout cannot reflow an article,
 * and so the homepage can load just this sheet for its tutorials section.
 */

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.learn-count {
  margin: 8px 0 0;
  color: var(--text-secondary, #5e6b87);
  font-weight: 600;
}

.learn-catalog,
.home-videos {
  padding: 64px 0 80px;
  background: var(--background, #f5f3ef);
}

.learn-toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 16px 20px;
  align-items: center;
  margin-bottom: 32px;
}

.learn-search {
  flex: 1 1 280px;
}

.learn-search input {
  width: 100%;
  padding: 14px 18px;
  border: 2px solid #e8e4df;
  border-radius: 12px;
  background: #fff;
  font: inherit;
  font-size: 16px;
}

.learn-search input:focus {
  outline: none;
  border-color: #e2725b;
  box-shadow: 0 0 0 4px rgba(226, 114, 91, 0.12);
}

.learn-kinds {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.learn-kind {
  padding: 8px 14px;
  border: 1px solid rgba(46, 58, 89, 0.14);
  border-radius: 999px;
  background: #fff;
  color: var(--text-secondary, #5e6b87);
  font: inherit;
  font-size: 0.9rem;
  font-weight: 600;
  cursor: pointer;
}

.learn-kind.is-active,
.learn-kind:hover {
  border-color: #e2725b;
  color: #2e3a59;
}

.learn-empty {
  margin: 0 0 24px;
  color: var(--text-secondary, #5e6b87);
}

.learn-video-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 24px;
}

.learn-video-card {
  display: flex;
  flex-direction: column;
  background: #fff;
  border: 1px solid rgba(46, 58, 89, 0.1);
  border-radius: 18px;
  overflow: hidden;
  box-shadow: 0 8px 24px rgba(46, 58, 89, 0.06);
}

.learn-video-thumb {
  position: relative;
  display: block;
  background: #1b1b1b;
}

.learn-video-thumb img {
  display: block;
  width: 100%;
  height: auto;
  aspect-ratio: 16 / 9;
  object-fit: cover;
}

.learn-video-duration {
  position: absolute;
  right: 10px;
  bottom: 10px;
  padding: 3px 8px;
  border-radius: 6px;
  background: rgba(0, 0, 0, 0.78);
  color: #fff;
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.02em;
}

.learn-video-body {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 16px 18px 18px;
  min-width: 0;
}

.learn-video-kind {
  margin: 0;
  color: #b64b39;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.learn-video-body h3 {
  margin: 0;
  font-size: 1.05rem;
  font-weight: 700;
  line-height: 1.35;
}

.learn-video-body h3 a {
  color: #2e3a59;
  text-decoration: none;
}

.learn-video-body h3 a:hover {
  color: #b64b39;
}

.learn-video-subject,
.learn-video-blurb {
  margin: 0;
  color: var(--text-secondary, #5e6b87);
  font-size: 0.92rem;
  line-height: 1.5;
}

.learn-video-links {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 16px;
  margin: 10px 0 0;
  font-size: 0.88rem;
  font-weight: 600;
}

.learn-video-links a {
  color: #b64b39;
}

.learn-playlist {
  padding: 0 0 80px;
  background: #fff;
}

.learn-playlist h2 {
  margin: 0 0 8px;
}

.learn-playlist p {
  max-width: 62ch;
  margin: 0 0 24px;
  color: var(--text-secondary, #5e6b87);
}

.learn-playlist .video-embed {
  max-width: 900px;
  margin: 0 auto;
}

.home-videos .section-header {
  margin-bottom: 36px;
}

.home-videos-more {
  margin: 32px 0 0;
  text-align: center;
}

@media (max-width: 640px) {
  .learn-catalog,
  .home-videos {
    padding: 40px 0 56px;
  }
}
