/**
 * Modern Card Design CSS
 * 현대적인 카드 스타일 - LESS에서 순수 CSS로 변환
 * 반응형 디자인 지원
 */

/* 기본 Body 스타일 (선택적 적용) */
body.modern-card-layout {
    background: #f2f2f2;
    font-family: 'Noto Sans KR', 'Malgun Gothic', '맑은 고딕', sans-serif;
    font-size: 14px;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* 다른 CSS 상속 방지 - 모든 외곽선과 여백 제거 */
.post-module,
.post-module *,
.post-module::before,
.post-module::after,
.post-module .thumbnail,
.post-module .thumbnail img,
.post-module .post-content,
.post-module a,
.post-module a * {
    border: none !important;
    outline: none !important;
    box-shadow: none;
}

/* 카드 자체의 그림자만 복원 */
.post-module {
    box-shadow: 0 6px 16px rgba(0, 0, 0, 0.12), 0 2px 6px rgba(0, 0, 0, 0.08) !important;
}

.post-module:hover {
    box-shadow: 0 16px 32px rgba(0, 0, 0, 0.2), 0 8px 16px rgba(0, 0, 0, 0.15) !important;
}

/* 썸네일과 이미지 여백 제거 */
.post-module .thumbnail,
.post-module .thumbnail img {
    margin: 0 !important;
    padding: 0 !important;
}

/* 콘텐츠 영역 padding 설정 */
.post-module .post-content {
    padding: 12px 20px !important;
}

/* 모던 카드 기본 스타일 */
.post-module {
    position: relative;
    z-index: 1;
    display: block;
    background: #fefefe;
    min-width: 270px;
    height: 470px;
    padding: 0;
    border: none;
    border-radius: 12px;
    box-shadow: 0 6px 16px rgba(0, 0, 0, 0.12), 0 2px 6px rgba(0, 0, 0, 0.08);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    overflow: hidden;
    cursor: pointer;
}

/* 화선지 질감 효과 */
.post-module::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-image: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" width="200" height="200"><filter id="noise"><feTurbulence type="fractalNoise" baseFrequency="0.9" numOctaves="4" /></filter><rect width="200" height="200" filter="url(%23noise)" opacity="0.05"/></svg>');
    background-repeat: repeat;
    opacity: 0.95;
    mix-blend-mode: multiply;
    pointer-events: none;
    z-index: 0;
}

/* 콘텐츠가 질감 위에 표시되도록 */
.post-module > * {
    position: relative;
    z-index: 1;
}

/* 호버 효과 */
.post-module:hover {
    transform: translateY(-8px);
    box-shadow: 0 16px 32px rgba(0, 0, 0, 0.2), 0 8px 16px rgba(0, 0, 0, 0.15);
}

.post-module:hover .thumbnail img {
    transform: scale(1.1);
    opacity: 0.6;
}

/* 썸네일 영역 */
.post-module .thumbnail {
    background: #ffffff;
    height: 358px;
    overflow: hidden;
    position: relative;
    border: none;
    border-radius: 12px 12px 0 0;
    line-height: 0;
    font-size: 0;
}

.post-module .thumbnail img {
    display: block;
    width: 100%;
    max-width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center center;
    border: none;
    vertical-align: top;
    transition: all 0.3s ease-in-out;
}

/* 날짜 배지 (선택적) */
.post-module .thumbnail .date {
    position: absolute;
    top: 20px;
    right: 20px;
    z-index: 1;
    background: #e74c3c;
    width: 55px;
    height: 55px;
    padding: 12.5px 0;
    border-radius: 100%;
    color: #ffffff;
    font-weight: 700;
    text-align: center;
    box-sizing: border-box;
}

.post-module .thumbnail .date .day {
    font-size: 18px;
    display: block;
}

.post-module .thumbnail .date .month {
    font-size: 12px;
    text-transform: uppercase;
    display: block;
}

/* 콘텐츠 영역 */
.post-module .post-content {
    position: absolute;
    bottom: 0;
    background: #ffffff;
    width: 100%;
    height: 112px;
    padding: 12px 20px;
    box-sizing: border-box;
    border: none;
    border-radius: 0 0 12px 12px;
    overflow: hidden;
    transition: all 0.3s cubic-bezier(0.37, 0.75, 0.61, 1.05);
}

