@charset "utf-8";

/* colors - always dark */
:root {
  --background-color: #111;
  --text-color: #fff;
  --primary-color: #e8d5b7;
  --secondary-color: #f5e6d3;
  --header-color: #f0e4d4;
  --faded-color: #c4b49a;
  --border-color: #444;
  --code-background-color: #222;
  --code-block-background-color: #1a1a1a;
  --code-block-text-color: #e0e0e0;
  --table-background-color: #1a1a1a;
  --table-border-color: #333;
  --pre-shadow: rgba(0, 0, 0, 0.3);
  --hr-shadow: #000;
  --date-warning-text-color: #e8b87a;
}

/* header image */
.header-image {
  position: relative;
  width: 100%;
  height: 200px;
  overflow: hidden;
}

.header-image canvas {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: cover;
  object-position: center bottom;
}

/* general style */
html    { background: var(--background-color); }
body    { font: 21px/26px 'Crimson Text', serif;
          margin: 0; padding: 0; font-weight: 400; color: var(--text-color); }
a       { color: var(--primary-color); font-weight: 400; }
a:hover { color: var(--secondary-color); }

/* tag sort controls */
.tag-sort-controls {
  margin: 10px 0 20px 0;
  font-size: 14px;
  color: var(--faded-color);
}

.tag-sort-controls input[type="radio"] {
  display: none;
}

.tag-sort-controls label {
  cursor: pointer;
  display: inline;
  text-decoration: none;
}

.tag-sort-controls label:hover {
  text-decoration: underline;
}

.tag-sort-controls input:checked {
  & + span {
    text-decoration: underline;
    color: var(--text-color);
  }
}

/* headlines */
h1, h2, h3, h4, h5, h6      { font-family: 'Playfair Display', serif;
                              font-weight: 300; color: var(--header-color); }
h1 a, h2 a, h3 a, h4 a,
h5 a, h6 a                  { text-decoration: none; }
h1 a:hover, h2 a:hover,
h3 a:hover, h4 a:hover      { text-decoration: underline; }
h1                          { margin: 15px 0 25px 0; }
h2                          { margin: 25px 0 10px 0; }
h3                          { margin: 35px 0 10px 0; }
h1                          { font-size: 52px; line-height: 56px; text-wrap: balance; }
h2                          { font-size: 42px; line-height: 44px; }
h3                          { font-size: 36px; line-height: 38px; }

h1 em                       { color: var(--text-color); font-size: 32px; display: block;
                              margin-left: 25px; margin-top: -15px; }

/* layout elements */
div.container               { max-width: 860px; margin: 8px auto 48px auto; padding: 0 40px; }
div.header                  { float: left }
div.header a                { text-decoration: none; color: var(--header-color); font-weight: 600; }
div.header a:hover          { color: var(--secondary-color); }
div.navigation              { float: right; }
div.header, div.navigation  { height: 25px; margin-bottom: 42px; }
div.navigation ul           { margin: 0; padding: 0; list-style: none; }
div.navigation ul li        { display: inline; margin: 0 2px; padding: 0; }
div.body                    { clear: both; margin: 0; line-height: 1.6; text-wrap: pretty; }
div.footer                  { margin-top: 55px; font-size: 19px; clear: both;
                              text-align: right; color: var(--faded-color); }
div.footer p                { margin: 0; }
div.footer a                { color: var(--faded-color); }

/* margins and stuff */
p, div.line-block, ul, ol, pre,
    table                       { margin: 15px 0 15px 0; }
dt                              { margin: 25px 0 16px 0; padding: 0; }
dd                              { margin: 16px 0 25px 40px; padding: 0; }
ul ol, ol ul, ul ul, ol ol      { margin: 10px 0; padding: 0 0 0 40px; }
li                              { padding: 0; }
li p                            { margin: 0; padding: 0; }
li p + p                        { margin-top: 15px; }
h1 + p.date                     { margin-top: -25px; font-style: italic; }
blockquote                      { font-style: italic; }

/* code formatting.  no monospace because of webkit (bug?) */
pre, code, tt   { font-family: 'Ubuntu Mono', 'Consolas', 'Deja Vu Sans Mono',
                  'Bitstream Vera Sans Mono', 'Monaco', 'Courier New', monospace;
                  font-size: 0.9em; }
pre             { line-height: 1.5; background: var(--code-block-background-color);
                  color: var(--code-block-text-color); padding: 8px 30px; width: 100%; overflow-x: auto;
                  margin: -8px -30px -8px -30px; border-radius: 2px; box-shadow: 0 0 3px var(--pre-shadow); }
code, tt        { background: var(--code-background-color); }

/* tables */
table           { border: 1px solid var(--table-border-color); border-collapse: collapse;
                  background: var(--table-background-color); }
td, th          { padding: 2px 12px; border: 1px solid var(--table-border-color); }

