/* AfriFlex — Content components */

.af-page-title {
  padding: 24px 16px 12px;
  font-size: 1.5rem;
  font-weight: 700;
}

.af-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
  gap: 12px;
  padding: 0 16px 32px;
}
@media (min-width: 640px) {
  .af-grid { grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: 16px; }
}
@media (min-width: 1024px) {
  .af-grid { grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 20px; }
}

.af-card {
  display: block;
  background: var(--af-surface);
  border-radius: 12px;
  overflow: hidden;
  transition: transform .2s ease, box-shadow .2s ease;
}
.af-card:hover { transform: translateY(-3px); box-shadow: 0 12px 30px rgba(0,0,0,.5); }
.af-card-img {
  position: relative;
  aspect-ratio: 2/3;
  overflow: hidden;
  background: #0a0a0e;
}
.af-card-img img {
  width: 100%; height: 100%; object-fit: cover;
  transition: transform .35s ease;
}
.af-card:hover .af-card-img img { transform: scale(1.06); }
.af-card-badge {
  position: absolute;
  top: 8px; left: 8px;
  background: rgba(0,0,0,.7);
  color: #fff;
  font-size: .68rem;
  padding: 3px 8px;
  border-radius: 999px;
  backdrop-filter: blur(6px);
}
.af-card-play {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(0,0,0,.35);
  color: #fff;
  font-size: 2rem;
  opacity: 0;
  transition: opacity .25s;
}
.af-card:hover .af-card-play { opacity: 1; }
.af-card-body { padding: 10px 12px 12px; }
.af-card-title {
  font-size: .85rem; font-weight: 600;
  line-height: 1.25;
  margin-bottom: 3px;
  overflow: hidden;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
}
.af-card-meta { font-size: .72rem; color: var(--af-muted); }

