/* =============================
   Blog List Page Styles
   ============================= */

.blog_list_section .list-container {
    margin-top: calc(var(--spacing-unit) * 3); /* 24px */
}

.blog-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); /* Adjust min size */
    gap: calc(var(--spacing-unit) * 3.5); /* 28px */
}

.blog-card {
    background-color: var(--card-bg-color);
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 3px 10px rgba(0,0,0,0.08);
    transition: transform 0.25s ease, box-shadow 0.25s ease;
    display: flex;
    flex-direction: column; /* Ensure content flows vertically */
}

.blog-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 7px 20px rgba(0,0,0,0.1);
}

.blog-card-link {
    text-decoration: none;
    color: inherit;
    display: flex;
    flex-direction: column;
    height: 100%; /* Make link fill the card */
}

.blog-card-image-wrap {
    width: 100%;
    padding-top: 60%; /* Approx 16:10 aspect ratio */
    position: relative;
    background-color: #e0e0e0;
    overflow: hidden;
}

.blog-card-image-wrap img {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s ease;
}

.blog-card:hover .blog-card-image-wrap img {
    transform: scale(1.05);
}

.blog-card-content {
    padding: calc(var(--spacing-unit) * 2.5); /* 20px */
    display: flex;
    flex-direction: column;
    flex-grow: 1; /* Allow content to take available space */
}

.blog-card-title {
    font-size: 1.25em;
    font-weight: 600;
    margin: 0 0 calc(var(--spacing-unit) * 1.5) 0; /* 12px bottom margin */
    line-height: 1.4;
    color: var(--text-color);
    /* Optional: Limit title to 2 lines with ellipsis */
    overflow: hidden;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    min-height: calc(1.25em * 1.4 * 2); /* Reserve space for 2 lines */
}

.blog-card-excerpt {
    font-size: 0.95em;
    color: var(--light-text-color);
    line-height: 1.6;
    margin-bottom: calc(var(--spacing-unit) * 2); /* 16px */
    flex-grow: 1; /* Push meta to the bottom */
    /* Optional: Limit excerpt lines */
     overflow: hidden;
    display: -webkit-box;
    -webkit-line-clamp: 3; 
    -webkit-box-orient: vertical;
}

.blog-card-meta {
    font-size: 0.85em;
    color: #868e96; /* Slightly lighter meta text */
    margin-top: auto; /* Push to bottom */
    padding-top: calc(var(--spacing-unit) * 1.5);
    border-top: 1px solid var(--border-color);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.blog-card-meta span {
    display: inline-flex; /* Align icon and text */
    align-items: center;
    gap: calc(var(--spacing-unit) * 0.5); /* Gap between icon and text */
}

.blog-card-meta i.fas {
    font-size: 0.9em;
}

/* Ensure pagination uses the styles from style.css */
.blog_list_section .pagination {
    margin-top: calc(var(--spacing-unit) * 5); /* 40px */
}

/* Responsive Adjustments */
@media (max-width: 480px) {
    .blog-grid {
        grid-template-columns: 1fr; /* Single column */
    }
}

/* 블로그 목록 컨테이너 */
.blog-list-container {
    margin-top: 20px;
}

/* 블로그 목록 (ul) */
.blog-list {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); /* 갤러리보다 약간 넓게 */
    gap: 25px;
    padding: 0;
    list-style: none;
}

/* 블로그 아이템 (li) */
.blog-item {
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    overflow: hidden;
    background-color: #fff;
    box-shadow: 0 2px 5px rgba(0,0,0,0.08);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    display: flex; /* 내부 요소 정렬 위해 */
    flex-direction: column; /* 세로 배치 */
}

.blog-item:hover {
    transform: translateY(-5px);
    box-shadow: 0 6px 18px rgba(0,0,0,0.1);
}

.blog-item a {
    display: flex;
    flex-direction: column;
    height: 100%; /* 링크 영역 확장 */
}

/* 썸네일 래퍼 */
.blog-thumbnail-wrap {
    width: 100%;
    padding-top: 60%; /* 16:9 비율과 유사하게 */
    position: relative;
    overflow: hidden;
    background-color: #ececec;
}

.blog-thumbnail-wrap img {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s ease;
}

.blog-item:hover .blog-thumbnail-wrap img {
    transform: scale(1.05);
}

/* 텍스트 래퍼 */
.blog-text-wrap {
    padding: 20px;
    flex-grow: 1; /* 남은 공간 채우기 */
    display: flex;
    flex-direction: column;
}

.blog-title {
    font-size: 1.3em;
    font-weight: bold;
    margin: 0 0 10px 0;
    line-height: 1.4;
    color: #333;
    /* 두 줄 이상 말줄임 (선택 사항) */
    /* display: -webkit-box; */
    /* -webkit-line-clamp: 2; */
    /* -webkit-box-orient: vertical; */
    /* overflow: hidden; */
    /* text-overflow: ellipsis; */
    /* height: calc(1.4em * 2); */
}

.blog-meta {
    font-size: 0.85em;
    color: #777;
    margin-top: auto; /* 아래쪽 정렬 */
    padding-top: 10px;
    border-top: 1px solid #f0f0f0;
}

.blog-meta span {
    margin-right: 10px;
}
@media (max-width: 768px) {
    .sub_section{
        padding: calc(var(--spacing-unit) * 1);
    }
    .blog-grid{
        grid-template-columns: repeat(2, 1fr);
        gap: calc(var(--spacing-unit) * 1);

    }
    .blog-card-title {
        display: block; /* Ensure it behaves like a block for overflow */
        white-space: nowrap; /* Prevent wrapping */
        overflow: hidden; /* Hide overflowing text */
        text-overflow: ellipsis; /* Add ... */
        min-height: 0;
    }
}
