/* =========================================================
   PPABAM NEWS - page specific styles
   Inline CSS separated from index.php
   2026-09-29
   ========================================================= */

/* =========================================================
   PPABAM STOCK MOBILE 2-COLUMN HARD FIX
   - 768px 이하에서 주요 종목 항상 2열
   - 400 / 390 / 360px에서도 1열로 내려가지 않음
========================================================= */
@media (max-width:768px){

    #stockDetailTable .stock-list,
    .stock-detail-box .stock-list,
    .stock-list{
        display:grid !important;
        grid-template-columns:repeat(2,minmax(0,1fr)) !important;
        gap:8px !important;
        width:100% !important;
        max-width:100% !important;
    }

    #stockDetailTable .stock-item,
    .stock-detail-box .stock-item,
    .stock-list .stock-item{
        min-width:0 !important;
        width:auto !important;
        max-width:100% !important;
        padding:11px !important;
        box-sizing:border-box !important;
    }

    .stock-list .stock-name{
        min-width:0 !important;
        font-size:12px !important;
        white-space:nowrap !important;
        overflow:hidden !important;
        text-overflow:ellipsis !important;
    }

    .stock-list .stock-code{
        font-size:10px !important;
        white-space:nowrap !important;
        overflow:hidden !important;
        text-overflow:ellipsis !important;
    }

    .stock-list .stock-price{
        min-width:0 !important;
        font-size:17px !important;
        white-space:nowrap !important;
        overflow:hidden !important;
        text-overflow:ellipsis !important;
    }

    .stock-list .stock-rate{
        font-size:11px !important;
        white-space:nowrap !important;
    }

    .stock-list .stock-info{
        min-width:0 !important;
        gap:4px !important;
        font-size:9px !important;
    }

    .stock-list .stock-info strong{
        min-width:0 !important;
        font-size:10px !important;
        white-space:nowrap !important;
        overflow:hidden !important;
        text-overflow:ellipsis !important;
    }
}

/* 초소형 모바일도 2열 유지 */
@media (max-width:430px){
    #stockDetailTable .stock-list,
    .stock-detail-box .stock-list,
    .stock-list{
        grid-template-columns:repeat(2,minmax(0,1fr)) !important;
        gap:7px !important;
    }

    #stockDetailTable .stock-item,
    .stock-detail-box .stock-item,
    .stock-list .stock-item{
        padding:9px !important;
    }

    .stock-list .stock-price{
        font-size:16px !important;
    }
}

/* =========================================================
   PPABAM EXCHANGE NEWS
   환율 그래프 아래 뉴스
========================================================= */
.exchange-news-box{
    margin-top:12px !important;
    margin-bottom:15px !important;
    padding:16px !important;
    border:1px solid #e5e7eb !important;
    border-radius:12px !important;
    background:#ffffff !important;
    box-shadow:none !important;
}

.exchange-news-box .stock-news-head{
    margin-bottom:12px !important;
    color:#101828;
    font-size:15px;
}

.exchange-news-box .stock-news-list{
    display:grid;
    grid-template-columns:repeat(2,minmax(0,1fr));
    gap:10px;
}

.exchange-news-box .stock-news-item{
    min-width:0;
    padding:12px !important;
    border:1px solid #e5e7eb !important;
    border-radius:12px !important;
    background:#ffffff !important;
    color:#101828 !important;
    text-decoration:none !important;
    box-shadow:none !important;
}

.exchange-news-box .stock-news-item:hover{
    background:#f8fafc !important;
    border-color:#d7dce5 !important;
    transform:none !important;
}

.exchange-news-box .stock-news-subject{
    color:#101828 !important;
    font-size:13px !important;
    font-weight:600 !important;
    line-height:1.5 !important;
}

.exchange-news-box .stock-news-meta{
    margin-top:7px !important;
    color:#98a2b3 !important;
    font-size:10px !important;
}

