/* 딴지거는 노동조합 홈페이지
   로고에서 가져온 디자인 원칙
   - 굵은 검정 테두리와 둥근 모서리
   - 뒤에 겹친 회색 D → 회색 그림자(--shadow-grey)
   - 빨간 깃발 → 강조색은 빨강 하나만 */
:root {
  --bg: #f4f4f2;
  --surface: #ffffff;
  --surface-2: #f7f7f5;
  --ink: #111111;
  --ink-2: #3a3a3a;
  --muted: #6b6b6b;
  --line: #e2e2de;
  --line-strong: #c9c9c4;
  --grey: #c0c0c0;            /* 로고의 회색 D */
  --accent: #e60000;          /* 깃발 빨강 (흰 글자 대비 4.8:1) */
  --accent-dark: #b80000;
  --accent-soft: #fff0ef;
  --flag: #ff1a1a;            /* 장식용 밝은 빨강 */
  --dark: #111111;
  --ok: #17703f;
  --ok-soft: #e6f4ec;
  --warn: #855a00;
  --warn-soft: #fdf3da;
  --info: #24467a;
  --info-soft: #edf2f9;
  --link: #1a56c4;
  --radius: 14px;
  --radius-sm: 10px;
  --stroke: 2px solid var(--ink);
  --shadow-grey: 6px 6px 0 var(--grey);
  --shadow-ink: 3px 3px 0 var(--ink);
  --wrap: 1160px;
  --header-h: 72px;
}

*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }

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

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font: 16px/1.65 "Pretendard", -apple-system, BlinkMacSystemFont, "Apple SD Gothic Neo", "Malgun Gothic", "맑은 고딕", "Noto Sans KR", sans-serif;
  word-break: keep-all;
  overflow-wrap: anywhere;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

main { flex: 1; }
a { color: inherit; }
img { max-width: 100%; }
h1, h2, h3 { letter-spacing: -0.025em; line-height: 1.3; font-weight: 800; }
:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; }

.wrap { width: 100%; max-width: var(--wrap); margin: 0 auto; padding: 0 16px; }
.muted { color: var(--muted); }
.small { font-size: 13px; }
.nowrap { white-space: nowrap; }
.right { text-align: right; }
.optional { color: var(--muted); font-weight: 500; font-size: 13px; }

