/* 공유영상 목록 · 와치 */

.videos-page .catalog-main {
  padding-top: 2rem;
}

.videos-hero {
  margin-bottom: 1.5rem;
}

.videos-hero h1 {
  margin: 0 0 0.4rem;
  font-size: clamp(1.6rem, 3vw, 2.1rem);
  letter-spacing: -0.03em;
}

.videos-hero p {
  margin: 0;
  color: var(--color-text-muted);
  max-width: 38rem;
}

.videos-toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  margin-bottom: 1.5rem;
}

.videos-search,
.videos-filter {
  display: flex;
}

.videos-search input,
.videos-filter select {
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.1);
  color: inherit;
  border-radius: 10px;
  padding: 0.65rem 0.85rem;
  font: inherit;
  min-width: 0;
}

.videos-search {
  flex: 1 1 16rem;
}

.videos-search input {
  width: 100%;
}

.videos-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 1.25rem 1rem;
}

.video-card {
  color: inherit;
  text-decoration: none;
  display: flex;
  flex-direction: column;
  gap: 0.7rem;
  min-width: 0;
}

.video-card:hover .video-card-thumb {
  transform: translateY(-2px);
}

.video-card-thumb {
  position: relative;
  aspect-ratio: 16 / 9;
  border-radius: 12px;
  overflow: hidden;
  background: #121826;
  transition: transform 0.2s ease;
}

.video-card-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.video-card-thumb-ph {
  width: 100%;
  height: 100%;
  display: grid;
  place-items: center;
  color: rgba(255, 255, 255, 0.35);
}

.video-card-platform {
  position: absolute;
  left: 0.4rem;
  bottom: 0.4rem;
  padding: 0.12rem 0.4rem;
  border-radius: 999px;
  background: rgba(0, 0, 0, 0.65);
  color: #fff;
  font-size: 0.68rem;
  font-weight: 650;
}

.video-card-title {
  margin: 0;
  font-size: 0.95rem;
  font-weight: 650;
  line-height: 1.35;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.video-card-channel {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  min-width: 0;
}

.video-card-avatar,
.vw-channel-avatar {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  object-fit: cover;
  background: #1c2433;
  flex-shrink: 0;
}

.video-card-meta {
  min-width: 0;
}

.video-card-channel-name {
  display: block;
  font-size: 0.8rem;
  color: var(--color-text-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.video-card-stats {
  display: block;
  font-size: 0.75rem;
  color: rgba(255, 255, 255, 0.45);
}

.videos-empty,
.videos-loading {
  grid-column: 1 / -1;
  padding: 2.5rem 1.25rem;
  text-align: center;
}

.videos-empty h3,
.videos-loading p {
  margin: 0 0 0.4rem;
}

.videos-empty p {
  margin: 0;
  color: var(--color-text-muted);
}

@media (max-width: 1100px) {
  .videos-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}

@media (max-width: 720px) {
  .videos-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1rem 0.7rem; }
  .video-card-title { font-size: 0.86rem; }
}

/* Watch */

.vw-page .catalog-main {
  max-width: 960px;
}

.vw-page.is-watch-split .catalog-main {
  max-width: var(--content-max);
  padding-top: 1.25rem;
  padding-bottom: 2rem;
}

.vw-page.is-watch-split .vw-layout {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 0 2rem;
  align-items: start;
}

.vw-page.is-watch-split .vw-stage,
.vw-page.is-watch-split .vw-side {
  position: sticky;
  top: calc(var(--header-h) + 0.85rem);
}

.vw-page.is-watch-split .vw-player-wrap.is-tiktok {
  --vw-fit-h: calc(100dvh - var(--header-h) - 5.25rem);
  width: min(360px, 38vw, calc(var(--vw-fit-h) * 9 / 16));
  max-width: none;
  max-height: var(--vw-fit-h);
  margin: 0;
}

.vw-page.is-watch-split .vw-tiktok-open {
  text-align: left;
}

.vw-page.is-watch-split .vw-side {
  max-height: calc(100dvh - var(--header-h) - 1.7rem);
  overflow: auto;
  padding-right: 0.15rem;
}

.vw-page.is-watch-split .vw-meta {
  margin-top: 0;
}

.vw-page.is-watch-wide .catalog-main {
  max-width: var(--content-max);
}

.vw-page.is-watch-wide .vw-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.45fr) minmax(300px, 0.7fr);
  grid-template-areas:
    "stage comments"
    "meta comments";
  gap: 1rem 2rem;
  align-items: start;
}

.vw-page.is-watch-wide .vw-side {
  display: contents;
}

.vw-page.is-watch-wide .vw-stage {
  grid-area: stage;
}

.vw-page.is-watch-wide .vw-meta {
  grid-area: meta;
  margin: 0;
}

