/*
 * SezTube :: module/channel/assets/ch.css
 * Yol: /module/channel/assets/ch.css
 * Açıklama: Kanal sayfası, Abonelikler sayfası, Abone ol düğmesi, kanalı özelleştir penceresi.
 *           Sadece core.css değişkenlerine (--st-*) bağlıdır. Önek: ch-
 *           Abone ol düğmesi ve .ch-owner izleme sayfasında da kullanılır (embed ile yüklenir).
 */

/* ---------- Abone ol düğmesi (her yerde ortak) ---------- */
.ch-sub {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px; flex: none;
  height: 40px; padding: 0 18px; border-radius: 999px; border: 1px solid transparent;
  font-size: 14px; font-weight: 700; line-height: 1; white-space: nowrap; cursor: pointer;
  color: var(--st-bg); background: var(--st-text);
  transition: background .2s, color .2s, transform .15s var(--st-ease), opacity .2s;
}
.ch-sub:hover { opacity: .9; }
.ch-sub:active { transform: scale(.96); }
.ch-sub .ch-ico-on { display: none; }
.ch-sub.is-on { color: var(--st-text); background: var(--st-surface-2); border-color: var(--st-border-strong); }
.ch-sub.is-on:hover { background: var(--st-surface-3); opacity: 1; }
.ch-sub.is-on .ch-ico-on { display: inline-block; }
.ch-sub.is-on .ch-ico-off { display: none; }
.ch-sub__ico { display: inline-grid; place-items: center; }
.ch-sub--manage { color: var(--st-text); background: var(--st-surface-2); border-color: var(--st-border-strong); }
.ch-sub--manage:hover { background: var(--st-surface-3); opacity: 1; }
.ch-sub.is-busy { opacity: .6; pointer-events: none; }

/* ---------- İzleme sayfasındaki yükleyen bloğu ---------- */
.ch-owner { justify-content: space-between; gap: 14px; width: 100%; }
.ch-owner__who { display: flex; align-items: center; gap: 12px; min-width: 0; }
.ch-owner__text { display: flex; flex-direction: column; min-width: 0; }
.ch-owner__text strong { font-size: 15px; font-weight: 680; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; transition: color .2s; }
.ch-owner__text > span { font-size: 12.5px; color: var(--st-text-3); }
@media (hover: hover) { .ch-owner__who:hover strong { color: var(--st-accent); } }
@media (min-width: 768px) { .ch-owner { width: auto; justify-content: flex-start; gap: 20px; } }

/* ---------- Sayfa iskeleti ---------- */
.ch-page { width: 100%; max-width: 1400px; margin: 0 auto; padding-bottom: 20px; }
.ch-muted { color: var(--st-text-3); font-size: 14px; padding: 8px 2px; }
.ch-opt { font-weight: 500; color: var(--st-text-3); }

/* ---------- Banner ---------- */
.ch-banner {
  position: relative; overflow: hidden; aspect-ratio: 16 / 5; width: 100%;
  background: linear-gradient(120deg, hsl(var(--ch-h, 260), 62%, 34%), hsl(calc(var(--ch-h, 260) + 60), 66%, 26%));
}
.ch-banner img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
@media (min-width: 768px) {
  .ch-banner { aspect-ratio: 6 / 1; min-height: 120px; max-height: 240px; width: auto; margin: 20px 28px 0; border-radius: 22px; }
}

/* ---------- Kanal başlığı ---------- */
.ch-head { display: flex; align-items: flex-start; gap: 16px; padding: 16px 14px 6px; }
.ch-avatar { flex: none; --ch-av: 72px; margin-top: 2px; }
.ch-avatar .st-avatar { width: var(--ch-av) !important; height: var(--ch-av) !important; font-size: calc(var(--ch-av) * .42) !important; }
.ch-id { min-width: 0; flex: 1; }
.ch-name { font-size: 22px; font-weight: 800; letter-spacing: -.025em; line-height: 1.2; overflow-wrap: anywhere; }
.ch-stats { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 8px; margin-top: 4px; font-size: 13px; color: var(--st-text-2); }
.ch-stats i { width: 3px; height: 3px; border-radius: 50%; background: currentColor; opacity: .7; }
.ch-bio { margin-top: 10px; font-size: 14px; line-height: 1.5; color: var(--st-text-2); overflow-wrap: anywhere; }
.ch-bio__more { font-size: 14px; font-weight: 700; color: var(--st-text); }
.ch-bio__more:hover { color: var(--st-accent); }
.ch-cta { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; margin-top: 14px; }

