/* ══════════════════════════════════════════════════════════════════
   맑은클래스 공개 화면 스타일  (index.html · category.html · 404.html)

   ⚠️ 이 파일은 **공개 화면 전용**이다. 관리자(admin.html)와 로그인(login.html)은
   여전히 style.css 를 쓴다. 2026-08-31에 일부러 갈라놓았다 —
   한 파일을 같이 쓰던 시절에 공개 화면을 고치다 관리자 화면이 무너지는 사고가
   두 번 났다(2026-07-21 관리자 헤더 붕괴 / 2026-08-18 인라인으로 회피).
   여기를 아무리 고쳐도 관리자 화면은 영향받지 않는다. 그게 이 파일의 존재 이유다.

   반대 방향도 성립한다: style.css 를 고쳐도 이 화면들은 바뀌지 않는다.
   ══════════════════════════════════════════════════════════════════ */

:root {
  /* A안 팔레트 (2026-08-27 확정) */
  --cyan:   #0eb3d3;
  --cyan-d: #0a8ba5;
  --cyan-l: #e3f6fa;
  --cream:  #fdf7ec;
  --mint:   #eefaf7;
  --ink:    #12303a;
  --ink2:   #3d5a66;
  --mut:    #6d8794;
  --line:   #dbe8ec;
  --line-2: #eef4f6;
  --paper:  #fff;
  --mark:   #fff3bf;

  /* 스티키 검색바가 실제로 차지하는 높이. JS(syncSkOffset)가 실측값으로
     덮어쓴다 — 폰트·줄바꿈이 바뀌면 CSS에 적어둔 값과 어긋나기 때문. */
  --sk-h: 62px;
  --sk-offset: 62px;
}

* { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: 'Noto Sans KR', 'Pretendard', system-ui, 'Malgun Gothic', sans-serif;
  font-size: 15px;
  line-height: 1.65;
  /* 한글은 어절 중간에서 끊으면 읽기 어렵다. 새 제목 요소를 추가할 때도
     이 규칙이 상속되는지 확인할 것. */
  word-break: keep-all;
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3, h4 {
  font-family: 'Gothic A1', 'Noto Sans KR', sans-serif;
  margin: 0;
  letter-spacing: -.02em;
  text-wrap: balance;
}

a { color: inherit; text-decoration: none; }
button, input, select { font-family: inherit; }
button { cursor: pointer; }
img { max-width: 100%; }

:focus-visible {
  outline: 2px solid var(--cyan-d);
  outline-offset: 2px;
}

.wrap { max-width: 1180px; margin: 0 auto; padding: 0 24px; }

.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;
}

/* ── 헤더 ─────────────────────────────────────────────────────────
   category.html · 404.html 도 이 세 클래스(header / .header-inner / .logo)를
   쓴다. 이름을 바꾸려면 templates/ 전체를 grep 해서 함께 고칠 것. */
header {
  background: var(--paper);
  border-bottom: 1px solid var(--line);
}
.header-inner {
  max-width: 1180px;
  margin: 0 auto;
  padding: 0 24px;
  height: 66px;
  display: flex;
  align-items: center;
  gap: 26px;
}
.logo {
  font-family: 'Gothic A1', sans-serif;
  font-weight: 800;
  font-size: 19px;
  letter-spacing: -.03em;
  color: var(--ink);
}
.logo span { color: var(--cyan-d); }
.header-right {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 18px;
  font-size: 13.5px;
  color: var(--ink2);
}
.header-right a:hover { color: var(--cyan-d); }

