@charset "UTF-8";
/* =====================================================================
   국비교육 플랫폼 — 공통 스타일
   Mobile First / 480 · 768 · 1024 · 1280
   ===================================================================== */

/* ---------- 디자인 토큰 ---------- */
:root {
  /* 색상 — 신뢰감 있는 공공·교육 톤 */
  --brand:        #1b3a6b;
  --brand-dark:   #142c52;
  --brand-light:  #e8eefa;
  --accent:       #2f6fed;
  --accent-dark:  #1f56c4;
  --accent-soft:  #eaf1ff;

  --ink:          #111827;
  --ink-2:        #374151;
  --muted:        #6b7280;
  --muted-2:      #9ca3af;
  --line:         #e5e7eb;
  --line-2:       #f0f2f5;
  --bg:           #ffffff;
  --bg-soft:      #f7f9fc;
  --bg-dim:       #eef1f6;

  --success:      #12805c;
  --success-bg:   #e6f6f0;
  --warning:      #b45309;
  --warning-bg:   #fef3e2;
  --danger:       #c0392b;
  --danger-bg:    #fdeceb;
  --info:         #1f56c4;
  --info-bg:      #eaf1ff;

  /* 타이포 */
  --font: "Pretendard", -apple-system, BlinkMacSystemFont, "Malgun Gothic",
          "맑은 고딕", "Apple SD Gothic Neo", system-ui, sans-serif;
  --fs-xs:   12px;
  --fs-sm:   13px;
  --fs-base: 15px;
  --fs-md:   16px;
  --fs-lg:   18px;
  --fs-xl:   22px;
  --fs-2xl:  28px;
  --fs-3xl:  34px;

  /* 간격 */
  --sp-1: 4px;  --sp-2: 8px;  --sp-3: 12px; --sp-4: 16px;
  --sp-5: 20px; --sp-6: 24px; --sp-8: 32px; --sp-10: 40px;
  --sp-12: 48px; --sp-16: 64px; --sp-20: 80px;

  /* 모양 */
  --r-sm: 4px; --r: 8px; --r-lg: 12px; --r-xl: 16px; --r-full: 999px;
  --sh-sm: 0 1px 2px rgba(17,24,39,.06);
  --sh:    0 2px 8px rgba(17,24,39,.08);
  --sh-md: 0 6px 20px rgba(17,24,39,.10);
  --sh-lg: 0 12px 32px rgba(17,24,39,.14);

  --header-h: 60px;
  --container: 1200px;
  --t: .18s ease;
}

/* ---------- 리셋 ---------- */
*, *::before, *::after { box-sizing: border-box; }
html {
  -webkit-text-size-adjust: 100%; scroll-behavior: smooth;
  /* 내용이 짧아 세로 스크롤바가 없는 페이지로 이동하면 뷰포트 폭이 넓어지면서
     가운데 정렬된 헤더·본문이 옆으로 밀린다. 스크롤바 자리를 항상 비워 둔다. */
  scrollbar-gutter: stable;
}
html, body { max-width: 100%; overflow-x: clip; }
/* 콘텐츠가 짧아도 푸터가 화면 아래에 붙도록 본문이 남은 높이를 차지한다.
   관리자(body.admin)는 푸터가 없고 자체 100vh 레이아웃이라 제외한다. */
body:not(.admin) { min-height: 100vh; min-height: 100dvh; display: flex; flex-direction: column; }
body:not(.admin) > #main { flex: 1 0 auto; }
body:not(.admin) > .site-footer { flex: none; }
body {
  margin: 0;
  font-family: var(--font);
  font-size: var(--fs-base);
  line-height: 1.65;
  color: var(--ink);
  background: var(--bg);
  word-break: keep-all;
  overflow-wrap: break-word;
  -webkit-font-smoothing: antialiased;
}
h1,h2,h3,h4,h5,h6,p,figure,blockquote,dl,dd { margin: 0; }
h1,h2,h3,h4,h5,h6 { font-weight: 700; line-height: 1.35; letter-spacing: -.02em; }
ul,ol { margin: 0; padding: 0; list-style: none; }
img,svg,video { max-width: 100%; height: auto; display: block; }
a { color: inherit; text-decoration: none; }
a:hover { color: var(--accent); }
button { font: inherit; cursor: pointer; }
summary { cursor: pointer; }   /* 브라우저 기본값이 default 라 직접 지정한다 */
table { border-collapse: collapse; width: 100%; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: var(--r-sm); }

.skip-link {
  position: absolute; left: -9999px; top: 0; z-index: 999;
  background: var(--brand); color: #fff; padding: var(--sp-3) var(--sp-5);
}
.skip-link:focus { left: 0; }

/* ---------- 레이아웃 ---------- */
.inner { width: 100%; max-width: var(--container); margin: 0 auto; padding: 0 var(--sp-4); }
.section { padding: var(--sp-10) 0; }
.section + .section { padding-top: 0; }
/* 배경이 바뀌는 지점에서는 위 여백을 살린다 — 없으면 제목이 배경 경계에 딱 붙는다
   ① 배경 구역이 시작될 때  ② 배경 구역이 끝나고 다음 구역이 올 때 */
.section + .section.section-soft,
.section-soft + .section { padding-top: var(--sp-10); }
.section-soft { background: var(--bg-soft); }
.page-narrow { max-width: 720px; margin: 0 auto; padding: var(--sp-10) var(--sp-4) var(--sp-16); }

.section-head {
  display: flex; align-items: baseline; justify-content: space-between;
  gap: var(--sp-3); margin-bottom: var(--sp-5); flex-wrap: wrap;
}
.section-head h2 { font-size: var(--fs-xl); }
.section-head .sub { color: var(--muted); font-size: var(--fs-sm); margin-top: 2px; }
.section-head .more { color: var(--accent); font-size: var(--fs-sm); font-weight: 600; white-space: nowrap; }
.section-head .more::after { content: " ›"; }

