/*!
 * Styles for Special:Contribute page.
 */
@import 'mediawiki.skin.variables.less';

.mw-special-Contribute {
	.mw-contribute-wrapper {
		// Ensure this is user's specified font size.
		// This works around the fact that Vector skin uses 14px rather than 16px.
		font-size: 1rem;
	}

	.mw-contribute-tab {
		display: inline-block;
	}

	.mw-contribute-tabs-content {
		background-color: @background-color-neutral-subtle;
	}

	/* Flexbox gap not supported by all browsers */
	/* stylelint-disable-next-line plugin/no-unsupported-browser-features */
	.mw-contribute-content-area {
		display: flex;
		flex-flow: row wrap;
		gap: 24px 24px;
	}

	.mw-contribute-card {
		background-color: @background-color-base;
		border: @border-subtle;
		border-radius: @border-radius-base;
		box-shadow: 0 1px 2px 0 rgba( 0, 0, 0, 0.1 );
		text-decoration: none;

		&:hover {
			text-decoration: none;
		}

		&:last-of-type .mw-contribute-card-content {
			margin-bottom: 0;
		}
	}

	.mw-contribute-card-content {
		color: @color-base;
		padding: 12px;
	}

	.mw-contribute-card-title {
		font-weight: bold;
	}

	.mw-contribute-card-icon {
		padding-right: 8px;

		&--article {
			.cdx-mixin-css-icon( @cdx-icon-article );
		}

		&--language {
			.cdx-mixin-css-icon( @cdx-icon-language );
		}

		&--upload {
			.cdx-mixin-css-icon( @cdx-icon-upload );
		}

		&--lightbulb {
			.cdx-mixin-css-icon( @cdx-icon-lightbulb );
		}
	}

	.mw-contribute-card-description {
		padding-left: 28px;
		font-size: @font-size-base * 0.875;
	}

	.mw-contribute-card-action {
		color: @color-progressive;
		padding-left: 28px;
		padding-top: 4px;
		font-size: @font-size-base * 0.875;
		font-weight: bold;
	}

	// Narrow screens
	@media only screen and ( max-width: @max-width-breakpoint-mobile ) {
		/* stylelint-disable-next-line selector-class-pattern */
		.content {
			margin: 0;
		}

		.mw-contribute-content-area {
			padding: 24px 16px;
		}

		.mw-contribute-card {
			width: 100%;
		}
	}

	// Wide screens
	@media only screen and ( min-width: @min-width-breakpoint-tablet ) {
		.mw-contribute-content-area {
			padding: 32px;
		}

		.mw-contribute-card {
			// We need 2 cards per row. that is 50% width.
			// Then reduce 24px for column gap and 2px for border margins
			width: ~'calc(50% - (1/2)*24px - 2px)';
		}
	}
}
