/* ==========================================================================
   반응형 규칙 (기준: 1440 / 1024 / 768 / 360)
   ========================================================================== */

/* 노트북 이하 (≤1200px) */
/* 헤더: 영문 부제는 넓은 화면에서만, 좁은 데스크톱에서는 워드마크만 */
@media (max-width: 1320px) {
    .logo-text small { display: none; }
}
@media (min-width: 1025px) and (max-width: 1140px) {
    .logo-divider, .logo-text { display: none; }
}

@media (max-width: 1200px) {
    .gnb-link { padding: 0 11px; font-size: .96rem; }
    .card-grid { grid-template-columns: repeat(2, 1fr); }
}

/* 태블릿 이하 (≤1024px): 햄버거 메뉴로 전환 */
@media (max-width: 1024px) {
    :root { --header-h: 64px; }
    .nav-toggle { display: inline-flex; }
    .site-nav {
        display: none; position: fixed; left: 0; right: 0; top: var(--header-h); bottom: 0;
        flex-direction: column; align-items: stretch; justify-content: flex-start; gap: 0;
        background: var(--white); overflow-y: auto; padding: 8px 0 32px; border-top: 1px solid var(--gray-200);
    }
    .site-header.is-nav-open .site-nav { display: flex; }
    body.nav-locked { overflow: hidden; }
    .gnb { flex-direction: column; margin: 0; }
    .gnb-item { flex-wrap: wrap; border-bottom: 1px solid var(--gray-100); }
    .gnb-link { flex: 1; line-height: 1.4; padding: 16px 24px; font-size: 1.05rem; }
    .gnb-item.is-active > .gnb-link { box-shadow: inset 3px 0 0 var(--blue-600); }
    .gnb-sub-toggle { display: inline-flex; margin: 0 16px 0 0; width: 44px; height: 44px; align-items: center; justify-content: center; }
    .gnb-sub-toggle[aria-expanded="true"] svg { transform: rotate(180deg); }
    .gnb-sub {
        position: static; transform: none; opacity: 1; visibility: visible; display: none; width: 100%;
        border: 0; border-radius: 0; box-shadow: none; padding: 0 16px 12px; background: var(--white);
    }
    .gnb-item:hover > .gnb-sub, .gnb-item:focus-within > .gnb-sub { transform: none; }
    .gnb-item.is-open > .gnb-sub { display: block; transform: none; }
    .gnb-sub a { padding: 12px 16px; font-size: 1rem; background: var(--gray-50); margin-bottom: 4px; white-space: normal; }
    .header-util { padding: 20px 24px 0; flex-wrap: wrap; gap: 10px; }
    .header-util .btn { flex: 1; }

    .hero-inner { grid-template-columns: 1fr; padding-top: 72px; padding-bottom: 120px; }
    .hero-panel { justify-self: start; max-width: none; }
    .hero-bg { max-width: 90%; opacity: .5; }
    .hero-title { font-size: 2.4rem; }
    .news-grid { grid-template-columns: 1fr; }
    .intro-split { grid-template-columns: 1fr; gap: 40px; }
    .sub-layout { grid-template-columns: minmax(0, 1fr); gap: 28px; padding-top: 28px; }
    .sub-nav { position: static; }
    .sub-nav-title { display: none; }
    .sub-nav ul { display: flex; gap: 6px; overflow-x: auto; border: 0; padding: 0 0 6px; border-radius: 0; scrollbar-width: thin; }
    .sub-nav li { flex-shrink: 0; }
    .sub-nav a { border: 1px solid var(--gray-200); border-radius: 999px; padding: 8px 16px; white-space: nowrap; }
    .feature-grid--3 { grid-template-columns: repeat(2, 1fr); }
    .contact-cards { grid-template-columns: 1fr; }
    .cta-inner { flex-direction: column; align-items: flex-start; }
}

