/* 리마켓 STORY 페이지 전용 CSS */
/* CSS 버전: 1.1.0 */

.story-section {
    padding: 60px 0 100px;
    background: #ffffff;
    min-height: 80vh;
}

/* 헤더 섹션 */
.story-header {
    max-width: 1600px;
    margin: 0 auto 50px;
    padding: 0 20px;
    text-align: center;
}

.story-header-content {
    padding-bottom: 30px;
    border-bottom: 2px solid #e9ecef;
}

.story-intro-question {
    font-size: 18px;
    font-weight: 500;
    color: #6c757d;
    margin: 0 0 15px 0;
}

.story-main-title {
    font-size: 48px;
    font-weight: 900;
    color: #1a1a1a;
    margin: 0;
    letter-spacing: -1px;
}

/* 필터링 섹션 */
.story-filters-section {
    max-width: 1600px;
    margin: 0 auto 40px;
    padding: 0 20px;
}

.filters-section-title {
    font-size: 20px;
    font-weight: 700;
    color: #1a1a1a;
    margin: 0 0 20px 0;
}

.filters-wrapper {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
}

.filter-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 12px 24px;
    background: #ffffff;
    border: 2px solid #e9ecef;
    border-radius: 25px;
    color: #495057;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
}

.filter-btn:hover {
    border-color: #0058a3;
    color: #0058a3;
    background: rgba(0, 88, 163, 0.05);
    transform: translateY(-2px);
}

.filter-btn.active {
    background: linear-gradient(135deg, #22c55e, #16a34a);
    border-color: #22c55e;
    color: #ffffff;
    box-shadow: 0 4px 15px rgba(34, 197, 94, 0.3);
}

.filter-btn.active:hover {
    background: linear-gradient(135deg, #16a34a, #15803d);
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(34, 197, 94, 0.4);
}

.filter-btn i {
    font-size: 14px;
}

/* 검색 섹션 */
.story-search-section {
    max-width: 1600px;
    margin: 0 auto 50px;
    padding: 0 20px;
}

.search-section-title {
    font-size: 20px;
    font-weight: 700;
    color: #1a1a1a;
    margin: 0 0 20px 0;
}

.search-wrapper {
    position: relative;
    max-width: 600px;
}

.story-search-input {
    width: 100%;
    padding: 16px 60px 16px 24px;
    border: 2px solid #e9ecef;
    border-radius: 30px;
    font-size: 16px;
    font-family: inherit;
    color: #1a1a1a;
    background: #ffffff;
    transition: all 0.3s ease;
}

.story-search-input:focus {
    outline: none;
    border-color: #0058a3;
    box-shadow: 0 0 0 4px rgba(0, 88, 163, 0.1);
}

.story-search-input::placeholder {
    color: #adb5bd;
}

.story-search-btn {
    position: absolute;
    right: 8px;
    top: 50%;
    transform: translateY(-50%);
    width: 44px;
    height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #0058a3, #003d7a);
    color: #ffffff;
    border: none;
    border-radius: 50%;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 12px rgba(0, 88, 163, 0.3);
}

.story-search-btn:hover {
    background: linear-gradient(135deg, #003d7a, #002855);
    transform: translateY(-50%) scale(1.05);
    box-shadow: 0 6px 20px rgba(0, 88, 163, 0.4);
}

.story-search-btn i {
    font-size: 20px;
}

/* 콘텐츠 래퍼 */
.story-content-wrapper {
    max-width: 1600px;
    margin: 0 auto;
    padding: 0 20px;
}

/* 콘텐츠 그리드 */
.story-content-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 12px;
    grid-auto-rows: minmax(200px, auto);
}

.story-card {
    background: #ffffff;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.06);
    transition: all 0.3s ease;
    cursor: pointer;
    display: flex;
    flex-direction: column;
}

.story-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.15);
}

/* 큰 피처드 카드: 첫 번째 카드, 2x2 크기 (왼쪽 상단) */
.story-card-featured {
    grid-column: 1 / span 2;
    grid-row: 1 / span 2;
}

/* 작은 카드: 우측 상단/하단 2개씩 2줄 - 명시적 위치 지정 */
.story-card-pos-3-1 {
    grid-column: 3;
    grid-row: 1;
}

.story-card-pos-4-1 {
    grid-column: 4;
    grid-row: 1;
}

.story-card-pos-3-2 {
    grid-column: 3;
    grid-row: 2;
}

.story-card-pos-4-2 {
    grid-column: 4;
    grid-row: 2;
}

/* 일반 카드: 세 번째 행부터 1줄에 4개씩 자동 배치 */
.story-card-regular {
    grid-column: span 1;
    grid-row: span 1;
}

/* 검색 시: 균일 4열 그리드 (왼쪽 큰 셀 제외, 모두 동일 크기) */
.story-content-grid--search .story-card-featured,
.story-content-grid--search .story-card-pos-3-1,
.story-content-grid--search .story-card-pos-4-1,
.story-content-grid--search .story-card-pos-3-2,
.story-content-grid--search .story-card-pos-4-2,
.story-content-grid--search .story-card-regular {
    grid-column: span 1;
    grid-row: span 1;
}
.story-content-grid--search .story-card-featured .story-card-title {
    font-size: 16px;
    font-weight: 700;
}
.story-content-grid--search .story-card-featured .story-card-subtitle {
    font-size: 14px;
}
.story-content-grid--search .story-card-featured .story-card-content {
    padding: 14px 16px;
}

