/* DPI converter: the photo with "in your file" and "after" side by side under it, on one side; the new DPI,
   what changes, the unit and the download on the other.
   The layout of the two sides is the shared one of the photo tools (.pst-photo in assets/css/tools.css).
   ========================================================================== */

/* The whole photo, fitted into the box whatever its shape. */
.pst-dpi__view {
	--pst-dpi-tall: 380px;
	display: grid;
	place-items: center;
	min-height: 220px;
	padding: 14px;
	border-radius: 20px;
	background: var(--pst-ink);
	overflow: hidden;
}

.pst-dpi__frame {
	width: min(100%, calc(var(--pst-dpi-tall) * var(--pst-dpi-ratio, 0.8)));
	aspect-ratio: var(--pst-dpi-ratio, 0.8);
}

.pst-dpi__frame canvas {
	display: block;
	width: 100%;
	height: 100%;
	border-radius: 4px;
	/* See-through parts show the usual grey squares behind them. */
	background: #FFFFFF repeating-conic-gradient(#D9DDE4 0 25%, transparent 0 50%) 0 0 / 16px 16px;
}

/* "In your file" and "After": three rows, the changed values in bold. */
.pst .pst-dpi__compare {
	width: 100%;
	border-collapse: collapse;
	font-size: 15px;
	font-variant-numeric: tabular-nums;
	table-layout: fixed;
}

.pst .pst-dpi__compare th,
.pst .pst-dpi__compare td {
	padding: 10px 8px;
	border-bottom: 1px solid var(--pst-line);
	text-align: left;
	vertical-align: top;
}

.pst .pst-dpi__compare thead th {
	padding-top: 0;
	color: var(--pst-muted);
	font-size: 12px;
	font-weight: 600;
	letter-spacing: 0.06em;
	text-transform: uppercase;
}

.pst .pst-dpi__compare tbody th {
	width: 28%;
	color: var(--pst-muted);
	font-weight: 500;
}

.pst .pst-dpi__compare th:first-child,
.pst .pst-dpi__compare td:first-child {
	padding-left: 0;
}

.pst .pst-dpi__compare tbody tr:last-child > * {
	border-bottom: 0;
}

.pst .pst-dpi__compare td.is-changed {
	color: var(--pst-ink);
	font-weight: 700;
}

.pst .pst-dpi__status.is-warning {
	color: #A3341F;
}

/* The common values in a row, a value of one's own under them. */
.pst-dpi__values {
	display: flex;
	flex-wrap: wrap;
	gap: 8px;
}

.pst-dpi__values .pst-chip {
	min-width: 60px;
	justify-content: center;
	font-variant-numeric: tabular-nums;
}

.pst-dpi__other {
	max-width: 200px;
}

/* What changes: two large choices, each with a line under its name. */
.pst-dpi__modes {
	display: grid;
	gap: 8px;
}

.pst .pst-dpi__mode {
	display: grid;
	gap: 2px;
	width: 100%;
	margin: 0;
	padding: 12px 14px 12px 44px;
	position: relative;
	border: 1px solid var(--pst-line-strong);
	border-radius: 12px;
	background: var(--pst-white);
	color: var(--pst-ink);
	font: inherit;
	text-align: left;
	cursor: pointer;
}

.pst .pst-dpi__mode::before {
	content: "";
	position: absolute;
	top: 14px;
	left: 14px;
	width: 18px;
	height: 18px;
	border: 2px solid var(--pst-line-strong);
	border-radius: 50%;
	box-sizing: border-box;
}

.pst .pst-dpi__mode:hover {
	border-color: var(--pst-ink);
}

.pst .pst-dpi__mode[aria-pressed="true"] {
	border-color: var(--pst-ink);
	box-shadow: inset 0 0 0 1px var(--pst-ink);
}

.pst .pst-dpi__mode[aria-pressed="true"]::before {
	border: 5px solid var(--pst-ink);
}

.pst .pst-dpi__mode:disabled {
	cursor: default;
	opacity: 0.6;
}

.pst-dpi__mode-name {
	font-size: 15px;
	font-weight: 600;
}

.pst-dpi__mode-hint {
	color: var(--pst-muted);
	font-size: 14px;
	line-height: 1.4;
}

.pst-dpi .pst-drop {
	flex: none;
}

@container pst (max-width: 450px) {
	.pst-dpi__view {
		--pst-dpi-tall: 300px;
		min-height: 180px;
		padding: 10px;
	}

	.pst .pst-dpi__compare {
		font-size: 13.5px;
	}

	.pst .pst-dpi__compare th,
	.pst .pst-dpi__compare td {
		padding-inline: 4px;
	}

	.pst .pst-dpi__compare tbody th {
		width: 23%;
	}

	/* A long single word ("Utskriftsstørrelse") is hyphenated, or broken where nothing else helps. */
	.pst .pst-dpi__compare th {
		hyphens: auto;
		overflow-wrap: anywhere;
	}

	.pst .pst-dpi__compare thead th {
		font-size: 11px;
		letter-spacing: 0.03em;
	}
}
