/*--- Modern Color Scheme ---*/
:root {
    --primary-color: #007bff; /* 주 색상 (파란색) */
    --primary-darker: #0056b3; /* 주 색상 (더 어둡게) */
    --light-bg: #f8f9fa;      /* 밝은 배경색 */
    --border-color: #dee2e6;  /* 테두리 색상 */
    --text-color: #212529;    /* 기본 텍스트 색상 */
    --text-secondary: #6c757d;/* 보조 텍스트 색상 */
}

/*--- Basic Setup ---*/
body {
    font-family: 'Nanum Gothic', 'Malgun Gothic', sans-serif;
    font-size: 14px;
    background-color: #f4f4f9; /* 외부 배경색 */
    color: var(--text-color);
    margin: 0;
    line-height: 1.6;
}

a { text-decoration: none; color: var(--text-color); }
a:hover { text-decoration: underline; color: var(--primary-color); }
ul, li { list-style: none; padding: 0; margin: 0; }

/*--- Layout ---*/
.top-wrap, .contents-wrap, .bottom-wrap {
    width: 960px;
    margin: 0 auto;
    background-color: #fff;
    box-sizing: border-box;
}

.top-wrap { 
    position: relative;
    padding: 10px 20px;
}

.contents-wrap {
    display: flex;
    padding: 20px;
    border-top: 2px solid var(--primary-color);
}

.contents { 
    width: 690px; 
}
.sidebar { 
    width: 250px; 
    margin-left: 20px;
}

.bottom-wrap {
    clear: both;
    padding: 20px;
    font-size: 0.85em;
}

/*--- Header ---*/
.top-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 10px; }
.logo img { border: 0; }

.top-util {
    position: absolute;
    top: -5px;
    right: 20px;
}
.top-util ul { display: flex; }
.top-util li { margin-left: 1px; font-size: 12px; color: var(--text-secondary); }
.top-util a { color: var(--text-secondary); }
.top-util .visit-num { font-weight: bold; color: var(--primary-color); }

/*--- Navigation ---*/
.main-menu > ul {
    display: flex;
    border-top: 1px solid var(--border-color);
    border-bottom: 1px solid var(--border-color);
    margin-top: 30px;
}
.main-menu a { display: block; padding: 10px 15px; font-weight: bold; color: var(--text-color); }
.main-menu a:hover { background-color: var(--light-bg); text-decoration: none; color: var(--primary-color); }

.has-submenu { position: relative; }
.submenu {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    background-color: #fff;
    min-width: 160px;
    box-shadow: 0 8px 16px rgba(0,0,0,0.1);
    z-index: 100;
    border: 1px solid var(--border-color);
}
.has-submenu:hover .submenu { display: block; }
.submenu a { font-weight: normal; }

/*--- Main Contents ---*/
.page-intro {
    background-color: var(--light-bg);
    border: 1px solid var(--border-color);
    border-bottom: 2px solid var(--primary-color);
    padding: 15px;
    margin-bottom: 20px;
    border-radius: 4px;
}
.page-intro h1 { font-size: 1.5em; margin: 0 0 5px; color: var(--primary-color); }
.page-intro p { font-size: 0.9em; }

