/* ------------------------------------------------------------- *
 * chn-info-icon — sitewide tooltip pattern (F2, 2026-06-17)      *
 *                                                                *
 * Replaces inline `<small>` / `class="description"` help text   *
 * under form fields with a small circular `i` button that      *
 * reveals the help message in a tooltip on hover, focus, or    *
 * tap. The button is keyboard reachable (Tab + Space / Enter)  *
 * and the tooltip is associated with the field via             *
 * `aria-describedby`.                                            *
 *                                                                *
 * Markup contract:                                              *
 *   <span class="chn-info-icon" data-chn-info-icon>             *
 *     <button type="button" class="chn-info-icon__btn"          *
 *       aria-describedby="<tooltip-id>"                          *
 *       aria-label="<accessible question>">                      *
 *       <span aria-hidden="true">i</span>                        *
 *     </button>                                                  *
 *     <span id="<tooltip-id>" class="chn-info-tooltip"           *
 *       role="tooltip">…help message…</span>                     *
 *   </span>                                                      *
 *                                                                *
 * The plugin-side copy in bid-platform.css predates this file   *
 * and stays put so the bid-platform doesn't depend on the      *
 * theme being active. Tokens use the local CSS var first then  *
 * fall back to a literal — keeps the component working on the *
 * customer-edit screen the bid plugin renders inside an iframe  *
 * (where the theme tokens may not be in scope).                 *
 * ------------------------------------------------------------- */
.chn-info-icon {
	display: inline-flex;
	align-items: center;
	position: relative;
	margin-inline-start: 6px;
	vertical-align: middle;
	line-height: 1;
}
/* Standard filled-circle info marker (slate grey background, white "i"
 * inside) matching Stripe / Bootstrap / GitHub. The lowercase "i" glyph
 * is drawn by the inline SVG inside the button (dot + stem); this rule
 * paints the surrounding circle. */
.chn-info-icon__btn {
	appearance: none;
	-webkit-appearance: none;
	background: #6b7280;
	border: 0;
	color: #fff;
	border-radius: 50%;
	width: 16px;
	height: 16px;
	padding: 0;
	font-family: inherit;
	font-size: 0;
	line-height: 1;
	cursor: pointer;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	transition: background .15s ease, box-shadow .15s ease;
}
.chn-info-icon__btn svg {
	display: block;
	width: 16px;
	height: 16px;
	fill: #fff;
}
.chn-info-icon__btn:hover,
.chn-info-icon__btn:focus-visible {
	background: #4b5563;
	color: #fff;
	outline: none;
}
.chn-info-icon__btn:focus-visible {
	box-shadow: 0 0 0 2px rgba(11, 59, 148, 0.28);
}
.chn-info-tooltip {
	position: absolute;
	top: calc(100% + 6px);
	left: 50%;
	transform: translateX(-50%);
	background: var(--chn-color-ink, #1d2733);
	color: #fff;
	font-size: 12px;
	font-weight: 500;
	line-height: 1.45;
	padding: 8px 10px;
	border-radius: var(--chn-radius-sm, 4px);
	width: max-content;
	max-width: 260px;
	white-space: normal;
	z-index: 50;
	opacity: 0;
	visibility: hidden;
	pointer-events: none;
	transition: opacity .12s ease, visibility .12s ease;
	box-shadow: 0 4px 16px -6px rgba(0, 0, 0, 0.35);
}
.chn-info-tooltip::before {
	content: "";
	position: absolute;
	bottom: 100%;
	left: 50%;
	transform: translateX(-50%);
	border: 5px solid transparent;
	border-bottom-color: var(--chn-color-ink, #1d2733);
}
.chn-info-icon:hover .chn-info-tooltip,
.chn-info-icon:focus-within .chn-info-tooltip {
	opacity: 1;
	visibility: visible;
}
/* On narrow viewports nudge the tooltip in from the right edge so a label
 * sitting close to the column edge doesn't clip the message. */
@media (max-width: 520px) {
	.chn-info-tooltip { left: auto; right: 0; transform: none; max-width: 220px; }
	.chn-info-tooltip::before { left: auto; right: 6px; transform: none; }
}
