/* ===== 서식자료실 목록 (법률구조공단 자료실 스타일) ===== */

.fa-wrap {
	max-width: 100%;
	margin: 2rem 0;
	font-size: 14px;
	line-height: 1.5;
	color: #333;
}

.fa-error {
	padding: 0.875rem 1rem;
	color: #b00020;
	background: #fdecea;
	border: 1px solid #f5c6cb;
	border-radius: 2px;
}

/* ── 상단 툴바: 검색(우측) + 총 n건(좌측) ── */
.fa-wrap {
	display: grid;
	grid-template-columns: 1fr;
	grid-template-rows: auto auto auto auto;
}

.fa-search-form {
	grid-row: 1;
	grid-column: 1;
	justify-self: end;
	align-self: start;
	display: flex;
	flex-wrap: nowrap;
	align-items: stretch;
	gap: 0.35rem;
	margin: 0 0 0.35rem;
	padding: 0;
	background: none;
	border: none;
	border-radius: 0;
	max-width: 100%;
}

.fa-search-input {
	width: 350px;
	max-width: 100%;
	min-width: 0;
	box-sizing: border-box;
	height: 34px;
	padding: 0 0.6rem;
	border: 1px solid #b0b8c1;
	border-radius: 2px;
	font-size: 14px;
	line-height: 1.2;
	color: #333;
	background: #fff;
}

.fa-search-input:focus {
	outline: none;
	border-color: #003876;
	box-shadow: 0 0 0 2px rgba(0, 56, 118, 0.12);
}

.fa-search-btn {
	box-sizing: border-box;
	height: 34px;
	padding: 0 0.9rem;
	background: #003876;
	color: #fff;
	border: 1px solid #003876;
	border-radius: 2px;
	cursor: pointer;
	font-size: 14px;
	white-space: nowrap;
	line-height: 1.2;
	display: inline-flex;
	align-items: center;
	justify-content: center;
}

.fa-search-btn:hover {
	background: #002a57;
	border-color: #002a57;
}

.fa-search-reset {
	font-size: 13px;
	color: #666;
	text-decoration: underline;
	margin-left: 0.25rem;
}

.fa-search-reset:hover {
	color: #003876;
}

.fa-result-count {
	grid-row: 2;
	grid-column: 1;
	justify-self: start;
	align-self: start;
	margin: 0 0 0.625rem;
	padding: 0;
	font-size: 14px;
	color: #444;
}

.fa-result-count strong {
	color: #003876;
	font-weight: 700;
}

/* ── 테이블 ── */
.fa-table-responsive {
	grid-row: 3;
	overflow-x: auto;
	-webkit-overflow-scrolling: touch;
	border-top: 2px solid #003876;
	border-bottom: 1px solid #c8cdd3;
}

.fa-table {
	width: 100%;
	border-collapse: collapse;
	background: #fff;
	table-layout: fixed;
}

.fa-table thead {
	background: #003876;
	color: #fff;
}

.fa-table th {
	padding: 0.55rem 0.75rem;
	font-size: 14px;
	font-weight: 600;
	text-align: center;
	border: none;
	letter-spacing: -0.01em;
}

.fa-table td {
	padding: 0.5rem 0.75rem;
	text-align: center;
	border-bottom: 1px solid #e4e7eb;
	vertical-align: middle;
	font-size: 14px;
}

.fa-table tbody tr:nth-child(even) {
	background: #f8f9fb;
}

.fa-table tbody tr:hover {
	background: #eef3f8;
}

.fa-table tbody tr:last-child td {
	border-bottom: none;
}

/* 번호: 좁게, 가운데 */
.fa-col-no {
	width: 56px;
	text-align: center;
}

.fa-table th.fa-col-no,
.fa-table td.fa-col-no {
	text-align: center;
}

/* 제목: 넓게, 왼쪽 */
.fa-col-title {
	width: auto;
	text-align: left;
}

.fa-table th.fa-col-title,
.fa-table td.fa-col-title {
	text-align: left;
}

