/* 미래고용나눔협회 새 홈페이지 */
* { margin: 0; padding: 0; box-sizing: border-box; }
body {
  font-family: "Noto Sans KR", "Malgun Gothic", sans-serif;
  color: #333;
  background: #f7f8fa;
  line-height: 1.6;
}
a { color: #2b5ea7; text-decoration: none; }
a:hover { text-decoration: underline; }
.wrap { max-width: 1100px; margin: 0 auto; padding: 0 16px; }

/* ---------- 헤더 ---------- */
.topbar { background: #fff; border-bottom: 3px solid #2b5ea7; }
.topbar .wrap { display: flex; align-items: center; justify-content: space-between; height: 72px; }
.logo { display: flex; flex-direction: column; line-height: 1.2; color: #2b5ea7; }
.logo strong { font-size: 20px; letter-spacing: -0.5px; }
.logo span { font-size: 12px; color: #888; }
.nav { display: flex; list-style: none; gap: 4px; }
.nav > li { position: relative; padding: 8px 14px; cursor: pointer; font-size: 15px; font-weight: 600; color: #333; }
.nav > li.active, .nav > li:hover { color: #2b5ea7; }
.nav > li > .sub {
  display: none; position: absolute; top: 100%; left: 0; min-width: 170px;
  background: #fff; border: 1px solid #e3e6ea; border-top: 2px solid #2b5ea7;
  box-shadow: 0 6px 18px rgba(0,0,0,0.08); z-index: 50;
}
.nav > li:hover > .sub { display: block; }
.nav > li > .sub a { display: block; padding: 10px 16px; font-size: 14px; font-weight: 400; color: #444; white-space: nowrap; }
.nav > li > .sub a:hover { background: #f0f4fa; color: #2b5ea7; text-decoration: none; }
.nav-toggle { display: none; background: none; border: none; font-size: 26px; color: #2b5ea7; cursor: pointer; }

/* ---------- 메인 배너 ---------- */
.hero {
  background: linear-gradient(135deg, #2b5ea7 0%, #3f7fd4 100%);
  color: #fff; text-align: center; padding: 70px 16px 64px;
}
.hero h1 { font-size: 30px; margin-bottom: 12px; letter-spacing: -0.5px; }
.hero p { font-size: 16px; opacity: 0.92; }

/* 홈 히어로 롤링 배너 */
.hero-slider { position: relative; width: 100%; overflow: hidden; background: #eef1f5; }
.hero-slider .hs-track { position: relative; width: 100%; aspect-ratio: 1920 / 500; }
.hero-slider .hs-slide { position: absolute; inset: 0; opacity: 0; transform: none; transition: opacity 0.7s ease, transform 0.7s ease; }
.hero-slider .hs-slide.active { opacity: 1; transform: none; }
.hero-slider .hs-slide img { width: 100%; height: 100%; object-fit: cover; display: block; }
.hero-slider .hs-arrow { position: absolute; top: 50%; transform: translateY(-50%); z-index: 5; background: rgba(0, 0, 0, 0.35); color: #fff; border: 0; width: 42px; height: 42px; font-size: 18px; cursor: pointer; border-radius: 50%; line-height: 1; }
.hero-slider .hs-arrow:hover { background: rgba(0, 0, 0, 0.55); }
.hero-slider .hs-arrow.prev { left: 14px; }
.hero-slider .hs-arrow.next { right: 14px; }
@media (max-width: 860px) {
  .hero-slider .hs-track { aspect-ratio: 16 / 9; }
  .hero-slider .hs-arrow { width: 32px; height: 32px; font-size: 14px; }
}

/* ---------- 섹션 ---------- */
.section { padding: 40px 0; }
.section h2 { font-size: 22px; color: #2b5ea7; margin-bottom: 18px; border-left: 4px solid #2b5ea7; padding-left: 10px; }
.card { background: #fff; border: 1px solid #e3e6ea; border-radius: 8px; padding: 22px; }

/* 게시글 목록 */
.post-list { list-style: none; }
.post-list li { display: flex; justify-content: space-between; gap: 12px; padding: 11px 0; border-bottom: 1px solid #eef0f3; }
.post-list a { flex: 1; color: #333; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.post-list a:hover { color: #2b5ea7; }
.post-list .date { color: #999; font-size: 13px; white-space: nowrap; }

/* 갤러리 그리드 */
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 14px; }
/* 홈 최근글 카드 (모바일 1열, 데스크톱 2열) — 오버플로우 방지 */
.home-grid { grid-template-columns: 1fr; }
.home-grid > * { min-width: 0; }
@media (min-width: 861px) {
  .home-grid { grid-template-columns: 1fr 1fr; }
}
.grid .item { background: #fff; border: 1px solid #e3e6ea; border-radius: 8px; overflow: hidden; }
.grid .item img { width: 100%; height: 160px; object-fit: cover; display: block; }
.grid .item .cap { padding: 8px 12px; font-size: 13px; color: #555; }

/* 페이지 본문 */
.page-body { background: #fff; border: 1px solid #e3e6ea; border-radius: 8px; padding: 28px; min-height: 400px; }
.page-body img { max-width: 100%; height: auto; }
.page-body table { border-collapse: collapse; max-width: 100%; }
.page-body td, .page-body th { border: 1px solid #ddd; padding: 6px 10px; }

/* 게시글 본문 */
.post-view { background: #fff; border: 1px solid #e3e6ea; border-radius: 8px; padding: 28px; }
.post-view h1 { font-size: 22px; margin-bottom: 10px; }
.post-meta { color: #999; font-size: 13px; margin-bottom: 20px; padding-bottom: 14px; border-bottom: 1px solid #eef0f3; }
.post-body { line-height: 1.8; }
.post-body img { max-width: 100%; height: auto; }
.post-body table { border-collapse: collapse; max-width: 100%; }
.post-body td, .post-body th { border: 1px solid #ddd; padding: 6px 10px; }

/* 버튼/폼 */
.btn {
  display: inline-block; background: #2b5ea7; color: #fff; border: none; border-radius: 6px;
  padding: 9px 18px; font-size: 14px; cursor: pointer;
}
.btn:hover { background: #24508f; text-decoration: none; }
.btn.ghost { background: #fff; color: #2b5ea7; border: 1px solid #2b5ea7; }
.btn.danger { background: #c0392b; }
.btn.danger:hover { background: #a93226; }
input[type="text"], input[type="password"], input[type="search"], textarea, select {
  width: 100%; padding: 10px 12px; border: 1px solid #cfd4da; border-radius: 6px; font-size: 14px; font-family: inherit;
}
textarea { min-height: 220px; resize: vertical; }
label { display: block; font-size: 14px; font-weight: 600; margin: 14px 0 6px; }

/* 페이지네이션 */
.pagination { display: flex; justify-content: center; gap: 6px; margin-top: 24px; }
.pagination a, .pagination span {
  padding: 7px 12px; border: 1px solid #d8dce1; border-radius: 6px; background: #fff; color: #555; font-size: 14px;
}
.pagination a:hover { border-color: #2b5ea7; color: #2b5ea7; text-decoration: none; }
.pagination .cur { background: #2b5ea7; color: #fff; border-color: #2b5ea7; }

/* 검색창 */
.search-box { display: flex; gap: 8px; max-width: 420px; margin: 0 auto 26px; }
.search-box input { flex: 1; }

/* 푸터 */
footer { background: #2c323a; color: #b8c0ca; margin-top: 50px; padding: 34px 0 30px; font-size: 14px; }
footer p { margin-bottom: 6px; }
footer strong { color: #e6e9ed; }
footer .copy { color: #7d8691; font-size: 12px; }

/* 로그인/관리 */
.auth-box { max-width: 360px; margin: 60px auto; }
.admin-toolbar { display: flex; justify-content: space-between; align-items: center; margin-bottom: 16px; }

/* 관리자 대시보드 레이아웃 */
.admin-layout { display: flex; gap: 24px; align-items: flex-start; }
.admin-side {
  width: 200px; flex-shrink: 0; background: #fff; border: 1px solid #e3e6ea;
  border-radius: 8px; padding: 10px 0; position: sticky; top: 90px;
}
.admin-side a {
  display: block; padding: 11px 18px; color: #444; font-size: 14px; border-left: 3px solid transparent;
}
.admin-side a:hover { background: #f0f4fa; color: #2b5ea7; text-decoration: none; }
.admin-side a.active { background: #f0f4fa; color: #2b5ea7; border-left-color: #2b5ea7; font-weight: 600; }
.admin-main { flex: 1; min-width: 0; }
.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 14px; margin-bottom: 20px; }
.stat {
  background: #fff; border: 1px solid #e3e6ea; border-radius: 8px; padding: 18px;
  text-align: center;
}
.stat .num { font-size: 28px; font-weight: 700; color: #2b5ea7; }
.stat .lbl { font-size: 13px; color: #888; margin-top: 4px; }
.board-bars { display: flex; flex-direction: column; gap: 8px; }
.board-bars .row { display: flex; align-items: center; gap: 10px; font-size: 13px; }
.board-bars .bar {
  flex: 1; height: 10px; background: #eef0f3; border-radius: 5px; overflow: hidden;
}
.board-bars .bar i { display: block; height: 100%; background: #2b5ea7; }
.board-bars .cnt { width: 40px; text-align: right; color: #666; }
.view { display: none; }
.view.active { display: block; }
.page-edit-layout { display: flex; gap: 20px; align-items: flex-start; }
.page-list-col { width: 220px; flex-shrink: 0; }
.page-list {
  border: 1px solid #e3e6ea; border-radius: 8px; max-height: 480px; overflow-y: auto; background: #fff;
}
.page-list li { border-bottom: 1px solid #f0f2f5; }
.page-list li:last-child { border-bottom: none; }
.page-list a { display: block; padding: 10px 14px; font-size: 14px; color: #444; }
.page-list a:hover { background: #f0f4fa; color: #2b5ea7; text-decoration: none; }
.page-list li.sel a { background: #f0f4fa; color: #2b5ea7; font-weight: 600; }
.page-edit-col { flex: 1; min-width: 0; }
/* 위지위그 편집기 */
.editor-toolbar {
  display: flex; flex-wrap: wrap; gap: 4px; align-items: center;
  background: #f4f6f9; border: 1px solid #cfd4da; border-bottom: none;
  border-radius: 6px 6px 0 0; padding: 6px 8px;
}
.editor-toolbar button {
  min-width: 32px; height: 30px; padding: 0 8px; border: 1px solid transparent;
  border-radius: 4px; background: none; font-size: 14px; cursor: pointer; color: #333;
}
.editor-toolbar button:hover { background: #e4e9f0; }
.editor-toolbar button.on { background: #2b5ea7; color: #fff; }
.editor-toolbar .sep { width: 1px; height: 20px; background: #d0d5dc; margin: 0 4px; }
.editor-toolbar select, .editor-toolbar input[type="color"] {
  height: 30px; border: 1px solid #cfd4da; border-radius: 4px; background: #fff;
  padding: 0 4px; font-size: 13px; width: auto;
}
.editor-toolbar input[type="color"] { width: 34px; padding: 2px; cursor: pointer; }
/* 이미지 미리보기 */
.img-preview { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 10px; }
.img-preview-item {
  position: relative; width: 100px; height: 100px; border: 1px solid #e3e6ea;
  border-radius: 8px; overflow: hidden; background: #f4f6f9;
}
.img-preview-item img { width: 100%; height: 100%; object-fit: cover; display: block; }
.img-preview-del {
  position: absolute; top: 4px; right: 4px; width: 22px; height: 22px; border: none;
  border-radius: 50%; background: rgba(0,0,0,0.65); color: #fff; font-size: 12px;
  line-height: 1; cursor: pointer;
}
.img-preview-del:hover { background: #c0392b; }
.editor-body {
  min-height: 260px; background: #fff; border: 1px solid #cfd4da; border-radius: 0 0 6px 6px;
  padding: 14px 16px; font-size: 14px; line-height: 1.7; outline: none; overflow-y: auto;
}
.editor-body:focus { border-color: #2b5ea7; }
.editor-body img { max-width: 100%; height: auto; }
.editor-hint { font-size: 12px; color: #888; margin-top: 8px; }
.editor-body table { border-collapse: collapse; max-width: 100%; }
.editor-body td, .editor-body th { border: 1px solid #ddd; padding: 6px 10px; }
@media (max-width: 860px) {
  .page-edit-layout { flex-direction: column; }
  .page-list-col { width: 100%; }
  .page-list { max-height: 200px; }
}
.filter-bar { display: flex; gap: 10px; align-items: center; margin-bottom: 14px; flex-wrap: wrap; }
/* 배너 관리 목록 */
.banner-admin-list { list-style: none; }
.banner-admin-list li { display: flex; align-items: center; gap: 14px; padding: 12px 0; border-bottom: 1px solid #eef0f3; flex-wrap: wrap; }
.banner-admin-list .thumb { width: 200px; flex-shrink: 0; }
.banner-admin-list .thumb img { width: 100%; height: 52px; object-fit: cover; border-radius: 4px; border: 1px solid #e3e6ea; display: block; }
.banner-admin-list .info { flex: 1; min-width: 160px; display: flex; flex-direction: column; gap: 4px; font-size: 13px; }
.banner-admin-list .info .link { color: #888; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.banner-admin-list .badge { display: inline-block; font-size: 11px; padding: 1px 8px; border-radius: 10px; background: #eee; color: #888; width: fit-content; }
.banner-admin-list .badge.on { background: #e3f2fd; color: #2b5ea7; }
.banner-admin-list .acts { display: flex; gap: 6px; flex-wrap: wrap; }
.banner-admin-list .acts .btn { padding: 3px 10px; font-size: 12px; }

/* 이미지 관리 그리드 */
.img-manage-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 14px; }
.img-manage-grid .im-item { border: 1px solid #e3e6ea; border-radius: 8px; overflow: hidden; background: #fff; }
.img-manage-grid .im-thumb { width: 100%; height: 100px; object-fit: cover; display: block; background: #f4f6f8; }
.img-manage-grid .im-info { padding: 8px 10px; font-size: 11px; color: #666; }
.img-manage-grid .im-key { word-break: break-all; margin-bottom: 4px; color: #444; }
.img-manage-grid .ref-on { color: #c0392b; }
.img-manage-grid .ref-off { color: #2e7d32; }
.img-manage-grid .im-acts { display: flex; gap: 6px; padding: 0 10px 10px; }
.img-manage-grid .im-acts .btn { padding: 3px 8px; font-size: 12px; }

.filter-bar select, .filter-bar input { width: auto; }
.filter-bar input { flex: 1; min-width: 180px; }
@media (max-width: 860px) {
  .admin-layout { flex-direction: column; }
  .admin-side { width: 100%; position: static; display: flex; flex-wrap: wrap; }
  .admin-side a { border-left: none; border-bottom: 2px solid transparent; }
  .admin-side a.active { border-bottom-color: #2b5ea7; }
}

/* ---------- 서브메뉴 탭 바 (PC) ---------- */
.sub-tabs {
  display: flex; flex-wrap: wrap; gap: 6px; margin: 24px 0 4px;
  padding: 10px 12px; background: #fff; border: 1px solid #e3e6ea; border-radius: 8px;
}
.sub-tabs a {
  padding: 8px 16px; border-radius: 6px; font-size: 14px; color: #555;
  border: 1px solid transparent;
}
.sub-tabs a:hover { background: #f0f4fa; color: #2b5ea7; text-decoration: none; }
.sub-tabs a.active { background: #2b5ea7; color: #fff; }

/* ---------- 모바일 메뉴: 대메뉴 아이콘 2x3 그리드 + 하단 서브메뉴 ---------- */
.m-menu { display: none; }
.m-overlay { display: none; }
@media (max-width: 860px) {
  .nav-toggle { display: block; }
  .nav { display: none !important; }
  .m-menu { display: none; }
  .m-menu.open {
    display: block;
    position: fixed; top: 72px; left: 0; right: 0;
    z-index: 100;
    max-height: calc(100vh - 72px); overflow-y: auto;
    box-shadow: 0 12px 28px rgba(0,0,0,0.18);
  }
  .m-overlay {
    display: none; position: fixed; inset: 0; z-index: 95;
    background: rgba(0,0,0,0.45);
  }
  .m-overlay.show { display: block; }
  .sub-tabs { margin: 14px 0 2px; padding: 8px; overflow-x: auto; flex-wrap: nowrap; }
  .sub-tabs a { white-space: nowrap; padding: 7px 13px; }
  .m-grid {
    display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px;
    padding: 12px 16px 14px; background: #fff;
  }
  .m-item {
    display: flex; align-items: center; gap: 10px; width: 100%; text-align: left;
    background: #f2f6fc; border: 1px solid #e3e6ea; border-radius: 10px;
    padding: 12px 14px; cursor: pointer; color: #333;
  }
  .m-item .m-ico { display: flex; color: #2b5ea7; }
  .m-item .m-ico svg { width: 26px; height: 26px; }
  .m-item .m-lbl { font-size: 15px; font-weight: 600; }
  .m-item:active { background: #e4ecf8; }
  .m-item.active { background: #2b5ea7; border-color: #2b5ea7; }
  .m-item.active .m-ico { color: #fff; }
  .m-item.active .m-lbl { color: #fff; }
  /* 하단 서브메뉴 리스트 */
  .m-sub { display: none; border-top: 1px solid #e3e6ea; background: #fff; }
  .m-sub.open { display: block; }
  .m-sub a {
    display: block; padding: 13px 22px; font-size: 14px; color: #444;
    border-bottom: 1px solid #f0f2f5; position: relative;
  }
  .m-sub a:last-child { border-bottom: none; }
  .m-sub a:active { background: #f0f4fa; }
}
