/* Ilmaiset kokeilut – vertailu
 * Värit tulevat asetuksista (Ilmaiset kokeilut → Asetukset) CSS-muuttujina.
 */
.ik-vertailu {
	--ik-btn: #4f46e5;
	--ik-btn-text: #ffffff;
	--ik-accent: #4f46e5;
	--ik-card: #ffffff;
	--ik-text: #0f172a;
	--ik-border: #e2e8f0;
	--ik-muted: color-mix(in srgb, var(--ik-text) 58%, transparent);
	--ik-soft: color-mix(in srgb, var(--ik-accent) 7%, var(--ik-card));
	--ik-radius: 16px;
	container-type: inline-size;
	margin: 2em 0;
	color: var(--ik-text);
	font-size: 15px;
	line-height: 1.5;
}

.ik-vertailu *,
.ik-vertailu *::before,
.ik-vertailu *::after { box-sizing: border-box; }

.ik-vertailu__otsikko { margin: 0 0 1em; }

.ik-vertailu__lista {
	list-style: none;
	margin: 0;
	padding: 0;
	display: grid;
	/* Yhteinen sarakejako kaikille korteille (subgrid) -> sarakkeet kohdakkain.
	 * Kesto- ja hintasarake levenevät sisällön mukaan, jotta teksti pysyy yhdellä rivillä. */
	grid-template-columns: minmax(170px, 1.2fr) fit-content(240px) fit-content(180px) minmax(200px, 1fr);
	column-gap: 24px;
	row-gap: 16px;
}

/* ---------- Kortti ---------- */
.ik-kortti {
	margin: 0;
	padding: 0;
	background: var(--ik-card);
	border: 1px solid var(--ik-border);
	border-radius: var(--ik-radius);
	box-shadow: 0 1px 2px rgba(15, 23, 42, .04), 0 4px 16px -6px rgba(15, 23, 42, .08);
	overflow: hidden;
	display: grid;
	grid-template-columns: subgrid;
	grid-column: 1 / -1;
	transition: box-shadow .2s ease, border-color .2s ease, transform .2s ease;
}
.ik-kortti:hover {
	border-color: color-mix(in srgb, var(--ik-accent) 45%, var(--ik-border));
	box-shadow: 0 2px 4px rgba(15, 23, 42, .04), 0 14px 32px -12px rgba(15, 23, 42, .18);
	transform: translateY(-2px);
}

.ik-kortti__paa {
	display: grid;
	grid-template-columns: subgrid;
	grid-column: 1 / -1;
	align-items: center;
	row-gap: 16px;
	padding: 22px 26px;
}

/* Yritys (logo + nimi, linkki) */
.ik-kortti__yritys {
	display: flex;
	align-items: center;
	gap: 16px;
	min-width: 0;
	color: inherit !important;
	text-decoration: none !important;
}
.ik-kortti__logo {
	flex: 0 0 72px;
	width: 72px;
	height: 72px;
	display: flex;
	align-items: center;
	justify-content: center;
	padding: 8px;
	background: #fff;
	border: 1px solid var(--ik-border);
	border-radius: 14px;
	overflow: hidden;
	transition: border-color .2s ease;
}
.ik-kortti__logo img {
	max-width: 100%;
	max-height: 100%;
	width: auto;
	height: auto;
	margin: 0;
	object-fit: contain;
}
.ik-kortti__logo-placeholder {
	font-size: 28px;
	font-weight: 800;
	color: var(--ik-accent);
}
.ik-kortti__nimi { display: flex; flex-direction: column; min-width: 0; }
.ik-kortti__nimi strong {
	font-size: 18px;
	font-weight: 700;
	line-height: 1.25;
	overflow-wrap: anywhere;
}
.ik-kortti__tuote { color: var(--ik-muted); font-size: 13.5px; margin-top: 2px; }

a.ik-kortti__yritys:hover strong,
a.ik-kortti__yritys:focus-visible strong { color: var(--ik-accent); }
a.ik-kortti__yritys:hover .ik-kortti__logo { border-color: var(--ik-accent); }
a.ik-kortti__yritys:focus-visible { outline: 2px solid var(--ik-accent); outline-offset: 4px; border-radius: 14px; }

