/**
 * NicLen Portfolio – frontend styles for the shortcodes.
 *
 * Selectors use two classes on purpose: they have to win against the Elementor kit
 * (".elementor-kit-N h2", ".elementor-kit-N a") and the Hello theme reset.
 */

@font-face {
	font-family: "Roboto Slab";
	src: url("../fonts/RobotoSlab.ttf") format("truetype");
	font-weight: 100 900;
	font-style: normal;
	font-display: swap;
}

@font-face {
	font-family: "Lato";
	src: url("../fonts/Lato-Regular.ttf") format("truetype");
	font-weight: 400;
	font-style: normal;
	font-display: swap;
}

@font-face {
	font-family: "Lato";
	src: url("../fonts/Lato-Bold.ttf") format("truetype");
	font-weight: 700;
	font-style: normal;
	font-display: swap;
}

@font-face {
	font-family: "Lato";
	src: url("../fonts/Lato-Black.ttf") format("truetype");
	font-weight: 900;
	font-style: normal;
	font-display: swap;
}

/* [niclen_category_tiles] */

/*
 * As many columns as fit with at least 240 px each, but never more than 4
 * (the 4-column width wins as long as it is wider than 240 px). Follows the width of the
 * surrounding Elementor container, not the viewport.
 */
.niclen-category-tiles {
	--niclen-blue: #009ee3;
	--niclen-blue-dark: #0089c6;
	--niclen-tiles-gap: 4.6%; /* 69 px at the design's 1495 px content width */
	display: grid;
	grid-template-columns: repeat(auto-fill, minmax(min(100%, max(240px, (100% - 3 * var(--niclen-tiles-gap)) / 4)), 1fr));
	gap: 30px var(--niclen-tiles-gap);
	margin: 0;
	padding: 0;
	list-style: none;
}

/* Flex column, so each tile fills its grid cell and all tiles in a row share the tallest height. */
.niclen-category-tiles .niclen-category-tiles__item {
	display: flex;
	flex-direction: column;
	margin: 0;
	padding: 0;
}

/*
 * The aspect ratio is the minimum height; a long, wrapping title makes the tile grow
 * (hence no overflow:hidden). The tile is a size container, so the title scales with its width.
 * "isolation" keeps the image and gradient layers (z-index -1) above the tile background.
 */
.niclen-category-tiles .niclen-category-tile {
	position: relative;
	display: flex;
	flex: 1 0 auto;
	flex-direction: column;
	justify-content: flex-end;
	align-items: flex-start;
	gap: 10px;
	box-sizing: border-box;
	aspect-ratio: 322 / 199;
	container-type: inline-size;
	isolation: isolate;
	padding: 14px 14px 26px;
	border-radius: 20px;
	background: #222;
	box-shadow: 0 3px 6px rgba(0, 0, 0, 0.16);
	color: #fff;
	font-family: "Roboto Slab", serif;
	text-decoration: none;
}

.niclen-category-tiles .niclen-category-tile__image,
.niclen-category-tiles .niclen-category-tile::after {
	position: absolute;
	z-index: -1;
	inset: 0;
	width: 100%;
	height: 100%;
	border-radius: inherit;
}

.niclen-category-tiles .niclen-category-tile__image {
	object-fit: cover;
	transition: filter 0.2s ease;
}

/* Black-to-white gradient in "multiply" mode, from below the bottom edge up to the middle. */
.niclen-category-tiles .niclen-category-tile::after {
	content: "";
	background: linear-gradient(to top, rgba(0, 0, 0, 0.8), rgba(0, 0, 0, 0) 50%);
}

.niclen-category-tiles .niclen-category-tile__title {
	margin: 0;
	color: #fff;
	font-family: inherit;
	font-size: clamp(20px, 8.7cqi, 28px); /* 28 px on a 322 px wide tile */
	font-weight: 700;
	line-height: 1.32;
	text-transform: uppercase;
	text-shadow: 5px 5px 6px rgba(0, 0, 0, 0.16);
	overflow-wrap: break-word;
	hyphens: auto;
}

.niclen-category-tiles .niclen-category-tile__button {
	display: inline-flex;
	align-items: center;
	gap: 16px;
	padding: 7px 16px;
	border-radius: 32px;
	background: var(--niclen-blue);
	box-shadow: 0 3px 6px rgba(0, 0, 0, 0.16);
	color: #fff;
	font-size: 15px;
	font-weight: 700;
	line-height: 20px;
	white-space: nowrap;
}

.niclen-category-tiles .niclen-category-tile:hover,
.niclen-category-tiles .niclen-category-tile:focus {
	color: #fff;
}

.niclen-category-tiles .niclen-category-tile:hover .niclen-category-tile__button,
.niclen-category-tiles .niclen-category-tile:focus-visible .niclen-category-tile__button {
	background: var(--niclen-blue-dark);
}

.niclen-category-tiles .niclen-category-tile:hover .niclen-category-tile__image,
.niclen-category-tiles .niclen-category-tile:focus-visible .niclen-category-tile__image {
	filter: brightness(0.85);
}

.niclen-category-tiles .niclen-category-tile:focus-visible {
	outline: 3px solid var(--niclen-blue);
	outline-offset: 3px;
}
