/*
 * Product page layouts.
 *
 * Deliberately no fonts and no hard colors: text, links and headings inherit
 * from the active theme. Lines and tints are made from currentColor, so they
 * follow the theme in light and dark designs. Responsive behavior uses
 * container queries (the width of the place the layout sits in, such as a
 * narrow column or a phone), with a viewport fallback for older browsers.
 */
.ucp-pl-wrap {
	container-type: inline-size;
	container-name: ucp-pl;
	margin: 1.5em 0;
	max-width: 100%;
}

.ucp-pl {
	--ucp-pl-line: rgba(128, 128, 128, 0.3);
	--ucp-pl-tint: rgba(128, 128, 128, 0.08);
	--ucp-pl-gap: 1.5em;
	display: grid;
	gap: var(--ucp-pl-gap);
	max-width: 100%;
	overflow-wrap: anywhere;
}

@supports (color: color-mix(in srgb, red, blue)) {
	.ucp-pl {
		--ucp-pl-line: color-mix(in srgb, currentColor 22%, transparent);
		--ucp-pl-tint: color-mix(in srgb, currentColor 6%, transparent);
	}
}

.ucp-pl-section {
	min-width: 0;
}

.ucp-pl-section__title {
	margin: 0 0 0.6em;
}

.ucp-pl a {
	overflow-wrap: anywhere;
}

.ucp-pl img {
	max-width: 100%;
	height: auto;
}

.ucp-pl-fallback {
	opacity: 0.7;
}

/* Text block */
.ucp-pl-text > :first-child,
.ucp-pl-paragraph:first-child {
	margin-top: 0;
}

.ucp-pl-paragraph {
	margin: 0.5em 0;
}

/* Specification table */
.ucp-pl-table {
	width: 100%;
	border-collapse: collapse;
	table-layout: auto;
}

.ucp-pl-table th,
.ucp-pl-table td {
	padding: 0.6em 0.8em;
	border-bottom: 1px solid var(--ucp-pl-line);
	text-align: start;
	vertical-align: top;
	font-style: normal;
}

.ucp-pl-table th {
	width: 35%;
	font-weight: 600;
}

.ucp-pl-table td p:first-child {
	margin-top: 0;
}

.ucp-pl-table td p:last-child {
	margin-bottom: 0;
}

/* Icon list */
.ucp-pl-icons,
.ucp-pl-features,
.ucp-pl-downloads {
	margin: 0;
	padding: 0;
	list-style: none;
}

.ucp-pl-icons {
	display: grid;
	grid-template-columns: repeat(auto-fit, minmax(14em, 1fr));
	gap: 0.8em 1.5em;
}

.ucp-pl-icons__item {
	display: flex;
	gap: 0.6em;
	align-items: flex-start;
}

.ucp-pl-icon {
	flex: none;
	margin-top: 0.15em;
}

.ucp-pl-icons__label {
	font-weight: 600;
}

/* Accordion */
.ucp-pl-acc {
	border-bottom: 1px solid var(--ucp-pl-line);
}

.ucp-pl-acc:first-child {
	border-top: 1px solid var(--ucp-pl-line);
}

.ucp-pl-acc__summary {
	display: flex;
	justify-content: space-between;
	gap: 1em;
	align-items: center;
	padding: 0.8em 0;
	font-weight: 600;
	cursor: pointer;
	list-style: none;
}

.ucp-pl-acc__summary::-webkit-details-marker {
	display: none;
}

.ucp-pl-acc__summary::after {
	content: "+";
	flex: none;
	font-weight: 400;
	line-height: 1;
}

.ucp-pl-acc[open] > .ucp-pl-acc__summary::after {
	content: "\2212";
}

.ucp-pl-acc__summary:focus-visible,
.ucp-pl-tabs__tab:focus-visible,
.ucp-pl-tabs__panel:focus-visible {
	outline: 2px solid currentColor;
	outline-offset: 2px;
}

.ucp-pl-acc__body {
	padding: 0 0 1em;
}

.ucp-pl-acc__body > :first-child {
	margin-top: 0;
}

/* Tabs */
.ucp-pl-tabs__list {
	display: none;
}

.ucp-pl-tabs.is-ready .ucp-pl-tabs__list {
	display: flex;
	flex-wrap: wrap;
	gap: 0.25em;
	border-bottom: 1px solid var(--ucp-pl-line);
}

.ucp-pl-tabs.is-ready .ucp-pl-tabs__panel-title {
	position: absolute;
	width: 1px;
	height: 1px;
	margin: -1px;
	padding: 0;
	overflow: hidden;
	clip: rect(0, 0, 0, 0);
	white-space: nowrap;
	border: 0;
}

.ucp-pl-tabs__tab {
	appearance: none;
	margin: 0 0 -1px;
	padding: 0.6em 1em;
	border: 1px solid transparent;
	border-bottom: 0;
	border-radius: 0.3em 0.3em 0 0;
	background: transparent;
	color: inherit;
	font: inherit;
	opacity: 0.75;
	cursor: pointer;
}

