/* ══════════════════════════════════════
   게시판 — 통합 CSS (리스트/상세/글쓰기)
   ══════════════════════════════════════ */

/* ── 카드 공통 (1회만 선언) ── */
.dg-board-page { }
.dg-academy-card {
	background: #fff;
	border-radius: 16px;
	box-shadow: 0 2px 12px rgba(0,0,0,.06);
	margin-bottom: 1.5rem;
}
.dg-academy-card__head {
	display: flex;
	align-items: center;
	gap: 1rem;
	padding: .8rem 1.1rem;
	background: var(--dg-primary-gradient);
	border-radius: 16px 16px 0 0;
	overflow: hidden;
	position: relative;
}
.dg-academy-card__icon {
	width: 46px; height: 46px;
	border-radius: 12px;
	background: rgba(45,74,30,.10);
	display: flex; align-items: center; justify-content: center;
	color: #2d4a1e;
	font-size: 1.15rem;
	flex-shrink: 0;
}
.dg-academy-card__label {
	display: inline-block;
	font-size: .68rem; font-weight: 600;
	color: rgba(45,74,30,.5);
	background: rgba(45,74,30,.12);
	padding: .15rem .55rem;
	border-radius: 4px;
	margin-bottom: .2rem;
	letter-spacing: .02em;
}
.dg-academy-card__title {
	font-family: 'Noto Serif KR', serif;
	font-size: 1.15rem; font-weight: 700;
	color: #2d4a1e;
	margin: 0;
}
.dg-academy-card__badge {
	margin-left: auto;
	font-size: .78rem;
	color: rgba(45,74,30,.5);
	white-space: nowrap;
}
.dg-academy-card__body {
	padding: 1rem .65rem;
	overflow: visible;
}


/* ══════════════════════════════════════
   리스트
   ══════════════════════════════════════ */

