/* ============================================================
   메인 페이지 모던 카드 UI
   - 둥근 모서리 16px, 호버 시 translateY(-5px)
   - 동영상 썸네일 재생 버튼, 제목 아래 조회수·날짜
   - 무한 스크롤 느낌 하단 여백, 이미지 스켈레톤 UI
   ============================================================ */

/* 카드 공통 */
.home-modern-list {
  display: flex;
  flex-wrap: wrap;
  gap: 1.25rem;
  list-style: none;
  margin: 0;
  padding: 0;
}

.home-modern-card {
  border-radius: 16px;
  overflow: hidden;
  background: rgba(15, 20, 32, 0.65);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid rgba(255, 255, 255, 0.1);
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.2);
  transition: transform 0.25s ease, box-shadow 0.25s ease;
  display: block;
  text-decoration: none;
  color: inherit;
}

.home-modern-card:hover {
  transform: translateY(-5px);
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.35), 0 0 0 1px rgba(0, 209, 255, 0.15);
}

/* 썸네일 영역 + 스켈레톤 */
.card-thumb-wrap {
  position: relative;
  width: 100%;
  padding-bottom: 56.25%;
  background: rgba(255, 255, 255, 0.06);
  overflow: hidden;
}

.card-thumb-wrap .skeleton {
  position: absolute;
  inset: 0;
  background: linear-gradient(
    90deg,
    rgba(255, 255, 255, 0.04) 0%,
    rgba(255, 255, 255, 0.08) 50%,
    rgba(255, 255, 255, 0.04) 100%
  );
  background-size: 200% 100%;
  animation: skeleton-shimmer 1.2s ease-in-out infinite;
}

.card-thumb-wrap.loaded .skeleton {
  display: none;
}

@keyframes skeleton-shimmer {
  0% { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}

.card-thumb-wrap img,
.card-thumb-wrap video {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: 0;
  transition: opacity 0.3s ease;
}

.card-thumb-wrap.loaded img,
.card-thumb-wrap.loaded video {
  opacity: 1;
}

/* 동영상 재생 버튼 오버레이 */
.card-thumb-wrap.video-thumb::after {
  content: "";
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.35);
  pointer-events: none;
}

.card-play-icon {
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  width: 56px;
  height: 56px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.85);
  display: flex;
  align-items: center;
  justify-content: center;
  pointer-events: none;
  z-index: 2;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
}

.card-play-icon svg {
  width: 24px;
  height: 24px;
  margin-left: 4px;
  fill: #0a0e17;
}

/* 카드 본문: 제목 + 조회수·날짜 */
.card-info {
  padding: 1rem 1.1rem;
}

.card-info .card-title {
  font-size: 1rem;
  font-weight: 500;
  line-height: 1.4;
  margin: 0 0 0.5rem 0;
  color: #e8ecf1;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.card-meta {
  font-size: 0.8125rem;
  color: #8b95a5;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.card-meta span + span::before {
  content: "·";
  margin-right: 0.5rem;
  color: #6b7280;
}

/* 그리드 열 수 */
.home-section-cards .home-modern-list {
  --cols: 2;
}
@media (min-width: 576px) {
  .home-section-cards .home-modern-list { --cols: 2; }
}
@media (min-width: 768px) {
  .home-section-cards .home-modern-list { --cols: 2; }
}
@media (min-width: 992px) {
  .home-section-cards .home-modern-list { --cols: 2; }
}

.home-section-cards .home-modern-card {
  flex: 1 1 calc((100% - (var(--cols) - 1) * 1.25rem) / var(--cols));
  min-width: 0;
  max-width: 100%;
}

.home-section-best .home-modern-list {
  --cols: 2;
}
@media (min-width: 576px) {
  .home-section-best .home-modern-list { --cols: 2; }
}
@media (min-width: 768px) {
  .home-section-best .home-modern-list { --cols: 3; }
}
@media (min-width: 992px) {
  .home-section-best .home-modern-list { --cols: 4; }
}

.home-section-best .home-modern-card {
  flex: 1 1 calc((100% - (var(--cols) - 1) * 1.25rem) / var(--cols));
  min-width: 0;
  max-width: 100%;
}

/* 무한 스크롤 느낌: 하단 여백 */
.home-infinite-spacer {
  min-height: 120px;
  padding-bottom: 80px;
}

/* 사이드 최근게시글 카드 스타일 */
.side-modern-list {
  list-style: none;
  margin: 0;
  padding: 0;
}

.side-modern-card {
  display: block;
  padding: 0.75rem 1rem;
  margin-bottom: 0.5rem;
  border-radius: 16px;
  background: rgba(15, 20, 32, 0.5);
  border: 1px solid rgba(255, 255, 255, 0.08);
  text-decoration: none;
  color: #e8ecf1;
  transition: transform 0.2s ease, background 0.2s ease, border-color 0.2s ease;
}

.side-modern-card:hover {
  transform: translateY(-3px);
  background: rgba(255, 255, 255, 0.06);
  border-color: rgba(0, 209, 255, 0.2);
  color: #00d1ff;
}

