/* News card layout tweaks (supports legacy .blog-card-top/bottom markup too) */

/* 부모 테마 스타일 덮어쓰기 - 썸네일 크기 고정 */
.page-card.blog-card .blog-card-thumb,
.blog-card .blog-card-thumb {
    width: 110px !important;
    min-width: 110px !important;
    max-width: 110px !important;
    height: 110px !important;
    min-height: 110px !important;
    max-height: 110px !important;
    aspect-ratio: 1 / 1 !important;
    flex-shrink: 0 !important;
    flex-grow: 0 !important;
    /* 부모 테마의 aspect-ratio: 16/9 덮어쓰기 */
    margin: 0 !important;
}

.blog-card-inner {
    position: relative;
    display: flex;
    flex-direction: row;
    align-items: flex-start;
    gap: 16px;
}

.blog-card-content-wrapper,
.blog-card-top {
    display: flex;
    flex-direction: row;
    align-items: flex-start;
    gap: 16px;
    flex: 1;
    min-width: 0;
}

.blog-card-bottom {
    display: flex;
    flex-direction: column;
    gap: 6px;
    flex: 1;
    min-width: 0;
}

.blog-card-thumb {
    flex-shrink: 0 !important;
    width: 110px !important;
    min-width: 110px !important;
    max-width: 110px !important;
    height: 110px !important;
    min-height: 110px !important;
    max-height: 110px !important;
    aspect-ratio: 1 / 1 !important;
    border-radius: 16px;
    background-size: cover !important;
    background-position: center;
    background-color: #f1f5f9;
    display: block !important;
    text-decoration: none;
    position: relative;
    overflow: hidden;
    /* 이미지 로딩 전 레이아웃 안정화 */
    box-sizing: border-box;
}

/* 이미지 로딩 전 레이아웃 안정화 */
.blog-card-thumb:not([style*="background-image"]),
.blog-card-thumb[style*="background-image"] {
    /* background-image가 로드되기 전에도 크기 유지 */
    width: 110px !important;
    height: 110px !important;
    min-width: 110px !important;
    min-height: 110px !important;
    max-width: 110px !important;
    max-height: 110px !important;
}

.blog-card-thumb i {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    color: #94a3b8;
    font-size: 24px;
}

.blog-card-text-content,
.blog-card-bottom {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.blog-card-title {
    margin: 0;
    font-size: 16px;
    line-height: 1.4;
    font-weight: 600;
}

.blog-card-title a {
    color: #0f172a;
    text-decoration: none;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    text-overflow: ellipsis;
    transition: color 0.2s ease;
}

.blog-card-title a:hover,
.blog-card-title a:focus {
    color: #1f242d !important; /* near-black but softer */
    font-size: inherit !important;
    transform: none !important;
    scale: 1 !important;
}

.blog-card-date {
    font-size: 13px;
    color: #64748b;
    margin: 0;
}

.blog-card-category {
    display: none !important;
}

.blog-card-excerpt {
    margin: 0;
    color: #475569;
    font-size: 13px;
    line-height: 1.5;
    display: block;
    overflow: hidden;
    text-overflow: ellipsis;
    max-height: calc(1.5em * 2);
    visibility: visible;
    opacity: 1;
    word-break: break-word;
    overflow-wrap: anywhere;
}

@supports (-webkit-line-clamp: 2) {
    .blog-card-excerpt {
        display: -webkit-box !important;
        -webkit-line-clamp: 2;
        -webkit-box-orient: vertical;
    }
}

.blog-card,
.blog-card-inner,
.blog-card-bottom,
.blog-card-top {
    width: 100%;
    box-sizing: border-box;
}

/* 추가 안정화: flex 컨테이너에서 썸네일이 확장되지 않도록 */
.blog-card-content-wrapper,
.blog-card-top {
    min-width: 0; /* flex 아이템이 축소될 수 있도록 */
}

.blog-card-text-content {
    min-width: 0; /* 텍스트가 오버플로우될 때 ellipsis 작동하도록 */
    overflow: hidden;
}

.blog-card-inner .comments-bubble,
.blog-card-inner .more-link-custom {
    position: absolute;
    top: 0;
    right: 0;
    z-index: 10;
}

.blog-card-top .more-link-custom {
    position: static;
    margin-left: auto;
}

@media (max-width: 768px) {
    .blog-card-inner,
    .blog-card-content-wrapper,
    .blog-card-top {
        flex-direction: row;
        gap: 12px;
        align-items: flex-start;
    }

    /* 모바일에서도 부모 테마 스타일 덮어쓰기 */
    .page-card.blog-card .blog-card-thumb,
    .blog-card .blog-card-thumb,
    .blog-card-thumb {
        width: 86px !important;
        min-width: 86px !important;
        max-width: 86px !important;
        height: 86px !important;
        min-height: 86px !important;
        max-height: 86px !important;
        aspect-ratio: 1 / 1 !important;
        flex-shrink: 0 !important;
        flex-grow: 0 !important;
        margin: 0 !important;
    }

    /* 모바일에서도 이미지 로딩 전 레이아웃 안정화 */
    .blog-card-thumb:not([style*="background-image"]),
    .blog-card-thumb[style*="background-image"] {
        width: 86px !important;
        height: 86px !important;
        min-width: 86px !important;
        min-height: 86px !important;
        max-width: 86px !important;
        max-height: 86px !important;
    }

    .blog-card-title {
        font-size: 15px;
    }

    .blog-card-date {
        font-size: 12px;
    }
}
