<script setup lang="ts">
import { ref } from 'vue';

const lessons = ref([
	{
		id: 'l1',
		title: 'Getting Started',
		summary: 'Overview of the codebase and conventions.',
		type: 'Video',
	},
	{
		id: 'l2',
		title: 'Core Concepts',
		summary: 'Key patterns and architecture.',
		type: 'Article',
	},
	{
		id: 'l3',
		title: 'Hands-on Lab',
		summary: 'Small task to practice.',
		type: 'Practical',
	},
]);
</script>

<template>
	<div class="page-wrap">
		<header class="page-header">
			<h1>Training Module</h1>
			<p class="lead">Interactive module with lessons and checkpoints.</p>
		</header>

		<section class="lessons">
			<article
				v-for="lesson in lessons"
				:key="lesson.id"
				class="lesson-card"
			>
				<h3>{{ lesson.title }}</h3>
				<p>{{ lesson.summary }}</p>
				<div class="lesson-footer">
					<span class="badge">{{ lesson.type }}</span>
					<button class="cta-small">Open</button>
				</div>
			</article>
		</section>
	</div>
</template>

<style scoped>
.page-wrap {
	max-width: 960px;
	margin: 0 auto;
	padding: 1rem;
}
.page-header h1 {
	font-size: 2rem;
}
.lead {
	color: #6b7280;
	margin-bottom: 1rem;
}
.lessons {
	display: grid;
	grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
	gap: 1rem;
}
.lesson-card {
	background: #fff;
	padding: 0.75rem;
	border-radius: 8px;
	box-shadow: 0 1px 2px rgba(0, 0, 0, 0.04);
}
.lesson-footer {
	display: flex;
	justify-content: space-between;
	align-items: center;
	margin-top: 0.75rem;
}
.badge {
	background: #eef2ff;
	color: #4f46e5;
	padding: 0.25rem 0.5rem;
	border-radius: 6px;
	font-weight: 600;
}
.cta-small {
	background: #4f46e5;
	color: #fff;
	padding: 0.4rem 0.6rem;
	border-radius: 6px;
	border: none;
}
</style>
