/* 리마켓 STORY 상세 페이지 전용 CSS */
/* CSS 버전: 1.2.2 */

/* 기본 스타일 리셋 */
.story-detail-section * {
    box-sizing: border-box;
}

/* 메인 컨테이너 */
.story-detail-section {
    background-color: #ffffff;
    min-height: 100vh;
    padding: 40px 0 80px 0;
}

.story-detail-container {
    max-width: 1600px;
    margin: 0 auto;
    padding: 0 20px;
}

/* 헤더 섹션 */
.story-detail-header {
    margin-bottom: 50px;
    padding-bottom: 30px;
    border-bottom: 1px solid #e9ecef;
    max-width: 1600px;
    margin-left: auto;
    margin-right: auto;
}

.story-detail-category {
    font-size: 14px;
    font-weight: 500;
    color: #6c757d;
    margin: 0 0 12px 0;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.story-detail-title {
    font-size: 42px;
    font-weight: 900;
    color: #1a1a1a;
    margin: 0 0 20px 0;
    line-height: 1.2;
    letter-spacing: -0.5px;
}

.story-detail-subtitle {
    font-size: 18px;
    font-weight: 400;
    color: #495057;
    margin: 0;
    line-height: 1.6;
}

/* 본문 콘텐츠 */
.story-detail-content {
    margin-bottom: 80px;
    max-width: 1600px;
    margin-left: auto;
    margin-right: auto;
}

/* 본문 내 테이블: Bootstrap Reboot의 tbody,td,th { border-width:0 } 무력화
 * 저장된 HTML의 인라인 border-color가 보이도록 border-width·border-style 부여 */
.story-detail-content table,
.story-detail-content table tbody,
.story-detail-content table td,
.story-detail-content table tfoot,
.story-detail-content table th,
.story-detail-content table thead,
.story-detail-content table tr {
    border-width: 1px;
    border-style: solid;
    border-color: #dee2e6;
}
.story-detail-content table {
    border-collapse: collapse;
}

.story-content-section {
    margin-bottom: 60px;
}

/* 인트로 텍스트 섹션 */
.story-content-text-intro {
    max-width: 100%;
    margin: 0 auto;
}

.story-intro-text {
    font-size: 20px;
    line-height: 1.8;
    color: #495057;
    text-align: center;
    font-weight: 400;
}

/* 이미지 왼쪽, 텍스트 오른쪽 레이아웃 */
.story-content-section {
    margin-bottom: 60px;
}

/* 그리드 레이아웃이 있는 섹션 (이미지와 텍스트가 함께 있는 경우) */
.story-content-section:has(.story-content-image-left),
.story-content-section:has(.story-content-image-right),
.story-content-section.story-content-reverse {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 50px;
    align-items: flex-start;
}

/* 그리드 비율 클래스 */
.story-content-section.story-grid-2-10 {
    grid-template-columns: 2fr 10fr !important;
}

.story-content-section.story-grid-3-9 {
    grid-template-columns: 3fr 9fr !important;
}

.story-content-section.story-grid-4-6 {
    grid-template-columns: 4fr 6fr !important;
}

/* 왼쪽 제목/설명 + 오른쪽 이미지 비율 (텍스트 넓음) */
.story-content-section.story-grid-10-2 {
    grid-template-columns: 10fr 2fr !important;
}

.story-content-section.story-grid-9-3 {
    grid-template-columns: 9fr 3fr !important;
}

.story-content-section.story-grid-6-4 {
    grid-template-columns: 6fr 4fr !important;
}

/* 반응형: 모바일에서는 모든 그리드가 세로 배치 */
@media (max-width: 768px) {
    .story-content-section.story-grid-2-10,
    .story-content-section.story-grid-3-9,
    .story-content-section.story-grid-4-6,
    .story-content-section.story-grid-10-2,
    .story-content-section.story-grid-9-3,
    .story-content-section.story-grid-6-4 {
        grid-template-columns: 1fr !important;
    }
}

/* 반응형: 모바일에서는 세로 배치 */
@media (max-width: 768px) {
    .story-content-section {
        display: block !important;
    }
    
    .story-content-section:has(.story-content-image-left),
    .story-content-section:has(.story-content-image-right),
    .story-content-section.story-content-reverse {
        display: block !important;
        grid-template-columns: 1fr !important;
    }
    
    .story-content-image-left,
    .story-content-image-right {
        width: 100% !important;
        margin-bottom: 30px;
    }
    
    .story-content-text-left,
    .story-content-text-right {
        width: 100% !important;
    }
    
    .story-content-heading {
        font-size: 24px !important;
    }
    
    .story-content-paragraph {
        font-size: 16px !important;
    }
    
    .story-detail-title {
        font-size: 32px !important;
    }
    
    .story-detail-subtitle {
        font-size: 16px !important;
    }
}

.story-content-image-left {
    width: 100%;
    border-radius: 16px;
    overflow: hidden;
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.1);
}

