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

html {
  font-size: 16px;
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  padding: 0;
  font-family: -apple-system, BlinkMacSystemFont, "Helvetica Neue", Helvetica, Arial, sans-serif;
  font-size: 1rem;
  line-height: 1.5;
  color: #111;
  background: #fff;
}

/* Layout */
header, main, footer {
  max-width: 45rem;
  margin: 0 auto;
  padding: 0 1.5rem;
}

main {
  min-height: calc(100vh - 10rem);
  padding-top: 2rem;
  padding-bottom: 4rem;
}

/* Header & Navigation */
header {
  padding-top: 2rem;
  padding-bottom: 1rem;
  border-bottom: 1px solid #eee;
}

nav {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 1rem;
}

.site-title {
  font-size: 1.25rem;
  font-weight: 700;
  color: #111;
  text-decoration: none;
}

.site-title:hover {
  color: #3364ff;
}

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

.nav-links a {
  color: #111;
  text-decoration: none;
  font-size: 0.95rem;
}

.nav-links a:hover,
.nav-links a.active {
  color: #3364ff;
  text-decoration: underline;
}

/* Footer */
footer {
  padding: 2rem 1.5rem;
  border-top: 1px solid #eee;
  text-align: center;
  color: #666;
  font-size: 0.875rem;
}

/* Typography */
h1, h2, h3, h4, h5, h6 {
  margin: 2rem 0 1rem;
  line-height: 1.3;
  font-weight: 700;
  color: #111;
}

h1 { font-size: 1.75rem; }
h2 { font-size: 1.4rem; }
h3 { font-size: 1.2rem; }
h4 { font-size: 1.1rem; }

p {
  margin: 0 0 1.5rem;
}

a {
  color: #3364ff;
  text-decoration: none;
}

a:hover {
  text-decoration: underline;
}

/* Post List */
.post-list {
  list-style: none;
  padding: 0;
  margin: 2rem 0;
  counter-reset: post-counter;
}

.post-list li {
  position: relative;
  padding-left: 2.5rem;
  margin-bottom: 1.5rem;
  counter-increment: post-counter;
}

/* .post-list li::before { */
/*   content: counter(post-counter); */
/*   position: absolute; */
/*   left: 0; */
/*   color: #3364ff; */
/*   font-size: 0.875rem; */
/*   font-weight: 500; */
/* } */

.post-list a {
  display: block;
  font-weight: 600;
  color: #111;
  font-size: 1.1rem;
  margin-bottom: 0.25rem;
}

.post-list a:hover {
  color: #3364ff;
}

.post-list time {
  display: block;
  color: #666;
  font-size: 0.8125rem;
}

/* Single Post */
.post-header {
  margin-bottom: 2.5rem;
  text-align: center;
}

.post-header h1 {
  margin-bottom: 0.5rem;
}

.post-header time {
  color: #666;
  font-size: 0.875rem;
}

.tags {
  margin-top: 0.75rem;
}

.tags a {
  display: inline-block;
  margin-right: 0.5rem;
  font-size: 0.8125rem;
  color: #666;
}

.tags a:hover {
  color: #3364ff;
}

/* Post Content */
.post-content {
  line-height: 1.5;
}

.post-content h2 {
  margin-top: 2.5rem;
}

.post-content h3 {
  margin-top: 2rem;
}

.post-content img {
  max-width: 100%;
  height: auto;
  border-radius: 6px;
  margin: 1.5rem 0;
}

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

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

/* Blockquotes - Clean, elegant style */
.post-content blockquote {
  margin: 1.5rem 0;
  padding: 1rem 1.5rem;
  border-left: 3px solid #3364ff;
  background: #f8f9fa;
  color: #444;
  font-style: italic;
}

.post-content blockquote p {
  margin: 0;
}

.post-content blockquote p + p {
  margin-top: 1rem;
}

