/* ------------------------------ 머리말 ------------------------------ */
/* #primary(ID) 가 클래스 선택자를 이겨 padding 이 적용되지 않으므로 함께 붙인다 */
#primary.board-archive {
	max-width: 1280px;
	margin: 0 auto;
	padding: 0 1.5rem 5rem;
}

.board-archive-header {
	display: grid;
	grid-template-columns: auto 1fr;
	align-items: center;
	gap: 0.35rem 1.1rem;
	padding: 3rem 0 1.75rem;
	margin-bottom: 2rem;
	border-bottom: 1px solid #e5e5e5;
}

.board-archive-icon {
	grid-row: span 2;
	display: flex;
	align-items: center;
	justify-content: center;
	width: 52px;
	height: 52px;
	border-radius: 14px;
	flex-shrink: 0;
	color: #fff;
	background: #999;
}

/* 제목과 건수를 한 줄로. 격자에서는 이 묶음이 한 칸이다 */
.board-archive-headline {
	display: flex;
	align-items: baseline;
	flex-wrap: wrap;
	gap: 0.7rem;
	min-width: 0;
}

.board-archive-header .page-title {
	margin: 0;
	font-size: 1.5rem;
	font-weight: 700;
	color: #111;
	letter-spacing: -0.02em;
}

.board-archive-count {
	font-size: 0.82rem;
	font-weight: 400;
	color: #999;
	white-space: nowrap;
}

.board-archive-desc {
	margin: 0;
	color: #777;
	font-size: 0.9rem;
	line-height: 1.6;
	word-break: keep-all;
}

/* Accent colors per board */
.board-archive-notice .board-archive-icon {
	background: #2563eb;
}

.board-archive-bulletin .board-archive-icon {
	background: #16a34a;
}

.board-archive-gallery .board-archive-icon {
	background: #db2777;
}

.board-archive-priest-board .board-archive-icon {
	background: #92400e;
}

.board-archive-generic .board-archive-icon {
	background: #64748b;
}

.board-archive-committee-board .board-archive-icon {
	background: #0d9488;
}

/* Gallery grid */
.gallery-grid {
	display: grid;
	grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
	gap: 1.5rem;
}

.gallery-grid-item {
	display: block;
	color: inherit;
	text-decoration: none;
}

.gallery-grid-thumb {
	aspect-ratio: 4 / 3;
	border-radius: 8px;
	background-color: #f0f0f0;
	background-size: cover;
	background-position: center;
	display: flex;
	align-items: center;
	justify-content: center;
	overflow: hidden;
}

.gallery-grid-placeholder {
	color: #bbb;
}

.gallery-grid-caption {
	display: flex;
	flex-direction: column;
	gap: 0.15rem;
	padding: 0.6rem 0.1rem;
}

.gallery-grid-title {
	font-size: 0.9rem;
	font-weight: 600;
	overflow: hidden;
	text-overflow: ellipsis;
	white-space: nowrap;
}

.gallery-grid-meta {
	display: flex;
	align-items: center;
	gap: 0.6rem;
	font-size: 0.8rem;
	color: #999;
}

.gallery-grid-date {
	font-variant-numeric: tabular-nums;
}

.gallery-grid-hit {
	display: inline-flex;
	align-items: center;
	gap: 0.2rem;
	font-variant-numeric: tabular-nums;
}

.gallery-grid-hit svg {
	color: #c4c4bc;
}

.gallery-grid-item:hover .gallery-grid-thumb {
	outline: 2px solid #db2777;
	outline-offset: 2px;
}

.search-results-page .board-archive-icon {
	background: #475569;
}

/* ---------------------------- 페이지 넘기기 ---------------------------- */
/* 공지사항만 68쪽이라 목록만큼이나 자주 쓰인다. */
.board-archive .pagination {
	margin-top: 2.5rem;
}

.board-archive .nav-links {
	display: flex;
	flex-wrap: wrap;
	justify-content: center;
	align-items: center;
	gap: 0.4rem;
}

.board-archive .page-numbers {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	min-width: 38px;
	height: 38px;
	padding: 0 0.7rem;
	border: 1px solid #e0e0da;
	border-radius: 8px;
	background: #fff;
	color: #444;
	font-size: 0.88rem;
	font-variant-numeric: tabular-nums;
	text-decoration: none;
	transition: border-color 0.15s ease, background-color 0.15s ease, color 0.15s ease;
}

.board-archive a.page-numbers:hover {
	border-color: #111;
	color: #111;
}

.board-archive .page-numbers.current {
	border-color: #111;
	background: #111;
	color: #fff;
	font-weight: 700;
}

.board-archive .page-numbers.dots {
	min-width: 1.5rem;
	padding: 0;
	border-color: transparent;
	background: none;
	color: #bbb;
}

.board-archive .page-numbers.prev,
.board-archive .page-numbers.next {
	font-size: 0.85rem;
	color: #666;
}

/* ---------------------------- 전체 게시판 ---------------------------- */
.board-archive .board-all-link {
	margin: 2.5rem 0 0;
	padding-top: 1.5rem;
	border-top: 1px solid #f0f0ec;
	font-size: 0.88rem;
}

