/* ============================================================
   khadersyed.com — Plain CSS
   Daring Fireball–inspired, typography-focused design
   ============================================================ */

/* --- Reset & Base ------------------------------------------ */

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

html {
  font-size: 16px;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body {
  font-family: 'Geist', system-ui, -apple-system, sans-serif;
  color: #111827;
  background: #fff;
  line-height: 1.7;
}

a {
  color: inherit;
  text-decoration: none;
}

a:hover {
  color: #374151;
}

a:focus-visible {
  outline: 2px solid rgba(107, 114, 128, 0.5);
  outline-offset: 2px;
}

img {
  max-width: 100%;
  height: auto;
}

/* --- Layout ------------------------------------------------ */

.site {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

.container {
  max-width: 56rem;
  margin: 0 auto;
  padding: 0 1.5rem;
}

.site-header {
  border-bottom: 1px solid #e5e7eb;
  background: #fff;
}

.header-inner {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding-top: 1rem;
  padding-bottom: 1rem;
}

.site-title {
  font-size: 1.5rem;
  font-weight: 700;
  color: #111827;
  transition: color 0.2s;
}

.site-title:hover {
  color: #374151;
}

.site-nav {
  display: none;
  gap: 2rem;
  font-size: 0.875rem;
}

.nav-link {
  color: #4b5563;
  transition: color 0.2s;
}

.nav-link:hover {
  color: #111827;
}

.content-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 2rem;
  padding: 2rem 0;
}

.main-content {
  min-width: 0;
}

.site-footer {
  border-top: 1px solid #e5e7eb;
  margin-top: auto;
  padding: 2rem 0;
}

.footer-text {
  font-size: 0.875rem;
  color: #6b7280;
  text-align: center;
}

@media (min-width: 1024px) {
  .site-nav {
    display: flex;
  }

  .content-grid {
    grid-template-columns: 1fr 3fr;
  }
}

/* --- Sidebar ----------------------------------------------- */

.sidebar-heading {
  font-size: 0.75rem;
  font-weight: 600;
  color: #111827;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 1rem;
}

.recent-posts {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.recent-post {
  padding-bottom: 1rem;
  border-bottom: 1px solid #e5e7eb;
}

.recent-post:last-child {
  border-bottom: none;
}

.recent-post-link {
  display: block;
  font-size: 0.875rem;
  color: #374151;
  line-height: 1.5;
  transition: color 0.2s;
}

.recent-post-link:hover {
  color: #111827;
}

.recent-post-date {
  display: block;
  font-size: 0.75rem;
  color: #6b7280;
  margin-top: 0.25rem;
}

.sidebar-links {
  margin-top: 2rem;
}

.sidebar-links nav {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.sidebar-link {
  display: block;
  font-size: 0.875rem;
  color: #4b5563;
  transition: color 0.2s;
}

.sidebar-link:hover {
  color: #111827;
}

.newsletter {
  border-top: 1px solid #e5e7eb;
  padding-top: 1.5rem;
  margin-top: 2rem;
}

.newsletter-text {
  font-size: 0.875rem;
  color: #4b5563;
  margin-bottom: 0.75rem;
}

.newsletter-input {
  display: block;
  width: 100%;
  padding: 0.5rem 0.75rem;
  border: 1px solid #d1d5db;
  border-radius: 0.25rem;
  font-size: 0.875rem;
  font-family: inherit;
  margin-bottom: 0.5rem;
  transition: border-color 0.2s, box-shadow 0.2s;
}

.newsletter-input:focus {
  outline: none;
  border-color: #6b7280;
  box-shadow: 0 0 0 3px rgba(107, 114, 128, 0.15);
}

.newsletter-button {
  display: block;
  width: 100%;
  padding: 0.5rem 1rem;
  background: #111827;
  color: #fff;
  border: none;
  border-radius: 0.25rem;
  font-size: 0.875rem;
  font-weight: 500;
  font-family: inherit;
  cursor: pointer;
  transition: background 0.2s;
}

.newsletter-button:hover {
  background: #1f2937;
}

/* --- Post Cards (Home & Archive) --------------------------- */

.post-list {
  display: flex;
  flex-direction: column;
  gap: 2rem;
}

.post-card {
  padding-bottom: 2rem;
  border-bottom: 1px solid #e5e7eb;
}

.post-card:last-child {
  border-bottom: none;
}

.post-card-date {
  margin-bottom: 0.5rem;
}

.post-card-date time {
  font-size: 0.875rem;
  color: #6b7280;
}

.post-card-title {
  font-size: 1.5rem;
  font-weight: 700;
  color: #111827;
  margin-bottom: 0.75rem;
  line-height: 1.3;
}

.post-card-title a {
  transition: color 0.2s;
}

.post-card-title a:hover {
  color: #374151;
}

.post-card-excerpt {
  color: #374151;
  line-height: 1.7;
}

.read-more {
  margin-top: 1rem;
}

.read-more a {
  font-size: 0.875rem;
  color: #4b5563;
  transition: color 0.2s;
}

.read-more a:hover {
  color: #111827;
}

.archive-link {
  padding-top: 2rem;
}

.archive-link a {
  font-size: 0.875rem;
  color: #4b5563;
  transition: color 0.2s;
}

.archive-link a:hover {
  color: #111827;
}

/* --- Blog Post --------------------------------------------- */

.post-article {
  max-width: none;
}

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

.post-title {
  font-size: 1.875rem;
  font-weight: 700;
  color: #111827;
  margin-bottom: 1rem;
  line-height: 1.2;
}

.post-subtitle {
  font-size: 1.125rem;
  color: #4b5563;
  font-style: italic;
  margin-bottom: 1rem;
}

.post-meta {
  font-size: 0.875rem;
  color: #6b7280;
  margin-bottom: 1.5rem;
}

.post-external-link {
  color: #2563eb;
  transition: color 0.2s;
}

.post-external-link:hover {
  color: #1e40af;
}

/* --- Prose (rendered markdown) ----------------------------- */

.post-content {
  color: #374151;
  line-height: 1.8;
}

.post-content h1,
.post-content h2,
.post-content h3,
.post-content h4,
.post-content h5,
.post-content h6 {
  color: #111827;
  font-weight: 700;
  margin-top: 2em;
  margin-bottom: 0.75em;
  line-height: 1.3;
}

.post-content h1 { font-size: 1.875rem; }
.post-content h2 { font-size: 1.5rem; }
.post-content h3 { font-size: 1.25rem; }
.post-content h4 { font-size: 1.125rem; }

.post-content p {
  margin-bottom: 1.25em;
}

.post-content a {
  color: #2563eb;
  transition: color 0.2s;
}

.post-content a:hover {
  color: #1e40af;
}

.post-content strong {
  color: #111827;
  font-weight: 600;
}

.post-content em {
  color: #374151;
}

.post-content blockquote {
  border-left: 3px solid #d1d5db;
  padding-left: 1rem;
  color: #4b5563;
  font-style: italic;
  margin: 1.5em 0;
}

.post-content ul,
.post-content ol {
  padding-left: 1.5rem;
  margin-bottom: 1.25em;
}

.post-content li {
  margin-bottom: 0.5em;
}

.post-content code {
  font-family: 'SF Mono', 'Menlo', 'Consolas', monospace;
  font-size: 0.875em;
  color: #1f2937;
  background: #f3f4f6;
  padding: 0.125em 0.375em;
  border-radius: 0.25rem;
}

.post-content pre {
  background: #f3f4f6;
  padding: 1rem 1.25rem;
  border-radius: 0.375rem;
  overflow-x: auto;
  margin: 1.5em 0;
  line-height: 1.6;
}

.post-content pre code {
  background: none;
  padding: 0;
  font-size: 0.875rem;
}

.post-content hr {
  border: none;
  border-top: 1px solid #e5e7eb;
  margin: 2em 0;
}

.post-content img {
  border-radius: 0.375rem;
  margin: 1.5em 0;
}

.post-content table {
  width: 100%;
  border-collapse: collapse;
  margin: 1.5em 0;
}

.post-content th,
.post-content td {
  border: 1px solid #e5e7eb;
  padding: 0.5rem 0.75rem;
  text-align: left;
}

.post-content th {
  background: #f9fafb;
  font-weight: 600;
}

/* --- Static Pages ------------------------------------------ */

.page-title {
  font-size: 1.875rem;
  font-weight: 700;
  color: #111827;
  margin-bottom: 1rem;
}

.page-content {
  color: #374151;
  line-height: 1.8;
}

.page-content p {
  margin-bottom: 1.25em;
}

.page-content a {
  color: #2563eb;
}

.page-content a:hover {
  color: #1e40af;
}

.page-content h2 {
  font-size: 1.5rem;
  font-weight: 700;
  color: #111827;
  margin-top: 2em;
  margin-bottom: 1rem;
}

.page-content h3 {
  font-size: 1.125rem;
  font-weight: 600;
  color: #111827;
  margin-bottom: 0.5rem;
}

.page-content ul {
  padding-left: 1.5rem;
  margin-bottom: 1.25em;
}

.page-content li {
  margin-bottom: 0.25em;
  color: #4b5563;
}

.verse {
  line-height: 1.8;
}

.lead {
  font-size: 1.125rem;
  margin-bottom: 1.5rem;
}

.contact-section {
  margin-bottom: 1.5rem;
}

.contact-tips {
  background: #f9fafb;
  padding: 1rem 1.25rem;
  border-radius: 0.5rem;
  margin: 1.5rem 0;
}

/* --- Syntax Highlighting (Smalto) -------------------------- */

.smalto-keyword { color: #8b5cf6; }
.smalto-string { color: #059669; }
.smalto-comment { color: #6b7280; font-style: italic; }
.smalto-number { color: #d97706; }
.smalto-function { color: #2563eb; }
.smalto-type { color: #0891b2; }
.smalto-operator { color: #374151; }
.smalto-punctuation { color: #374151; }
.smalto-variable { color: #dc2626; }
.smalto-attribute { color: #7c3aed; }

/* --- Scrollbar --------------------------------------------- */

::-webkit-scrollbar {
  width: 8px;
}

::-webkit-scrollbar-track {
  background: rgba(0, 0, 0, 0.03);
}

::-webkit-scrollbar-thumb {
  background: rgba(0, 0, 0, 0.15);
  border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
  background: rgba(0, 0, 0, 0.25);
}
