/*
 * Kukinas — widget "Bento": estilos específicos.
 * Geometría fija (mosaico 3 columnas × alto escalonado) reconstruida con
 * flexbox anidado: cada columna/fila reparte su espacio con flex-grow en
 * proporción a las medidas originales del export de Pencil (500/480/268 de
 * ancho; 250/192 y 154/288 de alto en las columnas central y derecha), así
 * el mosaico se mantiene fluido en cualquier ancho de contenedor.
 * Las keyframes/utilidades compartidas viven en assets/css/common.css.
 */

.kk-bento {
	--kk-bento-gap: 16px;
	--kk-bento-r: 28px;
	--kk-bento-rn: 12px;
	display: flex;
	width: 100%;
	gap: var(--kk-bento-gap);
	aspect-ratio: 1280 / 458;
}

.kk-bento__col {
	display: flex;
	flex-direction: column;
	gap: var(--kk-bento-gap);
	min-width: 0;
	min-height: 0;
}

.kk-bento__col--photo { flex: 500 1 0%; }
.kk-bento__col--mid   { flex: 480 1 0%; }
.kk-bento__col--side  { flex: 268 1 0%; }

.kk-bento__row {
	display: flex;
	gap: var(--kk-bento-gap);
	flex: 192 1 0%;
	min-height: 0;
}
.kk-bento__row .kk-bento__tile--origin { flex: 224 1 0%; }
.kk-bento__row .kk-bento__tile--cta    { flex: 240 1 0%; }

.kk-bento__col--mid .kk-bento__tile--story       { flex: 250 1 0%; }
.kk-bento__col--side .kk-bento__tile--year       { flex: 154 1 0%; }
.kk-bento__col--side .kk-bento__tile--experience { flex: 288 1 0%; }

/* ---- Tarjeta base ---- */

.kk-bento__tile {
	position: relative;
	display: flex;
	flex-direction: column;
	box-sizing: border-box;
	overflow: hidden;
	min-width: 0;
	min-height: 0;
	text-decoration: none;
	transition: opacity .55s ease, transform .55s cubic-bezier(.22, 1, .36, 1);
}

.kk-bento--will-animate .kk-bento__tile {
	opacity: 0;
	transform: translateY(16px);
}
.kk-bento--will-animate.kk-in-view .kk-bento__tile {
	opacity: 1;
	transform: translateY(0);
}
.kk-bento--will-animate.kk-in-view .kk-bento__col--mid .kk-bento__tile--story  { transition-delay: .08s; }
.kk-bento--will-animate.kk-in-view .kk-bento__col--side .kk-bento__tile--year { transition-delay: .14s; }
.kk-bento--will-animate.kk-in-view .kk-bento__tile--origin                    { transition-delay: .2s; }
.kk-bento--will-animate.kk-in-view .kk-bento__tile--cta                       { transition-delay: .26s; }
.kk-bento--will-animate.kk-in-view .kk-bento__col--side .kk-bento__tile--experience { transition-delay: .32s; }

/* ---- Tarjeta 1: foto ---- */

.kk-bento__tile--photo {
	flex: 1;
	border-radius: var(--kk-bento-r);
	background-color: #EADFD2;
	background-size: cover;
	background-position: center;
	justify-content: flex-end;
	padding: 28px;
}

.kk-bento__tile--empty {
	background-image: none !important;
}
.kk-bento__tile--empty::before {
	content: "";
	position: absolute;
	inset: 0;
	background: repeating-linear-gradient(135deg, rgba(23, 23, 23, .06) 0 10px, transparent 10px 20px);
}

