/* 공통 변수 가져와 사용 */

/* 1. 히어로 비주얼 배너 섹션 */
.hero-section {
    display: flex;
    flex-direction: row-reverse;
    align-items: center;
    justify-content: space-between;
    background: linear-gradient(135deg, var(--color-bg-light) 0%, #FFFFFF 100%);
    /* background-image: url('/images/banner.webp'); */
    background-image: url('/images/bg.webp');
    background-position: center;
    background-repeat: no-repeat;
    background-size: cover;
    border-radius: 16px;
    padding: 40px;
    margin-bottom: 40px;
    overflow: hidden;
}
.hero-text h2 {
    font-size: 28px;
    font-weight: bold;
    /* color: var(--color-dark); */
    line-height: 1.4;
    margin-bottom: 15px;
    color : white;
    text-align: center;
}
.hero-text p {
    color : white;
    /* color: var(--color-gray); */
    margin-bottom: 25px;
}
.hero-buttons {
    display: flex;
    gap: 12px;
    flex-direction: column-reverse;
}
.hero-buttons button {
    padding: 12px 24px;
    border-radius: 8px;
    font-weight: bold;
    font-size: 15px;
}
.btn-primary {
    background-color: var(--color-primary);
    color: var(--color-white);
}
.btn-secondary {
    background-color: var(--color-white);
    color: var(--color-dark);
    border: 1px solid var(--color-gray);
}
.hero-character img {
    max-height: 220px;
    object-fit: contain;
}

/* 2. 섹션 공통 헤더 */
.content-section, .split-section {
    margin-bottom: 40px;
}
.section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}
.section-header h3 {
    font-size: 20px;
    font-weight: bold;
}
.btn-more {
    font-size: 14px;
    color: var(--color-gray);
}

/* 3. 오늘의 추천작 그리드 (PC 5열) */
.books-grid {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 20px;
}
/* 메인 카드 높이 균일화 및 글자 넘침 방지 */
.book-card {
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}
.book-title {
    margin-top: 8px;
    display: -webkit-box;
    -webkit-line-clamp: 1;
    -webkit-box-orient: vertical;
    overflow: hidden;
}
.book-card .thumb-box {
    position: relative;
    border-radius: 12px;
    overflow: hidden;
    aspect-ratio: 1 / 1; /* 시안 상 정사각형에 가까움 */
    margin-bottom: 10px;
    background-color: #E2E8F0;
}
.book-card .thumb-box img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}
.book-card .badge {
    position: absolute;
    top: 10px;
    left: 10px;
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 11px;
    font-weight: bold;
    color: white;
}
.book-card .badge.hot { background-color: #FF5A5F; }
.book-card .badge.new { background-color: #22C55E; }
.book-card .badge.recom { background-color: var(--color-primary); }

.book-info {
    font-size: 13px;
    color: var(--color-gray);
    margin: 2px 0 6px;
}
.book-meta {
    display: flex;
    gap: 10px;
    font-size: 12px;
    font-weight: 500;
}
.book-meta .rating { color: #FFB800; }
.book-meta .views { color: var(--color-gray); }

/* 4. 하단 2분할 레이아웃 (PC) */
.bottom-split-container {
    display: grid;
    grid-template-columns: 2fr 1fr; /* 인기작 2 : 실시간랭킹 1 비율 */
    gap: 24px;
    width: 100%;
}
.popularity-section { flex: 2; }
.ranking-section { flex: 1; }

/* 인기 연재작 와이드 카드 */
.wide-book-card {
    display: flex;
    align-items: center;
    background-color: var(--color-white);
    border-radius: 12px;
    padding: 20px;
    position: relative;
    border: 1px solid #F1F5F9;
}
.rank-num {
    font-size: 24px;
    font-weight: bold;
    color: var(--color-primary);
    margin-right: 15px;
}
.wide-thumb {
    width: 90px;
    height: 110px;
    object-fit: cover;
    border-radius: 8px;
    margin-right: 20px;
}
.wide-info {
    flex: 1;
    padding-right: 80px;
}
.book-summary {
    font-size: 13px;
    color: #64748B;
    margin: 8px 0;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}
.btn-continue {
    position: absolute;
    right: 20px;
    background-color: var(--color-bg-light);
    color: var(--color-primary);
    padding: 8px 16px;
    border-radius: 20px;
    font-weight: bold;
    font-size: 13px;
}

/* 실시간 랭킹 리스트 */
.ranking-list li {
    display: flex;
    align-items: center;
    padding: 12px 0;
    border-bottom: 1px solid #F1F5F9;
}
.rank-idx {
    font-weight: bold;
    width: 25px;
}
.rank-icon {
    width: 24px;
    height: 24px;
    border-radius: 4px;
    margin-right: 10px;
}
.rank-title {
    flex: 1;
    font-size: 14px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.rank-score {
    font-size: 13px;
    color: #FFB800;
    font-weight: bold;
}

.content-section {
    display: none !important;
}

/* 📱 모바일 메인 전용 반응형 변형 */
@media (max-width: 1024px) {
    .hero-section {
        flex-direction: row-reverse;
        align-items: flex-start;
        padding: 20px;
        gap: 20px;
    }
    .hero-character img {
        max-height: 150px;
    }
    .hero-text h2 {
        display: none;
        font-size: 15px;
        text-align: right;
        color: white;
        text-shadow: 0px 0px 1px black;
    }
    .hero-text p {
        display: none;
    }
    .hero-buttons {
      flex-direction: column;
    }
    .hero-buttons button {
        padding: 8px 12px;
        border-radius: 5px;
        font-weight: initial;
        font-size: 12px;
    }
    
    /* 모바일 추천작 가로 스크롤 혹은 3열 배치 */
    .books-grid {
        grid-template-columns: repeat(3, 1fr);
        gap: 12px;
    }
    
    /* 하단 분할 영역을 세로로 나열 */
    .bottom-split-container {
        /* flex-direction: column;
        gap: 20px; */
        grid-template-columns: 1fr; /* 모바일에서는 일렬 정렬 */
    }
    .wide-info {
        padding-right: 0;
    }
    .btn-continue {
        position: static;
        margin-top: 10px;
        display: inline-block;
    }
    .wide-book-card {
        flex-direction: column;
        align-items: flex-start;
    }
    .wide-thumb {
        margin-bottom: 10px;
    }


    .row-title-area {
        display: inline-block !important;
        width: 100%;
    }
    .row-title-area h4 {
        display: inline !important;
    }

    .row-title-area .author-name {
        display: inline-block !important;
        width: 100%;
        text-align: right;
    }
}


