/* ==========================================================================
   oskuro-modern — clean minimal theme
   System light/dark via prefers-color-scheme
   ========================================================================== */

/* --------------------------------------------------------------------------
   Tokens
   -------------------------------------------------------------------------- */
:root {
  --bg:           #ffffff;
  --bg-secondary: #f7f7f5;
  --border:       #e5e5e2;
  --border-light: #efefec;
  --text:         #1a1a1a;
  --text-muted:   #6b6b6b;
  --text-faint:   #9a9a9a;
  --accent:       #2563eb;
  --accent-hover: #1d4ed8;
  --tag-bg:       #f0f0ed;
  --tag-text:     #444442;
  --mono:         "SFMono-Regular", "Consolas", "Liberation Mono", monospace;
  --sans:         -apple-system, BlinkMacSystemFont, "Segoe UI", system-ui, sans-serif;
  --serif:        Georgia, "Times New Roman", serif;
  --radius:       6px;
  --max-width:    960px;
  --content-width: 640px;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg:           #141414;
    --bg-secondary: #1c1c1c;
    --border:       #2a2a2a;
    --border-light: #222222;
    --text:         #e8e8e6;
    --text-muted:   #8a8a88;
    --text-faint:   #555552;
    --accent:       #60a5fa;
    --accent-hover: #93c5fd;
    --tag-bg:       #222220;
    --tag-text:     #a0a09e;
  }
}

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

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

body {
  font-family: var(--sans);
  font-size: 0.9375rem;
  line-height: 1.65;
  color: var(--text);
  background: var(--bg);
}

a { color: var(--accent); text-decoration: none; }
a:hover { color: var(--accent-hover); text-decoration: underline; }

img { max-width: 100%; height: auto; display: block; }

/* --------------------------------------------------------------------------
   Header
   -------------------------------------------------------------------------- */
.site-header {
  border-bottom: 1px solid var(--border);
  background: var(--bg);
  position: sticky;
  top: 0;
  z-index: 10;
}