.af-cat-strip {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding: 0 16px 12px;
  scrollbar-width: none;
}
.af-cat-strip::-webkit-scrollbar { display: none; }
.af-cat-chip {
  display: inline-flex;
  align-items: center;
  padding: 8px 14px;
  border-radius: 999px;
  background: var(--af-surface-2);
  color: #cfcfd6;
  font-size: .8rem;
  white-space: nowrap;
  transition: background .2s, color .2s;
}
.af-cat-chip:hover { background: #26262f; }
.af-cat-chip.active { background: var(--af-red); color: #fff; }

.af-seasons { display: grid; gap: 8px; }
.af-season-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 16px;
  background: var(--af-surface);
  border-radius: 10px;
  transition: background .2s;
}
.af-season-row:hover { background: var(--af-surface-2); }

.af-episodes { display: grid; gap: 10px; padding-bottom: 32px; }
.af-episode-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px;
  background: var(--af-surface);
  border-radius: 12px;
  transition: background .2s;
}
.af-episode-row:hover { background: var(--af-surface-2); }
.af-episode-thumb {
  width: 120px; height: 68px;
  object-fit: cover; border-radius: 8px;
  flex-shrink: 0;
  background: #0a0a0e;
}
.af-episode-info { flex: 1; min-width: 0; }
.af-episode-title {
  font-size: .92rem; font-weight: 600;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.af-episode-meta {
  font-size: .75rem; color: var(--af-muted);
  margin-top: 3px;
  display: flex; gap: 8px; align-items: center;
}
.af-episode-play {
  color: var(--af-red);
  font-size: 1.4rem;
  flex-shrink: 0;
}
.af-chip-mini {
  font-size: .65rem;
  background: var(--af-surface-2);
  padding: 2px 8px;
  border-radius: 999px;
}

.af-progress-bar {
  display: block;
  position: absolute;
  bottom: 0; left: 0; right: 0;
  height: 4px;
  background: rgba(0,0,0,.6);
}
.af-progress-bar > span {
  display: block;
  height: 100%;
  background: var(--af-red);
}
.af-progress-bar.small {
  position: relative;
  margin-top: 6px;
  height: 3px;
  border-radius: 2px;
}

.af-breadcrumb {
  padding: 8px 0;
  font-size: .8rem;
  color: var(--af-muted);
}
.af-breadcrumb a { color: var(--af-muted); }
.af-breadcrumb a:hover { color: var(--af-text); }

.af-search-item {
  display: flex;
  gap: 12px;
  padding: 12px 0;
  border-bottom: 1px solid rgba(255,255,255,.05);
  align-items: center;
}
.af-search-item img { border-radius: 8px; flex-shrink: 0; }
.af-search-item:last-child { border-bottom: none; }

.af-pagination {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 6px;
  padding: 24px 16px;
  flex-wrap: wrap;
}
.af-page {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 36px;
  height: 36px;
  padding: 0 10px;
  border-radius: 8px;
  background: var(--af-surface);
  font-size: .85rem;
  color: var(--af-text);
  transition: background .2s;
}
.af-page:hover { background: var(--af-surface-2); }
.af-page.active { background: var(--af-red); color: #fff; }
.af-page-dots { color: var(--af-muted); padding: 0 4px; }

.af-grid-cats {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  gap: 12px;
  padding: 0 16px 32px;
}
.af-cat-card {
  display: block;
  padding: 20px 16px;
  background: var(--af-surface);
  border-radius: 12px;
  transition: background .2s, transform .2s;
}
.af-cat-card:hover { background: var(--af-surface-2); transform: translateY(-2px); }
.af-cat-card-title { font-weight: 700; font-size: .95rem; }
.af-cat-card-meta { font-size: .75rem; color: var(--af-muted); margin-top: 4px; }

.btn-sm {
  padding: 8px 12px;
  font-size: .8rem;
  border-radius: 6px;
}
/* ═══════════════════════════════════════════
   Category → Subcategory drill-down (home)
   ═══════════════════════════════════════════ */
.af-category-browse {
    padding-bottom: 8px;
}

.af-cat-chip {
    cursor: pointer;
    border: 1px solid transparent;
    font-family: inherit;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    transition: background .18s, color .18s, border-color .18s;
}
.af-cat-chip.active {
    background: var(--af-red);
    color: #fff;
    border-color: var(--af-red);
}
.af-cat-chip:not(.active):hover {
    background: rgba(255,255,255,.06);
}
.af-chip-count {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 18px;
    height: 18px;
    padding: 0 5px;
    background: rgba(255,255,255,.15);
    color: inherit;
    border-radius: 999px;
    font-size: .65rem;
    font-weight: 700;
}
.af-cat-chip.active .af-chip-count {
    background: rgba(255,255,255,.28);
}

/* Subcategory panel */
.af-subcat-panel {
    padding: 4px 16px 12px;
    animation: af-fade .25s ease both;
}
.af-subcat-group {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px;
    margin-bottom: 10px;
}
.af-subcat-list {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    flex: 1;
    min-width: 0;
}
.af-subcat-chip {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 14px;
    background: var(--af-surface);
    border: 1px solid rgba(255,255,255,.08);
    border-radius: 999px;
    color: var(--af-text);
    font-size: .82rem;
    text-decoration: none;
    transition: background .18s, border-color .18s;
    white-space: nowrap;
}
.af-subcat-chip:hover {
    background: var(--af-surface-2);
    border-color: var(--af-red);
}
.af-subcat-chip .af-count {
    display: inline-block;
    background: rgba(229,9,20,.2);
    color: #ff6b6b;
    padding: 1px 7px;
    border-radius: 999px;
    font-size: .68rem;
    font-weight: 700;
}
.af-view-all-link {
    display: inline-block;
    color: var(--af-red);
    font-size: .8rem;
    font-weight: 600;
    text-decoration: none;
    padding: 6px 0;
    white-space: nowrap;
}
.af-view-all-link:hover { text-decoration: underline; }

/* Mobile tweaks */
@media (max-width: 640px) {
    .af-subcat-panel { padding: 4px 16px 12px; }
    .af-subcat-chip { padding: 8px 12px; font-size: .78rem; }
    .af-view-all-link { width: 100%; }
}
