/* ── sub-video.css ── */

/* ══════════════════════════════════════════
   탭 네비게이션
   ══════════════════════════════════════════ */
.vd-tabs {
  display: flex;
  gap: 0;
  margin-bottom: 36px;
  border-bottom: 2px solid #e8eef8;
}

.vd-tab {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 14px 30px;
  font-size: 15px;
  font-weight: 700;
  color: #6b7280;
  background: none;
  border: none;
  cursor: pointer;
  position: relative;
  transition: color 0.22s;
  letter-spacing: -0.3px;
}

.vd-tab::after {
  content: '';
  position: absolute;
  bottom: -2px;
  left: 0;
  right: 0;
  height: 3px;
  background: var(--color-primary, #3a7bd5);
  border-radius: 3px 3px 0 0;
  transform: scaleX(0);
  transition: transform 0.28s cubic-bezier(0.22, 0.68, 0, 1.2);
}

.vd-tab.is-active {
  color: var(--color-primary, #3a7bd5);
}

.vd-tab.is-active::after {
  transform: scaleX(1);
}

.vd-tab:hover:not(.is-active) {
  color: #475569;
}

.vd-tab i {
  font-size: 17px;
}

.vd-tab-count {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 22px;
  height: 22px;
  padding: 0 6px;
  background: #e8eef8;
  color: #64748b;
  font-size: 11px;
  font-weight: 800;
  border-radius: 100px;
  transition: background 0.2s, color 0.2s;
}

.vd-tab.is-active .vd-tab-count {
  background: var(--color-primary, #3a7bd5);
  color: #fff;
}

/* ── 탭 패널 ── */
.vd-tab-panel {
  display: none;
}
.vd-tab-panel.is-active {
  display: block;
}

/* ══════════════════════════════════════════
   섹션 타이틀
   ══════════════════════════════════════════ */
.vd-section-header {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 24px;
  padding-bottom: 16px;
  border-bottom: 1px solid #e8eef8;
}

.vd-section-icon {
  width: 40px;
  height: 40px;
  background: linear-gradient(135deg, #ff4040, #cc0000);
  color: #fff;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  flex-shrink: 0;
  box-shadow: 0 4px 12px rgba(255, 0, 0, 0.25);
}

.vd-section-title {
  font-size: 18px;
  font-weight: 800;
  color: #0f172a;
  letter-spacing: -0.4px;
  margin: 0;
}

.vd-section-sub {
  font-size: 13px;
  color: #6b7280;
  font-weight: 500;
  margin-left: auto;
  flex-shrink: 0;
}

/* ══════════════════════════════════════════
   동영상 그리드
   ══════════════════════════════════════════ */
.vd-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 28px 20px;
}

.vd-card {
  border-radius: 16px;
  overflow: hidden;
  background: #fff;
  box-shadow:
    0 1px 3px rgba(15, 30, 60, 0.06),
    0 4px 16px rgba(15, 30, 60, 0.07);
  cursor: pointer;
  transition:
    transform 0.28s cubic-bezier(0.22, 0.68, 0, 1.2),
    box-shadow 0.28s ease;
  position: relative;
  outline: none;
  border: none;
  padding: 0;
  text-align: left;
  width: 100%;
  display: block;
  font-family: inherit;
  font-size: inherit;
  color: inherit;
}

.vd-card::after {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: 16px;
  border: 2px solid transparent;
  transition: border-color 0.22s;
  pointer-events: none;
}

.vd-card:hover,
.vd-card:focus-visible {
  transform: translateY(-7px);
  box-shadow:
    0 4px 16px rgba(58, 123, 213, 0.14),
    0 16px 40px rgba(15, 30, 60, 0.13);
}

.vd-card:hover::after,
.vd-card:focus-visible::after {
  border-color: var(--color-primary, #3a7bd5);
}

/* ── 썸네일 ── */
.vd-thumb-wrap {
  position: relative;
  width: 100%;
  aspect-ratio: 16 / 9;
  overflow: hidden;
  background: #1e293b;
}

.vd-thumb {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: transform 0.4s cubic-bezier(0.22, 0.68, 0, 1.1), opacity 0.3s;
}

.vd-card:hover .vd-thumb,
.vd-card:focus-visible .vd-thumb {
  transform: scale(1.06);
  opacity: 0.8;
}

/* 썸네일 플레이스홀더 */
.vd-thumb-placeholder {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(140deg, #1e293b, #0f172a);
  font-size: 42px;
  color: #334155;
}

/* ── 재생 버튼 오버레이 ── */
.vd-play-btn {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  pointer-events: none;
}

.vd-play-icon {
  width: 60px;
  height: 60px;
  background: rgba(255, 255, 255, 0.90);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 24px rgba(0, 0, 0, 0.40);
  transition:
    transform 0.28s cubic-bezier(0.22, 0.68, 0, 1.2),
    background 0.2s;
}

.vd-play-icon i {
  font-size: 24px;
  color: #ff0000;
  margin-left: 3px;
}

.vd-card:hover .vd-play-icon,
.vd-card:focus-visible .vd-play-icon {
  transform: scale(1.18);
  background: #fff;
}

/* ── 카드 본문 ── */
.vd-card-body {
  padding: 14px 16px 16px;
}

.vd-card-title {
  font-size: 14px;
  font-weight: 700;
  color: #0f172a;
  line-height: 1.65;
  margin: 0 0 10px;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  word-break: keep-all;
  letter-spacing: -0.3px;
}

.vd-card-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.vd-yt-badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  background: #ff0000;
  color: #fff;
  font-size: 11px;
  font-weight: 800;
  padding: 4px 10px;
  border-radius: 6px;
}

.vd-card-date {
  font-size: 11px;
  color: #6b7280;
  font-weight: 500;
  white-space: nowrap;
}

/* ══════════════════════════════════════════
   쇼츠 그리드
   ══════════════════════════════════════════ */
.vd-shorts-grid {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 20px 14px;
}

.vd-shorts-card {
  border-radius: 14px;
  overflow: hidden;
  background: #fff;
  box-shadow:
    0 1px 3px rgba(15, 30, 60, 0.06),
    0 4px 16px rgba(15, 30, 60, 0.07);
  cursor: pointer;
  transition:
    transform 0.28s cubic-bezier(0.22, 0.68, 0, 1.2),
    box-shadow 0.28s ease;
  position: relative;
  outline: none;
  border: none;
  padding: 0;
  text-align: left;
  width: 100%;
  display: block;
  font-family: inherit;
  font-size: inherit;
  color: inherit;
}

.vd-shorts-card::after {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: 14px;
  border: 2px solid transparent;
  transition: border-color 0.22s;
  pointer-events: none;
}

.vd-shorts-card:hover,
.vd-shorts-card:focus-visible {
  transform: translateY(-6px);
  box-shadow:
    0 4px 16px rgba(255, 64, 64, 0.14),
    0 12px 32px rgba(15, 30, 60, 0.13);
}

.vd-shorts-card:hover::after,
.vd-shorts-card:focus-visible::after {
  border-color: #ff4040;
}

/* ── 쇼츠 썸네일 (9:16) ── */
.vd-shorts-thumb-wrap {
  position: relative;
  width: 100%;
  aspect-ratio: 9 / 16;
  overflow: hidden;
  background: #1e293b;
}

.vd-shorts-thumb-wrap .vd-thumb {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.vd-shorts-badge {
  position: absolute;
  top: 8px;
  left: 8px;
  background: #ff0000;
  color: #fff;
  font-size: 9px;
  font-weight: 900;
  padding: 3px 8px;
  border-radius: 5px;
  letter-spacing: 0.6px;
  z-index: 1;
}

.vd-shorts-play {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  pointer-events: none;
}

.vd-shorts-play-icon {
  width: 44px;
  height: 44px;
  background: rgba(255, 255, 255, 0.90);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.40);
  transition:
    transform 0.28s cubic-bezier(0.22, 0.68, 0, 1.2),
    background 0.2s;
}

.vd-shorts-play-icon i {
  font-size: 18px;
  color: #ff0000;
  margin-left: 2px;
}

.vd-shorts-card:hover .vd-shorts-play-icon,
.vd-shorts-card:focus-visible .vd-shorts-play-icon {
  transform: scale(1.18);
  background: #fff;
}

/* ── 쇼츠 카드 본문 ── */
.vd-shorts-body {
  padding: 10px 12px 12px;
}

.vd-shorts-title {
  font-size: 12px;
  font-weight: 700;
  color: #0f172a;
  line-height: 1.55;
  margin: 0 0 6px;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  word-break: keep-all;
  letter-spacing: -0.2px;
}

.vd-shorts-date {
  font-size: 10px;
  color: #6b7280;
  font-weight: 500;
}

/* ══════════════════════════════════════════
   모달 오버레이
   ══════════════════════════════════════════ */
.vd-modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.86);
  z-index: 9999;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 28px 20px;
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
}

.vd-modal-overlay.is-open {
  display: flex;
}

.vd-modal {
  background: #0f172a;
  border-radius: 20px;
  overflow: hidden;
  max-width: 880px;
  width: 100%;
  position: relative;
  box-shadow: 0 24px 80px rgba(0, 0, 0, 0.7);
  animation: vdModalIn 0.32s cubic-bezier(0.22, 0.68, 0, 1.2);
}

.vd-modal--shorts {
  max-width: 380px;
}

@keyframes vdModalIn {
  from { transform: scale(0.88) translateY(20px); opacity: 0; }
  to   { transform: scale(1) translateY(0);        opacity: 1; }
}

/* ── iframe 래퍼 ── */
.vd-modal-iframe-wrap {
  position: relative;
  width: 100%;
  padding-bottom: 56.25%;
  background: #000;
}

.vd-modal--shorts .vd-modal-iframe-wrap {
  padding-bottom: 177.78%;
}

.vd-modal-iframe {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  border: none;
}

/* ── 모달 하단 ── */
.vd-modal-footer {
  padding: 14px 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  border-top: 1px solid rgba(255, 255, 255, 0.06);
}

.vd-modal-title {
  font-size: 13px;
  font-weight: 700;
  color: #cbd5e1;
  line-height: 1.5;
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.vd-modal-yt-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: #ff0000;
  color: #fff !important;
  font-size: 12px;
  font-weight: 700;
  padding: 7px 15px;
  border-radius: 8px;
  text-decoration: none !important;
  flex-shrink: 0;
  transition: background 0.2s, transform 0.18s;
}

.vd-modal-yt-link:hover {
  background: #cc0000;
  transform: translateY(-1px);
}

/* ── 닫기 버튼 ── */
.vd-modal-close {
  position: absolute;
  top: -18px;
  right: -18px;
  width: 44px;
  height: 44px;
  background: #fff;
  border: none;
  border-radius: 50%;
  font-size: 20px;
  color: #1e293b;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.35);
  transition: background 0.2s, transform 0.22s cubic-bezier(0.22, 0.68, 0, 1.2);
  z-index: 10;
}

.vd-modal-close:hover {
  background: #fee2e2;
  color: #dc2626;
  transform: scale(1.12) rotate(90deg);
}

/* ══════════════════════════════════════════
   반응형
   ══════════════════════════════════════════ */
@media (max-width: 1200px) {
  .vd-shorts-grid { grid-template-columns: repeat(4, 1fr); }
}

@media (max-width: 1024px) {
  .vd-grid { grid-template-columns: repeat(2, 1fr); }
  .vd-shorts-grid { grid-template-columns: repeat(3, 1fr); }
}

@media (max-width: 767px) {
  .vd-tabs { margin-bottom: 24px; }
  .vd-tab { padding: 12px 16px; font-size: 14px; }
  .vd-grid { grid-template-columns: repeat(2, 1fr); gap: 18px 12px; }
  .vd-shorts-grid { grid-template-columns: repeat(3, 1fr); gap: 14px 10px; }
  .vd-card-body { padding: 12px 14px 14px; }
  .vd-card-title { font-size: 13px; }
  .vd-play-icon { width: 48px; height: 48px; }
  .vd-play-icon i { font-size: 19px; }
  .vd-modal-close { top: -14px; right: -14px; width: 36px; height: 36px; font-size: 17px; }
  .vd-section-title { font-size: 16px; white-space: nowrap; min-width: 0; flex: 1 1 auto; }
  .vd-section-sub { display: none; }
}

@media (max-width: 479px) {
  .vd-grid { grid-template-columns: 1fr; }
  .vd-shorts-grid { grid-template-columns: repeat(2, 1fr); }
  .vd-tab { padding: 10px 12px; font-size: 13px; }
  .vd-tab-count { display: none; }
}
