/* --- Custom CSS Grid Alignment --- */
.custom-schedule-grid {
	display: grid !important;
	grid-template-columns: repeat(2, 1fr) !important; /* Force 2 wide columns instead of 3 squished ones */
	gap: 20px !important;
	width: 100% !important;
	box-sizing: border-box !important;
	margin-bottom: 20px !important;
}

/* Ensure child wrappers fill up space properly */
.custom-grid-item {
	display: flex !important;
	flex-direction: column !important;
	width: 100% !important;
}

/* --- Box Formatting Rules --- */
.m-schedule-item {
	border: 3px solid #1eb3ed !important;
	width: 100% !important;             
	flex-grow: 1 !important;            
	
	min-height: 120px !important;       
	height: auto !important; 
	
	display: flex !important;
	align-items: center !important;     
	justify-content: center !important;
	padding: 20px 15px !important;      
	box-sizing: border-box !important;
	
	/* Absolute lockdown against text leaks */
	overflow: hidden !important; 
	position: relative !important;
}

.m-schedule-item .text-wrapper {
	width: 100% !important;
	text-align: center !important;
	/* Breaks extremely long compounds like "образовательного" onto new lines safely */
	word-break: break-word !important;
	overflow-wrap: break-word !important;
}

/* --- Fluid Text Engine (Scales elegantly with window width) --- */
.m-schedule-item .text-wrapper div {
	font-size: clamp(14px, 1.2vw, 18px) !important;
	line-height: 1.4 !important;
	font-weight: bold !important;
}

.m-schedule-item .text-wrapper div.long-text {
	font-size: clamp(13px, 1.1vw, 16px) !important;
	line-height: 1.4 !important;
	font-weight: bold !important;
}

.m-schedule-item .text-wrapper .text-sub-color {
	font-size: clamp(12px, 1vw, 14px) !important;
	font-weight: normal !important;
	margin-top: 4px !important;
}

.m-schedule-item .text-wrapper .divider {
	height: 2px !important;
	border: none !important;
	background-color: #1eb3ed !important;
	margin: 10px 0 !important; 
}

/* National Testing Center Link style corrections */
.m-schedule-item .text-wrapper .test-center-link {
	display: inline-block !important;
	font-size: clamp(11px, 0.8vw, 12px) !important;
	font-weight: bold !important;
	margin-top: 10px !important;
	text-decoration: underline !important;
	color: #1eb3ed !important;
}

/* --- Mobile Responsive Rules --- */
@media only screen and (max-width: 840px) {
	.custom-schedule-grid {
		grid-template-columns: 1fr !important; /* Stacks 100% full width on mobile screens */
		gap: 15px !important;
	}
	
	.m-schedule-item {
		min-height: 0 !important;
		padding: 20px 15px !important;
	}

	.m-schedule-item .text-wrapper div { font-size: 16px !important; }
	.m-schedule-item .text-wrapper div.long-text { font-size: 14px !important; }
	.m-schedule-item .text-wrapper .text-sub-color { font-size: 13px !important; }
}