/* blog.css — Monospace Web for TILES microblog */

@font-face {
  font-family: "Berkeley Mono";
  src: url("../fonts/BerkeleyMono-Condensed.woff2") format("woff2");
  font-weight: normal;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: "Berkeley Mono";
  src: url("../fonts/BerkeleyMono-Bold-Condensed.woff2") format("woff2");
  font-weight: bold;
  font-style: normal;
  font-display: swap;
}

:root {
  --font-family: "Berkeley Mono", monospace;
  --line-height: 1.20rem;
  --border-thickness: 2px;
  --text-color: #000;
  --bg-color: #fff;
  --alt-color: #666;
  --lunar-green: #4e5541;
  --tufte-red: #a00000;
  --border-color: #000;
  --hr-color: #000;
}

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

html {
  font-size: 16px;
}

body {
  font-family: var(--font-family);
  font-size: 1rem;
  line-height: var(--line-height);
  color: var(--text-color);
  background: var(--bg-color);
  max-width: 80ch;
  margin: 0 auto;
  padding: calc(var(--line-height) * 2) 2ch;
}

/* Header */

header {
  margin-bottom: calc(var(--line-height) * 2);
  white-space: pre;
  line-height: var(--line-height);
}

/* Links */

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

a:hover {
  text-decoration: underline;
}

article .content a {
  text-decoration: underline;
  text-decoration-color: var(--tufte-red);
  text-decoration-thickness: 1px;
  text-underline-offset: 2px;
}

article .content a:hover {
  text-decoration-thickness: 2px;
}

.cursor {
  color: var(--tufte-red);
  animation: blink 1s step-end infinite;
}

@keyframes blink {
  50% { opacity: 0; }
}

header a.menu {
  color: var(--lunar-green);
}

header a.menu:hover {
  text-decoration: underline;
  text-decoration-thickness: 2px;
}

/* Articles */

article {
  margin-top: calc(var(--line-height) * 3);
  margin-bottom: 0;
}

article .content p {
  margin: 0 0 var(--line-height) 0;
}

article .content p:last-child {
  margin-bottom: 0;
}

article .content ul,
article .content ol {
  margin: 0 0 var(--line-height) 0;
  padding-left: 3ch;
}

article .content li {
  margin-bottom: calc(var(--line-height) * 0.25);
}


/* Meta line: tags left, date right */

.meta {
  display: flex;
  color: var(--lunar-green);
  margin-bottom: calc(var(--line-height) * 0.25);
}

.meta .dots {
  flex: 1;
  overflow: hidden;
  white-space: nowrap;
  margin: 0 1ch;
}

.meta .dots::before {
  content: "................................................................................";
}

.meta time {
  flex-shrink: 0;
}

.meta time a,
.meta a.tag {
  color: var(--lunar-green);
  text-decoration: none;
}

.meta time a:hover,
.meta a.tag:hover {
  text-decoration: underline;
  text-decoration-thickness: 2px;
}

/* Pagination */

nav.meta {
  margin-top: calc(var(--line-height) * 2);
  margin-bottom: 0;
  color: var(--text-color);
  align-items: center;
}

nav.meta .dots::before {
  content: "";
}

nav.meta a {
  border: var(--border-thickness) solid var(--text-color);
  padding: calc(var(--line-height) / 2 - var(--border-thickness)) calc(1ch - var(--border-thickness));
  height: calc(var(--line-height) * 2);
  text-transform: uppercase;
  display: inline-block;
  text-decoration: none;
  line-height: calc(var(--line-height));
}

nav.meta a:hover {
  background: #f5f5f5;
  text-decoration: none;
}

nav.meta a:active {
  transform: translate(2px, 2px);
}

/* Separator lines */

.sep {
  display: block;
  white-space: nowrap;
  overflow: hidden;
}

/* Footer */

footer {
  margin-top: calc(var(--line-height) * 2);
  color: var(--alt-color);
}

/* Org export cleanup — hide generated cruft */

.content .footref,
.content .footdef {
  display: none;
}

#footnotes {
  display: none;
}

/* Bold and italic */

b, strong {
  font-weight: bold;
}

/* Responsive */

@media (max-width: 680px) {
  html {
    font-size: 14px;
  }

  body {
    padding: var(--line-height) 1ch;
  }

  /* Header: allow wrapping, hide char-drawn lines */
  header {
    white-space: normal;
    overflow: hidden;
  }

  /* Meta line: stack tags above date on narrow screens */
  .meta {
    flex-wrap: wrap;
  }

  .meta .dots {
    display: none;
  }

  .meta time {
    margin-left: auto;
  }
}
