/* Reset and base styles */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
  background-color: #dbeafe; /* blue-100 */
  color: #172033;
  min-height: 100vh;
  display: flex;
  justify-content: center;
  align-items: center;
  padding: 1.5rem;
  line-height: 1.6;
}

/* Main container - the "letter" */
.container {
  background: white;
  max-width: 42rem;
  width: 100%;
  padding: 3rem;
  box-shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.1);
  min-height: 600px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

.home-card {
  aspect-ratio: 8.5 / 11;
  min-height: auto;
  padding: 4rem;
}

/* Typography */
h1 {
  font-size: 2.25rem;
  margin-bottom: 1.5rem;
  font-weight: 400;
}

h2 {
  font-size: 1.5rem;
  margin-top: 2rem;
  margin-bottom: 1rem;
  font-weight: 500;
}

h3 {
  font-size: 1.25rem;
  margin-top: 1.5rem;
  margin-bottom: 0.75rem;
  font-weight: 500;
}

p {
  margin: 1rem 0;
}

a {
  color: #1f5f8b;
  text-decoration: none;
}

a:hover {
  text-decoration: underline;
}

/* Header with navigation */
.header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1.5rem;
}

.post-header {
  align-items: start;
  display: grid;
  grid-template-columns: 1fr auto;
  row-gap: 0.75rem;
}

.post-header h1 {
  grid-column: 1 / -1;
  grid-row: 2;
  margin-bottom: 0;
}

.post-header .nav {
  grid-column: 2;
  grid-row: 1;
  justify-self: end;
}

.nav {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.nav a {
  font-weight: 600;
  color: #172033;
}

.nav .rss-link {
  border-bottom: 1px dotted currentColor;
  color: inherit;
  position: relative;
}

.nav .rss-link::after {
  content: "↗";
  font-size: 0.75em;
  margin-left: 0.25rem;
  position: relative;
  top: -0.08em;
}

.nav .rss-link:hover {
  text-decoration: none;
}

.nav .rss-link:hover::before,
.nav .rss-link:focus::before {
  background: rgba(23, 32, 51, 0.92);
  border-radius: 4px;
  color: #fff;
  content: attr(data-tooltip);
  font-size: 0.75rem;
  font-weight: 500;
  line-height: 1.4;
  padding: 0.35rem 0.5rem;
  position: absolute;
  right: 0;
  top: calc(100% + 0.45rem);
  width: 13rem;
  z-index: 10;
}

/* Footer / contact links */
.footer {
  margin-top: 2rem;
  padding-top: 1.5rem;
  border-top: 1px solid #d7e0ea;
}

.footer-links {
  margin-top: 1rem;
}

.footer-links a {
  margin-right: 0.5rem;
}

/* Blog list */
.post-list {
  list-style: none;
  margin: 0.5rem 0 2rem;
}

.post-item {
  margin: 1.5rem 0;
  padding-bottom: 1.5rem;
  border-bottom: 1px solid #d7e0ea;
}

.post-item:first-child {
  margin-top: 0;
}

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

.post-title {
  font-size: 1.5rem;
  margin-top: 0;
  margin-bottom: 0.5rem;
}

.post-meta {
  color: #66758a;
  font-size: 0.875rem;
  margin-bottom: 0.5rem;
}

.post-description {
  color: #3b485c;
}

/* Blog post content */
.post-content {
  margin: 2rem 0;
}

.post-content h1,
.post-content h2,
.post-content h3,
.post-content h4 {
  margin-top: 2rem;
  margin-bottom: 1rem;
}

.post-content p {
  margin: 1rem 0;
}

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

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

.post-content code {
  background: #f3f4f6;
  padding: 0.125rem 0.25rem;
  border-radius: 0.25rem;
  font-size: 0.875rem;
}

.post-content pre {
  background: #1f2937;
  color: #f9fafb;
  padding: 1rem;
  border-radius: 0.5rem;
  overflow-x: auto;
  margin: 1rem 0;
}

.post-content pre code {
  background: transparent;
  padding: 0;
}

.post-content blockquote {
  border-left: 4px solid #cfdbea;
  padding-left: 1rem;
  margin: 1rem 0;
  color: #526176;
  font-style: italic;
}

/* Responsive adjustments */
@media (max-width: 768px) {
  body {
    padding: 1rem;
    align-items: flex-start;
  }

  .container {
    padding: 1.5rem;
    min-height: auto;
  }

  .home-card {
    aspect-ratio: auto;
  }

  h1 {
    font-size: 1.875rem;
  }

  .header {
    flex-direction: column;
    align-items: flex-start;
    gap: 1rem;
  }

  .post-header {
    display: flex;
  }
}
