/*** default.css  -*- CSS -*- */

/*** Ivan Shmakov, 2016, 2017, 2018, 2019, 2020 */

/** To the extent possible under law, the author(s) have dedicated
 ** all copyright and related and neighboring rights to this software
 ** to the public domain worldwide.  This software is distributed
 ** without any warranty.
 **
 ** You should have received a copy of the CC0 Public Domain Dedication
 ** along with this software.  If not, see
 ** <http://creativecommons.org/publicdomain/zero/1.0/>.
 */

/*** Data: */

@page {
  margin:   2cm;
}

@page :left {
  margin-right: 1cm;
}

@page :right {
  margin-left:  1cm;
}

@media screen {
  body {
    margin: 1em 0 0 2em;
    max-width:    72ex;
  }
}

@media print {
  body {
    /* line-height:    1.5; */
    max-width:      none;
  }
  footer {
    line-height:    1.0;
  }

  /** NB: color them the same, mainly for privacy reasons */
  :link,
  :visited {
    color:  #00e;
  }
}

/** html, body */

html {
  color:        black;
  background:   white;
}

body {
  margin:   1.5em auto;
  padding:      1.5em;
  /*
  background:   #ccc;
  color:    navy;
   */
}

/** article, section */

article,
section {
  /** BTW, these are apparent defaults for ol, ul; seem more applicable here */
  margin-top:   1em;
  margin-bottom:    1em;
}

/** p, ol, ul, li, etc. */

article p,
article li,
article dd,
section p,
section li,
section dd {
  text-align:   justify;
}

/** Revert justification for pre elements, however */
article pre,
section pre {
  text-align:   initial;
}

article p,
section p {
  margin:   0;
  text-indent:  3em;
}

/** Verses in lyrics are conventionally unindented */
.lyrics p,
p.lyrics {
  text-indent:  inherit;

  /** restore apparent defaults */
  margin-top:   1em;
  margin-bottom:    1em;
}

article ol,
article ul,
section ol,
section ul {
  margin:   0;
}

li p,
dd p,
dt p {
  text-indent:  inherit;

  /** restore apparent defaults */
  margin-top:   1em;
  margin-bottom:    1em;
}

/** header, footer */

header,
article header,
section header {
  text-align:   center;
  page-break-after: avoid;
}

header *,
article header *,
section header *,
footer *,
article footer *,
section footer * {
  text-align:   inherit;
  text-indent:  inherit;
}

article section header,
section section header {
  text-align:   left;
}

header p,
footer p {
  /** restore apparent defaults */
  margin-top:   1em;
  margin-bottom:    1em;
}

header .author,
header .date,
header .subtitle {
  font-weight:  bold;
}

header h1 ~ .subtitle {
  /** Like h2 */
  margin-bottom:    0.83em;
  margin-top:       0.83em;
  font-size:    150%;
}

header h1 ~ .author {
  /** Like h3 */
  margin-top:       1.00em;
  margin-bottom:    1.00em;
  font-size:    117%;
}

article header {
  margin:   1em 0;
  /*
  border-top:       medium solid;
  border-bottom:    medium solid;
   */
}

article header h1 {
  font-size:    200%;
}

article header:first-child {
  margin-top:   0;
}

section header {
  margin:   .7em 0;
  /*
  border-color:     gray !important;
  border-top:       thin solid;
  border-bottom:    thin solid;
   */
}

section section header,
section section footer {
  border:   none;
}

article footer {
  border-top:       medium solid;
}

section footer {
  border-top:       thin solid;
}

/** Miscellaneous */

:lang(de) > q {
    quotes: '»' '«' '‹' '›'
}

:lang(fr) > q {
    quotes: '« ' ' »'
}

:lang(ru) > q {
    quotes: '«' '»' '„' '“'
}

:link {
  text-decoration:  none !important;
}

/** E. g.: … where <var class="angled" >output</var> is the output file name */
.angled:before  { content: "⟨"; }
.angled:after   { content: "⟩"; }

/** Special-case figure elements; we’d rather use original font size for the captions */
.extra,
figure.extra > * {
  font-size:    small;
}

figure.extra,
figure.extra > figcaption {
  font-size:    inherit;
}

.wrap-long-lines {
  white-space:  pre-wrap;
}

.elision {
  font-family:  serif !important;
}

/** Not unlike http://mediawiki.org/wiki/Snippets/Horizontal_lists; my assumption is that the fragment below is /not/ copyrightable, as it follows technical necessity, and includes no creativity proper */
.hlist > dt,
.hlist > li {
  display: inline;
}

.hlist > dt::after,
.hlist > li::after {
  content: " · ";
}

/** The following typographic convention applies to several cases */

.prompt,
kbd kbd,
mark {
  font-weight:  bold;
}

[title] {
  text-decoration: solid grey underline;
}

/** Revert the default presentation for this one, however */
mark {
  background-color: transparent;
  color:    inherit;
}

/** FIXME: workaround for these elements to get normal text size. */
code, kbd, pre, samp {
  font-family:      monospace, Courier !important;
}

/** Make code examples stand out somewhat on :hover */
@media screen {
  /** FIXME: somehow unhighlight .elision as well? */
  kbd:hover {
    background-color:   lightgreen;
  }
  mark:hover {
    background-color:   yellow;
  }
  samp:hover {
    background-color:   lightblue;
  }
}

.this-qr {
  float:    right;
}

/*** default.css ends here */
