/* ============================================================
   한국형 게시판 스타일
============================================================ */

/* === A. 게시판 목록 === */
.post-board-container {
	position: relative;
	max-width: 100%;
	font-size: 14px;
}

/* 헤더 */
.board-header {
	display: flex;
	justify-content: space-between;
	align-items: center;
	margin-bottom: 20px;
	flex-wrap: wrap;
	gap: 12px;
}

.board-title-area {
	display: flex;
	align-items: baseline;
	gap: 8px;
}

.board-title {
	font-size: 22px;
	font-weight: 700;
	color: #1a1a1a;
	margin: 0;
	line-height: 1.3;
}

.board-count {
	font-size: 14px;
	color: #888;
	font-weight: 400;
}

/* 검색 */
.board-search {
	display: flex;
	align-items: center;
	border: 1px solid #ddd;
	border-radius: 24px;
	overflow: hidden;
	background: #fff;
}

.board-search-input {
	flex: 1;
	padding: 9px 16px;
	border: none;
	font-size: 13px;
	outline: none;
	min-width: 180px;
	background: transparent;
}

.board-search-btn {
	padding: 9px 16px;
	background: none;
	border: none;
	cursor: pointer;
	color: #666;
	display: flex;
	align-items: center;
}

.board-search-btn:hover {
	color: #532B83;
}

/* 탭 */
.board-tabs {
	margin-bottom: 20px;
	overflow-x: auto;
	white-space: nowrap;
	-webkit-overflow-scrolling: touch;
	scrollbar-width: none;
}

.board-tabs::-webkit-scrollbar {
	display: none;
}

.board-tab {
	display: inline-block;
	padding: 8px 20px;
	margin-right: 6px;
	margin-bottom: 6px;
	cursor: pointer;
	background: #f5f5f5;
	color: #555;
	border-radius: 30px;
	font-weight: 600;
	border: none;
	font-size: 13px;
	transition: all 0.2s;
}

.board-tab:hover {
	background: #e8e8e8;
}

.board-tab.active {
	background: #532B83;
	color: #fff;
}

/* 테이블 */
.board-table-wrapper {
	overflow-x: auto;
}

.board-table {
	width: 100%;
	border-collapse: collapse;
	border-top: 2px solid #333;
}

.board-table thead th {
	background: #fafafa;
	padding: 13px 10px;
	font-size: 13px;
	font-weight: 600;
	color: #555;
	border-bottom: 1px solid #ddd;
	white-space: nowrap;
}

.board-table tbody td {
	padding: 13px 10px;
	border-bottom: 1px solid #eee;
	font-size: 14px;
	color: #333;
}

.board-table .col-no {
	width: 55px;
	text-align: center;
}

.board-table .col-title {
	text-align: left;
}

.board-table .col-category {
	width: 90px;
	text-align: center;
	color: #666;
	font-size: 13px;
}

.board-table .col-author {
	width: 90px;
	text-align: center;
	color: #666;
}

.board-table .col-date {
	width: 100px;
	text-align: center;
	color: #888;
	font-size: 13px;
}

.board-table .col-views,
.board-table .col-likes {
	width: 65px;
	text-align: center;
	color: #888;
	font-size: 13px;
}

/* 행 */
.board-row:hover {
	background: #faf8fd;
}

.board-row.notice-row {
	background: #faf8fd;
}

.board-row.notice-row .col-title a {
	font-weight: 600;
}

.pin-icon {
	font-size: 13px;
}

.board-table .col-title a {
	color: #1a1a1a;
	text-decoration: none;
	transition: color 0.15s;
}

.board-table .col-title a:hover {
	color: #532B83;
}

.comment-count-badge {
	color: #532B83;
	font-size: 12px;
	font-weight: 500;
	margin-left: 5px;
}

/* 빈 상태 */
.board-empty {
	padding: 60px 20px;
	text-align: center;
	color: #999;
	font-size: 14px;
	border-bottom: 1px solid #eee;
}

/* 하단 */
.board-footer {
	display: flex;
	justify-content: center;
	align-items: center;
	margin-top: 24px;
	position: relative;
}

.board-write-btn {
	position: absolute;
	right: 0;
	display: inline-block;
	padding: 9px 24px;
	background: #1a1a1a;
	color: #fff;
	border-radius: 4px;
	text-decoration: none;
	font-size: 13px;
	font-weight: 500;
	transition: background 0.2s;
}

.board-write-btn:hover {
	background: #532B83;
	color: #fff;
}

