/* Device Tags for MyBB: device buttons under the message, device tags in thread lists and above the posts.
   The dark colours apply with <html data-theme="dark"> (Elektronmods dark mode) and use its variables. */

/* Buttons under the message ------------------------------------------------ */

.devicetags_field {
	max-width: 760px;
	margin-top: 14px;
	text-align: left;
}

.devicetags_field_label {
	display: flex;
	align-items: center;
	gap: 6px;
	margin-bottom: 7px;
	font-weight: bold;
}

.devicetags_icon {
	flex: none;
	width: 16px;
	height: 16px;
	fill: currentColor;
}

.devicetags_list {
	display: flex;
	flex-wrap: wrap;
	gap: 6px;
}

.devicetags_button {
	position: relative;
	display: inline-flex;
	margin: 0;
	cursor: pointer;
	-webkit-user-select: none;
	user-select: none;
	-webkit-tap-highlight-color: transparent;
}

/* The checkbox stays for keyboard and screen readers; the pill shows its state */
.devicetags_button input {
	position: absolute;
	width: 1px;
	height: 1px;
	margin: 0;
	padding: 0;
	border: 0;
	overflow: hidden;
	clip: rect(0 0 0 0);
	clip-path: inset(50%);
	white-space: nowrap;
}

.devicetags_pill {
	display: inline-flex;
	align-items: center;
	gap: 4px;
	height: 28px;
	padding: 0 12px;
	box-sizing: border-box;
	border: 1px solid #c5d0d9;
	border-radius: 14px;
	background: #fff;
	color: #3d4a55;
	font-size: 12px;
	font-weight: bold;
	line-height: 1;
	white-space: nowrap;
	transition: background-color 0.12s, border-color 0.12s, color 0.12s;
}

.devicetags_check {
	display: none;
	flex: none;
	width: 12px;
	height: 12px;
	fill: currentColor;
}

.devicetags_button:hover .devicetags_pill {
	border-color: #8eacc2;
	background: #f3f7fa;
}

.devicetags_button input:checked + .devicetags_pill {
	padding-left: 9px;
	border-color: #316180;
	background: #316180;
	color: #fff;
}

.devicetags_button:hover input:checked + .devicetags_pill {
	border-color: #3b7299;
	background: #3b7299;
}

.devicetags_button input:checked + .devicetags_pill .devicetags_check {
	display: block;
}

.devicetags_button input:focus-visible + .devicetags_pill {
	outline: 2px solid #4c9bf0;
	outline-offset: 2px;
}

/* The device of the thread's own forum: always on */
.devicetags_button_home {
	cursor: default;
}

.devicetags_button_home input:checked + .devicetags_pill,
.devicetags_button_home:hover input:checked + .devicetags_pill {
	border-color: #24495f;
	background: #24495f;
}

/* A thin line between the models of this device and the other devices */
.devicetags_button_next {
	margin-left: 9px;
}

.devicetags_button_next::before {
	content: "";
	position: absolute;
	top: 6px;
	bottom: 6px;
	left: -8px;
	width: 1px;
	background: #c5d0d9;
}

.devicetags_field_hint {
	margin-top: 7px;
	opacity: 0.8;
}

@media (max-width: 600px) {
	.devicetags_pill {
		height: 32px;
		border-radius: 16px;
	}
}

/* Tags in thread lists ----------------------------------------------------- */

.devicetags_chips {
	display: inline-flex;
	flex-wrap: wrap;
	gap: 3px;
	margin-left: 6px;
	vertical-align: 1px;
	text-transform: none;
	letter-spacing: normal;
}

a.devicetags_chip,
a.devicetags_chip:link,
a.devicetags_chip:visited {
	display: inline-block;
	padding: 2px 6px;
	border-radius: 3px;
	background: #e6edf2;
	color: #36566d;
	font-size: 10px;
	font-weight: bold;
	line-height: 1.3;
	text-decoration: none;
	white-space: nowrap;
}

a.devicetags_chip:hover,
a.devicetags_chip:focus {
	background: #d3e0ea;
	color: #24495f;
	text-decoration: none;
}

/* The forum being viewed */
a.devicetags_chip_current,
a.devicetags_chip_current:link,
a.devicetags_chip_current:visited,
a.devicetags_chip_current:hover {
	background: #316180;
	color: #fff;
}

/* Tags after the thread's title (they come before it in the markup, together with the prefix) */
.thead strong:has(> .devicetags_chips_head) {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 4px 8px;
}

.devicetags_chips_head {
	order: 1;
	margin-left: 0;
	vertical-align: 0;
}

.devicetags_chips_head a.devicetags_chip,
.devicetags_chips_head a.devicetags_chip:link,
.devicetags_chips_head a.devicetags_chip:visited {
	padding: 2px 7px;
	background: rgba(255, 255, 255, 0.16);
	color: #fff;
	font-size: 11px;
}

.devicetags_chips_head a.devicetags_chip:hover,
.devicetags_chips_head a.devicetags_chip:focus {
	background: rgba(255, 255, 255, 0.3);
	color: #fff;
}

/* Dark mode ---------------------------------------------------------------- */

html[data-theme="dark"] .devicetags_pill {
	border-color: var(--dm-border-strong, #3a4855);
	background: var(--dm-input, #121a20);
	color: var(--dm-text, #c3ced7);
}

html[data-theme="dark"] .devicetags_button:hover .devicetags_pill {
	border-color: #4f6476;
	background: var(--dm-hover, #2a3742);
}

html[data-theme="dark"] .devicetags_button input:checked + .devicetags_pill {
	border-color: #3c6f93;
	background: #3c6f93;
	color: #fff;
}

html[data-theme="dark"] .devicetags_button:hover input:checked + .devicetags_pill {
	border-color: #477ea5;
	background: #477ea5;
}

html[data-theme="dark"] .devicetags_button_home input:checked + .devicetags_pill,
html[data-theme="dark"] .devicetags_button_home:hover input:checked + .devicetags_pill {
	border-color: #2b5270;
	background: #2b5270;
}

html[data-theme="dark"] .devicetags_button_next::before {
	background: var(--dm-border-strong, #3a4855);
}

html[data-theme="dark"] a.devicetags_chip,
html[data-theme="dark"] a.devicetags_chip:link,
html[data-theme="dark"] a.devicetags_chip:visited {
	background: #24323e;
	color: var(--dm-link, #8aaec7);
}

html[data-theme="dark"] a.devicetags_chip:hover,
html[data-theme="dark"] a.devicetags_chip:focus {
	background: #2d3f4e;
	color: var(--dm-link-hover, #b3cde0);
}

html[data-theme="dark"] a.devicetags_chip_current,
html[data-theme="dark"] a.devicetags_chip_current:link,
html[data-theme="dark"] a.devicetags_chip_current:visited,
html[data-theme="dark"] a.devicetags_chip_current:hover {
	background: #3c6f93;
	color: #fff;
}

html[data-theme="dark"] .devicetags_chips_head a.devicetags_chip,
html[data-theme="dark"] .devicetags_chips_head a.devicetags_chip:link,
html[data-theme="dark"] .devicetags_chips_head a.devicetags_chip:visited {
	background: rgba(255, 255, 255, 0.12);
	color: #fff;
}

html[data-theme="dark"] .devicetags_chips_head a.devicetags_chip:hover,
html[data-theme="dark"] .devicetags_chips_head a.devicetags_chip:focus {
	background: rgba(255, 255, 255, 0.24);
	color: #fff;
}
