/* kattilamaki.com - Modern blog inspired by Medium/Ghost */
:root {
  --font-sans: -apple-system, BlinkMacSystemFont, "Segoe UI", "Inter", Roboto, "Helvetica Neue", Arial, sans-serif;
  --max-width: 72rem;
  --text: #292929;
  --text-light: #757575;
  --bg: #ffffff;
  --bg-subtle: #fafafa;
  --border: #e8e8e8;
  --accent: #1a8917;
  --shadow: 0 1px 3px rgba(0,0,0,0.05), 0 4px 12px rgba(0,0,0,0.05);
  --shadow-hover: 0 2px 8px rgba(0,0,0,0.08), 0 8px 24px rgba(0,0,0,0.08);
}

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

body {
  font-family: var(--font-sans);
  line-height: 1.6;
  color: var(--text);
  background: var(--bg);
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 2rem 1.5rem;
  -webkit-font-smoothing: antialiased;
}

/* Header */
header { 
  margin-bottom: 0;
  padding-bottom: 0.75rem;
  border-bottom: 1px solid var(--border);
}
header h1 { 
  font-size: 2rem; 
  font-weight: 700;
  letter-spacing: -0.02em;
  margin-bottom: 0.5rem;
  color: var(--text);
}
header p { 
  color: var(--text-light); 
  font-size: 1.125rem;
  line-height: 1.5;
}

/* Post list */
.post-grid { 
  display: block;
  max-width: none;
  margin: 0;
  padding: 0;
}

/* Post row */
.post-card {
  display: flex;
  flex-direction: row;
  align-items: stretch;
  background: var(--bg);
  border: none;
  border-bottom: 1px solid var(--border);
  border-radius: 0;
  padding: 0.75rem 0.75rem;
  margin: 0 -0.75rem;
  gap: 2rem;
  transition: background-color 0.15s ease;
  text-decoration: none;
  color: inherit;
}
.post-card:last-child { border-bottom: none; }
.post-card:hover,
.post-card:focus {
  background-color: rgba(0, 0, 0, 0.03);
  border-bottom-color: var(--accent);
  outline: none;
}
.post-card-content {
  padding: 0;
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: center;
  min-width: 0;
}
.post-card img { 
  width: 160px;
  height: 106px;
  object-fit: cover;
  display: block;
  flex-shrink: 0;
}
.post-card h2 { 
  font-size: 1.2rem; 
  font-weight: 600;
  letter-spacing: -0.01em;
  line-height: 1.3;
  margin-bottom: 0.35rem;
}
.post-meta { 
  font-size: 0.875rem;
  color: var(--text-light);
  margin-bottom: 0.4rem;
  font-weight: 500;
}
.post-excerpt { 
  font-size: 0.95rem;
  color: var(--text-light);
  line-height: 1.5;
  max-width: 72ch;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* Remove old nested-link styles that no longer apply */
.post-card a { 
  text-decoration: none;
  color: inherit;
}
.post-card a:hover {
  color: inherit;
}

/* Article (Post Page) */
article { 
  max-width: 680px;
  margin: 0 auto;
}
article h1 { 
  font-size: 2.5rem;
  font-weight: 700;
  letter-spacing: -0.03em;
  margin-bottom: 1rem;
  line-height: 1.2;
}
article .date { 
  color: var(--text-light);
  font-size: 1rem;
  font-weight: 500;
  margin-bottom: 2rem;
  display: block;
}
article img { 
  max-width: 100%;
  height: auto;
  margin: 1.5rem 0;
  border-radius: 4px;
}
article h2 { 
  font-size: 1.75rem;
  font-weight: 600;
  margin: 2.5rem 0 1rem;
  letter-spacing: -0.02em;
}
article p { 
  font-size: 1.125rem;
  line-height: 1.7;
  margin-bottom: 1.5rem;
  color: var(--text);
}
article ul, article ol { 
  margin: 1.5rem 0;
  padding-left: 1.5rem;
}
article li { 
  margin-bottom: 0.5rem;
  font-size: 1.125rem;
  line-height: 1.7;
}
article a { 
  color: var(--accent);
  text-decoration: underline;
  text-decoration-thickness: 1px;
  transition: text-decoration-thickness 0.2s;
}
article a:hover {
  text-decoration-thickness: 2px;
}
article strong {
  font-weight: 600;
}
article em {
  font-style: italic;
}

article figure {
  margin: 2rem 0;
}
article figcaption {
  font-size: 0.875rem;
  color: var(--text-light);
  text-align: center;
  margin-top: 0.75rem;
}

/* Back link */
.post-card p[style], article p[style] {
  margin-top: 2rem;
  padding-top: 1.5rem;
  border-top: 1px solid var(--border);
}

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

/* Responsive */
@media (max-width: 720px) {
  body { padding: 1rem; }
  header h1 { font-size: 1.75rem; }
  .post-card { gap: 1rem; padding: 1rem 0; margin: 0 -1rem; }
  .post-card img { width: 120px; height: 80px; }
  article h1 { font-size: 2rem; }
  article p, article li { font-size: 1rem; }
}
@media (max-width: 480px) {
  .post-card { flex-direction: column; gap: 0.75rem; }
  .post-card img { width: 100%; height: 160px; }
}
