/* YT Channel Gallery — barvy uprav přes CSS proměnné v šabloně, např.:
   .ytcg { --ytcg-accent: #e00; --ytcg-radius: 6px; } */
.ytcg {
  --ytcg-accent: #ff0033;
  --ytcg-text: inherit;
  --ytcg-muted: color-mix(in srgb, currentColor 60%, transparent);
  --ytcg-border: color-mix(in srgb, currentColor 14%, transparent);
  --ytcg-radius: 12px;
  --ytcg-gap: 20px;
  container-type: inline-size;
  container-name: ytcg;
  margin: 0 0 1.5em;
  color: var(--ytcg-text);
}
.ytcg *, .ytcg *::before, .ytcg *::after { box-sizing: border-box; }

/* Hlavička kanálu */
.ytcg-head {
  display: flex; align-items: center; gap: 16px;
  padding: 16px; margin-bottom: var(--ytcg-gap);
  border: 1px solid var(--ytcg-border); border-radius: var(--ytcg-radius);
}
.ytcg-head__avatar img { display: block; width: 72px; height: 72px; border-radius: 50%; object-fit: cover; }
.ytcg-head__body { flex: 1; min-width: 0; }
.ytcg-head__title { margin: 0 0 2px; font-size: 1.15em; line-height: 1.3; }
.ytcg-head__title a { color: inherit; text-decoration: none; }
.ytcg-head__title a:hover { text-decoration: underline; }
.ytcg-head__stats { margin: 0; font-size: .875em; color: var(--ytcg-muted); }
.ytcg-head__desc { margin: 6px 0 0; font-size: .9em; line-height: 1.5; }

.ytcg-btn {
  flex-shrink: 0; display: inline-block; padding: 9px 18px; border-radius: 999px;
  background: var(--ytcg-accent); color: #fff !important; font-weight: 600; font-size: .9em;
  text-decoration: none !important; transition: filter .15s;
}
.ytcg-btn:hover { filter: brightness(1.1); }

/* Mřížka */
.ytcg-grid { display: grid; gap: var(--ytcg-gap); }
.ytcg-cols-1 { grid-template-columns: minmax(0, 1fr); }
.ytcg-cols-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.ytcg-cols-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.ytcg-cols-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.ytcg-cols-5 { grid-template-columns: repeat(5, minmax(0, 1fr)); }
.ytcg-cols-6 { grid-template-columns: repeat(6, minmax(0, 1fr)); }

@container ytcg (max-width: 960px) {
  .ytcg-cols-5, .ytcg-cols-6 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
@container ytcg (max-width: 700px) {
  .ytcg-grid:not(.ytcg-cols-1) { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@container ytcg (max-width: 440px) {
  .ytcg-grid { grid-template-columns: minmax(0, 1fr) !important; }
  .ytcg-head { flex-wrap: wrap; }
  .ytcg-head__avatar img { width: 56px; height: 56px; }
  .ytcg-btn { width: 100%; text-align: center; }
}

/* Položka */
.ytcg-item { display: flex; flex-direction: column; gap: 6px; color: inherit !important; text-decoration: none !important; }
.ytcg-thumb {
  position: relative; display: block; aspect-ratio: 16 / 9; overflow: hidden;
  border-radius: var(--ytcg-radius); background: #000;
}
.ytcg-thumb img { width: 100%; height: 100%; object-fit: cover; display: block; transition: transform .3s ease; }
.ytcg-item:hover .ytcg-thumb img, .ytcg-item:focus-visible .ytcg-thumb img { transform: scale(1.04); }
.ytcg-item:focus-visible { outline: 2px solid var(--ytcg-accent); outline-offset: 4px; border-radius: var(--ytcg-radius); }

.ytcg-play {
  position: absolute; inset: 50% auto auto 50%; width: 60px; height: 42px; transform: translate(-50%, -50%);
  border-radius: 12px; background: rgba(0, 0, 0, .65); opacity: 0; transition: opacity .2s, background .2s;
}
.ytcg-play::after {
  content: ""; position: absolute; inset: 50% auto auto 52%; transform: translate(-50%, -50%);
  border-style: solid; border-width: 9px 0 9px 15px; border-color: transparent transparent transparent #fff;
}
.ytcg-item:hover .ytcg-play, .ytcg-item:focus-visible .ytcg-play { opacity: 1; background: var(--ytcg-accent); }

.ytcg-badge {
  position: absolute; right: 8px; bottom: 8px; padding: 2px 6px; border-radius: 4px;
  background: rgba(0, 0, 0, .8); color: #fff; font-size: 12px; font-weight: 600; line-height: 1.4;
}
.ytcg-badge--live { background: var(--ytcg-accent); }

.ytcg-item__title {
  font-weight: 600; line-height: 1.35;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
.ytcg-item__meta { font-size: .85em; color: var(--ytcg-muted); }

.ytcg-more { margin: var(--ytcg-gap) 0 0; text-align: center; }
.ytcg-empty { color: var(--ytcg-muted); }

/* Lightbox */
html.ytcg-lock { overflow: hidden; }
.ytcg-modal[hidden] { display: none; }
.ytcg-modal { position: fixed; inset: 0; z-index: 999999; display: flex; align-items: center; justify-content: center; padding: 20px; }
.ytcg-modal__backdrop { position: absolute; inset: 0; background: rgba(0, 0, 0, .85); }
.ytcg-modal__box {
  position: relative; width: min(1000px, 100%); max-height: 100%; overflow: auto;
  background: #111; color: #eee; border-radius: 12px; box-shadow: 0 20px 60px rgba(0, 0, 0, .5);
}
.ytcg-modal__player { position: relative; aspect-ratio: 16 / 9; background: #000; }
.ytcg-modal__player iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }
.ytcg-modal__info { padding: 16px 20px 20px; }
.ytcg-modal__info h3 { margin: 0 0 4px; color: #fff; font-size: 1.15em; line-height: 1.35; }
.ytcg-modal__meta { margin: 0 0 10px; font-size: .85em; color: #aaa; }
.ytcg-modal__desc { margin: 0 0 12px; font-size: .9em; line-height: 1.55; white-space: pre-line; color: #ccc; max-height: 9em; overflow: auto; }
.ytcg-modal__link { color: #fff !important; font-weight: 600; }
.ytcg-modal__close {
  position: absolute; top: 8px; right: 8px; z-index: 2; width: 40px; height: 40px; border: 0; border-radius: 50%;
  background: rgba(0, 0, 0, .6); color: #fff; font-size: 26px; line-height: 1; cursor: pointer;
}
.ytcg-modal__close:hover { background: var(--ytcg-accent, #ff0033); }

@media (prefers-reduced-motion: reduce) {
  .ytcg-thumb img, .ytcg-play { transition: none; }
}