/* 페이지네이션 */
.board-pagination-links {
	display: inline-flex;
	align-items: center;
	gap: 2px;
}

.board-pagination-links .page-number,
.board-pagination-links .page-nav {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	min-width: 32px;
	height: 32px;
	padding: 0 6px;
	border: 1px solid #e0e0e0;
	border-radius: 4px;
	font-size: 13px;
	color: #555;
	text-decoration: none;
	transition: all 0.15s;
	background: #fff;
}

.board-pagination-links .page-number:hover,
.board-pagination-links .page-nav:hover:not(.disabled) {
	background: #f5f5f5;
	border-color: #ccc;
}

.board-pagination-links .page-number.active {
	background: #532B83;
	color: #fff;
	border-color: #532B83;
	font-weight: 600;
}

.board-pagination-links .page-nav.disabled {
	color: #ccc;
	cursor: default;
	pointer-events: none;
}

.board-pagination-links .page-dots {
	padding: 0 4px;
	color: #999;
}

/* 로딩 */
.board-loading {
	position: absolute;
	top: 0;
	left: 0;
	right: 0;
	bottom: 0;
	background: rgba(255, 255, 255, 0.7);
	display: flex;
	align-items: center;
	justify-content: center;
	z-index: 10;
}

.board-spinner {
	width: 36px;
	height: 36px;
	border: 3px solid #eee;
	border-top-color: #532B83;
	border-radius: 50%;
	animation: fw-board-spin 0.7s linear infinite;
}

@keyframes fw-board-spin {
	to { transform: rotate(360deg); }
}

/* === B. 싱글 포스트 === */
.single-post-article {
	max-width: 800px;
	margin: 40px auto;
	padding: 0 20px;
	width: 100%;
}

.single-post-article .post-cate-wrap {
	margin-bottom: 16px;
}

.single-post-article .category-tag {
	display: inline-block;
	padding: 4px 14px;
	border-radius: 20px;
	font-size: 12px;
	color: #fff;
	margin-right: 6px;
	text-decoration: none;
}

.single-post-title {
	font-size: 28px;
	font-weight: 700;
	color: #1a1a1a;
	line-height: 1.45;
	margin: 0 0 24px 0;
	word-break: keep-all;
}

/* 메타 바 */
.single-post-meta {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 12px;
	padding: 16px 0;
	border-top: 2px solid #333;
	border-bottom: 1px solid #eee;
	margin-bottom: 32px;
}

.meta-author {
	display: flex;
	align-items: center;
	gap: 10px;
}

.meta-author img {
	border-radius: 50%;
	width: 36px;
	height: 36px;
}

.author-name {
	font-weight: 600;
	font-size: 14px;
	color: #333;
}

.meta-details {
	display: flex;
	align-items: center;
	gap: 8px;
	font-size: 13px;
	color: #888;
	margin-left: auto;
}

.meta-separator {
	color: #ddd;
}

/* 글 수정/삭제 버튼 */
.meta-post-actions {
	display: flex;
	gap: 6px;
}

.meta-post-actions .post-edit-btn,
.meta-post-actions .post-delete-btn {
	padding: 4px 12px;
	font-size: 12px;
	border: 1px solid #ddd;
	border-radius: 4px;
	background: #fff;
	color: #666;
	cursor: pointer;
	text-decoration: none;
	line-height: 1.5;
	transition: all 0.15s;
}

.meta-post-actions .post-edit-btn:hover {
	border-color: #532B83;
	color: #532B83;
}

.meta-post-actions .post-delete-btn:hover {
	border-color: #dc3545;
	color: #dc3545;
}

.current-thumb-note {
	font-size: 12px;
	color: #999;
	margin-top: 4px;
}

/* 첨부파일 (상세 페이지) */
.single-post-attachments {
	background: #f9f9fb;
	border: 1px solid #eee;
	border-radius: 8px;
	padding: 16px 20px;
	margin-bottom: 24px;
}

.attachments-title {
	display: flex;
	align-items: center;
	gap: 6px;
	font-size: 14px;
	font-weight: 600;
	color: #333;
	margin: 0 0 12px;
}

.attachments-title .att-count {
	background: #532B83;
	color: #fff;
	font-size: 11px;
	padding: 1px 7px;
	border-radius: 10px;
	font-weight: 500;
}

.attachments-list {
	list-style: none;
	margin: 0;
	padding: 0;
	display: flex;
	flex-direction: column;
	gap: 6px;
}

