/* ──────────────────────────────────────────────
   SIA Icon Box — frontend
   Single-layout card with top icon, title, description, checkmark list.
   Three widget contexts share the .sia-ib root: single Card, Grid (.sia-ibg),
   Carousel (.sia-ibc).

   Anti-illusion conventions applied (per global SIA design system rules):
   - Universal `::after` 1px inner outline (Rule 6) for edge definition
   - `clip-path` for transform-stable rounded clipping (Rule 7) — emitted
     by the `ib_card_radius` Elementor control alongside border-radius
   - GPU layer hints on hover-animated elements (Rule 4)
   ────────────────────────────────────────────── */

.sia-ib {
	position: relative;
	display: flex;
	flex-direction: column;
	overflow: hidden;
	background-color: transparent;
	color: var(--sia-color-text, #1A1718);
	border-radius: 16px;
	clip-path: inset(0 round 16px);
	padding: 32px;
	transition: background-color 0.25s ease, border-color 0.25s ease, transform 0.35s ease, box-shadow 0.35s ease;
	will-change: transform;
	isolation: isolate;
	/* CSS variable for the universal edge-definition outline (Rule 6).
	   Defaults to a faint dark border (works on light bg). Override via the
	   `--sia-card-edge` variable per instance for dark-card variants. */
	--sia-card-edge: rgba(0, 0, 0, 0.08);
}
.sia-ib * { box-sizing: border-box; }

/* Universal card-edge outline (Rule 6) */
.sia-ib::after {
	content: '';
	position: absolute;
	inset: 0;
	border-radius: inherit;
	pointer-events: none;
	box-shadow: inset 0 0 0 1px var(--sia-card-edge);
	z-index: 10;
}

.sia-ib--placeholder {
	padding: 24px;
	text-align: center;
	color: #9ca3af;
	font-style: italic;
	border: 1px dashed #d1d5db;
	background: #f9fafb;
}

/* ─── Top icon (colored rounded square) ─── */
.sia-ib__icon {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 52px;
	height: 52px;
	border-radius: 12px;
	background-color: color-mix(in srgb, var(--sia-color-secondary, #54595F), transparent 80%);
	color: var(--sia-color-primary, #c5ed3b);
	font-size: 22px;
	line-height: 0;
	flex-shrink: 0;
	transition: background-color 0.25s ease, color 0.25s ease;
	position: relative;
	z-index: 2;     /* above stretched link (z:1) */
}
.sia-ib__icon i,
.sia-ib__icon svg {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	line-height: 1;
}
.sia-ib__icon svg {
	width: 1em;
	height: 1em;
	fill: currentColor;
}

/* ─── Title ─── */
.sia-ib__title {
	margin: 24px 0 0;          /* default gap below icon — overridable */
	font-size: 22px;
	font-weight: 700;
	line-height: 1.2;
	letter-spacing: -0.01em;
	color: var(--sia-color-text, #1A1718);
	position: relative;
	z-index: 2;
}

/* ─── Description ─── */
.sia-ib__description {
	margin: 12px 0 0;
	font-size: 14px;
	line-height: 1.55;
	color: var(--sia-color-text, #1A1718);
	opacity: 0.7;
	position: relative;
	z-index: 2;
}

/* ─── List ─── */
.sia-ib__list {
	margin: 20px 0 0;          /* default gap below description — overridable */
	padding: 0;
	list-style: none;
	display: flex;
	flex-direction: column;
	gap: 10px;
	position: relative;
	z-index: 2;
}
.sia-ib__list-item {
	display: flex;
	align-items: center;
	gap: 10px;
	font-size: 14px;
	font-weight: 500;
	line-height: 1.4;
	color: var(--sia-color-text, #1A1718);
}
.sia-ib__list-icon {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	color: var(--sia-color-primary, #c5ed3b);
	font-size: 14px;
	line-height: 0;
	flex-shrink: 0;
}
.sia-ib__list-icon i,
.sia-ib__list-icon svg {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	line-height: 1;
}
.sia-ib__list-icon svg {
	width: 1em;
	height: 1em;
	fill: currentColor;
}

/* ─── Stretched link (whole-card click target) ───
   z-index: 5 puts the (transparent) link above ALL content layers (icon z:2,
   title z:2, description z:2, list z:2, button z:2). The link is invisible
   (font-size 0, no bg) but it's the topmost element in click hit-testing
   over the entire card surface — so a click ANYWHERE inside the card
   navigates to the link's href, not just the empty space between elements.
   The decorative ::after outline (z:10) sits above the link visually but
   has pointer-events:none so clicks pass through to the link beneath. */
.sia-ib__link {
	position: absolute;
	inset: 0;
	z-index: 5;
	font-size: 0;
	text-decoration: none;
	color: inherit;
	overflow: hidden;
}
.sia-ib__link:focus-visible {
	outline: 2px solid var(--sia-color-primary, #c5ed3b);
	outline-offset: -2px;
}

/* ─── Button ─── */
.sia-ib__button {
	display: inline-block;
	align-self: flex-start;
	margin-top: 24px;
	padding: 10px 22px;
	border-radius: 999px;
	/* Through a variable, not straight from the control. The hover background
	   below is declared here at (0,2,0) while a control writing `background`
	   lands at (0,4,0) — {{WRAPPER}} alone is (0,3,0) — so setting a Normal
	   background used to out-rank the hover outright and the button stopped
	   reacting. Same remedy as the FAQ question colours in v5.3.1. */
	background: var(--sia-ib-btn-bg, var(--sia-color-secondary, #54595F));
	color: #fff;
	font-size: 14px;
	font-weight: 600;
	line-height: 1;
	text-decoration: none;
	text-align: center;
	border: 0;
	cursor: pointer;
	transition: background 0.2s ease, color 0.2s ease, transform 0.3s ease, opacity 0.3s ease, box-shadow 0.2s ease;
	position: relative;
	z-index: 2;          /* above stretched link (z:1) so button is clickable */
}
.sia-ib__button:hover {
	background: var(--sia-ib-btn-bg-hover, var(--sia-color-primary, #c5ed3b));
}

/* ─── Button visibility + hover entrance effects ───
   IMPORTANT: prefix_class puts `sia-ib--btn-vis-hover` on the WIDGET WRAPPER
   (which contains all cards in a Grid/Carousel). The hover trigger MUST be
   `.sia-ib:hover` (the individual card), NOT `:hover` on the prefix-class
   element (which would fire on every card simultaneously). Same lesson
   learned in v3.7.1 for CTA icon visibility. */
.sia-ib--btn-vis-always .sia-ib__button {
	opacity: 1;
	transform: none;
}

.sia-ib--btn-vis-hover .sia-ib__button {
	opacity: 0;
}

/* Per-effect starting transforms for hover-only mode. */
.sia-ib--btn-vis-hover.sia-ib--btn-fx-fade       .sia-ib__button { transform: none; }
.sia-ib--btn-vis-hover.sia-ib--btn-fx-scale      .sia-ib__button { transform: scale(0.6); }
.sia-ib--btn-vis-hover.sia-ib--btn-fx-slide-up   .sia-ib__button { transform: translateY(16px); }
.sia-ib--btn-vis-hover.sia-ib--btn-fx-slide-down .sia-ib__button { transform: translateY(-16px); }

.sia-ib--btn-vis-hover .sia-ib:hover .sia-ib__button {
	opacity: 1;
	transform: none;
}

/* ─── Responsive ─── */
@media (max-width: 768px) {
	.sia-ib { padding: 24px; }
	.sia-ib__title { font-size: 20px; }
}
@media (max-width: 480px) {
	.sia-ib { padding: 20px; }
	.sia-ib__title { font-size: 18px; }
}
