/*
    Theme Name: mnmlist (pure minimal)
    Redesigned following Dieter Rams principles - 2025
*/

@import url("pygment.css");

/* Base */
body {
  background: #FFFFFF;
  color: #000;
  font-family: Helvetica, Arial, sans-serif;
  font-size: 21px;
  line-height: 1.6;
  max-width: 50em;
  margin: 0 auto;
  padding: 40px 20px;
}

.content-wrapper {
  max-width: 28em;
}

/* Expand for article pages with TOC */
.content-wrapper:has(.article-layout) {
  max-width: 46em; /* 28em article + 3em gap + 15em TOC */
}

/* Site Header */
.site-header {
  margin-bottom: 80px;
}

.site-header h1 {
  margin: 0;
  font-size: 1.2em;
  font-weight: 400;
  color: #000;
}

.site-header a {
  color: #000;
  text-decoration: none;
}

.site-header a:hover {
  text-decoration: underline;
}

.site-subtitle {
  margin: 0.3em 0 0 0;
  font-size: 0.75em;
  color: #999;
  font-weight: 400;
}

.header-nav {
  margin-top: 2em;
}

.header-nav ul {
  list-style: none;
  padding: 0;
  margin: 0;
}

.header-nav li {
  display: inline;
  margin-right: 20px;
}

.header-nav a {
  color: #999;
  text-decoration: none;
  font-size: 0.75em;
}

.header-nav a:hover {
  color: #000;
}

/* Typography */
h1 {
  font-size: 1.8em;
  font-weight: 400;
  color: #000;
  margin: 0 0 0.3em 0;
  line-height: 1.2;
}

h2 {
  font-size: 1.4em;
  font-weight: 400;
  color: #000;
  margin: 2em 0 0.5em 0;
}

h3 {
  font-size: 1.1em;
  font-weight: 400;
  color: #000;
  margin: 1.5em 0 0.5em 0;
}

h4 {
  font-size: 1em;
  font-weight: 400;
  color: #000;
}

time {
  color: #999;
  font-size: 0.75em;
  font-weight: 400;
}

/* Images */
img {
  max-width: 100%;
  height: auto;
  margin: 2em 0;
}

/* Figures */
figure {
  margin: 2em 0;
}

figure img {
  margin: 0 0 0.5em 0;
  display: block;
}

figcaption {
  font-size: 0.85em;
  color: #666;
  line-height: 1.5;
  font-style: italic;
}

/* Blockquotes */
blockquote {
  margin: 2em 0;
  padding-left: 1.5em;
  color: #666;
}

/* Paragraphs */
p {
  margin: 1em 0;
}

/* Links */
a {
  color: #000;
  text-decoration: underline;
}

a:hover {
  color: #666;
}

a:focus {
  outline: 2px solid #000;
  outline-offset: 2px;
}

/* Lists */
ul, ol {
  margin: 1em 0;
  padding-left: 2em;
}

li {
  margin: 0.5em 0;
}

/* Strong */
strong {
  font-weight: 700;
  color: #000;
}

/* Code */
code {
  background: #F5F5F5;
  padding: 2px 4px;
  font-family: Monaco, 'Courier New', monospace;
  font-size: 0.9em;
}

pre {
  background: #F5F5F5;
  padding: 1em;
  overflow: auto;
  margin: 2em 0;
  font-family: Monaco, 'Courier New', monospace;
  font-size: 0.85em;
  line-height: 1.4;
}

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

/* Article Page Header */
header {
  margin-bottom: 3em;
}

header h1 {
  margin-bottom: 0.3em;
}

header time {
  display: block;
  margin-bottom: 2em;
}

/* Homepage Article List */
.article-item {
  margin-bottom: 3em;
  position: relative;
}

.article-item-content {
  padding-left: 0;
  border-left: 2px solid transparent;
}

.article-item:hover .article-item-content,
.article-active .article-item-content {
  border-left-color: #000;
  padding-left: 1em;
  margin-left: -1em;
}

.article-item h2 {
  margin: 0 0 0.2em 0;
  font-size: 1.4em;
  font-weight: 400;
}

.article-item h2 a {
  color: #000;
  text-decoration: none;
}

.article-item h2 a:hover {
  text-decoration: underline;
}

.article-item time {
  display: block;
  margin-bottom: 0.5em;
}

.article-item-summary {
  color: #666;
  font-size: 0.95em;
  line-height: 1.5;
}

.article-item-image {
  display: none;
  position: absolute;
  left: calc(28em + 4em);
  top: 0;
  width: 380px;
  max-width: 30vw;
  border: 1px solid #000;
  background: #FFF;
  pointer-events: none;
}

/* First article shows image by default */
.article-item-first .article-item-image {
  display: block;
}

/* Active article (last hovered) shows its image */
.article-active .article-item-image {
  display: block;
}

/* Hide first article's default image when another is active */
.article-item-first:not(.article-active) .article-item-image {
  display: none;
}

.article-item-image img {
  display: block;
  width: 100%;
  height: auto;
  margin: 0;
}

/* Footer */
footer {
  margin-top: 100px;
  padding-top: 40px;
  border-top: 1px solid #E0E0E0;
}

footer ul {
  list-style: none;
  padding: 0;
  margin: 0;
}

footer li {
  display: inline;
  margin-right: 20px;
}

footer a {
  color: #999;
  text-decoration: none;
  font-size: 0.85em;
}

footer a:hover {
  color: #000;
}

/* Table of Contents Sidebar - Right Side */
.article-layout {
  position: relative;
  width: 100%;
  min-height: 100vh;
}

.article-main {
  max-width: 28em; /* Readable line length */
}

.toc-sidebar {
  position: absolute;
  left: 31em; /* 28em article + 3em gap */
  top: 0;
  width: 15em;
  height: 100%;
}

.toc-sidebar-inner {
  position: -webkit-sticky;
  position: sticky;
  top: 40px;
}

#toc-nav {
  padding-left: 1.5em;
  border-left: 1px solid #E0E0E0;
}

.toc-title {
  font-size: 0.75em;
  font-weight: 400;
  color: #999;
  margin-bottom: 0.5em;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

#toc-list {
  list-style: none;
  padding: 0;
  margin: 0;
}

#toc-list li {
  margin: 0.3em 0;
}

#toc-list li.h3 {
  padding-left: 1em;
}

#toc-list a {
  color: #999;
  text-decoration: none;
  font-size: 0.75em;
  line-height: 1.4;
  display: block;
  word-wrap: break-word;
  overflow-wrap: break-word;
  hyphens: auto;
}

#toc-list a:hover {
  color: #000;
}

#toc-list a.active {
  color: #000;
  font-weight: 400;
}

/* Responsive - hide TOC on smaller screens */
@media (max-width: 1400px) {
  .toc-sidebar {
    display: none;
  }
}

@media (max-width: 768px) {
  body {
    font-size: 19px;
    padding: 30px 15px;
  }

  .site-header {
    margin-bottom: 60px;
  }

  .article-item-image {
    display: none !important;
  }
}

@media (max-width: 1400px) {
  .article-item-image {
    width: 320px;
    left: calc(28em + 3em);
  }
}

@media (max-width: 1100px) {
  .content-wrapper:not(:has(.article-layout)) {
    max-width: 26em;
  }

  .article-item-image {
    width: 280px;
    left: calc(26em + 2em);
  }
}

/* Print */
@media print {
  body {
    max-width: 100%;
    font-size: 12pt;
  }

  .site-header,
  footer {
    display: none;
  }

  a {
    color: #000;
    text-decoration: none;
  }
}