/* Tiedot */
.ik-kortti__tieto { display: flex; flex-direction: column; gap: 2px; }
.ik-label {
	font-size: 11.5px;
	font-weight: 600;
	letter-spacing: .06em;
	text-transform: uppercase;
	color: var(--ik-muted);
}
.ik-arvo { font-size: 17px; font-weight: 600; }
.ik-arvo small { font-size: 13px; font-weight: 500; color: var(--ik-muted); }
.ik-arvo--korostus {
	align-self: flex-start;
	border-radius: 10px;
	line-height: 1.3;
	padding: 4px 12px;
	text-wrap: balance;
	background: color-mix(in srgb, var(--ik-accent) 12%, transparent);
	color: var(--ik-accent);
	font-weight: 700;
}

/* Painike */
.ik-kortti__cta { display: flex; }
.ik-painike {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	gap: 10px;
	width: 100%;
	min-height: 54px;
	padding: 14px 28px;
	border-radius: 12px;
	background: var(--ik-btn);
	color: var(--ik-btn-text) !important;
	font-size: 16.5px;
	font-weight: 700;
	line-height: 1.2;
	text-align: center;
	text-decoration: none !important;
	box-shadow: 0 6px 16px -6px color-mix(in srgb, var(--ik-btn) 70%, transparent);
	transition: filter .15s ease, transform .15s ease, box-shadow .15s ease;
}
.ik-painike svg { flex: 0 0 auto; transition: transform .15s ease; }
.ik-painike:hover,
.ik-painike:focus-visible {
	filter: brightness(.92);
	transform: translateY(-1px);
	box-shadow: 0 10px 22px -8px color-mix(in srgb, var(--ik-btn) 80%, transparent);
}
.ik-painike:hover svg { transform: translateX(3px); }
.ik-painike:focus-visible { outline: 3px solid color-mix(in srgb, var(--ik-btn) 40%, transparent); outline-offset: 2px; }

/* Ehdot: aina kortin alimpana, koko leveydeltä */
.ik-kortti__ehdot {
	grid-column: 1 / -1;
	display: flex;
	flex-direction: column;
	gap: 8px;
	padding: 16px 26px 18px;
	background: var(--ik-soft);
	border-top: 1px solid var(--ik-border);
}
.ik-ehdot {
	list-style: none;
	margin: 0;
	padding: 0;
	display: grid;
	grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
	gap: 6px 24px;
	font-size: var(--ik-terms-size, 14px);
	line-height: 1.5;
}
.ik-ehdot li {
	position: relative;
	margin: 0;
	padding-left: 1.75em;
}
.ik-ehdot li::before {
	content: "";
	position: absolute;
	left: 0;
	top: .2em;
	width: 1.15em;
	height: 1.15em;
	border-radius: 50%;
	background: var(--ik-accent);
	mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Cpath fill-rule='evenodd' d='M8 16A8 8 0 108 0a8 8 0 000 16zm3.5-10.3a.9.9 0 00-1.3 0L6.8 9.2 5.1 7.5a.9.9 0 10-1.3 1.3l2.3 2.3c.4.4.9.4 1.3 0l4.1-4.1a.9.9 0 000-1.3z'/%3E%3C/svg%3E") center / contain no-repeat;
	-webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Cpath fill-rule='evenodd' d='M8 16A8 8 0 108 0a8 8 0 000 16zm3.5-10.3a.9.9 0 00-1.3 0L6.8 9.2 5.1 7.5a.9.9 0 10-1.3 1.3l2.3 2.3c.4.4.9.4 1.3 0l4.1-4.1a.9.9 0 000-1.3z'/%3E%3C/svg%3E") center / contain no-repeat;
}

.ik-tyhja { color: var(--ik-muted); font-style: italic; }

/* ---------- Keskileveä ---------- */
@container (max-width: 760px) {
	.ik-vertailu__lista { grid-template-columns: 1fr; }
	.ik-kortti { display: block; }
	.ik-kortti__paa {
		grid-template-columns: 1fr 1fr;
		column-gap: 20px;
	}
	.ik-kortti__yritys,
	.ik-kortti__cta { grid-column: 1 / -1; }
}

