/* ── Flexoki — https://stephango.com/flexoki ── */
/* Base: paper #FFFCF0 · black #100F0F                          */
/* Accent: red-400 #D14D41 (light) · yellow-400 #D0A215 (dark) */

:root {
  /* Flexoki light */
  --bg:       #FFFCF0;  /* flexoki paper */
  --text:     #100F0F;  /* flexoki black */
  --muted:    #575653;  /* flexoki base-700 */
  --subtle:   #6F6E69;  /* flexoki base-600 */
  --border:   #CECDC3;  /* flexoki base-200 */
  --link:     #D14D41;  /* flexoki red-400 — contraste 4.5:1 sobre paper */
  --accent:   #D14D41;  /* flexoki red-400 */
  --code-bg:  #E6E4D9;  /* flexoki base-100 */
  --max-w:    660px;
}

/* ── Flexoki dark ── */
[data-theme="dark"] {
  --bg:       #100F0F;  /* flexoki black */
  --text:     #FFFCF0;  /* flexoki paper */
  --muted:    #B7B5AC;  /* flexoki base-300 */
  --subtle:   #9F9D96;  /* flexoki base-400 */
  --border:   #403E3C;  /* flexoki base-800 */
  --link:     #D0A215;  /* flexoki yellow-400 */
  --accent:   #D0A215;  /* flexoki yellow-400 */
  --code-bg:  #282726;  /* flexoki base-900 */
}

/* ── Theme toggle button ── */
#theme-toggle {
  background: none;
  border: none;
  cursor: pointer;
  padding: 0;
  color: var(--subtle);
  display: flex;
  align-items: center;
  line-height: 1;
  transition: color 0.15s ease;
}

#theme-toggle:hover { color: var(--link); }
#theme-toggle svg { display: block; }

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

html { font-size: 16px; }

body {
  font-family: 'Manrope', -apple-system, BlinkMacSystemFont, sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.75;
  -webkit-font-smoothing: antialiased;
}

/* ── Header / Nav ── */
header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  max-width: var(--max-w);
  margin: 0 auto;
  padding: 1.75rem 1.5rem;
}

.site-title {
  font-family: 'Manrope', sans-serif;
  font-weight: 500;
  font-size: 1.15rem;
  color: var(--text);
  text-decoration: none;
  transition: color 0.15s ease;
}

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

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

nav a {
  font-size: 1rem;
  font-weight: 500;
  color: var(--subtle);
  text-decoration: none;
  transition: color 0.15s ease;
}

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

/* ── Main content ── */
main {
  max-width: var(--max-w);
  margin: 2.5rem auto 0;
  padding: 0 1.5rem;
}

/* ── Typography ── */
h1 {
  font-family: 'Manrope', sans-serif;
  font-size: 1.5rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  line-height: 1.25;
  margin-bottom: 1.5rem;
}

h2 {
  font-family: 'Manrope', sans-serif;
  font-size: 1.15rem;
  font-weight: 700;
  letter-spacing: -0.01em;
  margin: 2rem 0 0.75rem;
}

h3 {
  font-family: 'Manrope', sans-serif;
  font-size: 1rem;
  font-weight: 600;
  margin: 1.5rem 0 0.5rem;
}

p { margin-bottom: 1.1rem; }

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

ul, ol { padding-left: 1.4rem; margin-bottom: 1.1rem; }
li { margin-bottom: 0.3rem; }

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

blockquote {
  font-family: 'Manrope', sans-serif;
  font-style: italic;
  font-size: 1.05rem;
  border-left: 2px solid var(--accent);
  padding-left: 1rem;
  color: var(--muted);
  margin: 1.5rem 0;
  line-height: 1.6;
}

code {
  font-family: 'IBM Plex Mono', monospace;
  font-size: 0.875em;
  background: var(--code-bg);
  padding: 0.15em 0.35em;
  border-radius: 3px;
}

pre {
  background: var(--code-bg);
  padding: 1rem;
  border-radius: 4px;
  overflow-x: auto;
  margin-bottom: 1.1rem;
}

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

/* ── Post list (index) ── */
.post-list { list-style: none; padding: 0; }

.post-list li {
  display: flex;
  justify-content: flex-start;
  align-items: baseline;
  gap: 0.75rem;
  padding: 0.2rem 0;
}

.post-list a {
  color: var(--text);
  font-size: 0.95rem;
  text-decoration: underline;
  text-decoration-color: var(--border);
  text-underline-offset: 3px;
}

.post-list a:hover { color: var(--link); text-decoration-color: var(--link); }

.post-date {
  font-size: 0.85rem;
  color: var(--subtle);
  white-space: nowrap;
  flex-shrink: 0;
  min-width: 5.5rem;
}

/* ── Article ── */
article time {
  display: block;
  font-size: 0.875rem;
  color: var(--muted);
  margin-bottom: 2rem;
}

/* ── Tag cloud ── */
.tag-cloud {
  line-height: 2;
  color: var(--muted);
}

.tag-cloud a {
  color: var(--text);
  font-size: 0.95rem;
  text-decoration: underline;
  text-decoration-color: var(--border);
  text-underline-offset: 3px;
}

.tag-cloud a:hover {
  color: var(--link);
  text-decoration-color: var(--link);
}

.tag-title {
  font-size: 1rem;
  font-weight: 500;
  color: var(--muted);
  margin-bottom: 1.5rem;
}

/* ── Related posts ── */
.related-posts {
  margin-top: 3rem;
  padding-top: 2rem;
  border-top: 1px solid var(--border);
}

.related-posts h2 {
  font-size: 0.9rem;
  font-weight: 500;
  color: var(--muted);
  margin-bottom: 0.75rem;
}

.related-posts ul {
  list-style: disc;
  padding-left: 1.25rem;
  margin: 0;
}

.related-posts li {
  padding: 0.25rem 0;
}

.related-posts a {
  color: var(--text);
  font-size: 0.95rem;
}

.related-posts a:hover {
  color: var(--link);
  text-decoration: none;
}

/* ── Footer emblem ── */
.footer-emblem {
  max-width: var(--max-w);
  margin: 2rem auto 2.5rem;
  padding: 0 1.5rem;
}

.footer-emblem img {
  width: 48px;
  height: 48px;
  opacity: 0.5;
  transition: opacity 0.15s ease;
}

.footer-emblem a:hover img {
  opacity: 0.8;
}

/* ── Footer ── */
footer {
  max-width: var(--max-w);
  margin: 4rem auto 2rem;
  padding: 1.5rem 1.5rem 0;
  border-top: 1px solid var(--border);
  font-size: 0.85rem;
  color: var(--subtle);
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

footer a {
  color: var(--subtle);
  text-decoration: underline;
  text-underline-offset: 3px;
}