.kk-bento__scrim {
	position: absolute;
	inset: 0;
	background: linear-gradient(180deg, transparent 0%, #171717D9 100%);
	pointer-events: none;
}

.kk-bento__tile--photo .kk-bento__label,
.kk-bento__tile--photo .kk-bento__title {
	position: relative;
	z-index: 1;
}
.kk-bento__tile--photo .kk-bento__title { margin-top: 6px; }

/* ---- Tarjeta 2: historia ---- */

.kk-bento__tile--story {
	border-radius: var(--kk-bento-r) var(--kk-bento-r) var(--kk-bento-rn) var(--kk-bento-r);
	background-color: #FFF0F8;
	padding: 26px;
	justify-content: flex-start;
	align-items: flex-start;
	gap: 13px;
}

.kk-bento__icon-badge {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 38px;
	height: 38px;
	flex-shrink: 0;
	border-radius: 999px;
	background: #FFFFFF;
}
.kk-bento__icon-badge svg,
.kk-bento__icon-badge i {
	font-size: 18px;
	width: 1em;
	height: 1em;
}

/* ---- Tarjeta 3: año ---- */

.kk-bento__tile--year {
	border-radius: var(--kk-bento-r) var(--kk-bento-r) var(--kk-bento-r) var(--kk-bento-rn);
	background-color: #E52B2F;
	padding: 22px;
	justify-content: flex-end;
	gap: 5px;
}

/* ---- Tarjeta 4: origen ---- */

.kk-bento__tile--origin {
	border-radius: var(--kk-bento-r) var(--kk-bento-rn) var(--kk-bento-r) var(--kk-bento-r);
	background-color: #FBF5E6;
	padding: 22px;
	justify-content: space-between;
}

/* ---- Tarjeta 5: CTA ---- */

.kk-bento__tile--cta {
	border-radius: var(--kk-bento-rn) var(--kk-bento-r) var(--kk-bento-r) var(--kk-bento-r);
	background-color: #123A74;
	padding: 22px;
	justify-content: space-between;
	cursor: pointer;
}
.kk-bento__tile--cta:hover,
.kk-bento__tile--cta:focus-visible {
	transform: translateY(-3px);
}

.kk-bento__cta-row {
	display: flex;
	align-items: center;
	justify-content: space-between;
	width: 100%;
}
.kk-bento__cta-row svg,
.kk-bento__cta-row i {
	font-size: 16px;
	width: 1em;
	height: 1em;
	transform: rotate(-45deg);
	transition: transform .25s ease;
}
.kk-bento__tile--cta:hover .kk-bento__cta-row svg,
.kk-bento__tile--cta:hover .kk-bento__cta-row i {
	transform: rotate(0deg);
}

/* ---- Tarjeta 6: experiencia ---- */

.kk-bento__tile--experience {
	border-radius: var(--kk-bento-rn) var(--kk-bento-r) var(--kk-bento-r) var(--kk-bento-r);
	background-color: #4A2A22;
	padding: 24px;
	justify-content: space-between;
}

/* ---- Roles de texto (compartidos entre tarjetas) ---- */

.kk-bento__label {
	font-family: Montserrat, system-ui, sans-serif;
	font-weight: 700;
	letter-spacing: .9px;
	text-transform: uppercase;
	line-height: 1.3;
}

.kk-bento__title {
	margin: 0;
	font-family: "Bricolage Grotesque", system-ui, sans-serif;
	font-weight: 400;
	line-height: 1.08;
}
.kk-bento__title--sm { font-size: 0.89em; }

.kk-bento__value {
	display: block;
	font-family: "Bricolage Grotesque", system-ui, sans-serif;
	font-weight: 400;
	line-height: 1;
}

.kk-bento__copy {
	margin: 0;
	font-family: Montserrat, system-ui, sans-serif;
	line-height: 1.45;
}

.kk-bento__icon {
	display: inline-flex;
	flex-shrink: 0;
	font-size: 24px;
}
.kk-bento__icon svg,
.kk-bento__icon i {
	width: 1em;
	height: 1em;
}

.kk-bento__stat {
	display: flex;
	flex-direction: column;
	gap: 5px;
}

/* ---- Esquemas de color por defecto (sobreescribibles desde Estilo) ---- */

.kk-bento__tile--photo .kk-bento__label,
.kk-bento__tile--photo .kk-bento__title,
.kk-bento__tile--year .kk-bento__label,
.kk-bento__tile--year .kk-bento__value,
.kk-bento__tile--cta .kk-bento__title,
.kk-bento__cta-row .kk-bento__label,
.kk-bento__tile--experience .kk-bento__label,
.kk-bento__tile--experience .kk-bento__value {
	color: #FFFFFF;
}

.kk-bento__tile--story .kk-bento__title,
.kk-bento__tile--origin .kk-bento__value {
	color: #171717;
}

.kk-bento__tile--story .kk-bento__copy,
.kk-bento__tile--origin .kk-bento__label {
	color: #665F58;
}

/* ---- Accesibilidad ---- */

@media (prefers-reduced-motion: reduce) {
	.kk-bento--will-animate .kk-bento__tile {
		opacity: 1;
		transform: none;
		transition: none;
	}
}

/* ---- Responsive ---- */

/* Tablet: foto + columna central arriba; año y experiencia abajo en fila */
@media (min-width: 768px) and (max-width: 1024px) {
	.kk-bento {
		flex-wrap: wrap;
		aspect-ratio: auto;
	}

	.kk-bento__col--photo {
		flex: 1 1 calc(50% - var(--kk-bento-gap) / 2);
		min-width: calc(50% - var(--kk-bento-gap) / 2);
		align-self: stretch;
	}

	.kk-bento__col--photo .kk-bento__tile--photo {
		flex: 1;
		min-height: 100%;
	}

	.kk-bento__col--mid {
		flex: 1 1 calc(50% - var(--kk-bento-gap) / 2);
		min-width: calc(50% - var(--kk-bento-gap) / 2);
	}

	.kk-bento__col--side {
		flex: 1 1 100%;
		flex-direction: row;
	}

	.kk-bento__col--side .kk-bento__tile--year,
	.kk-bento__col--side .kk-bento__tile--experience {
		flex: 1 1 50% !important;
		min-height: 160px;
	}
}

@media (max-width: 767px) {
	.kk-bento {
		flex-direction: column;
		aspect-ratio: auto;
	}
	.kk-bento__col--photo,
	.kk-bento__col--mid,
	.kk-bento__col--side {
		flex: none;
	}
	.kk-bento__row { flex-direction: column; }
	.kk-bento__row,
	.kk-bento__tile {
		flex: none !important;
	}
	.kk-bento__tile--photo { aspect-ratio: 4 / 3; }
	.kk-bento__tile--photo { padding: 18px; }
	.kk-bento__tile--story,
	.kk-bento__tile--year,
	.kk-bento__tile--origin,
	.kk-bento__tile--cta,
	.kk-bento__tile--experience {
		min-height: 150px;
		padding: 16px 18px;
	}
}