.exchange-news-box .stock-news-loading,
.exchange-news-box .stock-news-empty{
    grid-column:1 / -1;
    padding:18px 10px;
    color:#667085;
    font-size:12px;
    text-align:center;
}

/* 다크모드 */
body.dark-mode section.content .exchange-news-box,
section.content.dark .exchange-news-box{
    background:#171624 !important;
    border-color:#2a2a37 !important;
}

body.dark-mode section.content .exchange-news-box .stock-news-head,
section.content.dark .exchange-news-box .stock-news-head{
    color:#f5f4fa !important;
}

body.dark-mode section.content .exchange-news-box .stock-news-item,
section.content.dark .exchange-news-box .stock-news-item{
    background:#0e0f10 !important;
    border-color:#2a2a37 !important;
    color:#f5f4fa !important;
}

body.dark-mode section.content .exchange-news-box .stock-news-item:hover,
section.content.dark .exchange-news-box .stock-news-item:hover{
    background:#14151a !important;
    border-color:#3a3554 !important;
}

body.dark-mode section.content .exchange-news-box .stock-news-subject,
section.content.dark .exchange-news-box .stock-news-subject{
    color:#f5f4fa !important;
}

body.dark-mode section.content .exchange-news-box .stock-news-meta,
body.dark-mode section.content .exchange-news-box .stock-news-loading,
body.dark-mode section.content .exchange-news-box .stock-news-empty,
section.content.dark .exchange-news-box .stock-news-meta,
section.content.dark .exchange-news-box .stock-news-loading,
section.content.dark .exchange-news-box .stock-news-empty{
    color:#8f8da8 !important;
}

@media(max-width:768px){
    .exchange-news-box{
        padding:12px !important;
    }

    .exchange-news-box .stock-news-list{
        grid-template-columns:1fr !important;
        gap:8px !important;
    }
}

/* =========================================================
   PPABAM MARKET INDEX NEWS
   코스피/코스닥/다우 등 그래프 아래 뉴스
   환율 뉴스 박스와 동일 디자인
========================================================= */
.market-index-news-box{
    margin-top:12px !important;
    margin-bottom:15px !important;
    padding:16px !important;
    border:1px solid #e5e7eb !important;
    border-radius:12px !important;
    background:#ffffff !important;
    box-shadow:none !important;
}

.market-index-news-box .stock-news-head{
    margin-bottom:12px !important;
    color:#101828;
    font-size:15px;
}

.market-index-news-box .stock-news-list{
    display:grid;
    grid-template-columns:repeat(2,minmax(0,1fr));
    gap:10px;
}

.market-index-news-box .stock-news-item{
    min-width:0;
    padding:12px !important;
    border:1px solid #e5e7eb !important;
    border-radius:12px !important;
    background:#ffffff !important;
    color:#101828 !important;
    text-decoration:none !important;
    box-shadow:none !important;
}

.market-index-news-box .stock-news-item:hover{
    background:#f8fafc !important;
    border-color:#d7dce5 !important;
    transform:none !important;
}

.market-index-news-box .stock-news-subject{
    color:#101828 !important;
    font-size:13px !important;
    font-weight:600 !important;
    line-height:1.5 !important;
}

.market-index-news-box .stock-news-meta{
    margin-top:7px !important;
    color:#98a2b3 !important;
    font-size:10px !important;
}

.market-index-news-box .stock-news-loading,
.market-index-news-box .stock-news-empty{
    grid-column:1 / -1;
    padding:18px 10px;
    color:#667085;
    font-size:12px;
    text-align:center;
}

/* DARK MODE */
body.dark-mode section.content .market-index-news-box,
section.content.dark .market-index-news-box{
    background:#171624 !important;
    border-color:#2a2a37 !important;
}

body.dark-mode section.content .market-index-news-box .stock-news-head,
section.content.dark .market-index-news-box .stock-news-head{
    color:#f5f4fa !important;
}

body.dark-mode section.content .market-index-news-box .stock-news-item,
section.content.dark .market-index-news-box .stock-news-item{
    background:#0e0f10 !important;
    border-color:#2a2a37 !important;
    color:#f5f4fa !important;
}