/* ---------- 헤더 ---------- */
.site-header {
  position: sticky; top: 0; z-index: 100;
  background: rgba(255,255,255,.96);
  backdrop-filter: saturate(180%) blur(8px);
  border-bottom: 1px solid var(--line);
}
.site-header .inner {
  display: flex; align-items: center; gap: var(--sp-4);
  height: var(--header-h);
}
.logo {
  font-size: var(--fs-lg); font-weight: 800; letter-spacing: -.04em;
  color: var(--brand); flex: none;
  display: flex; align-items: center;
}
.logo img { display: block; height: 30px; width: auto; }
.logo span { color: var(--accent); }
.logo:hover { color: var(--brand); }

@media (min-width: 768px) {
  .logo img { height: 34px; }
}

.nav-toggle {
  margin-left: auto; width: 40px; height: 40px; border: 0; background: none;
  display: flex; flex-direction: column; justify-content: center; gap: 5px; padding: 8px;
}
.nav-toggle span { display: block; height: 2px; background: var(--ink); border-radius: 2px; transition: var(--t); }
.nav-toggle[aria-expanded="true"] span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.nav-toggle[aria-expanded="true"] span:nth-child(2) { opacity: 0; }
.nav-toggle[aria-expanded="true"] span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

.gnb {
  position: fixed; inset: var(--header-h) 0 auto 0;
  background: #fff; border-bottom: 1px solid var(--line);
  padding: var(--sp-2) var(--sp-4) var(--sp-5);
  display: none; box-shadow: var(--sh-md);
  max-height: calc(100vh - var(--header-h)); overflow-y: auto;
}
.gnb.is-open { display: block; }
.gnb > ul > li > a {
  display: block; padding: var(--sp-3) 0; font-weight: 600;
  border-bottom: 1px solid var(--line-2);
}
.gnb > ul > li > a.is-active { color: var(--accent); }
/* ---- 분야 드롭다운 ---- */
/* 모바일: 링크 + 펼침버튼 한 줄, 하위 목록은 아코디언으로 아래에 깔린다.
   li 를 flex-wrap 으로 두면 a 가 li 의 직계 자식으로 남아 기존 .gnb > ul > li > a 규칙이 그대로 산다. */
.gnb .has-sub { display: flex; flex-wrap: wrap; align-items: center; border-bottom: 1px solid var(--line-2); }
.gnb .has-sub > a { flex: 1; min-width: 0; border-bottom: 0; }
.gnb .sub-toggle {
  flex: none; width: 44px; height: 44px; border: 0; background: none; color: var(--muted);
  display: flex; align-items: center; justify-content: center;
}
.gnb .sub-toggle::before { content: ""; width: 8px; height: 8px; transition: transform var(--t);
  border-right: 2px solid currentColor; border-bottom: 2px solid currentColor;
  transform: rotate(45deg) translate(-2px, -2px); }
.gnb .has-sub.is-open > .sub-toggle::before { transform: rotate(-135deg) translate(-2px, -2px); }

.gnb .sub-menu { display: none; flex-basis: 100%; padding: var(--sp-1) 0 var(--sp-3) var(--sp-3); }
.gnb .has-sub.is-open > .sub-menu { display: block; }
.gnb .sub-menu a {
  display: block; padding: 7px 0; font-size: var(--fs-sm); color: var(--ink-2);
}
.gnb .sub-menu a:hover, .gnb .sub-menu a.is-active { color: var(--accent); }

.gnb-auth { display: flex; gap: var(--sp-2); margin-top: var(--sp-4); }
.gnb-auth .btn { flex: 1; justify-content: center; }
.inline-form { display: inline-flex; margin: 0; }

