/* Flexoki Color Scheme by Steph Ango */
/* https://stephango.com/flexoki */

:root {
  /* Light mode (default) */
  --bg: #FFFCF0;
  --bg-secondary: #F2F0E5;
  --text: #100F0F;
  --text-muted: #6F6E69;
  --text-faint: #B7B5AC;
  --link: #205EA6;
  --link-hover: #24837B;
  --accent: #24837B;
}

html.theme-dark,
.theme-dark {
  /* Dark mode */
  --bg: #1C1B1A;
  --bg-secondary: #282726;
  --text: #CECDC3;
  --text-muted: #878580;
  --text-faint: #575653;
  --link: #4385BE;
  --link-hover: #3AA99F;
  --accent: #3AA99F;
}

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

body {
  background-color: var(--bg);
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, "Inter", "IBM Plex Sans", Segoe UI, Helvetica, Arial, sans-serif;
  font-size: 18px;
  font-weight: normal;
  line-height: 1.6;
}

/* Layout */
header {
  max-width: 60ch;
  margin: 0 auto;
  padding: 2rem 1rem 0;
}

nav {
  margin-bottom: 3rem;
}

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

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

main {
  width: 100%;
  max-width: 60ch;
  margin: 0 auto;
  padding: 0 1rem;
  min-height: calc(100vh - 200px);
}

/* Gallery pages - wider layout */
body:has(.gallery-container) header,
body:has(.gallery-container) main {
  max-width: 1400px;
}

footer {
  max-width: 60ch;
  margin: 0 auto;
  padding: 3rem 1rem 2rem;
  text-align: left;
}

footer a {
  color: var(--text-muted);
  font-size: 0.9rem;
}

/* Typography */
h1, h2, h3 {
  font-weight: 500;
  letter-spacing: -0.015em;
}

h1 {
  font-size: 2rem;
  line-height: 1.2;
  margin-bottom: 0.5rem;
}

h2 {
  font-size: 1.5rem;
  line-height: 1.3;
  margin-top: 6rem;
  margin-bottom: 0.5rem;
}

h3 {
  font-size: 1.25rem;
  line-height: 1.4;
  margin-top: 5rem;
  margin-bottom: 0.5rem;
}

p {
  margin-bottom: 1.5rem;
}

p + ul,
p + ol {
  margin-top: -0.75rem;
}

a {
  color: var(--text);
  text-decoration: underline;
  text-decoration-color: var(--text);
  text-underline-offset: 0.2em;
}

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

/* Lists */
ul, ol {
  margin-bottom: 1.5rem;
  padding-left: 2rem;
}

li {
  margin-bottom: 0.25rem;
}

/* Post Layout */
.post-header {
  margin-bottom: 2rem;
  padding: 0;
  max-width: 60ch;
  margin-left: auto;
  margin-right: auto;
}

.post-header h1 {
  margin-top: 0;
  padding: 0;
}

.post-meta {
  color: var(--text-muted);
  font-size: 0.9rem;
  margin-bottom: 1rem;
}

.post-cover {
  margin-bottom: 2rem;
}

.post-cover img {
  width: 100%;
  height: auto;
  display: block;
  border-radius: 6px;
}

.post-content {
  line-height: 1.7;
  max-width: 60ch;
  margin: 0 auto;
  padding: 0;
}

.post-content h2 {
  margin-top: 3rem;
}

.post-content h3 {
  margin-top: 2.5rem;
}

.post-content h1:first-child,
.post-content h2:first-child,
.post-content h3:first-child {
  margin-top: 0;
}

/* Homepage List */
.note-list {
  list-style: disc;
  padding-left: 1.5rem;
  margin: 0;
}

.note-item {
  margin-bottom: 0.5rem;
}

.note-date {
  color: var(--text-muted);
  font-size: 1rem;
  white-space: nowrap;
  flex-shrink: 0;
  min-width: 6rem;
}

.note-title {
  font-size: 1.125rem;
  font-weight: 500;
  letter-spacing: -0.015em;
  margin: 0;
}

.note-title a {
  color: var(--text);
  text-decoration: underline;
  text-decoration-color: var(--text);
  text-underline-offset: 0.2em;
}

.note-title a:hover {
  color: var(--link);
  text-decoration-color: var(--link);
}

/* Code blocks */
code {
  background-color: var(--bg-secondary);
  padding: 0.2rem 0.4rem;
  border-radius: 3px;
  font-family: "SF Mono", Monaco, "Cascadia Code", "Roboto Mono", Consolas, "Courier New", monospace;
  font-size: 0.9em;
}

pre {
  background-color: var(--bg-secondary);
  padding: 1rem;
  border-radius: 6px;
  overflow-x: auto;
  margin-bottom: 1rem;
}

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

/* Blockquotes */
blockquote {
  padding-left: 1rem;
  margin: 1rem 0;
  color: var(--text-muted);
  font-style: italic;
}

/* Horizontal Rule */
hr {
  border: none;
  border-top: 1px solid var(--text-faint);
  margin: 3rem 0;
}

/* Images */
img {
  max-width: 100%;
  height: auto;
  border-radius: 6px;
  margin: 1rem 0;
}

/* Figure with caption */
figure {
  margin: 2rem 0;
}

figure img {
  margin: 0;
}

figcaption {
  font-size: 0.9rem;
  color: var(--text-muted);
  opacity: 0.8;
  margin-top: 0.3rem;
  line-height: 1.4;
}

/* Back link */
.back-link-wrapper {
  margin-bottom: 1.5rem;
}

.back-link-wrapper a {
  color: var(--text-muted);
  text-decoration: none;
  font-size: 0.85rem;
  opacity: 0.8;
}

.back-link-wrapper a:hover {
  color: var(--link);
  opacity: 1;
}

/* Homepage sections */
.home {
  display: grid;
  gap: 3rem;
}

.categories-section h2,
.articles-section h2 {
  font-size: 1.125rem;
  margin-top: 0;
  margin-bottom: 1.5rem;
}

.category-list {
  list-style: disc;
  padding-left: 1.5rem;
  margin: 0;
}

.category-item {
  margin-bottom: 0.5rem;
}

.category-item a {
  color: var(--text);
  text-decoration: underline;
  text-decoration-color: var(--text);
  text-underline-offset: 0.2em;
}

.category-item a:hover {
  color: var(--link);
  text-decoration-color: var(--link);
}