.story-content-text-right {
    width: 100%;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.story-content-image-full {
    width: 100%;
    margin-bottom: 40px;
    border-radius: 16px;
    overflow: hidden;
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.1);
}

.story-content-text-below {
    width: 100%;
    max-width: 900px;
    margin: 0 auto;
}

/* 역순 레이아웃 (텍스트 왼쪽, 이미지 오른쪽) */
.story-content-reverse {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 50px;
    align-items: flex-start;
}

.story-content-text-left {
    width: 100%;
    display: flex;
    flex-direction: column;
    justify-content: center;
    order: 1;
}

.story-content-image-right {
    width: 100%;
    border-radius: 16px;
    overflow: hidden;
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.1);
    order: 2;
}

.story-content-img {
    width: 100%;
    height: auto;
    display: block;
    object-fit: cover;
}

.story-content-heading {
    font-size: 32px;
    font-weight: 800;
    color: #1a1a1a;
    margin: 0 0 25px 0;
    line-height: 1.3;
    letter-spacing: -0.5px;
}

.story-content-paragraph {
    font-size: 18px;
    font-weight: 400;
    color: #495057;
    margin: 0;
    line-height: 1.9;
}

.story-content-paragraph:last-child {
    margin-bottom: 0;
}

/* 제품 리스트 섹션 */
.story-products-section {
    margin: 60px 0;
    padding: 40px 0;
    border-top: 1px solid #e9ecef;
}

.story-products-title {
    font-size: 28px;
    font-weight: 800;
    color: #1a1a1a;
    margin: 0 0 30px 0;
}

.story-products-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 20px;
}

.story-product-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
}

.story-product-image {
    width: 100%;
    aspect-ratio: 1 / 1;
    border-radius: 12px;
    overflow: hidden;
    background: #f8f9fa;
}

.product-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.story-product-label {
    font-size: 14px;
    font-weight: 600;
    color: #495057;
    text-align: center;
}

/* 구분선 */
.story-content-divider {
    border: none;
    border-top: 1px solid #e9ecef;
    margin: 60px 0;
}