/* footnotes */
table.footnote          { margin: 25px 0; background: transparent; border: none; }
table.footnote + table.footnote { margin-top: -35px; }
table.footnote td       { border: none; padding: 9px 0 0 0; font-size: 15px; }
table.footnote td.label { padding-right: 10px; }
table.footnote td p     { margin: 0; }
table.footnote td p + p { margin-top: 15px; }

/* blog overview */
div.entry-overview                  { margin: 25px 122px 25px 102px; }
div.entry-overview h1,
div.entry-overview div.summary,
div.entry-overview div.summary p    { display: inline; line-height: 25px; }
div.entry-overview h1               { margin: 0; font-size: 21px;
                                      font-family: 'Crimson Text', serif; }
div.entry-overview h1:after         { content: ":"; color: var(--text-color); }
div.entry-overview div.summary,
div.entry-overview div.date,
div.entry-overview div.summary p    { margin: 0; padding: 0; }
div.entry-overview div.detail       { margin-left: 140px; text-wrap: balance; }
div.entry-overview div.date         { float: left; width: 120px; color: var(--faded-color);
                                      text-align: right; font-size: 19px; margin-top: 2px;
                                      font-style: normal; }

@media only screen and (max-width: 900px) {
    div.entry-overview { margin: 25px 10px 25px 0; }
    div.entry-overview div.detail { margin-left: 130px; }
}

/* other alignment things */
img.align-center                    { margin: 15px auto; display: block; }
img.align-right                     { margin: 5px 0 5px 15px; display: block; float: right; }
.figure.align-center                { text-align: center; }
.figure p.caption                   { font-size: 14px; margin-top: 0; }
figcaption                          { font-size: 0.9em; text-align: center;
                                      color: var(--faded-color); margin-top: -8px; font-style: italic; }

/* pagination */
div.pagination          { margin: 36px 0 0 0; text-align: center; }
div.pagination strong   { font-weight: normal; font-style: italic; }

/* tags */
p.tags          { text-align: right; margin-top: 35px; }
ul.tagcloud     { font-size: 16px; margin: 36px 0; padding: 0;
                  list-style: none; line-height: 1.45; text-align: justify }
ul.tagcloud li  { margin: 0; padding: 0 10px; display: inline; }

/* latex math */
span.math img   { margin-bottom: -7px; }

/* strikethrough */
span.strike     { text-decoration: line-through; }

/* lines */
hr { border: none; border-bottom: 1px solid var(--border-color); height: 10px;
     margin: 10px auto 25px auto; width: 90%;
     box-shadow: 0 7px 7px -4px var(--hr-shadow); }

/* mobile */
@media only screen and (max-width: 800px) {
    div.body { padding: 0; margin: 0; }
    div.container { padding: 12px; margin: 0; }
    div.header { height: auto; margin: 0; }
    div.navigation { margin-bottom: 20px; }
    h1 { font-size: 42px; line-height: 44px; }
    h2 { font-size: 36px; line-height: 38px; }
    h3 { font-size: 28px; line-height: 30px; }
}

/* pygments fixes */
.w { text-decoration: none; }

/* expandables */
details {
  background: var(--code-background-color);
  padding: 5px 15px;
  border-radius: 2px;
}
details summary { cursor: pointer; }
details summary:hover { text-decoration: underline; color: var(--secondary-color); }
details[open] summary { text-decoration: underline; margin-bottom: 15px; }

/* date warning */
span.date-warning {
  color: var(--date-warning-text-color);
  font-style: italic;
}

/* upcoming indicator */
span.upcoming-indicator {
  color: var(--date-warning-text-color);
  font-style: italic;
  background: rgba(238, 118, 26, 0.15);
  padding: 2px 6px;
  line-height: 1.1em;
  border-radius: 3px;
  font-size: 0.8em;
  font-weight: bold;
}

/* images */
img.full-width,
canvas.full-width {
  width: 100%;
}

/* hide dithered images until JS replaces them with canvas */
img.dithered-image {
  visibility: hidden;
}

/* tag cloud styles */
.tag-link {
  position: relative;
}

.tag-tooltip {
  position: absolute;
  bottom: 120%;
  left: 50%;
  transform: translateX(-50%);
  background: var(--background-color);
  color: var(--text-color);
  padding: 6px 10px;
  border-radius: 6px;
  font-size: 13px;
  white-space: nowrap;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s ease;
  z-index: 1000;
  border: 1px solid var(--border-color);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
}

.tag-tooltip::before,
.tag-tooltip::after {
  content: '';
  position: absolute;
  top: 100%;
  left: 50%;
  transform: translateX(-50%);
  border: 6px solid transparent;
}

.tag-tooltip::before {
  border-top-color: var(--border-color);
  margin-top: 1px;
}

.tag-tooltip::after {
  border-top-color: var(--background-color);
  border-width: 5px;
}

.tag-link:hover .tag-tooltip {
  opacity: 1;
}
