/* ==========================================================
 * ad.seongam.net — 성암 소식 & 수상 실적 전용 스타일 (news.css)
 * ========================================================== */

:root {
    --sn-primary: #047857;
    --sn-primary-hover: #065f46;
    --sn-primary-light: #ecfdf5;
    --sn-border: #e2e8f0;
    --sn-text-main: #0f172a;
    --sn-text-muted: #64748b;
    --sn-card-shadow: 0 4px 6px -1px rgba(0,0,0,0.06), 0 2px 4px -2px rgba(0,0,0,0.04);
    --sn-card-shadow-hover: 0 10px 15px -3px rgba(0,0,0,0.08), 0 4px 6px -4px rgba(0,0,0,0.04);
}

.sn-portal-wrap {
    max-width: 1100px;
    margin: 0 auto;
    padding: 0 8px 60px;
    color: var(--sn-text-main);
    font-family: 'Pretendard', -apple-system, BlinkMacSystemFont, system-ui, sans-serif;
}

/* 툴바 (검색 & 펼치기 & 인쇄) */
.sn-filter-bar {
    background: #ffffff;
    padding: 14px 18px;
    border-radius: 14px;
    border: 1px solid var(--sn-border);
    box-shadow: 0 1px 3px rgba(0,0,0,0.04);
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 28px;
}

.sn-search-box {
    position: relative;
    flex: 1;
    min-width: 240px;
    max-width: 480px;
}

.sn-search-box input {
    width: 100%;
    padding: 8px 14px 8px 32px;
    font-size: 0.88rem;
    border-radius: 8px;
    border: 1px solid #cbd5e1;
    outline: none;
    box-sizing: border-box;
    transition: all 0.15s;
}

.sn-search-box input:focus {
    border-color: var(--sn-primary);
    box-shadow: 0 0 0 3px rgba(4, 120, 87, 0.15);
}

.sn-search-icon {
    position: absolute;
    left: 10px;
    top: 50%;
    transform: translateY(-50%);
    color: #94a3b8;
    pointer-events: none;
    font-size: 0.88rem;
}

.btn-toggle-all-acc {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 12px;
    font-size: 0.84rem;
    font-weight: 700;
    border-radius: 8px;
    border: 1px solid #cbd5e1;
    background: #f8fafc;
    color: #334155;
    cursor: pointer;
    transition: all 0.15s;
}

.btn-toggle-all-acc:hover {
    background: #f1f5f9;
    border-color: #94a3b8;
}

/* ==========================================================
 * 📜 시계열 연혁 타임라인 (Timeline View)
 * ========================================================== */
.timeline-container {
    position: relative;
    padding: 10px 0 30px;
}

.timeline-line {
    position: absolute;
    top: 0;
    bottom: 0;
    left: 36px;
    width: 3px;
    background: #e2e8f0;
    border-radius: 2px;
}

.timeline-year-group {
    position: relative;
    margin-bottom: 40px;
}

.timeline-year-marker {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 6px 18px;
    background: #1e293b;
    color: #ffffff;
    font-size: 1rem;
    font-weight: 800;
    border-radius: 20px;
    box-shadow: 0 2px 5px rgba(0,0,0,0.15);
    margin-left: 16px;
    margin-bottom: 24px;
    position: relative;
    z-index: 2;
}

.timeline-item {
    position: relative;
    display: flex;
    align-items: flex-start;
    margin-bottom: 24px;
    padding-left: 72px;
}

.timeline-node {
    position: absolute;
    left: 26px;
    top: 18px;
    width: 22px;
    height: 22px;
    border-radius: 50%;
    background: #ffffff;
    border: 4px solid var(--sn-primary);
    box-shadow: 0 0 0 3px rgba(4, 120, 87, 0.2);
    z-index: 2;
    transition: transform 0.2s ease;
}

.timeline-item:hover .timeline-node {
    transform: scale(1.15);
    border-color: var(--sn-primary-hover);
}

.timeline-card {
    background: #ffffff;
    border: 1px solid var(--sn-border);
    border-radius: 16px;
    padding: 22px 24px;
    width: 100%;
    box-shadow: var(--sn-card-shadow);
    transition: all 0.2s ease;
    box-sizing: border-box;
}

.timeline-card:hover {
    box-shadow: var(--sn-card-shadow-hover);
    border-color: #cbd5e1;
}

.timeline-card.pinned {
    border-left: 4px solid #eab308;
    background: linear-gradient(to right, #fefce8 0%, #ffffff 8%);
}

.timeline-card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 12px;
}

