/* ==========================================================================
   Adamini — portfolio per tema
   Si carica dopo main.css e ne riusa token e componenti: qui c'è solo
   quello che la pagina principale non ha.
   1. Hero compatto   3. Aree e casi
   2. Indice dei temi 4. Matrice
   ========================================================================== */

/* 1. Hero compatto -------------------------------------------------------- */

.hero--compact .hero__name {
	font-size: clamp(2.6rem, 1.3rem + 5.4vw, 5.75rem);
}

/* 2. Indice dei temi ------------------------------------------------------ */

.areas {
	display: grid;
	gap: 1.1rem;
	grid-template-columns: repeat(auto-fit, minmax(min(100%, 16.5rem), 1fr));
}

.area-link {
	display: flex;
	flex-direction: column;
	gap: 0.55rem;
	padding: clamp(1.2rem, 3vw, 1.6rem);
	background: var(--surface);
	border: 1px solid var(--line-soft);
	border-radius: var(--radius-lg);
	text-decoration: none;
	transition: border-color 0.3s var(--ease), transform 0.3s var(--ease);
}

.area-link:hover {
	border-color: color-mix(in srgb, var(--accent) 45%, transparent);
	transform: translateY(-3px);
}

.area-link__num {
	font-family: var(--font-mono);
	font-size: var(--step--1);
	letter-spacing: 0.1em;
	color: var(--accent);
}

.area-link__title {
	font-family: var(--font-display);
	font-size: var(--step-1);
	font-weight: 600;
	line-height: 1.15;
	letter-spacing: -0.02em;
}

.area-link__topics {
	font-size: var(--step--1);
	line-height: 1.55;
	color: var(--text-mute);
}

.area-link__count {
	margin-top: auto;
	padding-top: 0.75rem;
	border-top: 1px solid var(--line-soft);
	font-size: 0.85rem;
	color: var(--text-soft);
}

.area-link:hover .area-link__count {
	color: var(--accent);
}

/* 3. Aree e casi ---------------------------------------------------------- */

.area__topics {
	margin-block: calc(clamp(2rem, 5vw, 3.5rem) * -0.5) clamp(1.75rem, 4vw, 2.5rem);
}

.tag--theme {
	color: var(--accent);
	background: color-mix(in srgb, var(--accent) 10%, transparent);
	border-color: color-mix(in srgb, var(--accent) 35%, transparent);
}

.cases {
	display: grid;
	gap: 1.1rem;
	grid-template-columns: 1fr;
}

@media (min-width: 48rem) {
	.cases {
		grid-template-columns: repeat(2, 1fr);
	}
}

.case {
	display: flex;
	flex-direction: column;
	padding: clamp(1.3rem, 3vw, 1.8rem);
	background: var(--surface);
	border: 1px solid var(--line-soft);
	border-radius: var(--radius-lg);
	transition: border-color 0.3s var(--ease);
}

.case:hover {
	border-color: var(--line);
}

.case__head {
	display: flex;
	flex-wrap: wrap;
	align-items: baseline;
	justify-content: space-between;
	gap: 0.4rem 1rem;
	margin-bottom: 0.8rem;
}

.case__sigla {
	font-family: var(--font-display);
	font-size: var(--step-1);
	font-weight: 700;
	letter-spacing: -0.03em;
	color: var(--accent);
}

.case__period {
	font-family: var(--font-mono);
	font-size: 0.8rem;
	letter-spacing: 0.04em;
	color: var(--text-mute);
}

.case__title {
	font-size: var(--step-1);
	margin-bottom: 0.55rem;
}

.case__context {
	font-size: var(--step--1);
	color: var(--text-mute);
}

.case__list {
	display: grid;
	gap: 0.6rem;
	margin-block: 1rem 1.3rem;
	font-size: var(--step--1);
	line-height: 1.6;
	color: var(--text-soft);
}

.case__list li {
	position: relative;
	padding-left: 1.4rem;
}

.case__list li::before {
	content: "";
	position: absolute;
	left: 0;
	top: 0.62em;
	width: 0.45rem;
	height: 1px;
	background: var(--accent);
}

.case .tags {
	margin-top: auto;
}

.case__link {
	display: inline-flex;
	align-items: center;
	gap: 0.4rem;
	margin-top: 1rem;
	font-size: var(--step--1);
	color: var(--accent);
}

.case__link svg {
	width: 0.95rem;
	height: 0.95rem;
}

/* 4. Matrice -------------------------------------------------------------- */

.matrix {
	overflow-x: auto;
	border: 1px solid var(--line-soft);
	border-radius: var(--radius-lg);
	background: var(--surface);
}

.matrix table {
	width: 100%;
	border-collapse: collapse;
	font-size: var(--step--1);
}

.matrix caption {
	padding: 1rem 1.15rem;
	text-align: left;
	color: var(--text-mute);
	border-bottom: 1px solid var(--line-soft);
}

.matrix th,
.matrix td {
	padding: 0.75rem 0.5rem;
	border-bottom: 1px solid var(--line-soft);
	text-align: center;
}

.matrix tbody tr:last-child > * {
	border-bottom: 0;
}

.matrix thead th {
	font-family: var(--font-mono);
	font-weight: 400;
	letter-spacing: 0.08em;
	color: var(--text-mute);
}

.matrix thead a {
	text-decoration: none;
}

.matrix thead a:hover {
	color: var(--accent);
}

.matrix th[scope="row"] {
	position: sticky;
	left: 0;
	padding-inline: 1.15rem;
	text-align: left;
	white-space: nowrap;
	background: var(--surface);
	font-family: var(--font-display);
	font-weight: 600;
}

@media (min-width: 48rem) {
	.matrix th[scope="row"] {
		width: 16rem;
	}
}

/* Sullo stretto la matrice deve stare tutta nello schermo: via il settore,
   celle più strette. Lo scroll orizzontale resta solo come rete di sicurezza. */
@media (max-width: 47.999rem) {
	.matrix th,
	.matrix td {
		padding: 0.65rem 0.2rem;
	}

	.matrix th[scope="row"] {
		padding-inline: 0.9rem 0.4rem;
	}

	.matrix tbody th[scope="row"] small {
		display: none;
	}

	.matrix thead th {
		font-size: 0.72rem;
		letter-spacing: 0;
	}
}

.matrix th[scope="row"] small {
	display: block;
	font-family: var(--font-sans);
	font-weight: 400;
	font-size: 0.78rem;
	color: var(--text-mute);
}

.matrix tbody tr:hover > * {
	background: var(--surface-2);
}

.mx-dot {
	display: inline-block;
	width: 0.6rem;
	height: 0.6rem;
	border-radius: 50%;
	background: var(--accent);
}

.matrix__legend {
	display: flex;
	flex-wrap: wrap;
	gap: 0.4rem 1.5rem;
	margin-top: 1.1rem;
	font-size: 0.85rem;
	color: var(--text-mute);
}

.matrix__legend b {
	font-family: var(--font-mono);
	font-weight: 400;
	color: var(--accent);
	margin-inline-end: 0.35rem;
}

/* Dettagli dei casi -------------------------------------------------------- */

.case code {
	font-family: var(--font-mono);
	font-size: 0.88em;
	padding: 0.1em 0.35em;
	background: var(--surface-2);
	border-radius: 5px;
}

.case__metric {
	margin-top: 1rem;
	padding-top: 0.9rem;
	border-top: 1px solid var(--line-soft);
	font-size: 0.9rem;
	color: var(--text-mute);
}
