/* ============================================
   Clean serif theme — based on old ianhoar.com
   ============================================ */

@import url('https://fonts.googleapis.com/css2?family=Lora:ital,wght@0,400;0,700;1,400;1,700&display=swap');

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

:root {
  --bg:         #ffffff;
  --text:       #212529;
  --text-light: #6c757d;
  --link:       rgb(0, 82, 154);
  --link-hover: rgb(0, 60, 120);
  --border:     rgb(223, 230, 245);
  --code-bg:    #f5f7fa;
  --max-width:  720px;
}

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

body {
  font-family: 'Lora', serif;
  font-size: 1.1rem;
  line-height: 1.8;
  background-color: var(--bg);
  color: var(--text);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

a {
  color: var(--link);
  text-decoration: none;
}

a:hover {
  color: var(--link-hover);
}

/* --- Layout --- */
.container {
  width: 100%;
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 1.5rem;
}

main {
  flex: 1;
  padding-top: 2rem;
}

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

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

.site-title {
  font-style: italic;
  font-size: 1.7rem;
  font-weight: 700;
  text-decoration: none;
  color: var(--text);
}

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

/* --- Navigation --- */
.site-nav ul {
  list-style: none;
  display: flex;
  gap: 1.25rem;
}

.site-nav a {
  font-weight: bold;
  color: var(--text);
  text-decoration: none;
  padding: 0.2rem 0;
}

.site-nav a:hover,
.site-nav a.active {
  color: var(--link);
}

/* --- Prose / Content --- */
.content h1, .content h2, .content h3,
.content h4, .content h5, .content h6 {
  color: var(--text);
  margin-top: 2rem;
  margin-bottom: 0.75rem;
  line-height: 1.3;
}

.content h1 { font-size: 2rem; }
.content h2 { font-size: 1.5rem; }
.content h3 { font-size: 1.25rem; }

.content p {
  margin-bottom: 1.8rem;
}

.content a {
  color: var(--link);
  text-decoration: none;
}

.content a:hover {
  color: var(--link-hover);
  text-decoration: underline;
}

.content blockquote {
  border-left: 3px solid var(--border);
  padding: 0.5rem 1rem;
  margin: 1.5rem 0;
  color: var(--text-light);
  font-style: italic;
}

.content code {
  font-family: "Courier New", Courier, monospace;
  font-size: 0.85em;
  background: var(--code-bg);
  padding: 0.15em 0.4em;
  border-radius: 2px;
}

.content pre {
  background: var(--code-bg);
  border: 1px solid var(--border);
  padding: 1rem;
  overflow-x: auto;
  margin: 1.5rem 0;
  line-height: 1.5;
}

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

.content ul, .content ol {
  margin: 1rem 0 1.8rem 1.5rem;
}

.content li {
  margin-bottom: 0.3rem;
}

.content img {
  max-width: 100%;
  height: auto;
  margin: 1.5rem 0;
}

.content hr {
  border: none;
  border-top: 1px solid var(--border);
  margin: 2rem 0;
}

.content table {
  width: 100%;
  border-collapse: collapse;
  margin: 1.5rem 0;
  font-size: 0.9rem;
}

.content th, .content td {
  border: 1px solid var(--border);
  padding: 0.5rem 0.75rem;
  text-align: left;
}

.content th {
  background: var(--code-bg);
  font-size: 0.9rem;
  font-weight: 700;
}

/* --- Post list / Index --- */
.post-list {
  list-style: none;
  padding: 0;
}

.post-item {
  padding: 1rem 0;
  border-bottom: 1px solid var(--border);
}

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

.post-date {
  font-size: 0.8rem;
  color: var(--text-light);
  display: block;
  margin-bottom: 0.2rem;
}

.post-title {
  font-size: 1.1rem;
  font-weight: 700;
}

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

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

.post-summary {
  font-size: 0.95rem;
  color: var(--text-light);
  margin-top: 0.35rem;
  line-height: 1.6;
}

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

.post-header h1 {
  font-size: 2rem;
  margin-bottom: 0.5rem;
  line-height: 1.3;
}

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

.post-meta .separator {
  margin: 0 0.5rem;
  color: var(--border);
}

.post-tags {
  margin-top: 2rem;
  padding-top: 1rem;
  border-top: 1px solid var(--border);
}

.post-tags a {
  font-size: 0.8rem;
  color: var(--text-light);
  text-decoration: none;
  border: 1px solid var(--border);
  padding: 0.15rem 0.5rem;
  margin-right: 0.4rem;
  transition: all 0.2s ease;
}

.post-tags a:hover {
  background: var(--link);
  color: var(--bg);
  border-color: var(--link);
}

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

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

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

/* --- Pagination --- */
.pagination {
  display: flex;
  justify-content: space-between;
  padding: 2rem 0 1rem;
  font-size: 0.9rem;
}

.pagination a {
  color: var(--link);
  text-decoration: none;
}

.pagination a:hover {
  text-decoration: underline;
}

/* --- 404 --- */
.page-404 {
  text-align: center;
  padding: 4rem 0;
}

.page-404 h1 {
  font-size: 3rem;
  color: var(--text-light);
}

.page-404 p {
  color: var(--text-light);
  margin-top: 1rem;
}

/* --- Responsive --- */
@media (max-width: 600px) {
  html { font-size: 16px; }
  .site-title { font-size: 1.4rem; }
  .container { padding: 0 1rem; }
  .site-nav ul { gap: 1rem; }
}
