;; -*- mode: scheme; -*-
()
(let ((black "#333")
      (gray "#999")
      (white "#fff")
      (red "#900")
      (dark-blue "#009")

      (sans "Arial, Helvetica, sans-serif")
      (mono "'Courier New', Courier, monospace"))
  `((*
     (margin 0)
     (padding 0))
    (body
     (width "40em")
     (margin 0 "auto")
     (font-family ,sans)
     (font-size "1.1em")
     (line-height "1.2em")
     (color ,black)
     (background-color ,white))

    (h1
     (font-size "1.7em")
     (line-height "initial")
     (margin "0.5em" 0))
    (h2
     (font-size "1.4em"))

    (p
     (margin "1em" 0)
     (hyphens "auto")
     (-ms-hyphens "auto")
     (-moz-hyphens "auto")
     (-webkit-hyphens "auto")
     (text-align "justify"))

    (img
     (margin "0.5em" 0))

    (tt
     (font-family ,mono)
     (color ,red))

    (pre
     (margin "0.5em" 0)
     (font-family ,mono))

    (hr
     (margin "1em" 0)
     (border "none")
     (border-top "2px" ,gray "solid"))

    (blockquote
     (padding 0 0 0 "1em")
     (border-left "8px" ,gray "solid"))

    (.post
     ((// ul)
      (margin "0.5em" 0))
     ((// li)
      (margin 0 "1em")
      (text-align "justify")))

    (dd
     (padding "0.5em 1em")
     (text-align "justify"))

    (table
     (margin "1em" 0)
     (border "1px" ,black "solid")
     (border-collapse "collapse")
     (((// td) (// th))
      (padding 0 "0.1em"))
     ((& .footnote)
      (border "none")
      (border-top "1px" ,gray "solid")
      (display "block")
      (margin "0.5em" 0)
      (padding-top "1em")
      ;; HACK: nth-of-type(1) applies to the element, not the class, so
      ;; this *removes* the top border and padding from everything
      ;; except the first footnote table
      ((// |~ .footnote|)
       (border-top "none")
       (padding-top 0))
      ((// td)
       (padding 0)
       (padding-right "0.5em")))
     ((& .layout)
      (margin "1em" 0)
      (border-style "none")
      ((// td)
       (vertical-align "top")
       (padding 0 "0.5em" 0 0)
       ((// .key)
        (color ,gray)
        (font-weight "bold")))))

    (.header
     (margin "1em" 0)
     ((// ul)
      (list-style "none")
      (padding 0))
     ((// li)
      (display "inline")
      (padding 0 "0.5em")
      ((& :first-child)
       (padding 0))))

    (((.date .category))
     (font-family ,mono)
     (padding-bottom "0.5em")
     (padding-right "0.5em")
     (color ,gray)
     (display "block"))

    (a:link
     (color ,dark-blue))
    (a:visited
     (color ,black))

    (|#reverse|
     (unicode-bidi "bidi-override")
     (direction "rtl"))
    (.strike
     (text-decoration "line-through"))

    (media
     "(max-width: 800px)"
     (body (width "90%"))
     (pre
      (overflow-x "scroll")))))