.board-archive .board-all-link a {
	color: #888;
	text-decoration: none;
	transition: color 0.15s ease;
}

.board-archive .board-all-link a:hover {
	color: #111;
}

/* ---------------------------- 검색: 재검색 폼 ---------------------------- */
/* 결과가 많을 때 머리말까지 올라가지 않고 바로 다시 찾을 수 있게 둔다. */
.search-refine {
	display: flex;
	gap: 0.5rem;
	max-width: 32rem;
	margin: 0 0 2rem;
}

.search-refine-field {
	flex: 1 1 auto;
	min-width: 0;
	padding: 0.65rem 1.1rem;
	border: 1px solid #e0e0da;
	border-radius: 999px;
	background: #fafaf8;
	font-family: inherit;
	font-size: 0.92rem;
	color: #111;
	transition: border-color 0.15s ease, background-color 0.15s ease;
}

.search-refine-field::placeholder {
	color: #aaa;
}

.search-refine-field:focus {
	outline: none;
	border-color: #111;
	background: #fff;
}

.search-refine-submit {
	flex-shrink: 0;
	padding: 0.65rem 1.4rem;
	border: 0;
	border-radius: 999px;
	background: #111;
	color: #fff;
	font-family: inherit;
	font-size: 0.9rem;
	font-weight: 600;
	cursor: pointer;
	transition: background-color 0.15s ease;
}

.search-refine-submit:hover {
	background: #333;
}

.search-term {
	color: #111;
	font-weight: 700;
}

/* --------------------------- 검색: 게시판 배지 --------------------------- */
/* 여러 게시판 결과가 섞이므로 어느 게시판 글인지 함께 보여준다. */
.search-item-board {
	flex-shrink: 0;
	padding: 0.22rem 0.6rem;
	border: 1px solid #e8e8e4;
	border-radius: 6px;
	background: #fafaf8;
	font-size: 0.75rem;
	font-weight: 600;
	color: #777;
	text-align: center;
	white-space: nowrap;
	overflow: hidden;
	text-overflow: ellipsis;
}

.board-item-link:hover .search-item-board {
	border-color: #d8d8d2;
	color: #333;
}

/* --------------------------- 검색: 결과 없음 --------------------------- */
.search-empty {
	padding: 4rem 1.5rem 5rem;
	text-align: center;
	color: #666;
}

.search-empty-icon {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 72px;
	height: 72px;
	margin-bottom: 1.25rem;
	border-radius: 50%;
	background: #f4f4f1;
	color: #b8b8b0;
}

.search-empty-title {
	margin: 0 0 0.6rem;
	font-size: 1.1rem;
	font-weight: 700;
	color: #111;
}

.search-empty-desc {
	margin: 0;
	font-size: 0.92rem;
	line-height: 1.7;
	color: #888;
	word-break: keep-all;
}

@media (max-width: 600px) {
	.board-archive-header {
		padding: 2.25rem 0 1.5rem;
		gap: 0.3rem 0.9rem;
	}

	.board-archive-icon {
		width: 44px;
		height: 44px;
		border-radius: 12px;
	}

	.board-archive-header .page-title {
		font-size: 1.25rem;
		gap: 0.5rem;
	}

	.board-archive .page-numbers {
		min-width: 34px;
		height: 34px;
		padding: 0 0.5rem;
		font-size: 0.84rem;
	}

	.search-empty {
		padding: 3rem 0.5rem 4rem;
	}
}

/* ---------------------------- 글이 없을 때 ---------------------------- */
.board-empty {
	padding: 4rem 1.5rem;
	text-align: center;
}

.board-empty-icon {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 64px;
	height: 64px;
	margin-bottom: 1rem;
	border-radius: 50%;
	background: #f4f4f1;
	color: #b8b8b0;
}

.board-empty-title {
	margin: 0;
	font-size: 0.98rem;
	font-weight: 600;
	color: #888;
}

/* --------------------------- 위원회 고르기 --------------------------- */
.board-filter {
	display: flex;
	flex-wrap: wrap;
	gap: 0.45rem;
	margin-bottom: 1.75rem;
}

.board-filter-link {
	display: inline-flex;
	align-items: center;
	gap: 0.35rem;
	padding: 0.42rem 0.85rem;
	border: 1px solid #e0e0da;
	border-radius: 999px;
	background: #fff;
	color: #555;
	font-size: 0.84rem;
	font-weight: 600;
	text-decoration: none;
	white-space: nowrap;
	transition: border-color 0.15s ease, background-color 0.15s ease, color 0.15s ease;
}

.board-filter-link:hover {
	border-color: #111;
	color: #111;
}

.board-filter-link.is-current {
	border-color: #111;
	background: #111;
	color: #fff;
}

.board-filter-count {
	font-size: 0.74rem;
	font-weight: 400;
	opacity: 0.55;
}

@media (max-width: 600px) {
	.board-filter {
		flex-wrap: nowrap;
		overflow-x: auto;
		scrollbar-width: none;
	}

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