/* 기본 & 폰트 설정 */
@import url('https://fonts.googleapis.com/css2?family=Noto+Sans+KR:wght@300;400;500;700&display=swap');

:root {
    --primary-color: #0C7531; /* 학교 상징색 */
    --primary-color-hover: #109a42; /* 마우스 오버 시 밝은 녹색 */
    --dark-bg: #1a1a1a;
    --content-bg: #242424;
    --border-color: #444;
    --text-primary: #e6e6e6;
    --text-secondary: #a0a0a0;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Noto Sans KR', sans-serif;
    background-color: var(--dark-bg);
    color: var(--text-primary);
}
a {
    text-decoration: none;
    color: var(--text-primary);
}
/* 헤더 */
header {
    background-color: var(--content-bg);
    border-bottom: 1px solid var(--border-color);
    padding: 0 5%;
    position: sticky;
    top: 0;
    z-index: 1000;
}

code {
    line-height: 1.4;
    background-color: #333;
    color: #fff;
    padding: 5px 10px;
    border-radius: 5px;
    font-family: 'Courier New', Courier, monospace;
    font-size: 0.9rem;
    margin: 0 5px;
    display: inline-block;
    max-width: 100%;
    overflow-x: auto;
    white-space: pre;
    vertical-align: middle;
}

.header-container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    height: 60px;
}

.logo {
    font-size: 1.4rem;
    font-weight: 700;
    color: var(--primary-color);
    text-decoration: none;
}

.logo img {
    height: 40px;
    vertical-align: middle;
}

nav ul {
    list-style: none;
    display: flex;
    gap: 30px;
}

nav a {
    text-decoration: none;
    color: var(--text-secondary);
    font-weight: 500;
    padding: 18px 0;
    transition: color 0.3s ease, border-bottom 0.3s ease;
}

nav a:hover, nav a.active {
    color: var(--text-primary);
    border-bottom: 3px solid var(--primary-color);
}

.header-right {
    display: flex;
    align-items: center;
    gap: 20px;
    font-size: 1.2rem;
    color: var(--text-secondary);
}

.header-right i {
    cursor: pointer;
    transition: color 0.3s ease;
}

.header-right i:hover {
    color: var(--text-primary);
}


/* 메인 레이아웃 */
.container {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 30px;
    max-width: 1200px;
    margin: 30px auto;
    padding: 0 20px;
}

.section-title {
    font-size: 1.5rem;
    margin-bottom: 20px;
    padding-bottom: 10px;
    border-bottom: 2px solid var(--border-color);
}

/* 태그 공통 스타일 */
.tag {
    display: inline-block;
    padding: 4px 10px;
    border-radius: 15px;
    font-size: 0.8rem;
    font-weight: 700;
    color: #fff;
}

.tag.pick {
    background-color: var(--primary-color);
    position: absolute;
    top: 15px;
    left: 15px;
}

.tag.category {
    background-color: var(--primary-color-hover);
    margin-bottom: 10px;
}

/* 대표 뉴스 */
.featured-news {
    position: relative;
    border-radius: 8px;
    overflow: hidden;
    cursor: pointer;
    background-color: var(--content-bg);
}

.featured-image img {
    width: 100%;
    height: 400px;
    object-fit: cover;
    display: block;
    transition: transform 0.4s ease;
}

.featured-news:hover .featured-image img {
    transform: scale(1.05);
}

.featured-text {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    padding: 20px;
    background: linear-gradient(to top, rgba(0,0,0,0.9), transparent);
}

.featured-text h2 {
    font-size: 1.8rem;
    margin-bottom: 10px;
    color: #fff;
}

.featured-text span {
    font-size: 0.9rem;
    color: var(--text-secondary);
}


/* 서브 뉴스 */
.sub-featured {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
    margin-top: 20px;
}

.news-item-small {
    background-color: var(--content-bg);
    border-radius: 8px;
    overflow: hidden;
    transition: transform 0.3s ease;
}

.news-item-small:hover {
    transform: translateY(-5px);
}

.news-item-small img {
    width: 100%;
    height: 150px;
    object-fit: cover;
}

.news-item-small-text {
    padding: 15px;
}

.news-item-small-text h3 {
    font-size: 1.1rem;
    margin-bottom: 8px;
}

/* 카드 뉴스 */
.card-news {
    margin-top: 30px;
}

.card-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: 20px;
}

.news-card {
    background-color: var(--content-bg);
    border-radius: 8px;
    overflow: hidden;
    transition: transform 0.3s ease;
    cursor: pointer;
}