/* ---------- Mobiili ---------- */
@container (max-width: 480px) {
	/* Kesto ja hinta rinnakkain vain jos mahtuvat, muuten allekkain koko leveydellä. */
	.ik-kortti__paa { display: flex; flex-wrap: wrap; padding: 18px; gap: 16px 20px; }
	.ik-kortti__yritys,
	.ik-kortti__cta { flex: 1 1 100%; }
	.ik-kortti__tieto { flex: 1 1 auto; }
	.ik-kortti__ehdot { padding: 14px 18px 16px; }
	.ik-kortti__logo { flex-basis: 60px; width: 60px; height: 60px; }
	.ik-ehdot { grid-template-columns: 1fr; }
	.ik-kortti:hover { transform: none; }
}

@media (prefers-reduced-motion: reduce) {
	.ik-kortti, .ik-painike, .ik-painike svg { transition: none; }
}

/* ---------- Lue lisää ---------- */
.ik-kortti__cta { flex-direction: column; align-items: stretch; gap: 8px; }
.ik-lisaa {
	align-self: center;
	font-size: 13.5px;
	font-weight: 600;
	color: var(--ik-muted) !important;
	text-decoration: underline;
	text-underline-offset: 3px;
	text-decoration-color: color-mix(in srgb, var(--ik-muted) 40%, transparent);
}
.ik-lisaa:hover { color: var(--ik-accent) !important; text-decoration-color: currentColor; }
.ik-vertailu .screen-reader-text {
	position: absolute !important; width: 1px; height: 1px; padding: 0; margin: -1px;
	overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0;
}

/* ---------- Kokeilusivu ---------- */
.ik-kuvaus { margin: 2em 0; }
.ik-kaikki { margin: -1em 0 2em; font-weight: 600; }
.ik-kaikki a { text-decoration: none; }

/* ---------- Arkisto / kategoria / yritys ---------- */
.ik-sivu__sisalto {
	max-width: 1140px;
	margin: 0 auto;
	padding: 48px 16px 64px;
}
.ik-sivu__otsikko { margin: 0 0 .4em; line-height: 1.15; }
.ik-sivu__kuvaus { max-width: 760px; font-size: 1.05em; opacity: .85; }
.ik-sivu__kuvaus > :last-child { margin-bottom: 0; }

.ik-kategoriat ul {
	list-style: none;
	display: flex;
	flex-wrap: wrap;
	gap: 8px;
	margin: 24px 0 0;
	padding: 0;
}
.ik-kategoriat a {
	display: inline-flex;
	align-items: center;
	gap: 8px;
	padding: 8px 14px;
	border: 1px solid #e2e8f0;
	border-radius: 999px;
	background: #fff;
	color: inherit;
	font-size: 14px;
	font-weight: 600;
	text-decoration: none;
	transition: border-color .15s ease, background-color .15s ease;
}
.ik-kategoriat a:hover { border-color: currentColor; }
.ik-kategoriat span {
	min-width: 22px;
	padding: 0 6px;
	border-radius: 999px;
	background: #f1f5f9;
	font-size: 12px;
	text-align: center;
}

/* ---------- Ei jatkomaksua ---------- */
.ik-arvo--maksuton {
	display: inline-flex;
	align-items: center;
	gap: 6px;
	color: var(--ik-accent);
	font-weight: 700;
}
.ik-arvo--maksuton::before {
	content: "";
	flex: 0 0 auto;
	width: 1em;
	height: 1em;
	background: currentColor;
	mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Cpath fill-rule='evenodd' d='M8 16A8 8 0 108 0a8 8 0 000 16zm3.5-10.3a.9.9 0 00-1.3 0L6.8 9.2 5.1 7.5a.9.9 0 10-1.3 1.3l2.3 2.3c.4.4.9.4 1.3 0l4.1-4.1a.9.9 0 000-1.3z'/%3E%3C/svg%3E") center / contain no-repeat;
	-webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Cpath fill-rule='evenodd' d='M8 16A8 8 0 108 0a8 8 0 000 16zm3.5-10.3a.9.9 0 00-1.3 0L6.8 9.2 5.1 7.5a.9.9 0 10-1.3 1.3l2.3 2.3c.4.4.9.4 1.3 0l4.1-4.1a.9.9 0 000-1.3z'/%3E%3C/svg%3E") center / contain no-repeat;
}