/* 카테고리 라벨 */
.post-module .post-content .category {
    position: absolute;
    top: -34px;
    left: 0;
    background: #e74c3c;
    padding: 10px 15px;
    color: #ffffff;
    font-size: 14px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* 제목 */
.post-module .post-content .title {
    margin: 0;
    padding: 0 0 6px;
    color: #2d3748;
    font-size: 16px;
    font-weight: 700;
    line-height: 1.3;
    overflow: hidden;
    text-overflow: ellipsis;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
}

/* 부제목 */
.post-module .post-content .sub_title {
    margin: 0;
    padding: 0 0 6px;
    color: #374151;
    font-size: 13px;
    font-weight: 400;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* 설명 */
.post-module .post-content .description {
    display: none;
    color: #374151;
    font-size: 12px;
    line-height: 1.5;
    margin: 6px 0 0;
    overflow: hidden;
    text-overflow: ellipsis;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
}

/* 메타 정보 */
.post-module .post-content .post-meta {
    margin: 6px 0 0;
    color: #374151;
    font-size: 11px;
}

.post-module .post-content .post-meta .timestamp {
    margin: 0 16px 0 0;
    display: inline-block;
}

.post-module .post-content .post-meta a {
    color: #999999;
    text-decoration: none;
    transition: color 0.2s ease;
}

.post-module .post-content .post-meta a:hover {
    color: #e74c3c;
}

/* 호버 시 콘텐츠 영역 확장 */
.post-module:hover .post-content,
.post-module.hover .post-content {
    height: 180px;
}

/* 호버 시 설명 표시 */
.post-module:hover .post-content .description,
.post-module.hover .post-content .description {
    display: -webkit-box !important;
    opacity: 1 !important;
}

/* 기존 masonry-item과 호환 */
.masonry-item.post-module {
    margin-bottom: 30px;
}

/* 반응형 디자인 */

/* 태블릿 전용 스타일 (769px ~ 1024px) */
@media (min-width: 769px) and (max-width: 1024px) {
    .masonry-item.w-2 {
        width: 50% !important; /* 한 줄에 2개 */
    }

    .masonry-item.w-4 {
        width: 100% !important; /* 전체 너비 */
    }

    .post-module {
        height: auto;
        min-height: 400px;
    }

    .post-module .thumbnail {
        height: 280px;
    }

    .post-module .post-content {
        position: relative;
        height: 120px;
        padding: 12px 20px;
    }

    .post-module .post-content .title {
        font-size: 16px;
        padding: 0 0 6px;
    }

    .post-module .post-content .sub_title {
        font-size: 13px;
        padding: 0 0 6px;
    }

    /* 호버 시 확장 */
    .post-module:hover .post-content,
    .post-module.hover .post-content {
        height: 170px;
    }
}

/* 모바일 스타일 (768px 이하) */
@media (max-width: 768px) {
    .post-module {
        height: auto;
        min-height: 360px;
    }

    .post-module .thumbnail {
        height: 248px;
    }

    .post-module .post-content {
        position: relative;
        height: 112px;
        padding: 12px 20px;
    }

    .post-module .post-content .title {
        font-size: 17px;
        padding: 0 0 6px;
    }

    .post-module .post-content .sub_title {
        font-size: 13px;
        padding: 0 0 6px;
    }

    /* 모바일 호버 시 확장 */
    .post-module:hover .post-content,
    .post-module.hover .post-content {
        height: 160px;
    }
}

@media (max-width: 480px) {
    .post-module {
        min-width: 100%;
        min-height: 320px;
    }

    .post-module .thumbnail {
        height: 208px;
    }

    .post-module .post-content {
        height: 112px;
        padding: 12px 15px;
    }

    .post-module .post-content .title {
        font-size: 16px;
        padding: 0 0 6px;
    }

    .post-module .post-content .sub_title {
        font-size: 12px;
        padding: 0 0 6px;
    }

    .post-module .post-content .category {
        font-size: 11px;
        padding: 6px 10px;
    }
}

/* 그리드 레이아웃과 호환 */
.masonry .post-module {
    break-inside: avoid;
    page-break-inside: avoid;
}

/* 리스트 스타일과의 통합 */
.post-module .list-inline {
    padding-left: 0;
    margin-bottom: 5px;
}

.post-module .list-inline li {
    display: inline-block;
    padding-right: 8px;
    padding-left: 0;
    color: #999999;
    font-size: 11px;
}

.post-module .list-inline li i {
    margin-right: 3px;
}

/* 가격 표시 스타일 */
.post-module .post-content .price {
    color: #e74c3c;
    font-size: 16px;
    font-weight: 600;
    margin: 5px 0 0;
}

.post-module .post-content .price.line-through {
    text-decoration: line-through;
    color: #999999;
    font-size: 13px;
    margin: 3px 0 0;
}

/* 세일 태그 */
.post-module .thumbnail .sale-tag {
    position: absolute;
    top: 15px;
    left: 15px;
    z-index: 2;
}

.post-module .thumbnail .sale-tag .text-icon {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    color: #ffffff;
    font-weight: 700;
    font-size: 16px;
}

/* 라벨 스타일 개선 */
.post-module .label {
    display: inline-block;
    padding: 5px 10px;
    font-size: 13px;
    font-weight: 600;
    line-height: 1;
    color: #ffffff;
    text-align: center;
    white-space: nowrap;
    vertical-align: baseline;
    border-radius: 3px;
}

.post-module .label-info {
    background-color: #5bc0de;
}

/* 애니메이션 키프레임 */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.post-module {
    animation: fadeIn 0.5s ease-out;
}

/* 다크 모드 지원 (선택적) */
@media (prefers-color-scheme: dark) {
    body.modern-card-layout {
        background: #1a1a1a;
    }

    .post-module {
        background: #2d2d2d;
        box-shadow: 0px 1px 2px 0px rgba(255, 255, 255, 0.1);
    }

    .post-module:hover {
        box-shadow: 0px 15px 35px 0px rgba(255, 255, 255, 0.2);
    }

    .post-module .post-content {
        background: #ffffff;
    }

    .post-module .post-content .title {
        color: #2d3748;
    }

    .post-module .post-content .sub_title,
    .post-module .post-content .description,
    .post-module .post-content .post-meta {
        color: #374151;
    }
}
