/* didim-cms 기본 스타일. 색은 CSS 변수로, 값은 사이트 설정에서 주입 (base.html). */
:root {
  --color-primary: #1f4e79;
  --color-accent: #e08b00;
  --color-text: #222;
  --color-muted: #6b7280;
  --color-line: #e5e7eb;
  --color-bg: #fff;
  --radius: 6px;
  --max-width: 1080px;
}

* { box-sizing: border-box; }
body {
  margin: 0;
  color: var(--color-text);
  background: var(--color-bg);
  font: 16px/1.7 -apple-system, "Apple SD Gothic Neo", "Malgun Gothic", sans-serif;
}
a { color: var(--color-primary); text-decoration: none; }
a:hover { text-decoration: underline; }
h1 { font-size: 1.6rem; margin: 1.5rem 0 1rem; }
.container { max-width: var(--max-width); margin: 0 auto; padding: 0 16px; }
.lead { font-size: 1.1rem; color: var(--color-muted); }
.muted { color: var(--color-muted); }

.site-header { border-bottom: 1px solid var(--color-line); }
.header-inner { display: flex; align-items: center; justify-content: space-between;
  gap: 16px; min-height: 64px; flex-wrap: wrap; }
.brand { font-weight: 700; font-size: 1.15rem; color: var(--color-primary); }
.brand img { height: 36px; vertical-align: middle; }
.site-nav { display: flex; align-items: center; gap: 14px; font-size: .92rem; }
.nav-user { color: var(--color-muted); }
.inline-form { display: inline; margin: 0; }
.linklike { background: none; border: 0; padding: 0; font: inherit;
  color: var(--color-primary); cursor: pointer; }

main { min-height: 60vh; padding-bottom: 48px; }