.rank-list .rank-item {
    display: flex;
    position: relative;
    align-items: center;
    border: 1px solid var(--border-color);
    border-top: none;
    padding: 15px;
    cursor: pointer;
    transition: background-color 0.2s;
    min-height: 120px;
}
.rank-list .rank-item:first-child { border-top: 1px solid var(--border-color); }
.rank-list .rank-item:hover { background-color: #e7f3ff; }

.rank-item-logo { width: 160px; margin-right: 15px; flex-shrink: 0; }
.rank-item-logo img { max-width: 100%; border: 1px solid var(--border-color); }

.rank-item-info { flex-grow: 1; }
.rank-item-info h2 { font-size: 1.2em; margin: 0 0 10px; font-weight: bold; }
.rank-item-info h2 img { vertical-align: middle; margin-right: 5px; }
.rank-item-info ul { margin: 0; padding: 0; }
.rank-item-info li { padding-left: 15px; background: url('/iconimg/jng_icon.gif') no-repeat 0 7px; font-size: 0.9em; margin-bottom: 3px; }

.cta-button {
    position: absolute;
    right: 15px;
    bottom: 25px;
    background-color: var(--primary-color);
    color: #fff !important;
    padding: 6px 15px;
    border-radius: 4px;
    font-weight: bold;
    text-decoration: none !important;
    transition: background-color 0.2s;
}
.cta-button:hover { background-color: var(--primary-darker); color: #fff !important; }

.board-latest { display: flex; justify-content: space-between; margin: 20px 0; }
.latest-item { width: 49%; }

.collapsible .collapsible-trigger { cursor: pointer; padding: 10px 15px; background-color: #fff; border: 1px solid var(--border-color); margin-top: 10px; font-size: 1.1em; font-weight: bold; transition: background-color 0.2s; position: relative; border-radius: 4px; }
.collapsible .collapsible-trigger:hover { background-color: var(--light-bg); }
.collapsible .collapsible-trigger.active { background-color: var(--light-bg); }
.collapsible .collapsible-trigger::after { content: '▼'; position: absolute; right: 15px; font-size: 0.8em; }
.collapsible .collapsible-trigger.active::after { content: '▲'; }

.collapsible-content { padding: 15px; border: 1px solid var(--border-color); border-top: none; display: none; }
.collapsible-content h4 { font-size: 1.1em; color: var(--primary-color); margin-top: 10px;}
.author-profile { display: flex; align-items: center; gap: 20px; background: var(--light-bg); padding: 15px; border: 1px solid var(--border-color); margin-top: 10px; border-radius: 4px; }
.author-profile img { width: 100px; height: 100px; border-radius: 5px;}

/*--- Sidebar ---*/
.sidebar-widget { margin-bottom: 25px; }
.sidebar-widget h3 { background-color: var(--primary-color); color: #fff; font-weight: bold; padding: 8px 10px; font-size: 1em; margin: 0; border-radius: 4px 4px 0 0; }
.sidebar-widget h3 a { color: #fff; text-decoration: none; }
.sidebar-widget .social-links, .sidebar-widget ul { border: 1px solid var(--border-color); padding: 10px; border-top: none; }
.sidebar-widget li { border-bottom: 1px dotted var(--border-color); padding: 5px 0; }
.sidebar-widget li:last-child { border-bottom: none; }
.social-links img { width: 30px; height: 30px; margin: 2px;}
.sidebar-rank a { display: block; }
.sidebar-rank img { vertical-align: middle; margin-right: 5px; }

/*--- Footer ---*/
.footer-links { background-color: var(--light-bg); border: 1px solid var(--border-color); padding: 15px; border-radius: 5px; margin-bottom: 20px; text-align: center; }
.footer-links a { color: var(--primary-darker); margin: 0 10px; font-weight: bold; }
.footer-links a:hover { color: var(--primary-color); }

.footer-info { text-align: center; color: var(--text-secondary); line-height: 1.8; }
.footer-info a { color: var(--text-secondary); }

/*--- Gnuboard Latest Skin Basic ---*/
.latest_wr .li_date { color: #888; font-size: 0.85em; }
.lt_title { font-weight: normal !important; }

/*--- Gnuboard Latest Skin Pic_block ---*/
.pic_lt { padding: 10px; border: 1px solid var(--border-color); }
.pic_lt ul { list-style: none; padding: 0; margin: 0 -5px; zoom: 1; }
.pic_lt ul:after { display: block; visibility: hidden; clear: both; content: ""; }
.pic_lt li { float: left; width: 50%; padding: 0 5px; margin-bottom: 10px; box-sizing: border-box; }
.pic_lt .lt_img { display: block; margin-bottom: 5px; }
.pic_lt .lt_img img { max-width: 100%; height: auto; }
.pic_lt .lt_tit { display: block; text-align: center; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 0.9em; }

/*--- Responsive ---*/
@media screen and (max-width: 980px) { .top-wrap, .contents-wrap, .bottom-wrap { width: 100%; } .contents-wrap { flex-direction: column; } .contents, .sidebar { width: 100%; padding: 15px; box-sizing: border-box; margin-left: 0; } }
@media screen and (max-width: 600px) { .top-header { flex-direction: column; align-items: center; gap: 10px; } .top-util { position: static; } .main-menu ul { flex-wrap: wrap; justify-content: center; } .rank-item { flex-direction: column; align-items: center; text-align: center; } .rank-item-info { padding-right: 0; margin-top: 10px; } .cta-button { position: static; transform: none; margin-top: 15px; display: inline-block; } .board-latest { flex-direction: column; gap: 15px; } .latest-item { width: 100%; } .author-profile { flex-direction: column; } }

/* 수정된 모바일 스타일 (500px 이하) */
@media screen and (max-width: 500px) {
    .top-wrap {
        padding: 10px; /* 상단 좌우 여백 축소 */
    }
    .top-header {
        flex-direction: column-reverse; /* util을 위로, logo를 아래로 */
        align-items: flex-start; /* 로고를 왼쪽 정렬 */
        gap: 15px;
    }
    .top-util {
        width: 100%; /* 전체 너비를 차지하도록 */
    }
    .top-util ul {
        justify-content: center; /* 내부 항목들 중앙 정렬 */
        flex-wrap: wrap; /* 화면이 작을 경우 줄바꿈 허용 */
        gap: 0 10px;
    }
    .logo img {
        max-width: 180px; /* 로고 이미지 크기 추가 축소 */
    }
    .main-menu a {
        font-size: 9px; /* 메뉴 텍스트 크기 축소 */
        padding: 10px 5px; /* 메뉴 좌우 여백 축소 */
    }
    .main-menu > ul {
        justify-content: center; /* 메뉴가 한 줄에 꽉 차지 않을 경우 중앙 정렬 */
    }
    .page-intro h1 {
        font-size: 1.1rem; /* 타이틀 텍스트 대폭 축소 */
        word-break: keep-all; /* 타이틀 줄바꿈 개선 */
    }
}