.news-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 20px rgba(0,0,0,0.2);
}

.news-card img {
    width: 100%;
    height: 150px;
    object-fit: cover;
}

.card-content {
    padding: 15px;
}

.card-content h4 {
    font-size: 1rem;
    margin-bottom: 10px;
}

.timestamp {
    font-size: 0.8rem;
    color: var(--text-secondary);
}

/* 사이드바 - 인기 뉴스 */
.sidebar .ranking-news {
    background-color: var(--content-bg);
    padding: 20px;
    border-radius: 8px;
    position: sticky;
    top: 90px; /* 헤더 높이 + 여백 */
}

.ranking-news ol {
    list-style: none;
    counter-reset: ranking-counter;
}

.ranking-news li {
    counter-increment: ranking-counter;
    margin-bottom: 15px;
    padding-bottom: 15px;
    border-bottom: 1px solid var(--border-color);
}

.ranking-news li:last-child {
    border-bottom: none;
    margin-bottom: 0;
    padding-bottom: 0;
}

.ranking-news a {
    display: flex;
    align-items: center;
    gap: 15px;
    text-decoration: none;
    color: var(--text-primary);
}

.ranking-news a::before {
    content: counter(ranking-counter);
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--primary-color);
    min-width: 25px;
    text-align: center;
}

.rank-content {
    flex-grow: 1;
}

.rank-content h3 {
    font-size: 1rem;
    font-weight: 500;
    margin-bottom: 5px;
    transition: color 0.3s ease;
}

.rank-content span {
    font-size: 0.8rem;
    color: var(--text-secondary);
}

.ranking-news a:hover h3 {
    color: var(--primary-color-hover);
}

.ranking-news img {
    width: 60px;
    height: 60px;
    object-fit: cover;
    border-radius: 5px;
}

/* 푸터 */
.footer {
    text-align: center;
    padding: 30px;
    margin-top: 40px;
    background-color: var(--content-bg);
    color: var(--text-secondary);
    font-size: 0.9rem;
}
.footer p {
    margin-bottom: 5px;
}

/* 반응형 디자인 */
@media (max-width: 992px) {
    .container {
        grid-template-columns: 1fr;
    }
    .sidebar .ranking-news {
        position: static;
        margin-top: 30px;
    }
    nav ul {
        gap: 20px;
    }
}

@media (max-width: 768px) {
    nav {
        display: none; /* 모바일에서는 메뉴를 숨기고 햄버거 버튼으로 대체 가능 */
    }
    .featured-text h2 {
        font-size: 1.5rem;
    }
    .sub-featured {
        grid-template-columns: 1fr;
    }
    .card-grid {
        grid-template-columns: 1fr 1fr;
    }
}

@media (max-width: 480px) {
    .card-grid {
        grid-template-columns: 1fr;
    }
}



/* --- 기사 상세 페이지 스타일 (style.css에 추가) --- */

/* 기사 콘텐츠 영역 */
.article-content {
    background-color: var(--content-bg);
    padding: 30px;
    border-radius: 8px;
}

/* 경로(Breadcrumbs) */
.breadcrumbs {
    margin-bottom: 20px;
    font-size: 0.9rem;
    color: var(--text-secondary);
}
.breadcrumbs a {
    color: var(--text-secondary);
    text-decoration: none;
    transition: color 0.3s;
}
.breadcrumbs a:hover {
    color: var(--primary-color);
}


/* 기사 헤더 */
.article-header h1 {
    font-size: 2.5rem;
    font-weight: 700;
    line-height: 1.3;
    margin-bottom: 15px;
}
.article-meta {
    font-size: 0.9rem;
    color: var(--text-secondary);
    padding-bottom: 20px;
    border-bottom: 1px solid var(--border-color);
    margin-bottom: 20px;
}

/* 기사 대표 이미지 */
.article-content img {
    width: 100%;
    border-radius: 8px;
    margin-bottom: 10px;
}
.image-caption {
    font-size: 0.9rem;
    color: var(--text-secondary);
    text-align: center;
    margin-bottom: 30px;
}

/* 기사 본문 (가독성 최적화) */
.article-body {
    max-width: 720px; /* 너무 길지 않게 최대 너비 설정 */
    margin: 0 auto; /* 중앙 정렬 */
}

.article-body p {
    font-size: 1.1rem;
    line-height: 1.8;
    margin-bottom: 1.5em;
    color: var(--text-primary);
}

.article-body h2 {
    font-size: 1.8rem;
    margin-top: 2.5em;
    margin-bottom: 1em;
    padding-bottom: 0.3em;
    border-bottom: 2px solid var(--border-color);
}