@media (max-width: 599px) {
  .ch-head { flex-wrap: wrap; }
  .ch-id { flex-basis: calc(100% - 90px); }
  .ch-cta { flex-basis: 100%; }
  .ch-cta .ch-sub { flex: 1; }
}
@media (min-width: 768px) {
  .ch-head { gap: 28px; padding: 24px 28px 8px; }
  .ch-avatar { --ch-av: 128px; }
  .ch-name { font-size: 32px; }
  .ch-stats { font-size: 14px; margin-top: 6px; }
  .ch-bio { max-width: 720px; font-size: 14.5px; }
  .ch-cta { margin-top: 16px; }
}

/* ---------- Sekmeler ---------- */
.ch-tabsbar {
  position: sticky; z-index: 40; top: calc(var(--st-topbar-h) + var(--st-safe-t));
  margin-top: 12px; padding: 0 14px;
  background: var(--st-glass); border-bottom: 1px solid var(--st-border);
  -webkit-backdrop-filter: saturate(1.5) blur(18px); backdrop-filter: saturate(1.5) blur(18px);
}
.ch-tabs { display: flex; gap: 4px; overflow-x: auto; scrollbar-width: none; }
.ch-tabs::-webkit-scrollbar { display: none; }
.ch-tab {
  position: relative; flex: none; height: 48px; padding: 0 18px;
  font-size: 14.5px; font-weight: 650; color: var(--st-text-2); transition: color .2s;
}
.ch-tab:hover { color: var(--st-text); }
.ch-tab.is-active { color: var(--st-text); }
.ch-tab.is-active::after {
  content: ""; position: absolute; left: 12px; right: 12px; bottom: -1px; height: 3px;
  border-radius: 3px 3px 0 0; background: var(--st-grad);
}
@media (min-width: 768px) { .ch-tabsbar { padding: 0 28px; } }

.ch-pane { padding: 14px 12px 8px; animation: ch-in .4s var(--st-ease) both; }
@media (min-width: 768px) { .ch-pane { padding: 20px 28px 8px; } }
.ch-sorts { margin-bottom: 16px; }

/* ---------- Video ızgarası ve kart ---------- */
.ch-grid { display: grid; grid-template-columns: minmax(0, 1fr); gap: 22px 16px; }
@media (min-width: 600px) { .ch-grid { grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); } }
@media (min-width: 768px) { .ch-grid { gap: 28px 20px; } }

