/**
 * Modal styles for Social Previews
 */

@use "@automattic/jetpack-base-styles/gutenberg-base-styles" as gb;
@use "@automattic/jetpack-base-styles/root-variables";

// Styles shared between modals
.jetpack-social-previews__modal {

	.components-modal__header {
		margin: 0;
	}

	.components-modal__content {
		padding: 0;
	}
}

.jetpack-social-previews__modal--close-btn {
	position: absolute;
	right: 0.5rem;
	top: 0.5rem;
	height: 2rem;
}

// Main modal containing the social previews
.jetpack-social-previews__modal-previews {
	display: flex;
	flex-direction: column;
	height: 100%;

	.components-tab-panel__tabs-item:focus-visible::before {
		box-shadow: none;
		outline: none;
	}

	.components-tab-panel__tabs {
		display: flex;
		flex-direction: row;
		justify-content: center;
		height: 3rem;
		max-width: none;
		border-bottom: 1px solid var(--jp-gray);

		.components-button {
			outline: 0;
			font-size: 0;
			height: 100%;
			width: 2.5rem;
			white-space: nowrap;

			svg {
				display: block;
				fill: currentColor;
			}

			&.is-active::after {
				height: 0;
				border-bottom: 1px solid var(--jp-highlight);
				margin-bottom: -1px;
			}

			&:not(:disabled):not([aria-disabled="true"]):not(.is-secondary):not(.is-primary):not(.is-tertiary):not(.is-link):hover::after {
				border-bottom: 1px solid var(--jp-highlight);
				margin-bottom: -1px;
			}
		}
	}

	.components-tab-panel__tab-content {
		padding: 10px;
		background-color: gb.$white;
		flex: 1;
		overflow: auto;

		> div {
			display: flex;
			justify-content: center;
		}

		// Mastodon
		.mastodon-preview {
			max-width: 578px;
		}
	}

	@media ( min-width: gb.$break-small ) {
		width: calc(100vw - 40px);
	}

	@media ( min-width: gb.$break-large ) {
		width: calc(#{gb.$break-large} - 40px);

		.components-tab-panel__tabs {

			.components-button {
				font-size: 13px;
			}
		}

		.components-tab-panel__tab-content {
			padding: 40px;
		}
	}

	// Facebook
	.facebook-preview {
		width: 100%;
	}
}

// Modal containing the upgrade nudge
.jetpack-social-previews__modal-upgrade {
	padding: 2em;

	.jetpack-social-previews__upgrade-illustration {
		width: 100%;
		max-width: 351px;
		height: auto;
	}

	.jetpack-social-previews__upgrade-description {
		margin-bottom: 1em;
	}

	.jetpack-social-previews__upgrade-heading {
		font-size: 2em;
		line-height: 1.15;
	}

	.jetpack-social-previews__upgrade-feature-list {
		list-style: none;
		margin-bottom: 2em;
		padding-left: 1em;
		font-size: 1.1em;
		line-height: 1.4;

		li {
			position: relative;
			margin-bottom: 12px;

			&::before {
				content: "\2713 ";
				position: absolute;
				left: -20px;
				color: gb.$alert-green;
			}
		}
	}

	@media ( min-width: gb.$break-small ) {
		width: 80vw;
		max-width: 870px;
		display: grid;
		grid-gap: 3em;
		grid-template-columns: 1fr 1fr;
		padding-top: 4em;

		.jetpack-social-previews__upgrade-illustration {
			grid-column: 2;
			grid-row: 1;
			max-width: 100%;
			padding-right: 2em;
		}

		.jetpack-social-previews__upgrade-description {
			grid-column: 1;
			grid-row: 1;
			margin-bottom: 0;
			padding: 0 1em 1em;
		}

		.jetpack-social-previews__upgrade-heading {
			margin-top: 0;
		}

		.jetpack-social-previews__upgrade-feature-list {
			padding-left: 0;
		}
	}

	@media ( min-width: gb.$break-medium ) {

		.jetpack-social-previews__upgrade-description {
			padding: 0 2em 2em;
		}
	}
}

