/*
 * FDSH Project Links Fix v1.0.0
 * Layout-only corrections. No content changes.
 */

/* Keep cards aligned within each grid row. */
.elementor-widget-fdsh_project_links .fdsh-project-links__grid,
[data-widget_type^="fdsh_project_links"] .fdsh-project-links__grid {
	align-items: stretch;
}

/* Each card becomes a predictable vertical layout. */
.elementor-widget-fdsh_project_links .fdsh-project-links__item,
[data-widget_type^="fdsh_project_links"] .fdsh-project-links__item {
	display: flex;
	flex-direction: column;
	min-width: 0;
	height: 100%;
}

/*
 * Uniform media height. The wrapper custom properties are populated from the
 * widget's existing responsive Media Height setting. Legacy % values are
 * converted to a deterministic px height by PHP.
 */
.elementor-widget-fdsh_project_links.fdsh-project-links-fixed .fdsh-project-links__media,
[data-widget_type^="fdsh_project_links"].fdsh-project-links-fixed .fdsh-project-links__media {
	height: var(--fdsh-project-media-height, 220px) !important;
	flex: 0 0 auto;
	overflow: hidden;
}

.elementor-widget-fdsh_project_links .fdsh-project-links__media img,
[data-widget_type^="fdsh_project_links"] .fdsh-project-links__media img {
	display: block;
	width: 100%;
	height: 100%;
	max-width: none;
	object-fit: cover;
}

/* Description absorbs remaining card height, naturally pushing CTA downward. */
.elementor-widget-fdsh_project_links .fdsh-project-links__text,
[data-widget_type^="fdsh_project_links"] .fdsh-project-links__text {
	flex: 1 1 auto;
	min-height: 0;
}

/* Keep the CTA at the bottom while preserving its existing style controls. */
.elementor-widget-fdsh_project_links .fdsh-project-links__item > .fdsh-button,
[data-widget_type^="fdsh_project_links"] .fdsh-project-links__item > .fdsh-button {
	margin-top: auto;
	width: max-content;
	max-width: 100%;
}

@media (max-width: 1024px) {
	.elementor-widget-fdsh_project_links.fdsh-project-links-fixed .fdsh-project-links__media,
	[data-widget_type^="fdsh_project_links"].fdsh-project-links-fixed .fdsh-project-links__media {
		height: var(--fdsh-project-media-height-tablet, 210px) !important;
	}
}

@media (max-width: 767px) {
	.elementor-widget-fdsh_project_links.fdsh-project-links-fixed .fdsh-project-links__media,
	[data-widget_type^="fdsh_project_links"].fdsh-project-links-fixed .fdsh-project-links__media {
		height: var(--fdsh-project-media-height-mobile, 200px) !important;
	}
}