.skip { position: absolute; left: -9999px; }
.skip:focus { left: 16px; top: 8px; z-index: 100; background: #fff; padding: 8px 12px; border: var(--stroke); border-radius: 8px; }

/* ---------- 머리글 ---------- */
.site-header {
  background: var(--surface);
  border-bottom: 3px solid var(--ink);
  position: sticky;
  top: 0;
  z-index: 30;
}
.header-inner { display: flex; align-items: center; gap: 32px; height: var(--header-h); position: relative; }
.logo { display: flex; align-items: flex-end; gap: 10px; text-decoration: none; flex-shrink: 0; padding-bottom: 2px; }
.logo-mark { height: 48px; width: auto; display: block; }
.logo-word { height: 21px; width: auto; display: block; margin-bottom: 7px; }
.site-nav { flex: 1; display: flex; align-items: center; justify-content: space-between; gap: 16px; align-self: stretch; }
.menu { list-style: none; margin: 0; padding: 0; display: flex; gap: 4px; flex-wrap: wrap; align-self: stretch; }
.menu li { display: flex; }
.menu a {
  position: relative; display: flex; align-items: center; padding: 0 12px;
  text-decoration: none; font-weight: 750; color: var(--ink); white-space: nowrap;
}
.menu a::after {
  content: ''; position: absolute; left: 12px; right: 12px; bottom: -3px; height: 5px;
  background: var(--accent); border-radius: 3px 3px 0 0;
  transform: scaleX(0); transition: transform .15s ease;
}
.menu a:hover { color: var(--accent); }
.menu a.active::after, .menu a:hover::after { transform: scaleX(1); }
.tag {
  display: inline-block; margin-left: 6px; padding: 0 6px;
  font-size: 11px; font-weight: 700; line-height: 18px;
  border: 1.5px solid var(--line-strong); border-radius: 5px; color: var(--muted);
}
.user-menu { display: flex; align-items: center; gap: 14px; font-size: 14.5px; white-space: nowrap; }
.user-menu a:not(.btn) { text-decoration: none; color: var(--ink-2); font-weight: 600; }
.user-menu a:not(.btn):hover { color: var(--accent); }
.me-name { font-weight: 800; }
.admin-link { color: var(--accent) !important; font-weight: 800 !important; }
.nav-toggle {
  display: none; margin-left: auto;
  background: var(--surface); border: var(--stroke); border-radius: var(--radius-sm);
  padding: 7px 14px; font: inherit; font-size: 14px; font-weight: 800; cursor: pointer;
  box-shadow: 2px 2px 0 var(--ink);
}
.nav-toggle[aria-expanded="true"] { background: var(--ink); color: #fff; }

@media (max-width: 960px) {
  :root { --header-h: 62px; }
  .logo-mark { height: 42px; }
  .logo-word { height: 18px; margin-bottom: 6px; }
  .nav-toggle { display: block; }
  .site-nav {
    display: none;
    position: absolute; top: calc(var(--header-h) + 3px); left: 0; right: 0;
    background: var(--surface); border-bottom: 3px solid var(--ink);
    flex-direction: column; align-items: stretch; padding: 8px 16px 16px;
  }
  .site-nav.open { display: flex; }
  .menu { flex-direction: column; gap: 0; }
  .menu li { display: block; }
  .menu a { padding: 12px 4px; border-bottom: 1px solid var(--line); }
  .menu a::after { left: 0; right: auto; top: 12px; bottom: 12px; width: 5px; height: auto; border-radius: 0 3px 3px 0; transform: scaleY(0); }
  .menu a.active { padding-left: 14px; }
  .menu a.active::after, .menu a:hover::after { transform: scaleY(1); }
  .user-menu { flex-wrap: wrap; padding-top: 14px; }
}
@media (max-width: 380px) {
  .logo-word { height: 15px; }
  .logo-mark { height: 38px; }
}

/* ---------- 버튼·폼 ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  padding: 10px 20px; border-radius: var(--radius-sm);
  border: var(--stroke); background: var(--accent); color: #fff;
  font: inherit; font-weight: 800; font-size: 15px; line-height: 1.2;
  text-decoration: none; cursor: pointer; white-space: nowrap;
  box-shadow: var(--shadow-ink);
  transition: transform .08s ease, box-shadow .08s ease, background-color .15s;
}
.btn:hover { background: var(--accent-dark); transform: translate(-1px, -1px); box-shadow: 4px 4px 0 var(--ink); }
.btn:active { transform: translate(2px, 2px); box-shadow: 1px 1px 0 var(--ink); }
.btn-ghost { background: var(--surface); color: var(--ink); }
.btn-ghost:hover { background: var(--surface-2); }
.btn-danger { background: var(--surface); color: var(--accent); border-color: var(--accent); box-shadow: 3px 3px 0 var(--accent); }
.btn-danger:hover { background: var(--accent-soft); box-shadow: 4px 4px 0 var(--accent); }
.btn-danger:active { box-shadow: 1px 1px 0 var(--accent); }
.btn-sm { padding: 5px 12px; font-size: 13.5px; box-shadow: 2px 2px 0 var(--ink); }
.btn-sm.btn-danger { box-shadow: 2px 2px 0 var(--accent); }
.btn-lg { padding: 13px 26px; font-size: 17px; }
.btn-block { width: 100%; padding: 13px 18px; }
.link-btn { background: none; border: 0; padding: 0; font: inherit; color: var(--ink-2); cursor: pointer; font-weight: 600; }
.link-btn:hover { color: var(--accent); text-decoration: underline; }
.link-btn.danger { color: var(--accent); }
form.inline { display: inline; }

.field { margin-bottom: 18px; }
.field > label { display: block; font-weight: 800; margin-bottom: 6px; font-size: 14.5px; }
.hint { font-size: 13px; color: var(--muted); margin: 6px 0 0; }

input[type=text], input[type=email], input[type=password], input[type=tel],
input[type=number], input[type=url], input[type=date], select, textarea {
  width: 100%; padding: 10px 12px;
  border: 2px solid var(--line-strong); border-radius: var(--radius-sm);
  font: inherit; font-size: 15.5px; background: #fff; color: var(--ink);
  transition: border-color .15s, box-shadow .15s;
}
input[type=file] { font: inherit; font-size: 14px; max-width: 100%; }
input:hover, select:hover, textarea:hover { border-color: #a9a9a4; }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--ink); box-shadow: 0 0 0 3px rgba(230, 0, 0, .18); }
textarea { min-height: 340px; resize: vertical; line-height: 1.7; }
textarea.short { min-height: 110px; }
.code-input { font-size: 26px !important; letter-spacing: .4em; text-align: center; font-variant-numeric: tabular-nums; }
.check { display: inline-flex; gap: 8px; align-items: center; font-weight: 600; cursor: pointer; }
.check input { width: 18px; height: 18px; accent-color: var(--accent); }
.checks { display: flex; gap: 8px 22px; flex-wrap: wrap; margin-bottom: 14px; }
.form-actions { display: flex; gap: 10px; justify-content: flex-end; flex-wrap: wrap; }
.form-links { margin: 18px 0 0; text-align: center; font-size: 14.5px; color: var(--muted); display: flex; gap: 8px; justify-content: center; align-items: center; flex-wrap: wrap; }
.form-links a { color: var(--ink-2); font-weight: 600; }
.actions-row { display: flex; gap: 10px; flex-wrap: wrap; }
.inline-form { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.inline-form select { width: auto; min-width: 180px; }
.inline-form p { margin: 0; flex-basis: 100%; }

.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 0 14px; }
.grid-3 { display: grid; grid-template-columns: 2fr 1fr 1fr; gap: 0 14px; }
.grid-4 { display: grid; grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr) minmax(0, 1fr) minmax(0, .6fr); gap: 0 14px; }

/* ---------- 알림 ---------- */
.flash-wrap { padding-top: 18px; }
.flash, .alert { padding: 12px 16px; border-radius: var(--radius-sm); margin-bottom: 12px; font-size: 15px; border: 2px solid transparent; font-weight: 600; }
.alert p { margin: 0 0 8px; }
.flash-success, .alert-success { background: var(--ok-soft); color: var(--ok); border-color: #b7dcc6; }
.flash-error, .alert-error { background: var(--accent-soft); color: var(--accent-dark); border-color: #f3c1be; }
.flash-info, .alert-info { background: var(--info-soft); color: var(--info); border-color: #cfdbee; }
.alert-warn { background: var(--warn-soft); color: var(--warn); border-color: #eed9a2; }
.suggest-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.anon-notice {
  background: var(--ink); color: #d6d6d6;
  border-radius: var(--radius); padding: 14px 18px 14px 22px; margin-bottom: 20px; font-size: 14.5px;
  border-left: 8px solid var(--accent);
}
.anon-notice strong { color: #fff; display: block; margin-bottom: 2px; }

/* ---------- 홈 ---------- */
.hero { position: relative; background: var(--ink); color: #fff; overflow: hidden; border-bottom: 3px solid var(--ink); }
.slide { position: relative; display: none; height: clamp(300px, 46vw, 560px); }
.slide.is-active { display: block; animation: fade .6s ease; }
@keyframes fade { from { opacity: .3; } to { opacity: 1; } }
.slide img { width: 100%; height: 100%; object-fit: cover; display: block; }
.slide-caption {
  position: absolute; inset: 0; display: flex; align-items: flex-end; padding-bottom: 60px;
  background: linear-gradient(90deg, rgba(0, 0, 0, .7) 0%, rgba(0, 0, 0, .25) 60%, rgba(0, 0, 0, 0) 100%);
}
.slide-caption h2 { font-size: clamp(28px, 4.2vw, 50px); margin: 0 0 10px; max-width: 780px; letter-spacing: -0.035em; font-weight: 900; }
.slide-caption h2::before { content: ''; display: block; width: 56px; height: 8px; background: var(--flag); border-radius: 2px; margin-bottom: 16px; transform: skewY(-6deg); }
.slide-caption p { margin: 0 0 20px; font-size: clamp(15px, 1.7vw, 19px); opacity: .92; max-width: 640px; }
.slide-caption .btn { background: #fff; color: var(--ink); box-shadow: 3px 3px 0 var(--accent); }
.slide-caption .btn:hover { background: #fff; box-shadow: 5px 5px 0 var(--accent); }
.slider-dots { position: absolute; bottom: 22px; left: 50%; transform: translateX(-50%); display: flex; gap: 8px; z-index: 2; }
.slider-dots button { width: 10px; height: 10px; border-radius: 5px; border: 0; padding: 0; background: rgba(255, 255, 255, .55); cursor: pointer; transition: width .2s; }
.slider-dots button[aria-current="true"] { background: var(--flag); width: 30px; }
.slider-arrow {
  position: absolute; top: 50%; transform: translateY(-50%); z-index: 2;
  width: 46px; height: 46px; border-radius: 50%; border: 2px solid #fff;
  background: rgba(0, 0, 0, .35); color: #fff; font-size: 26px; line-height: 1; cursor: pointer;
}
.slider-arrow:hover { background: var(--accent); border-color: var(--accent); }
.slider-prev { left: 16px; }
.slider-next { right: 16px; }

/* 사진이 없을 때의 기본 첫 화면 */
.hero-empty {
  background-color: var(--surface);
  background-image: radial-gradient(#dcdcd8 1.2px, transparent 1.2px);
  background-size: 18px 18px;
  color: var(--ink);
}
.hero-default {
  display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center; gap: 40px;
  padding-top: clamp(48px, 7vw, 88px); padding-bottom: clamp(48px, 7vw, 88px);
}
.hero-copy h1 { font-size: clamp(38px, 6.4vw, 76px); margin: 0 0 16px; letter-spacing: -0.045em; font-weight: 900; line-height: 1.12; }
.hero-copy h1::before { content: ''; display: block; width: 64px; height: 10px; background: var(--flag); border-radius: 2px; margin-bottom: 22px; transform: skewY(-6deg); }
.hero-tagline { font-size: clamp(17px, 2vw, 22px); color: var(--ink-2); margin: 0 0 28px; max-width: 560px; font-weight: 600; }
.hero-actions { display: flex; gap: 12px; flex-wrap: wrap; }
.hero-mark { width: clamp(180px, 26vw, 320px); height: auto; display: block; filter: drop-shadow(10px 10px 0 rgba(0, 0, 0, .08)); }

.section { padding: 56px 0 8px; }
.section-tight { padding-top: 28px; }
.intro { display: grid; grid-template-columns: 240px 1fr; gap: 32px; }
.intro h2 { margin: 0; font-size: 26px; }
.intro h2::before { content: ''; display: block; width: 34px; height: 7px; background: var(--flag); border-radius: 2px; margin-bottom: 14px; transform: skewY(-6deg); }
.intro-body { font-size: 17px; color: var(--ink-2); line-height: 1.9; }

.home-boards { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 24px; }
.card { background: var(--surface); border: var(--stroke); border-radius: var(--radius); padding: 20px 22px 14px; box-shadow: var(--shadow-grey); }
.card-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 4px; padding-bottom: 12px; border-bottom: 3px solid var(--ink); }
.card-head h3 { margin: 0; font-size: 19px; }
.more { font-size: 13.5px; color: var(--muted); text-decoration: none; font-weight: 700; }
.more::after { content: ' →'; }
.more:hover { color: var(--accent); }
.latest { list-style: none; margin: 0; padding: 0; }
.latest li { display: flex; justify-content: space-between; gap: 12px; padding: 10px 0; border-top: 1px solid var(--line); }
.latest li:first-child { border-top: 0; }
.latest a { text-decoration: none; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; font-weight: 600; }
.latest a:hover { color: var(--accent); }
.latest time { color: var(--muted); font-size: 13px; flex-shrink: 0; font-variant-numeric: tabular-nums; }
.locked { color: var(--muted); padding: 26px 0 14px; text-align: center; margin: 0; }
.locked a { color: var(--accent); font-weight: 800; }

.banner-wide { display: grid; gap: 16px; }
.banner-wide img { width: 100%; display: block; border-radius: var(--radius); border: var(--stroke); }
.banner-small { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 12px; padding-bottom: 32px; }
.banner-small a, .banner-small span { display: block; background: var(--surface); border: 2px solid var(--line-strong); border-radius: var(--radius-sm); padding: 10px; transition: border-color .15s, transform .1s; }
.banner-small a:hover { border-color: var(--ink); transform: translateY(-2px); }
.banner-small img { width: 100%; height: 56px; object-fit: contain; display: block; }

/* ---------- 공통 페이지 ---------- */
.page { padding-top: 44px; padding-bottom: 80px; }
.page-narrow { max-width: 540px; }
.page-mid { max-width: 880px; }
.page-head { margin-bottom: 24px; }
.page-head h1 { margin: 0 0 4px; font-size: 30px; display: flex; align-items: center; gap: 10px; flex-wrap: wrap; letter-spacing: -0.035em; }
.page-head p { margin: 0; }
.panel { background: var(--surface); border: var(--stroke); border-radius: var(--radius); padding: 26px; margin-bottom: 20px; box-shadow: var(--shadow-grey); }
.panel > :last-child { margin-bottom: 0; }
.panel-title { font-size: 18px; margin: 0 0 18px; }
.crumb { margin: 0 0 6px; font-size: 14px; }
.crumb a { color: var(--accent); text-decoration: none; font-weight: 800; }

.steps { display: flex; gap: 6px; list-style: none; padding: 0; margin: 0 0 18px; font-size: 13px; }
.steps li { flex: 1; text-align: center; padding: 8px 4px; border-radius: 8px; background: #e7e7e3; color: var(--muted); font-weight: 800; border: 2px solid transparent; }
.steps li.on { background: var(--accent); color: #fff; border-color: var(--ink); }
.steps li.done { background: var(--surface); color: var(--ink); border-color: var(--ink); }
.terms { background: var(--surface-2); border: 1.5px solid var(--line-strong); border-radius: var(--radius-sm); padding: 12px 14px; font-size: 13.5px; color: var(--ink-2); margin-bottom: 10px; }
.terms ul { margin: 6px 0 0; padding-left: 18px; }

.error-page { text-align: center; padding-top: 72px; }
.error-page::before { content: ''; display: block; width: 96px; height: 109px; margin: 0 auto 18px; background: url("/img/logo-mark.png") center / contain no-repeat; }
.error-code { font-size: 72px; font-weight: 900; color: var(--accent); margin: 0; line-height: 1; letter-spacing: -0.04em; }
.error-page h1 { font-size: 22px; margin: 12px 0 26px; }
.error-page .actions-row { justify-content: center; }

/* ---------- 게시판 ---------- */
.board-tools { display: flex; justify-content: space-between; gap: 12px; margin-bottom: 14px; flex-wrap: wrap; }
.search { display: flex; gap: 8px; flex: 1; max-width: 400px; }
.search-wide { max-width: 500px; margin-bottom: 14px; }
.post-list { list-style: none; margin: 0; padding: 0; background: var(--surface); border: var(--stroke); border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow-grey); }
.post-list li { border-top: 1px solid var(--line); }
.post-list li:first-child { border-top: 0; }
.post-list a { display: flex; align-items: center; gap: 16px; padding: 15px 20px; text-decoration: none; }
.post-list a:hover { background: var(--surface-2); }
.post-list a:hover .post-title { color: var(--accent); }
.post-list li.pinned { background: var(--accent-soft); }
.post-title { flex: 1; min-width: 0; font-weight: 700; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cc { color: var(--accent); font-size: 13px; margin-left: 5px; font-weight: 800; }
.pin { display: inline-block; font-size: 12px; font-weight: 800; background: var(--accent); color: #fff; border-radius: 5px; padding: 0 7px; margin-right: 8px; vertical-align: 2px; line-height: 20px; }
.post-meta { display: flex; gap: 14px; color: var(--muted); font-size: 13px; flex-shrink: 0; font-variant-numeric: tabular-nums; }
.empty { padding: 52px 16px; text-align: center; color: var(--muted); margin: 0; }
.pager { display: flex; justify-content: center; gap: 6px; margin-top: 28px; flex-wrap: wrap; }
.pager a { min-width: 38px; padding: 6px 10px; text-align: center; border-radius: 8px; text-decoration: none; color: var(--ink-2); border: 2px solid transparent; font-weight: 700; }
.pager a:hover { background: var(--surface); border-color: var(--line-strong); }
.pager a.current { border-color: var(--ink); color: #fff; background: var(--ink); }

.post { background: var(--surface); border: var(--stroke); border-radius: var(--radius); box-shadow: var(--shadow-grey); }
.post-head { padding: 26px 30px 18px; border-bottom: 3px solid var(--ink); }
.post-head h1 { margin: 0 0 10px; font-size: 26px; letter-spacing: -0.035em; }
.meta { color: var(--muted); font-size: 14px; display: flex; gap: 6px 14px; flex-wrap: wrap; }
.post-body { padding: 30px; min-height: 180px; font-size: 16.5px; line-height: 1.9; overflow-wrap: anywhere; }
.post-body a, .comment-body a, .intro-body a { color: var(--link); }
/* 서식도구로 쓴 글 */
.post-body p { margin: 0 0 .5em; }
.post-body h2, .post-body h3 { margin: 1.1em 0 .45em; font-size: 1.22em; font-weight: 800; line-height: 1.45; letter-spacing: -0.02em; }
.post-body h2 { font-size: 1.36em; }
.post-body ul, .post-body ol { margin: 0 0 .7em; padding-left: 1.6em; }
.post-body blockquote { margin: 0 0 .8em; padding: .5em 1em; border-left: 4px solid var(--accent); background: var(--surface-2); color: var(--ink-2); }
.post-body blockquote p:last-child { margin-bottom: 0; }
.post-body blockquote + blockquote { margin-top: -.8em; } /* 이어진 인용은 한 덩어리로 */
.post-body img { display: block; max-width: 100%; height: auto; margin: .7em 0; border-radius: 6px; }
.post-body > :first-child { margin-top: 0; }
.post-body > :last-child { margin-bottom: 0; }

/* 글쓰기 서식도구 */
.rich-editor { border: 2px solid var(--line-strong); border-radius: var(--radius-sm); background: var(--surface); }
.rich-editor:focus-within { border-color: var(--ink); box-shadow: 0 0 0 3px rgba(230, 0, 0, .18); }
.rich-toolbar {
  position: sticky; top: calc(var(--header-h) + 3px); z-index: 2;
  display: flex; flex-wrap: wrap; align-items: center; gap: 4px; padding: 6px;
  background: var(--surface-2); border-bottom: 1.5px solid var(--line); border-radius: var(--radius-sm) var(--radius-sm) 0 0;
}
.rich-toolbar button {
  min-width: 36px; height: 34px; padding: 0 10px; border: 1.5px solid transparent; border-radius: 8px;
  background: none; color: var(--ink); font: inherit; font-size: 14px; font-weight: 700; cursor: pointer; white-space: nowrap;
}
.rich-toolbar button:hover { background: var(--surface); border-color: var(--line-strong); }
.rich-toolbar button[aria-pressed="true"] { background: var(--ink); border-color: var(--ink); color: #fff; }
.rich-toolbar .rich-photo { border-color: var(--ink); background: var(--surface); }
.rich-sep { width: 1.5px; height: 22px; background: var(--line-strong); margin: 0 4px; }
.rich-content.post-body { min-height: 340px; padding: 16px 18px; line-height: 1.8; outline: none; cursor: text; }
.rich-content img { cursor: default; }
.rich-status { margin: 0; padding: 0 14px 10px; font-size: 13.5px; color: var(--muted); font-weight: 600; }
.rich-status:empty { display: none; }
.post-actions { display: flex; gap: 10px; padding: 14px 30px 16px; border-top: 1px solid var(--line); flex-wrap: wrap; align-items: flex-start; }
.spacer { flex: 1; }

.pw-action { position: relative; }
.pw-action > summary { list-style: none; }
.pw-action > summary::-webkit-details-marker { display: none; }
.pw-form {
  position: absolute; right: 0; top: calc(100% + 8px); z-index: 5;
  display: flex; gap: 6px; background: var(--surface); border: var(--stroke);
  border-radius: var(--radius-sm); padding: 8px; box-shadow: var(--shadow-grey); width: 290px;
}
.pw-form input { padding: 6px 10px; font-size: 14px; }

.comments { margin-top: 24px; }
.comments h2 { font-size: 18px; margin: 0 0 6px; }
.comment { padding: 14px 0; border-top: 1px solid var(--line); }
.comment-head { display: flex; gap: 10px; align-items: center; font-size: 13.5px; color: var(--muted); margin-bottom: 4px; }
.comment-head strong { color: var(--ink); font-size: 14.5px; }
.comment-tools { display: flex; gap: 12px; align-items: center; }
.push-right { margin-left: auto; }
.comment-body { font-size: 15.5px; }
.comment-form { display: grid; gap: 8px; margin-top: 14px; padding-top: 16px; border-top: 2px solid var(--ink); }
.comment-form textarea { min-height: 90px; }
.comment-form .row { display: flex; gap: 8px; justify-content: flex-end; }
.comment-form .row input { max-width: 240px; padding: 6px 10px; font-size: 14px; }

/* ---------- 관리자 ---------- */
.admin-layout { display: grid; grid-template-columns: 210px minmax(0, 1fr); gap: 36px; padding-top: 36px; padding-bottom: 80px; }
.admin-nav { position: sticky; top: calc(var(--header-h) + 24px); align-self: start; display: flex; flex-direction: column; gap: 3px; }
.admin-nav a { padding: 9px 12px; border-radius: var(--radius-sm); text-decoration: none; color: var(--ink-2); font-weight: 700; display: flex; justify-content: space-between; align-items: center; border: 2px solid transparent; }
.admin-nav a:hover { background: var(--surface); }
.admin-nav a.active { background: var(--surface); color: var(--ink); border-color: var(--ink); box-shadow: inset 5px 0 0 var(--accent); }
.admin-role { margin: 16px 12px 0; font-size: 13px; color: var(--muted); }
.admin-role strong { display: block; color: var(--ink); font-size: 15px; }
.badge { background: var(--accent); color: #fff; border-radius: 999px; font-size: 12px; font-weight: 800; padding: 0 7px; line-height: 20px; }
.admin-section { margin: 36px 0; }
.admin-section > h2 { font-size: 20px; margin: 0 0 6px; }
.admin-section > p { margin: 0 0 14px; font-size: 14.5px; }

.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 14px; }
.stat { background: var(--surface); border: var(--stroke); border-radius: var(--radius); padding: 16px 18px; }
.stat .n { font-size: 32px; font-weight: 900; letter-spacing: -0.03em; font-variant-numeric: tabular-nums; line-height: 1.3; }
.stat .l { color: var(--muted); font-size: 14px; font-weight: 600; }
.stat-alert { border-color: var(--accent); background: var(--accent-soft); box-shadow: 4px 4px 0 var(--accent); }
.stat-alert .n { color: var(--accent); }

.table-wrap { overflow-x: auto; background: var(--surface); border: var(--stroke); border-radius: var(--radius); }
table.data { width: 100%; border-collapse: collapse; font-size: 14.5px; }
table.data th, table.data td { padding: 11px 14px; border-bottom: 1px solid var(--line); text-align: left; vertical-align: middle; }
table.data th { background: var(--surface-2); font-weight: 800; color: var(--ink); white-space: nowrap; font-size: 13.5px; border-bottom: 2px solid var(--ink); }
table.data tr:last-child td { border-bottom: 0; }
table.data td a { text-decoration: none; }
table.data td a:hover strong { color: var(--accent); }
table.data td.right .inline { margin-right: 4px; }
.perm-table td:not(:first-child), .perm-table th:not(:first-child) { text-align: center; }
.table-wrap + p { margin-top: 12px; }

.tabs { display: flex; gap: 6px; margin-bottom: 16px; flex-wrap: wrap; }
.tabs a { padding: 6px 14px; border-radius: 999px; text-decoration: none; border: 2px solid var(--line-strong); background: var(--surface); font-size: 14px; color: var(--ink-2); font-weight: 700; }
.tabs a:hover { border-color: var(--ink); }
.tabs a.active { background: var(--ink); border-color: var(--ink); color: #fff; }
.pill { display: inline-block; padding: 1px 9px; border-radius: 999px; font-size: 12.5px; font-weight: 800; background: #e9e9e5; color: var(--ink-2); white-space: nowrap; }
.page-head h1 .pill { font-size: 13px; }
.pill-pending { background: var(--warn-soft); color: var(--warn); }
.pill-active { background: var(--ok-soft); color: var(--ok); }
.pill-rejected, .pill-suspended { background: var(--accent-soft); color: var(--accent-dark); }

.dl { display: grid; grid-template-columns: 110px 1fr; gap: 10px 16px; margin: 0; }
.dl dt { color: var(--muted); font-size: 14.5px; font-weight: 600; }
.dl dd { margin: 0; }

.media-list { display: grid; gap: 16px; }
.media-item { display: grid; grid-template-columns: 240px minmax(0, 1fr); gap: 20px; background: var(--surface); border: var(--stroke); border-radius: var(--radius); padding: 18px; }
.media-item > img { width: 100%; aspect-ratio: 16 / 9; object-fit: cover; border-radius: 8px; background: #eee; }
.media-item > img.contain { object-fit: contain; background: var(--surface-2); border: 1px solid var(--line); }
.media-item .field { margin-bottom: 12px; }
.is-off { opacity: .6; }
.is-off:hover, .is-off:focus-within { opacity: 1; }
.delete-row { margin-top: 8px; text-align: right; }
details.add { background: var(--surface); border: 2px dashed var(--ink); border-radius: var(--radius); padding: 14px 18px; margin-bottom: 16px; }
details.add[open] summary { margin-bottom: 16px; }
details.add summary { cursor: pointer; font-weight: 800; color: var(--accent); }
.board-form-head { display: flex; gap: 12px; align-items: baseline; margin-bottom: 14px; flex-wrap: wrap; }
.board-form-head strong { font-size: 17px; }

/* 팝업 관리 목록 */
.popup-thumb img { width: 100%; max-height: 320px; object-fit: contain; border-radius: 8px; background: var(--surface-2); border: 1px solid var(--line); display: block; }
.popup-thumb-text { background: var(--surface-2); border: 1px solid var(--line); border-radius: 8px; padding: 14px; font-size: 14px; color: var(--ink-2); min-height: 120px; }
.popup-thumb-text strong { display: block; color: var(--ink); margin-bottom: 4px; }
.popup-thumb-meta { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; margin: 10px 0 2px; }
.popup-thumb p { margin-top: 6px; margin-bottom: 0; }
.remove-image { margin-top: 8px; }

/* ---------- 팝업 공지 (홈) ---------- */
body.popup-open { overflow: hidden; }
.popup-layer {
  position: fixed; inset: 0; z-index: 50;
  background: rgba(17, 17, 17, .6);
  overflow-y: auto; padding: 84px 16px 32px;
}
.popup-stack { display: flex; flex-wrap: wrap; gap: 20px; justify-content: center; align-items: flex-start; min-height: 100%; }
.popup {
  width: min(420px, 100%); background: var(--surface); border: 3px solid var(--ink); border-radius: var(--radius); overflow: hidden;
  box-shadow: 8px 8px 0 var(--grey);
  display: flex; flex-direction: column;
  animation: popup-in .25s ease;
}
@keyframes popup-in { from { transform: translateY(12px); opacity: 0; } to { transform: none; opacity: 1; } }
.popup-head { display: flex; align-items: center; gap: 12px; padding: 14px 12px 14px 20px; border-bottom: 3px solid var(--ink); }
.popup-head h2 { margin: 0; font-size: 18px; flex: 1; min-width: 0; }
.popup-head h2::before { content: ''; display: inline-block; width: 18px; height: 11px; background: var(--flag); border-radius: 2px; margin-right: 8px; transform: skewY(-8deg); vertical-align: 2px; }
.popup-x { border: 0; background: none; font-size: 28px; line-height: 1; width: 36px; height: 36px; border-radius: 8px; cursor: pointer; color: var(--ink); }
.popup-x:hover { background: var(--accent-soft); color: var(--accent); }
.popup-image { display: block; }
.popup-image img { width: 100%; display: block; max-height: 70vh; object-fit: contain; background: var(--surface-2); }
.popup-body { padding: 18px 20px; font-size: 15.5px; line-height: 1.75; max-height: 50vh; overflow-y: auto; }
.popup-body a:not(.btn) { color: var(--link); }
.popup-more { margin: 14px 0 0; }
.popup-foot { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 10px 14px 10px 20px; background: var(--surface-2); border-top: 2px solid var(--ink); font-size: 14px; }

/* ---------- 바닥글 ---------- */
.site-footer { background: var(--ink); color: #a8a8a8; padding: 40px 0 48px; font-size: 14px; margin-top: 56px; border-top: 8px solid var(--accent); }
.footer-inner { display: flex; gap: 24px 48px; align-items: flex-start; justify-content: space-between; flex-wrap: wrap; }
.footer-brand { display: flex; align-items: center; gap: 14px; text-decoration: none; }
.footer-badge { width: 56px; height: 56px; border-radius: 14px; background: #fff; display: grid; place-items: center; flex-shrink: 0; box-shadow: 4px 4px 0 var(--accent); }
.footer-badge img { height: 44px; width: auto; display: block; }
.footer-word { height: 22px; width: auto; display: block; filter: invert(1); }
.footer-text { max-width: 560px; }
.footer-text p { margin: 0 0 6px; }
.footer-copy { color: #7d7d7d; font-size: 13px; }
.site-footer a { color: #e2e2e2; }

/* ---------- 좁은 화면 ---------- */
@media (max-width: 860px) {
  .admin-layout { grid-template-columns: minmax(0, 1fr); gap: 16px; padding-top: 20px; }
  .admin-nav { position: static; flex-direction: row; overflow-x: auto; gap: 4px; padding-bottom: 6px; }
  .admin-nav a { white-space: nowrap; gap: 6px; }
  .admin-role { display: none; }
  .hero-default { grid-template-columns: minmax(0, 1fr); gap: 8px; }
  .hero-mark { order: -1; width: clamp(120px, 30vw, 170px); margin-bottom: 8px; }
  .hero-copy h1::before { display: none; }
}
@media (max-width: 640px) {
  .grid-2, .grid-3, .grid-4, .intro, .dl, .media-item { grid-template-columns: minmax(0, 1fr); }
  .popup-layer { padding-top: 24px; }
  .intro { gap: 12px; }
  .dl dt { margin-top: 6px; }
  .page { padding-top: 28px; }
  .page-head h1 { font-size: 25px; }
  .panel { padding: 20px 18px; box-shadow: 4px 4px 0 var(--grey); }
  .card, .post, .post-list { box-shadow: 4px 4px 0 var(--grey); }
  .post-head, .post-body { padding-left: 18px; padding-right: 18px; }
  .post-actions { padding-left: 18px; padding-right: 18px; }
  .post-list a { flex-direction: column; align-items: flex-start; gap: 3px; padding: 13px 16px; }
  .post-title { white-space: normal; }
  .slider-arrow { display: none; }
  .slide-caption { padding-bottom: 52px; }
  .pw-form { width: min(290px, calc(100vw - 48px)); }
  /* 서식도구는 한 줄로, 옆으로 밀어서 */
  .rich-toolbar { flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; -webkit-overflow-scrolling: touch; }
  .rich-toolbar::-webkit-scrollbar { display: none; }
  .rich-toolbar button { flex: none; }
  .rich-toolbar .rich-photo { order: -1; } /* 휴대전화에서 가장 많이 쓰는 사진 버튼을 맨 앞에 */
  .rich-content.post-body { min-height: 260px; padding: 14px; }
  .comment-form .row { flex-direction: column; }
  .comment-form .row input { max-width: none; }
  .search { max-width: none; flex-basis: 100%; }
  .board-tools > .btn { margin-left: auto; }
  .hero-actions .btn { flex: 1; }
  .section { padding-top: 40px; }
}
@media (prefers-reduced-motion: reduce) {
  .slide.is-active, .popup { animation: none; }
  .btn, .menu a::after { transition: none; }
}