.vw-page.is-watch-wide .vw-comments {
  grid-area: comments;
  position: sticky;
  top: calc(var(--header-h) + 1rem);
  max-height: calc(100dvh - var(--header-h) - 2rem);
  overflow: auto;
  padding-left: 1.35rem;
  border-left: 1px solid rgba(255, 255, 255, 0.08);
}

.vw-page.is-watch-wide .vw-desc {
  max-height: 11em;
}

.vw-player-wrap {
  position: relative;
  width: 100%;
  aspect-ratio: 16 / 9;
  background: #000;
  border-radius: 14px;
  overflow: hidden;
}

.vw-player-wrap iframe {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  border: 0;
}

.vw-player-wrap.is-tiktok {
  aspect-ratio: 9 / 16;
  max-width: 420px;
  margin: 0 auto;
}

.vw-tiktok-open {
  margin: 0.65rem 0 0;
  text-align: center;
}

.vw-nav {
  display: flex;
  justify-content: space-between;
  gap: 0.55rem;
  margin-top: 0.75rem;
}

.vw-nav-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 2.35rem;
  padding: 0.45rem 0.85rem;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.12);
  color: inherit;
  text-decoration: none;
  font-size: 0.85rem;
  font-weight: 650;
}

.vw-nav-btn.is-prev::before {
  content: "‹";
  margin-right: 0.35rem;
  font-size: 1.1em;
}

.vw-nav-btn.is-next::after {
  content: "›";
  margin-left: 0.35rem;
  font-size: 1.1em;
}

.vw-nav-btn:hover {
  background: rgba(255, 255, 255, 0.14);
}

.vw-nav-btn.is-disabled {
  opacity: 0.35;
  pointer-events: none;
}

.vw-tiktok-open a {
  color: var(--color-text-muted);
  font-size: 0.85rem;
}

.vw-meta {
  margin: 1.1rem 0 1.5rem;
}

.vw-title {
  margin: 0 0 0.75rem;
  font-size: clamp(1.15rem, 2.2vw, 1.45rem);
  letter-spacing: -0.02em;
  line-height: 1.35;
}

.vw-channel {
  display: flex;
  align-items: center;
  gap: 0.7rem;
  color: inherit;
  text-decoration: none;
}

.vw-channel-avatar {
  width: 40px;
  height: 40px;
}

.vw-channel-name {
  font-weight: 650;
}

.vw-channel-sub {
  display: block;
  font-size: 0.8rem;
  color: var(--color-text-muted);
}

.vw-desc {
  margin: 1rem 0 0;
  color: var(--color-text-muted);
  font-size: 0.92rem;
  line-height: 1.55;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  max-height: 4.8em;
  overflow: hidden;
}

.vw-desc a {
  color: var(--color-cta-lime);
  text-decoration: underline;
  text-underline-offset: 0.15em;
}

.vw-desc.is-open {
  max-height: none;
}

.vw-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  margin: 0.75rem 0 0;
}

.vw-tag {
  font-size: 0.78rem;
  color: var(--color-text-muted);
  background: rgba(255, 255, 255, 0.06);
  padding: 0.14rem 0.5rem;
  border-radius: 999px;
}

.vw-desc-toggle {
  margin-top: 0.4rem;
  background: none;
  border: 0;
  color: var(--color-cta-lime);
  font: inherit;
  cursor: pointer;
  padding: 0;
}

.vw-comments h2 {
  margin: 0 0 0.9rem;
  font-size: 1.05rem;
}

.vw-composer {
  display: flex;
  gap: 0.6rem;
  margin-bottom: 1.1rem;
}

.vw-composer textarea {
  flex: 1;
  min-height: 2.8rem;
  resize: vertical;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 10px;
  color: inherit;
  font: inherit;
  padding: 0.65rem 0.8rem;
}

.vw-login-cta {
  margin-bottom: 1rem;
  padding: 0.9rem 1rem;
}