body.dark-mode section.content .market-index-news-box .stock-news-item:hover,
section.content.dark .market-index-news-box .stock-news-item:hover{
    background:#14151a !important;
    border-color:#3a3554 !important;
}

body.dark-mode section.content .market-index-news-box .stock-news-subject,
section.content.dark .market-index-news-box .stock-news-subject{
    color:#f5f4fa !important;
}

body.dark-mode section.content .market-index-news-box .stock-news-meta,
body.dark-mode section.content .market-index-news-box .stock-news-loading,
body.dark-mode section.content .market-index-news-box .stock-news-empty,
section.content.dark .market-index-news-box .stock-news-meta,
section.content.dark .market-index-news-box .stock-news-loading,
section.content.dark .market-index-news-box .stock-news-empty{
    color:#8f8da8 !important;
}

/* 모바일 */
@media(max-width:768px){
    .market-index-news-box{
        padding:12px !important;
    }

    .market-index-news-box .stock-news-list{
        grid-template-columns:1fr !important;
        gap:8px !important;
    }
}

.stock-news-box{
    margin-top:16px;
    padding:16px;
    border-radius:16px;
    background:#fff;
    border:1px solid #eee;
}

.stock-news-head{
    margin-bottom:12px;
    font-size:16px;
}

.stock-news-tags{
    display:flex;
    flex-wrap:wrap;
    gap:8px;
    margin-bottom:14px;
}

.stock-news-tag{
    border:0;
    padding:7px 12px;
    border-radius:20px;
    background:#f1f3f5;
    font-size:13px;
    cursor:pointer;
}

.stock-news-tag.active{
    background:#111;
    color:#fff;
}

.stock-news-list{
    display:grid;
    grid-template-columns:repeat(2, 1fr);
    gap:12px;
}

.stock-news-item{
    display:block;
    padding:12px;
    border:1px solid #eee;
    border-radius:10px;
    background:#fff;
    text-decoration:none;
    color:#222;
    transition:.15s;
}

.stock-news-item:hover{
    border-color:#ddd;
    transform:translateY(-1px);
}

.stock-news-subject{
    font-size:14px;
    font-weight:600;
    line-height:1.5;

    overflow:hidden;

    display:-webkit-box;
    -webkit-line-clamp:2;
    -webkit-box-orient:vertical;
}

.stock-news-meta{
    margin-top:8px;
    font-size:12px;
    color:#888;
}

@media (max-width:768px){

    .stock-news-list{
        grid-template-columns:1fr;
    }

}




/* 다크모드 */
body.dark-mode section.content .stock-news-box{
    background:#1e1e1e;
    border-color:#333;
}

body.dark-mode section.content  .stock-news-head{
    color:#f1f1f1;
}

body.dark-mode section.content  .stock-news-tag{
    background:#2a2a2a;
    color:#ddd;
}

body.dark-mode section.content  .stock-news-tag.active{
    background:#6c5ce7;
    color:#fff;
}

body.dark-mode section.content  .stock-news-item{
    background:#252525;
    border-color:#333;
    color:#f1f1f1;
}

body.dark-mode section.content  .stock-news-item:hover{
    border-color:#555;
}

body.dark-mode section.content  .stock-news-subject{
    color:#f1f1f1;
}

body.dark-mode section.content  .stock-news-meta{
    color:#999;
}

body.dark-mode section.content  .stock-news-loading,
body.dark-mode section.content .stock-news-empty{
    color:#999;
}

body.dark-mode section.content  .stock-news-tag.active{
    background:#6c5ce7;
    color:#fff;
    box-shadow:0 0 10px rgba(108,92,231,.3);
}

/* PPABAM RELATED NEWS FONT SYNC */
#exchangeNewsBox,
#marketNewsBox,
#exchangeNewsBox *,
#marketNewsBox *{
    font-family:'Noto Sans KR', sans-serif !important;
}
