/**
 * "Casino Rating" block — premium horizontal ranking-card. Loaded on the
 * front end (inc/enqueue.php) and inside the block editor iframe
 * (inc/casino-rating-block.php) so the canvas preview matches what visitors
 * see: rank badge, logo, name, bonus text, feature pills, and two stacked
 * action buttons (primary CTA + secondary "Dettagli"). No numeric rating is
 * displayed anywhere in this card.
 */
.ci-rating-card {
	position: relative;
	display: flex;
	flex-direction: column;
	align-items: center;
	gap: 16px;
	padding: 22px;
	margin: 18px 0;
	background: var(--ci-bg-card, #ffffff);
	border: 1px solid var(--ci-border-strong, rgba(30, 26, 20, 0.18));
	border-radius: var(--ci-radius-lg, 26px);
	box-shadow: var(--ci-shadow-card, 0 8px 24px rgba(60, 48, 30, 0.08));
	overflow: hidden;
	transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease;
}

.ci-rating-card::before {
	content: "";
	position: absolute;
	top: 0;
	left: 0;
	right: 0;
	height: 4px;
	background: linear-gradient(90deg, var(--ci-accent-neon-cyan, #2f6b4f), var(--ci-accent-neon-pink, #b2481f));
}

.ci-rating-card--missing {
	padding: 24px;
	text-align: center;
	color: var(--ci-text-muted);
}

.ci-rating-card:hover {
	transform: translateY(-3px);
	box-shadow: var(--ci-shadow-card-lg, 0 18px 44px rgba(60, 48, 30, 0.12));
	border-color: var(--ci-accent-gold, #b2481f);
}

.ci-rating-card__rank {
	flex-shrink: 0;
	width: 34px;
	font-family: var(--ci-font-heading, 'Poppins', sans-serif);
	font-weight: 800;
	font-size: 26px;
	line-height: 1;
	text-align: center;
	color: var(--ci-accent-gold, #b2481f);
}

.ci-rating-card__logo {
	flex-shrink: 0;
	width: 84px;
	height: 84px;
	display: flex;
	align-items: center;
	justify-content: center;
	background: #fff;
	border: 1px solid var(--ci-border, rgba(30, 26, 20, 0.1));
	border-radius: var(--ci-radius-md, 16px);
	overflow: hidden;
}
.ci-rating-card__logo img {
	max-width: 82%;
	max-height: 82%;
	width: auto;
	height: auto;
	object-fit: contain;
}

.ci-rating-card__body {
	flex: 1 1 auto;
	min-width: 0;
	text-align: center;
}

.ci-rating-card__name {
	font-size: 19px;
	margin-bottom: 6px;
	font-weight: 800;
}
.ci-rating-card__name a { color: inherit; text-decoration: none; }
.ci-rating-card__name a:hover { text-decoration: underline; }

.ci-rating-card__bonus {
	color: var(--ci-accent-gold, #b2481f);
	font-weight: 600;
	font-size: 14px;
	margin-bottom: 10px;
}

.ci-rating-card__pills {
	display: flex;
	flex-wrap: wrap;
	justify-content: center;
	gap: 8px;
}
.ci-pill {
	display: inline-block;
	padding: 5px 14px;
	font-size: 12px;
	font-weight: 600;
	color: var(--ci-text-primary, #22201c);
	background: var(--ci-bg-darker, #f3ede1);
	border: 1px solid var(--ci-border, rgba(30, 26, 20, 0.12));
	border-radius: 999px;
	white-space: nowrap;
}

.ci-rating-card__actions {
	flex-shrink: 0;
	display: flex;
	flex-direction: column;
	gap: 8px;
	width: 100%;
}
.ci-rating-card__actions .ci-btn {
	width: 100%;
	text-align: center;
}
.ci-btn--ghost {
	background: transparent;
	border: 1px solid var(--ci-border-strong, rgba(30, 26, 20, 0.2));
	color: var(--ci-text-primary, #22201c);
}
.ci-btn--ghost:hover {
	border-color: var(--ci-accent-neon-cyan, #2f6b4f);
	color: var(--ci-accent-neon-cyan, #2f6b4f);
}

/* Editor-canvas-only tweaks: static preview markers (non-clickable CTA span). */
.ci-rating-card--editor-preview .ci-btn { pointer-events: none; }
.ci-rating-card-editor-empty {
	padding: 16px;
	margin: 0;
	font-style: italic;
	color: var(--ci-text-muted, #8a8377);
}

@media (min-width: 640px) {
	.ci-rating-card {
		flex-direction: row;
		align-items: center;
		text-align: left;
		gap: 20px;
	}
	.ci-rating-card__body { text-align: left; }
	.ci-rating-card__pills { justify-content: flex-start; }
	.ci-rating-card__actions { width: auto; flex-direction: row; }
	.ci-rating-card__actions .ci-btn { width: auto; min-width: 130px; }
}

/*
 * Editor-only hover-delete affordance: a small "×" button that appears over
 * the top-right corner of a custom block's canvas preview on hover, so the
 * block can be removed without opening the toolbar's "..." menu. Has no
 * effect on the front end — these classes are only ever emitted by the
 * editor JS's edit() functions, never by the PHP render_callback output.
 */
.ci-block-hover-wrap {
	position: relative;
}
.ci-block-hover-delete.ci-block-hover-delete {
	position: absolute;
	top: 8px;
	right: 8px;
	z-index: 5;
	width: 28px;
	height: 28px;
	min-width: 28px;
	padding: 0;
	display: flex;
	align-items: center;
	justify-content: center;
	background: rgba(20, 18, 14, 0.75);
	color: #fff;
	border-radius: 50%;
	opacity: 0;
	transform: scale(0.9);
	transition: opacity 0.15s ease, transform 0.15s ease, background 0.15s ease;
	pointer-events: none;
}
.ci-block-hover-wrap:hover .ci-block-hover-delete.ci-block-hover-delete {
	opacity: 1;
	transform: scale(1);
	pointer-events: auto;
}
.ci-block-hover-delete.ci-block-hover-delete:hover {
	background: var(--ci-accent-red, #b2481f);
}
