/* Vasi.Ro — static archive theme */

:root {
  --paper: #fbf7f0;
  --ink: #2a2420;
  --ink-soft: #6b5f54;
  --line: #e4dccd;
  --accent: #1f5f4f;
  --accent-soft: #dfeee9;
  --card-bg: #ffffff;
  --code-bg: #22201d;
  --code-ink: #f2ede2;
  --max-width: 760px;
  color-scheme: light;
}

/* Auto dark mode, follows the visitor's system setting */
@media (prefers-color-scheme: dark) {
  :root {
    --paper: #171512;
    --ink: #ece6dc;
    --ink-soft: #a89e91;
    --line: #37332c;
    --accent: #6fd3af;
    --accent-soft: #1e2b26;
    --card-bg: #201d19;
    --code-bg: #0e0d0b;
    --code-ink: #f2ede2;
    color-scheme: dark;
  }
}

/* Manual override via the toggle button, wins over system setting */
html[data-theme="dark"] {
  --paper: #171512;
  --ink: #ece6dc;
  --ink-soft: #a89e91;
  --line: #37332c;
  --accent: #6fd3af;
  --accent-soft: #1e2b26;
  --card-bg: #201d19;
  --code-bg: #0e0d0b;
  --code-ink: #f2ede2;
  color-scheme: dark;
}
html[data-theme="light"] {
  --paper: #fbf7f0;
  --ink: #2a2420;
  --ink-soft: #6b5f54;
  --line: #e4dccd;
  --accent: #1f5f4f;
  --accent-soft: #dfeee9;
  --card-bg: #ffffff;
  --code-bg: #22201d;
  --code-ink: #f2ede2;
  color-scheme: light;
}

body { transition: background-color 0.15s ease, color 0.15s ease; }

* { box-sizing: border-box; }

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

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  line-height: 1.65;
  font-size: 17px;
}

h1, h2, h3, .brand-text, .card-title a, .post-title {
  font-family: 'Fraunces', Georgia, serif;
}

a {
  color: var(--accent);
  text-decoration: none;
}
a:hover { text-decoration: underline; }
a:focus-visible, button:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

.site-wrap {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 20px;
}

/* Header */
.site-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
  padding: 36px 0 20px;
  border-bottom: 1px solid var(--line);
}
.brand {
  display: flex;
  align-items: baseline;
  gap: 10px;
  color: var(--ink);
}
.brand:hover { text-decoration: none; }
.brand-mark {
  font-family: 'Fraunces', serif;
  font-weight: 700;
  font-size: 30px;
  color: var(--accent);
  background: var(--accent-soft);
  border-radius: 10px;
  width: 42px;
  height: 42px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  line-height: 1;
}
.brand-text {
  font-size: 22px;
  font-weight: 600;
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.brand-text small {
  font-family: 'Inter', sans-serif;
  font-size: 12.5px;
  font-weight: 500;
  color: var(--ink-soft);
  letter-spacing: 0.02em;
}
.site-nav {
  display: flex;
  gap: 22px;
  flex-wrap: wrap;
  font-size: 14.5px;
  font-weight: 500;
}
.site-nav a { color: var(--ink-soft); }
.site-nav a.active, .site-nav a:hover { color: var(--accent); }

.header-right {
  display: flex;
  align-items: center;
  gap: 20px;
  flex-wrap: wrap;
}

.theme-toggle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 34px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: var(--card-bg);
  color: var(--ink-soft);
  cursor: pointer;
  padding: 0;
  flex-shrink: 0;
}
.theme-toggle:hover { color: var(--accent); border-color: var(--accent); }
.theme-toggle .icon-moon { display: none; }
@media (prefers-color-scheme: dark) {
  html:not([data-theme="light"]) .theme-toggle .icon-sun { display: none; }
  html:not([data-theme="light"]) .theme-toggle .icon-moon { display: inline; }
}
html[data-theme="dark"] .theme-toggle .icon-sun { display: none; }
html[data-theme="dark"] .theme-toggle .icon-moon { display: inline; }
html[data-theme="light"] .theme-toggle .icon-sun { display: inline; }
html[data-theme="light"] .theme-toggle .icon-moon { display: none; }

/* Intro block */
.intro { padding: 36px 0 8px; }
.intro h1 {
  font-size: 34px;
  margin: 0 0 8px;
  line-height: 1.15;
}
.intro p {
  color: var(--ink-soft);
  margin: 0;
  font-size: 16.5px;
}