/* ── 히어로 ───────────────────────────────────────────────────── */
.hero {
  background: linear-gradient(180deg, var(--mint) 0%, #f7fcfb 100%);
  padding: 54px 0 0;
}
.hero-grid {
  display: grid;
  grid-template-columns: 1.05fr .95fr;
  gap: 32px;
  align-items: end;
  padding-bottom: 38px;
}
.hero-eyebrow { font-size: 13px; font-weight: 700; color: var(--cyan-d); margin-bottom: 12px; }
.hero h1 { font-size: 34px; font-weight: 800; line-height: 1.35; margin-bottom: 14px; }
.hero p { color: var(--ink2); font-size: 15.5px; margin: 0 0 24px; max-width: 34ch; }

.search-bar {
  display: flex;
  align-items: center;
  gap: 10px;
  background: var(--paper);
  border: 2px solid var(--cyan);
  border-radius: 999px;
  padding: 6px 6px 6px 20px;
  max-width: 500px;
  box-shadow: 0 8px 26px -14px rgba(14, 179, 211, .6);
}
.search-bar-icon { display: flex; flex: none; color: var(--cyan-d); }
.search-bar input {
  flex: 1; min-width: 0; border: 0; outline: 0; background: none;
  font-size: 15px; color: var(--ink);
}
.search-bar input::placeholder { color: var(--mut); }
.search-bar button {
  border: 0; background: var(--cyan); color: #fff;
  font-weight: 700; font-size: 14px; padding: 11px 24px; border-radius: 999px;
  transition: background .15s;
}
.search-bar button:hover { background: var(--cyan-d); }

.hero-stats {
  display: flex;
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: 14px;
  overflow: hidden;
  margin-top: 26px;
  max-width: 500px;
}
.hero-stat { flex: 1; padding: 13px 18px; border-right: 1px solid var(--line); }
.hero-stat:last-child { border-right: 0; }
.hero-stat strong {
  display: block;
  font-family: 'Gothic A1', sans-serif;
  font-size: 21px; font-weight: 800; color: var(--cyan-d);
  font-variant-numeric: tabular-nums;
}
.hero-stat span { font-size: 12px; color: var(--mut); }

/* 히어로 오른쪽 장식 — 실제 강좌 카드 한 장을 얹는다(지어낸 그림이 아니다) */
.hero-illo { position: relative; height: 258px; }
.hero-blob { position: absolute; border-radius: 50%; }
.hero-peek {
  position: absolute; right: 4px; bottom: 14px; width: 232px;
  background: var(--paper); border: 1px solid var(--line); border-radius: 14px;
  overflow: hidden; box-shadow: 0 16px 34px -20px rgba(18, 48, 58, .6);
}
.hero-peek .peek-body { padding: 10px 12px 13px; }
.hero-peek .peek-title {
  font-size: 12.5px; font-weight: 700; line-height: 1.4;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}

/* ── 분야 관문(대분류 8개) ─────────────────────────────────────
   예전 .cat-bar 를 대신한다. 각 칸은 **진짜 링크**(/category/대분류)다 —
   크롤러가 카테고리 페이지로 들어오는 유일한 통로라 href 를 빼면 안 된다.
   사람이 누르면 아래 드롭다운이 열리고 검색 필터로 이어진다. */
.gates { z-index: 3; margin-top: -28px; }
/* 드롭다운의 위치 기준이 **이 카드**다. .gates 를 기준으로 두면 패널이
   전체폭으로 벌어져 카드보다 넓게 그려진다. */
.gates-card {
  position: relative; z-index: 3;
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: 20px;
  padding: 22px 24px 18px;
  box-shadow: 0 14px 40px -26px rgba(18, 48, 58, .45);
}
.gates-card h2 { font-size: 15px; font-weight: 800; margin-bottom: 16px; }
.gates-card h2 em { font-style: normal; color: var(--cyan-d); }
.gate-row { display: grid; grid-template-columns: repeat(8, 1fr); gap: 8px; }
.gate {
  display: block; text-align: center; padding: 13px 6px 11px;
  border: 0; background: none; border-radius: 12px; transition: background .15s;
  color: inherit;
}
.gate:hover, .gate[aria-expanded="true"] { background: var(--cyan-l); }
.gate .ico {
  width: 46px; height: 46px; margin: 0 auto 9px; border-radius: 14px;
  display: grid; place-items: center; background: var(--cream);
}
.gate svg { width: 23px; height: 23px; stroke: var(--cyan-d); fill: none; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
.gate b { display: block; font-size: 13.5px; font-weight: 700; margin-bottom: 2px; }
.gate .blurb { font-size: 11px; color: var(--mut); line-height: 1.3; display: block; }

/* ── 대분류 드롭다운 패널 ─────────────────────────────────────── */
.cat-panel {
  display: none;
  /* -1px 은 카드 테두리 두께. 패널 바깥선과 카드 바깥선을 정확히 맞춘다. */
  position: absolute; left: -1px; right: -1px; top: calc(100% + 5px);
  z-index: 40;
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: 16px;
  box-shadow: 0 24px 60px -30px rgba(18, 48, 58, .55);
}
.cat-panel.open { display: block; }
.cat-panel-inner { padding: 14px 24px 20px; }
/* 분야 이름은 넣지 않는다(위 관문에 색으로 이미 표시됨). 남는 건 규모 한 줄과
   전체 보기 링크뿐이라 구분선 없이 가볍게 얹는다 — 선을 그으면 패널이
   위와 분리된 독립 상자처럼 보인다. */
.cat-panel-head {
  display: flex; align-items: baseline; gap: 10px; margin-bottom: 10px;
}
.cat-panel-head .count { font-size: 12px; color: var(--mut); white-space: nowrap; }
.cat-panel-head .viewall {
  margin-left: auto; font-size: 12.5px; font-weight: 700; color: var(--cyan-d);
  padding: 5px 11px; border-radius: 20px; background: var(--cyan-l); white-space: nowrap;
}
.cat-panel-grid {
  display: flex; flex-wrap: wrap; align-items: flex-start; gap: 6px 26px;
  max-height: 430px; overflow-y: auto;
}
.cat-col { display: flex; flex-direction: column; width: 190px; flex: 0 0 190px; min-width: 0; }
.cat-col-head {
  display: flex; justify-content: space-between; gap: 8px; align-items: baseline;
  font-size: 13.5px; font-weight: 700; padding: 7px 9px; border-radius: 8px;
  border: 1px solid transparent; margin-bottom: 2px;
}
.cat-col-head:hover { background: var(--cyan-l); border-color: var(--cyan); color: var(--cyan-d); }
.cat-col-head .n { font-size: 11px; font-weight: 600; color: var(--mut); flex: none; }
.cat3-link {
  display: flex; justify-content: space-between; gap: 8px; align-items: baseline;
  font-size: 12.5px; color: var(--ink2); padding: 4px 9px; border-radius: 7px;
}
.cat3-link:hover { background: var(--cyan-l); color: var(--cyan-d); }
.cat3-link .n { font-size: 11px; color: var(--mut); flex: none; font-variant-numeric: tabular-nums; }
.cat-col-empty { padding: 6px 9px; font-size: 12px; color: var(--mut); }

.cat-nav-mobile, .cat-panel-mobile { display: none; }

/* ── 썸네일 ───────────────────────────────────────────────────
   상자를 꽉 채운다(cover). 전체 2,227건 중 97%가 770×539(1.429)라
   이 비율에서는 대부분 한 점도 잘리지 않는다.

   ⚠️ 2026-08-31: 한때 '흐린 배경 + contain'(전체를 담고 남는 자리를 같은
   이미지 흐림으로 메우는 방식)을 썼다가 **되돌렸다.** 잘림은 막았지만
   비율이 다른 이미지에서 위아래에 흐린 띠가 생겨 카드가 지저분해 보였다.
   16:9 계열 소수(약 3%)는 좌우가 조금 잘리는데, 그건 이미지 쪽에서
   개별로 손보기로 했다(사용자 결정). **다시 contain 으로 바꾸지 말 것.** */
.thumb { position: relative; aspect-ratio: 1.429; overflow: hidden; background: #e7ecf1; }
.thumb img {
  position: absolute; inset: 0; width: 100%; height: 100%;
  display: block; object-fit: cover;
}
/* 이미지가 없는 과정(전체의 0.1%)에 쓰는 대체 타일. 깨진 이미지 아이콘 대신
   분야 이름을 크게 보여준다. */
.thumb.is-empty {
  display: grid; place-items: center; background: var(--cream);
  font-family: 'Gothic A1', sans-serif; font-weight: 800; font-size: 15px; color: #c9b48a;
}

/* ── 카드 ─────────────────────────────────────────────────────── */
.grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; }
/* 🔴 카드는 <button> 이다. 버튼은 자기보다 내용이 짧으면 **내용을 위아래
   가운데로 몰아넣는다.** 그리드는 같은 줄 카드 높이를 가장 큰 것에 맞추므로,
   제목이 한 줄인 카드만 썸네일이 11px 내려앉아 혼자 뜬 것처럼 보였다
   (2026-09-01 실측: 카드 348 / 내용 326 → 위 11 · 아래 11).
   → flex 세로 정렬로 바꿔 **위에서부터 쌓고**, 남는 높이는 아래로 보낸다.
   시간·차시 줄은 아예 맨 아래에 붙여 같은 줄끼리 나란히 놓는다. */
.card {
  border: 1px solid var(--line); border-radius: 12px; overflow: hidden;
  background: var(--paper); text-align: left; padding: 0; width: 100%;
  display: flex; flex-direction: column;
  transition: transform .16s, box-shadow .16s;
}
.card:hover { transform: translateY(-3px); box-shadow: 0 16px 34px -22px rgba(18, 48, 58, .5); }
.card > .thumb, .rec-card > .thumb { flex: none; }
.card-body { padding: 12px 13px 13px; flex: 1; display: flex; flex-direction: column; }
.chip-cat {
  display: inline-block; font-size: 10.5px; font-weight: 700; color: var(--cyan-d);
  background: var(--cyan-l); padding: 2px 8px; border-radius: 5px; margin-bottom: 7px;
}
.card-title {
  font-size: 13.5px; font-weight: 700; line-height: 1.45; margin-bottom: 7px;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
.card-title mark { background: var(--mark); border-radius: 2px; padding: 0 1px; color: inherit; }
.card-path {
  font-size: 11.5px; color: var(--mut); margin-bottom: 7px;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.card-meta {
  display: flex; gap: 10px; font-size: 11.5px; color: var(--ink2);
  border-top: 1px solid var(--line); padding-top: 8px; font-variant-numeric: tabular-nums;
  margin-top: auto;   /* 제목 길이와 무관하게 카드 맨 아래 */
}

/* ── 결과 영역 ────────────────────────────────────────────────── */
.results-panel { padding: 44px 0 60px; scroll-margin-top: calc(var(--sk-offset) + 12px); }
.section-head {
  display: flex; align-items: flex-end; justify-content: space-between; gap: 16px;
  margin-bottom: 20px;
}
.section-head h2 { font-size: 23px; font-weight: 800; }
.section-head .sub { font-size: 13.5px; color: var(--mut); font-variant-numeric: tabular-nums; }

/* 검색 모드에서만 펼쳐지는 머리말 + 조건 칩 */
.result-head { display: none; margin-bottom: 20px; }
body.search-mode .result-head { display: block; }
body.search-mode .browse-head { display: none; }
.result-crumb { font-size: 12.5px; color: var(--mut); margin-bottom: 8px; }
.result-title { font-size: 22px; font-weight: 800; margin-bottom: 5px; }
.result-title .rt-q { color: var(--cyan-d); }
.result-title .rt-n { font-variant-numeric: tabular-nums; }
.result-chips { display: flex; gap: 7px; flex-wrap: wrap; margin-top: 12px; }
.result-chips .chip {
  display: inline-flex; align-items: center; gap: 6px;
  font-size: 12.5px; font-weight: 600; background: var(--cyan-l); color: var(--cyan-d);
  padding: 5px 7px 5px 11px; border-radius: 999px;
}
.result-chips .chip-k { font-weight: 500; opacity: .75; }
.result-chips .chip button {
  border: 0; background: none; color: inherit; opacity: .6; font-size: 12px;
  line-height: 1; padding: 2px 4px;
}
.result-chips .chip button:hover { opacity: 1; }
.result-chips .chip-clear {
  border: 0; background: none; font-size: 12.5px; color: var(--mut); padding: 5px 4px;
}
.result-chips .chip-clear:hover { color: var(--ink); text-decoration: underline; }

/* 검색 모드 레이아웃: 왼쪽 좁히기 + 3열 카드 */
.result-layout { display: grid; grid-template-columns: 1fr; gap: 0; }
body.search-mode .result-layout { grid-template-columns: 208px 1fr; gap: 30px; }
.side { display: none; }
body.search-mode .side { display: block; }
.side h4 { font-size: 13px; font-weight: 800; margin: 0 0 9px; }
.side ul { list-style: none; margin: 0 0 22px; padding: 0; }
.side li {
  font-size: 13.5px; color: var(--ink2); padding: 6px 9px; border-radius: 7px;
  display: flex; justify-content: space-between; gap: 8px; cursor: pointer;
}
.side li:hover { background: var(--cyan-l); }
.side li.on { background: var(--cyan-l); color: var(--cyan-d); font-weight: 700; }
.side li .n { font-size: 11.5px; color: var(--mut); font-variant-numeric: tabular-nums; }
.side li.on .n { color: var(--cyan-d); }

.sorts {
  display: none; justify-content: space-between; align-items: center;
  margin-bottom: 14px; font-size: 13px; color: var(--mut);
}
body.search-mode .sorts { display: flex; }
.sorts b { color: var(--ink); font-weight: 600; font-variant-numeric: tabular-nums; }
body.search-mode .grid { grid-template-columns: repeat(3, 1fr); }

/* 검색 모드에서만 카드 페이드인(계단식) */
.grid.fadein > * { animation: cardin .34s ease both; }
@keyframes cardin { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
@media (prefers-reduced-motion: reduce) {
  .grid.fadein > * { animation: none; }
  .card:hover { transform: none; }
}

/* ── 페이지네이션 ─────────────────────────────────────────────── */
.pagination { display: flex; gap: 6px; justify-content: center; padding: 34px 0 0; flex-wrap: wrap; }
.pagination button {
  font-size: 13px; border: 1px solid var(--line); background: var(--paper); color: var(--ink2);
  min-width: 34px; height: 34px; border-radius: 8px; padding: 0 8px;
}
.pagination button:hover:not(:disabled) { border-color: var(--cyan); color: var(--cyan-d); }
.pagination button.active { background: var(--cyan); border-color: var(--cyan); color: #fff; font-weight: 700; }
.pagination button:disabled { opacity: .35; cursor: default; }

/* ── 스켈레톤 ─────────────────────────────────────────────────── */
.sk-card { border: 1px solid var(--line); border-radius: 12px; overflow: hidden; background: var(--paper); }
.sk-card .sk-thumb { aspect-ratio: 1.429; background: var(--line-2); }
.sk-card .sk-lines { padding: 13px; }
.sk-line { height: 11px; border-radius: 4px; margin-bottom: 9px; background: linear-gradient(90deg, #eef2f5 25%, #e2e9ee 37%, #eef2f5 63%); background-size: 400% 100%; animation: shimmer 1.3s linear infinite; }
@keyframes shimmer { from { background-position: 100% 0; } to { background-position: 0 0; } }

/* ── 빈 결과 ─────────────────────────────────────────────────── */
.empty { text-align: center; padding: 60px 20px; }
.empty .empty-ico {
  width: 52px; height: 52px; margin: 0 auto 16px; border-radius: 16px;
  display: grid; place-items: center; background: var(--cyan-l); color: var(--cyan-d);
}
.empty h3 { font-size: 17px; font-weight: 800; margin-bottom: 8px; }
.empty p { color: var(--mut); font-size: 14px; margin: 0 0 24px; }
.empty .icon { font-size: 30px; margin-bottom: 12px; }
.empty-blk { margin-top: 18px; }
.empty-lbl { font-size: 12px; color: var(--mut); margin-bottom: 8px; }
.empty-sugg { display: flex; gap: 7px; justify-content: center; flex-wrap: wrap; }
.empty-sugg button {
  font-size: 13px; padding: 7px 14px; border-radius: 999px;
  border: 1px solid var(--line); background: var(--paper); color: var(--ink2);
}
.empty-sugg button:hover { border-color: var(--cyan); color: var(--cyan-d); background: var(--cyan-l); }

/* ── 스티키 검색바 ────────────────────────────────────────────── */
.sk-bar {
  position: fixed; top: 0; left: 0; right: 0; z-index: 60;
  background: rgba(255, 255, 255, .96);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--line);
  transform: translateY(-104%);
  transition: transform .22s ease;
  box-shadow: 0 8px 24px -18px rgba(18, 48, 58, .8);
}
.sk-bar.is-visible { transform: none; }
.sk-bar-inner {
  display: flex; align-items: center; gap: 12px; min-height: var(--sk-h);
  padding-top: 8px; padding-bottom: 8px; flex-wrap: wrap;
}
.sk-logo { font-family: 'Gothic A1', sans-serif; font-weight: 800; font-size: 16px; flex: none; }
.sk-logo span { color: var(--cyan-d); }
.sk-field {
  flex: 1 1 240px; min-width: 0; display: flex; align-items: center; gap: 8px;
  border: 1px solid var(--line); border-radius: 999px; padding: 7px 14px; background: var(--paper);
}
.sk-field:focus-within { border-color: var(--cyan); box-shadow: 0 0 0 3px var(--cyan-l); }
.sk-field-icon { display: flex; flex: none; color: var(--mut); }
.sk-field input { flex: 1; min-width: 0; border: 0; outline: 0; background: none; font-size: 14px; color: var(--ink); }
.sk-filters { display: flex; align-items: center; gap: 8px; min-width: 0; }
.sk-filters select {
  font-size: 13px; padding: 8px 10px; border-radius: 8px;
  border: 1px solid var(--line); background: var(--paper); color: var(--ink2); max-width: 150px;
}
.sk-filters select:focus { border-color: var(--cyan); outline: none; box-shadow: 0 0 0 3px var(--cyan-l); }
.sk-go { border: 0; background: var(--cyan); color: #fff; font-weight: 700; font-size: 13.5px; padding: 9px 18px; border-radius: 999px; flex: none; }
.sk-go:hover { background: var(--cyan-d); }
.sk-reset { border: 1px solid var(--line); background: var(--paper); color: var(--mut); font-size: 13px; padding: 8px 14px; border-radius: 999px; flex: none; }
.sk-reset:hover { color: var(--ink); border-color: var(--mut); }

/* ── 상세 모달 ───────────────────────────────────────────────── */
.modal-overlay {
  display: none; position: fixed; inset: 0; z-index: 80;
  background: rgba(10, 30, 40, .55); padding: 28px 20px; overflow-y: auto;
}
.modal-overlay.open { display: block; }
.modal {
  max-width: 940px; margin: 0 auto; background: var(--paper);
  border-radius: 18px; overflow: hidden; box-shadow: 0 40px 90px -40px rgba(0, 0, 0, .7);
}
.modal-head { background: var(--mint); padding: 22px 28px 26px; position: relative; border-bottom: 1px solid var(--line); }
.modal-close {
  position: absolute; top: 16px; right: 18px; width: 32px; height: 32px; border-radius: 50%;
  border: 1px solid var(--line); background: var(--paper); color: var(--ink2); font-size: 15px; line-height: 1;
}
.modal-close:hover { background: var(--ink); color: #fff; border-color: var(--ink); }
.modal-crumb { font-size: 12.5px; color: var(--mut); margin-bottom: 12px; padding-right: 40px; }

/* 썸네일은 **원래 비율(1.429)을 지킨다.** 상자를 오른쪽 기둥 높이에 맞춰
   늘이면 cover 라 모든 강좌가 조금씩 잘린다 — 잘림은 비율이 다른 소수에서만
   생기게 두는 것이 이 화면의 원칙이다.
   높이는 반대로 **오른쪽 기둥을 줄여서** 맞춘다(아래 .dfacts 여백). */
.dgrid { display: grid; grid-template-columns: 376px 1fr; gap: 26px; align-items: start; }
.dgrid > div { min-width: 0; }
.dgrid .thumb { border-radius: 14px; border: 1px solid var(--line); }
/* 썸네일 옆 기둥이 그 높이에 들어오도록 제목을 두 줄로 자르고 여백을 조였다 */
.dtitle {
  font-size: 21px; font-weight: 800; line-height: 1.4; margin: 6px 0 9px;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
/* 라벨과 값을 위아래가 아니라 좌우로 — 줄 높이가 절반이 된다 */
.dfacts {
  display: grid; grid-template-columns: repeat(2, 1fr); gap: 1px; background: var(--line);
  border: 1px solid var(--line); border-radius: 10px; overflow: hidden; margin: 0 0 10px;
}
/* 여백을 조인 것은 취향이 아니라 계산이다 — 이 표 3줄에서 18px 을 빼야
   오른쪽 기둥이 왼쪽 썸네일(376px 폭 → 263px 높이)과 나란히 끝난다. */
.dfacts > div {
  background: var(--paper); padding: 5px 13px;
  display: flex; align-items: baseline; justify-content: space-between; gap: 10px;
}
.dfacts dt { font-size: 11.5px; color: var(--mut); margin: 0; flex: none; }
.dfacts dd { margin: 0; font-size: 13.5px; font-weight: 600; text-align: right; font-variant-numeric: tabular-nums; }
.dcta { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.btn-main {
  display: inline-block; background: var(--cyan); color: #fff; border: 0;
  font-weight: 700; font-size: 14.5px; padding: 11px 26px; border-radius: 10px;
}
.btn-main:hover { background: var(--cyan-d); }

.modal-body { padding: 26px 28px 34px; }
.dsec { margin-bottom: 28px; }
.dsec:last-child { margin-bottom: 0; }
.dsec h3 { font-size: 17px; font-weight: 800; margin-bottom: 11px; padding-bottom: 8px; border-bottom: 2px solid var(--ink); }
.dsec p { margin: 0; color: var(--ink2); font-size: 14.5px; line-height: 1.85; white-space: pre-line; }
.dlist { margin: 0; padding: 0; list-style: none; }
.dlist li { position: relative; padding-left: 17px; margin-bottom: 7px; color: var(--ink2); font-size: 14.5px; line-height: 1.7; }
.dlist li::before { content: ""; position: absolute; left: 2px; top: 10px; width: 5px; height: 5px; border-radius: 50%; background: var(--cyan); }

.rec-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; }
.rec-card {
  border: 1px solid var(--line); border-radius: 10px; overflow: hidden;
  background: var(--paper); text-align: left; padding: 0; width: 100%;
  display: flex; flex-direction: column;   /* 위 .card 와 같은 이유 */
}
.rec-card:hover { border-color: var(--cyan); }
.rec-card .rec-body { padding: 9px 11px 11px; }
.rec-title { font-size: 12.5px; font-weight: 600; line-height: 1.42; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.rec-meta { font-size: 11px; color: var(--mut); margin-top: 4px; font-variant-numeric: tabular-nums; }

/* ── 푸터 ─────────────────────────────────────────────────────── */
.site-foot { background: var(--ink); color: #9fc0ca; padding: 30px 0; font-size: 12.5px; }
.site-foot .wrap { display: flex; gap: 16px; align-items: center; flex-wrap: wrap; }
.site-foot .foot-logo { font-family: 'Gothic A1', sans-serif; font-weight: 800; font-size: 15px; color: #fff; }
.site-foot a { color: #cfe6ec; }
.site-foot a:hover { color: #fff; text-decoration: underline; }
.site-foot .foot-right { margin-left: auto; }

/* ── 반응형 ───────────────────────────────────────────────────── */
@media (max-width: 1080px) {
  .grid { grid-template-columns: repeat(3, 1fr); }
  body.search-mode .grid { grid-template-columns: repeat(2, 1fr); }
  .rec-grid { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 900px) {
  .hero-grid { grid-template-columns: 1fr; }
  .hero-illo { display: none; }
  .gate-row { grid-template-columns: repeat(4, 1fr); }
  .dgrid { grid-template-columns: 1fr; }
  body.search-mode .result-layout { grid-template-columns: 1fr; gap: 0; }
  /* 좁은 화면에서 왼쪽 좁히기는 위쪽 가로 목록이 된다 */
  body.search-mode .side { margin-bottom: 20px; }
  .side ul { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 14px; }
  .side li { border: 1px solid var(--line); border-radius: 999px; padding: 5px 12px; }
}

@media (max-width: 720px) {
  .wrap, .header-inner { padding: 0 16px; }
  .hero { padding-top: 34px; }
  .hero h1 { font-size: 26px; }
  .hero-stats { flex-wrap: wrap; }
  .grid, body.search-mode .grid { grid-template-columns: repeat(2, 1fr); }
  /* 좁은 화면에선 8칸 아이콘 행 대신 가로 스크롤 칩 + 인라인 아코디언 */
  .gates { margin-top: -18px; }
  .gates-card { padding: 16px 14px; border-radius: 16px; }
  .gate-row { display: none; }
  .cat-panel { display: none !important; }
  .cat-nav-mobile { display: flex; gap: 7px; overflow-x: auto; padding-bottom: 4px; }
  .cat-chip {
    flex: none; font-size: 13px; font-weight: 600; padding: 7px 14px; border-radius: 999px;
    border: 1px solid var(--line); background: var(--paper); color: var(--ink2); white-space: nowrap;
  }
  .cat-chip[aria-expanded="true"] { background: var(--cyan); border-color: var(--cyan); color: #fff; }
  .cat-panel-mobile { display: none; margin-top: 12px; }
  .cat-panel-mobile.open { display: block; }
  .cat-panel-mobile .cat-panel-inner { padding: 0; }
  .cat-panel-mobile .cat-col { width: 100%; flex: 1 1 100%; }
  .modal-overlay { padding: 0; }
  .modal { border-radius: 0; min-height: 100vh; }
  .modal-head, .modal-body { padding-left: 18px; padding-right: 18px; }
  .rec-grid { grid-template-columns: repeat(2, 1fr); }
  .site-foot .foot-right { margin-left: 0; }
}

@media (max-width: 420px) {
  .grid, body.search-mode .grid { grid-template-columns: 1fr; }
}
