/* Public channel page — /c/<slug> (CR-7b) */

.public-channel {
  width: 100%;
  padding: 0 0 4rem;
}

/* ---- Hero ---- */
.channel-hero {
  position: relative;
  width: 100%;
  height: 460px;
  background-size: cover;
  background-position: center;
}
.channel-hero.no-image { height: 250px; }
.channel-hero.is-loading { background-color: #1a1a1a; }
/* Left-to-right brand gradient: brand color fades to transparent (only on images) */
.channel-hero::before {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(90deg,
    var(--brand-color, #00617c) 0%,
    var(--brand-color, #00617c) 5%,
    transparent 35%);
  pointer-events: none;
  opacity: 0.85;
  z-index: 0;
}
.channel-hero.no-image::before { display: none; }
.channel-hero::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(0,0,0,0) 30%, rgba(0,0,0,0.65) 100%);
  pointer-events: none;
}
.channel-hero.no-image::after { display: none; }

.hero-overlay {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  max-width: 1280px;
  margin: 0 auto;
  padding: 1.5rem 1.6rem;
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 1rem;
  z-index: 2;
}
.hero-identity {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 0.5rem;
  min-width: 0;
}
.hero-logo {
  height: 80px;
  max-width: 280px;
  object-fit: contain;
  display: block;
}
.hero-name {
  font-size: 2rem;
  font-weight: 800;
  color: #fff;
  margin: 0;
  text-shadow: 0 2px 8px rgba(0,0,0,0.5);
}

.hero-manage-link {
  color: #fff;
  background: rgba(0,0,0,0.45);
  padding: 0.45rem 0.85rem;
  border-radius: 6px;
  font-size: 0.85rem;
  font-weight: 600;
  text-decoration: none;
  border: 1px solid rgba(255,255,255,0.25);
  flex-shrink: 0;
  align-self: flex-end;
  white-space: nowrap;
}
.hero-manage-link:hover { background: rgba(0,0,0,0.7); }

/* ---- Body ---- */
.channel-body {
  max-width: 1280px;
  margin: 0 auto;
  padding: 1.5rem 1.6rem 0;
}

.filter-row {
  display: flex;
  gap: 1rem;
  margin-bottom: 1.5rem;
  align-items: center;
}
.filter-row .search-input {
  flex: 1;
  padding: 0.65rem 0.9rem;
  background-color: #1a1a1a;
  border: 1px solid #333;
  border-radius: 6px;
  color: #eee;
  font-size: 0.95rem;
}
.filter-row .search-input:focus { border-color: #00b4ec; outline: none; }
.filter-row-secondary {
  display: flex;
  gap: 0.6rem;
}
.filter-select {
  padding: 0.65rem 0.8rem;
  background-color: #1a1a1a;
  border: 1px solid #333;
  border-radius: 6px;
  color: #eee;
  font-size: 0.95rem;
  min-width: 160px;
}

/* ---- Video grid ---- */
.video-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 1.2rem;
}
.video-card {
  display: block;
  background-color: #1a1a1a;
  border-radius: 8px;
  overflow: hidden;
  text-decoration: none;
  color: inherit;
  transition: transform 0.15s, box-shadow 0.15s;
}
.video-card:hover {
  transform: translateY(-3px);
  box-shadow: 0 8px 24px rgba(0,0,0,0.5);
}
.video-card-thumb {
  position: relative;
  aspect-ratio: 16 / 9;
  background-color: #2a2a2a;
  background-size: cover;
  background-position: center;
}
.video-card-thumb.no-thumb {
  display: flex;
  align-items: center;
  justify-content: center;
  color: #666;
  font-size: 0.85rem;
}
.video-card-thumb.no-thumb::after { content: 'No preview'; }
.video-card-duration {
  position: absolute;
  bottom: 6px;
  right: 8px;
  background: rgba(0,0,0,0.8);
  color: #fff;
  font-size: 0.78rem;
  font-weight: 600;
  padding: 1px 6px;
  border-radius: 3px;
}
.video-card-body { padding: 0.55rem 0.7rem 0.75rem; }
.video-card-title {
  font-weight: 600;
  font-size: 0.88rem;
  line-height: 1.3;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  margin-bottom: 0.35rem;
}
.video-card-meta {
  font-size: 0.74rem;
  color: #888;
}

/* ---- Empty / load more / error ---- */
.empty-state {
  text-align: center;
  padding: 3rem 1rem;
  color: #888;
}
.load-more-wrap {
  text-align: center;
  margin: 2rem 0 0;
}
.load-more-count {
  margin-top: 0.6rem;
  font-size: 0.85rem;
  color: #888;
}
.channel-error {
  text-align: center;
  padding: 5rem 1rem;
  color: #aaa;
  font-size: 1.05rem;
}
.grid-error { color: #f66; padding: 1rem 0; }

/* ---- Mobile ---- */
@media (max-width: 700px) {
  .channel-hero { height: 360px; }
  .channel-hero.no-image { height: 200px; }
  .hero-logo { height: 60px; max-width: 200px; }
  .hero-name { font-size: 1.5rem; }
  .filter-row { flex-direction: column; align-items: stretch; }
  .filter-row .search-input { width: 100%; }
  .filter-row-secondary { display: flex; }
  .filter-select { flex: 1; min-width: 0; }
  .video-grid { grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 1rem; }
  .channel-body { padding: 1rem; }
}

/* ---- Tabs (CR-7b polish) ---- */
.channel-tabs {
  max-width: 1280px;
  margin: 0 auto;
  padding: 0 1.6rem;
  display: flex;
  gap: 1.6rem;
  border-bottom: 1px solid #2a2a2a;
}
.channel-tab {
  background: none;
  border: none;
  color: #aaa;
  font-size: 0.95rem;
  font-weight: 600;
  padding: 0.8rem 0.2rem;
  margin-bottom: -1px;
  cursor: pointer;
  border-bottom: 2px solid transparent;
  transition: color 0.15s, border-color 0.15s;
}
.channel-tab:hover { color: #fff; }
.channel-tab.active {
  color: var(--brand-color, #00b4ec);
  border-bottom-color: var(--brand-color, #00b4ec);
}

.tab-panel { display: none; }
.tab-panel.active { display: block; }

.about-name {
  font-size: 1.8rem;
  font-weight: 800;
  margin: 1rem 0 0.6rem;
  color: #fff;
}
.about-desc {
  font-size: 1rem;
  color: #ccc;
  line-height: 1.55;
  white-space: pre-wrap;
  max-width: 880px;
}

/* ---- Video view (CR-7c) ---- */
.video-view { width: 100%; }
.video-view-inner {
  max-width: 1100px;
  margin: 0 auto;
  padding: 1.4rem 1.6rem 4rem;
}

.video-back-link {
  display: inline-block;
  color: #aaa;
  text-decoration: none;
  font-size: 0.9rem;
  margin-bottom: 1rem;
}
.video-back-link:hover { color: #fff; }

.video-player-wrap {
  width: 100%;
  background: #000;
  border-radius: 8px;
  overflow: hidden;
  margin-bottom: 1.2rem;
}
.video-iframe-wrap {
  position: relative;
  width: 100%;
  padding-bottom: 56.25%;
  height: 0;
}
.video-iframe-wrap iframe {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  border: 0;
}
.video-html5 {
  width: 100%;
  display: block;
  background: #000;
  aspect-ratio: 16 / 9;
}

.video-title {
  font-size: 1.6rem;
  font-weight: 800;
  color: #fff;
  margin: 0 0 0.4rem;
  line-height: 1.25;
}
.video-meta-line {
  font-size: 0.92rem;
  color: #bbb;
  margin-bottom: 0.25rem;
}
.video-meta-channel {
  color: var(--brand-color, #00b4ec);
  text-decoration: none;
  font-weight: 600;
}
.video-meta-channel:hover { text-decoration: underline; }
.video-genres-line {
  font-size: 0.85rem;
  color: #888;
  margin-bottom: 0.6rem;
}
.video-edit-link {
  display: inline-block;
  font-size: 0.82rem;
  color: #aaa;
  background: #1a1a1a;
  border: 1px solid #2a2a2a;
  padding: 0.3rem 0.7rem;
  border-radius: 5px;
  text-decoration: none;
  margin-bottom: 1rem;
}
.video-edit-link:hover { color: #fff; border-color: #444; }

.video-description {
  font-size: 0.98rem;
  color: #ddd;
  line-height: 1.55;
  white-space: pre-wrap;
  margin: 1rem 0 2.5rem;
}

/* Rail */
.video-rail {
  border-top: 1px solid #2a2a2a;
  padding-top: 1.2rem;
}
.video-rail-heading {
  font-size: 1.05rem;
  font-weight: 700;
  color: #ccc;
  margin: 0 0 0.9rem;
}
.video-rail-scroll {
  display: flex;
  gap: 1rem;
  overflow-x: auto;
  scroll-snap-type: x proximity;
  padding-bottom: 0.6rem;
}
.video-rail-scroll .video-card {
  flex: 0 0 220px;
  scroll-snap-align: start;
}

@media (max-width: 700px) {
  .video-view-inner { padding: 1rem; }
  .video-title { font-size: 1.25rem; }
  .video-rail-scroll .video-card { flex-basis: 180px; }
}

/* CR-10-img-relax: ensure cover/contain on uploaded images */
.hero-logo { object-position: center; }