.header-inner {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 1.5rem;
  height: 52px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.site-title {
  font-size: 0.9375rem;
  font-weight: 600;
  color: var(--text);
  text-decoration: none;
  letter-spacing: -0.01em;
}

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

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

.header-nav a {
  font-size: 0.8125rem;
  color: var(--text-muted);
  text-decoration: none;
  transition: color 0.15s;
}

.header-nav a:hover { color: var(--text); text-decoration: none; }

.lang-switch {
  font-family: var(--mono);
  font-size: 0.75rem !important;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  padding: 2px 7px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  color: var(--text-muted) !important;
}

.lang-switch:hover {
  border-color: var(--accent);
  color: var(--accent) !important;
}

/* --------------------------------------------------------------------------
   Page layout
   -------------------------------------------------------------------------- */
.page-wrap {
  max-width: var(--max-width);
  margin: 2rem auto;
  padding: 0 1.5rem;
  display: grid;
  grid-template-columns: 1fr 220px;
  gap: 3rem;
  align-items: start;
}

/* --------------------------------------------------------------------------
   Post cards (list pages)
   -------------------------------------------------------------------------- */
.post-card {
  padding: 1.25rem 0;
  border-bottom: 1px solid var(--border-light);
}

.post-card:first-child { padding-top: 0; }

.post-card-meta {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin-bottom: 0.3rem;
}

.post-card-meta time {
  font-family: var(--mono);
  font-size: 0.75rem;
  color: var(--text-faint);
  letter-spacing: 0.02em;
}

.post-card-title {
  font-size: 1rem;
  font-weight: 600;
  line-height: 1.3;
  margin-bottom: 0.35rem;
  letter-spacing: -0.01em;
}

.post-card-title a {
  color: var(--text);
  text-decoration: none;
}

.post-card-title a:hover { color: var(--accent); text-decoration: none; }

.post-card-excerpt {
  font-size: 0.875rem;
  color: var(--text-muted);
  line-height: 1.55;
  margin-bottom: 0.5rem;
}

.post-card-tags { display: flex; flex-wrap: wrap; gap: 0.375rem; }

/* --------------------------------------------------------------------------
   Tags
   -------------------------------------------------------------------------- */
.post-tag {
  font-size: 0.7rem;
  font-family: var(--mono);
  color: var(--tag-text);
  background: var(--tag-bg);
  padding: 2px 7px;
  border-radius: var(--radius);
  text-decoration: none;
  letter-spacing: 0.02em;
}

.post-tag:hover {
  color: var(--accent);
  background: var(--tag-bg);
  text-decoration: none;
}

/* --------------------------------------------------------------------------
   Single post
   -------------------------------------------------------------------------- */
.post { max-width: var(--content-width); }

.post-header { margin-bottom: 2rem; padding-bottom: 1.25rem; border-bottom: 1px solid var(--border); }

.post-title {
  font-size: 1.5rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  line-height: 1.25;
  margin-bottom: 0.75rem;
}

.post-meta {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.post-meta time {
  font-family: var(--mono);
  font-size: 0.8rem;
  color: var(--text-faint);
}

.post-content {
  font-size: 0.9375rem;
  line-height: 1.75;
}

.post-content p { margin: 1em 0; }
.post-content p:first-child { margin-top: 0; }

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

.post-content h2, .post-content h3, .post-content h4 {
  font-weight: 600;
  letter-spacing: -0.01em;
  margin: 1.75em 0 0.5em;
  line-height: 1.3;
}

.post-content h2 { font-size: 1.2rem; }
.post-content h3 { font-size: 1rem; }

.post-content blockquote {
  border-left: 3px solid var(--border);
  padding-left: 1rem;
  margin: 1.25em 0;
  color: var(--text-muted);
  font-style: italic;
}

.post-content pre {
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1rem;
  overflow-x: auto;
  font-family: var(--mono);
  font-size: 0.8125rem;
  line-height: 1.55;
  margin: 1.25em 0;
}

.post-content code {
  font-family: var(--mono);
  font-size: 0.8125rem;
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  border-radius: 3px;
  padding: 1px 5px;
}

.post-content pre code {
  background: none;
  border: none;
  padding: 0;
  font-size: inherit;
}

.post-content ul, .post-content ol {
  margin: 0.75em 0 0.75em 1.5em;
}

.post-content li { margin: 0.25em 0; }

.post-content img {
  border-radius: var(--radius);
  margin: 1.5em 0;
}

/* --------------------------------------------------------------------------
   List heading (tag pages, archive)
   -------------------------------------------------------------------------- */
.list-heading {
  font-size: 1.125rem;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 1.5rem;
  padding-bottom: 0.75rem;
  border-bottom: 1px solid var(--border);
  letter-spacing: -0.01em;
}

/* --------------------------------------------------------------------------
   Archive page
   -------------------------------------------------------------------------- */
.archive-year { margin-bottom: 2rem; }

.archive-year-title {
  font-size: 0.875rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-muted);
  margin-bottom: 0.75rem;
  padding-bottom: 0.4rem;
  border-bottom: 1px solid var(--border-light);
}

.archive-year-title .tag-count { font-weight: 400; }

.archive-entry {
  display: flex;
  align-items: baseline;
  gap: 1rem;
  padding: 0.2rem 0;
  font-size: 0.875rem;
}

.archive-date {
  font-family: var(--mono);
  font-size: 0.75rem;
  color: var(--text-faint);
  flex-shrink: 0;
  width: 4.5rem;
}

/* --------------------------------------------------------------------------
   Sidebar
   -------------------------------------------------------------------------- */
.page-sidebar { font-size: 0.8125rem; }

.sidebar-section {
  margin-bottom: 1.75rem;
}

.sidebar-title {
  font-size: 0.6875rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-faint);
  margin-bottom: 0.6rem;
}

.sidebar-avatar {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  margin-bottom: 0.5rem;
  border: 1px solid var(--border);
}

.sidebar-about { color: var(--text-muted); }
.sidebar-about a { color: var(--text-muted); }
.sidebar-about a:hover { color: var(--accent); }

.sidebar-tags { line-height: 1.7; }

.sidebar-tag {
  font-size: 0.75rem;
  font-family: var(--mono);
  color: var(--text-muted);
  text-decoration: none;
}

.sidebar-tag:hover { color: var(--accent); text-decoration: none; }

.tag-count {
  font-size: 0.7rem;
  color: var(--text-faint);
  font-family: var(--mono);
}

.sidebar-archives { line-height: 1.7; }
.sidebar-archives a { color: var(--text-muted); font-family: var(--mono); font-size: 0.75rem; }
.sidebar-archives a:hover { color: var(--accent); text-decoration: none; }

.sidebar-links { list-style: none; line-height: 1.8; }
.sidebar-links a { color: var(--text-muted); }
.sidebar-links a:hover { color: var(--accent); }

/* --------------------------------------------------------------------------
   Pagination
   -------------------------------------------------------------------------- */
.pagination {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1.5rem 0 0;
  font-size: 0.875rem;
}