.attachment-item a {
	display: flex;
	align-items: center;
	gap: 8px;
	padding: 8px 12px;
	background: #fff;
	border: 1px solid #e8e8e8;
	border-radius: 6px;
	text-decoration: none;
	color: #333;
	font-size: 13px;
	transition: all 0.15s;
}

.attachment-item a:hover {
	border-color: #532B83;
	color: #532B83;
	background: #faf7fd;
}

.attachment-item a::before {
	content: '';
	width: 18px;
	height: 18px;
	flex-shrink: 0;
	background-size: contain;
	background-repeat: no-repeat;
}

.att-image a::before { content: '🖼'; }
.att-pdf a::before { content: '📄'; }
.att-doc a::before { content: '📝'; }
.att-xls a::before { content: '📊'; }
.att-zip a::before { content: '📦'; }
.att-file a::before { content: '📎'; }

.att-size {
	color: #999;
	font-size: 12px;
	margin-left: auto;
}

/* 첨부파일 (글쓰기/수정 폼) */
.field-hint {
	font-size: 12px;
	color: #999;
	font-weight: 400;
}

.attachment-help {
	font-size: 12px;
	color: #999;
	margin: 4px 0 8px;
}

.attachment-list {
	display: flex;
	flex-direction: column;
	gap: 4px;
}

.attachment-list .att-item {
	display: flex;
	align-items: center;
	gap: 8px;
	padding: 6px 10px;
	background: #f5f5f5;
	border-radius: 4px;
	font-size: 13px;
}

.attachment-list .att-remove {
	margin-left: auto;
	background: none;
	border: none;
	color: #dc3545;
	cursor: pointer;
	font-size: 14px;
	padding: 0 4px;
}

.existing-attachments {
	margin-top: 8px;
}

.existing-att-item {
	display: flex;
	align-items: center;
	gap: 8px;
	padding: 6px 10px;
	background: #f5f5f5;
	border-radius: 4px;
	font-size: 13px;
	margin-bottom: 4px;
	cursor: pointer;
}

.existing-att-item input[type="checkbox"] {
	accent-color: #532B83;
}

/* 본문 */
.single-post-content {
	line-height: 1.85;
	font-size: 16px;
	color: #333;
	margin-bottom: 40px;
	word-break: keep-all;
}

.single-post-content img {
	max-width: 100%;
	height: auto;
	border-radius: 4px;
}

.single-post-content p {
	margin-bottom: 1.2em;
}

/* 액션 바 (좋아요 + 공유) */
.single-post-actions {
    display: flex;
    justify-content: end;
    align-items: center;
    gap: 9px;
    padding: 24px 0;
    border-top: 1px solid #eee;
    border-bottom: 1px solid #eee;
    margin-bottom: 30px;
}

.post-like-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 14px;
    border: 1px solid #ddd;
    border-radius: 24px;
    background: #fff;
    cursor: pointer;
    font-size: 13px;
    color: #555;
    transition: all 0.2s;
}

.post-like-btn:hover {
	border-color: #532B83;
	color: #532B83;
}

.post-like-btn.liked {
	border-color: #532B83;
	color: #532B83;
	background: #f8f4fd;
}

.post-like-btn .like-icon {
	width: 14px;
	height: 14px;
}

.post-like-btn .like-count {
	font-weight: 600;
}

/* 이전글/다음글 */
.single-post-nav {
	border: 1px solid #eee;
	border-radius: 6px;
	overflow: hidden;
	margin-bottom: 24px;
}

.single-post-nav a {
	display: flex;
	align-items: center;
	gap: 16px;
	padding: 16px 20px;
	text-decoration: none;
	transition: background 0.15s;
}

.single-post-nav a:hover {
	background: #faf8fd;
}

.single-post-nav a + a {
	border-top: 1px solid #eee;
}

.nav-label {
	font-size: 12px;
	color: #888;
	min-width: 45px;
	font-weight: 500;
}

.nav-title {
	font-size: 14px;
	color: #333;
	overflow: hidden;
	text-overflow: ellipsis;
	white-space: nowrap;
}

/* 목록보기 */
.single-post-back {
	text-align: center;
	margin-bottom: 50px;
}

.single-post-back .back-to-list,
.single-post-back a.button {
	display: inline-block;
	padding: 10px 32px;
	border: 1px solid #ddd;
	border-radius: 4px;
	color: #333;
	text-decoration: none;
	font-size: 14px;
	font-weight: 500;
	transition: all 0.15s;
	background: #f5f5f5;
}

