/* wp-mafatih — Mafatih only: chapter cards (index) and item lists (chapter pages). */

/* Chapter cards */
.maf-tiles {
	display: grid;
	grid-template-columns: repeat(auto-fill, minmax(16rem, 1fr));
	gap: 1rem;
}

@media (min-width: 900px) {
	.maf-tiles {
		grid-template-columns: repeat(3, minmax(0, 1fr));
	}
}

.maf-tile {
	position: relative;
	display: flex;
	align-items: center;
	gap: 1rem;
	height: 100%;
	padding: 1.1rem 1.2rem;
	overflow: hidden;
	border: 1px solid var(--maf-mint-line);
	border-radius: 22px;
	background: var(--maf-card);
	box-shadow: var(--maf-shadow);
	transition: transform .2s ease, border-color .2s ease, box-shadow .2s ease;
}

.maf-tile::after {
	content: "";
	position: absolute;
	inset-inline-end: -30px;
	bottom: -30px;
	width: 110px;
	height: 110px;
	background-image: var(--maf-pattern);
	background-size: 55px;
	opacity: .07;
	pointer-events: none;
}

.maf-tile:hover {
	border-color: var(--maf-green);
	box-shadow: 0 18px 36px -20px rgba(0, 80, 40, .55);
	transform: translateY(-3px);
}

.maf-tile__num {
	flex: none;
	display: grid;
	place-items: center;
	width: 3.2rem;
	height: 3.2rem;
	background: var(--maf-green);
	clip-path: var(--maf-star);
	font-size: 1.15rem;
	font-weight: 700;
	color: #fff;
}

.maf-tile__text {
	display: flex;
	flex: 1;
	flex-direction: column;
	min-width: 0;
}

.maf-tile__title {
	font-weight: 700;
	font-size: 1.05rem;
	line-height: 1.7;
}

.maf-tile__meta {
	font-size: .85rem;
	color: var(--maf-ink-soft);
}

.maf-tile__go {
	flex: none;
	width: 10px;
	height: 10px;
	border-inline-start: 2.5px solid var(--maf-red);
	border-bottom: 2.5px solid var(--maf-red);
	transform: rotate(135deg); /* Points left: forward in a right-to-left page. */
}

/* Lists on chapter pages */
.maf-list {
	display: grid;
	grid-template-columns: repeat(auto-fill, minmax(16rem, 1fr));
	gap: .55rem;
}

.maf-list a {
	display: flex;
	align-items: center;
	gap: .7rem;
	height: 100%;
	min-height: 3.1rem;
	padding: .55rem 1rem;
	border: 1px solid var(--maf-mint-line);
	border-radius: 16px;
	background: var(--maf-card);
	line-height: 1.7;
	transition: border-color .15s ease, background-color .15s ease;
}

.maf-list a::before {
	content: "";
	flex: none;
	width: 9px;
	height: 9px;
	background: var(--maf-mint);
	clip-path: var(--maf-star);
}

.maf-list a:hover {
	border-color: var(--maf-green);
	background: var(--maf-mint-soft);
	color: var(--maf-green-ink);
}

.maf-list a:hover::before {
	background: var(--maf-red);
}

@media (max-width: 600px) {
	.maf-tile {
		flex-direction: column;
		text-align: center;
		gap: .5rem;
	}

	.maf-tile__go {
		display: none;
	}

	.maf-tiles {
		grid-template-columns: repeat(2, minmax(0, 1fr));
		gap: .6rem;
	}

	.maf-list a {
		justify-content: center;
		text-align: center;
	}
}
