/* === CSS Custom Properties === */
:root {
  --bg: #f2f6fa;
  --text: #0b172c;
  --text-secondary: #428d90;
  --surface: #fff;
  --link: #0051ff;
  --accent: #01bda5;
  --border: #d9d9e9;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0b172c;
    --text: #ececf6;
    --text-secondary: #b5b5d4;
    --surface: #1e3c43;
    --link: #1b7efb;
    --accent: #01bda5;
    --border: #404075;
  }
}

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

body {
  background-color: var(--bg);
  color: var(--text);
  font-family: Manrope, sans-serif;
  font-size: 18px;
  font-weight: 400;
  line-height: 2;
}

/* === Layout === */
.container {
  max-width: 1000px;
  margin: 0 auto;
  padding: 0 1.5rem;
}

/* === Typography === */
h1, h2, h3, h4, h5 {
  font-family: Inter, sans-serif;
  font-weight: 600;
  line-height: 1.3;
  color: var(--text);
}

h1 { font-size: 2.25rem; margin-bottom: 0.5rem; }
h2 { font-size: 1.75rem; margin-bottom: 1rem; margin-top: 2rem; }
h3 { font-size: 1.375rem; margin-bottom: 0.75rem; margin-top: 1.5rem; }
h4 { font-size: 1.125rem; margin-bottom: 0.5rem; margin-top: 1.25rem; }

p {
  margin-bottom: 1.5rem;
}

a {
  color: var(--link);
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 2px;
  transition: color 0.2s;
}

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

strong {
  font-weight: 600;
}

blockquote {
  border-left: 4px solid var(--accent);
  background-color: var(--surface);
  padding: 1.25rem 1.5rem;
  margin: 1.5rem 0;
  border-radius: 0 4px 4px 0;
}

blockquote p:last-child {
  margin-bottom: 0;
}

code {
  font-family: ui-monospace, "Cascadia Code", "Source Code Pro", Menlo, Consolas, "DejaVu Sans Mono", monospace;
  font-size: 0.9em;
  background-color: var(--surface);
  padding: 0.15em 0.4em;
  border-radius: 3px;
}

pre {
  background-color: var(--surface);
  padding: 1.25rem;
  border-radius: 6px;
  overflow-x: auto;
  margin: 1.5rem 0;
}

pre code {
  background: none;
  padding: 0;
}

img {
  max-width: 100%;
  height: auto;
  border-radius: 6px;
}

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

/* === Header === */
.site-header {
  padding: 1.5rem 0;
  border-bottom: 1px solid var(--border);
  margin-bottom: 2rem;
}

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

.site-title {
  font-family: Inter, sans-serif;
  font-size: 1.25rem;
  font-weight: 600;
  text-decoration: none;
  color: var(--text);
}

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

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

nav a {
  text-decoration: none;
  color: var(--text-secondary);
  font-size: 0.95rem;
}

nav a:hover {
  color: var(--accent);
}

/* === Post List === */
.post-list {
  list-style: none;
}

.post-item {
  display: flex;
  gap: 1.5rem;
  align-items: flex-start;
  padding: 1.5rem 0;
  border-bottom: 1px solid var(--border);
}

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

.post-thumb {
  width: 120px;
  height: 120px;
  object-fit: cover;
  border-radius: 6px;
  flex-shrink: 0;
}

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

.post-info h2 {
  font-size: 1.25rem;
  margin: 0 0 0.25rem 0;
}

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

.post-info h2 a:hover {
  color: var(--accent);
}

.post-date {
  font-size: 0.85rem;
  color: var(--text-secondary);
  margin-bottom: 0.5rem;
}

.post-description {
  font-size: 0.95rem;
  color: var(--text-secondary);
  margin: 0;
  line-height: 1.5;
}

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

.post-hero-figure {
  margin: 0 0 2rem 0;
}

.post-hero {
  display: block;
  width: 100%;
  margin-bottom: 0;
  border-radius: 6px 6px 0 0;
}

.post-hero-figure figcaption {
  background-color: var(--surface);
  padding: 0.6rem 1rem;
  border-radius: 0 0 6px 6px;
}

.post-hero-figure figcaption .image-caption {
  display: block;
  font-family: Georgia, "Times New Roman", serif;
  font-style: italic;
  font-size: 1.05rem;
  color: var(--text-secondary);
  line-height: 1.5;
}

.post-hero-figure figcaption .image-attribution {
  display: block;
  font-size: 0.75rem;
  color: var(--text-secondary);
  margin-top: 0.35rem;
  line-height: 1.4;
}

.post-meta {
  font-size: 0.85rem;
  color: var(--text-secondary);
  margin-bottom: 0.25rem;
}

.post-content {
  max-width: 100%;
}

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

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

/* === About Page === */
.about-content {
  max-width: 680px;
}

/* === Footer === */
.site-footer {
  margin-top: 3rem;
  padding: 1.5rem 0;
  border-top: 1px solid var(--border);
  text-align: center;
}

.site-footer p {
  font-size: 0.85rem;
  color: var(--text-secondary);
  margin: 0;
}

/* === Responsive === */
@media (max-width: 600px) {
  .post-item {
    flex-direction: column;
  }

  .post-thumb {
    width: 100%;
    height: 200px;
  }

  h1 { font-size: 1.75rem; }
  h2 { font-size: 1.375rem; }
}
