.ticker-wrap { background-color: #0f172a; color: #fff; padding: 12px 0; overflow: hidden; display: flex; align-items: center; }
.ticker-title { background-color: #e11d48; color: #fff; font-weight: 800; padding: 4px 12px; border-radius: 4px; font-size: 0.85rem; margin-left: 20px; margin-right: 15px; white-space: nowrap; z-index: 2; box-shadow: 0 2px 10px rgba(225,29,72,0.3); }

.ticker-mask {
    flex: 1; /* 타이틀을 제외한 나머지 가로 영역을 모두 차지 */
    overflow: hidden; /* 이 영역을 벗어나는 텍스트는 보이지 않게 숨김 처리 */
    margin-left: 10px; /* 버튼에서 10px 정도 더 앞쪽에서 사라지도록 여백 확보 */
    display: flex;

    /* (선택) 버튼에 닿기 전에 부드럽게 스르륵 사라지게 하는 그라데이션 마스크 효과 */
    -webkit-mask-image: linear-gradient(to right, transparent 0%, black 20px);
    mask-image: linear-gradient(to right, transparent 0%, black 20px);
}

.ticker-move { display: flex; white-space: nowrap; animation: ticker 30s linear infinite; }
.ticker-move:hover { animation-play-state: paused; }
.ticker-list { display: flex; align-items: center; }
.ticker-item { color: #94a3b8; text-decoration: none; margin-right: 30px; font-weight: 600; font-size: 0.95rem; transition: color 0.2s; }
.ticker-item:hover { color: #fff; text-decoration: underline; }
@keyframes ticker { 0% { transform: translateX(0); } 100% { transform: translateX(-50%); } }

.container { max-width: 1280px; margin: 40px auto; padding: 0 24px; }

/* =======================================================
   [고급형 필터 대시보드]
   ======================================================= */
.filter-dashboard {
    display: flex;
    flex-direction: column;
    gap: 20px;
    margin-bottom: 40px;
    background: #fff;
    padding: 16px 24px;
    border-radius: 24px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.03);
    border: 1px solid #f1f5f9;
}

@media (min-width: 1024px) {
    .filter-dashboard {
        flex-direction: row;
        align-items: center;
        justify-content: space-between;
        padding: 12px 16px 12px 24px;
    }
}

/* 1. 카테고리 영역 (가로 스크롤 & 끝부분 페이드 효과) */
/* 1. 카테고리 영역 (고정버튼 + 가로 스크롤 + 화살표) */
.category-group {
    display: flex;
    align-items: center;
    flex: 1;
    gap: 15px;
    overflow: hidden;
}

.reset-btn {
    flex-shrink: 0; /* 전체보기 버튼 크기 축소 방지 */
    position: relative;
    z-index: 20;
}

.category-scroll-wrapper {
    flex: 1;
    position: relative;
    display: flex;
    align-items: center;
    overflow: hidden;
}

/* 화살표 컨테이너 및 배경 그라데이션 */
.scroll-arrow-wrapper {
    position: absolute;
    top: 0; bottom: 0;
    display: flex;
    align-items: center;
    z-index: 10;
}
.scroll-arrow-wrapper.left { left: 0; padding-right: 20px; background: linear-gradient(to right, #fff 60%, transparent); display: none; }
.scroll-arrow-wrapper.right { right: 0; padding-left: 20px; background: linear-gradient(to left, #fff 60%, transparent); }

/* 동그란 화살표 버튼 */
.scroll-arrow {
    width: 34px; height: 34px;
    border-radius: 50%;
    background: #fff;
    border: 1px solid #e2e8f0;
    box-shadow: 0 2px 6px rgba(0,0,0,0.06);
    color: #64748b;
    display: flex; align-items: center; justify-content: center;
    cursor: pointer; transition: all 0.2s;
}
.scroll-arrow:hover { background: var(--primary); color: #fff; border-color: var(--primary); transform: scale(1.05); }
.scroll-arrow svg { width: 16px; height: 16px; }

.categories {
    display: flex;
    gap: 10px;
    overflow-x: auto;
    padding: 5px 0;
    scroll-behavior: smooth;
    cursor: grab;
    scrollbar-width: none;
    -ms-overflow-style: none;
    width: 100%;
}
.categories::-webkit-scrollbar { display: none; }
.categories.active { cursor: grabbing; }

.category-btn {
    padding: 10px 22px;
    border-radius: 30px;
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    color: #64748b;
    font-weight: 700;
    font-size: 0.95rem;
    text-decoration: none;
    white-space: nowrap;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    user-select: none;
}
.category-btn:hover { background: #f1f5f9; color: #0f172a; transform: translateY(-2px); }
.category-btn.active {
    background: var(--primary);
    color: #fff;
    border-color: var(--primary);
    box-shadow: 0 4px 12px rgba(37, 99, 235, 0.25);
}

/* 2. 검색 및 정렬 폼 영역 */
.search-and-sort {
    display: flex;
    gap: 12px;
    align-items: center;
    flex-shrink: 0; /* 우측 영역이 찌그러지지 않도록 고정 */
}

/* 정렬 셀렉트 박스 */
.sort-select {
    padding: 10px 35px 10px 18px !important;
    border-radius: 30px;
    border: 1px solid #e2e8f0;
    font-family: inherit;
    font-weight: 700;
    font-size: 0.9rem;
    color: #475569;
    outline: none;
    cursor: pointer;
    background-color: #f8fafc;
    appearance: none;
    -webkit-appearance: none;
    background-image: url("data:image/svg+xml;charset=UTF-8,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23475569' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 14px center;
    background-size: 14px;
    transition: 0.2s;
}
.sort-select:hover { border-color: var(--primary); color: var(--primary); }

/* 검색창 */
.search-box {
    display: flex;
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 30px;
    overflow: hidden;
    padding: 4px;
    transition: all 0.3s;
}
.search-box:focus-within {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
    background: #fff;
}
.search-box input {
    border: none;
    padding: 8px 10px 8px 18px;
    outline: none;
    width: 200px;
    font-family: inherit;
    font-weight: 500;
    background: transparent;
    color: #0f172a;
}
.search-box button {
    background: var(--primary);
    color: #fff;
    border: none;
    width: 38px;
    height: 38px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: 0.2s;
}
.search-box button:hover { background: #1d4ed8; transform: scale(1.05); }

/* 모바일 뷰 */
@media (max-width: 640px) {
    .search-and-sort { flex-direction: column; width: 100%; }
    .sort-select, .search-box, .search-box input { width: 100%; }
}

.featured-card { display: flex; background: #fff; border-radius: 24px; overflow: hidden; box-shadow: 0 10px 30px rgba(0,0,0,0.04); margin-bottom: 50px; cursor: pointer; border: 1px solid #f1f5f9; transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1); }
.featured-card:hover { transform: translateY(-5px); box-shadow: 0 20px 40px rgba(0,0,0,0.08); border-color: #e2e8f0; }
.featured-image {
    width: 55%;
    aspect-ratio: 16 / 9;
    position: relative;
    background: #1e1e2d; /* #f1f5f9 대신 로딩 시 더 깔끔한 어두운 톤 */
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
}
.featured-image img {
    position: absolute;
    top: 0; left: 0;
    width: 100% !important;
    height: 100% !important;
    object-fit: cover !important;
    transition: transform 0.4s ease;
}
.featured-card:hover .featured-image img { transform: scale(1.05); }
.featured-content { width: 45%; padding: 50px 40px; display: flex; flex-direction: column; justify-content: center; }
.featured-badge { display: inline-flex; align-items: center; background: #e11d48; color: #fff; font-size: 0.85rem; font-weight: 800; padding: 6px 14px; border-radius: 20px; align-self: flex-start; margin-bottom: 20px; }
.featured-title { font-size: 2.2rem; font-weight: 800; color: var(--text-main); margin: 0 0 12px 0; line-height: 1.35; word-break: keep-all; }
.featured-subtitle { font-size: 1.15rem; color: var(--text-muted); margin: 0 0 24px 0; }
.featured-preview { font-size: 1.1rem; color: #475569; line-height: 1.6; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; margin-bottom: 30px; }
.featured-preview * { display: inline !important; margin: 0 6px 0 0 !important; font-size: 1.1rem !important; font-weight: 400 !important; color: #475569 !important; pointer-events: none !important; }
.featured-action { font-weight: 800; color: var(--primary); font-size: 1.1rem; display: flex; align-items: center; gap: 8px; }

.grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); gap: 30px; align-items: stretch; }
.card { background: var(--card-bg); border-radius: 20px; box-shadow: 0 4px 20px rgba(0, 0, 0, 0.04); transition: all 0.3s; display: flex; flex-direction: column; height: 100%; border: 1px solid #f1f5f9; cursor: pointer; overflow: hidden; }
.card:hover { transform: translateY(-8px); box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1); border-color: #e2e8f0; }
.card-image-wrapper {
    width: 100%;
    aspect-ratio: 4 / 3;
    background: #1e1e2d;
    overflow: hidden;
    position: relative;
    border-bottom: 1px solid #f1f5f9;
    display: flex;
    align-items: center;
    justify-content: center;
}
.card-image-wrapper img {
    position: absolute;
    top: 0; left: 0;
    width: 100% !important;
    height: 100% !important;
    object-fit: cover !important;
    transition: transform 0.4s ease;
}
.card:hover .card-image-wrapper img { transform: scale(1.05); }
.card-image-fallback { width: 100%; height: 100%; display: flex; align-items: center; justify-content: center; background: linear-gradient(135deg, #eff6ff, #dbeafe); color: #2563eb; font-weight: 800; font-size: 1.4rem; padding: 20px; text-align: center; word-break: keep-all; }
.card-header { padding: 20px 24px 10px; }
.keyword-tag { display: inline-flex; align-items: center; background-color: #eff6ff; color: var(--primary); font-size: 0.85rem; font-weight: 700; padding: 6px 14px; border-radius: 30px; margin-bottom: 12px; text-decoration: none; transition: 0.2s; }
.keyword-tag:hover { background-color: var(--primary); color: #fff; }
.card-title { margin: 0; font-size: 1.25rem; font-weight: 700; color: var(--text-main); word-break: keep-all; line-height: 1.4; }
.card-subtitle { font-size: 0.875rem; color: var(--text-muted); margin-top: 8px; }
.card-body { padding: 0 24px 24px; flex-grow: 1; display: flex; flex-direction: column; }
.content-preview { font-size: 0.95rem; color: #475569; line-height: 1.5; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; max-height: 4.5em; margin-top: auto; }
.content-preview * {
    display: inline !important;
    margin: 0 6px 0 0 !important; /* 오른쪽 마진을 6px 주어 제목과 본문 사이 띄어쓰기 강제 유발 */
    font-size: 0.95rem !important;
    font-weight: 400 !important;
    color: #475569 !important;
    pointer-events: none !important;
}

.card-meta { display: flex; align-items: center; justify-content: space-between; margin-top: 15px; padding-top: 15px; border-top: 1px dashed #f1f5f9; }
.card-author { display: flex; align-items: center; gap: 8px; }
.card-author img { width: 24px; height: 24px; border-radius: 50%; background: #f8fafc; border: 1px solid #e2e8f0; }
.card-author-name { font-size: 0.85rem; font-weight: 700; color: #475569; }
.card-date { font-size: 0.8rem; color: #94a3b8; font-weight: 500; }

.empty-state { grid-column: 1 / -1; text-align: center; padding: 80px 20px; color: var(--text-muted); background: #fff; border-radius: 20px; border: 1px dashed #cbd5e1; }
.load-more-container { text-align: center; margin-top: 50px; padding-bottom: 40px; }
.load-more-btn { padding: 14px 40px; border-radius: 30px; background: #fff; border: 2px solid #e2e8f0; color: #475569; font-weight: 700; cursor: pointer; transition: 0.2s; }
.load-more-btn:hover { border-color: var(--primary); color: var(--primary); }
.load-more-btn:disabled { opacity: 0.5; cursor: not-allowed; }

@media (max-width: 800px) {
    .featured-card { flex-direction: column; } .featured-image, .featured-content { width: 100%; } .featured-image { height: 280px; } .featured-content { padding: 30px 20px; } .featured-title { font-size: 1.8rem; }
}
@media (max-width: 640px) {
    .toolbar { flex-direction: column; align-items: stretch; }
    .search-and-sort { flex-direction: column; width: 100%; }
    .sort-select { width: 100%; }
    .search-box { width: 100%; }
    .search-box input { width: 100%; }
    .card-image-wrapper { height: 180px; }
    .ticker-title { display: none; }
}