/*
 * 課題一覧ページ専用。
 *
 * 単なるリンク一覧ではなく、「今どのような状態か」から自分に近い課題を
 * 選べるディレクトリとして表示する。課題の分類・説明は page-problem.php が所有する。
 */

.p-problem-index .c-entry-content {
	margin-bottom: 56px;
}

.p-problem-groups {
	border-bottom: 1px solid var(--color-border);
}

.p-problem-group {
	display: grid;
	grid-template-columns: minmax(210px, 0.34fr) minmax(0, 1fr);
	align-items: start;
	gap: 64px;
	padding: 64px 0;
	border-top: 1px solid var(--color-border);
	scroll-margin-top: 96px;
}

.p-problem-group:first-child {
	padding-top: 0;
	border-top: 0;
}

.p-problem-group__header {
	max-width: 300px;
}

.p-problem-group__eyebrow {
	margin: 0 0 10px;
	color: var(--color-primary);
	font-size: 0.68rem;
	font-weight: 600;
	line-height: 1.4;
	letter-spacing: 0.08em;
}

.p-problem-group__header h2 {
	margin: 0;
	color: var(--color-heading);
	font-weight: 500;
}

.p-problem-group__header > p:last-child {
	margin: 16px 0 0;
	color: var(--color-text-secondary);
	line-height: 1.85;
}

.p-problem-cards {
	display: grid;
	grid-template-columns: repeat(2, minmax(0, 1fr));
	gap: 16px;
}

.p-problem-card {
	display: flex;
	min-width: 0;
	overflow: hidden;
	flex-direction: column;
	color: var(--color-text);
	background: var(--color-background);
	border: 1px solid var(--color-border);
	text-decoration: none;
	transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.p-problem-card:hover,
.p-problem-card:focus-visible {
	border-color: var(--color-primary);
	box-shadow: 0 10px 28px var(--color-shadow-neutral-soft);
}

.p-problem-card__visual {
	overflow: hidden;
	background: var(--color-background-subtle);
	border-bottom: 1px solid var(--color-border);
}

.p-problem-card__visual img {
	display: block;
	width: 100%;
	aspect-ratio: 16 / 9;
	object-fit: cover;
	transition: transform 0.3s ease;
}

.p-problem-card:hover .p-problem-card__visual img,
.p-problem-card:focus-visible .p-problem-card__visual img {
	transform: scale(1.02);
}

.p-problem-card__body {
	display: flex;
	flex: 1;
	flex-direction: column;
	padding: 24px 26px 26px;
}

.p-problem-card__head {
	display: grid;
	grid-template-columns: minmax(0, 1fr) 10px;
	align-items: start;
	gap: 22px;
}

.p-problem-card h3 {
	justify-self: start;
	width: fit-content;
	max-width: 100%;
	padding-bottom: 4px;
	margin: 0;
	color: var(--color-heading);
	background-image: linear-gradient(currentColor, currentColor);
	background-repeat: no-repeat;
	background-position: right bottom;
	background-size: 0 1px;
	font-weight: 500;
	transition: color 0.2s ease, background-size 0.3s ease;
}

.p-problem-card:hover h3,
.p-problem-card:focus-visible h3 {
	color: var(--color-primary-dark);
	background-position: left bottom;
	background-size: 100% 1px;
}

.p-problem-card__arrow {
	display: block;
	width: 8px;
	height: 8px;
	margin-top: 8px;
	border-top: 1.5px solid var(--color-primary);
	border-right: 1.5px solid var(--color-primary);
	transform: rotate(45deg);
}

.p-problem-card__summary {
	margin: 18px 0 0;
	color: var(--color-text-secondary);
	line-height: 1.85;
}

.p-problem-card__states {
	padding-top: 18px;
	margin-top: 24px;
	border-top: 1px solid var(--color-border);
}

.p-problem-card__states > p {
	margin: 0 0 10px;
	color: var(--color-primary-dark);
	font-size: 0.72rem;
	font-weight: 600;
	line-height: 1.4;
}

.p-problem-card__states ul {
	display: grid;
	gap: 6px;
	padding: 0;
	margin: 0;
	list-style: none;
}

.p-problem-card__states li {
	position: relative;
	padding-left: 14px;
	color: var(--color-text);
	line-height: 1.65;
}

.p-problem-card__states li::before {
	position: absolute;
	top: 0.72em;
	left: 1px;
	width: 4px;
	height: 4px;
	content: "";
	background: var(--color-primary);
	border-radius: 50%;
}

.p-problem-card__body::after {
	display: block;
	padding-top: 18px;
	margin-top: auto;
	color: var(--color-primary);
	border-top: 1px solid var(--color-border);
	content: "詳しく見る  →";
	font-weight: 600;
	line-height: 1.4;
}

@media (max-width: 980px) {
	.p-problem-group {
		grid-template-columns: 1fr;
		gap: 28px;
		padding: 52px 0;
	}

	.p-problem-group:first-child {
		padding-top: 0;
	}

	.p-problem-group__header {
		max-width: 680px;
	}
}

@media (max-width: 760px) {
	.p-problem-index .c-entry-content {
		margin-bottom: 40px;
	}

	.p-problem-group {
		gap: 24px;
		padding: 44px 0;
		scroll-margin-top: 80px;
	}

	.p-problem-group:first-child {
		padding-top: 0;
	}

	.p-problem-cards {
		grid-template-columns: 1fr;
	}

	.p-problem-card__body {
		padding: 22px 22px 24px;
	}
}

@media (prefers-reduced-motion: reduce) {
	.p-problem-card,
	.p-problem-card__visual img,
	.p-problem-card h3 {
		transition: none;
	}
}