.narrow { max-width: 420px; }
.field { display: flex; flex-direction: column; gap: 4px; margin: 0 0 14px; }
.field label { font-size: .9rem; font-weight: 600; }
.field input, .field select, .field textarea {
  padding: 9px 10px; border: 1px solid var(--color-line);
  border-radius: var(--radius); font: inherit; width: 100%;
}
.field input:focus { outline: 2px solid var(--color-primary); outline-offset: 1px; }
.help, .error { font-size: .82rem; }
.help { color: var(--color-muted); }
.error, .errors { color: #b91c1c; }
.errors { margin: 0 0 14px; padding-left: 18px; }

.btn {
  background: var(--color-primary); color: #fff; border: 0;
  padding: 10px 20px; border-radius: var(--radius); font: inherit; cursor: pointer;
}
.btn:hover { filter: brightness(1.1); }
.sub-links { margin-top: 16px; font-size: .9rem; color: var(--color-muted); }
.notice { background: #f3f4f6; border-left: 3px solid var(--color-accent);
  padding: 10px 14px; border-radius: var(--radius); }

.messages { list-style: none; margin: 16px 0; padding: 0; }
.msg { padding: 10px 14px; border-radius: var(--radius); margin-bottom: 8px;
  background: #f3f4f6; }
.msg.success { background: #ecfdf5; }
.msg.error { background: #fef2f2; }

.site-footer { border-top: 1px solid var(--color-line); padding: 24px 0;
  color: var(--color-muted); font-size: .88rem; }
.footer-contact { margin: 6px 0 0; }

@media (max-width: 600px) {
  h1 { font-size: 1.35rem; }
}

/* ---- 게시판 ---- */
.board-head h1 { margin-bottom: .25rem; }
.board-actions { margin: 18px 0; display: flex; gap: 10px; justify-content: flex-end; }
.btn-sm { padding: 7px 14px; font-size: .9rem; }
.btn-plain { display: inline-block; padding: 7px 14px; border: 1px solid var(--color-line);
  border-radius: var(--radius); font-size: .9rem; color: var(--color-text); }
.btn-plain:hover { background: #f9fafb; text-decoration: none; }
.danger, .btn-plain.danger { color: #b91c1c; }
.btn.danger { background: #b91c1c; color: #fff; }

.category-tabs { display: flex; flex-wrap: wrap; gap: 6px; margin: 14px 0; }
.category-tabs a { padding: 5px 12px; border: 1px solid var(--color-line);
  border-radius: 999px; font-size: .88rem; }
.category-tabs a.on { background: var(--color-primary); color: #fff; border-color: var(--color-primary); }

.board-search { display: flex; gap: 8px; margin: 14px 0; justify-content: flex-end; }
.board-search input { padding: 7px 10px; border: 1px solid var(--color-line);
  border-radius: var(--radius); font: inherit; max-width: 240px; }

.board-table { width: 100%; border-collapse: collapse; font-size: .93rem; }
.board-table th, .board-table td { padding: 11px 8px; border-bottom: 1px solid var(--color-line);
  text-align: left; }
.board-table thead th { border-bottom: 2px solid var(--color-primary); font-size: .88rem; }
.board-table .col-num { width: 70px; color: var(--color-muted); }
.board-table .col-author { width: 110px; }
.board-table .col-date { width: 90px; color: var(--color-muted); }
.board-table .col-view { width: 60px; color: var(--color-muted); text-align: right; }
.board-table tr.is-notice { background: #fbfbf7; }
.empty { text-align: center; color: var(--color-muted); padding: 40px 0; }
.tag { display: inline-block; background: var(--color-accent); color: #fff;
  border-radius: 3px; padding: 1px 7px; font-size: .78rem; margin-right: 4px; }
.cat { color: var(--color-muted); font-size: .9em; }
.count { color: var(--color-accent); font-size: .85em; font-weight: 600; }

.notice-list { list-style: none; padding: 0; margin: 0; }
.notice-list li { padding: 14px 0; border-bottom: 1px solid var(--color-line); }
.notice-list .meta, .gallery-card .meta { color: var(--color-muted); font-size: .85rem; }
.excerpt { color: var(--color-muted); font-size: .9rem; margin: 6px 0 0;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.gallery-grid { list-style: none; padding: 0; margin: 0;
  display: grid; grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); gap: 18px; }
.gallery-card .thumb { aspect-ratio: 4 / 3; background: #f3f4f6; border-radius: var(--radius);
  overflow: hidden; display: flex; align-items: center; justify-content: center; }
.gallery-card .thumb img { width: 100%; height: 100%; object-fit: cover; }
.no-thumb { color: var(--color-muted); font-size: .85rem; }
.thumb-title { margin: 8px 0 2px; font-weight: 600; font-size: .95rem; }

.pagination { display: flex; gap: 6px; justify-content: center; margin: 24px 0; font-size: .9rem; }
.pagination a, .pagination .on { padding: 6px 11px; border: 1px solid var(--color-line);
  border-radius: var(--radius); }
.pagination .on { background: var(--color-primary); color: #fff; border-color: var(--color-primary); }

/* 글 보기 */
.post-head { border-bottom: 2px solid var(--color-primary); padding-bottom: 12px; }
.crumb { font-size: .88rem; margin: 0; }
.post-head h1 { margin: .4rem 0; font-size: 1.45rem; }
.post-head .meta { color: var(--color-muted); font-size: .88rem; margin: 0; }
.admin-only { color: #b45309; font-size: .85em; }
.post-body { padding: 24px 0; line-height: 1.8; word-break: break-word; }
.post-body img { max-width: 100%; height: auto; border-radius: var(--radius); }
.post-body h2 { font-size: 1.25rem; margin-top: 1.6em; }
.post-body blockquote { margin: 1em 0; padding: .5em 1em; border-left: 3px solid var(--color-line);
  color: var(--color-muted); }
.post-body pre { background: #f6f8fa; padding: 12px; border-radius: var(--radius); overflow-x: auto; }
.post-body table { border-collapse: collapse; }
.post-body th, .post-body td { border: 1px solid var(--color-line); padding: 6px 10px; }
.attachments { list-style: none; padding: 12px 14px; margin: 0 0 18px;
  background: #f9fafb; border-radius: var(--radius); font-size: .9rem; }
.post-actions, .form-actions { display: flex; gap: 8px; align-items: center;
  padding: 16px 0; border-top: 1px solid var(--color-line); }
.post-nav p { margin: 4px 0; font-size: .9rem; color: var(--color-muted); }

/* 댓글 */
.comments { margin-top: 32px; }
.comments h2 { font-size: 1.05rem; }
.comment-list { list-style: none; padding: 0; margin: 0 0 20px; }
.comment { padding: 12px 0; border-bottom: 1px solid var(--color-line); }
.comment.is-reply { padding-left: 28px; background: #fafafa; }
.comment .meta { margin: 0 0 4px; font-size: .88rem; }
.comment-body { margin: 0; white-space: pre-wrap; }
.comment-actions { margin: 6px 0 0; font-size: .85rem; display: flex; gap: 10px; }
.comment-form { max-width: 640px; }
.reply-target { background: #fffbeb; padding: 6px 10px; border-radius: var(--radius);
  font-size: .85rem; margin-bottom: 8px; }

/* 글쓰기 */
.write-form { max-width: 820px; }
.write-form .field input[type=text], .write-form .field select { max-width: 420px; }
#editor { border: 1px solid var(--color-line); border-radius: var(--radius); }

@media (max-width: 600px) {
  .board-table .col-author, .board-table .col-view { display: none; }
  .board-search { justify-content: stretch; }
  .board-search input { max-width: none; flex: 1; }
}

.main-nav { display: flex; gap: 18px; font-size: .95rem; }
.main-nav a { color: var(--color-text); font-weight: 500; }
.main-nav a:hover { color: var(--color-primary); }


/* ---- 대시보드 ---- */
.dash { display: grid; grid-template-columns: 180px 1fr; gap: 28px; align-items: start;
  margin-top: 20px; }
.dash-nav { position: sticky; top: 16px; border: 1px solid var(--color-line);
  border-radius: var(--radius); padding: 14px; font-size: .92rem; }
.dash-brand { margin: 0 0 10px; font-weight: 700; color: var(--color-primary); }
.dash-nav nav { display: flex; flex-direction: column; gap: 2px; }
.dash-nav nav a { padding: 7px 9px; border-radius: var(--radius); color: var(--color-text); }
.dash-nav nav a:hover { background: #f3f4f6; text-decoration: none; }
.dash-nav nav a.on { background: var(--color-primary); color: #fff; }
.dash-role { margin: 12px 0 0; font-size: .82rem; }
.dash-main { min-width: 0; }
.dash-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.dash-cols { display: grid; grid-template-columns: 1fr 1fr; gap: 24px; }
.dash-cols h2 { font-size: 1rem; border-bottom: 1px solid var(--color-line); padding-bottom: 6px; }

.stat-cards { list-style: none; padding: 0; margin: 20px 0 28px;
  display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 12px; }
.stat-cards li { border: 1px solid var(--color-line); border-radius: var(--radius);
  padding: 14px; display: flex; flex-direction: column; gap: 2px; }
.stat-cards li.warn { border-color: var(--color-accent); background: #fffbeb; }
.stat-cards .num { font-size: 1.8rem; font-weight: 700; color: var(--color-primary); line-height: 1.2; }
.stat-cards .label { font-size: .9rem; }
.stat-cards .sub { font-size: .8rem; }

.plain-list { list-style: none; padding: 0; margin: 0; font-size: .92rem; }
.plain-list li { padding: 7px 0; border-bottom: 1px solid var(--color-line);
  display: flex; justify-content: space-between; gap: 10px; }
.plain-list .muted { font-size: .84rem; white-space: nowrap; }

.dash-table { width: 100%; border-collapse: collapse; font-size: .9rem; margin: 14px 0; }
.dash-table th, .dash-table td { padding: 9px 7px; border-bottom: 1px solid var(--color-line);
  text-align: left; vertical-align: top; }
.dash-table thead th { background: #f9fafb; font-size: .85rem; white-space: nowrap; }
.dash-table tr.off { background: #fafafa; color: var(--color-muted); }
.row-actions { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; white-space: nowrap; }
.row-actions select { font-size: .82rem; padding: 2px 4px; }
.small { font-size: .85rem; }
.memo-form { display: flex; gap: 4px; }
.memo-form input { width: 120px; padding: 3px 6px; border: 1px solid var(--color-line);
  border-radius: 4px; font-size: .82rem; }

.dash-filters { display: flex; flex-wrap: wrap; gap: 8px; align-items: center;
  padding: 12px; background: #f9fafb; border-radius: var(--radius); margin: 14px 0; }
.dash-filters input[type=search], .dash-filters select {
  padding: 6px 9px; border: 1px solid var(--color-line); border-radius: var(--radius);
  font: inherit; font-size: .9rem; }
.inline-label { display: inline-flex; align-items: center; gap: 5px; font-size: .88rem; }

.dash-form { max-width: 620px; }
.formset { border: 1px solid var(--color-line); border-radius: var(--radius);
  padding: 12px 14px; margin: 18px 0; }
.formset legend { font-size: .9rem; font-weight: 600; padding: 0 6px; }
.formset-row { display: flex; flex-wrap: wrap; gap: 12px; padding: 6px 0;
  border-bottom: 1px solid var(--color-line); }
.formset-row input[type=text], .formset-row input[type=number] { width: 140px; padding: 4px 7px;
  border: 1px solid var(--color-line); border-radius: 4px; }

@media (max-width: 860px) {
  .dash { grid-template-columns: 1fr; }
  .dash-nav { position: static; }
  .dash-nav nav { flex-direction: row; flex-wrap: wrap; }
  .dash-cols { grid-template-columns: 1fr; }
  .dash-table { display: block; overflow-x: auto; }
}

.nav-dash { font-weight: 600; color: var(--color-accent); }

/* ---- 메인 페이지 ---- */
.preview-bar { background: #fffbeb; border: 1px solid var(--color-accent);
  border-radius: var(--radius); padding: 10px 14px; margin: 14px 0; font-size: .9rem; }
.banner-slot { border: 1px dashed var(--color-line); border-radius: var(--radius);
  padding: 14px; text-align: center; font-size: .85rem; margin: 14px 0; }

.section-head { display: flex; align-items: baseline; justify-content: space-between;
  border-bottom: 2px solid var(--color-primary); padding-bottom: 6px; margin-top: 28px; }
.section-head h2 { font-size: 1.05rem; margin: 0; }
.section-head .more { font-size: .85rem; }

.main-rows { list-style: none; padding: 0; margin: 10px 0 0; }
.main-rows li { display: flex; justify-content: space-between; gap: 12px;
  padding: 8px 0; border-bottom: 1px solid var(--color-line); font-size: .94rem; }
.main-rows .muted { font-size: .85rem; white-space: nowrap; }

.main-cards { list-style: none; padding: 0; margin: 14px 0 0;
  display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 18px; }
.main-cards.three { grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); }
.main-card strong { display: block; margin: 6px 0 2px; font-size: .98rem; }
.card-thumb { display: block; aspect-ratio: 16/10; background: #f3f4f6; overflow: hidden;
  border-radius: var(--radius); }
.card-thumb.big { aspect-ratio: 16/8; }
.card-thumb img { width: 100%; height: 100%; object-fit: cover; }
.card-summary, .card-meta { margin: 2px 0; font-size: .85rem; }

.main-classic { display: grid; grid-template-columns: 1fr 300px; gap: 28px;
  align-items: start; }
.main-cols { display: grid; grid-template-columns: 1fr 1fr; gap: 24px; }
.main-intro { background: #f9fafb; border-radius: var(--radius); padding: 18px; margin: 20px 0; }
.main-intro h2 { margin-top: 0; font-size: 1.05rem; }

.hero { background: var(--color-primary); color: #fff; border-radius: var(--radius);
  padding: 56px 28px; margin: 20px 0; text-align: center; background-size: cover;
  background-position: center; position: relative; }
.hero.has-image::before { content: ""; position: absolute; inset: 0;
  background: rgba(0, 0, 0, .45); border-radius: var(--radius); }
.hero-inner { position: relative; }
.hero h1 { color: #fff; font-size: 2rem; margin: 0 0 .4em; }
.hero-text { font-size: 1.05rem; margin: 0 0 1.2em; }
.hero .btn { background: #fff; color: var(--color-primary); font-weight: 600; }

.lead-card h2 { margin: 8px 0 4px; font-size: 1.35rem; }
.main-featured { margin-top: 20px; }

/* ---- 문서 페이지 ---- */
.page-doc .page-head { border-bottom: 2px solid var(--color-primary); padding-bottom: 12px; }
.page-doc.wide { max-width: none; }
.page-doc.plain, .page-doc.with_toc { max-width: 820px; }
.with-toc { display: grid; grid-template-columns: 200px 1fr; gap: 28px; align-items: start; }
.toc { position: sticky; top: 16px; border-left: 2px solid var(--color-line);
  padding-left: 14px; font-size: .88rem; }
.toc-title { font-weight: 700; margin: 0 0 6px; }
.toc ul { list-style: none; padding: 0; margin: 0; }
.toc li { padding: 3px 0; }
.toc li.h3 { padding-left: 12px; font-size: .85rem; }
.page-edit { margin-top: 24px; }

/* 상단 메뉴 하위 메뉴 */
.has-sub { position: relative; display: inline-block; }
.submenu { display: none; position: absolute; top: 100%; left: 0; z-index: 20;
  background: #fff; border: 1px solid var(--color-line); border-radius: var(--radius);
  min-width: 140px; padding: 6px 0; box-shadow: 0 6px 18px rgba(0, 0, 0, .08); }
.has-sub:hover .submenu, .has-sub:focus-within .submenu { display: block; }
.submenu a { display: block; padding: 6px 14px; font-size: .9rem; }

/* 메인 스타일 고르기 */
.template-picker { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
  gap: 14px; margin: 18px 0; }
.template-card { border: 1px solid var(--color-line); border-radius: var(--radius);
  padding: 12px; }
.template-card.on { border-color: var(--color-primary); box-shadow: 0 0 0 1px var(--color-primary); }
.template-name { font-weight: 600; margin: 8px 0 2px; }
.template-thumb { background: #f3f4f6; border-radius: 4px; height: 76px; padding: 8px;
  display: grid; gap: 4px; }
.template-thumb span { background: #d1d5db; border-radius: 2px; }
.thumb-classic { grid-template-columns: 1fr 1fr; grid-template-rows: 14px 1fr; }
.thumb-classic span:first-child { grid-column: 1 / -1; }
.thumb-hero { grid-template-rows: 34px 1fr; }
.thumb-hero span:first-child { background: #9ca3af; }
.thumb-magazine { grid-template-columns: 1fr 1fr 1fr; grid-template-rows: 30px 1fr; }
.thumb-magazine span:first-child { grid-column: 1 / -1; background: #9ca3af; }
.slot-name { min-width: 90px; font-size: .9rem; }

@media (max-width: 860px) {
  .main-classic, .main-cols, .with-toc { grid-template-columns: 1fr; }
  .toc { position: static; }
  .hero { padding: 36px 18px; }
  .hero h1 { font-size: 1.5rem; }
}

/* ---- 배너·팝업 ---- */
.banner { margin: 10px 0; }
.banner img { width: 100%; height: auto; border-radius: var(--radius); display: block; }
.banner-text { display: block; background: var(--color-primary); color: #fff;
  padding: 14px 18px; border-radius: var(--radius); text-align: center; font-weight: 600; }
.banner-slot-row { margin: 14px 0; }
.banner-slot-row.banner_side .banner { margin-bottom: 12px; }
.site-footer .banner { max-width: 420px; margin: 0 auto 14px; }

.popup { position: fixed; z-index: 100; background: #fff; border: 1px solid var(--color-line);
  border-radius: var(--radius); box-shadow: 0 10px 30px rgba(0, 0, 0, .18); overflow: hidden;
  max-width: calc(100vw - 32px); }
.popup-center { top: 50%; left: 50%; transform: translate(-50%, -50%); }
.popup-left_top { top: 80px; left: 24px; }
.popup-right_top { top: 80px; right: 24px; }
.popup-body { padding: 16px; overflow: auto; max-height: 70vh; }
.popup-body img { width: 100%; height: auto; display: block; }
.popup-foot { display: flex; align-items: center; justify-content: space-between;
  gap: 10px; padding: 8px 14px; background: #f3f4f6; font-size: .85rem; }
@media (max-width: 600px) {
  .popup.hide-mobile { display: none; }
  .popup { left: 16px; right: 16px; width: auto !important; transform: none; top: 70px; }
}

/* 대시보드 보조 */
.mini-thumb { max-width: 90px; max-height: 40px; border-radius: 3px; vertical-align: middle; }
.backup-run { display: flex; gap: 12px; align-items: center; margin: 16px 0 24px; }
.notice pre { background: #fff; padding: 10px 12px; border-radius: var(--radius);
  overflow-x: auto; font-size: .85rem; }
.notice ol { margin: 8px 0 0 18px; padding: 0; font-size: .9rem; }
.popup-title { margin: 0; padding: 10px 14px; background: var(--color-primary); color: #fff;
  font-weight: 600; font-size: .95rem; }

/* ---- 사이트 설정의 브랜딩 미리보기 ---- */
.brand-preview { display: flex; flex-wrap: wrap; gap: 24px; padding: 14px;
  background: #f9fafb; border-radius: var(--radius); margin-bottom: 16px; }
.brand-item { display: flex; flex-direction: column; gap: 8px; }
.brand-label { margin: 0; font-size: .85rem; font-weight: 600; color: var(--color-muted); }
.brand-box { display: inline-flex; align-items: center; justify-content: center;
  border: 1px solid var(--color-line); border-radius: var(--radius); padding: 8px 12px;
  min-width: 120px; min-height: 52px; background: #fff; }
.brand-box img { max-height: 36px; max-width: 200px; }
.brand-box.dark { background: #1f2937; }
.brand-box.tiny { min-width: 52px; min-height: 52px; padding: 6px; }
.brand-box.tiny img { max-height: 32px; max-width: 32px; }
.brand-box.wide { min-width: 200px; }
.brand-box.wide img { max-height: 110px; max-width: 220px; }
.brand-box.empty { color: var(--color-muted); font-size: .85rem; text-align: center;
  border-style: dashed; }
.fav-tab { display: inline-flex; align-items: center; gap: 6px; background: #e5e7eb;
  border-radius: 8px 8px 0 0; padding: 6px 12px; font-size: .82rem; }
.fav-tab img { width: 16px; height: 16px; }
.color-chip { display: inline-flex; align-items: center; justify-content: center;
  min-width: 82px; height: 34px; border-radius: var(--radius); color: #fff;
  font-size: .78rem; font-family: monospace; }
.dash-form .formset input[type=file] { font-size: .88rem; }

/* ---- 첨부 파일 칸 ---- */
.attach-field { gap: 8px; }
.attach-row { display: flex; align-items: center; gap: 10px; padding: 6px 0;
  border-bottom: 1px dashed var(--color-line); }
.attach-row:last-child { border-bottom: 0; }
.attach-info { font-size: .85rem; white-space: nowrap; }
.attach-info.error { color: #b91c1c; font-weight: 600; }
.attach-actions { display: flex; align-items: center; gap: 12px; margin: 6px 0 0; }
.attach-actions .btn-plain[disabled] { opacity: .45; cursor: not-allowed; }
.attachments li { display: flex; align-items: center; gap: 8px; padding: 3px 0; }

@media (max-width: 600px) {
  .attach-row { flex-wrap: wrap; }
}

/* ---- 아이콘 (Lucide) ---- */
.icon { display: inline-block; vertical-align: -0.15em; flex: none; }
.dash-nav nav a .icon { vertical-align: -0.2em; margin-right: 6px; opacity: .75; }
.dash-nav nav a.on .icon { opacity: 1; }
.count .icon { margin-right: 2px; vertical-align: -0.12em; }
.attachments .icon { color: var(--color-muted); }
.row-actions .icon, .comment-actions .icon { vertical-align: -0.15em; }
.linklike .icon { vertical-align: -0.2em; }
#attach-add .icon { margin-right: 4px; }

/* ---- 글쓰기 폼: 체크박스와 파일 고르기 ---- */
.visually-hidden { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }

.check-row { display: flex; flex-wrap: wrap; gap: 10px; margin: 4px 0 18px; }
.check-label { display: inline-flex; align-items: center; gap: 7px; cursor: pointer;
  padding: 8px 14px; border: 1px solid var(--color-line); border-radius: 999px;
  font-size: .92rem; background: #fff; user-select: none; }
.check-label:hover { background: #f9fafb; }
.check-label input[type=checkbox] { width: 16px; height: 16px; margin: 0; accent-color: var(--color-primary); }
.check-label:has(input:checked) { border-color: var(--color-primary);
  background: #eff5fb; font-weight: 600; }
.check-label:focus-within { outline: 2px solid var(--color-primary); outline-offset: 2px; }

.file-button { display: inline-flex; align-items: center; gap: 6px; cursor: pointer;
  padding: 7px 14px; border: 1px solid var(--color-line); border-radius: var(--radius);
  font-size: .9rem; background: #fff; white-space: nowrap; }
.file-button:hover { background: #f9fafb; }
.file-button:focus-within { outline: 2px solid var(--color-primary); outline-offset: 2px; }
.attach-name { flex: 1; min-width: 0; font-size: .88rem; overflow: hidden;
  text-overflow: ellipsis; white-space: nowrap; }
.attach-name.chosen { color: var(--color-text); }

@media (max-width: 600px) {
  .check-row { gap: 8px; }
  .check-label { padding: 7px 12px; font-size: .88rem; }
  .attach-name { flex: 1 1 100%; }
}

/* 공용 폼의 체크박스: 나란한 것끼리 한 줄에 놓인다 */
.field-check { display: inline-flex; flex-direction: column; gap: 4px;
  margin: 0 8px 14px 0; vertical-align: top; }
.field-check .help { max-width: 260px; white-space: normal; }

/* 메뉴(GNB) 편집 */
.menu-add-buttons { display: flex; gap: 8px; flex-wrap: wrap; }
.menu-table tr.is-child td:first-child { padding-left: 26px; }
.child-mark { margin-right: 4px; }
.menu-form .field[hidden] { display: none !important; }

/* 메뉴 순서 드래그 */
.menu-table .col-grip { width: 30px; padding-right: 0; }
.drag-handle { display: inline-flex; color: var(--color-muted); cursor: grab;
  padding: 4px; border-radius: 3px; touch-action: none; }
.drag-handle:active { cursor: grabbing; }
.menu-table tr:hover .drag-handle { color: var(--color-primary); background: #f3f4f6; }
.menu-table tr.dragging { opacity: .75; }
.menu-table tr.dragging td { background: #eff5fb; }
.reorder-status { min-height: 1.2em; margin: 8px 0 0; }
.reorder-status.error { color: #b91c1c; font-weight: 600; }

/* ---- 헤더 (반응형) ---- */
.header-inner { position: relative; }
.site-menu { display: flex; align-items: center; justify-content: space-between;
  gap: 24px; flex: 1; margin-left: 28px; }
.nav-toggle { display: none; background: none; border: 1px solid var(--color-line);
  border-radius: var(--radius); padding: 7px 9px; cursor: pointer;
  color: var(--color-text); line-height: 0; }
.nav-toggle:hover { background: #f9fafb; }
.nav-toggle .icon { width: 22px; height: 22px; }
.nav-toggle-close { display: none; }
.nav-toggle[aria-expanded="true"] .nav-toggle-open { display: none; }
.nav-toggle[aria-expanded="true"] .nav-toggle-close { display: inline-flex; }

/* 하위 메뉴 펼침 단추: 넓은 화면에서는 방향 표시만 하고 hover 로 연다 */
.sub-toggle { background: none; border: 0; padding: 0 0 0 2px; cursor: pointer;
  color: inherit; line-height: 0; }
.sub-toggle .icon { width: 14px; height: 14px; }
.has-sub.open .submenu { display: block; }

@media (max-width: 900px) {
  .header-inner { min-height: 56px; flex-wrap: nowrap; }
  .nav-toggle { display: inline-flex; align-items: center; }

  /* 헤더 아래로 떨어지는 패널 */
  .site-menu { display: none; position: absolute; top: 100%; left: 0; right: 0; z-index: 30;
    flex-direction: column; align-items: stretch; gap: 0; margin: 0;
    background: #fff; border: 1px solid var(--color-line); border-top: 0;
    border-radius: 0 0 var(--radius) var(--radius);
    box-shadow: 0 10px 24px rgba(0, 0, 0, .08); max-height: 75vh; overflow-y: auto; }
  .site-menu.open { display: flex; }

  .main-nav, .site-nav { flex-direction: column; align-items: stretch; gap: 0;
    font-size: 1rem; }
  .main-nav > a, .has-sub > a, .site-nav > a, .site-nav .nav-user,
  .site-nav .inline-form > .linklike {
    display: block; padding: 13px 18px; border-bottom: 1px solid var(--color-line); }
  .site-nav { border-top: 4px solid #f3f4f6; }
  .site-nav .nav-user { color: var(--color-muted); font-size: .9rem; }
  .site-nav .inline-form { display: block; }
  .site-nav .inline-form > .linklike { width: 100%; text-align: left; }

  /* 하위 메뉴는 눌러서 편다. 상위 링크는 그대로 살아 있다. */
  .has-sub { display: flex; flex-wrap: wrap; align-items: stretch; position: static; }
  .has-sub > a { flex: 1; }
  .sub-toggle { flex: none; width: 52px; border-bottom: 1px solid var(--color-line);
    border-left: 1px solid var(--color-line); display: flex; align-items: center;
    justify-content: center; }
  .sub-toggle .icon { width: 18px; height: 18px; transition: transform .15s; }
  .has-sub.open .sub-toggle .icon { transform: rotate(180deg); }
  .has-sub:hover .submenu { display: none; }   /* 손가락에는 hover 가 없다 */
  .has-sub.open .submenu { display: block; }
  .submenu { position: static; width: 100%; border: 0; border-radius: 0;
    box-shadow: none; background: #f9fafb; padding: 0; }
  .submenu a { padding: 12px 18px 12px 34px; border-bottom: 1px solid var(--color-line);
    font-size: .95rem; }
}

/* ---- 통합 검색 ---- */
.nav-search { display: inline-flex; align-items: center; gap: 5px; }
.nav-search-text { display: none; }

.search-form { display: flex; gap: 8px; margin: 18px 0 24px; max-width: 560px; }
.search-form input { flex: 1; min-width: 0; padding: 10px 12px;
  border: 1px solid var(--color-line); border-radius: var(--radius); font: inherit; }
.search-form input:focus { outline: 2px solid var(--color-primary); outline-offset: 1px; }
.search-form .btn { display: inline-flex; align-items: center; gap: 6px; white-space: nowrap; }

.search-summary { color: var(--color-muted); font-size: .92rem; margin: 0 0 18px; }
.search-group { margin-bottom: 28px; }
.search-group .section-head { margin-top: 0; }
.search-group h2 { display: flex; align-items: baseline; gap: 8px; }
.search-list { list-style: none; padding: 0; margin: 10px 0 0; }
.search-item { padding: 10px 0; border-bottom: 1px solid var(--color-line); }
.search-item > a { font-weight: 500; }
.search-meta { margin: 3px 0 0; font-size: .85rem; }

@media (max-width: 900px) {
  .nav-search { padding: 13px 18px; border-bottom: 1px solid var(--color-line); }
  .nav-search-text { display: inline; }
}

/* ---- SNS 공유 ---- */
.share-buttons { display: flex; flex-wrap: wrap; align-items: center; gap: 8px;
  padding: 14px 0; border-top: 1px solid var(--color-line); }
.share-label { display: inline-flex; align-items: center; gap: 5px; font-size: .88rem;
  margin-right: 4px; }
.share-button { display: inline-flex; align-items: center; gap: 6px; cursor: pointer;
  padding: 7px 12px; border: 1px solid var(--color-line); border-radius: 999px;
  background: #fff; color: var(--color-text); font: inherit; font-size: .88rem; }
.share-button:hover { background: #f9fafb; text-decoration: none; }
.share-button .icon { width: 16px; height: 16px; }
.share-kakaotalk .icon { color: #3c1e1e; }
.share-kakaotalk:hover { background: #fee500; border-color: #fee500; }
.share-facebook .icon { color: #0866ff; }
.share-x .icon { color: #000; }
.share-naver .icon { color: #03c75a; }
.share-line .icon { color: #00c300; }
.share-done { font-size: .85rem; }

/* 인쇄할 때는 공유 단추를 빼고 본문만 */
@media print {
  .share-buttons, .site-header, .site-footer, .post-actions, .post-nav,
  .comments, .banner-slot-row { display: none !important; }
}

/* 대시보드: 체크박스 여러 개 */
.field-checklist ul { list-style: none; padding: 0; margin: 4px 0 0;
  display: flex; flex-wrap: wrap; gap: 8px; }
.field-checklist li label { display: inline-flex; align-items: center; gap: 7px;
  padding: 8px 14px; border: 1px solid var(--color-line); border-radius: 999px;
  font-size: .92rem; cursor: pointer; }
.field-checklist li label:hover { background: #f9fafb; }
.field-checklist input[type=checkbox] { margin: 0; accent-color: var(--color-primary); }