.card-meta-left {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

.card-badge-category {
    font-size: 0.78rem;
    font-weight: 800;
    padding: 4px 10px;
    border-radius: 6px;
    letter-spacing: -0.2px;
}

/* 카테고리별 컬러 뱃지 */
.badge-대회수상 { background: #fef3c7; color: #b45309; border: 1px solid #fde68a; }
.badge-학교행사 { background: #dbeafe; color: #1d4ed8; border: 1px solid #bfdbfe; }
.badge-진로취업 { background: #f3e8ff; color: #6b21a8; border: 1px solid #e9d5ff; }
.badge-입학홍보 { background: #ccfbf1; color: #0f766e; border: 1px solid #99f6e4; }
.badge-장학복지 { background: #ffe4e6; color: #be123c; border: 1px solid #fecdd3; }
.badge-언론보도 { background: #e0e7ff; color: #3730a3; border: 1px solid #c7d2fe; }
.badge-기타     { background: #f1f5f9; color: #475569; border: 1px solid #e2e8f0; }

.card-date-badge {
    font-size: 0.82rem;
    font-weight: 700;
    color: #64748b;
    background: #f8fafc;
    padding: 4px 8px;
    border-radius: 6px;
    border: 1px solid #e2e8f0;
}

.card-pin-badge {
    font-size: 0.75rem;
    font-weight: 800;
    color: #a16207;
    background: #fef08a;
    padding: 3px 8px;
    border-radius: 6px;
}

/* 타임라인 카드 본문 가로 분할 레이아웃 */
.timeline-card-body-row {
    display: flex;
    gap: 18px;
    align-items: flex-start;
    justify-content: space-between;
}

.timeline-card-text-col {
    flex: 1;
    min-width: 0;
}

.timeline-card-title {
    font-size: 1.15rem;
    font-weight: 800;
    color: #0f172a;
    margin: 0 0 10px;
    line-height: 1.45;
    word-break: break-word;
}

.news-summary-box {
    background: #f8fafc;
    border-left: 3px solid var(--sn-primary);
    padding: 8px 12px;
    border-radius: 0 8px 8px 0;
    font-size: 0.88rem;
    color: #334155;
    line-height: 1.5;
    margin-bottom: 12px;
}

/* 우측 대표 썸네일 (사진 또는 유튜브 영상) */
.timeline-card-thumb-col {
    flex-shrink: 0;
    width: 140px;
    cursor: pointer;
}

.lead-thumb-wrapper {
    position: relative;
    width: 100%;
    height: 98px;
    border-radius: 10px;
    overflow: hidden;
    background: #0f172a;
    border: 1px solid #e2e8f0;
}

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

.timeline-card-thumb-col:hover .lead-thumb-img {
    transform: scale(1.05);
}

.lead-thumb-overlay {
    position: absolute;
    inset: 0;
    background: rgba(0,0,0,0.25);
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity 0.2s;
}

.timeline-card-thumb-col:hover .lead-thumb-overlay {
    opacity: 1;
}

.zoom-icon {
    font-size: 1.3rem;
}

.yt-play-btn {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: #ef4444;
    color: #ffffff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.9rem;
    padding-left: 2px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.3);
}

.thumb-media-badge {
    position: absolute;
    bottom: 5px;
    left: 5px;
    padding: 2px 6px;
    font-size: 0.68rem;
    font-weight: 700;
    border-radius: 4px;
    background: rgba(0,0,0,0.7);
    color: #ffffff;
}

.yt-badge {
    background: rgba(220, 38, 38, 0.9);
}

.thumb-count-badge {
    position: absolute;
    top: 5px;
    right: 5px;
    background: rgba(15, 23, 42, 0.75);
    color: #ffffff;
    font-size: 0.7rem;
    font-weight: 700;
    padding: 2px 6px;
    border-radius: 4px;
}

/* 아코디언 펼침 버튼 */
.news-accordion-btn-wrap {
    margin-top: 8px;
}

.btn-news-accordion {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 6px 14px;
    background: #f1f5f9;
    color: #334155;
    border: 1px solid #cbd5e1;
    border-radius: 8px;
    font-size: 0.82rem;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.15s ease;
}

.btn-news-accordion:hover {
    background: #e2e8f0;
    color: #0f172a;
}

.btn-news-accordion.active {
    background: #ecfdf5;
    color: #047857;
    border-color: #a7f3d0;
}

.acc-arrow {
    font-size: 0.75rem;
    transition: transform 0.2s ease;
}

.btn-news-accordion.active .acc-arrow {
    transform: rotate(180deg);
}

/* 아코디언 펼침 상세 내용 */
.news-accordion-body {
    margin-top: 16px;
    padding-top: 16px;
    border-top: 1px dashed #e2e8f0;
}

.news-content-box {
    font-size: 0.92rem;
    line-height: 1.7;
    color: #1e293b;
    white-space: pre-wrap;
    word-break: break-word;
    margin-bottom: 16px;
}

/* 🏆 참가 및 수상 명단 (학생 실명 마스킹 및 학번 가림 칩) */
.participants-section {
    background: #f0fdf4;
    border: 1px solid #bbf7d0;
    border-radius: 12px;
    padding: 12px 14px;
    margin-bottom: 16px;
}

.participants-title {
    font-size: 0.84rem;
    font-weight: 800;
    color: #166534;
    margin-bottom: 8px;
    display: flex;
    align-items: center;
    gap: 6px;
}

.participants-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.participant-chip {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    background: #ffffff;
    border: 1px solid #86efac;
    padding: 4px 10px;
    border-radius: 8px;
    font-size: 0.82rem;
    color: #14532d;
    box-shadow: 0 1px 2px rgba(0,0,0,0.03);
}

.award-tag {
    background: #fef3c7;
    color: #92400e;
    font-weight: 800;
    padding: 1px 6px;
    border-radius: 4px;
    font-size: 0.74rem;
    border: 1px solid #fde68a;
}

/* 사진 갤러리 */
.news-gallery {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(130px, 1fr));
    gap: 8px;
    margin-bottom: 16px;
}

.gallery-thumb {
    width: 100%;
    height: 95px;
    object-fit: cover;
    border-radius: 8px;
    border: 1px solid #e2e8f0;
    cursor: pointer;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    display: block;
}

.gallery-thumb:hover {
    transform: scale(1.03);
    box-shadow: 0 4px 10px rgba(0,0,0,0.12);
}

/* 카드 하단 메타 & 링크 & 다운로드 */
.card-footer-meta {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    padding-top: 12px;
    border-top: 1px solid #f1f5f9;
}

.link-chip {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 5px 12px;
    background: #eff6ff;
    color: #1d4ed8;
    border: 1px solid #bfdbfe;
    border-radius: 6px;
    font-size: 0.8rem;
    font-weight: 700;
    text-decoration: none;
    transition: background 0.15s;
}

.link-chip:hover {
    background: #dbeafe;
}

.card-author-info {
    font-size: 0.78rem;
    color: #94a3b8;
}

/* 라이트박스 모달 */
.lightbox-modal {
    position: fixed;
    inset: 0;
    background: rgba(15, 23, 42, 0.92);
    z-index: 999999;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 20px;
    backdrop-filter: blur(4px);
}

.lightbox-modal.active {
    display: flex;
}

.lightbox-close {
    position: absolute;
    top: 20px;
    right: 24px;
    background: rgba(255,255,255,0.15);
    border: none;
    color: #ffffff;
    font-size: 1.8rem;
    width: 44px;
    height: 44px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s;
    z-index: 10;
}

.lightbox-close:hover {
    background: rgba(255,255,255,0.3);
}

.lightbox-img {
    max-width: 90vw;
    max-height: 85vh;
    border-radius: 8px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.5);
    object-fit: contain;
}

.lightbox-video-wrap {
    width: 90vw;
    max-width: 900px;
    aspect-ratio: 16 / 9;
    background: #000000;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 10px 30px rgba(0,0,0,0.5);
}

.lightbox-video-wrap iframe {
    width: 100%;
    height: 100%;
    border: none;
}

/* 더 보기 버튼 & 래퍼 */
.timeline-load-more-wrap {
    text-align: center;
    margin-top: 28px;
    padding-left: 72px;
}

.timeline-end-notice {
    color: #94a3b8;
    font-size: 0.88rem;
    font-weight: 600;
    padding: 16px 0 24px;
}

.btn-load-more {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    width: auto;
    min-width: 240px;
    margin: 0 auto;
    padding: 12px 28px;
    background: #ffffff;
    color: var(--sn-primary);
    border: 2px solid var(--sn-primary);
    border-radius: 24px;
    font-size: 0.95rem;
    font-weight: 700;
    cursor: pointer;
    text-align: center;
    box-shadow: 0 2px 5px rgba(0,0,0,0.05);
    transition: all 0.2s ease;
}

.btn-load-more:hover {
    background: var(--sn-primary);
    color: #ffffff;
    box-shadow: 0 4px 12px rgba(4, 120, 87, 0.25);
    transform: translateY(-1px);
}

.btn-load-more:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
}

/* 모바일 반응형 */
@media (max-width: 768px) {
    .timeline-line {
        left: 20px;
    }

    .timeline-node {
        left: 10px;
        width: 18px;
        height: 18px;
    }

    .timeline-item {
        padding-left: 44px;
    }

    .timeline-year-marker {
        margin-left: 6px;
        font-size: 0.9rem;
        padding: 5px 14px;
    }

    .timeline-card {
        padding: 16px;
    }

    .timeline-card-body-row {
        flex-direction: column;
        gap: 12px;
    }

    .timeline-card-thumb-col {
        width: 100%;
    }

    .lead-thumb-wrapper {
        height: 160px;
    }

    .sn-filter-bar {
        padding: 12px;
    }

    .sn-search-box {
        min-width: 100%;
        width: 100%;
    }

    .timeline-load-more-wrap {
        padding-left: 44px;
    }
}

@media print {
    .sn-filter-bar, .news-accordion-btn-wrap, .btn-load-more, .site header, footer {
        display: none !important;
    }
    .news-accordion-body {
        display: block !important;
    }
    .timeline-card {
        box-shadow: none !important;
        border: 1px solid #ccc !important;
        break-inside: avoid;
    }
}