.pagination-link { color: var(--text-muted); }
.pagination-link:hover { color: var(--accent); }
.pagination-info { color: var(--text-faint); font-family: var(--mono); font-size: 0.75rem; }

/* --------------------------------------------------------------------------
   Footer
   -------------------------------------------------------------------------- */
.site-footer {
  max-width: var(--max-width);
  margin: 1rem auto 2rem;
  padding: 1.25rem 1.5rem 0;
  border-top: 1px solid var(--border);
  font-size: 0.8rem;
  color: var(--text-faint);
}

.site-footer a { color: var(--text-faint); }
.site-footer a:hover { color: var(--accent); }

/* --------------------------------------------------------------------------
   Responsive
   -------------------------------------------------------------------------- */
@media (max-width: 720px) {
  .page-wrap {
    grid-template-columns: 1fr;
    gap: 2rem;
    margin: 1rem auto;
  }

  .page-sidebar { order: -1; }

  .header-nav { gap: 0.75rem; }
}

/* --------------------------------------------------------------------------
   Pagefind search
   -------------------------------------------------------------------------- */
.search-wrap { margin-bottom: 0.25rem; }

.pagefind-ui__search-input {
  width: 100%;
  font-size: 0.8125rem;
  font-family: var(--sans);
  padding: 5px 8px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--bg);
  color: var(--text);
  outline: none;
}

.pagefind-ui__search-input:focus {
  border-color: var(--accent);
}

.pagefind-ui__search-clear {
  background: none;
  border: none;
  color: var(--text-faint);
  cursor: pointer;
  font-size: 0.75rem;
  padding: 0 4px;
}

.pagefind-ui__results-area {
  margin-top: 0.5rem;
}

.pagefind-ui__result {
  padding: 0.5rem 0;
  border-bottom: 0.5px solid var(--border-light);
  font-size: 0.8rem;
}

.pagefind-ui__result-title {
  font-size: 0.8125rem;
  font-weight: 600;
  color: var(--text);
}

.pagefind-ui__result-title a {
  color: var(--text);
  text-decoration: none;
}

.pagefind-ui__result-title a:hover { color: var(--accent); }

.pagefind-ui__result-excerpt {
  font-size: 0.75rem;
  color: var(--text-muted);
  margin-top: 2px;
  line-height: 1.45;
}

mark {
  background: #fef08a;
  color: inherit;
  border-radius: 2px;
  padding: 0 1px;
}

@media (prefers-color-scheme: dark) {
  mark { background: #713f12; }
}

/* --------------------------------------------------------------------------
   Isso comments
   -------------------------------------------------------------------------- */
.comments {
  max-width: var(--content-width);
  margin-top: 3rem;
  padding-top: 1.5rem;
  border-top: 1px solid var(--border);
}

.comments-title {
  font-size: 0.9rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-faint);
  margin-bottom: 1.5rem;
}

/* Isso overrides — match the clean theme */
#isso-thread * { font-family: var(--sans) !important; }

#isso-thread .isso-comment {
  border-top: 0.5px solid var(--border-light);
  padding: 1rem 0;
}

#isso-thread .isso-comment-header .author {
  font-size: 0.8125rem;
  font-weight: 600;
  color: var(--text);
}

#isso-thread .isso-comment-header .spacer { color: var(--text-faint); }

#isso-thread .isso-comment-header .date {
  font-family: var(--mono);
  font-size: 0.75rem;
  color: var(--text-faint);
}

#isso-thread .text-wrapper .text {
  font-size: 0.875rem;
  color: var(--text);
  line-height: 1.65;
}

#isso-thread .text-wrapper .text p { margin: 0.5em 0; }
#isso-thread .text-wrapper .text p:first-child { margin-top: 0; }

#isso-thread input,
#isso-thread textarea {
  font-family: var(--sans);
  font-size: 0.875rem;
  background: var(--bg);
  color: var(--text);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 6px 8px;
}

#isso-thread input:focus,
#isso-thread textarea:focus {
  border-color: var(--accent);
  outline: none;
}

#isso-thread .post-action input[type=submit] {
  background: var(--accent);
  color: white;
  border: none;
  border-radius: var(--radius);
  padding: 6px 16px;
  font-size: 0.8125rem;
  cursor: pointer;
}

#isso-thread .post-action input[type=submit]:hover {
  background: var(--accent-hover);
}

#isso-thread .isso-feedlink,
#isso-thread .isso-comment-footer { font-size: 0.75rem; color: var(--text-faint); }
