/**
 * Trenue AI News Frontend CSS v2.9.26
 * - 모바일 반응형 개선
 * - 프론트페이지 뉴스 탭 모바일 최적화
 * - PREMIUM 배지 스타일 추가
 * - 주가 표시 스타일
 * - 관련 뉴스 스타일
 * - 인라인 배너 스타일
 * - 그라데이션 약화
 * - 배너 높이 설정에서 조절 가능
 * - 돋움체 한글 폰트
 */

/* 주가 표시 스타일 */
.trenue-stock-price {
    font-size: 0.9em;
    font-weight: 600;
    margin-left: 5px;
}

.trenue-stock-up { color: #e53935 !important; }
.trenue-stock-down { color: #1976d2 !important; }
.trenue-stock-neutral { color: #333 !important; }

/* 관련 뉴스 스타일 */
.trenue-related-news {
    margin-top: 30px;
    padding: 20px;
    background: #f9f9f9;
    border-radius: 8px;
}

.trenue-related-news ul {
    margin: 0;
    padding-left: 20px;
}

.trenue-related-news li {
    margin-bottom: 8px;
}

.trenue-related-news a {
    color: #1a73e8;
    text-decoration: none;
}

.trenue-related-news a:hover {
    text-decoration: underline;
}

/* 인라인 배너 */
.trenue-inline-banner {
    margin: 25px 0;
    padding: 15px;
    text-align: center;
}

/* 관련 유튜브 영상 */
.trenue-related-video {
    margin: 30px 0;
    padding: 20px;
    background: #f8f9fa;
    border-radius: 10px;
}

.trenue-related-video p {
    font-size: 14px;
    color: #666;
    margin-bottom: 10px;
}

/* PREMIUM 배지 스타일 */
.trenue-premium-badge {
    height: 18px;
    vertical-align: middle;
    margin-right: 8px;
}

.trenue-premium-text-badge {
    display: inline-block;
    font-size: 11px;
    font-weight: 700;
    padding: 3px 10px;
    border-radius: 4px;
    margin-right: 10px;
    vertical-align: middle;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    /* 기본값 - 인라인 스타일로 덮어쓰기 가능 */
    background-color: #ff6b6b;
    color: #ffffff;
}

/* 유튜브 영상 콘텐츠 헤더 */
.trenue-video-content-title {
    font-size: 20px;
    font-weight: 700;
    color: #333;
    margin: 30px 0 20px 0;
    padding-bottom: 10px;
    border-bottom: 2px solid #4a90d9;
}

/* 유튜브 영상 서술 */
.trenue-video-description {
    line-height: 2.0;
    color: #444;
    font-size: 16px;
}

.trenue-video-description p,
.trenue-video-description br + br {
    margin-bottom: 20px;
}

.trenue-video-description strong {
    color: #1a1a1a;
    font-weight: 600;
}

.trenue-video-description h3 {
    font-size: 18px;
    font-weight: 700;
    color: #333;
    margin: 25px 0 15px 0;
}

/* 본문 내 광고 */
.trenue-content-ad {
    margin: 25px 0;
    padding: 15px;
    background: #f8f9fa;
    border-radius: 8px;
    text-align: center;
}

/* 전체 한글 폰트 돋움체 적용 */
body,
.trenue-content-preview,
.trenue-preview-text,
.trenue-signup-banner,
.trenue-premium-banner,
.trenue-source-card {
    font-family: 'Dotum', '돋움', 'Apple SD Gothic Neo', 'Malgun Gothic', '맑은 고딕', sans-serif !important;
}

/* 미리보기 영역 */
.trenue-content-preview {
    position: relative;
    max-height: 280px;
    overflow: hidden;
    margin-bottom: 0;
    padding-bottom: 20px; /* 간격 좁힘 */
}

.trenue-preview-text {
    font-family: 'Dotum', '돋움', 'Apple SD Gothic Neo', 'Malgun Gothic', '맑은 고딕', sans-serif !important;
    line-height: 1.8;
    color: #333;
    font-size: 16px;
}

.trenue-preview-text p {
    margin: 0;
    padding: 15px 0;
}

/* 그라데이션 - 약간 더 강하게 */
.trenue-preview-fade {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 100px; /* 80px → 100px 늘림 */
    background: linear-gradient(
        to bottom,
        rgba(255, 255, 255, 0) 0%,
        rgba(255, 255, 255, 0.4) 30%,
        rgba(255, 255, 255, 0.8) 60%,
        rgba(255, 255, 255, 1) 100%
    );
    pointer-events: none;
}

/* 회원가입 배너 (비회원용) - padding은 인라인 스타일로 조절 */
.trenue-signup-banner {
    font-family: 'Dotum', '돋움', 'Apple SD Gothic Neo', 'Malgun Gothic', '맑은 고딕', sans-serif !important;
    /* padding, margin은 인라인 스타일에서 설정됨 - !important 없음 */
}

.trenue-signup-banner h3 {
    font-family: 'Dotum', '돋움', 'Apple SD Gothic Neo', 'Malgun Gothic', '맑은 고딕', sans-serif !important;
    font-weight: 700 !important;
    line-height: 1.4 !important;
}

.trenue-signup-banner p {
    font-family: 'Dotum', '돋움', 'Apple SD Gothic Neo', 'Malgun Gothic', '맑은 고딕', sans-serif !important;
}

.trenue-signup-banner a {
    font-family: 'Dotum', '돋움', 'Apple SD Gothic Neo', 'Malgun Gothic', '맑은 고딕', sans-serif !important;
    transition: transform 0.2s, box-shadow 0.2s;
}

.trenue-signup-banner a:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(0,0,0,0.2);
}

/* 프리미엄 배너 (무료회원용) - padding은 인라인 스타일로 조절 */
.trenue-premium-banner {
    font-family: 'Dotum', '돋움', 'Apple SD Gothic Neo', 'Malgun Gothic', '맑은 고딕', sans-serif !important;
    /* padding, margin은 인라인 스타일에서 설정됨 - !important 없음 */
}

.trenue-premium-banner h3 {
    font-family: 'Dotum', '돋움', 'Apple SD Gothic Neo', 'Malgun Gothic', '맑은 고딕', sans-serif !important;
    font-weight: 700 !important;
    line-height: 1.4 !important;
}

.trenue-premium-banner p {
    font-family: 'Dotum', '돋움', 'Apple SD Gothic Neo', 'Malgun Gothic', '맑은 고딕', sans-serif !important;
}

.trenue-premium-banner a {
    font-family: 'Dotum', '돋움', 'Apple SD Gothic Neo', 'Malgun Gothic', '맑은 고딕', sans-serif !important;
    transition: transform 0.2s, box-shadow 0.2s;
}

.trenue-premium-banner a:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 25px rgba(0,0,0,0.3);
}

/* 광고 컨테이너 */
.trenue-ad-container {
    margin: 30px 0;
    padding: 20px;
    background: #f9f9f9;
    border-radius: 8px;
    text-align: center;
}

/* 원본 기사 링크 카드 */
.trenue-source-card {
    font-family: 'Dotum', '돋움', 'Apple SD Gothic Neo', 'Malgun Gothic', '맑은 고딕', sans-serif !important;
    transition: box-shadow 0.2s, transform 0.2s;
}

.trenue-source-card:hover {
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
    transform: translateY(-1px);
}

/* 대표 이미지 */
.trenue-featured-image {
    margin: 0 0 25px 0;
}

.trenue-featured-image img {
    width: 100%;
    height: auto;
    border-radius: 10px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.1);
}

