@import "@wordpress/base-styles/breakpoints";
@import "@wordpress/base-styles/mixins";

.themes-list {
	display: grid;
	grid-template-columns: 100%;
	list-style: none;
	padding: 0;
	margin: 0 -10px; // items flush against list edge

	@include break-small {
		$theme-item-min-width: 320px;
		$theme-item-horizontal-margin: 32px; // Keep using margin as there might be an empty row

		display: grid;
		grid-template-columns: repeat(auto-fill, minmax($theme-item-min-width + $theme-item-horizontal-margin, 1fr));
	}

	.feature-example & {
		max-width: 1000px;
		margin: auto;
	}

	.second-upsell-wrapper {
		grid-column: 1/-1;
		grid-row-start: 7;
		padding: 0 16px;

		.upsell-nudge {
			margin-top: 0 !important;
			margin-bottom: 2rem !important;
		}
	}
}

.themes-list__empty-search-text {
	color: var(--studio-gray-60);
	margin-top: 48px;
	margin-bottom: 32px;
}

.themes-list__options {
	background-color: var(--studio-white);
	border-radius: 4px;
	padding: 20px;
	border: 1px solid var(--studio-gray-5);
	text-align: center;

	@include break-small {
		padding: 40px;
	}

	.themes-list & {
		grid-column: 1/-1;
		margin: 0 16px;
	}

	.themes-list__options-heading {
		font-size: 1.25rem;
		font-weight: 500;
		margin-bottom: 12px;
	}

	.themes-list__options-subheading {
		color: var(--studio-gray-60);
		margin-bottom: 20px;

		@include break-small {
			margin-bottom: 60px;
		}
	}

	.themes-list__option {
		display: block;
		margin: 20px auto;
		width: 100%;

		@include break-small {
			display: flex;
			max-width: 600px;
			margin-top: 40px;
			margin-bottom: 40px;
		}
	}

	.themes-list__option-icon {
		display: none;
		margin-right: 16px;
		flex-shrink: 0;

		@include break-small {
			display: block;
		}
	}

	.themes-list__option-content {
		display: flex;
		border-bottom: 1px solid var(--studio-gray-5);
		padding-bottom: 20px;
		flex-direction: column;
		gap: 16px;
		width: 100%;

		@include break-mobile {
			flex-direction: row;
		}

		@include break-small {
			padding-bottom: 40px;
		}
	}

	.themes-list__option-text {
		text-align: left;
	}

	.themes-list__option-button {
		white-space: nowrap;
		height: fit-content;
		overflow: visible;
		align-self: center;
		display: inline-block;

		@include break-mobile {
			margin-left: auto;
		}
	}

	.themes-list__option-title {
		font-weight: 500;
		margin-bottom: 8px;
	}

	.themes-list__option-description {
		color: var(--studio-gray-60);
		font-size: 0.875rem;

		> ul {
			color: var(--studio-gray-60);
			counter-reset: li;
			display: flex;
			flex-direction: column;
			font-size: 0.875rem;
			font-weight: 400;
			gap: 12px;
			line-height: 20px;
			list-style-type: none;
			margin: 0;

			> li {
				align-items: center;
				display: flex;
				padding-left: 28px;
				position: relative;

				&::before {
					align-items: center;
					border: 0.909px solid var(--studio-gray-80);
					border-radius: 50%;
					box-sizing: border-box;
					color: var(--studio-gray-80);
					content: counter(li);
					counter-increment: li;
					display: flex;
					font-size: 10.909px;
					font-weight: 400;
					height: 20px;
					justify-content: center;
					left: 0;
					letter-spacing: -0.061px;
					line-height: 20px;
					position: absolute;
					top: 0;
					width: 20px;
				}
			}
		}
	}

	.themes-list__option:last-child {
		margin-bottom: 0;

		.themes-list__option-content {
			border-bottom: none;
			padding-bottom: 0;

			@include break-small {
				padding-bottom: 20px;
			}
		}
	}
}

.theme-showcase.is-collection-view {
	.themes-list {
		grid-template-columns: repeat(1, 1fr);

		@include breakpoint-deprecated( ">660px" ) {
			grid-template-columns: repeat(2, 1fr);
		}
		@include break-xlarge {
			grid-template-columns: repeat(3, 1fr);
		}
	}
}