.side-modern-card .side-card-title {
  font-size: 0.875rem;
  font-weight: 500;
  line-height: 1.4;
  margin: 0;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.side-modern-card .side-card-meta {
  font-size: 0.75rem;
  color: #8b95a5;
  margin-top: 0.35rem;
}

/* ========== 비대칭 그리드 + 섹션 제목 바 ========== */
.section-title-bar {
  font-size: 1.125rem;
  font-weight: 700;
  color: #e8ecf1;
  margin: 0 0 1rem 0;
  padding-left: 0.75rem;
  border-left: 4px solid #00d1ff;
  line-height: 1.35;
}

.home-asymmetric-row {
  margin-top: 0.5rem;
}

.home-main-col {
  padding-right: 0.75rem;
}

@media (min-width: 1200px) {
  .home-side-col {
    padding-left: 0.75rem;
    border-left: 1px solid rgba(255, 255, 255, 0.08);
  }
}

/* 베스트 동영상: 큰 썸네일 */
.home-best-video-list {
  --cols: 1;
}
@media (min-width: 576px) {
  .home-best-video-list { --cols: 2; }
}
@media (min-width: 992px) {
  .home-best-video-list { --cols: 3; }
}

.home-best-video-list .home-modern-card {
  flex: 1 1 calc((100% - (var(--cols) - 1) * 1.25rem) / var(--cols));
  min-width: 0;
  max-width: 100%;
}

.home-video-card-large .card-thumb-wrap {
  padding-bottom: 56.25%;
}

/* 2단 Masonry: 최신 뉴스 / 인기 게시글 */
.home-masonry-row {
  margin-top: 1.5rem;
}

.home-masonry-col {
  margin-bottom: 1rem;
}

.masonry-list {
  column-count: 1;
  column-gap: 1rem;
  margin: 0;
  padding: 0;
  list-style: none;
}

@media (min-width: 576px) {
  .masonry-list { column-count: 2; }
}

.masonry-item {
  break-inside: avoid;
  margin-bottom: 0.75rem;
  page-break-inside: avoid;
}

.masonry-card {
  display: block;
  padding: 0.75rem 1rem;
  border-radius: 12px;
  background: rgba(15, 20, 32, 0.6);
  border: 1px solid rgba(255, 255, 255, 0.08);
  text-decoration: none;
  color: #e8ecf1;
  transition: background 0.2s ease, border-color 0.2s ease;
}

.masonry-card:hover {
  background: rgba(255, 255, 255, 0.06);
  border-color: rgba(0, 209, 255, 0.2);
  color: #00d1ff;
}

.masonry-card-title {
  font-size: 0.9375rem;
  font-weight: 500;
  margin: 0 0 0.35rem 0;
  line-height: 1.4;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.masonry-card-with-thumb {
  padding: 0;
  display: flex;
  flex-direction: column;
}

.masonry-card-with-thumb .masonry-thumb {
  padding-bottom: 56.25%;
}

.masonry-card-with-thumb .card-info {
  padding: 0.65rem 0.85rem;
}

.section-more {
  display: inline-block;
  margin-top: 0.5rem;
  font-size: 0.875rem;
  font-weight: 500;
  color: #00d1ff;
  text-decoration: none;
}

.section-more:hover {
  color: #33dbff;
  text-decoration: underline;
}

/* 사이드: 보증사이트 랭킹 위젯 */
.home-side-widget {
  margin-bottom: 1.5rem;
}

.ranking-list {
  list-style: none;
  margin: 0;
  padding: 0;
}

.ranking-item {
  display: flex;
  align-items: center;
  padding: 0.6rem 0.85rem;
  margin-bottom: 0.4rem;
  border-radius: 12px;
  background: rgba(15, 20, 32, 0.5);
  border: 1px solid rgba(255, 255, 255, 0.08);
  text-decoration: none;
  color: #e8ecf1;
  transition: background 0.2s ease, border-color 0.2s ease;
}

.ranking-item:hover {
  background: rgba(0, 209, 255, 0.1);
  border-color: rgba(0, 209, 255, 0.25);
  color: #00d1ff;
}

.ranking-num {
  flex-shrink: 0;
  width: 1.5rem;
  height: 1.5rem;
  line-height: 1.5rem;
  text-align: center;
  font-size: 0.8125rem;
  font-weight: 700;
  color: #00d1ff;
  background: rgba(0, 209, 255, 0.15);
  border-radius: 6px;
  margin-right: 0.6rem;
}

.ranking-name {
  font-size: 0.9375rem;
  font-weight: 500;
}

/* 최신 후기 슬라이더 */
.side-review-slider {
  overflow: hidden;
  border-radius: 12px;
  background: rgba(15, 20, 32, 0.5);
  border: 1px solid rgba(255, 255, 255, 0.08);
}

.side-review-track {
  display: flex;
  flex-direction: column;
  max-height: 280px;
  overflow-y: auto;
}

.side-review-card {
  display: block;
  padding: 0.7rem 1rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
  text-decoration: none;
  color: #e8ecf1;
  transition: background 0.2s ease;
}

.side-review-card:last-child {
  border-bottom: none;
}

.side-review-card:hover {
  background: rgba(255, 255, 255, 0.05);
  color: #00d1ff;
}

.side-review-title {
  font-size: 0.875rem;
  font-weight: 500;
  margin: 0 0 0.25rem 0;
  line-height: 1.4;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.side-review-date {
  font-size: 0.75rem;
  color: #8b95a5;
}