/* Code Blocks */
.post-content code {
  font-family: "SF Mono", Menlo, Monaco, "Courier New", monospace;
  font-size: 0.875em;
  background: #f4f4f4;
  padding: 0.15rem 0.4rem;
  border-radius: 3px;
}

.post-content pre {
  position: relative;
  margin: 1.5rem 0;
  padding: 1rem 1.25rem;
  background: #1e1e1e;
  border-radius: 6px;
  overflow-x: auto;
}

.post-content pre code {
  background: none;
  padding: 0;
  color: #d4d4d4;
  font-size: 0.875rem;
  line-height: 1.5;
  white-space: pre-wrap;
  word-wrap: break-word;
}

/* Chroma highlight wrapper */
.post-content .highlight {
  position: relative;
  margin: 1.5rem 0;
}

.post-content .highlight pre {
  margin: 0;
}

/* Code block copy button */
.code-copy-btn {
  position: absolute;
  top: 0.5rem;
  right: 0.5rem;
  padding: 0.25rem 0.5rem;
  background: yellow;
  color: black;
  border: none;
  border-radius: 4px;
  font-size: 0.75rem;
  font-family: inherit;
  cursor: pointer;
  opacity: 0;
  transition: opacity 0.2s, background 0.2s;
}

.post-content pre:hover .code-copy-btn,
.post-content .highlight:hover .code-copy-btn {
  opacity: 1;
}

.code-copy-btn:hover {
  background: yellow;
  color: black;
}

.code-copy-btn.copied {
  background: cyan;
  color: black;
}

/* Tables */
.post-content table {
  width: 100%;
  margin: 1.5rem 0;
  border-collapse: collapse;
}

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

.post-content th {
  font-weight: 600;
  border-bottom: 2px solid #ddd;
}

/* Horizontal Rule */
.post-content hr {
    margin: 2.5rem 0;
    border: 0;
    height: 1px;
    background: #333;
    background-image: linear-gradient(to right, #ccc, #333, #ccc);
}

/* Post Navigation */
.post-nav {
  display: flex;
  justify-content: space-between;
  margin-top: 3rem;
  padding-top: 1.5rem;
  border-top: 1px solid #eee;
  font-size: 0.9rem;
}

.post-nav a {
  color: #666;
}

.post-nav a:hover {
  color: #3364ff;
}

.post-nav .next {
  margin-left: auto;
}

/* Home Page */
.home h1:first-child {
  margin-top: 0;
}

/* Home sections grid */
.home-sections {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 2rem;
  margin-top: 2rem;
}

.home-sections section {
  background: #f8f9fa;
  border-radius: 8px;
  padding: 1.5rem;
  border: 1px solid #eee;
}

.home-sections section h2 {
  font-size: 1.1rem;
  margin: 0 0 1rem 0;
  padding-bottom: 0.75rem;
  border-bottom: 2px solid #3364ff;
  color: #333;
}

.home-sections .post-list {
  margin: 0;
}

.home-sections .post-list li {
  padding-left: 0;
  margin-bottom: 1rem;
}

.home-sections .post-list a {
  font-size: 1rem;
}

.home-sections .view-all {
  margin: 1rem 0 0 0;
  padding-top: 0.75rem;
  border-top: 1px solid #eee;
  font-size: 0.875rem;
}

.recent-posts h2 {
  font-size: 1.25rem;
  margin-top: 3rem;
}

/* List Page */
.list-page h1 {
  margin-top: 0;
  margin-bottom: 0.5rem;
}

.comment-via-email {
  text-align: center;
}

/* pras customisations */
.main-header, .main-footer {
  background-color: #b2ffff;
}

/* Responsive */
@media (max-width: 600px) {
  html {
    font-size: 15px;
  }

  nav {
    flex-direction: column;
    align-items: flex-start;
  }

  .nav-links {
    gap: 1rem;
  }

  .post-list li {
    padding-left: 2rem;
  }

  .home-sections {
    grid-template-columns: 1fr;
    gap: 1.5rem;
  }

  .home-sections .post-list li {
    padding-left: 0;
  }
}