/* Cards */
.card-grid {
  display: flex;
  flex-direction: column;
  gap: 18px;
  padding: 24px 0 20px;
}
.card {
  background: var(--card-bg);
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 22px 24px;
}
.card-date {
  font-size: 12.5px;
  color: var(--ink-soft);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  margin-bottom: 8px;
}
.card-title {
  margin: 0 0 8px;
  font-size: 22px;
  line-height: 1.3;
}
.card-title a { color: var(--ink); }
.card-title a:hover { color: var(--accent); text-decoration: none; }
.card-excerpt {
  margin: 0 0 12px;
  color: var(--ink-soft);
  font-size: 15.5px;
}
.card-more {
  font-size: 14px;
  font-weight: 600;
}

/* Pager */
.pager {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 8px 0 48px;
  font-size: 14.5px;
  font-weight: 500;
  flex-wrap: wrap;
}
.pager-status {
  color: var(--ink-soft);
  order: 2;
}
.pager a:first-child { order: 1; }
.pager a:last-child { order: 3; margin-left: auto; }

/* Post */
.post { padding: 40px 0 8px; }
.post-meta {
  font-size: 13px;
  color: var(--ink-soft);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  margin-bottom: 10px;
}
.post-title {
  font-size: 34px;
  line-height: 1.2;
  margin: 0 0 28px;
}
.post-content {
  font-size: 17.5px;
}
.post-content p { margin: 0 0 20px; }
.post-content img {
  max-width: 100%;
  height: auto;
  border-radius: 8px;
  margin: 8px 0;
}
.post-content a { text-decoration: underline; }
.post-content blockquote {
  border-left: 3px solid var(--accent);
  margin: 20px 0;
  padding: 4px 0 4px 18px;
  color: var(--ink-soft);
  font-style: italic;
}
.post-content ul, .post-content ol { padding-left: 22px; margin: 0 0 20px; }
.post-content code {
  background: var(--accent-soft);
  padding: 2px 5px;
  border-radius: 4px;
  font-size: 0.9em;
}
.post-content pre {
  background: var(--code-bg);
  color: var(--code-ink);
  padding: 16px;
  border-radius: 10px;
  overflow-x: auto;
}
.post-content pre code { background: none; padding: 0; color: inherit; }
.post-content em { color: var(--ink-soft); }

.yt-embed {
  position: relative;
  width: 100%;
  padding-top: 56.25%;
  margin: 24px 0;
  border-radius: 10px;
  overflow: hidden;
  background: var(--code-bg);
}
.yt-embed iframe {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  border: 0;
}

.post-nav {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  border-top: 1px solid var(--line);
  margin-top: 32px;
  padding: 24px 0 48px;
  font-size: 14.5px;
  font-weight: 500;
}
.post-nav a { max-width: 48%; }
.post-nav-prev { text-align: right; margin-left: auto; }

.static-page .post-title { margin-bottom: 20px; }

/* Archive */
.archive-toc {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  padding: 20px 0 30px;
}
.archive-toc a {
  background: var(--card-bg);
  border: 1px solid var(--line);
  padding: 6px 14px;
  border-radius: 999px;
  font-size: 14px;
  font-weight: 600;
  color: var(--ink);
}
.archive-toc a span { color: var(--ink-soft); font-weight: 500; }
.archive-toc a:hover { border-color: var(--accent); color: var(--accent); text-decoration: none; }

.archive-year { padding-bottom: 30px; scroll-margin-top: 20px; }
.archive-year h2 {
  font-size: 22px;
  border-bottom: 1px solid var(--line);
  padding-bottom: 8px;
  margin-bottom: 12px;
}
.archive-list { list-style: none; margin: 0; padding: 0; }
.archive-list li {
  padding: 7px 0;
  border-bottom: 1px dotted var(--line);
  font-size: 15.5px;
  display: flex;
  gap: 10px;
}
.archive-date {
  color: var(--ink-soft);
  font-variant-numeric: tabular-nums;
  flex-shrink: 0;
  width: 40px;
}

/* Footer */
.site-footer {
  border-top: 1px solid var(--line);
  margin-top: 40px;
  padding: 24px 0 48px;
  font-size: 13px;
  color: var(--ink-soft);
}

@media (max-width: 600px) {
  body { font-size: 16px; }
  .intro h1 { font-size: 28px; }
  .post-title { font-size: 27px; }
  .site-header { padding-top: 24px; }
  .post-nav { flex-direction: column; }
  .post-nav a { max-width: 100%; }
  .post-nav-prev { text-align: left; margin-left: 0; }
}
