/* ═══════════════════════════════════════════
   Sqalie Blog — Public Stylesheet
   Clean, minimal, SEO-friendly
   ═══════════════════════════════════════════ */

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

:root {
    --color-bg: #ffffff;
    --color-text: #1a1a2e;
    --color-text-light: #6b7280;
    --color-border: #e5e7eb;
    --color-accent: #2563eb;
    --color-accent-hover: #1d4ed8;
    --color-surface: #f9fafb;
    --font-sans: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    --font-serif: 'Georgia', 'Times New Roman', serif;
    --max-width: 1120px;
    --max-width-prose: 720px;
}

html { font-size: 16px; scroll-behavior: smooth; }

body {
    font-family: var(--font-sans);
    color: var(--color-text);
    background: var(--color-bg);
    line-height: 1.7;
    -webkit-font-smoothing: antialiased;
}

img { max-width: 100%; height: auto; display: block; }
a { color: var(--color-accent); text-decoration: none; }
a:hover { color: var(--color-accent-hover); }

.container {
    max-width: var(--max-width);
    margin: 0 auto;
    padding: 0 1.5rem;
}

/* ── Header ── */
.site-header {
    border-bottom: 1px solid var(--color-border);
    padding: 1rem 0;
}

.site-header .container {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.site-logo {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--color-text);
    letter-spacing: -0.02em;
}

.site-nav {
    display: flex;
    gap: 1.5rem;
}

.site-nav a {
    color: var(--color-text-light);
    font-size: 0.9rem;
    font-weight: 500;
    transition: color 0.15s;
}

.site-nav a:hover { color: var(--color-text); }

/* ── Hero ── */
.hero {
    text-align: center;
    padding: 4rem 0 2rem;
}

.hero h1 {
    font-size: 2.5rem;
    font-weight: 800;
    letter-spacing: -0.03em;
    margin-bottom: 0.5rem;
}

.hero-tagline {
    font-size: 1.15rem;
    color: var(--color-text-light);
}

/* ── Category Filter ── */
.category-filter {
    display: flex;
    gap: 0.75rem;
    justify-content: center;
    padding: 1.5rem 0 2.5rem;
    flex-wrap: wrap;
}

.category-filter a {
    padding: 0.4rem 1rem;
    border-radius: 9999px;
    font-size: 0.85rem;
    font-weight: 500;
    color: var(--color-text-light);
    border: 1px solid var(--color-border);
    transition: all 0.15s;
}

.category-filter a:hover,
.category-filter a.active {
    background: var(--color-text);
    color: #fff;
    border-color: var(--color-text);
}

/* ── Posts Grid ── */
.posts-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 2rem;
    padding-bottom: 3rem;
}

.post-card {
    border: 1px solid var(--color-border);
    border-radius: 12px;
    overflow: hidden;
    transition: box-shadow 0.2s;
}

.post-card:hover {
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.06);
}

.post-card-image img {
    width: 100%;
    height: 200px;
    object-fit: cover;
}

.post-card-body {
    padding: 1.25rem;
}

.post-card-category {
    display: inline-block;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--color-accent);
    margin-bottom: 0.5rem;
}

.post-card-title {
    font-size: 1.15rem;
    font-weight: 700;
    line-height: 1.4;
    margin-bottom: 0.5rem;
}

.post-card-title a {
    color: var(--color-text);
}

.post-card-title a:hover {
    color: var(--color-accent);
}

.post-card-excerpt {
    font-size: 0.9rem;
    color: var(--color-text-light);
    line-height: 1.5;
    margin-bottom: 0.75rem;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.post-card-meta {
    font-size: 0.8rem;
    color: var(--color-text-light);
}

/* ── Single Post ── */
.post {
    max-width: var(--max-width-prose);
    margin: 0 auto;
    padding: 2rem 0 4rem;
}

.post-header {
    margin-bottom: 2rem;
}

.post-category {
    display: inline-block;
    font-size: 0.8rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--color-accent);
    margin-bottom: 0.75rem;
}

.post-header h1 {
    font-size: 2.25rem;
    font-weight: 800;
    line-height: 1.25;
    letter-spacing: -0.02em;
    margin-bottom: 1rem;
}

.post-meta {
    font-size: 0.9rem;
    color: var(--color-text-light);
}

.post-meta-sep { margin: 0 0.4rem; }

.post-image {
    margin: 0 -1.5rem 2rem;
    border-radius: 12px;
    overflow: hidden;
}

.post-image img {
    width: 100%;
    height: auto;
}

/* ── Prose (article content) ── */
.prose h2 { font-size: 1.5rem; font-weight: 700; margin: 2rem 0 0.75rem; }
.prose h3 { font-size: 1.25rem; font-weight: 600; margin: 1.5rem 0 0.5rem; }
.prose p { margin-bottom: 1.25rem; }
.prose ul, .prose ol { margin-bottom: 1.25rem; padding-left: 1.5rem; }
.prose li { margin-bottom: 0.25rem; }
.prose blockquote {
    border-left: 3px solid var(--color-accent);
    padding-left: 1rem;
    margin: 1.5rem 0;
    color: var(--color-text-light);
    font-style: italic;
}
.prose pre {
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: 8px;
    padding: 1rem;
    overflow-x: auto;
    margin-bottom: 1.25rem;
    font-size: 0.875rem;
    line-height: 1.6;
}
.prose code {
    background: var(--color-surface);
    padding: 0.15em 0.4em;
    border-radius: 4px;
    font-size: 0.9em;
}
.prose pre code {
    background: none;
    padding: 0;
}
.prose img {
    border-radius: 8px;
    margin: 1.5rem 0;
}
.prose a { text-decoration: underline; }
.prose table {
    width: 100%;
    border-collapse: collapse;
    margin-bottom: 1.25rem;
}
.prose th, .prose td {
    border: 1px solid var(--color-border);
    padding: 0.5rem 0.75rem;
    text-align: left;
}
.prose th { background: var(--color-surface); font-weight: 600; }

/* ── Tags ── */
.post-tags { margin-top: 2rem; padding-top: 1.5rem; border-top: 1px solid var(--color-border); }
.tag {
    display: inline-block;
    padding: 0.25rem 0.75rem;
    background: var(--color-surface);
    border-radius: 9999px;
    font-size: 0.8rem;
    color: var(--color-text-light);
    margin: 0.25rem 0.25rem 0 0;
}

/* ── Category Header ── */
.category-header {
    padding: 3rem 0 2rem;
}
.category-header h1 { font-size: 2rem; font-weight: 800; }
.category-description { color: var(--color-text-light); margin-top: 0.5rem; }

/* ── Misc ── */
.empty-state {
    text-align: center;
    padding: 4rem 0;
    color: var(--color-text-light);
    font-size: 1.1rem;
}

.back-link {
    display: inline-block;
    margin-top: 2rem;
    font-weight: 500;
}

/* ── Footer ── */
.site-footer {
    border-top: 1px solid var(--color-border);
    padding: 2rem 0;
    text-align: center;
    font-size: 0.85rem;
    color: var(--color-text-light);
}

.site-footer a { color: var(--color-text-light); }
.site-footer a:hover { color: var(--color-text); }

/* ── Responsive ── */
@media (max-width: 768px) {
    .hero h1 { font-size: 1.75rem; }
    .post-header h1 { font-size: 1.75rem; }
    .posts-grid { grid-template-columns: 1fr; }
    .site-header .container { flex-direction: column; gap: 0.75rem; }
    .site-nav { gap: 1rem; }
}