.ch-card { display: flex; flex-direction: column; gap: 10px; min-width: 0; animation: ch-in .45s var(--st-ease) both; }
.ch-card__thumb {
  position: relative; display: block; aspect-ratio: 16 / 9; overflow: hidden; border-radius: 14px; background: var(--st-surface-2);
  transition: box-shadow .3s var(--st-ease), transform .2s var(--st-ease);
}
.ch-card__thumb::after { content: ""; position: absolute; inset: 0; border-radius: inherit; box-shadow: inset 0 0 0 1px var(--st-border); pointer-events: none; }
.ch-card__thumb img { width: 100%; height: 100%; object-fit: cover; transition: transform .5s var(--st-ease); }
a.ch-card__thumb:active { transform: scale(.985); }
.ch-ph {
  display: grid; place-items: center; width: 100%; height: 100%; color: rgba(255, 255, 255, .85);
  background: linear-gradient(135deg, hsl(var(--ch-h, 260), 68%, 48%), hsl(calc(var(--ch-h, 260) + 55), 72%, 36%));
}
.ch-dur {
  position: absolute; right: 8px; bottom: 8px; padding: 2px 7px; border-radius: 8px;
  font-size: 12px; font-weight: 650; line-height: 1.5; color: #fff; font-variant-numeric: tabular-nums; background: rgba(8, 8, 14, .78);
}
.ch-vis {
  position: absolute; left: 8px; top: 8px; padding: 2px 8px; border-radius: 8px;
  font-size: 11.5px; font-weight: 700; color: #fff; background: rgba(8, 8, 14, .72);
}
.ch-card__body { padding: 0 2px; min-width: 0; }
.ch-card__title { font-size: 15px; font-weight: 660; line-height: 1.35; }
.ch-card__title a { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; transition: color .2s; }
.ch-card__by { margin-top: 3px; font-size: 13px; color: var(--st-text-2); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ch-card__meta { display: flex; align-items: center; gap: 6px; margin-top: 2px; font-size: 12.5px; color: var(--st-text-3); white-space: nowrap; overflow: hidden; }
.ch-card__meta i { flex: none; width: 3px; height: 3px; border-radius: 50%; background: currentColor; opacity: .7; }
@media (hover: hover) {
  .ch-card:hover .ch-card__thumb { box-shadow: 0 16px 36px -18px rgba(124, 92, 255, .6); }
  .ch-card:hover .ch-card__thumb img { transform: scale(1.05); }
  .ch-card:hover .ch-card__title a { color: var(--st-accent); }
}
.ch-more { display: flex; justify-content: center; padding: 22px 0 8px; }

/* ---------- Hakkında ---------- */
.ch-about { display: grid; grid-template-columns: minmax(0, 1fr); gap: 22px; max-width: 1000px; }
.ch-about__title { margin: 0 0 8px; font-size: 16px; font-weight: 720; }
.ch-about__main > .ch-about__title:not(:first-child) { margin-top: 22px; }
.ch-about__text { font-size: 14.5px; line-height: 1.6; color: var(--st-text-2); overflow-wrap: anywhere; }
.ch-about__text a { color: var(--st-accent); }
.ch-about__text a:hover { text-decoration: underline; }
.ch-about__link { display: inline-flex; align-items: center; gap: 8px; font-size: 14px; font-weight: 600; color: var(--st-accent); overflow-wrap: anywhere; }
.ch-about__link:hover { text-decoration: underline; }
.ch-about__stats { display: grid; gap: 4px; padding: 6px 16px; border-radius: 18px; background: var(--st-surface); border: 1px solid var(--st-border); align-self: start; margin: 0; }
.ch-about__stats > div { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 12px 0; }
.ch-about__stats > div + div { border-top: 1px solid var(--st-border); }
.ch-about__stats dt { display: inline-flex; align-items: center; gap: 10px; font-size: 13.5px; color: var(--st-text-2); }
.ch-about__stats dt .st-icon { color: var(--st-text-3); }
.ch-about__stats dd { margin: 0; font-size: 14px; font-weight: 700; font-variant-numeric: tabular-nums; }
@media (min-width: 900px) { .ch-about { grid-template-columns: minmax(0, 1fr) 320px; gap: 32px; } }

/* ---------- Abonelikler sayfası ---------- */
.ch-page--subs { padding: 16px 14px 24px; }
.ch-subs-head { margin-bottom: 18px; }
.ch-subs-title { font-size: 24px; font-weight: 800; letter-spacing: -.03em; }
.ch-subs-sub { margin-top: 4px; font-size: 14px; color: var(--st-text-2); }
.ch-block + .ch-block { margin-top: 28px; }
.ch-block__title { margin-bottom: 14px; font-size: 17px; font-weight: 740; letter-spacing: -.01em; }
.ch-strip { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 12px; }
.ch-chan {
  display: flex; flex-direction: column; align-items: center; gap: 12px; padding: 18px 12px 14px; text-align: center;
  border-radius: 20px; background: var(--st-surface); border: 1px solid var(--st-border);
  transition: border-color .2s, transform .2s var(--st-ease);
}
.ch-chan:hover { border-color: var(--st-border-strong); }
.ch-chan__link { display: flex; flex-direction: column; align-items: center; gap: 4px; min-width: 0; width: 100%; }
.ch-chan__link .st-avatar { margin-bottom: 6px; }
.ch-chan__name { max-width: 100%; font-size: 14.5px; font-weight: 700; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ch-chan__meta { font-size: 12.5px; color: var(--st-text-3); }
@media (min-width: 768px) { .ch-page--subs { padding: 28px 28px 40px; } .ch-subs-title { font-size: 30px; } }

/* ---------- Kanalı özelleştir penceresi ---------- */
.ch-dialog { position: fixed; inset: 0; z-index: 95; display: flex; align-items: flex-end; justify-content: center; }
.ch-dialog[hidden] { display: none; }
.ch-dialog__backdrop {
  position: absolute; inset: 0; background: rgba(4, 4, 9, .66);
  -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px); opacity: 0; transition: opacity .25s;
}
.ch-dialog.is-open .ch-dialog__backdrop { opacity: 1; }
.ch-dialog__panel {
  position: relative; display: flex; flex-direction: column; width: 100%; max-height: 92dvh; max-height: 92vh;
  border-radius: 26px 26px 0 0; background: var(--st-surface); border: 1px solid var(--st-border-strong); border-bottom: 0;
  box-shadow: var(--st-shadow-lg); transform: translateY(100%); transition: transform .4s var(--st-ease);
  padding-bottom: var(--st-safe-b);
}
.ch-dialog.is-open .ch-dialog__panel { transform: none; }
.ch-dialog__head { display: flex; align-items: center; justify-content: space-between; padding: 14px 12px 10px 20px; border-bottom: 1px solid var(--st-border); }
.ch-dialog__head h2 { font-size: 17px; font-weight: 740; }
.ch-dialog__body { display: flex; flex-direction: column; gap: 18px; padding: 18px 20px; overflow-y: auto; overscroll-behavior: contain; }
.ch-dialog__foot { display: flex; justify-content: flex-end; gap: 10px; padding: 12px 20px 16px; border-top: 1px solid var(--st-border); }
.ch-dialog__prog { height: 3px; background: var(--st-surface-3); }
.ch-dialog__prog i { display: block; width: 100%; height: 100%; background: var(--st-grad); transform-origin: left; transform: scaleX(0); transition: transform .2s linear; }
.ch-dialog.is-busy .ch-dialog__body { opacity: .55; pointer-events: none; }
@media (min-width: 640px) {
  .ch-dialog { align-items: center; padding: 20px; }
  .ch-dialog__panel { max-width: 560px; border-radius: 26px; border-bottom: 1px solid var(--st-border-strong); transform: translateY(18px) scale(.97); opacity: 0; transition: transform .4s var(--st-spring), opacity .25s; padding-bottom: 0; }
  .ch-dialog.is-open .ch-dialog__panel { opacity: 1; }
}

.ch-pickb {
  position: relative; display: grid; place-items: center; aspect-ratio: 6 / 1; min-height: 72px; overflow: hidden; border-radius: 14px;
  background: linear-gradient(120deg, hsl(var(--ch-h, 260), 50%, 30%), hsl(calc(var(--ch-h, 260) + 60), 54%, 24%));
  border: 1px solid var(--st-border);
}
.ch-pickb img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.ch-pickb__ph { display: inline-flex; align-items: center; gap: 8px; font-size: 13px; font-weight: 600; color: rgba(255, 255, 255, .85); }
.ch-pick-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.ch-pick-actions label, .ch-picka label { cursor: pointer; }
.ch-pick-actions label:focus-within, .ch-picka label:focus-within { box-shadow: var(--st-ring); }
.ch-picka { display: flex; align-items: center; gap: 14px; }
.ch-picka__img .st-avatar img { width: 100%; height: 100%; }

@keyframes ch-in { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }
