/* Midas — light minimalist theme */

:root {
  --bg: #fafafa;
  --text: #1a1a1a;
  --muted: #666;
  --accent: #111;
  --card-bg: #fff;
  --card-border: #e0e0e0;
  --code-bg: #f5f5f5;
  --max-width-home: 640px;
  --max-width-post: 640px;
}

html {
  scrollbar-gutter: stable;
}

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

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

/* Header */
.site-header {
  max-width: var(--max-width-post);
  margin: 0 auto;
  padding: 1.5rem 1rem;
  width: 100%;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.site-name {
  font-weight: 700;
  font-size: 1.1rem;
  color: var(--accent);
  text-decoration: none;
}

.site-header nav a {
  color: var(--muted);
  text-decoration: none;
  font-size: 0.95rem;
  margin-left: 1rem;
}

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

/* Main */
main {
  flex: 1;
  width: 100%;
}

/* Footer */
.site-footer {
  max-width: var(--max-width-post);
  margin: 0 auto;
  padding: 2rem 1rem;
  text-align: center;
  color: var(--muted);
  font-size: 0.85rem;
}

.footer-links {
  margin-top: 0.5rem;
  display: flex;
  gap: 0.75rem;
  justify-content: center;
  flex-wrap: wrap;
}

.footer-links a {
  color: var(--muted);
  text-decoration: none;
}

.footer-links a:hover {
  color: var(--text);
  text-decoration: underline;
}

.footer-credit {
  margin-top: 0.5rem;
  font-size: 0.8rem;
}

.footer-credit a {
  color: var(--muted);
  text-decoration: none;
}

.footer-credit a:hover {
  color: var(--text);
}

/* Home */
.home-container {
  max-width: var(--max-width-home);
  margin: 2rem auto;
  padding: 0 1rem;
  text-align: center;
}

.home .site-header,
.home .site-footer {
  max-width: var(--max-width-home);
}

.profile-pic {
  width: 96px;
  height: 96px;
  border-radius: 50%;
  object-fit: cover;
  margin-bottom: 1rem;
}

.home-name {
  font-size: 1.5rem;
  font-weight: 700;
  margin-bottom: 0.25rem;
}

.home-bio {
  color: var(--muted);
  font-size: 0.95rem;
  margin-bottom: 1rem;
}

.socials {
  display: flex;
  justify-content: center;
  gap: 0.75rem;
  margin-bottom: 1.5rem;
}

.social-link {
  color: var(--muted);
  transition: color 0.2s;
}

.social-link:hover {
  color: var(--accent);
}

.social-link svg {
  width: 24px;
  height: 24px;
}

.cards {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  margin-bottom: 2rem;
}

.card {
  display: block;
  background: var(--card-bg);
  border: 1px solid var(--card-border);
  border-radius: 12px;
  padding: 1rem 1.25rem;
  text-decoration: none;
  color: var(--text);
  transition: box-shadow 0.2s, border-color 0.2s;
}

.card:hover {
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.06);
  border-color: #d0d0d0;
}

.card-title {
  font-weight: 500;
}

.recent-posts {
  text-align: left;
}

.home .recent-posts {
  margin-top: 1.5rem;
}

.recent-posts h2 {
  font-size: 1.1rem;
  margin-bottom: 0.5rem;
}

.recent-posts ul {
  list-style: none;
}

.recent-posts li {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  padding: 0.5rem 0;
  border-bottom: 1px solid var(--card-border);
}

.recent-posts li a {
  color: var(--text);
  text-decoration: none;
  font-weight: 500;
}

.recent-posts li a:hover {
  text-decoration: underline;
}

.post-date {
  color: var(--muted);
  font-size: 0.85rem;
  white-space: nowrap;
  margin-left: 0.5rem;
}

.all-posts-link {
  display: inline-block;
  margin-top: 0.75rem;
  color: var(--muted);
  text-decoration: none;
  font-size: 0.9rem;
}

.all-posts-link:hover {
  color: var(--text);
}

/* Post list */
.post-list-container {
  max-width: var(--max-width-post);
  margin: 2rem auto;
  padding: 0 1rem;
}

.post-list-container h1 {
  font-size: 1.5rem;
  margin-bottom: 1rem;
}

.post-list {
  list-style: none;
}

.post-item {
  padding: 1rem 0;
  border-bottom: 1px solid var(--card-border);
}

.post-link {
  font-size: 1.1rem;
  font-weight: 600;
  color: var(--text);
  text-decoration: none;
}

.post-link:hover {
  text-decoration: underline;
}

.post-item .post-date {
  display: block;
  margin: 0.25rem 0;
}

.post-description {
  color: var(--muted);
  font-size: 0.9rem;
  margin-top: 0.25rem;
}

/* Post */
.post-container {
  max-width: var(--max-width-post);
  margin: 2rem auto;
  padding: 0 1rem;
}

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

.post-header h1 {
  font-size: 1.75rem;
  line-height: 1.3;
  margin-bottom: 0.5rem;
}

.post-header .post-date {
  display: block;
  color: var(--muted);
  font-size: 0.9rem;
  margin-left: 0;
  margin-bottom: 0.5rem;
}

.post-header .post-description {
  color: var(--muted);
  font-size: 1rem;
  margin-bottom: 1rem;
}

.post-cover {
  width: 100%;
  border-radius: 8px;
  margin-top: 0.5rem;
}

.post-body {
  font-size: 1rem;
  line-height: 1.7;
}

.post-body h2,
.post-body h3,
.post-body h4 {
  margin-top: 1.5rem;
  margin-bottom: 0.75rem;
  line-height: 1.3;
}

.post-body p {
  margin-bottom: 1rem;
}

.post-body a {
  color: var(--accent);
  text-decoration: underline;
}

.post-body ul,
.post-body ol {
  margin: 0.5rem 0 1rem;
  padding-left: 1.5rem;
}

.post-body li {
  margin-bottom: 0.35rem;
}

.post-body li:last-child {
  margin-bottom: 0;
}

.post-body p + ul,
.post-body p + ol,
.post-body h2 + ul,
.post-body h2 + ol,
.post-body h3 + ul,
.post-body h3 + ol,
.post-body h4 + ul,
.post-body h4 + ol {
  margin-top: 0.25rem;
}

.post-body .task-list-item {
  list-style: none;
  margin-left: -1.5rem;
  margin-bottom: 0.35rem;
}

.post-body .task-list-item:last-child {
  margin-bottom: 0;
}

.post-body .task-list-item input[type="checkbox"] {
  margin: 0.15rem 0.5rem 0 0;
}

.post-body table {
  width: 100%;
  border-collapse: collapse;
  margin: 1rem 0;
  border: 1px solid var(--card-border);
  border-radius: 8px;
  overflow: hidden;
}

.post-body th {
  background: var(--card-bg);
  font-weight: 600;
  text-align: left;
  padding: 0.6rem 0.75rem;
  border-bottom: 2px solid var(--card-border);
}

.post-body td {
  padding: 0.6rem 0.75rem;
  border-bottom: 1px solid var(--card-border);
}

.post-body tbody tr:last-child td {
  border-bottom: none;
}

.post-body tbody tr:nth-child(even) {
  background: #f9f9f9;
}

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

.post-body blockquote {
  border-left: 3px solid var(--card-border);
  padding-left: 1rem;
  color: var(--muted);
  margin-bottom: 1rem;
}

.post-body pre {
  background: var(--code-bg);
  padding: 1rem;
  border-radius: 6px;
  overflow-x: auto;
  margin-bottom: 1rem;
  font-size: 0.9rem;
}

.post-body code {
  background: var(--code-bg);
  padding: 0.15rem 0.35rem;
  border-radius: 4px;
  font-size: 0.9em;
}

.post-body pre code {
  background: none;
  padding: 0;
}

/* Page */
.page-container {
  max-width: var(--max-width-post);
  margin: 2rem auto;
  padding: 0 1rem;
}

.page-container h1 {
  font-size: 1.75rem;
  margin-bottom: 1rem;
}

.page-body {
  font-size: 1rem;
  line-height: 1.7;
}

.page-body p {
  margin-bottom: 1rem;
}

.page-body a {
  color: var(--accent);
  text-decoration: underline;
}

/* Pygments overrides */
.highlight {
  background: var(--code-bg);
  border-radius: 6px;
}

.highlight pre {
  margin: 0;
  background: none;
}

/* Pygments (default) */
.highlight .hll { background-color: #ffffcc; }
.highlight .c { color: #999988; font-style: italic; }
.highlight .err { color: #a61717; background-color: #e3d2d2; }
.highlight .k { color: #000000; font-weight: 600; }
.highlight .o { color: #000000; font-weight: 600; }
.highlight .ch { color: #999988; font-style: italic; }
.highlight .cm { color: #999988; font-style: italic; }
.highlight .cp { color: #999999; font-weight: 600; }
.highlight .cpf { color: #999988; font-style: italic; }
.highlight .c1 { color: #999988; font-style: italic; }
.highlight .cs { color: #999999; font-weight: 600; font-style: italic; }
.highlight .gd { color: #000000; background-color: #ffdddd; }
.highlight .ge { color: #000000; font-style: italic; }
.highlight .gr { color: #aa0000; }
.highlight .gh { color: #999999; }
.highlight .gi { color: #000000; background-color: #ddffdd; }
.highlight .go { color: #888888; }
.highlight .gp { color: #555555; }
.highlight .gs { font-weight: 600; }
.highlight .gu { color: #800080; font-weight: 600; }
.highlight .gt { color: #aa0000; }
.highlight .kc { color: #000000; font-weight: 600; }
.highlight .kd { color: #000000; font-weight: 600; }
.highlight .kn { color: #000000; font-weight: 600; }
.highlight .kp { color: #000000; font-weight: 600; }
.highlight .kr { color: #000000; font-weight: 600; }
.highlight .kt { color: #445588; font-weight: 600; }
.highlight .m { color: #009999; }
.highlight .s { color: #dd1144; }
.highlight .na { color: #008080; }
.highlight .nb { color: #0086b3; }
.highlight .nc { color: #445588; font-weight: 600; }
.highlight .no { color: #008080; }
.highlight .nd { color: #3c5d5d; font-weight: 600; }
.highlight .ni { color: #800080; }
.highlight .ne { color: #990000; font-weight: 600; }
.highlight .nf { color: #990000; font-weight: 600; }
.highlight .nl { color: #990000; font-weight: 600; }
.highlight .nn { color: #555555; }
.highlight .nt { color: #000080; }
.highlight .nv { color: #008080; }
.highlight .ow { color: #000000; font-weight: 600; }
.highlight .w { color: #bbbbbb; }
.highlight .mb { color: #009999; }
.highlight .mf { color: #009999; }
.highlight .mh { color: #009999; }
.highlight .mi { color: #009999; }
.highlight .mo { color: #009999; }
.highlight .sa { color: #dd1144; }
.highlight .sb { color: #dd1144; }
.highlight .sc { color: #dd1144; }
.highlight .dl { color: #dd1144; }
.highlight .sd { color: #dd1144; }
.highlight .s2 { color: #dd1144; }
.highlight .se { color: #dd1144; }
.highlight .sh { color: #dd1144; }
.highlight .si { color: #dd1144; }
.highlight .sx { color: #dd1144; }
.highlight .sr { color: #009926; }
.highlight .s1 { color: #dd1144; }
.highlight .ss { color: #990073; }
.highlight .bp { color: #999999; }
.highlight .fm { color: #990000; font-weight: 600; }
.highlight .vc { color: #008080; }
.highlight .vg { color: #008080; }
.highlight .vi { color: #008080; }
.highlight .vm { color: #008080; }
.highlight .il { color: #009999; }
