/* ======================================================================
 * EB Blog — SPL 스타일 카드 레이아웃
 * ====================================================================== */

@import url('https://fonts.googleapis.com/css2?family=Noto+Sans+KR:wght@300;400;500;600;700&display=swap');

.blog-page {
    font-family: 'Noto Sans KR', -apple-system, BlinkMacSystemFont, sans-serif;
    color: #1f2937;
    max-width: 1200px;
    margin: 0 auto;
    padding: 24px 16px 64px;
}

/* ───── Hero ───── */
.blog-hero {
    background: linear-gradient(135deg, #4f46e5 0%, #7c3aed 50%, #06b6d4 100%);
    border-radius: 20px;
    padding: 48px 40px;
    color: #fff;
    margin-bottom: 28px;
    box-shadow: 0 10px 30px rgba(79, 70, 229, 0.18);
    position: relative;
    overflow: hidden;
}
.blog-hero::before {
    content: '';
    position: absolute;
    top: -60px; right: -60px;
    width: 240px; height: 240px;
    background: radial-gradient(circle, rgba(255,255,255,0.15) 0%, transparent 65%);
    border-radius: 50%;
}
.blog-hero-inner { position: relative; }
.blog-hero-badge {
    display: inline-block;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.18em;
    padding: 5px 12px;
    background: rgba(255,255,255,0.18);
    border-radius: 30px;
    margin-bottom: 14px;
}
.blog-hero-title {
    font-size: 34px;
    font-weight: 700;
    margin: 0 0 10px 0;
    letter-spacing: -0.5px;
    color: #fff;
}
.blog-hero-subtitle {
    font-size: 15px;
    font-weight: 300;
    margin: 0 0 14px 0;
    opacity: 0.92;
}
.blog-hero-count {
    display: inline-block;
    font-size: 13px;
    font-weight: 500;
    padding: 6px 14px;
    background: rgba(255,255,255,0.16);
    border-radius: 20px;
    backdrop-filter: blur(6px);
}

/* ───── Category Tabs ───── */
.blog-cat-tabs {
    display: flex;
    gap: 4px;
    margin-bottom: 18px;
    padding: 6px;
    background: #f3f4f6;
    border-radius: 14px;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}
.blog-cat-tab {
    flex: 0 0 auto;
    padding: 10px 20px;
    font-size: 14px;
    font-weight: 500;
    color: #6b7280;
    text-decoration: none;
    border-radius: 10px;
    transition: all 0.2s ease;
    white-space: nowrap;
}
.blog-cat-tab:hover {
    color: #4f46e5;
    background: rgba(79,70,229,0.05);
    text-decoration: none;
}
.blog-cat-tab.active {
    color: #fff;
    background: #4f46e5;
    box-shadow: 0 4px 12px rgba(79,70,229,0.28);
}
.blog-cat-tab.active:hover { color: #fff; }

/* ───── Toolbar ───── */
.blog-toolbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
    margin-bottom: 20px;
    flex-wrap: wrap;
}
.blog-toolbar-left, .blog-toolbar-right {
    display: flex;
    gap: 10px;
    align-items: center;
}
.blog-sort-select {
    padding: 9px 14px;
    font-size: 13px;
    font-weight: 500;
    color: #374151;
    background: #fff;
    border: 1px solid #e5e7eb;
    border-radius: 10px;
    cursor: pointer;
    outline: none;
    min-width: 120px;
}
.blog-sort-select:focus { border-color: #a5b4fc; }
.blog-search-form {
    display: flex;
    align-items: center;
    background: #fff;
    border: 1px solid #e5e7eb;
    border-radius: 10px;
    overflow: hidden;
    transition: border-color 0.2s;
}
.blog-search-form:focus-within { border-color: #a5b4fc; box-shadow: 0 0 0 3px rgba(165,180,252,0.18); }
.blog-search-input {
    border: none;
    padding: 9px 14px;
    font-size: 13px;
    outline: none;
    width: 220px;
    background: transparent;
}
.blog-search-btn {
    border: none;
    background: transparent;
    padding: 9px 14px;
    color: #6b7280;
    cursor: pointer;
}
.blog-search-btn:hover { color: #4f46e5; }
.blog-write-btn {
    padding: 10px 18px;
    font-size: 13px;
    font-weight: 600;
    color: #fff;
    background: linear-gradient(135deg, #4f46e5, #7c3aed);
    border: none;
    border-radius: 10px;
    text-decoration: none;
    box-shadow: 0 4px 14px rgba(79,70,229,0.26);
    transition: all 0.22s ease;
    white-space: nowrap;
}
.blog-write-btn:hover {
    color: #fff;
    transform: translateY(-1px);
    box-shadow: 0 6px 18px rgba(79,70,229,0.34);
    text-decoration: none;
}
.blog-write-btn i { margin-right: 4px; }

/* ───── Notice strip ───── */
.blog-notice-strip {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-bottom: 20px;
    padding: 14px 18px;
    background: linear-gradient(90deg, #fffbeb, #fef3c7);
    border: 1px solid #fde68a;
    border-radius: 12px;
}
.blog-notice-item {
    display: flex;
    align-items: center;
    gap: 10px;
    text-decoration: none;
    color: #92400e;
    font-size: 13.5px;
}
.blog-notice-item:hover { color: #b45309; text-decoration: none; }
.blog-notice-badge {
    flex: 0 0 auto;
    padding: 3px 8px;
    font-size: 11px;
    font-weight: 700;
    background: #f59e0b;
    color: #fff;
    border-radius: 4px;
}
.blog-notice-title { flex: 1; font-weight: 500; }
.blog-notice-date { flex: 0 0 auto; font-size: 12px; color: #a16207; }

/* ───── Card Grid ───── */
.blog-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 24px;
}
.blog-card {
    background: #fff;
    border: 1px solid #f1f0ee;
    border-radius: 16px;
    overflow: hidden;
    transition: transform 0.25s ease, box-shadow 0.25s ease;
    display: flex;
    flex-direction: column;
}
.blog-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 14px 36px rgba(0,0,0,0.08);
}
.blog-card-thumb-link {
    display: block;
    position: relative;
    aspect-ratio: 16 / 10;
    overflow: hidden;
    background: #f9fafb;
}
.blog-card-thumb {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.45s ease;
}
.blog-card:hover .blog-card-thumb { transform: scale(1.05); }
.blog-card-thumb-placeholder {
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #e0e7ff, #ede9fe);
    padding: 1rem 1.25rem;
}
.blog-card-thumb-initial {
    font-size: 64px;
    font-weight: 700;
    color: #6366f1;
    opacity: 0.45;
}
.blog-card-thumb-text {
    font-size: 1.15rem;
    font-weight: 700;
    line-height: 1.45;
    color: #4338ca;
    text-align: center;
    /* 한글은 어절 단위로 자연스럽게 줄바꿈 */
    word-break: keep-all;
    overflow-wrap: break-word;
    max-width: 100%;
    letter-spacing: -0.01em;
}
.blog-card-flag {
    position: absolute;
    top: 12px;
    /* EBS 로고 와의 충돌 방지를 위해 우측 상단으로 배치 */
    right: 12px;
    padding: 4px 10px;
    font-size: 10.5px;
    font-weight: 700;
    border-radius: 6px;
    letter-spacing: 0.04em;
    z-index: 2;
}
.blog-card-flag-new { background: #10b981; color: #fff; }
.blog-card-flag-hot { background: #ef4444; color: #fff; }

/* 브랜드 뱃지 (EBS 등) — 썸네일 좌상단에 카드 배지로 노출 */
.blog-card-brand {
    position: absolute;
    top: 12px;
    left: 12px;
    z-index: 3;
    height: 26px;
    width: auto;
    padding: 4px 8px;
    background: rgba(255, 255, 255, 0.95);
    border-radius: 6px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.12), 0 0 0 1px rgba(0, 0, 0, 0.04);
    box-sizing: content-box;
}

.blog-card-body {
    padding: 18px 20px 20px;
    display: flex;
    flex-direction: column;
    flex: 1;
}
.blog-card-cat {
    display: inline-block;
    font-size: 11px;
    font-weight: 600;
    color: #4f46e5;
    background: #eef2ff;
    padding: 4px 10px;
    border-radius: 20px;
    text-decoration: none;
    margin-bottom: 10px;
    align-self: flex-start;
    letter-spacing: 0.02em;
}
.blog-card-cat:hover {
    background: #e0e7ff;
    color: #4338ca;
    text-decoration: none;
}
.blog-card-title {
    font-size: 16.5px;
    font-weight: 600;
    margin: 0 0 8px 0;
    line-height: 1.45;
    color: #111827;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}
.blog-card-title a {
    color: inherit;
    text-decoration: none;
}
.blog-card-title a:hover { color: #4f46e5; text-decoration: none; }
.blog-card-excerpt {
    font-size: 13px;
    color: #6b7280;
    line-height: 1.6;
    margin: 0 0 14px 0;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    flex: 1;
}
.blog-card-meta {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 12px;
    color: #9ca3af;
    border-top: 1px solid #f3f4f6;
    padding-top: 12px;
    flex-wrap: wrap;
}
.blog-card-sep { opacity: 0.5; }
.blog-card-meta i { margin-right: 2px; }

/* ───── Empty ───── */
.blog-empty {
    text-align: center;
    padding: 80px 20px;
    background: #fafaf9;
    border-radius: 16px;
    border: 1px dashed #d4d4d8;
}
.blog-empty-icon {
    font-size: 56px;
    color: #d1d5db;
    margin-bottom: 14px;
}
.blog-empty-text {
    font-size: 15px;
    color: #9ca3af;
    margin: 0 0 18px 0;
}

/* ───── Pagination ───── */
.blog-pagination {
    margin-top: 36px;
    display: flex;
    justify-content: center;
}
.blog-pagination .pagination {
    display: inline-flex;
    gap: 4px;
    padding: 0;
    margin: 0;
    list-style: none;
}
.blog-pagination .pagination li a,
.blog-pagination .pagination li span {
    display: block;
    padding: 10px 14px;
    font-size: 13px;
    color: #374151;
    background: #fff;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    text-decoration: none;
    transition: all 0.15s ease;
}
.blog-pagination .pagination li a:hover {
    color: #4f46e5;
    border-color: #a5b4fc;
    background: #eef2ff;
}
.blog-pagination .pagination li.active a,
.blog-pagination .pagination li.active span {
    color: #fff;
    background: #4f46e5;
    border-color: #4f46e5;
}

/* ───── Responsive ───── */
@media (max-width: 1024px) {
    .blog-grid { grid-template-columns: repeat(2, 1fr); gap: 20px; }
}
@media (max-width: 640px) {
    .blog-page { padding: 16px 12px 48px; }
    .blog-hero { padding: 36px 24px; border-radius: 16px; }
    .blog-hero-title { font-size: 26px; }
    .blog-hero-subtitle { font-size: 13px; }
    .blog-grid { grid-template-columns: 1fr; gap: 16px; }
    .blog-toolbar { flex-direction: column; align-items: stretch; }
    .blog-toolbar-left, .blog-toolbar-right { justify-content: space-between; }
    .blog-search-input { width: 100%; }
    .blog-search-form { flex: 1; }
}