.single-post-back .back-to-list:hover,
.single-post-back a.button:hover {
	background: #f5f5f5;
	border-color: #ccc;
}

/* === C. 댓글 === */
.board-comments-section {
	margin-top: 50px;
	padding-top: 30px;
	border-top: 2px solid #333;
}

.board-comments-header h3 {
	font-size: 18px;
	font-weight: 700;
	margin: 0 0 20px 0;
}

.comments-total {
	color: #532B83;
	margin-left: 4px;
}

/* 댓글 작성폼 */
.comment-write-form {
	margin-bottom: 30px;
}

.comment-write-form textarea,
.reply-textarea,
.edit-textarea {
	width: 100%;
	min-height: 80px;
	padding: 14px;
	border: 1px solid #ddd;
	border-radius: 6px;
	font-size: 14px;
	line-height: 1.5;
	resize: vertical;
	font-family: inherit;
	box-sizing: border-box;
}

.comment-write-form textarea:focus,
.reply-textarea:focus,
.edit-textarea:focus {
	border-color: #532B83;
	outline: none;
}

.comment-submit-btn,
.reply-submit-btn {
	display: inline-block;
	float: right;
	margin-top: 8px;
	padding: 8px 22px;
	background: #532B83;
	color: #fff;
	border: none;
	border-radius: 4px;
	font-size: 13px;
	font-weight: 500;
	cursor: pointer;
	transition: opacity 0.2s;
}

.comment-submit-btn:hover,
.reply-submit-btn:hover {
	opacity: 0.85;
}

.comment-login-notice {
	padding: 20px;
	background: #f8f8f8;
	border-radius: 6px;
	text-align: center;
	color: #666;
	font-size: 14px;
	margin-bottom: 30px;
}

.comment-login-notice a {
	color: #532B83;
	font-weight: 600;
}

/* 댓글 목록 */
.board-comments-list {
	clear: both;
}

.board-comment-item {
	display: flex;
	gap: 12px;
	padding: 20px 0;
	border-bottom: 1px solid #f0f0f0;
}

.board-comment-item.reply-comment {
	margin-left: 52px;
	padding-left: 16px;
	border-left: 2px solid #f0f0f0;
}

.board-comment-item .comment-avatar img {
	width: 40px;
	height: 40px;
	border-radius: 50%;
}

.comment-body {
	flex: 1;
	min-width: 0;
}

.comment-info {
	display: flex;
	align-items: center;
	gap: 10px;
	margin-bottom: 6px;
	flex-wrap: wrap;
}

.comment-author-name {
	font-weight: 600;
	font-size: 14px;
	color: #333;
}

.comment-date {
	font-size: 12px;
	color: #999;
}

.comment-actions-inline {
	margin-left: auto;
}

.comment-actions-inline button {
	background: none;
	border: none;
	font-size: 12px;
	color: #999;
	cursor: pointer;
	padding: 2px 6px;
}

.comment-actions-inline button:hover {
	color: #532B83;
}

.comment-text {
	font-size: 14px;
	line-height: 1.65;
	color: #333;
	word-break: keep-all;
}

/* 수정 폼 */
.edit-comment-form {
	margin-top: 10px;
}

.edit-textarea {
	min-height: 60px;
}

.edit-actions {
	display: flex;
	gap: 8px;
	justify-content: flex-end;
	margin-top: 8px;
}

.save-edit-btn {
	padding: 6px 16px;
	background: #532B83;
	color: #fff;
	border: none;
	border-radius: 4px;
	font-size: 12px;
	cursor: pointer;
}

.cancel-edit-btn {
	padding: 6px 16px;
	background: #f0f0f0;
	color: #333;
	border: none;
	border-radius: 4px;
	font-size: 12px;
	cursor: pointer;
}

/* 답글 */
.comment-bottom-actions {
	margin-top: 8px;
}

.comment-bottom-actions .reply-btn {
	background: none;
	border: none;
	font-size: 12px;
	color: #888;
	cursor: pointer;
	padding: 0;
}

.comment-bottom-actions .reply-btn:hover {
	color: #532B83;
}

.reply-form {
	display: none;
	margin-top: 10px;
}

.reply-form.show {
	display: block;
}

.reply-textarea {
	min-height: 60px;
}

.reply-submit-btn {
	margin-top: 6px;
	font-size: 12px;
	padding: 6px 16px;
}