/* ---------- 버튼 ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  padding: 10px 18px; border: 1px solid var(--line); border-radius: var(--r);
  background: #fff; color: var(--ink-2); font-size: var(--fs-base); font-weight: 600;
  transition: var(--t); white-space: nowrap; text-align: center;
}
.btn:hover { border-color: var(--muted-2); color: var(--ink); background: var(--bg-soft); }
.btn-primary { background: var(--accent); border-color: var(--accent); color: #fff; }
.btn-primary:hover { background: var(--accent-dark); border-color: var(--accent-dark); color: #fff; }
.btn-brand { background: var(--brand); border-color: var(--brand); color: #fff; }
.btn-brand:hover { background: var(--brand-dark); border-color: var(--brand-dark); color: #fff; }
.btn-ghost { border-color: transparent; background: transparent; }
.btn-ghost:hover { background: var(--bg-dim); }
.btn-danger { border-color: var(--danger); color: var(--danger); }
.btn-danger:hover { background: var(--danger-bg); color: var(--danger); }
/* 해제·되돌리기처럼 삭제는 아니지만 상태를 거두는 동작 */
.btn-warn { border-color: var(--warning); color: var(--warning); background: var(--warning-bg); }
.btn-warn:hover { border-color: var(--warning); color: var(--warning); background: #fde9cc; }
.btn-sm { padding: 6px 12px; font-size: var(--fs-sm); }
.btn-lg { padding: 14px 28px; font-size: var(--fs-md); }
.btn-block { width: 100%; }
.btn:disabled, .btn.is-disabled { opacity: .5; pointer-events: none; }

/* ---- 관심과정(찜) 버튼 ----
   찜은 개인 상태이므로 숫자를 노출하지 않고 하트 채움 여부로만 표시한다.
   (favorite_count 컬럼은 정렬·기관 통계용으로 계속 유지) */
.fav-btn::before {
  content: '\2661';                 /* 빈 하트 */
  font-size: 1.15em; line-height: 1; color: var(--muted-2); transition: var(--t);
}
.fav-btn:hover::before { color: var(--danger); }
.fav-btn.is-on::before { content: '\2665'; color: var(--danger); }   /* 채운 하트 */
.fav-btn.is-on { border-color: var(--danger); color: var(--danger); background: var(--danger-bg); }
.fav-btn.is-on:hover { border-color: var(--danger); color: var(--danger); background: var(--danger-bg); }
/* 카드용 — 아이콘만. 테두리·배경 없이 하트 색으로만 상태를 표시한다 */
.fav-btn-icon { padding: 6px 10px; gap: 0; }
.fav-btn-icon, .fav-btn-icon:hover,
.fav-btn-icon.is-on, .fav-btn-icon.is-on:hover {
  border-color: transparent; background: none; box-shadow: none;
}

/* ---------- 검색 ---------- */
.search-hero { background: linear-gradient(135deg, var(--brand) 0%, #24518f 55%, var(--accent) 100%); padding: var(--sp-10) 0 var(--sp-12); }
.search-hero h1 { color: #fff; font-size: var(--fs-xl); text-align: center; margin-bottom: var(--sp-2); word-break: keep-all; }
.search-hero .lead { color: rgba(255,255,255,.85); text-align: center; font-size: var(--fs-sm); margin-bottom: var(--sp-6); }

.search-box { background: #fff; border-radius: var(--r-lg); padding: var(--sp-3); box-shadow: var(--sh-md); display: grid; gap: var(--sp-2); }
.search-box .row { display: grid; grid-template-columns: minmax(0,1fr) minmax(0,1fr); gap: var(--sp-2); }
.search-box input[type="search"], .search-box input[type="text"], .search-box select {
  width: 100%; padding: 11px 12px; border: 1px solid var(--line);
  border-radius: var(--r); font-size: var(--fs-base); background: #fff; color: var(--ink);
}
.search-box input:focus, .search-box select:focus { border-color: var(--accent); outline: none; }

/* ---------- 카테고리 그리드 ---------- */
.cat-grid { display: grid; grid-template-columns: repeat(3, minmax(0,1fr)); gap: var(--sp-2); }
.cat-grid a { min-width: 0; word-break: break-word;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 6px;
  padding: var(--sp-4) var(--sp-2); border: 1px solid var(--line); border-radius: var(--r-lg);
  background: #fff; font-size: var(--fs-sm); font-weight: 600; text-align: center;
  min-height: 76px; transition: var(--t);
}
.cat-grid a:hover { border-color: var(--accent); background: var(--accent-soft); color: var(--accent); transform: translateY(-2px); }
.cat-grid .cnt { font-size: var(--fs-xs); color: var(--muted); font-weight: 500; }

/* ---------- 과정 카드 ---------- */
.course-grid { display: grid; grid-template-columns: minmax(0,1fr); gap: var(--sp-4); }

.course-card {
  display: flex; flex-direction: column; overflow: hidden;
  border: 1px solid var(--line); border-radius: var(--r-lg);
  background: #fff; transition: var(--t); height: 100%;
}
.course-card:hover { border-color: var(--accent); box-shadow: var(--sh-md); transform: translateY(-2px); }
.course-card .thumb {
  position: relative; aspect-ratio: 1200/630; background: var(--bg-dim); overflow: hidden;
}
.course-card .thumb img { width: 100%; height: 100%; object-fit: cover; }
.course-card .thumb .ph {
  width: 100%; height: 100%; display: flex; align-items: center; justify-content: center;
  /* 시각적 중심보다 살짝 아래에 배치 (중앙정렬 기준을 밀어내므로 이동량의 2배) */
  padding-top: 16px;
  color: var(--muted-2); font-size: var(--fs-sm); font-weight: 600;
  background: linear-gradient(135deg, var(--bg-dim), var(--brand-light));
}
.course-card .badges { position: absolute; top: 10px; left: 10px; display: flex; gap: 4px; flex-wrap: wrap; }
.course-card .body { padding: var(--sp-4); display: flex; flex-direction: column; gap: 6px; flex: 1; min-width: 0; }
.course-card .org { font-size: var(--fs-xs); color: var(--muted); font-weight: 600; }
.course-card .title {
  font-size: var(--fs-md); font-weight: 700; line-height: 1.4; color: var(--ink);
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
.course-card .meta { font-size: var(--fs-sm); color: var(--muted); display: flex; flex-wrap: wrap; gap: 4px 10px; }
.course-card .foot {
  margin-top: auto; padding-top: var(--sp-3); border-top: 1px solid var(--line-2);
  display: flex; align-items: center; justify-content: space-between; gap: var(--sp-2);
}
.course-card .price { font-weight: 700; color: var(--brand); font-size: var(--fs-base); }
.course-card .price.free { color: var(--success); }

.course-row {
  display: grid; grid-template-columns: 120px minmax(0,1fr); gap: var(--sp-4);
  padding: var(--sp-4) 0; border-bottom: 1px solid var(--line);
}
.course-row .thumb { aspect-ratio: 1/1; border-radius: var(--r); overflow: hidden; background: var(--bg-dim); }

/* ---------- 배지 ---------- */
.badge {
  display: inline-flex; align-items: center; padding: 3px 9px;
  border-radius: var(--r-full); font-size: var(--fs-xs); font-weight: 700; line-height: 1.5;
}
.badge-recruiting { background: var(--success-bg); color: var(--success); }
.badge-closed     { background: var(--bg-dim);     color: var(--muted); }
.badge-pending    { background: var(--warning-bg); color: var(--warning); }
.badge-rejected   { background: var(--danger-bg);  color: var(--danger); }
.badge-new        { background: var(--danger);     color: #fff; }
.badge-online     { background: var(--info-bg);    color: var(--info); }
.badge-offline    { background: #f3e8ff;           color: #7c3aed; }
.badge-blended    { background: #fef9c3;           color: #a16207; }
.badge-support    { background: var(--brand-light);color: var(--brand); }
.badge-solid      { background: rgba(17,24,39,.72);color: #fff; backdrop-filter: blur(4px); }

/* ul 로 감싸지 않아도 ::marker 가 새지 않도록 방어 */
.chip-list, .chip-list > li { list-style: none; }
.chip-list { display: flex; flex-wrap: wrap; gap: var(--sp-2); padding: 0; margin: 0; }
.chip-list a, .chip {
  display: inline-flex; padding: 6px 14px; border: 1px solid var(--line);
  border-radius: var(--r-full); font-size: var(--fs-sm); background: #fff; transition: var(--t);
}
.chip-list a:hover, .chip.is-on { border-color: var(--accent); background: var(--accent-soft); color: var(--accent); }
/* 현재 선택된 탭 — hover 와 확실히 구분되도록 채움 스타일로 처리한다.
   (기존에는 .chip.is-on 만 있어 <a class="is-on"> 에는 아무 스타일도 걸리지 않았다) */
.chip-list a.is-on, .chip-list a.is-on:hover {
  background: var(--accent); border-color: var(--accent); color: #fff; font-weight: 700;
}
.chip-list a.is-on .badge { background: rgba(255,255,255,.28); color: #fff; }

/* ---------- 기관 카드 ---------- */
.org-grid { display: grid; grid-template-columns: minmax(0,1fr); gap: var(--sp-3); }
.org-card {
  display: flex; align-items: center; gap: var(--sp-3);
  padding: var(--sp-4); border: 1px solid var(--line); border-radius: var(--r-lg);
  background: #fff; transition: var(--t);
}
.org-card:hover { border-color: var(--accent); box-shadow: var(--sh); }
.org-card .logo-box {
  width: 48px; height: 48px; flex: none; border-radius: var(--r);
  background: var(--brand-light); color: var(--brand);
  display: flex; align-items: center; justify-content: center; font-weight: 800; font-size: var(--fs-lg);
  overflow: hidden;
}
.org-card .logo-box img { width: 100%; height: 100%; object-fit: cover; }
.org-card > span:last-child { min-width: 0; display: block; }
.org-card .name { font-weight: 700; display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.org-card .desc { font-size: var(--fs-sm); color: var(--muted); display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* ---------- 목록/공지 ---------- */
.list-plain li { border-bottom: 1px solid var(--line-2); }
.list-plain a { display: flex; align-items: center; justify-content: space-between; gap: var(--sp-3); padding: var(--sp-3) 0; }
.list-plain .t { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.list-plain .d { font-size: var(--fs-sm); color: var(--muted-2); flex: none; }

/* ---------- 폼 ---------- */
.form-card {
  border: 1px solid var(--line); border-radius: var(--r-lg);
  padding: var(--sp-6); background: #fff;
}
.field { margin-bottom: var(--sp-4); }
.field > label { display: block; font-weight: 600; font-size: var(--fs-sm); margin-bottom: 6px; }
.field .req { color: var(--danger); margin-left: 2px; }
.field .hint { font-size: var(--fs-xs); color: var(--muted); margin-top: 4px; }
.field .err { font-size: var(--fs-xs); color: var(--danger); margin-top: 4px; }

.input, input[type="text"], input[type="email"], input[type="password"],
input[type="tel"], input[type="url"], input[type="number"], input[type="date"],
input[type="search"], select, textarea {
  width: 100%; padding: 11px 12px;
  border: 1px solid var(--line); border-radius: var(--r);
  font-family: inherit; font-size: var(--fs-base); color: var(--ink); background: #fff;
  transition: var(--t);
}
select { appearance: none; padding-right: 34px;
  background-image: url("data:image/svg+xml;charset=utf8,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%236b7280' stroke-width='2'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 10px center; background-size: 16px;
}
textarea { min-height: 140px; resize: vertical; line-height: 1.7; }
input:focus, select:focus, textarea:focus { border-color: var(--accent); outline: none; box-shadow: 0 0 0 3px var(--accent-soft); }
input:disabled, select:disabled, textarea:disabled { background: var(--bg-dim); color: var(--muted); }
.input-error { border-color: var(--danger) !important; }
.field-row { display: grid; gap: var(--sp-3); }
.field-row > * { min-width: 0; }

.check { display: flex; align-items: flex-start; gap: 8px; font-size: var(--fs-sm); cursor: pointer; }
.check input { width: 18px; height: 18px; flex: none; margin-top: 2px; accent-color: var(--accent); }

/* 항목 수에 맞춰 한 줄로 배치. 폭이 모자라면 자동 줄바꿈되고,
   min(100%, 200px) 이라 아주 좁은 컨테이너에서도 넘치지 않는다. */
.radio-cards {
  display: grid; gap: var(--sp-2);
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 200px), 1fr));
}
.radio-cards label {
  display: flex; align-items: center; gap: 10px; padding: var(--sp-3) var(--sp-4);
  border: 1px solid var(--line); border-radius: var(--r); cursor: pointer; transition: var(--t);
}
.radio-cards label:has(input:checked) { border-color: var(--accent); background: var(--accent-soft); }
.radio-cards input { accent-color: var(--accent); }

/* ---------- 알림 ---------- */
.flash { padding: var(--sp-3) 0; font-size: var(--fs-sm); font-weight: 600; }
.flash-success { background: var(--success-bg); color: var(--success); }
.flash-error   { background: var(--danger-bg);  color: var(--danger); }
.flash-info    { background: var(--info-bg);    color: var(--info); }

.alert { padding: var(--sp-3) var(--sp-4); border-radius: var(--r); font-size: var(--fs-sm); margin-bottom: var(--sp-4); }
.alert-error   { background: var(--danger-bg);  color: var(--danger); }
.alert-info    { background: var(--info-bg);    color: var(--info); }
.alert-warning { background: var(--warning-bg); color: var(--warning); }

/* ---------- 빈 상태 ---------- */
.empty { padding: var(--sp-16) var(--sp-4); text-align: center; color: var(--muted); }
.empty .em { font-size: var(--fs-md); font-weight: 600; color: var(--ink-2); margin-bottom: var(--sp-2); }
.empty .actions { margin-top: var(--sp-5); display: flex; gap: var(--sp-2); justify-content: center; flex-wrap: wrap; }

/* ---------- 페이지네이션 ---------- */
.pagination { display: flex; justify-content: center; gap: 4px; margin: var(--sp-8) 0; flex-wrap: wrap; }
.pagination a, .pagination span {
  min-width: 38px; height: 38px; padding: 0 10px;
  display: inline-flex; align-items: center; justify-content: center;
  border: 1px solid var(--line); border-radius: var(--r); font-size: var(--fs-sm);
}
.pagination a:hover { border-color: var(--accent); color: var(--accent); }
.pagination .is-current { background: var(--accent); border-color: var(--accent); color: #fff; font-weight: 700; }
.pagination .is-disabled { color: var(--muted-2); pointer-events: none; }

/* ---------- 브레드크럼 ---------- */
/* 아래 구역이 padding-top:0 이라 제목이 빵부스러기에 붙는다 → 아래 여백을 준다 */
.breadcrumb { display: flex; flex-wrap: wrap; gap: 6px; font-size: var(--fs-xs); color: var(--muted); padding: var(--sp-3) 0 var(--sp-6); }
.breadcrumb li:not(:last-child)::after { content: "›"; margin-left: 6px; color: var(--muted-2); }
.breadcrumb a:hover { color: var(--accent); }

/* ---------- 상세 ---------- */
.detail-head { padding: var(--sp-6) 0; border-bottom: 1px solid var(--line); }
.detail-head h1 { font-size: var(--fs-xl); margin: var(--sp-2) 0; }
.detail-body { padding: var(--sp-6) 0; }
.detail-body h2 { font-size: var(--fs-lg); margin: var(--sp-8) 0 var(--sp-3); padding-bottom: var(--sp-2); border-bottom: 2px solid var(--brand); }
.detail-body h2:first-child { margin-top: 0; }
/* 바로 뒤에 표가 오는 제목은 밑줄을 빼서 표 상단선과 겹치지 않게 한다 */
.detail-body h2:has(+ .scroll-x) { border-bottom: 0; padding-bottom: 0; }
.detail-body p { margin-bottom: var(--sp-3); }

.info-table { border-top: 2px solid var(--brand); font-size: var(--fs-sm); }
.info-table th, .info-table td { padding: 11px var(--sp-3); border-bottom: 1px solid var(--line); text-align: left; vertical-align: top; }
.info-table th { width: 34%; background: var(--bg-soft); font-weight: 600; color: var(--ink-2); }

.prose { line-height: 1.85; }
.prose p { margin-bottom: var(--sp-4); }
.prose h2, .prose h3 { margin: var(--sp-6) 0 var(--sp-3); }
.prose ul { list-style: disc; padding-left: 20px; margin-bottom: var(--sp-4); }
.prose ol { list-style: decimal; padding-left: 22px; margin-bottom: var(--sp-4); }
.prose li { margin-bottom: 4px; }
.prose img { border-radius: var(--r); margin: var(--sp-4) 0; }
.prose table { margin: var(--sp-4) 0; font-size: var(--fs-sm); }
.prose th, .prose td { border: 1px solid var(--line); padding: 8px 10px; }
.prose th { background: var(--bg-soft); }
.prose a { color: var(--accent); text-decoration: underline; }
.prose blockquote { border-left: 3px solid var(--accent); padding-left: var(--sp-4); color: var(--muted); margin: var(--sp-4) 0; }

/* ---------- FAQ ---------- */
.faq-item { border-bottom: 1px solid var(--line); }
.faq-item > summary {
  padding: var(--sp-4) var(--sp-8) var(--sp-4) 0; font-weight: 600;
  cursor: pointer; list-style: none; position: relative;
}
.faq-item > summary::-webkit-details-marker { display: none; }
.faq-item > summary::after {
  content: "+"; position: absolute; right: 4px; top: 50%; transform: translateY(-50%);
  font-size: var(--fs-lg); color: var(--muted); font-weight: 400;
}
.faq-item[open] > summary::after { content: "−"; }
.faq-item .answer { padding: 0 0 var(--sp-4); color: var(--ink-2); line-height: 1.8; }

/* ---------- 푸터 ---------- */
.site-footer {
  margin-top: var(--sp-16); padding: var(--sp-8) 0 var(--sp-10);
  background: var(--bg-soft); border-top: 1px solid var(--line);
  font-size: var(--fs-sm); color: var(--muted);
}
.footer-links { display: flex; flex-wrap: wrap; gap: var(--sp-3) var(--sp-5); margin-bottom: var(--sp-5); }
.footer-links a { font-weight: 600; color: var(--ink-2); }
.footer-links a:hover { color: var(--accent); }
.footer-info p { margin-bottom: 4px; line-height: 1.7; }
.copyright { margin-top: var(--sp-5); padding-top: var(--sp-4); border-top: 1px solid var(--line); font-size: var(--fs-xs); color: var(--muted-2); }

/* ---------- 에러 페이지 ---------- */
.error-page { text-align: center; }
.error-code { font-size: 64px; font-weight: 800; color: var(--brand-light); line-height: 1; }
.error-page h1 { font-size: var(--fs-xl); margin: var(--sp-3) 0; }
.error-msg { color: var(--muted); }
.error-actions { display: flex; gap: var(--sp-2); justify-content: center; margin: var(--sp-6) 0 var(--sp-10); flex-wrap: wrap; }
.error-suggest h2 { font-size: var(--fs-base); margin-bottom: var(--sp-3); }
.error-suggest .chip-list { justify-content: center; }

/* ---------- 유틸 ---------- */
.tc { text-align: center; } .tr { text-align: right; }
.mt-0{margin-top:0}.mt-2{margin-top:var(--sp-2)}.mt-4{margin-top:var(--sp-4)}
.mt-6{margin-top:var(--sp-6)}.mt-8{margin-top:var(--sp-8)}
.mb-2{margin-bottom:var(--sp-2)}.mb-4{margin-bottom:var(--sp-4)}.mb-6{margin-bottom:var(--sp-6)}
.muted { color: var(--muted); }
.small { font-size: var(--fs-sm); }
.xsmall { font-size: var(--fs-xs); }
.bold { font-weight: 700; }
.flex { display: flex; gap: var(--sp-2); }
.flex-between { display: flex; align-items: center; justify-content: space-between; gap: var(--sp-3); }
.flex-wrap { flex-wrap: wrap; }
.hidden { display: none !important; }
.sr-only {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0;
}
.scroll-x { overflow-x: auto; -webkit-overflow-scrolling: touch; }

/* =====================================================================
   반응형
   ===================================================================== */
@media (min-width: 480px) {
  .cat-grid { grid-template-columns: repeat(4, minmax(0,1fr)); }
  .course-grid { grid-template-columns: repeat(2, minmax(0,1fr)); }
  .field-row { grid-template-columns: minmax(0,1fr) minmax(0,1fr); }
}

@media (min-width: 768px) {
  :root { --fs-base: 15px; --header-h: 68px; }
  .inner { padding: 0 var(--sp-6); }
  .section { padding: var(--sp-12) 0; }
  .section-head h2 { font-size: var(--fs-2xl); }
  .search-hero h1 { font-size: var(--fs-2xl); }
  .search-box { grid-template-columns: 2fr 1fr 1fr auto; align-items: center; }
  .search-box .row { display: contents; }
  .search-box .btn { height: 44px; }
  .cat-grid { grid-template-columns: repeat(5, minmax(0,1fr)); }
  .course-grid { grid-template-columns: repeat(3, minmax(0,1fr)); }
  .org-grid { grid-template-columns: repeat(2, minmax(0,1fr)); }
  .detail-head h1 { font-size: var(--fs-2xl); }
  .page-narrow { padding-top: var(--sp-12); }
  .info-table th { width: 22%; }
  .footer-links { gap: var(--sp-3) var(--sp-8); }
}

@media (min-width: 1024px) {
  .nav-toggle { display: none; }
  .gnb {
    position: static; display: flex !important; align-items: center; gap: var(--sp-6);
    background: none; border: 0; box-shadow: none; padding: 0;
    margin-left: auto; max-height: none; overflow: visible;
  }
  .gnb > ul { display: flex; gap: var(--sp-6); }
  .gnb > ul > li > a { padding: 0; border: 0; font-size: var(--fs-base); }
  .gnb > ul > li > a:hover { color: var(--accent); }

  /* 분야 드롭다운 — 데스크톱은 hover/focus 로 펼친다 */
  .gnb .has-sub { display: block; position: relative; border-bottom: 0; }
  .gnb .has-sub > a { flex: none; }
  .gnb .sub-toggle { display: none; }
  .gnb .sub-menu {
    display: grid; grid-template-columns: repeat(3, minmax(0,1fr)); gap: 0 var(--sp-5);
    position: absolute; top: calc(100% + 14px); left: 50%; transform: translateX(-50%);
    min-width: 540px; padding: var(--sp-4) var(--sp-5); flex-basis: auto;
    background: #fff; border: 1px solid var(--line); border-radius: var(--r-lg);
    box-shadow: var(--sh-md); z-index: 120;
    opacity: 0; visibility: hidden; transition: opacity var(--t), visibility var(--t);
  }
  /* 메뉴와 패널 사이 빈 구간에서 hover 가 끊기지 않도록 다리를 놓는다 */
  .gnb .sub-menu::before { content: ""; position: absolute; left: 0; right: 0; top: -14px; height: 14px; }
  .gnb .has-sub:hover > .sub-menu,
  .gnb .has-sub:focus-within > .sub-menu { opacity: 1; visibility: visible; }
  .gnb .sub-menu a { padding: 6px 0; white-space: nowrap; }
  .gnb-auth { margin-top: 0; }
  .gnb-auth .btn { flex: none; }
  .cat-grid { grid-template-columns: repeat(8, minmax(0,1fr)); }
  .course-grid { grid-template-columns: repeat(4, minmax(0,1fr)); }
  .org-grid { grid-template-columns: repeat(3, minmax(0,1fr)); }
  .main-columns { display: grid; grid-template-columns: minmax(0,1fr) 320px; gap: var(--sp-8); align-items: start; }
  .detail-columns { display: grid; grid-template-columns: minmax(0,1fr) 340px; gap: var(--sp-8); align-items: start; }
  .detail-aside { position: sticky; top: calc(var(--header-h) + var(--sp-4)); }
}

@media (min-width: 1280px) {
  .search-hero { padding: var(--sp-12) 0 var(--sp-16); }
  .search-hero h1 { font-size: var(--fs-3xl); }
}

/* 접근성 — 애니메이션 최소화 */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; transition-duration: .01ms !important; scroll-behavior: auto !important; }
}

/* 인쇄 */
@media print {
  .site-header, .site-footer, .nav-toggle, .btn, .pagination { display: none !important; }
  body { font-size: 11pt; }
}

/* =====================================================================
   마이페이지 / 기업회원
   ===================================================================== */
.mypage-wrap { display: grid; grid-template-columns: minmax(0,1fr); gap: var(--sp-6); padding-bottom: var(--sp-12); }

.mypage-nav {
  border: 1px solid var(--line); border-radius: var(--r-lg); padding: var(--sp-4); background: #fff;
}
.mypage-user { padding-bottom: var(--sp-4); border-bottom: 1px solid var(--line-2); margin-bottom: var(--sp-3); }
.mypage-nav nav ul { display: flex; gap: var(--sp-1); overflow-x: auto; -webkit-overflow-scrolling: touch; }
.mypage-nav nav a {
  display: flex; align-items: center; gap: 6px; padding: 9px 14px;
  border-radius: var(--r); font-size: var(--fs-sm); font-weight: 600;
  color: var(--ink-2); white-space: nowrap;
}
.mypage-nav nav a:hover { background: var(--bg-soft); }
.mypage-nav nav a.is-active { background: var(--accent-soft); color: var(--accent); }

/* 문의 1건처럼 내용이 적어도 본문 영역이 납작해 보이지 않게 최소 높이를 준다 */
.mypage-body { min-height: 420px; }
.mypage-body > h1 { font-size: var(--fs-xl); margin-bottom: var(--sp-2); }
.mypage-body > .lead { color: var(--muted); font-size: var(--fs-sm); margin-bottom: var(--sp-5); }

.data-table { font-size: var(--fs-sm); }
.data-table th, .data-table td { padding: 11px var(--sp-3); border-bottom: 1px solid var(--line); text-align: left; }
.data-table thead th { background: var(--bg-soft); font-weight: 700; border-top: 2px solid var(--brand); white-space: nowrap; }
.data-table tbody tr:hover { background: var(--bg-soft); }
.data-table .num { text-align: right; }
.data-table .ctr { text-align: center; }

.stat-grid { display: grid; grid-template-columns: repeat(2, minmax(0,1fr)); gap: var(--sp-3); }
.stat-card {
  border: 1px solid var(--line); border-radius: var(--r-lg); padding: var(--sp-4); background: #fff;
}
.stat-card .label { font-size: var(--fs-xs); color: var(--muted); }
.stat-card .value { font-size: var(--fs-2xl); font-weight: 800; color: var(--brand); line-height: 1.2; margin-top: 2px; }
.stat-card .sub { font-size: var(--fs-xs); color: var(--muted-2); }

.form-section {
  border: 1px solid var(--line); border-radius: var(--r-lg); padding: var(--sp-5); background: #fff;
  margin-bottom: var(--sp-4);
}
.form-section > h2 {
  font-size: var(--fs-md); padding-bottom: var(--sp-3); margin-bottom: var(--sp-4);
  border-bottom: 1px solid var(--line);
}
.form-actions {
  position: sticky; bottom: 0; background: rgba(255,255,255,.96); backdrop-filter: blur(6px);
  padding: var(--sp-3) 0; border-top: 1px solid var(--line);
  display: flex; gap: var(--sp-2); justify-content: flex-end;
}

.msg-item { padding: var(--sp-4) 0; border-bottom: 1px solid var(--line); }
.msg-item.is-unread { background: var(--accent-soft); margin: 0 calc(var(--sp-4) * -1); padding-left: var(--sp-4); padding-right: var(--sp-4); }

.thumb-preview {
  display: block; max-width: 200px; border: 1px solid var(--line);
  border-radius: var(--r); overflow: hidden; margin-top: var(--sp-2);
}

@media (min-width: 768px) {
  .stat-grid { grid-template-columns: repeat(4, minmax(0,1fr)); }
}
@media (min-width: 1024px) {
  .mypage-wrap { grid-template-columns: 220px minmax(0,1fr); gap: var(--sp-8); align-items: start; }
  .mypage-body { min-height: 560px; }
  .mypage-nav { position: sticky; top: calc(var(--header-h) + var(--sp-4)); }
  .mypage-nav nav ul { flex-direction: column; overflow: visible; }
  .mypage-nav nav a { justify-content: space-between; }
}

/* =====================================================================
   직업적성테스트
   ===================================================================== */

/* ---- 진행률 ---- */
.apt-progress {
  position: sticky; top: var(--header-h); z-index: 20;
  background: rgba(255,255,255,.96); backdrop-filter: blur(6px);
  padding: var(--sp-3) 0; margin-bottom: var(--sp-4);
  border-bottom: 1px solid var(--line);
}
.apt-progress-bar { height: 8px; background: var(--bg-dim); border-radius: var(--r-full); overflow: hidden; }
.apt-progress-bar i { display: block; height: 100%; background: var(--accent); border-radius: var(--r-full); transition: width .25s ease; }

/* ---- 문항 ---- */
.apt-q {
  border: 1px solid var(--line); border-radius: var(--r-lg);
  padding: var(--sp-5); margin: 0 0 var(--sp-3); background: #fff;
  transition: var(--t);
}
.apt-q.is-done { border-color: var(--accent); background: #fbfcff; }
.apt-q > legend {
  font-weight: 600; line-height: 1.55; padding: 0; margin-bottom: var(--sp-4);
  display: block; width: 100%;
}
.apt-q-no {
  display: inline-block; margin-right: 6px; padding: 2px 9px; border-radius: var(--r-full);
  background: var(--brand-light); color: var(--brand); font-size: var(--fs-xs); font-weight: 800;
}
.apt-q.is-done .apt-q-no { background: var(--accent); color: #fff; }

.apt-choices { display: grid; grid-template-columns: minmax(0,1fr); gap: 6px; }
.apt-choices label {
  display: flex; align-items: center; gap: 8px; cursor: pointer;
  padding: 10px 12px; border: 1px solid var(--line); border-radius: var(--r);
  font-size: var(--fs-sm); transition: var(--t); background: #fff;
}
.apt-choices label:hover { border-color: var(--accent); background: var(--accent-soft); }
.apt-choices input { accent-color: var(--accent); width: 17px; height: 17px; flex: none; }
.apt-choices label:has(input:checked) {
  border-color: var(--accent); background: var(--accent-soft); color: var(--accent); font-weight: 700;
}

/* ---- 결과: TOP 3 ---- */
.apt-top { display: grid; grid-template-columns: minmax(0,1fr); gap: var(--sp-3); }
.apt-top-card {
  border: 2px solid var(--line); border-radius: var(--r-lg);
  padding: var(--sp-5); background: #fff; text-align: center;
}
.apt-top-card.is-first { box-shadow: var(--sh-md); }
.apt-rank { font-size: var(--fs-xs); font-weight: 800; color: var(--muted-2); letter-spacing: .08em; }
.apt-name { font-size: var(--fs-lg); font-weight: 800; margin-top: 2px; }
.apt-top-card.is-first .apt-name { font-size: var(--fs-xl); }
.apt-gauge {
  height: 10px; background: var(--bg-dim); border-radius: var(--r-full);
  overflow: hidden; margin: var(--sp-3) 0 6px;
}
.apt-gauge i { display: block; height: 100%; border-radius: var(--r-full); transition: width .6s ease; }
.apt-rate { font-size: var(--fs-xl); font-weight: 800; line-height: 1; }

/* ---- 결과: 전체 분야 ---- */
.apt-row {
  display: grid; grid-template-columns: 96px minmax(0,1fr) 44px;
  align-items: center; gap: var(--sp-2); margin-bottom: 8px; font-size: var(--fs-sm);
}
.apt-row-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: var(--fs-xs); }
.apt-row-bar { height: 12px; background: var(--bg-dim); border-radius: var(--r-full); overflow: hidden; }
.apt-row-bar i { display: block; height: 100%; border-radius: var(--r-full); transition: width .5s ease; }
.apt-row-val { text-align: right; font-size: var(--fs-xs); font-variant-numeric: tabular-nums; }

@media (min-width: 560px) {
  .apt-choices { grid-template-columns: repeat(5, minmax(0,1fr)); }
  .apt-choices label { flex-direction: column; gap: 4px; text-align: center; padding: 10px 4px; font-size: var(--fs-xs); }
}
@media (min-width: 768px) {
  .apt-top { grid-template-columns: repeat(3, minmax(0,1fr)); align-items: start; }
  .apt-row { grid-template-columns: 130px minmax(0,1fr) 50px; }
  .apt-row-name { font-size: var(--fs-sm); }
}

/* 우편번호 찾기 — 입력칸 + 버튼 한 줄 */
.addr-search { display: flex; gap: var(--sp-2); align-items: center; }
.addr-search input { flex: 1; min-width: 0; max-width: 160px; }
.addr-search .btn { flex: none; white-space: nowrap; }
input[readonly] { background: var(--bg-soft); cursor: default; }

/* ---------- 로딩 스피너 / 오버레이 ---------- */
.spinner {
  display: inline-block; width: 34px; height: 34px; flex: none;
  border: 3px solid var(--line);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin .7s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

.loading-overlay {
  position: fixed; inset: 0; z-index: 9998;
  display: flex; align-items: center; justify-content: center;
  background: rgba(17, 24, 39, .45);
}
.loading-card {
  display: flex; flex-direction: column; align-items: center; gap: var(--sp-3);
  min-width: 220px; max-width: 88vw; padding: var(--sp-6) var(--sp-8);
  background: #fff; border-radius: var(--r-lg); box-shadow: var(--sh-lg);
  text-align: center;
}
.loading-text { font-weight: 700; font-size: var(--fs-base); color: var(--ink); }
.loading-sub  { font-size: var(--fs-xs); color: var(--muted); }

/* 애니메이션을 줄이도록 설정한 사용자는 회전 대신 점멸로 표시 */
@media (prefers-reduced-motion: reduce) {
  .spinner { animation: none; border-top-color: var(--accent); opacity: .6; }
}

/* 내 문의 — 작성 원문·답변을 줄바꿈 그대로 보여준다 */
.qna-text { line-height: 1.8; word-break: break-word; overflow-wrap: anywhere; }

/* Q&A 목록 — 제목 줄만 두고 내용·답변은 접는다 */
.qna-item > summary {
  display: flex; align-items: center; gap: 6px;
  list-style: none; padding: 2px 0;
}
.qna-item > summary::-webkit-details-marker { display: none; }
.qna-item > summary::after {
  content: ""; flex: none; width: 7px; height: 7px; margin-left: 2px;
  border-right: 2px solid var(--muted-2); border-bottom: 2px solid var(--muted-2);
  transform: rotate(45deg) translate(-2px, -2px); transition: transform var(--t);
}
.qna-item[open] > summary::after { transform: rotate(-135deg) translate(-2px, -2px); }
.qna-item > summary:hover { color: var(--accent); }
.qna-item > summary:hover::after { border-color: var(--accent); }

/* 랜딩 소개 콘텐츠 — 등록된 경우에만 출력되므로 박스로 구분한다 */
.intro-box {
  padding: var(--sp-5);
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  background: var(--bg-soft);
}
.intro-box > :last-child { margin-bottom: 0; }