/* 유튜브 임베드 */
.trenue-youtube-embed {
    position: relative;
    width: 100%;
    padding-bottom: 56.25%; /* 16:9 비율 */
    margin-bottom: 25px;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 4px 20px rgba(0,0,0,0.15);
}

.trenue-youtube-embed iframe {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    border: none;
}

/* 유튜브 숏폼 (세로) */
.trenue-youtube-shorts {
    position: relative;
    width: 100%;
    max-width: 400px;
    margin: 0 auto 25px auto;
    padding-bottom: 177.78%; /* 9:16 비율 */
    border-radius: 16px;
    overflow: hidden;
    box-shadow: 0 4px 20px rgba(0,0,0,0.15);
}

.trenue-youtube-shorts iframe {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    border: none;
}

/* 반응형 - 모바일에서는 작게 */
@media (max-width: 768px) {
    /* 배너 모바일 최적화 */
    .trenue-signup-banner,
    .trenue-premium-banner {
        padding: 30px 20px !important;
        margin: 0 -15px !important; /* 모바일에서 좌우 여백 제거 */
        border-radius: 0 !important;
    }
    
    .trenue-signup-banner h3,
    .trenue-premium-banner h3 {
        font-size: 18px !important;
        line-height: 1.5 !important;
        word-break: keep-all !important;
    }
    
    .trenue-signup-banner p,
    .trenue-premium-banner p {
        font-size: 13px !important;
        line-height: 1.6 !important;
    }
    
    /* 배너 버튼 모바일 최적화 */
    .trenue-signup-banner a,
    .trenue-premium-banner a {
        display: inline-block !important;
        padding: 12px 24px !important;
        font-size: 13px !important;
        margin: 5px !important;
    }
    
    .trenue-preview-fade {
        height: 60px;
    }
    
    .trenue-youtube-shorts {
        max-width: 100%;
    }
    
    /* 미리보기 텍스트 모바일 */
    .trenue-preview-text {
        font-size: 15px !important;
        line-height: 1.7 !important;
    }
    
    .trenue-content-preview {
        max-height: 220px;
    }
    
    /* PREMIUM 배지 모바일 */
    .trenue-premium-text-badge {
        font-size: 10px !important;
        padding: 2px 8px !important;
        margin-right: 6px !important;
    }
    
    /* 유튜브 임베드 모바일 */
    .trenue-youtube-embed {
        margin: 0 -15px 20px -15px;
        border-radius: 0;
        width: calc(100% + 30px);
    }
    
    /* 원본 기사 카드 모바일 */
    .trenue-source-card {
        padding: 12px !important;
        margin: 15px 0 !important;
    }
    
    /* 관련 뉴스 모바일 */
    .trenue-related-news {
        padding: 15px;
        margin: 20px -15px;
        border-radius: 0;
    }
    
    /* 광고 컨테이너 모바일 */
    .trenue-ad-container,
    .trenue-content-ad {
        padding: 10px;
        margin: 15px -15px;
        border-radius: 0;
    }
    
    /* 더보기 버튼 모바일 */
    .trenue-read-more-btn {
        padding: 10px 20px;
        font-size: 14px;
    }
    
    .trenue-read-more-divider {
        margin: 20px 0;
    }
}