.article-body blockquote {
    margin: 2em 0;
    padding: 1.5em;
    border-left: 4px solid var(--primary-color);
    background-color: var(--dark-bg);
    font-style: italic;
    font-size: 1.1rem;
    color: var(--text-secondary);
}

.article-body ul {
    list-style: disc;
    padding-left: 20px;
    margin-bottom: 1.5em;
}

/* 기사 하단 (태그 & 공유) */
.article-footer {
    margin-top: 40px;
    padding-top: 20px;
    border-top: 1px solid var(--border-color);
    max-width: 720px;
    margin-left: auto;
    margin-right: auto;
}
.article-tags .tag {
    background-color: #444; /* 태그 색상 변경 */
}
.share-buttons {
    display: flex;
    align-items: center;
    gap: 10px;
}
.share-button {
    display: inline-flex;
    justify-content: center;
    align-items: center;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    color: #fff;
    text-decoration: none;
    transition: transform 0.3s;
}
.share-button:hover {
    transform: scale(1.1);
}
.share-button.facebook { background-color: #1877F2; }
.share-button.twitter { background-color: #1DA1F2; }
.share-button.link { background-color: #6c757d; }


/* 관련 기사 섹션 */
.related-articles {
    margin-top: 50px;
}

/* 반응형 조정 */
@media (max-width: 768px) {
    .article-header h1 {
        font-size: 2rem;
    }
    .article-footer {
        flex-direction: column;
        align-items: flex-start;
        gap: 20px;
    }
}

/* --- 검색 결과 페이지 스타일 (style.css에 추가) --- */

.search-main-content {
    background-color: var(--content-bg);
    padding: 30px;
    border-radius: 8px;
}

/* 검색 헤더 */
.search-header {
    padding-bottom: 20px;
    margin-bottom: 20px;
    border-bottom: 2px solid var(--border-color);
}
.search-header h1 {
    font-size: 1.8rem;
}
.highlight-query {
    color: var(--primary-color-hover);
}
.result-count {
    font-size: 1.2rem;
    color: var(--text-secondary);
    font-weight: 400;
}

/* 검색 결과 리스트 */
.search-result-item {
    display: flex;
    gap: 20px;
    padding: 20px 0;
    border-bottom: 1px solid var(--border-color);
    text-decoration: none;
    color: inherit;
    transition: background-color 0.3s;
}
.search-result-item:hover {
    background-color: var(--dark-bg);
}
.search-result-item:last-child {
    border-bottom: none;
}
.result-item-thumbnail {
    width: 150px;
    height: 100px;
    object-fit: cover;
    border-radius: 5px;
    flex-shrink: 0;
}
.result-item-content h3 {
    font-size: 1.2rem;
    margin-top: 5px;
    margin-bottom: 8px;
}
.result-item-content p {
    font-size: 0.95rem;
    color: var(--text-secondary);
    line-height: 1.6;
    margin-bottom: 10px;
}
.highlight {
    color: var(--primary-color);
    font-weight: 700;
}
.result-item-meta {
    font-size: 0.8rem;
    color: #888;
}

/* 결과 없음 */
.no-results {
    text-align: center;
    padding: 80px 20px;
    color: var(--text-secondary);
}
.no-results i {
    font-size: 4rem;
    margin-bottom: 20px;
    opacity: 0.5;
}
.no-results p {
    font-size: 1.5rem;
    font-weight: 500;
    color: var(--text-primary);
    margin-bottom: 10px;
}
.no-results span {
    font-size: 1rem;
}

/* 페이지네이션 */
.pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 8px;
    margin-top: 40px;
}
.page-number, .page-arrow {
    display: inline-block;
    padding: 8px 14px;
    border: 1px solid var(--border-color);
    border-radius: 5px;
    text-decoration: none;
    color: var(--text-secondary);
    transition: background-color 0.3s, color 0.3s;
}
.page-number:hover, .page-arrow:hover {
    background-color: var(--border-color);
    color: var(--text-primary);
}
.page-number.active {
    background-color: var(--primary-color);
    border-color: var(--primary-color);
    color: #fff;
    font-weight: 700;
}
.page-arrow.disabled {
    color: #555;
    cursor: not-allowed;
}
.page-arrow.disabled:hover {
    background-color: transparent;
}









/* --- 글 작성 에디터 페이지 스타일 (style.css에 추가) --- */
:root {
    --editor-bg: #1E1E1E;
    --preview-bg: #121212;
    --footer-bg: #252525;
    --text-primary: #e6e6e6;
    --text-secondary: #a0a0a0;
    --border-color: #333;
    --primary-color: #0C7531; /* 기존 학교 상징색 */
}

.editor-body {
    background-color: var(--editor-bg);
    margin: 0;
    padding: 0;
    overflow: hidden; /* 스크롤바는 각 Pane에서 처리 */
}

#editor-form {
    display: flex;
    flex-direction: column;
    height: 100vh;
}

.editor-main {
    flex-grow: 1;
    display: grid;
    grid-template-columns: 1fr 1fr;
    overflow: hidden;
}

.editor-pane, .preview-pane {
    height: 100%;
    padding: 2rem 3rem;
    overflow-y: auto;
}

.editor-pane {
    background-color: var(--editor-bg);
}

.preview-pane {
    background-color: var(--preview-bg);
    border-left: 1px solid var(--border-color);
}

#title-input {
    width: 100%;
    background: none;
    border: none;
    color: var(--text-primary);
    font-size: 2.5rem;
    font-weight: 700;
    padding: 1rem 0;
    margin-bottom: 1rem;
    border-bottom: 2px solid var(--border-color);
}
#title-input:focus {
    outline: none;
    border-bottom-color: var(--primary-color);
}

