/*
 * This is a manifest file that'll be compiled into application.css, which will include all the files
 * listed below.
 *
 * Any CSS (and SCSS, if configured) file within this directory, lib/assets/stylesheets, or any plugin's
 * vendor/assets/stylesheets directory can be referenced here using a relative path.
 *
 * You're free to add application-wide styles to this file and they'll appear at the bottom of the
 * compiled file so the styles you add here take precedence over styles defined in any other CSS
 * files in this directory. Styles in this file should be added after the last require_* statement.
 * It is generally better to create a new file per style scope.
 *


 */

/* https://github.com/jensimmons/cssremedy/blob/master/css/remedy.css */
/* @docs
   label: Core Remedies
   version: 0.1.0-beta.2
   
   note: |
   These remedies are recommended
   as a starter for any project.
   
   category: file
 */


/* @docs
   label: Box Sizing

   note: |
   Use border-box by default, globally.

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


/* @docs
   label: Line Sizing

   note: |
   Consistent line-spacing,
   even when inline elements have different line-heights.

   links:
   - https://drafts.csswg.org/css-inline-3/#line-sizing-property

   category: global
 */
html { line-sizing: normal; }


/* @docs
   label: Body Margins

   note: |
   Remove the tiny space around the edge of the page.

   category: global
 */
body { margin: 0; }


/* @docs
   label: Hidden Attribute

   note: |
   Maintain `hidden` behaviour when overriding `display` values.

   category: global
 */
[hidden] { display: none; }


/* @docs
   label: Heading Sizes

   note: |
   Switch to rem units for headings

   category: typography
 */
h1 { font-size: 2rem; }
h2 { font-size: 1.5rem; }
h3 { font-size: 1.17rem; }
h4 { font-size: 1.00rem; }
h5 { font-size: 0.83rem; }
h6 { font-size: 0.67rem; }


/* @docs
   label: H1 Margins

   note: |
   Keep h1 margins consistent, even when nested.

   category: typography
 */
h1 { margin: 0.67em 0; }


/* @docs
   label: Pre Wrapping

   note: |
   Overflow by default is bad...

   category: typography
 */
pre { white-space: pre-wrap; }


/* @docs
   label: Horizontal Rule

   note: |
   1. Solid, thin horizontal rules
   2. Remove Firefox `color: gray`
   3. Remove default `1px` height, and common `overflow: hidden`

   category: typography
 */
hr {
  border-style: solid;
  border-width: 1px 0 0;
  color: inherit;
  height: 0;
  overflow: visible;
}


/* @docs
   label: Responsive Embeds

   note: |
   1. Block display is usually what we want
   2. The `vertical-align` removes strange space-below in case authors overwrite the display value
   3. Responsive by default
   4. Audio without `[controls]` remains hidden by default

   category: embedded elements
 */
img, svg, video, canvas, audio, iframe, embed, object {
  display: block;
  vertical-align: middle;
  max-width: 100%;
}
audio:not([controls]) { display:none; }


/* @docs
   label: Responsive Images

   note: |
   These new elements display inline by default,
   but that's not the expected behavior for either one.
   This can interfere with proper layout and aspect-ratio handling.

   1. Remove the unnecessary wrapping `picture`, while maintaining contents
   2. Source elements have nothing to display, so we hide them entirely

   category: embedded elements
 */
picture { display: contents; }
source { display: none; }


/* @docs
   label: Aspect Ratios

   note: |
   Maintain intrinsic aspect ratios when `max-width` is applied.
   `iframe`, `embed`, and `object` are also embedded,
   but have no intrinsic ratio,
   so their `height` needs to be set explicitly.

   category: embedded elements
 */
img, svg, video, canvas {
  height: auto;
}


/* @docs
   label: Audio Width

   note: |
   There is no good reason elements default to 300px,
   and audio files are unlikely to come with a width attribute.

   category: embedded elements
 */
audio { width: 100%; }

/* @docs
   label: Image Borders

   note: |
   Remove the border on images inside links in IE 10 and earlier.

   category: legacy browsers
 */
img { border-style: none; }


/* @docs
   label: SVG Overflow

   note: |
   Hide the overflow in IE 10 and earlier.

   category: legacy browsers
 */
svg { overflow: hidden; }