/* 아주 작은 화면 (iPhone SE 등) */
@media (max-width: 375px) {
    .trenue-signup-banner,
    .trenue-premium-banner {
        padding: 25px 15px !important;
    }
    
    .trenue-signup-banner h3,
    .trenue-premium-banner h3 {
        font-size: 16px !important;
    }
    
    .trenue-signup-banner a,
    .trenue-premium-banner a {
        padding: 10px 18px !important;
        font-size: 12px !important;
    }
    
    .trenue-preview-text {
        font-size: 14px !important;
    }
    
    .trenue-premium-text-badge {
        font-size: 9px !important;
        padding: 2px 6px !important;
    }
}

/* ===== 더보기 (Read More) 기능 ===== */
.trenue-read-more-container {
    position: relative;
}

.trenue-preview-content {
    line-height: 2.0;
}

.trenue-read-more-wrapper {
    position: relative;
}

.trenue-read-more-divider {
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 30px 0;
    position: relative;
}

.trenue-read-more-divider::before,
.trenue-read-more-divider::after {
    content: '';
    flex: 1;
    height: 1px;
    background: linear-gradient(to right, transparent, #ddd, #ddd, transparent);
}

.trenue-read-more-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 12px 28px;
    margin: 0 20px;
    background: linear-gradient(135deg, #4a90d9 0%, #3a7bc8 100%);
    color: #fff;
    border: none;
    border-radius: 30px;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(74, 144, 217, 0.3);
}

.trenue-read-more-btn:hover {
    background: linear-gradient(135deg, #5a9fe9 0%, #4a8bd8 100%);
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(74, 144, 217, 0.4);
}

.trenue-read-more-btn svg {
    transition: transform 0.3s ease;
}

.trenue-read-more-btn.expanded svg {
    transform: rotate(180deg);
}

.trenue-hidden-content {
    animation: fadeIn 0.5s ease;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.trenue-read-more-banner {
    margin: 20px 0 30px 0;
    padding: 15px;
    background: #f9f9f9;
    border-radius: 8px;
    text-align: center;
}

/* 유튜브 캠페인 배너 */
.trenue-yt-banner {
    margin: 25px 0;
    padding: 15px;
    text-align: center;
}

/* ===== 프론트페이지 뉴스 탭 메뉴 모바일 최적화 ===== */
/* 뉴스 카테고리 탭 - 모바일 가로 스크롤 */
.news-category-tabs,
.category-filter-tabs,
[class*="news-tabs"],
[class*="category-tabs"] {
    display: flex;
    flex-wrap: nowrap;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none; /* Firefox */
    -ms-overflow-style: none; /* IE/Edge */
    gap: 8px;
    padding: 10px 0;
}

.news-category-tabs::-webkit-scrollbar,
.category-filter-tabs::-webkit-scrollbar,
[class*="news-tabs"]::-webkit-scrollbar,
[class*="category-tabs"]::-webkit-scrollbar {
    display: none; /* Chrome/Safari */
}

@media (max-width: 768px) {
    /* 탭 버튼 모바일 스타일 */
    .news-category-tabs button,
    .news-category-tabs a,
    .category-filter-tabs button,
    .category-filter-tabs a,
    [class*="news-tabs"] button,
    [class*="news-tabs"] a,
    [class*="category-tabs"] button,
    [class*="category-tabs"] a {
        flex-shrink: 0;
        padding: 8px 16px !important;
        font-size: 13px !important;
        white-space: nowrap;
        border-radius: 20px !important;
        border: 1px solid #e0e0e0 !important;
        background: #fff !important;
        color: #666 !important;
        transition: all 0.2s ease;
    }
    
    /* 활성 탭 */
    .news-category-tabs button.active,
    .news-category-tabs a.active,
    .category-filter-tabs button.active,
    .category-filter-tabs a.active,
    [class*="news-tabs"] button.active,
    [class*="news-tabs"] a.active,
    [class*="category-tabs"] button.active,
    [class*="category-tabs"] a.active,
    .news-category-tabs button[aria-selected="true"],
    .category-filter-tabs button[aria-selected="true"] {
        background: linear-gradient(135deg, #4a90d9 0%, #3a7bc8 100%) !important;
        color: #fff !important;
        border-color: transparent !important;
        box-shadow: 0 2px 8px rgba(74, 144, 217, 0.3);
    }
    
    /* 탭 컨테이너 */
    .news-tabs-container,
    .category-tabs-wrapper,
    [class*="tabs-container"],
    [class*="tabs-wrapper"] {
        margin: 0 -15px;
        padding: 0 15px;
    }
    
    /* 뉴스 리스트 아이템 모바일 */
    .news-list-item,
    .news-card,
    [class*="news-item"] {
        padding: 15px 0 !important;
        border-bottom: 1px solid #f0f0f0;
    }
    
    /* 뉴스 이미지 모바일 */
    .news-thumbnail,
    .news-image,
    [class*="news-thumb"] {
        border-radius: 8px !important;
        overflow: hidden;
    }
    
    /* 뉴스 제목 모바일 */
    .news-title,
    [class*="news-title"] {
        font-size: 15px !important;
        line-height: 1.4 !important;
        word-break: keep-all;
    }
    
    /* 뉴스 요약 모바일 */
    .news-excerpt,
    .news-summary,
    [class*="news-excerpt"],
    [class*="news-summary"] {
        font-size: 13px !important;
        line-height: 1.5 !important;
        color: #666 !important;
    }
}

/* 최신 뉴스 섹션 헤더 모바일 */
@media (max-width: 768px) {
    .latest-news-header,
    .news-section-header,
    [class*="section-header"] {
        padding: 15px 0 !important;
        margin-bottom: 10px !important;
    }
    
    .latest-news-header h2,
    .news-section-header h2,
    [class*="section-header"] h2 {
        font-size: 18px !important;
    }
    
    /* 그리드/리스트 전환 버튼 */
    .view-toggle,
    [class*="view-toggle"],
    [class*="grid-toggle"] {
        padding: 6px 10px !important;
    }
}
