/* HasnainCMS Starter Styles
   Replace or extend with your own design */

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

:root {
  --max-w: 900px;
  --color-text: #1a1a1a;
  --color-muted: #666;
  --color-accent: #2563eb;
  --color-border: #e5e7eb;
  --font: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
}

body {
  font-family: var(--font);
  color: var(--color-text);
  line-height: 1.6;
  font-size: 1rem;
}

/* ── Header ── */
header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1rem 2rem;
  border-bottom: 1px solid var(--color-border);
  max-width: var(--max-w);
  margin: 0 auto;
}
header a { color: inherit; text-decoration: none; }
header > a { font-weight: 700; font-size: 1.1rem; }
nav { display: flex; gap: 1.5rem; }
nav a { color: var(--color-muted); font-size: .9rem; }
nav a:hover { color: var(--color-accent); }

/* ── Main ── */
main {
  max-width: var(--max-w);
  margin: 2rem auto;
  padding: 0 2rem;
}

/* ── Blog post ── */
.post-container { max-width: 720px; margin: 2rem auto; padding: 0 2rem; }
.post-header { margin-bottom: 2rem; }
.post-header h1 { font-size: 2rem; line-height: 1.25; margin-bottom: .5rem; }
.post-meta { color: var(--color-muted); font-size: .85rem; }
.tag { background: #f3f4f6; padding: .1rem .5rem; border-radius: 4px; font-size: .75rem; }
.post-content h2 { margin: 1.8rem 0 .7rem; font-size: 1.4rem; }
.post-content h3 { margin: 1.5rem 0 .5rem; font-size: 1.15rem; }
.post-content p { margin-bottom: 1rem; }
.post-content a { color: var(--color-accent); }
.post-content img { max-width: 100%; height: auto; border-radius: 8px; margin: 1rem 0; }
.post-content ul, .post-content ol { padding-left: 1.5rem; margin-bottom: 1rem; }
.post-content li { margin-bottom: .3rem; }
.post-content blockquote { border-left: 3px solid var(--color-accent); padding-left: 1rem; color: var(--color-muted); margin: 1rem 0; }

/* ── Blog index ── */
.posts-grid { display: grid; gap: 2rem; }
.post-card { border: 1px solid var(--color-border); border-radius: 10px; overflow: hidden; }
.post-card img { width: 100%; height: 200px; object-fit: cover; display: block; }
.post-card-body { padding: 1.2rem; }
.post-card h2 { font-size: 1.2rem; margin-bottom: .4rem; }
.post-card h2 a { color: inherit; text-decoration: none; }
.post-card h2 a:hover { color: var(--color-accent); }
.post-card .post-meta { font-size: .8rem; color: var(--color-muted); margin-bottom: .7rem; }
.read-more { color: var(--color-accent); font-size: .875rem; text-decoration: none; font-weight: 600; }

/* ── Related posts ── */
.related-posts { margin-top: 3rem; padding-top: 2rem; border-top: 1px solid var(--color-border); }
.related-posts h2 { margin-bottom: 1rem; font-size: 1.2rem; }
.related-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 1rem; }
.related-card { display: block; border: 1px solid var(--color-border); border-radius: 8px; overflow: hidden; text-decoration: none; color: inherit; }
.related-card img { width: 100%; height: 120px; object-fit: cover; display: block; }
.related-card h3 { padding: .7rem; font-size: .9rem; }
.related-card p { padding: 0 .7rem .7rem; font-size: .8rem; color: var(--color-muted); }
.related-card:hover { border-color: var(--color-accent); }

/* ── Footer ── */
footer {
  text-align: center;
  padding: 2rem;
  font-size: .85rem;
  color: var(--color-muted);
  border-top: 1px solid var(--color-border);
  margin-top: 4rem;
}