/* @docs
   label: HTML5 Elements

   note: |
   Default block display on HTML5 elements.
   For oldIE to apply this styling one needs to add some JS as well (i.e. `document.createElement("main")`)

   links:
   - https://www.sitepoint.com/html5-older-browsers-and-the-shiv/

   category: legacy browsers
 */
article, aside, details, figcaption, figure, footer, header, hgroup, main, nav, section {
  display: block;
}


/* @docs
   label: Checkbox & Radio Inputs

   note: |
   1. Add the correct box sizing in IE 10
   2. Remove the padding in IE 10

   category: legacy browsers
 */
[type='checkbox'],
[type='radio'] {
  box-sizing: border-box;
  padding: 0;
}


body {
  font-size: 1.2rem;
  font-family: Charter, 'Bitstream Charter', 'Sitka Text', Cambria, serif;
  font-weight: normal;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

/*
 * generated at http://www.patternify.com/
 * http://bit.ly/2mg6Qlc
 */
.header {
  background: url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAkAAAAJCAYAAADgkQYQAAAALklEQVQoU2NkIAIwEqGGgZAiYwYGhrOEFIEtIlsR2Apkt5JtEoaHYSZhWIGsEgB+QQMKUesOpwAAAABJRU5ErkJggg==) repeat;
}

nav {
  padding-top: 0.5rem;
  padding-left: 0.5rem;
}
nav h1 {
  margin-top: 0px;
  font-size: 1.0em;
}

nav h1, nav a {
  color: black;
}

nav a {
  background: white;
  text-decoration: none;
}

nav a:hover {
  color: red;
}
nav ul {
  display: flex;
  list-style: none;
  padding-left: 0px;
  margin-top: 0px;
}
nav ul li {
  list-style-type: none;
  margin-right: 0.5em;
}
nav ul li.logout {
  margin-left: auto;
}



form, form > dialog {
  display: flex;
  flex-direction: column;
  flex-grow: 1;
}

form fieldset, form details {
  display: flex;
  flex-direction: column;
  border: none;
  padding: 0px;
}

form fieldset > textarea,
form fieldset > input[type=text] {
  font-size: 1.2rem;
}

form fieldset > textarea,
form fieldset > input[type=text] {
  flex-grow: 1;
  padding-left: 5px;
  padding-right: 5px;
}

form fieldset.fill {
  flex-grow: 1;
}

form fieldset > textarea {
  height: 100%;
}

main.user > form fieldset {
  margin-top: 1.0rem;
}

form > .actions, dialog > .actions {
  display: flex;
  margin-top: 0.25rem;
  flex-direction: row;
  justify-content: flex-end;
}

/**
 * disable input zoom on ios: https://stackoverflow.com/a/16255670
 */
@media screen and (-webkit-min-device-pixel-ratio:0) { 
  select,
  textarea,
  input {
    font-size: 16px;
  }
}

.button {
  font-family: Charter, "Bitstream Charter", "Sitka Text", Cambria, serif;
  font-size: 1.1rem;
  border: 0px solid;
  border-radius: 10px;
  padding: 0.5rem;
  background: #eeeeee;
  margin-right: 0.25rem;
  text-decoration: none;
  color: black;

  &:hover {
    cursor: pointer;
  }
}

main {
  margin-left: 0.5rem;
}

article > header {
  h1 {
    margin-top: 0;
    margin-bottom: 0;
    margin-right: 0.8rem;
  }
  time {
    margin-right: 0.5rem;
  }
  display: flex;
  align-items: baseline;
}

article p {
  max-width: 85%;
}

article > section.body.collapsed {
  max-height: 120px;
  overflow: hidden;
  text-overflow: ellipsis;

  /* https://stackoverflow.com/questions/22808040/fading-out-text-on-overflow-with-css-if-the-text-is-bigger-than-allowed */
  mask-image: linear-gradient(180deg, #000 60%, transparent);
}

main.user {
  margin-left: auto;
  margin-right: auto;
}

div.links > ul {
  display: flex;
  flex-direction: row;
  list-style: none;
}
div.links > ul > li {
  font-size: 90%;
  margin: 0.5rem;
}


dialog {
  opacity: 0;
  transform: scaleY(0);
}

dialog[open] {
  opacity: 1;
  transform: scaleY(1);
}

dialog > fieldset {
  margin-bottom: 1.0rem;
}