/* ── 툴바 ── */
.dg-board-toolbar {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: .75rem;
	margin-bottom: 1.25rem;
}
.dg-board-toolbar .form-control,
.dg-board-toolbar .form-select {
	border-radius: 8px;
	border: 1px solid #e0e0e0;
	font-size: .9rem;
}
.dg-board-toolbar .form-control:focus,
.dg-board-toolbar .form-select:focus {
	border-color: #4a7c3f;
	box-shadow: 0 0 0 3px rgba(74,124,63,.15);
}
.dg-board-search {
	display: flex;
	flex: 1;
	min-width: 0;
	gap: .5rem;
}
.dg-board-search input { flex: 1; min-width: 0; }
.dg-board-search .btn { border-radius: 8px; white-space: nowrap; }
.dg-board-info {
	font-size: .82rem;
	color: #888;
}
.dg-board-info strong { color: #2d4a1e; }

/* ── 글쓰기 버튼 ── */
.dg-btn-write {
	display: inline-flex;
	align-items: center;
	gap: .4rem;
	background: #4a7c3f;
	color: #fff;
	border: none;
	border-radius: 8px;
	padding: .5rem 1rem;
	font-size: .88rem;
	font-weight: 600;
	text-decoration: none;
	white-space: nowrap;
	transition: background .2s;
}
.dg-btn-write:hover { background: #3a6331; color: #fff; }

/* ── 관리자 버튼 ── */
.dg-admin-btns {
	display: flex;
	gap: .4rem;
}
.dg-admin-btns .btn { border-radius: 8px; font-size: .78rem; padding: .3rem .5rem; }

/* ── 카테고리 드롭다운 ── */
.dg-cat-dropdown .dropdown-toggle {
	border-radius: 8px;
	font-size: .88rem;
	border: 1px solid #e0e0e0;
}
.dg-cat-dropdown .dropdown-menu {
	border-radius: 10px;
	box-shadow: 0 4px 16px rgba(0,0,0,.1);
	border: 1px solid #f0f0f0;
}
.dg-cat-dropdown .dropdown-item { font-size: .88rem; padding: .45rem 1rem; }
.dg-cat-dropdown .dropdown-item:hover { background: rgba(45,74,30,.06); color: #2d4a1e; }
.dg-cat-dropdown .active .dropdown-item { background: rgba(45,74,30,.10); color: #2d4a1e; font-weight: 600; }

/* ── 공지사항 ── */
.dg-notice-list {
  width: 100%;
  max-height: 300px;
  overflow-y: auto;
  overflow-x: hidden;
}

.dg-notice-item {
  min-width: 0;
}

.dg-notice-body {
  min-width: 0;
  overflow: hidden;
}

.dg-notice-body h6,
.dg-notice-body p {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  max-width:50vw;
}
.dg-notice-item {
	display: flex;
	align-items: flex-start;
	gap: .75rem;
	padding: .85rem 1rem;
	background: rgba(45,74,30,.04);
	border: 1px solid rgba(45,74,30,.10);
	border-radius: 10px;
	margin-bottom: .5rem;
	text-decoration: none;
	color: inherit;
	transition: background .2s;
}
.dg-notice-item:hover { background: rgba(45,74,30,.08); color: inherit; }
.dg-notice-icon {
	width: 32px; height: 32px;
	border-radius: 8px;
	background: #4a7c3f;
	display: flex; align-items: center; justify-content: center;
	color: #fff;
	font-size: .75rem;
	flex-shrink: 0;
	margin-top: .1rem;
}
.dg-notice-body { flex: 1; min-width: 0; }
.dg-notice-body h6 {
	font-size: .92rem;
	font-weight: 600;
	color: #333;
	margin: 0 0 .2rem;
	display: flex;
	align-items: center;
	gap: .4rem;
	flex-wrap: wrap;
}
.dg-notice-body p {
	font-size: .82rem;
	color: #888;
	margin: 0;
	overflow: hidden;
	text-overflow: ellipsis;
	white-space: nowrap;
}
.dg-notice-date {
	font-size: .75rem;
	color: #aaa;
	white-space: nowrap;
	margin-top: .1rem;
}

/* ── 게시글 리스트 ── */
.dg-post-list { list-style: none; padding: 0; margin: 0; }
.dg-post-item {
	display: block;
	padding: .9rem 1rem;
	border-bottom: 1px solid #f5f5f5;
	text-decoration: none;
	color: inherit;
	transition: background .15s;
}
.dg-post-item:last-child { border-bottom: none; }
.dg-post-item:hover { background: rgba(45,74,30,.02); color: inherit; }
.dg-post-item__top {
	display: flex;
	justify-content: space-between;
	align-items: flex-start;
	gap: .75rem;
	margin-bottom: .3rem;
}
.dg-post-item__title {
	font-size: .95rem;
	font-weight: 600;
	color: #333;
	margin: 0;
	display: flex;
	align-items: center;
	gap: .35rem;
	flex-wrap: wrap;
	flex: 1;
	min-width: 0;
}
.dg-post-item__date {
	font-size: .75rem;
	color: #aaa;
	white-space: nowrap;
	flex-shrink: 0;
}
.dg-post-item__desc {
	font-size: .85rem;
	color: #888;
	margin: 0 0 .3rem;
	overflow: hidden;
	text-overflow: ellipsis;
	white-space: nowrap;
}
.dg-post-item__meta {
	font-size: .75rem;
	color: #aaa;
	display: flex;
	align-items: center;
	gap: .75rem;
}
.dg-post-item__meta i { font-size: .65rem; color: #4a7c3f; }

/* ── 배지 ── */
.dg-badge-new {
	font-size: .6rem;
	font-weight: 700;
	color: #fff;
	background: #ef5350;
	padding: .15rem .4rem;
	border-radius: 4px;
	line-height: 1;
}
.dg-badge-lock { color: #bbb; font-size: .78rem; }
.dg-badge-file { color: #bbb; font-size: .75rem; }

/* ── 빈 목록 ── */
.dg-empty {
	text-align: center;
	padding: 3rem 1rem;
	color: #ccc;
	font-size: .95rem;
}
.dg-empty i { font-size: 2rem; display: block; margin-bottom: .75rem; }

/* ── 페이지네이션 ── */
.dg-pagination {
	display: flex;
	align-items: center;
	justify-content: center;
	gap: .5rem;
	margin-top: 1.5rem;
	margin-bottom: 1rem;
}
.dg-pagination-btns {
	display: flex;
	justify-content: space-between;
	align-items: center;
	flex-wrap: wrap;
	gap: .5rem;
}
.dg-pagination-btns .btn { border-radius: 8px; font-size: .82rem; }


/* ══════════════════════════════════════
   상세보기
   ══════════════════════════════════════ */
.dg-view-page { }

/* ── 글 제목 영역 ── */
.dg-post-header {
	padding-bottom: 1rem;
	margin-bottom: 1.25rem;
	border-bottom: 1px solid #f0f0f0;
}
.dg-post-title {
	font-family: 'Noto Serif KR', serif;
	font-size: 1.35rem;
	font-weight: 700;
	color: #212121;
	margin: 0 0 .75rem;
	line-height: 1.5;
	word-break: keep-all;
}
.dg-post-title .badge-notice {
	display: inline-flex;
	align-items: center;
	gap: .3rem;
	font-size: .7rem;
	font-weight: 600;
	color: #fff;
	background: #4a7c3f;
	padding: .2rem .5rem;
	border-radius: 4px;
	vertical-align: middle;
	margin-right: .4rem;
}
.dg-post-title .badge-cat { font-size: .75rem; font-weight: 600; color: #2d4a1e; margin-right: .3rem; }
.dg-post-title .badge-file { color: #aaa; font-size: .85rem; margin-left: .3rem; }

/* ── 메타 정보 ── */
.dg-post-meta {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: .5rem 1.25rem;
	font-size: .85rem;
	color: #888;
}
.dg-post-meta i { font-size: .75rem; color: #4a7c3f; }
.dg-post-meta-right {
	margin-left: auto;
	display: flex;
	align-items: center;
	gap: .75rem;
}
.dg-post-meta-right a { color: #888; text-decoration: none; font-size: .82rem; transition: color .2s; }
.dg-post-meta-right a:hover { color: #2d4a1e; }

/* ── 본문 ── */
.dg-post-content {
	padding: 1.5rem 0;
	font-size: 1rem;
	line-height: 1.8;
	color: #333;
	word-break: keep-all;
	overflow-wrap: break-word;
}
.dg-post-content img { max-width: 100%; height: auto; border-radius: 8px; }

/* ── 첨부파일 ── */
.dg-attach-box {
	background: #fafafa;
	border: 1px solid #f0f0f0;
	border-radius: 12px;
	padding: 1rem 1.15rem;
	margin-top: 1rem;
}
.dg-attach-box__title {
	font-size: .88rem;
	font-weight: 600;
	color: #424242;
	margin: 0 0 .6rem;
	display: flex;
	align-items: center;
	gap: .4rem;
}
.dg-attach-box__title i { color: #4a7c3f; }
.dg-attach-list { list-style: none; padding: 0; margin: 0; }
.dg-attach-list li {
	display: flex;
	align-items: center;
	justify-content: space-between;
	padding: .45rem 0;
	border-bottom: 1px solid #f5f5f5;
	font-size: .88rem;
}
.dg-attach-list li:last-child { border-bottom: none; }
.dg-attach-list a { color: #424242; text-decoration: none; display: flex; align-items: center; gap: .4rem; }
.dg-attach-list a:hover { color: #2d4a1e; }
.dg-attach-list a i { color: #4a7c3f; font-size: .8rem; }
.dg-attach-list .meta { font-size: .78rem; color: #aaa; display: flex; gap: .5rem; }

/* ── 태그 ── */
.dg-tag-box {
	display: flex;
	flex-wrap: wrap;
	gap: .4rem;
	margin-top: 1rem;
	padding-top: .75rem;
	border-top: 1px solid #f0f0f0;
}
.dg-tag-box a {
	display: inline-block;
	font-size: .78rem;
	color: #2d4a1e;
	background: rgba(45,74,30,.06);
	padding: .2rem .6rem;
	border-radius: 4px;
	text-decoration: none;
	transition: background .2s;
}
.dg-tag-box a:hover { background: rgba(45,74,30,.12); }

/* ── 공감 버튼 ── */
.dg-score-box {
	display: flex;
	justify-content: center;
	gap: .75rem;
	padding: 1.25rem 0;
	margin-top: .5rem;
	border-top: 1px solid #f0f0f0;
}
.dg-score-btn {
	display: inline-flex;
	align-items: center;
	gap: .4rem;
	padding: .5rem 1.2rem;
	border-radius: 10px;
	font-size: .88rem;
	font-weight: 600;
	text-decoration: none;
	transition: transform .15s, box-shadow .15s;
	border: none;
}
.dg-score-btn:hover { transform: translateY(-2px); box-shadow: 0 4px 12px rgba(0,0,0,.1); }
.dg-score-btn.good { background: rgba(45,74,30,.08); color: #2d4a1e; }
.dg-score-btn.good:hover { background: rgba(45,74,30,.15); color: #1e3a1a; }
.dg-score-btn.bad { background: #fff3e0; color: #e65100; }
.dg-score-btn.bad:hover { background: #ffe0b2; color: #bf360c; }

/* ── 액션 버튼 바 ── */
.dg-action-bar {
	display: flex;
	justify-content: flex-end;
	flex-wrap: wrap;
	gap: .4rem;
	padding: 1rem 0;
}
.dg-action-bar .btn { border-radius: 8px; font-size: .82rem; }

/* ── 댓글 영역 ── */
.dg-comment-toggle {
	display: flex;
	align-items: center;
	gap: .5rem;
	padding: .75rem 0;
	font-size: .92rem;
	color: #424242;
	border-top: 1px solid #f0f0f0;
}
.dg-comment-toggle i { color: #4a7c3f; }
.dg-comment-toggle a { color: #2d4a1e; text-decoration: underline; text-underline-offset: 3px; font-weight: 600; }

/* ── 이전글/다음글 ── */
.dg-post-nav { border-top: 1px solid #f0f0f0; margin-top: .5rem; }
.dg-post-nav__item {
	display: flex;
	align-items: center;
	gap: .75rem;
	padding: .75rem 0;
	border-bottom: 1px solid #f5f5f5;
	font-size: .9rem;
	color: #555;
}
.dg-post-nav__item:last-child { border-bottom: none; }
.dg-post-nav__label {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 60px;
	font-size: .75rem;
	font-weight: 600;
	color: #888;
	flex-shrink: 0;
}
.dg-post-nav__label i { margin-right: .3rem; font-size: .7rem; color: #4a7c3f; }
.dg-post-nav__item a { color: #424242; text-decoration: none; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.dg-post-nav__item a:hover { color: #2d4a1e; }
.dg-post-nav__item .no-link { color: #ccc; }

/* ── 비밀글 안내 ── */
.dg-hidden-notice {
	background: #fff3e0;
	border-left: 4px solid #ffa726;
	border-radius: 0 10px 10px 0;
	padding: .75rem 1rem;
	margin: 1rem 0;
	font-size: .88rem;
	color: #e65100;
}

/* ── SNS 공유 ── */
.dg-sns-box { display: flex; gap: .5rem; margin-top: .75rem; }
.dg-sns-box img { cursor: pointer; border-radius: 6px; transition: transform .15s; }
.dg-sns-box img:hover { transform: scale(1.1); }


/* ══════════════════════════════════════
   글쓰기
   ══════════════════════════════════════ */
.dg-write-page { }

/* ── 폼 필드 그룹 ── */
.dg-form-group { margin-bottom: 1rem; }
.dg-form-label {
	display: block;
	font-size: .82rem;
	font-weight: 600;
	color: #666;
	margin-bottom: .35rem;
	padding-left: .1rem;
}
.dg-form-row {
	display: flex;
	gap: 1rem;
}
.dg-form-row > .dg-form-group { flex: 1; min-width: 0; }

/* ── 인풋 스타일 ── */
.dg-write-page .form-control,
.dg-write-page .form-select {
	border-radius: 10px;
	border: 1px solid #e0e0e0;
	font-size: .95rem;
	padding: .6rem .9rem;
	transition: border-color .2s, box-shadow .2s;
}
.dg-write-page .form-control:focus,
.dg-write-page .form-select:focus {
	border-color: #4a7c3f;
	box-shadow: 0 0 0 3px rgba(74,124,63,.15);
}
.dg-write-page .form-control::placeholder { color: #bbb; }

/* ── 제목 입력 (강조) ── */
.dg-subject-input {
	font-size: 1.1rem !important;
	font-weight: 600;
	padding: .75rem 1rem !important;
}

/* ── 체크박스 / 스위치 영역 ── */
.dg-switch-row {
	display: flex;
	flex-wrap: wrap;
	gap: .75rem 1.5rem;
	padding: .75rem 1rem;
	background: #fafafa;
	border-radius: 10px;
	margin-bottom: 1rem;
}
.dg-switch-row .form-check-label { font-size: .88rem; color: #555; }
.dg-switch-row .form-check-input:checked { background-color: #4a7c3f; border-color: #4a7c3f; }

/* ── 등록 후 이동 옵션 ── */
.dg-after-box {
	background: rgba(45,74,30,.04);
	border: 1px solid rgba(45,74,30,.10);
	border-radius: 10px;
	padding: .85rem 1rem;
	margin-top: 1rem;
}
.dg-after-box__title { font-size: .82rem; font-weight: 600; color: #888; margin-bottom: .5rem; }
.dg-after-options { display: flex; flex-wrap: wrap; gap: .5rem 1.25rem; }
.dg-after-options .form-check-label { font-size: .88rem; color: #555; }
.dg-after-options .form-check-input:checked { background-color: #4a7c3f; border-color: #4a7c3f; }

/* ── 태그/트랙백 영역 ── */
.dg-extra-fields { border-top: 1px solid #f0f0f0; padding-top: 1rem; margin-top: 1rem; }
.dg-extra-help { font-size: .78rem; color: #aaa; margin-top: .25rem; }

/* ── 소셜 연동 ── */
.dg-social-box {
	display: flex;
	align-items: center;
	gap: .75rem;
	padding: .75rem 1rem;
	background: #fafafa;
	border-radius: 10px;
	margin-top: 1rem;
	font-size: .88rem;
	color: #555;
}

/* ── 하단 버튼 ── */
.dg-write-actions {
	display: flex;
	justify-content: flex-end;
	gap: .5rem;
	padding-top: 1.25rem;
	margin-top: 1rem;
	border-top: 1px solid #f0f0f0;
}
.dg-btn-cancel {
	display: inline-flex;
	align-items: center;
	gap: .35rem;
	padding: .55rem 1.2rem;
	border-radius: 10px;
	font-size: .9rem;
	font-weight: 600;
	color: #888;
	background: #f5f5f5;
	border: 1px solid #e0e0e0;
	cursor: pointer;
	transition: background .2s;
}
.dg-btn-cancel:hover { background: #eee; }
.dg-btn-submit {
	display: inline-flex;
	align-items: center;
	gap: .35rem;
	padding: .55rem 1.5rem;
	border-radius: 10px;
	font-size: .9rem;
	font-weight: 600;
	color: #fff;
	background: #4a7c3f;
	border: none;
	cursor: pointer;
	transition: background .2s, transform .15s;
}
.dg-btn-submit:hover { background: #3a6331; transform: translateY(-1px); }

/* ── 에디터 안내 (관리자 제한) ── */
.dg-editor-notice {
	background: #fff3e0;
	border-left: 4px solid #ffa726;
	border-radius: 0 10px 10px 0;
	padding: .85rem 1.1rem;
	margin: 1rem 0;
	font-size: .9rem;
	color: #e65100;
}


/* ══════════════════════════════════════
   모바일 반응형 (통합 — 1회만 선언)
   ══════════════════════════════════════ */
@media (max-width: 768px) {

	/* ── 카드 공통 ── */
	.dg-academy-card { overflow: visible; }
	.dg-academy-card__head { border-radius: 16px 16px 0 0; }
	.dg-academy-card__body { padding: 1rem .85rem; overflow: visible; }

	/* ── 리스트: 툴바 ── */
	.dg-board-toolbar {
		flex-direction: column;
		align-items: stretch;
	}
	.dg-board-search {
		min-width: auto;
		flex-wrap: wrap;
		gap: 4px;
	}
	.dg-board-search .form-select {
		flex: 0 0 80px;
		min-width: 0;
		font-size: .82rem;
		padding: 6px 8px;
	}
	.dg-board-search .form-control {
		flex: 1;
		min-width: 0;
		font-size: .82rem;
		padding: 6px 8px;
	}
	.dg-board-search .btn {
		font-size: .78rem;
		padding: 6px 8px;
	}
	.dg-btn-write {
		font-size: .82rem;
		padding: .45rem .8rem;
	}

	/* ── 리스트: 게시글 ── */
	.dg-post-item { padding: .75rem .5rem; }
	.dg-post-item__title { font-size: .88rem; }
	.dg-post-item__desc { display: none; }

	/* ── 리스트: 공지 ── */
	.dg-notice-item { padding: .7rem .75rem; gap: .5rem; }
	.dg-notice-date { display: none; }

	.dg-notice-body h6 {
		font-size: .85rem;
		word-break: break-all;
	}
	.dg-notice-body p {
		white-space: normal;
		word-break: break-all;
	}

	/* ── 상세보기 ── */
	.dg-post-title { font-size: 1.15rem; }
	.dg-post-meta { font-size: .8rem; }
	.dg-post-meta-right { margin-left: 0; width: 100%; justify-content: flex-end; }
	.dg-action-bar { justify-content: center; }
	.dg-post-content { padding: 1rem 0; font-size: .95rem; }

	/* ── 글쓰기 ── */
	.dg-form-row { flex-direction: column; gap: 0; }
	.dg-write-actions { justify-content: center; }
	.dg-after-options { flex-direction: column; }
}