
/* Archive layout — card-catalog inspired */
:root {
  --paper: #faf9f5;
  --paper-deep: #edece3;
  --ink: #22262b;
  --ink-soft: #4b5158;
  --rule: #cfcdbf;
  --accent: #2b5b6b;
  --accent-soft: #dde7e9;
  --stamp: #8c2f2f;
  --code-bg: #f1f0e6;
  --code-border: #ded9c4;
  --max-width: 920px;
}

* { box-sizing: border-box; }

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

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: Charter, 'Iowan Old Style', 'Georgia', serif;
  font-size: 17px;
  line-height: 1.6;
}

.wiki-layout {
  display: flex;
  align-items: flex-start;
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 2.5rem 1.5rem 1rem;
  gap: 2.5rem;
}

.sidebar {
  flex: 0 0 210px;
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Helvetica, Arial, sans-serif;
  font-size: 0.86rem;
  border-right: 1px dotted var(--rule);
  padding-right: 1.5rem;
  position: sticky;
  top: 2rem;
}

.site-title {
  font-family: Charter, 'Iowan Old Style', 'Georgia', serif;
  font-weight: 700;
  font-size: 1.15rem;
  letter-spacing: 0.01em;
  margin-bottom: 1.25rem;
  padding-bottom: 0.75rem;
  border-bottom: 2px solid var(--ink);
}

.site-title a { color: var(--ink); text-decoration: none; }

.sidebar ul {
  list-style: none;
  margin: 0 0 0.9rem 0;
  padding: 0;
}

.sidebar li {
  margin: 0.3rem 0;
  padding-left: 0.9rem;
  position: relative;
}

.sidebar li::before {
  content: '\2013';
  position: absolute;
  left: 0;
  color: var(--rule);
}

.sidebar ul ul { margin: 0.3rem 0 0.3rem 0.5rem; }

.sidebar .sidehead {
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-size: 0.72rem;
  font-weight: 700;
  color: var(--accent);
  margin: 1.1rem 0 0.35rem;
  padding-top: 0.6rem;
  border-top: 1px dotted var(--rule);
}

.sidebar li:first-child .sidehead,
.sidebar > div.sidehead:first-of-type {
  border-top: none;
  padding-top: 0;
}

.sidebar a {
  color: var(--ink-soft);
  text-decoration: none;
}

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

.content {
  flex: 1 1 auto;
  min-width: 0;
  padding-bottom: 3rem;
}

.content h1 {
  font-size: 1.7rem;
  line-height: 1.25;
  margin: 0 0 1.4rem;
  padding-bottom: 0.6rem;
  border-bottom: 1px solid var(--rule);
}

.content h2 { font-size: 1.35rem; margin-top: 2rem; }
.content h3 { font-size: 1.15rem; margin-top: 1.7rem; }
.content h4, .content h5, .content h6 { font-size: 1.02rem; margin-top: 1.4rem; }

.content p { margin: 0.9rem 0; }

.content a { color: var(--accent); text-decoration: underline; text-decoration-color: var(--accent-soft); text-underline-offset: 2px; }
.content a:hover { text-decoration-color: var(--accent); }

.content ul, .content ol { padding-left: 1.4rem; }
.content li { margin: 0.3rem 0; }

.content code {
  font-family: 'SFMono-Regular', Menlo, Consolas, 'Liberation Mono', monospace;
  font-size: 0.88em;
  background: var(--code-bg);
  border: 1px solid var(--code-border);
  border-radius: 3px;
  padding: 0.05em 0.35em;
}

.content pre.code {
  background: var(--code-bg);
  border: 1px solid var(--code-border);
  border-radius: 4px;
  padding: 0.9rem 1rem;
  overflow-x: auto;
  line-height: 1.5;
}

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

.content pre.indented {
  background: var(--paper-deep);
  border-left: 3px solid var(--rule);
  padding: 0.6rem 1rem;
  overflow-x: auto;
  font-family: 'SFMono-Regular', Menlo, Consolas, monospace;
  font-size: 0.86em;
}

.content table.pmwiki-table {
  border-collapse: collapse;
  margin: 1.2rem 0;
  width: 100%;
}

.content table.pmwiki-table td {
  border: 1px solid var(--rule);
  padding: 0.5rem 0.7rem;
  vertical-align: top;
}

.content hr {
  border: none;
  border-top: 1px dotted var(--rule);
  margin: 1.8rem 0;
}

.align-right { display: block; text-align: right; }
.align-center { display: block; text-align: center; }
.align-left { display: block; text-align: left; }

.content img { max-width: 100%; height: auto; }

.content img.rframe {
  float: right;
  margin: 0.2rem 0 1rem 1.2rem;
}

.content img.lframe {
  float: left;
  margin: 0.2rem 1.2rem 1rem 0;
}

.content img.cframe {
  display: block;
  margin: 1.2rem auto;
}

.content img.frame {
  border: 1px solid var(--rule);
  padding: 4px;
  background: #fff;
}

.content img.thumb {
  max-width: 200px;
}

footer.archive-footer {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 1rem 1.5rem 2.5rem;
  display: flex;
  justify-content: flex-end;
  clear: both;
}

footer.archive-footer p {
  display: inline-block;
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Helvetica, Arial, sans-serif;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--stamp);
  border: 1.5px solid var(--stamp);
  border-radius: 3px;
  padding: 0.35rem 0.7rem;
  transform: rotate(-1.2deg);
  opacity: 0.85;
}

@media (max-width: 680px) {
  .wiki-layout { flex-direction: column; padding: 1.5rem 1.1rem; gap: 1rem; }
  .sidebar {
    position: static;
    flex: none;
    width: 100%;
    border-right: none;
    border-bottom: 1px dotted var(--rule);
    padding-right: 0;
    padding-bottom: 1rem;
  }
  footer.archive-footer { justify-content: center; padding: 1rem 1.1rem 2rem; }
}

@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; animation: none !important; }
}

a:focus-visible, a:focus {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}