.ucp-pl-tabs__tab[aria-selected="true"] {
	opacity: 1;
	font-weight: 600;
	border-color: var(--ucp-pl-line);
	background: var(--ucp-pl-tint);
}

.ucp-pl-tabs__panel {
	padding: 1em 0;
}

.ucp-pl-tabs.is-ready .ucp-pl-tabs__panel[hidden] {
	display: none;
}

.ucp-pl-tabs__panel-title {
	margin: 0 0 0.4em;
}

.ucp-pl-tabs__panel > :last-child {
	margin-bottom: 0;
}

/* Highlight box */
.ucp-pl-highlight {
	padding: 1em 1.2em;
	border: 1px solid var(--ucp-pl-line);
	border-radius: 0.4em;
	background: var(--ucp-pl-tint);
}

.ucp-pl-section--accent .ucp-pl-highlight {
	border-inline-start: 0.3em solid currentColor;
}

.ucp-pl-section--notice .ucp-pl-highlight {
	border-style: dashed;
	border-width: 2px;
}

.ucp-pl-highlight > :first-child {
	margin-top: 0;
}

.ucp-pl-highlight > :last-child {
	margin-bottom: 0;
}

/* Definition lists (highlight, image and text) */
.ucp-pl-defs {
	margin: 0;
}

.ucp-pl-defs__row {
	display: flex;
	flex-wrap: wrap;
	gap: 0.25em 0.8em;
	padding: 0.3em 0;
}

.ucp-pl-defs dt {
	font-weight: 600;
}

.ucp-pl-defs dd {
	margin: 0;
}

/* Image and text */
.ucp-pl-media {
	display: grid;
	grid-template-columns: minmax(0, 2fr) minmax(0, 3fr);
	gap: 1.5em;
	align-items: center;
}

.ucp-pl-media--right .ucp-pl-media__figure {
	order: 2;
}

.ucp-pl-media__figure {
	margin: 0;
}

.ucp-pl-media__image {
	display: block;
	width: 100%;
	border-radius: 0.3em;
}

/* Feature list */
.ucp-pl-features {
	display: grid;
	grid-template-columns: repeat(auto-fit, minmax(16em, 1fr));
	gap: 0.5em 1.5em;
}

.ucp-pl-features__item {
	position: relative;
	padding-inline-start: 1.4em;
}

.ucp-pl-features__item::before {
	content: "";
	position: absolute;
	inset-inline-start: 0.2em;
	top: 0.55em;
	width: 0.45em;
	height: 0.45em;
	border-radius: 50%;
	background: currentColor;
}

.ucp-pl-features__label {
	font-weight: 600;
}

/* Downloads */
.ucp-pl-downloads__item {
	padding: 0.5em 0;
	border-bottom: 1px solid var(--ucp-pl-line);
}

.ucp-pl-downloads__label {
	font-weight: 600;
}

/* Narrow places: phones, narrow columns. */
@container ucp-pl (max-width: 37.5em) {
	.ucp-pl {
		--ucp-pl-gap: 1.2em;
	}

	.ucp-pl-table,
	.ucp-pl-table tbody,
	.ucp-pl-table tr,
	.ucp-pl-table th,
	.ucp-pl-table td {
		display: block;
		width: 100%;
	}

	.ucp-pl-table tr {
		padding: 0.5em 0;
		border-bottom: 1px solid var(--ucp-pl-line);
	}

	.ucp-pl-table th,
	.ucp-pl-table td {
		padding: 0.1em 0;
		border: 0;
	}

	.ucp-pl-media {
		grid-template-columns: minmax(0, 1fr);
	}

	.ucp-pl-media--right .ucp-pl-media__figure {
		order: 0;
	}

	.ucp-pl-tabs.is-ready .ucp-pl-tabs__list {
		flex-wrap: nowrap;
		overflow-x: auto;
		-webkit-overflow-scrolling: touch;
	}

	.ucp-pl-tabs__tab {
		flex: none;
		min-height: 44px;
	}

	.ucp-pl-acc__summary {
		min-height: 44px;
	}

	.ucp-pl-icons,
	.ucp-pl-features {
		grid-template-columns: minmax(0, 1fr);
	}
}

/* Browsers without container queries: follow the viewport. */
@supports not (container-type: inline-size) {
	@media (max-width: 600px) {
		.ucp-pl-table,
		.ucp-pl-table tbody,
		.ucp-pl-table tr,
		.ucp-pl-table th,
		.ucp-pl-table td {
			display: block;
			width: 100%;
		}

		.ucp-pl-media {
			grid-template-columns: minmax(0, 1fr);
		}

		.ucp-pl-icons,
		.ucp-pl-features {
			grid-template-columns: minmax(0, 1fr);
		}
	}
}

@media print {
	.ucp-pl-tabs .ucp-pl-tabs__list {
		display: none !important;
	}

	.ucp-pl-tabs .ucp-pl-tabs__panel[hidden] {
		display: block !important;
	}
}
