/* ==========================================================================
   최신글 스킨 : 유튜브 영상 카드 (dd__utb)
   --------------------------------------------------------------------------
   카드 그리드 + 가운데 재생 버튼 + 팝업 재생.
   부르는 쪽에서 열 수를 바꾸고 싶으면 감싸는 요소에서
   .lat_utb { grid-template-columns: ... } 로 덮어쓰면 됩니다.
   ========================================================================== */
.lat_utb {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 3rem 2.4rem;
}

/* 카드 전체가 버튼 (키보드로도 열립니다) */
.lat_utb .itv_open {
  display: block;
  width: 100%;
  padding: 0;

  background: none;
  border: 0;
  cursor: pointer;
  text-align: left;
}

.lat_utb .itv_thumb {
  position: relative;
  overflow: hidden;
  border-radius: 1.6rem;
  background: var(--ink-2);
}

.lat_utb .itv_thumb img {
  display: block;
  width: 100%;
  /* 유튜브 hqdefault 는 4:3 이라 위아래에 검은 띠가 있습니다.
     16:9 로 잘라내 띠를 감춥니다. */
  aspect-ratio: 16 / 9;
  object-fit: cover;
  transition: transform 0.5s;
}

.lat_utb .itv_item:hover .itv_thumb img {
  transform: scale(1.05);
}

/* 가운데 재생 버튼 : 유튜브 빨강 대신 브랜드 주홍 */
.lat_utb .itv_play {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);

  display: flex;
  align-items: center;
  justify-content: center;

  width: 5.6rem;
  height: 5.6rem;
  border-radius: 50%;
  background: var(--brand);
  box-shadow: 0 0.6rem 2rem rgba(0, 0, 0, 0.35);
  transition: transform 0.3s, background 0.3s;
}

/* 삼각형은 CSS 로 그립니다 (아이콘 라이브러리에 기대지 않습니다) */
.lat_utb .itv_play::before {
  content: "";
  margin-left: 0.4rem;

  border-style: solid;
  border-width: 0.9rem 0 0.9rem 1.5rem;
  border-color: transparent transparent transparent #fff;
}

.lat_utb .itv_item:hover .itv_play {
  transform: translate(-50%, -50%) scale(1.08);
  background: var(--brand-dark);
}

.lat_utb .itv_info {
  padding: 1.8rem 0.4rem 0;
}

.lat_utb .itv_info h3 {
  margin-bottom: 0.8rem;

  font-size: 1.8rem;
  font-weight: 500;
  line-height: 1.5;
  color: var(--ink-text);

  /* 두 줄까지만 보이고 넘치면 말줄임 */
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.lat_utb .itv_item:hover .itv_info h3 {
  color: var(--brand);
}

.lat_utb .itv_date {
  font-size: 1.5rem;
  font-variant-numeric: tabular-nums;
  color: var(--ink-mute);
}

/* 밝은 바탕(서브페이지 등)에서 쓸 때는 글자색을 되돌립니다 */
.sub .lat_utb .itv_info h3 {
  color: var(--text-color);
}

.sub .lat_utb .itv_date {
  color: var(--text-color-mute);
}

.sub .lat_utb .itv_thumb {
  background: var(--secondary-color);
}

/* ==========================================================================
   팝업
   ========================================================================== */
body.yp_lock {
  overflow: hidden;
}

#yt_pop {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 10000;

  align-items: center;
  justify-content: center;
  padding: 2.4rem;
}

#yt_pop.on {
  display: flex;
}

#yt_pop .yp_bg {
  position: absolute;
  inset: 0;
  background: rgba(8, 9, 10, 0.82);
}

#yt_pop .yp_box {
  position: relative;
  width: min(96rem, 100%);
  background: var(--ink-panel);
  border-radius: 2rem;
  overflow: hidden;
  box-shadow: 0 2.4rem 6.4rem rgba(0, 0, 0, 0.5);
}

#yt_pop .yp_head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.6rem;

  padding: 1.8rem 2.4rem;
  border-bottom: 1px solid var(--ink-line);
}

#yt_pop .yp_head strong {
  font-size: 1.8rem;
  font-weight: 500;
  color: var(--ink-text);
}

#yt_pop .yp_close {
  display: flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 auto;

  width: 3.6rem;
  height: 3.6rem;

  background: rgba(255, 255, 255, 0.08);
  border: 0;
  border-radius: 50%;
  cursor: pointer;
  transition: background 0.25s;
}

#yt_pop .yp_close:hover {
  background: var(--brand);
}

#yt_pop .yp_close .icon {
  width: 1.8rem;
  height: 1.8rem;
  stroke: var(--ink-text);
  stroke-width: 2;
}

/* 16:9 영상 자리 */
#yt_pop .yp_body {
  position: relative;
  width: 100%;
  aspect-ratio: 16 / 9;
  background: #000;
}

#yt_pop .yp_body iframe {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  border: 0;
}

/* ==========================================================================
   반응형
   ========================================================================== */
@media (max-width: 1024px) {
  .lat_utb {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 768px) {
  .lat_utb {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 2rem 1.4rem;
  }

  .lat_utb .itv_play {
    width: 4.4rem;
    height: 4.4rem;
  }

  .lat_utb .itv_play::before {
    border-width: 0.7rem 0 0.7rem 1.2rem;
  }

  .lat_utb .itv_info h3 {
    font-size: 1.6rem;
  }

  #yt_pop {
    padding: 1.2rem;
  }

  #yt_pop .yp_head {
    padding: 1.4rem 1.6rem;
  }
}