/* === D. 글쓰기 폼 === */
.post-write-container {
	max-width: 800px;
	margin: 40px auto;
	padding: 0 20px;
}

.write-page-title {
	font-size: 24px;
	font-weight: 700;
	margin: 0 0 30px 0;
	color: #1a1a1a;
}

.write-field {
	margin-bottom: 24px;
}

.write-field label {
	display: block;
	font-weight: 600;
	font-size: 14px;
	margin-bottom: 8px;
	color: #333;
}

.write-field input[type="text"],
.write-field select {
	width: 100%;
	padding: 11px 15px;
	border: 1px solid #ddd;
	border-radius: 4px;
	font-size: 14px;
	background: #fff;
	box-sizing: border-box;
}

.write-field input[type="text"]:focus,
.write-field select:focus {
	border-color: #532B83;
	outline: none;
}

.write-field input[type="file"] {
	font-size: 13px;
}

.image-preview-area {
	margin-top: 10px;
}

.image-preview-area img {
	max-width: 200px;
	border-radius: 4px;
}

.write-actions {
	display: flex;
	gap: 12px;
	justify-content: center;
	margin-top: 36px;
	padding-top: 24px;
	border-top: 1px solid #eee;
}

.write-submit-btn {
	padding: 12px 48px;
	background: #532B83;
	color: #fff;
	border: none;
	border-radius: 4px;
	font-size: 15px;
	font-weight: 600;
	cursor: pointer;
	transition: opacity 0.2s;
}

.write-submit-btn:hover {
	opacity: 0.85;
}

.write-cancel-btn {
	padding: 12px 36px;
	background: #f0f0f0;
	color: #333;
	border-radius: 4px;
	text-decoration: none;
	font-size: 15px;
	font-weight: 500;
	display: inline-flex;
	align-items: center;
	transition: background 0.15s;
}

.write-cancel-btn:hover {
	background: #e5e5e5;
}

.write-login-required {
	max-width: 800px;
	margin: 60px auto;
	text-align: center;
	padding: 40px;
	background: #f8f8f8;
	border-radius: 8px;
}

.write-login-required a {
	color: #532B83;
	font-weight: 600;
}

/* === E. 반응형 === */
@media screen and (max-width: 768px) {
	/* 게시판 */
	.board-header {
		flex-direction: column;
		align-items: stretch;
	}

	.board-search {
		width: 100%;
	}

	.board-search-input {
		min-width: 0;
		flex: 1;
	}

	.board-table thead {
		display: none;
	}

	.board-table,
	.board-table tbody,
	.board-table tr,
	.board-table td {
		display: block;
	}

	.board-table .board-row {
		padding: 14px 4px;
		border-bottom: 1px solid #eee;
		position: relative;
	}

	.board-table td.col-no {
		display: none;
	}

	.board-table td.col-title {
		font-size: 15px;
		font-weight: 600;
		padding: 0 0 8px;
		border: none;
	}

	.board-table td.col-category {
		display: inline;
		padding: 0;
		border: none;
		font-size: 12px;
		color: #532B83;
		font-weight: 500;
	}

	.board-table td.col-category::after {
		content: " · ";
		color: #ddd;
	}

	.board-table td.col-author,
	.board-table td.col-date,
	.board-table td.col-views,
	.board-table td.col-likes {
		display: inline;
		padding: 0;
		border: none;
		font-size: 12px;
		color: #999;
	}

	.board-table td.col-author::after,
	.board-table td.col-date::after,
	.board-table td.col-views::after {
		content: " · ";
		color: #ddd;
	}

	.board-table .notice-row td.col-title::before {
		content: "📌 ";
	}

	.board-footer {
		flex-direction: column;
		gap: 16px;
	}

	.board-write-btn {
		position: static;
		text-align: center;
	}

	/* 싱글 */
	.single-post-title {
		font-size: 22px;
	}

	.single-post-meta {
		flex-direction: column;
		align-items: flex-start;
		gap: 8px;
	}

	.single-post-content {
		font-size: 15px;
	}

	.single-post-actions {
		gap: 10px;
	}

	/* 댓글 */
	.board-comment-item.reply-comment {
		margin-left: 20px;
	}

	.comment-info {
		flex-wrap: wrap;
	}
}

@media screen and (max-width: 480px) {
	.single-post-article {
		margin: 20px auto;
	}

	.single-post-title {
		font-size: 20px;
	}

	.board-tab {
		padding: 7px 14px;
		font-size: 12px;
	}
}