/* 모바일 (≤768px) */
@media (max-width: 768px) {
    body { font-size: 15.5px; }
    .container { padding: 0 16px; }
    .section { padding: 60px 0; }
    .section-head { flex-direction: column; align-items: flex-start; gap: 12px; margin-bottom: 24px; }
    .section-title { font-size: 1.55rem; }
    .logo { gap: 10px; }
    .logo-wordmark { height: 26px; }
    .logo-divider { height: 24px; }
    .logo-text strong { font-size: .98rem; }
    .logo-text small { display: none; }
    .footer-brand { flex-wrap: wrap; }

    .hero-inner { padding-top: 56px; padding-bottom: 104px; gap: 32px; }
    .hero-title { font-size: 1.85rem; }
    .hero-lead { font-size: 1rem; }
    .hero-actions .btn { flex: 1 1 auto; }
    .quick-menu { margin-top: -56px; }
    .quick-list { grid-template-columns: repeat(3, 1fr); }
    .quick-list li + li { border-left: 0; }
    .quick-list li { border-right: 1px solid var(--gray-200); border-bottom: 1px solid var(--gray-200); }
    .quick-list li:nth-child(3n) { border-right: 0; }
    .quick-link { padding: 18px 6px; font-size: .88rem; }
    .quick-link .icon { width: 26px; height: 26px; }
    .news-panel { padding: 20px; }
    .card-grid, .feature-grid, .feature-grid--3 { grid-template-columns: 1fr; }
    .page-hero { padding: 44px 0 40px; }
    .page-hero-title { font-size: 1.75rem; }
    .greeting-wrap { grid-template-columns: 1fr; }
    .greeting-photo { max-width: 180px; }
    .form-row { grid-template-columns: 1fr; }
    .auth-card { padding: 28px 20px; }
    .footer-body { flex-direction: column; gap: 20px; }
    .info-table th { width: 110px; }
    .info-table th, .info-table td { padding: 12px; }

    /* 조직도: 세로 배치 */
    .org-branch, .org-branch--4 { grid-template-columns: 1fr 1fr; padding-top: 16px; }
    .org-branch::before, .org-branch .org-node::before { display: none; }

    /* 게시판 표 → 카드형 목록 */
    .board-toolbar { flex-direction: column; align-items: stretch; }
    .search-form { flex-wrap: wrap; }
    .search-form select { flex: 0 0 108px; min-width: 0; width: 108px; }
    .search-form .btn { flex: 0 0 auto; }
    .search-form input[type="search"] { flex: 1; width: auto; min-width: 0; }
    .board-table thead { display: none; }
    .board-table, .board-table tbody, .board-table tr, .board-table td { display: block; width: 100%; }
    .board-table tr { padding: 14px 4px; border-bottom: 1px solid var(--gray-200); }
    .board-table td { padding: 0; border: 0; text-align: left; }
    .board-table td.cell-title { margin-bottom: 6px; font-size: 1rem; }
    .board-table td.col-num { display: none; }
    .board-table td.col-author, .board-table td.col-date, .board-table td.col-views {
        display: inline; width: auto; font-size: .85rem; color: var(--text-muted);
    }
    .board-table td.col-author::after, .board-table td.col-date::after { content: "·"; margin: 0 6px; }
    .board-table td.col-views::before { content: "조회 "; }
    .board-table tr.is-notice td { background: none; }
    .board-table .notice-inline { display: inline-flex; margin-right: 4px; }
    .board-table tr.is-notice { background: #F7FAFD; }
    .board-table td.empty-state { padding: 40px 0; text-align: center; }
    .post-view-title { font-size: 1.3rem; }
    .post-view-body { padding: 24px 0; }
}

/* 소형 모바일 (≤420px, 360px 대응) */
@media (max-width: 420px) {
    .logo-divider, .logo-text { display: none; }
    .hero-title { font-size: 1.6rem; }
    .btn-lg { min-height: 48px; padding: 0 18px; }
    .quick-list { grid-template-columns: repeat(2, 1fr); }
    .quick-list li:nth-child(3n) { border-right: 1px solid var(--gray-200); }
    .quick-list li:nth-child(2n) { border-right: 0; }
    .quick-list li:last-child { grid-column: 1 / -1; }
    .news-item { flex-wrap: wrap; gap: 4px 10px; }
    .news-title { flex-basis: 100%; white-space: normal; order: 1; }
    .news-date { order: 2; }
    .org-branch, .org-branch--4 { grid-template-columns: 1fr; }
    .org-side { flex-direction: column; align-items: center; }
    .pagination a, .pagination span { min-width: 36px; height: 36px; }
}

/* 인쇄 */
@media print {
    .site-header, .site-footer, .sub-nav, .breadcrumb, .post-view-actions, .board-actions { display: none !important; }
    .page-hero { background: none; color: #000; padding: 0; }
    .page-hero-title { color: #000; }
    .sub-layout { display: block; padding: 0; }
}
