/* Hover item card (js/item-hovercard.js). Anything carrying data-itemid gets
   a popover with the item's icon, type line and client description.

   The card body is deliberately light. Descriptions come from the client's
   iteminfo.lua and carry the client's own <font color> markup: 94 distinct
   colours, almost all of them dark (#0000CC labels, #009900 weights, #990099
   item names) because in game they sit on a white tooltip. Recolouring them
   on a dark panel would mean maintaining a 94-entry colour table, so the card
   keeps the game's white background instead and every colour reads as the
   client intended. This is also what the popup looks like in game. */

/* Links keep the normal pointer; only non-link carriers (icons) get help. */
[data-itemid]:not(a) { cursor: help; }

.sov-itemcard {
	position: absolute;
	z-index: 9999;
	max-width: 340px;
	min-width: 220px;
	/* The longest client description on this server is ~7,900 characters
	   (item 19185), so the card has to cap and scroll rather than run off
	   the screen. Average is ~420, so this almost never engages. */
	max-height: 60vh;
	overflow-y: auto;
	overscroll-behavior: contain;
	padding: 12px 14px;
	font-size: 12px;
	line-height: 1.55;
	color: #23262E;
	background: #FFFFFF;
	border: 1px solid #8B8B8B;
	border-left: 3px solid var(--crimson, #E53946);
	border-radius: var(--radius-md, 6px);
	box-shadow: 0 12px 34px rgba(0, 0, 0, .6);
	pointer-events: auto;
}

.sov-itemcard .ic-img {
	float: right;
	width: 48px;
	height: 48px;
	margin: 0 0 6px 10px;
	image-rendering: pixelated;
}

.sov-itemcard .ic-name {
	display: block;
	font-size: 14px;
	font-weight: 700;
	color: #1B1E24;
}

.sov-itemcard .ic-meta {
	display: block;
	margin-top: 2px;
	font-size: 11px;
	letter-spacing: .04em;
	text-transform: uppercase;
	color: #6B7280;
}

.sov-itemcard .ic-desc {
	clear: both;
	margin-top: 8px;
	padding-top: 8px;
	border-top: 1px solid #D8D8D8;
	color: #23262E;
}

/* Client markup: keep its colours, just weight them up a little. */
.sov-itemcard .ic-desc font { font-weight: 600; }

/* A few descriptions carry white text for a white tooltip that the client
   draws darker; pin those to the body colour so they are not invisible. */
.sov-itemcard .ic-desc font[color="#FFFFFF"],
.sov-itemcard .ic-desc font[color="#ffffff"] { color: #23262E !important; }

.sov-itemcard .ic-nodesc,
.sov-itemcard .ic-loading { color: #8A8F98; font-style: italic; }

/* No hover on touch screens: the card would need a tap to open and a tap to
   dismiss, which fights the link itself. Item pages carry the description. */
@media (hover: none) {
	.sov-itemcard { display: none !important; }
	[data-itemid]:not(a) { cursor: default; }
}
