/*
 * adapter_diagram.css - shared styling for the "which controllers -> which console"
 * graphic drawn by assets/js/adapter_diagram.js.
 *
 * Loaded by two pages so they stay pixel-identical:
 *   - em_adapters.html : the full auto-cycling / clickable interactive diagram.
 *   - the order confirmation page (order_complete_page.pl -> template_message.html):
 *     a single static frame showing only the adapter the customer bought.
 *
 * The container sizing is a class (.adapter-diagram) so both the interactive
 * copy (which also keeps the #adapter-diagram id for the JS to hook into) and
 * the static copy share it. Anything that is interactive-only (the pointer
 * cursor, manual-mode controls, output chips) stays keyed off #adapter-diagram
 * so it never applies to the static copy.
 */

/* ---- Animated controller/console overview graphic ---- */
/* position: relative so a page can pin something into a corner of the box -
   the per-combination landing pages put their price there. It must go in
   the WRAP, not .adapter-diagram, because renderStatic() clears that
   element's innerHTML and would delete anything placed inside it. */
.adapter-diagram-wrap {
	position: relative;
	width: 670px;
	box-sizing: border-box;
	margin: 4px auto 26px auto;
	background: #FFFFFF;
	border: 1px solid #DADADA;
	box-shadow: 0 2px 8px rgba(0,0,0,0.12);
	padding: 10px;
}
.adapter-diagram {
	position: relative;
	width: 670px;
	height: 231px;
	overflow: hidden;
}
.adapter-diagram-side {
	position: absolute;
	top: 0;
	left: 0;
	width: 100%;
	height: 100%;
}
.adapter-frame-layer {
	position: absolute;
	top: 0;
	left: 0;
	width: 100%;
	height: 100%;
	opacity: 0;
	transition-property: opacity;
	transition-timing-function: ease;
}
.adapter-frame-layer.is-visible { opacity: 1; }
.adapter-diagram-body {
	position: absolute;
	z-index: 3;
	display: block;
}
.adapter-icon-swatch {
	position: absolute;
	z-index: 2;
	border-radius: 3px;
	background: var(--swatch-color, #999999);
}
.adapter-icon-img {
	position: absolute;
	z-index: 2;
	display: block;
}
.adapter-icon-backdrop {
	position: absolute;
	z-index: 1;
	display: block;
	filter: grayscale(1);
}
.adapter-line {
	position: absolute;
	z-index: 0;
	opacity: 0.85;
}
.adapter-caption {
	position: absolute;
	left: 0;
	top: 197px;
	width: 100%;
	height: 34px;
	box-sizing: border-box;
}
.adapter-caption-layer {
	position: absolute;
	top: 0;
	left: 0;
	width: 100%;
	height: 100%;
	display: flex;
	flex-direction: column;
	align-items: center;
	justify-content: center;
	gap: 3px;
	opacity: 0;
	transition-property: opacity;
	transition-timing-function: ease;
}
.adapter-caption-layer.is-visible { opacity: 1; }
.adapter-caption-name {
	font-size: 15px;
	font-weight: bold;
	letter-spacing: 0.5px;
}
.adapter-caption-desc {
	font-size: 11px;
	font-style: italic;
	color: #777777;
}

/* ---- Compact static variant (adapter_diagram.js renderStaticCompact) ----
   Landing-page diagrams showing one fixed input/output pair. Laid out as four
   bands - title / desc / drawing / foot - whose heights must stay in sync with
   COMPACT_TITLE_H (30), COMPACT_DESC_H (19), COMPACT_DRAW_H (116) and
   COMPACT_FOOT_H (58) in adapter_diagram.js. verify_diagram.py cross-checks
   these numbers.

   Every rule here sets font-size explicitly rather than relying on inheritance:
   styles.css opens with a "* { font-size: 14px }" rule, which matches each
   element directly and so beats any inherited size from an ancestor. */
.adapter-diagram.is-compact { height: 223px; }

/* Adapter name across the top. The class is applied directly to the <a> (not a
   wrapper) so the global "*" rule above can't reset its size. */
.adapter-compact-title {
	position: absolute;
	top: 0;
	left: 0;
	width: 100%;
	height: 30px;
	box-sizing: border-box;
	padding: 0 14px;
	z-index: 4;
	display: flex;
	align-items: flex-end;
	justify-content: center;
	font-size: 17px;
	font-weight: bold;
	letter-spacing: 1px;
	text-decoration: none;
}
a.adapter-compact-title:hover { text-decoration: underline; }

/* Descriptive sentence, centred directly under the name. */
.adapter-compact-desc {
	position: absolute;
	top: 30px;
	left: 0;
	width: 100%;
	height: 19px;
	box-sizing: border-box;
	padding: 3px 14px 0 14px;
	z-index: 4;
	text-align: center;
	font-size: 11px;
	font-style: italic;
	letter-spacing: 0.5px;
	color: #777777;
}

/* Feature bullets, bottom-left of the foot band. Width is capped so a long
   bullet wraps rather than running underneath the corner buy button. */
.adapter-compact-points {
	position: absolute;
	left: 22px;
	bottom: 9px;
	width: 460px;
	z-index: 4;
	margin: 0;
	padding: 0 0 0 15px;
	list-style: disc outside;
}
.adapter-compact-points li {
	font-size: 10.5px;
	line-height: 14px;
	letter-spacing: 0.3px;
	color: #555555;
	padding: 0 0 1px 0;
}

/* Buy button, bottom-right of the foot band. Anchored to the bottom rather than
   a hardcoded top offset so it survives retuning the band heights. Sized to
   match the interactive diagram's .adapter-diagram-buy-btn, and inset far
   enough from the edge to clear the wrap's 10px padding. */
.adapter-diagram-static-buy {
	position: absolute;
	bottom: 8px;
	right: 20px;
	z-index: 4;
	padding: 8px 18px;
	font-size: 12px;
	font-weight: bold;
	letter-spacing: 1px;
	line-height: 1;
	color: #fff;
	text-decoration: none;
	transition: opacity 150ms;
}
.adapter-diagram-static-buy:hover {
	opacity: 0.85;
	color: #fff;
	text-decoration: none;
}

#adapter-diagram:not(.is-manual) { cursor: pointer; }
.adapter-icon-img.is-clickable,
.adapter-icon-swatch.is-clickable {
	cursor: pointer;
	transition: opacity 150ms;
}
.adapter-icon-img.is-clickable:hover,
.adapter-icon-swatch.is-clickable:hover {
	opacity: 0.7;
}

.adapter-diagram-cta {
	display: flex;
	align-items: center;
	justify-content: center;
	gap: 14px;
	flex-wrap: wrap;
	margin-top: 10px;
	min-height: 20px;
}
.adapter-diagram-hint {
	font-size: 12px;
	color: #777777;
	cursor: pointer;
	text-decoration: underline;
	text-decoration-style: dotted;
}
.adapter-diagram-hint:hover { color: #444444; }
.adapter-diagram-buy-btn {
	display: none;
	padding: 9px 20px;
	font-size: 12px;
	font-weight: bold;
	letter-spacing: 1px;
	color: #fff;
	text-decoration: none;
	transition: opacity 150ms;
}
.adapter-diagram-buy-btn:hover { opacity: 0.85; color: #fff; text-decoration: none; }
.adapter-diagram-details-btn {
	display: none;
	padding: 7px 18px;
	font-size: 12px;
	font-weight: bold;
	letter-spacing: 1px;
	background: #fff;
	border: 2px solid #999999;
	color: #444444;
	text-decoration: none;
	transition: opacity 150ms, border-color 150ms, color 150ms;
}
.adapter-diagram-details-btn:hover { opacity: 0.7; text-decoration: none; }
.adapter-diagram-reset {
	display: none;
	background: none;
	border: none;
	padding: 0;
	font-size: 12px;
	color: #777777;
	cursor: pointer;
	text-decoration: underline;
	font-family: inherit;
}
.adapter-diagram-reset:hover { color: #444444; }

.adapter-diagram-outputs {
	display: none;
	align-items: center;
	justify-content: center;
	gap: 8px;
	flex-wrap: wrap;
	margin-top: 12px;
}
.adapter-output-chip {
	display: inline-flex;
	align-items: center;
	gap: 6px;
	background: #FFFFFF;
	border: 1px solid #DADADA;
	padding: 5px 12px;
	font-family: inherit;
	font-size: 11px;
	color: #333;
	cursor: pointer;
	transition: border-color 150ms, opacity 150ms;
}
.adapter-output-chip:hover { border-color: #999999; }
.adapter-output-chip-dot {
	width: 10px;
	height: 10px;
	border-radius: 2px;
	display: inline-block;
}
.adapter-output-chip.is-current {
	opacity: 0.4;
	cursor: default;
}
.adapter-output-chip.is-current:hover { border-color: #DADADA; }
