/*
 * School Result Plugin — Print Stylesheet
 * Ensures school header and full result sheet print correctly.
 */

@media print {

	/* 1. Safely hide common theme elements and plugin forms without crashing flexbox layouts */
	header, footer, nav, aside, #wpadminbar, .site-header, .site-footer, .sidebar, .widget-area {
		display: none !important;
	}

	/* 4. Ensure result sheet resets theme flow impacts */
	#sr-result-sheet {
		width: 100% !important;
		margin: 0 !important;
		padding: 15mm 15mm 10mm 15mm !important;
		border: none !important;
		background: #fff !important;
		font-family: Arial, Helvetica, sans-serif !important;
		font-size: 11pt !important;
		color: #000 !important;
		-webkit-print-color-adjust: exact !important;
		print-color-adjust: exact !important;
	}

	/* 5. School header — must print */
	.sr-school-header {
		display: flex !important;
		visibility: visible !important;
		text-align: center;
		justify-content: center;
		align-items: center;
		gap: 16px;
		margin-bottom: 10px;
	}
	.sr-school-logo img {
		max-height: 60px;
		max-width: 60px;
	}
	.sr-school-name {
		font-size: 16pt;
		font-weight: bold;
		color: #000 !important;
		text-transform: uppercase;
		margin: 0 0 4px 0;
	}
	.sr-school-address,
	.sr-school-contact {
		font-size: 10pt;
		margin: 2px 0;
		color: #333;
	}
	.sr-exam-title {
		font-size: 13pt;
		font-weight: bold;
		margin: 6px 0 0 0;
		text-transform: uppercase;
	}
	.sr-divider {
		border-top: 2px solid #000 !important;
		margin: 8px 0;
	}

	/* 6. Student info section */
	.sr-student-section {
		display: flex !important;
	}
	.sr-info-table td {
		font-size: 10pt;
		padding: 3px 5px;
	}
	.sr-student-name {
		font-weight: bold;
		font-size: 11pt;
	}

	/* 7. Photo */
	.sr-photo-img {
		width: 90px;
		height: 110px;
		object-fit: cover;
		border: 1px solid #333;
	}
	.sr-photo-placeholder {
		width: 90px;
		height: 110px;
		border: 1px dashed #666;
	}

	/* 8. Marks table */
	.sr-result-table {
		width: 100%;
		border-collapse: collapse;
		font-size: 10pt;
		margin-top: 8px;
	}
	.sr-result-table th,
	.sr-result-table td {
		border: 1px solid #333 !important;
		padding: 4px 6px;
	}
	.sr-result-table th {
		background: #ddd !important;
		-webkit-print-color-adjust: exact;
		print-color-adjust: exact;
	}
	.sr-totals-row td {
		background: #eee !important;
		font-weight: bold;
		-webkit-print-color-adjust: exact;
		print-color-adjust: exact;
	}
	.sr-sub-pass { color: #006000 !important; }
	.sr-sub-fail { color: #c00000 !important; font-weight: bold; }

	/* 9. Summary */
	.sr-summary-table td { font-size: 11pt; padding: 4px 6px; }
	.sr-status-pass { color: #006000 !important; }
	.sr-status-fail { color: #c00000 !important; }

	/* 10. Hide action buttons */
	.sr-result-actions,
	.sr-noprint,
	#sr-search-form,
	.sr-search-box,
	#wpadminbar {
		display: none !important;
		visibility: hidden !important;
	}

	/* 11. Print footer — show it */
	.sr-print-footer {
		display: block !important;
		visibility: visible !important;
		margin-top: 20px;
		text-align: center;
		font-size: 9pt;
		color: #666;
		border-top: 1px solid #ddd;
		padding-top: 6px;
	}

	/* 12. Page setup */
	@page {
		size: A4 portrait;
		margin: 0;
	}
}