.story-card-link {
    display: block;
    text-decoration: none;
    color: inherit;
    height: 100%;
    display: flex;
    flex-direction: column;
    gap: 0;
}

.story-card-image {
    width: 100%;
    overflow: hidden;
    background: #f8f9fa;
    flex-shrink: 0;
    aspect-ratio: 1 / 1;
}

.story-card-featured .story-card-image {
    aspect-ratio: 1 / 1;
}

.story-image {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    transition: transform 0.3s ease;
}

.story-card:hover .story-image {
    transform: scale(1.05);
}

.story-card-content {
    padding: 12px 14px;
    background: #ffffff;
    flex-shrink: 0;
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
}

.story-card-featured .story-card-content {
    padding: 18px 20px;
}

.story-card-title {
    font-size: 16px;
    font-weight: 700;
    color: #1a1a1a;
    margin: 0;
    line-height: 1.4;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    text-overflow: ellipsis;
}

.story-card-featured .story-card-title {
    font-size: 24px;
    font-weight: 900;
    line-height: 1.3;
    -webkit-line-clamp: 2;
    margin-bottom: 6px;
}

.story-category-badge {
    display: block;
    padding: 4px 10px;
    background-color: #f0f0f0;
    color: #666;
    font-size: 11px;
    font-weight: 600;
    border-radius: 4px;
    margin-right: 0;
    margin-bottom: 6px;
    vertical-align: middle;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    width: fit-content;
}

.story-card-subtitle {
    font-size: 16px;
    font-weight: 500;
    color: #6c757d;
    margin: 0;
    line-height: 1.4;
}

.story-card-subtitle-small {
    font-size: 13px;
    font-weight: 400;
    color: #6c757d;
    margin: 4px 0 0 0;
    line-height: 1.4;
    display: -webkit-box;
    -webkit-line-clamp: 1;
    -webkit-box-orient: vertical;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* 더 보기 버튼 */
.story-load-more-wrapper {
    max-width: 1600px;
    margin: 60px auto 0;
    padding: 0 20px;
    display: flex;
    justify-content: center;
    align-items: center;
}

.story-load-more-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    padding: 16px 40px;
    background: linear-gradient(135deg, #0058a3, #003d7a);
    color: #ffffff;
    border: none;
    border-radius: 50px;
    font-size: 18px;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(0, 88, 163, 0.3);
}

.story-load-more-btn:hover {
    transform: translateY(-3px);
    box-shadow: 0 6px 20px rgba(0, 88, 163, 0.4);
    background: linear-gradient(135deg, #0066b8, #004a8f);
}

.story-load-more-btn:active {
    transform: translateY(-1px);
}

.story-load-more-btn i {
    font-size: 20px;
    transition: transform 0.3s ease;
}

.story-load-more-btn:hover i {
    transform: translateY(3px);
}

/* 반응형 디자인 */
@media (max-width: 1200px) {

    .story-content-grid {
        grid-template-columns: repeat(3, 1fr);
        gap: 12px;
    }

    .story-card-featured {
        grid-column: 1 / span 2;
        grid-row: 1 / span 2;
    }

    /* 작은 카드 위치 재조정 */
    .story-card-pos-3-1 {
        grid-column: 3;
        grid-row: 1;
    }

    .story-card-pos-4-1 {
        grid-column: 1;
        grid-row: 3;
    }

    .story-card-pos-3-2 {
        grid-column: 2;
        grid-row: 3;
    }

    .story-card-pos-4-2 {
        grid-column: 3;
        grid-row: 2;
    }

    .story-card-regular {
        grid-column: span 1;
    }
}

@media (max-width: 991px) {
    .story-section {
        padding: 40px 0 80px;
    }

    .story-main-title {
        font-size: 36px;
    }

    .story-card-featured .story-card-title {
        font-size: 28px;
    }

    .story-card-title {
        font-size: 16px;
    }
}

@media (max-width: 768px) {
    .story-section {
        padding: 30px 0 60px;
    }

    .story-intro-question {
        font-size: 16px;
    }

    .story-main-title {
        font-size: 32px;
    }

    .filters-section-title,
    .search-section-title {
        font-size: 18px;
    }

    .filter-btn {
        padding: 10px 20px;
        font-size: 14px;
    }

    .story-search-input {
        padding: 14px 55px 14px 20px;
        font-size: 15px;
    }

    .story-search-btn {
        width: 40px;
        height: 40px;
    }


    .story-content-grid {
        grid-template-columns: 1fr;
        gap: 10px;
    }

    .story-card-featured {
        grid-column: span 1;
        grid-row: span 1;
    }

    .story-card-featured .story-card-image {
        aspect-ratio: 1 / 1;
    }

    .story-card-featured .story-card-title {
        font-size: 18px;
    }

    .story-card-content {
        padding: 10px 12px;
    }

    .story-card-featured .story-card-content {
        padding: 12px 14px;
    }

    .story-card-pos-3-1,
    .story-card-pos-4-1,
    .story-card-pos-3-2,
    .story-card-pos-4-2 {
        grid-column: span 1;
        grid-row: span 1;
    }
}

@media (max-width: 576px) {
    .story-main-title {
        font-size: 28px;
    }

    .filters-wrapper {
        gap: 8px;
    }

    .filter-btn {
        padding: 8px 16px;
        font-size: 13px;
    }

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

    .story-card-featured .story-card-title {
        font-size: 20px;
    }
}