#editor {
    width: 100%;
    height: calc(100% - 100px); /* 제목 입력창 높이 제외 */
    background: none;
    border: none;
    resize: none;
    color: var(--text-primary);
    font-size: 1rem;
    line-height: 1.7;
    font-family: 'Menlo', 'Monaco', 'Consolas', 'Courier New', monospace;
}
#editor:focus {
    outline: none;
}

/* 미리보기 창 스타일 */
.preview-pane h1, .preview-pane h2, .preview-pane h3 {
    border-bottom: 1px solid var(--border-color);
    padding-bottom: 0.5em;
}
.preview-pane p {
    line-height: 1.8;
    margin: 1em 0;
}
.preview-pane img {
    max-width: 100%;
    border-radius: 4px;
}
.preview-pane blockquote {
    border-left: 4px solid var(--primary-color);
    padding-left: 1em;
    margin-left: 0;
    color: var(--text-secondary);
}
.preview-pane code {
    background-color: #2b2b2b;
    padding: 0.2em 0.4em;
    border-radius: 3px;
}
.preview-pane pre > code {
    display: block;
    padding: 1em;
}

/* 푸터 스타일 */
.editor-footer {
    height: 60px;
    background-color: var(--footer-bg);
    border-top: 1px solid var(--border-color);
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0 2rem;
    flex-shrink: 0;
}
.exit-button {
    color: var(--text-secondary);
    text-decoration: none;
    font-weight: bold;
}
.actions button {
    padding: 0.6rem 1.2rem;
    border: none;
    border-radius: 4px;
    font-weight: bold;
    cursor: pointer;
    margin-left: 1rem;
}
.draft-button {
    background-color: #444;
    color: var(--text-primary);
}
.publish-button {
    background-color: var(--primary-color);
    color: white;
}

.class-img-representation {
    font-size: 13px;
    color: white;
    border: 1px solid #c2c2c2;
    padding: 3px;
    border-radius: 7px;
    width: 100%;
    max-width: 170px;
}


.input-title {
    padding: 10px;
    border-radius: 5px;
    margin-bottom: 10px;
    margin-right: 10px;
    border: 2px solid var(--border-color);
    background-color: var(--editor-bg);
    color: var(--text-primary);
    font-size: 12px;
    transition: border-color 0.2s, background-color 0.2s;
}
.input-title:focus {
    outline: none;
    border-color: var(--primary-color);
    background-color: #232323;
}
::placeholder {
    color: var(--text-secondary);
    opacity: 1;
}




/* --- 전체 기사 페이지 스타일 (style.css에 추가) --- */
.full-width-content {
    grid-column: 1 / -1; /* 컨테이너의 전체 너비 사용 */
}

.page-title {
    font-size: 2.5rem;
    margin-bottom: 30px;
    padding-bottom: 15px;
    border-bottom: 2px solid var(--border-color);
}

/* 카드 그리드 스타일 재사용 (홈페이지와 동일) */
.card-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 25px;
}

/* 로더 컨테이너 */
.loader-container {
    text-align: center;
    padding: 40px 0;
    color: var(--text-secondary);
    display: none; /* 기본적으로 숨김 */
}

/* 로딩 스피너 애니메이션 */
.spinner {
    width: 40px;
    height: 40px;
    border: 4px solid var(--border-color);
    border-top-color: var(--primary-color);
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin: 0 auto 15px;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