/* 이전글/다음글 네비게이션 */
.story-navigation-section {
    margin: 40px 0;
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.story-nav-item {
    display: flex;
    align-items: center;
    gap: 20px;
    padding: 20px;
    background: #ffffff;
    border: 1px solid #e9ecef;
    border-radius: 12px;
    text-decoration: none;
    color: inherit;
    transition: all 0.3s ease;
    cursor: pointer;
}

.story-nav-item:hover {
    border-color: #0058a3;
    box-shadow: 0 4px 15px rgba(0, 88, 163, 0.1);
    transform: translateX(5px);
}

.story-nav-prev:hover {
    transform: translateX(-5px);
}

.story-nav-thumbnail {
    width: 120px;
    height: 120px;
    flex-shrink: 0;
    border-radius: 8px;
    overflow: hidden;
    background: #f8f9fa;
}

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

.story-nav-item:hover .nav-thumbnail-img {
    transform: scale(1.1);
}

.story-nav-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.story-nav-label {
    font-size: 14px;
    font-weight: 600;
    color: #6c757d;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

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

.story-nav-item:hover .story-nav-title {
    color: #0058a3;
}

.story-nav-arrow {
    width: 40px;
    height: 40px;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #f8f9fa;
    border-radius: 50%;
    color: #6c757d;
    font-size: 20px;
    transition: all 0.3s ease;
}

.story-nav-item:hover .story-nav-arrow {
    background: #0058a3;
    color: #ffffff;
    transform: scale(1.1);
}

/* 추천 게시글 섹션 */
.story-recommended-section {
    margin-top: 80px;
    padding-top: 60px;
    border-top: 2px solid #e9ecef;
    max-width: 1600px;
    margin-left: auto;
    margin-right: auto;
}

.story-recommended-title {
    font-size: 32px;
    font-weight: 900;
    color: #1a1a1a;
    margin: 0 0 8px 0;
}

.story-recommended-subtitle {
    font-size: 16px;
    font-weight: 400;
    color: #6c757d;
    margin: 0 0 40px 0;
}

.story-recommended-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 30px;
}

.story-recommended-card {
    background: #ffffff;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
    transition: all 0.3s ease;
    cursor: pointer;
}

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

.story-recommended-link {
    display: block;
    text-decoration: none;
    color: inherit;
}

.story-recommended-image {
    width: 100%;
    aspect-ratio: 1 / 1;
    overflow: hidden;
    background: #f8f9fa;
    border-radius: 12px 12px 0 0;
}

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

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

.story-recommended-content {
    padding: 20px;
    background: #ffffff;
}

.story-recommended-card-title {
    font-size: 18px;
    font-weight: 700;
    color: #1a1a1a;
    margin: 0 0 8px 0;
    line-height: 1.4;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.story-recommended-card-desc {
    font-size: 14px;
    font-weight: 400;
    color: #6c757d;
    margin: 0;
    line-height: 1.5;
}

/* 반응형 디자인 */
@media (max-width: 991px) {
    .story-detail-title {
        font-size: 36px;
    }

    .story-content-heading {
        font-size: 28px;
    }

    .story-content-paragraph {
        font-size: 16px;
    }

    .story-content-section:nth-of-type(2),
    .story-content-reverse {
        grid-template-columns: 1fr;
        gap: 30px;
    }
    
    .story-content-text-left {
        order: 2;
    }
    
    .story-content-image-right {
        order: 1;
    }
    
    .story-intro-text {
        font-size: 18px;
    }

    .story-products-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 15px;
    }

    .story-recommended-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 20px;
    }

    .story-nav-thumbnail {
        width: 100px;
        height: 100px;
    }

    .story-nav-item {
        padding: 15px;
        gap: 15px;
    }

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

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

    .story-detail-container {
        padding: 0 15px;
    }

    .story-detail-header {
        margin-bottom: 40px;
        padding-bottom: 20px;
    }

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

    .story-detail-subtitle {
        font-size: 16px;
    }

    .story-content-heading {
        font-size: 24px;
    }

    .story-content-paragraph {
        font-size: 15px;
    }

    .story-content-section {
        margin-bottom: 40px;
    }

    .story-products-section {
        margin: 40px 0;
        padding: 30px 0;
    }

    .story-products-title {
        font-size: 24px;
        margin-bottom: 20px;
    }

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

    .story-recommended-section {
        margin-top: 60px;
        padding-top: 40px;
    }

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

    .story-recommended-grid {
        grid-template-columns: 1fr;
        gap: 20px;
    }

    .story-nav-thumbnail {
        width: 80px;
        height: 80px;
    }

    .story-nav-item {
        padding: 12px;
        gap: 12px;
    }

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

    .story-nav-label {
        font-size: 12px;
    }

    .story-nav-arrow {
        width: 35px;
        height: 35px;
        font-size: 18px;
    }
}

@media (max-width: 576px) {
    .story-products-grid {
        grid-template-columns: 1fr;
    }
}

