/*
 * 상세 화면 인쇄(인쇄 단추·Ctrl+P). 본문 틀에 herb-print-root 를 단 화면에서만 동작한다.
 * 위 메뉴·폴더 탐색기·단추·추가/삭제 링크를 빼고, 본문을 한 장 폭으로, 입력 칸은 값만 찍는다.
 * 화면별로 더 뺄 것은 herb-print-hide 를 달거나 그 화면에 @media print 를 더한다.
 */
@media print {
	@page { size: A4; margin: 12mm 10mm; }

	body:has(.herb-print-root) { padding: 0 !important; background: #fff !important; }
	body:has(.herb-print-root) > header,
	body:has(.herb-print-root) #projectSubmenuNav,
	body:has(.herb-print-root) > nav,
	body:has(.herb-print-root) footer,
	body:has(.herb-print-root) .offcanvas,
	body:has(.herb-print-root) #llm-chat-widget,
	body:has(.herb-print-root) #toastContainer,
	body:has(.herb-print-root) #notification-container { display: none !important; }

	.herb-print-root #leftArea,
	.herb-print-root [class*="folder-navigator"],
	.herb-print-root .resizer,
	.herb-print-root .herb-detail-actions,
	.herb-print-root .herb-toolbar,
	.herb-print-root .breadcrumb,
	.herb-print-root .btn,
	.herb-print-root .herb-print-hide,
	.herb-print-root .modal,
	.herb-print-root .collapse:not(.show),
	.herb-print-root a:has(.bi-trash),
	.herb-print-root td:has(.bi-trash),
	.herb-print-root a:has(.unlink-icon),
	/* 창·접힌 칸을 여는 링크(추가·댓글·연결 등)는 종이에서 쓸 수 없다 */
	.herb-print-root a[data-bs-toggle="modal"],
	.herb-print-root a[data-bs-toggle="collapse"],
	.herb-print-root th.visually-hidden { display: none !important; }

	/* 본문을 한 장 폭으로(화면에서는 폴더 탐색기 옆 좁은 칸이라 제목이 세로로 찍혔다) */
	.herb-print-root, .herb-print-root > .row { margin: 0 !important; max-width: 100% !important; padding: 0 !important; }
	.herb-print-root #rightArea { flex: 0 0 100% !important; width: 100% !important; max-width: 100% !important; padding: 0 !important; }
	.herb-print-root .project-content-area,
	.herb-print-root .project-content-scroll { height: auto !important; max-height: none !important; overflow: visible !important; }
	.herb-print-root .table-responsive { overflow: visible !important; }
	.herb-print-root .card { background: #fff !important; border-color: #bbb !important; }
	.herb-print-root .bg-light { background: #fff !important; }

	/* 입력 칸은 값만 보이게 */
	.herb-print-root .form-control,
	.herb-print-root .form-select {
		border: 0 !important; background: none !important; box-shadow: none !important;
		padding: .1rem 0 !important; min-height: 0 !important; -webkit-appearance: none; appearance: none;
	}
	.herb-print-root .col-form-label { flex: 0 0 18%; max-width: 18%; font-weight: 600; padding-top: .1rem; padding-bottom: .1rem; }
	.herb-print-root .col-form-label + [class*="col-"] { flex: 1 0 0; max-width: none; }
	.herb-print-root .note-toolbar,
	.herb-print-root .note-statusbar,
	.herb-print-root .note-resizebar { display: none !important; }
	.herb-print-root .note-editor { border: 0 !important; }
	.herb-print-root .note-editable { height: auto !important; max-height: none !important; overflow: visible !important; padding: 0 !important; background: #fff !important; }

	/* 표: 줄이 쪽 사이에서 잘리지 않게, 선택 칸(체크박스)은 빼고 */
	.herb-print-root table { page-break-inside: auto; }
	.herb-print-root tr { break-inside: avoid; page-break-inside: avoid; }
	.herb-print-root th:has(> input[type="checkbox"]),
	.herb-print-root td:has(> input[type="checkbox"]) { display: none; }
	/* 연결 끊기 아이콘만 있는 마지막 칸(동작) */
	.herb-print-root table:has(.unlink-icon) th:last-child,
	.herb-print-root table:has(.unlink-icon) td:last-child { display: none; }
	.herb-print-root .badge,
	.herb-print-root .progress,
	.herb-print-root .progress-bar { -webkit-print-color-adjust: exact; print-color-adjust: exact; }
	.herb-print-root .badge { border: 1px solid #999; }
	.herb-print-root a { color: inherit !important; text-decoration: none !important; }

	/* 글씨는 조금 작게(종이에서는 화면보다 작아도 잘 읽힌다) */
	.herb-print-root { font-size: 10pt; }
	.herb-print-root h4, .herb-print-root .h4 { font-size: 13pt; }
	.herb-print-root h5, .herb-print-root .h5 { font-size: 12pt; }
	.herb-print-root h6, .herb-print-root .h6 { font-size: 10.5pt; }
	.herb-print-root .form-control, .herb-print-root .form-select,
	.herb-print-root .col-form-label, .herb-print-root .note-editable { font-size: 10pt !important; }
	.herb-print-root table, .herb-print-root .table { font-size: 9pt; }
	.herb-print-root small, .herb-print-root .small { font-size: 8pt; }
}
