/* Treinamentos SGG — catálogo de vídeos (accordion + busca + modal) */
.tsgg-wrap {
  --tsgg-blue: #1d6fd6;
  --tsgg-blue-dark: #14509e;
  --tsgg-bg: #f5f7fa;
  --tsgg-card: #ffffff;
  --tsgg-border: #e2e6ec;
  --tsgg-text: #1f2733;
  --tsgg-muted: #6b7480;
  max-width: 980px;
  margin: 0 auto;
  color: var(--tsgg-text);
}

.tsgg-search-wrap {
  position: sticky;
  top: 0;
  z-index: 5;
  background: var(--tsgg-bg);
  padding: 4px 0 16px;
}

.tsgg-search {
  width: 100%;
  padding: 12px 16px;
  font-size: 1rem;
  border: 1px solid var(--tsgg-border);
  border-radius: 10px;
  background: var(--tsgg-card);
  color: var(--tsgg-text);
  outline: none;
  transition: border-color .15s, box-shadow .15s;
}
.tsgg-search:focus {
  border-color: var(--tsgg-blue);
  box-shadow: 0 0 0 3px rgba(29,111,214,.15);
}

.tsgg-count {
  margin: 8px 2px 0;
  font-size: .85rem;
  color: var(--tsgg-muted);
}

.tsgg-module {
  background: var(--tsgg-card);
  border: 1px solid var(--tsgg-border);
  border-radius: 12px;
  margin-bottom: 12px;
  overflow: hidden;
}

.tsgg-module > summary {
  list-style: none;
  cursor: pointer;
  padding: 14px 18px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-weight: 600;
  font-size: 1.02rem;
  user-select: none;
}
.tsgg-module > summary::-webkit-details-marker { display: none; }

.tsgg-module > summary .tsgg-badge {
  font-weight: 500;
  font-size: .78rem;
  color: #fff;
  background: var(--tsgg-blue);
  border-radius: 999px;
  padding: 2px 10px;
  margin-left: 10px;
  white-space: nowrap;
}

.tsgg-module > summary::after {
  content: "\25BE";
  margin-left: auto;
  padding-left: 12px;
  color: var(--tsgg-muted);
  transition: transform .15s;
}
.tsgg-module[open] > summary::after { transform: rotate(180deg); }

.tsgg-module-title { display: flex; align-items: center; }

.tsgg-video-list {
  border-top: 1px solid var(--tsgg-border);
  padding: 6px 10px;
}

.tsgg-video-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 10px;
  border-radius: 8px;
}
.tsgg-video-row:hover { background: var(--tsgg-bg); }
.tsgg-video-row + .tsgg-video-row { border-top: 1px solid #f0f2f5; }

.tsgg-video-title {
  font-size: .93rem;
  line-height: 1.35;
}
.tsgg-video-title mark {
  background: #fff1a8;
  color: inherit;
  border-radius: 3px;
  padding: 0 1px;
}

.tsgg-watch-btn {
  flex-shrink: 0;
  border: none;
  cursor: pointer;
  background: var(--tsgg-blue);
  color: #fff;
  font-size: .82rem;
  font-weight: 600;
  padding: 7px 14px;
  border-radius: 8px;
  transition: background .15s;
}
.tsgg-watch-btn:hover { background: var(--tsgg-blue-dark); }

.tsgg-empty {
  text-align: center;
  color: var(--tsgg-muted);
  padding: 40px 10px;
  display: none;
}

/* Modal */
.tsgg-modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(10, 14, 20, .75);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 2000;
  padding: 20px;
}
.tsgg-modal-overlay.tsgg-open { display: flex; }

.tsgg-modal-box {
  width: 100%;
  max-width: 900px;
  background: #000;
  border-radius: 10px;
  overflow: hidden;
  position: relative;
  box-shadow: 0 20px 60px rgba(0,0,0,.5);
}

.tsgg-modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: #10151c;
  color: #fff;
  padding: 10px 14px;
  font-size: .9rem;
  font-weight: 600;
}

.tsgg-modal-close {
  background: none;
  border: none;
  color: #fff;
  font-size: 1.3rem;
  line-height: 1;
  cursor: pointer;
  padding: 2px 6px;
}
.tsgg-modal-close:hover { color: #ff5c5c; }

.tsgg-modal-frame-wrap {
  position: relative;
  width: 100%;
  padding-top: 56.25%;
  background: #000;
}
.tsgg-modal-frame-wrap iframe {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  border: 0;
}

@media (prefers-color-scheme: dark) {
  .tsgg-wrap {
    --tsgg-bg: #12161d;
    --tsgg-card: #1b212b;
    --tsgg-border: #2a3140;
    --tsgg-text: #e7ebf1;
    --tsgg-muted: #8b93a1;
  }
  .tsgg-video-row:hover { background: #232a35; }
  .tsgg-video-row + .tsgg-video-row { border-top-color: #262d38; }
}
