/* Minimal Wikipedia-inspired dark theme */
* {
  box-sizing: border-box;
}

html {
  background-color: #121212;
  color: #f2f2f2;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  font-size: 16px;
  line-height: 1.65;
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0 auto;
  padding: 2.5rem 1.25rem 5rem 1.25rem;
  max-width: 680px;
  background-color: #121212;
  color: #f2f2f2;
}

/* Header (Ceiling area: no boxes, just structured text) */
header {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  padding-bottom: 0.75rem;
  margin-bottom: 2.5rem;
  border-bottom: 1px solid #2b2b2b;
}

.site-brand {
  font-size: 1.05rem;
  font-weight: 700;
  color: #ffffff;
  text-decoration: none;
  letter-spacing: 0.02em;
}

.site-brand:hover {
  text-decoration: underline;
}

nav {
  display: flex;
  gap: 1.25rem;
}

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

nav a:hover,
nav a[aria-current="page"] {
  color: #ffffff;
  text-decoration: underline;
  text-underline-offset: 4px;
}

/* Typography */
h1 {
  font-size: 1.65rem;
  font-weight: 600;
  line-height: 1.3;
  margin: 0 0 1.25rem 0;
  padding-bottom: 0.4rem;
  border-bottom: 1px solid #2b2b2b;
  color: #ffffff;
}

h2 {
  font-size: 1.25rem;
  font-weight: 600;
  line-height: 1.35;
  margin: 2rem 0 0.75rem 0;
  padding-bottom: 0.25rem;
  border-bottom: 1px solid #242424;
  color: #ffffff;
}

p {
  margin: 0 0 1.1rem 0;
  color: #eaeaea;
}

/* Explicit inline links so users clearly know they are clickable */
a.inline-link {
  color: #8ab4f8;
  text-decoration: underline;
  text-underline-offset: 3px;
}

a.inline-link:hover {
  color: #aecbfa;
}

/* Social icons row */
.social-links {
  display: flex;
  align-items: center;
  gap: 1.15rem;
  margin: 1.5rem 0 1.75rem 0;
}

.social-links a {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: rgba(255, 255, 255, 0.72);
  text-decoration: none;
}

.social-links a:hover {
  color: rgba(255, 255, 255, 1);
}

.social-links svg {
  width: 21px;
  height: 21px;
  fill: currentColor;
}

/* CV line */
.cv-row {
  margin-top: 1.25rem;
  font-size: 0.98rem;
  color: #e0e0e0;
}

/* Projects */
.project-item {
  margin-bottom: 2.25rem;
}

.project-links {
  display: flex;
  flex-wrap: wrap;
  gap: 1.25rem;
  margin-top: 0.5rem;
}

/* Blog index controls & entries */
.blog-controls {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1.75rem;
  font-size: 0.9rem;
  color: #bdbdbd;
}

.sort-buttons {
  display: flex;
  gap: 0.75rem;
}

.sort-btn {
  background: none;
  border: none;
  padding: 0;
  font: inherit;
  color: #9e9e9e;
  cursor: pointer;
  text-decoration: none;
}

.sort-btn:hover,
.sort-btn.active {
  color: #ffffff;
  text-decoration: underline;
  text-underline-offset: 3px;
}

/* Blog list: vertical stacked rows, clickable as a whole block, square cover thumbnail on the left, no boxy card borders */
.post-list {
  display: flex;
  flex-direction: column;
}

.post-row-link {
  display: flex;
  align-items: flex-start;
  gap: 1.25rem;
  padding: 1.25rem 0;
  border-bottom: 1px solid #262626;
  text-decoration: none;
  color: inherit;
}

.post-row-link:first-child {
  padding-top: 0.25rem;
}

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

.post-row-link:hover .post-row-title {
  text-decoration: underline;
  text-underline-offset: 3px;
  color: #ffffff;
}

.post-thumb {
  width: 112px;
  height: 112px;
  min-width: 112px;
  object-fit: cover;
  display: block;
  border-radius: 0;
}

.post-row-content {
  flex: 1;
  min-width: 0;
}

.post-meta {
  font-size: 0.85rem;
  color: #a8a8a8;
  margin-bottom: 0.25rem;
}

.post-row-title {
  font-size: 1.18rem;
  font-weight: 600;
  line-height: 1.35;
  margin: 0 0 0.4rem 0;
  color: #f5f5f5;
}

.post-excerpt {
  margin: 0;
  font-size: 0.94rem;
  line-height: 1.55;
  color: #cccccc;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* Single blog post */
.article-header {
  margin-bottom: 1.75rem;
}

.back-link {
  display: inline-block;
  margin-bottom: 1.5rem;
  font-size: 0.92rem;
}

/* 404 Page */
.error-code {
  font-size: 0.92rem;
  color: #a8a8a8;
  margin-bottom: 0.35rem;
}

@media (max-width: 520px) {
  body {
    padding: 1.75rem 1rem 4rem 1rem;
  }
  header {
    flex-direction: column;
    gap: 0.5rem;
  }
  .post-row-link {
    gap: 0.95rem;
  }
  .post-thumb {
    width: 88px;
    height: 88px;
    min-width: 88px;
  }
}