.fa-col-title a {
	color: #003876;
	text-decoration: none;
	font-weight: 400;
}

.fa-col-title a:hover {
	text-decoration: underline;
	color: #003876;
}

/* 등록일: 좁게, 가운데 */
.fa-col-date {
	width: 110px;
	white-space: nowrap;
	color: #555;
	text-align: center;
}

.fa-table th.fa-col-date,
.fa-table td.fa-col-date {
	text-align: center;
}

/* ── 페이지네이션 ── */
.fa-pagination {
	grid-row: 4;
	margin-top: 1.25rem;
}

.fa-page-list {
	display: flex;
	flex-wrap: wrap;
	justify-content: center;
	gap: 0.25rem;
	list-style: none;
	margin: 0;
	padding: 0;
}

.fa-page-list a,
.fa-page-list span {
	display: inline-block;
	min-width: 2rem;
	padding: 0.35rem 0.5rem;
	text-align: center;
	border: 1px solid #c8cdd3;
	border-radius: 2px;
	text-decoration: none;
	color: #444;
	font-size: 13px;
	line-height: 1.4;
	background: #fff;
}

.fa-page-list a:hover {
	background: #eef3f8;
	border-color: #003876;
	color: #003876;
}

.fa-page-current {
	background: #003876 !important;
	border-color: #003876 !important;
	color: #fff !important;
	font-weight: 600;
}

.fa-page-dots {
	border: none;
	background: none;
	color: #999;
	min-width: auto;
	padding: 0.35rem 0.2rem;
}

.fa-no-results {
	padding: 1.5rem;
	text-align: center;
	color: #666;
	background: #f8f9fb;
	border: 1px solid #e4e7eb;
	border-top: 2px solid #003876;
}

/* ── 모바일 ── */
@media (max-width: 768px) {
	.fa-search-form {
		justify-self: end;
		width: 100%;
		max-width: 100%;
		flex-wrap: wrap;
		justify-content: flex-end;
	}

	.fa-search-input {
		flex: 1 1 200px;
		width: 350px;
		max-width: 100%;
	}

	.fa-result-count {
		margin-bottom: 0.5rem;
	}
}

@media (max-width: 640px) {
	.fa-wrap {
		font-size: 13px;
	}

	.fa-search-form {
		flex-direction: row;
		align-items: stretch;
	}

	.fa-search-btn {
		flex-shrink: 0;
	}

	/* 카드형 목록 */
	.fa-table-responsive {
		overflow-x: visible;
		border-top: 2px solid #003876;
		border-bottom: 1px solid #c8cdd3;
	}

	.fa-table thead {
		display: none;
	}

	.fa-table,
	.fa-table tbody,
	.fa-table tr,
	.fa-table td {
		display: block;
		width: 100%;
	}

	.fa-table tr {
		padding: 0.625rem 0.875rem;
		border-bottom: 1px solid #e4e7eb;
	}

	.fa-table tbody tr:nth-child(even),
	.fa-table tbody tr:hover {
		background: #f8f9fb;
	}

	.fa-table tr:last-child {
		border-bottom: none;
	}

	.fa-table td {
		text-align: left;
		padding: 0.2rem 0;
		border: none;
	}

	.fa-table td::before {
		content: attr(data-label);
		display: inline-block;
		min-width: 3.25rem;
		margin-right: 0.5rem;
		font-weight: 600;
		color: #003876;
		font-size: 12px;
	}

	.fa-col-no::before {
		content: "번호";
	}

	.fa-col-title {
		margin-bottom: 0.15rem;
	}

	.fa-col-title a {
		font-size: 14px;
		line-height: 1.45;
	}

	.fa-col-date {
		font-size: 12px;
		color: #777;
	}
}

/* 초소형: 가로 스크롤 테이블 유지 옵션 (선택적 fallback) */
@media (max-width: 400px) {
	.fa-search-form {
		flex-wrap: wrap;
	}

	.fa-search-input {
		flex: 1 1 100%;
	}
}
