/* terokarvinen.com. The look of the old zebtex theme, written again for siv. */

:root {
  --dark: #504F40;
  --dark-hover: #6F6E5A;
  --on-dark: #F2EED3;
  --sand: #DBD8C0;
  --code-background: #f0f3f3;
  --muted: #777;
}

html, body {
  margin: 0;
  padding: 0;
  font-family: sans-serif;
  font-size: 16px;
  line-height: 1.3;
}
body.front { background: #dbd8c014; }

h1 { font-size: 35px; }
h1, h2, h3, h4, h5 { color: var(--dark); line-height: 1.2; }
h1 small { color: var(--muted); font-size: 20px; }
p { letter-spacing: 0.2px; }
article li { padding: 4px; }
hr { width: 10%; color: darkgray; margin: 25px auto; }
hr.line { margin-top: 70px; margin-bottom: 70px; }
main, article, aside, p, pre { overflow-wrap: break-word; }
img, svg, video { max-width: 100%; height: auto; }

/* Header and footer */

header.dark, footer.dark {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: center;
  margin: 0;
  padding: 0;
  color: #fff;
  background: var(--dark);
}
header.dark h1 { display: inline-block; margin: 0; padding: 0; font-size: 16px; font-weight: normal; }
header.dark a, footer.dark a {
  display: inline-block;
  padding: 12px;
  font-size: 16px;
  font-weight: normal;
  text-decoration: none;
  color: var(--on-dark);
  background: var(--dark);
}
header.dark a:hover, footer.dark a:hover { color: #FFFDEE; background: var(--dark-hover); }

form.search { display: inline-block; margin: 5px; padding-right: 12px; }
form.search input[type=search] { color: black; background: var(--sand); padding: 5px; border: 1px solid #888; }
form.search input[type=submit] { height: 30px; color: #57564c; background: #afac99; border: 1px solid #888; }

/* Text column and the side column */

.flexed {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  align-items: flex-start;
  column-gap: 5%;
  margin-top: 15px;
}
.flexed main { flex: 0 1 800px; min-width: 0; margin: 10px; }
.flexed aside.side { flex: 0 1 250px; min-width: 200px; margin: 10px; }
.flexed .spacer { flex: 0 0 50px; }
main article { background: white; padding: 20px; }
main h1 { margin-top: 0; }
.summary a { text-decoration: none; }

.side .toc p { margin: 0 0 0.5em; }
.side .toc ul { padding-left: 20px; margin-top: 0; }
.side .toc ul ul { padding-left: 12px; }
.side .toc li { list-style: none; }
.side .toc a { display: inline-block; width: 100%; padding: 7px 0; text-decoration: none; color: #00e; }
.side .toc a:hover { background-color: #dbd8c040; }
.meta { font-size: smaller; color: var(--dark); }

/* Tags */

a.tag {
  display: inline-block;
  margin: 2px 0;
  padding: 2px 5px;
  border-radius: 5px;
  font-size: 12px;
  line-height: 20px;
  white-space: nowrap;
  text-decoration: none;
  color: var(--dark);
  background: var(--sand);
}
.tag.large { font-size: 35px; color: black; padding: 0 10px; border-radius: 5px; background: var(--sand); }
.tagh1 { color: var(--dark); }

/* Front page */

.intro { padding: 0; }
.card {
  position: relative;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  column-gap: 20px;
  margin-bottom: 20px;
  padding: 10px;
  background: white;
}
.card > div { flex: 1 1 300px; max-width: 455px; }
.card img.cover { width: 300px; height: 300px; object-fit: cover; }
.card h2 a.cardlink { color: var(--dark); text-decoration: none; }
/* The title's link covers the whole card, as on live. */
.card a.cardlink::after { content: ""; position: absolute; inset: 0; }
.card .summary a { color: inherit; font-style: italic; pointer-events: none; }  /* live shows them as <i> */
.card .summary figure, .card .summary img, .card .summary .anchor { display: none; }
.card:hover h2 a.cardlink { text-decoration: underline; }
ul.years { margin: 0 0 0.5em; }

/* Lists of pages */

article.listed { padding: 0 20px; background: none; }

/* After the article: previous and next, comments, related */

.bar {
  clear: both;
  margin-top: 70px;
  padding: 10px 20px;
  color: var(--dark);
  background: #efefef;
}
.bar a { color: var(--dark); }
.bar h2 { margin: 10px 0 5px; font-size: 18px; }
.bar h2.inline { display: inline; margin-right: 0.5em; }
.prevnext { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 10px; }
.prevnext a { display: inline-block; padding: 12px; text-decoration: none; }
.related { margin-top: 0; }
.related .cards { display: flex; flex-wrap: wrap; gap: 0 20px; }
.related .card { flex: 1 1 400px; max-width: 500px; margin: 20px 0; padding: 20px; background-color: #dbd8c014; }
.related .card > div { max-width: none; }

aside#comments { max-width: 55em; margin: 0 auto; padding: 0 20px; }
#comments pre { color: black; background: white; padding: 0; }
#comments .oneComment { padding-bottom: 20px; }
#comments a.writeButton {
  display: inline-block;
  padding: 8px;
  border-radius: 8px;
  font-size: 20px;
  text-decoration: none;
  color: white;
  background: #4e9a06;
}

/* Tables */

main table { border-collapse: separate; border-spacing: 3px; }
main table th, main table td { min-width: 5em; max-width: 40em; padding: 4px; }
main table th { color: var(--dark); }
main table tr:nth-child(even) { background: var(--code-background); }

/* Code */

pre {
  padding: 15px;
  white-space: pre-wrap;
  font-size: 17px;
  line-height: 1.3;
  background: var(--code-background);
  tab-size: 4;
}
pre code { background: none; }
kbd { border: 1px solid darkgray; border-radius: 4px; padding: 3px; margin: 3px; }

/* Heading anchors: hidden until the heading is hovered or focused */
.anchor, .top { text-decoration: none; opacity: 0; font-weight: normal; font-size: 0.8em; margin-left: 0.2em; }
h2:hover .anchor, h3:hover .anchor, h4:hover .anchor, h2:hover .top, h3:hover .top, h4:hover .top,
.anchor:focus, .top:focus { opacity: 0.6; }
@media (hover: none) {
  .anchor { opacity: 0.3; }
  .top { display: none; }
}

/* Classes used in the articles */

.clearFloat, .clear { clear: both; }
.left { float: left; }
.right { float: right; }
.center { display: block; margin-left: auto; margin-right: auto; }
.pad { padding: 20px; }
.padSides { padding-left: 20px; padding-right: 20px; }
.minusTop { margin-top: -40px; }
.narrow { width: 26em; max-width: 100%; }
.playground { background: var(--sand); }
.archived { border: 2px solid orange; background: lightyellow; padding: 40px; }
.downloadAButton {
  display: inline-block;
  margin: 20px 0;
  padding: 18px;
  border-radius: 10px;
  text-decoration: none;
  color: var(--dark);
  background: var(--sand);
}
.downloadAButton i { margin: 5px; }

/* Icons */

@font-face {
  font-family: "BSIcons";
  src: url("/font/bsicons.woff") format("woff");
}
[class^="bi-"]::before, [class*=" bi-"]::before {
  display: inline-block;
  font-family: BSIcons !important;
  font-style: normal;
  font-weight: normal !important;
  font-variant: normal;
  text-transform: none;
  line-height: 1;
  vertical-align: text-bottom;
}
.bi-cloud-download-fill::before { content: "\f29a"; }
.bi-cloud-download::before { content: "\f29b"; }
.bi-download::before { content: "\f2ea"; }
.bi-alarm::before { content: "\f102"; }
.bi-search::before { content: "\f52a"; }
.bi-book::before { content: "\f194"; }
.bi-chat-quote::before { content: "\f255"; }
.bi-telephone::before { content: "\f5c1"; }
.bi-mailbox::before { content: "\f47c"; }

/* All pages */

ul.all { list-style: none; padding: 0; }
ul.all time { color: var(--muted); font-variant-numeric: tabular-nums; }

@media print {
  header, footer, .side, .bar, #comments, .anchor, .top, .filter { display: none; }
  a[href^="http"]::after { content: " (" attr(href) ")"; font-size: 90%; }
  pre, figure, table { break-inside: avoid; }
  h2, h3, h4 { break-after: avoid; }
}