.vw-comment-list {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.vw-comment {
  display: grid;
  grid-template-columns: 36px 1fr auto;
  gap: 0.65rem 0.75rem;
  align-items: start;
}

.vw-comment-body {
  margin: 0.15rem 0 0;
  font-size: 0.92rem;
  line-height: 1.5;
  white-space: pre-wrap;
}

.vw-comment-time {
  font-size: 0.75rem;
  color: var(--color-text-muted);
}

.vw-comment-del {
  background: none;
  border: 0;
  color: var(--color-text-muted);
  cursor: pointer;
  font: inherit;
  font-size: 0.8rem;
}

.vw-comment-fab {
  display: none;
}

.vw-sheet,
.vw-sheet-backdrop {
  display: none;
}

.vw-error {
  padding: 3rem 1rem;
  text-align: center;
}

@media (max-width: 768px) {
  .vw-page.is-watch-mobile .site-header,
  .vw-page.is-watch-mobile .site-footer,
  .vw-page.is-watch-mobile .footer-aurora-stage {
    display: none;
  }

  .vw-page.is-watch-mobile {
    background: #05070c;
  }

  .vw-page.is-watch-mobile .catalog-main {
    max-width: none;
    padding: 0;
    margin: 0;
  }

  .vw-page.is-watch-portrait .vw-stage {
    position: fixed;
    inset: 0;
    background: #000;
    display: flex;
    flex-direction: column;
    align-items: stretch;
    justify-content: center;
  }

  .vw-page.is-watch-portrait .vw-player-wrap {
    border-radius: 0;
    width: 100%;
  }

  .vw-page.is-watch-portrait.is-portrait-video .vw-stage {
    overflow: hidden;
  }

  .vw-page.is-watch-portrait .vw-nav {
    position: absolute;
    right: max(0.7rem, env(safe-area-inset-right));
    bottom: max(5.5rem, calc(env(safe-area-inset-bottom) + 4.7rem));
    left: auto;
    margin: 0;
    flex-direction: column;
    z-index: 8;
  }

  .vw-page.is-watch-portrait .vw-nav-btn {
    min-width: 4.6rem;
    background: rgba(18, 24, 38, 0.82);
  }

  .vw-page.is-watch-portrait .vw-nav-btn.is-prev::before,
  .vw-page.is-watch-portrait .vw-nav-btn.is-next::after {
    content: none;
    margin: 0;
  }

  .vw-page.is-watch-portrait .vw-nav-btn.is-prev::after {
    content: "↑";
    margin-left: 0.3rem;
  }

  .vw-page.is-watch-portrait .vw-nav-btn.is-next::after {
    content: "↓";
    margin-left: 0.3rem;
  }

  .vw-page.is-watch-portrait.is-portrait-video .vw-player-wrap.is-tiktok {
    position: absolute;
    left: 50%;
    top: 50%;
    width: max(100vw, calc(100dvh * 9 / 16));
    height: max(100dvh, calc(100vw * 16 / 9));
    max-width: none;
    max-height: none;
    aspect-ratio: 9 / 16;
    margin: 0;
    transform: translate(-50%, -50%);
  }

  .vw-page.is-watch-portrait .vw-layout > .vw-side {
    display: none;
  }

  .vw-page.is-watch-portrait .vw-sheet .vw-side {
    display: block;
  }

  .vw-page.is-watch-portrait .vw-comment-fab {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    position: fixed;
    right: max(1rem, env(safe-area-inset-right));
    bottom: max(1.2rem, env(safe-area-inset-bottom));
    z-index: 30;
    border: 0;
    border-radius: 999px;
    padding: 0.7rem 0.95rem;
    background: rgba(18, 24, 38, 0.92);
    color: #fff;
    font: inherit;
    font-weight: 650;
    cursor: pointer;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.35);
  }

  .vw-page.is-watch-portrait .vw-sheet-backdrop {
    display: block;
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.35);
    z-index: 40;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.22s ease;
  }

  .vw-page.is-watch-portrait.is-sheet-open .vw-sheet-backdrop {
    opacity: 1;
    pointer-events: auto;
  }

  .vw-page.is-watch-portrait .vw-sheet {
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    height: 60vh;
    z-index: 50;
    background: #10151f;
    border-radius: 16px 16px 0 0;
    transform: translateY(110%);
    transition: transform 0.28s cubic-bezier(0.16, 1, 0.3, 1);
    display: flex;
    flex-direction: column;
    overflow: hidden;
  }

  .vw-page.is-watch-portrait.is-sheet-open .vw-sheet {
    transform: none;
  }

  .vw-sheet-handle {
    flex: 0 0 auto;
    width: 42px;
    height: 4px;
    border-radius: 99px;
    background: rgba(255, 255, 255, 0.28);
    margin: 0.55rem auto 0.4rem;
  }

  .vw-sheet-scroll {
    overflow: auto;
    padding: 0 1rem 1.25rem;
    flex: 1;
  }

  .vw-page.is-watch-landscape .vw-stage {
    position: relative;
    display: block;
  }

  .vw-page.is-watch-landscape .vw-player-wrap {
    border-radius: 0;
  }

  .vw-page.is-watch-landscape.is-portrait-video .vw-player-wrap.is-tiktok {
    width: min(100%, calc(100dvh * 9 / 16));
    max-width: none;
    margin: 0 auto;
  }

  .vw-page.is-watch-landscape .vw-side {
    padding: 0.9rem 1rem 1.5rem;
  }

  .vw-page.is-watch-landscape .vw-sheet {
    display: none;
  }
}

@media (prefers-reduced-motion: reduce) {
  .vw-page.is-watch-portrait .vw-sheet,
  .vw-page.is-watch-portrait .vw-sheet-backdrop,
  .video-card-thumb {
    transition: none;
  }
}
