/* 
 * Custom Tables - Base Styles
 */

.custom-table-wrapper {
	width: 100%;
	margin-bottom: 30px;
	padding: 40px; /* Generous padding around the list like the UI */
	background-color: var(--ct-bg-color);
	/* The following variables are set dynamically inline by the parent shortcode,
	   but we provide fallbacks here just in case. */
	--ct-text-color: #1a1a1a;
	--ct-link-color: #e5003a;
	--ct-border-color: #1a1a1a;
	--ct-bg-color: #f4f4f4;
}

.custom-table-inner {
	display: flex;
	flex-direction: column;
}

.custom-table-header-row {
	display: flex;
	flex-direction: row;
	align-items: center;
	padding: 0 0 15px 0;
	border-bottom: 2px solid var(--ct-border-color);
	margin-bottom: 0;
	gap: 15px;
}

.custom-table-header-col {
	flex: 1;
	display: flex;
	flex-direction: column;
	justify-content: center;
}

.custom-table-header-col:first-child {
	align-items: flex-start;
	text-align: left;
}

.custom-table-header-col:last-child {
	align-items: flex-end;
	text-align: right;
}

.custom-table-heading {
	font-size: 16px;
	font-weight: 500;
	text-transform: uppercase;
	color: var(--ct-text-color);
	opacity: 0.9;
}

.custom-table-row {
	display: flex;
	flex-direction: row;
	align-items: center;
	background-color: transparent;
	border-bottom: 1px solid var(--ct-border-color);
	padding: 20px 0;
	color: var(--ct-text-color);
	transition: background-color 0.3s ease;
	gap: 15px; /* Spacing between columns */
}

.custom-table-col {
	flex: 1; /* Distribute available space equally among columns */
	display: flex;
	flex-direction: column;
	justify-content: center;
}

.custom-table-col:first-child {
	align-items: flex-start;
	text-align: left;
}

.custom-table-col:last-child {
	align-items: flex-end;
	text-align: right;
}

.custom-table-text {
	font-size: 16px;
	line-height: 1.5;
	word-break: break-word;
}

.custom-table-link {
	color: var(--ct-link-color);
	font-size: 16px;
	line-height: 1.5;
	text-decoration: underline;
	font-weight: 500;
	transition: color 0.3s ease, opacity 0.3s ease;
	word-break: break-word;
}

.custom-table-link:hover {
	opacity: 0.8;
}

/* 
 * Responsive Design 
 */
@media screen and (max-width: 768px) {
	.custom-table-wrapper {
		padding: 20px 15px;
	}

	.custom-table-header-row {
		padding: 0 0 10px 0;
	}

	.custom-table-row {
		padding: 15px 0;
	}

	.custom-table-heading {
		font-size: 14px;
	}

	.custom-table-text,
	.custom-table-link {
		font-size: 14px;
	}
}

@media screen and (max-width: 480px) {
	/* For very small screens, if the row text is very long, we can allow it to stack natively 
	   but keep it left aligned instead of centering it */
	.custom-table-header-row,
	.custom-table-row {
		flex-direction: column;
		align-items: flex-start;
		gap: 8px;
	}

	.custom-table-col:first-child,
	.custom-table-col:last-child,
	.custom-table-col,
	.custom-table-header-col:first-child,
	.custom-table-header-col:last-child,
	.custom-table-header-col {
		width: 100%;
		align-items: flex-start;
		text-align: left;
	}
}
