/* CSS Reset */
*,
*::before,
*::after {
	box-sizing: border-box;
	margin: 0;
	padding: 0;
}

html {
	-webkit-text-size-adjust: 100%;
	text-rendering: optimizelegibility;
}

body {
	min-height: 100vh;
	line-height: 1.75;
	font-family: system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
	padding: 2rem;
	display: flex;
	justify-content: center;
	color: #374151;
	background: #ffffff;
}

article {
	max-width: 65ch;
	width: 100%;
	font-size: 1.125rem;
}

/* Typography Styles (Prose) */
article h1 {
	font-size: 2.25rem;
	font-weight: 800;
	line-height: 1.2;
	margin-bottom: 1.5rem;
	color: #111827;
}

article h2 {
	font-size: 1.875rem;
	font-weight: 700;
	line-height: 1.3;
	margin-top: 2.5rem;
	margin-bottom: 1.25rem;
	color: #111827;
}

article h3 {
	font-size: 1.5rem;
	font-weight: 600;
	line-height: 1.4;
	margin-top: 2rem;
	margin-bottom: 1rem;
	color: #111827;
}

article h4 {
	font-size: 1.25rem;
	font-weight: 600;
	line-height: 1.5;
	margin-top: 1.75rem;
	margin-bottom: 0.75rem;
	color: #111827;
}

article p {
	margin-bottom: 1.25rem;
	line-height: 1.75;
}

article p.lead {
	font-size: 1.25rem;
	color: #6b7280;
	margin-bottom: 1.75rem;
}

article a {
	color: #2563eb;
	text-decoration: underline;
	font-weight: 500;
}

article a:hover {
	color: #1d4ed8;
}

article strong {
	font-weight: 600;
	color: #111827;
}

article em {
	font-style: italic;
}

article code {
	font-family: 'Courier New', Courier, monospace;
	font-size: 0.875em;
	padding: 0.2em 0.4em;
	background: #f3f4f6;
	border-radius: 0.25rem;
	color: #111827;
}

article pre {
	background: #1f2937;
	color: #f9fafb;
	padding: 1.25rem 1.5rem;
	border-radius: 0.5rem;
	overflow-x: auto;
	margin: 1.75rem 0;
	line-height: 1.7;
}

article pre code {
	background: none;
	padding: 0;
	font-size: 0.875rem;
	color: inherit;
}

article ul,
article ol {
	margin: 1.25rem 0 1.25rem 1.5rem;
	padding-left: 0.5rem;
}

article ul {
	list-style-type: disc;
}

article ol {
	list-style-type: decimal;
}

article li {
	margin-bottom: 0.5rem;
	line-height: 1.75;
}

article li > p {
	margin-bottom: 0.75rem;
}

article blockquote {
	font-style: italic;
	border-left: 4px solid #e5e7eb;
	padding-left: 1.5rem;
	margin: 1.75rem 0;
	color: #6b7280;
}

article blockquote p {
	margin-bottom: 0.5rem;
}

article table {
	width: 100%;
	border-collapse: collapse;
	margin: 1.75rem 0;
	font-size: 0.95rem;
}

article thead {
	border-bottom: 2px solid #e5e7eb;
}

article th {
	font-weight: 600;
	text-align: left;
	padding: 0.75rem 1rem;
	color: #111827;
}

article td {
	padding: 0.75rem 1rem;
	border-top: 1px solid #e5e7eb;
}

article tbody tr:hover {
	background: #f9fafb;
}

article aside {
	background: #f3f4f6;
	border-left: 4px solid #9ca3af;
	padding: 1rem 1.5rem;
	margin: 1.75rem 0;
	border-radius: 0.25rem;
}

article footer {
	margin-top: 3rem;
	padding-top: 2rem;
	border-top: 1px solid #e5e7eb;
	color: #6b7280;
	font-size: 0.95rem;
}

article small {
	font-size: 0.875rem;
	color: #6b7280;
}

/* Responsive */
@media (max-width: 640px) {
	body {
		padding: 1rem;
	}

	article {
		font-size: 1rem;
	}

	article h1 {
		font-size: 1.875rem;
	}

	article h2 {
		font-size: 1.5rem;
	}

	article h3 {
		font-size: 1.25rem;
	}
}

/* Listing page styles */
.container {
    max-width: 1200px;
    width: 100%;
    margin: 0 auto;
}

.page-header {
    background: #f9fafb;
    border-radius: 12px;
    padding: 3rem 2rem;
    margin-bottom: 2rem;
    text-align: center;
}

.page-header h1 {
    margin: 0 0 0.5rem 0;
}

.page-header p {
    margin: 0;
    color: #6b7280;
}

.articles-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 1.5rem;
}

.article-card {
    background: #ffffff;
    border: 1px solid #e5e7eb;
    border-radius: 12px;
    padding: 1.5rem;
    transition: all 0.2s;
    display: flex;
    flex-direction: column;
}

.article-card:hover {
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    transform: translateY(-2px);
}

.article-meta {
    display: flex;
    gap: 0.5rem;
    margin-bottom: 1rem;
}

.badge {
    display: inline-block;
    padding: 0.25rem 0.75rem;
    background: #f3f4f6;
    border-radius: 6px;
    font-size: 0.875rem;
    color: #6b7280;
}

.article-card h2 {
    font-size: 1.25rem;
    margin: 0 0 0.75rem 0;
    color: #111827;
}

.article-card p {
    margin: 0 0 1.5rem 0;
    color: #6b7280;
    font-size: 0.95rem;
    line-height: 1.6;
    flex-grow: 1;
}

.article-actions {
    display: flex;
    gap: 0.5rem;
}

.btn {
    flex: 1;
    padding: 0.75rem 1rem;
    border: none;
    border-radius: 8px;
    font-size: 0.875rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    text-decoration: none;
    text-align: center;
    display: inline-block;
}

.btn-primary {
    background: #2563eb;
    color: white;
}

.btn-primary:hover {
    background: #1d4ed8;
}

.btn-secondary {
    background: #f3f4f6;
    color: #374151;
}

.btn-secondary:hover {
    background: #e5e7eb;
}

.btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.loading, .error {
    text-align: center;
    padding: 3rem;
    color: #6b7280;
}

.error {
    color: #dc2626;
}

@media (max-width: 768px) {
    .articles-grid {
        grid-template-columns: 1fr;
    }

    .page-header {
        padding: 2rem 1.5rem;
    }
}
