:root {
  --action: brown;
  --main-bg: #ecece9;
  --main-border: #cccccf;
  --subtle-text: #667;
  --footer-height: 38px;
  --text: #0d0d0f;
}

body {
  margin: 0px;
  padding: 0px;
  font-family: sans-serif;
  font-size: 16px;
  color: var(--text);

  a {
    color: var(--action);
  }
  a[href],
  a[hx-post],
  a[hx-delete],
  a[hx-patch],
  a[hx-get] {
    text-decoration: underline;
    cursor: pointer;
  }
  .has-cursor {
    cursor: pointer;
  }
}

header {
  padding: 10px 10px 8px 10px; /* 8px makes up for nav>a 2px bottom border */
  background: var(--main-bg);
  border-bottom: 1px solid var(--main-border);

  #logo {
    height: 40px;
    margin-bottom: 2px;
  }
  nav a {
    display: inline-block;
    margin-right: 10px;
    font-size: 14px;
    text-decoration: none !important;
    color: var(--subtle-text);
    border-bottom: 2px solid transparent;
  }
  nav a.active,
  nav a:hover {
    border-bottom: 2px solid grey;
  }
  nav a.right {
    float: right;
    margin-right: 0px;
    margin-left: 10px;
  }
  #search {
    margin-bottom: 10px;
    text-align: right;
    float: right;
  }
  #search input {
    border: 1px solid var(--main-border);
    font-size: 14px;
    line-height: 24px;
    padding: 1px 8px;
  }
  #search input[type=search] {
    border-top-left-radius: 6px;
    border-bottom-left-radius: 6px;
    background-color: #fff;
  }
  #search input[type=submit] {
    border-left: 0px;
    border-top-right-radius: 6px;
    border-bottom-right-radius: 6px;
    background-color: #e2e2e2;
    font-weight: bold;
    color: #333;
  }
  #search input[type=submit]:hover {
    background-color: #ddd;
  }
}

main {
  p, ul, ol {
    line-height: 1.5em;
  }
  padding: 10px 10px calc(var(--footer-height) + 10px + 1px) 10px;

  h1, h2, h3, h4, h5, h6 {
    margin: 0 0 10px 0;
    padding: 0px;
  }

  table + h2 {
    margin-top: 20px;
  }

  h1 {
    font-size: 40px;
  }

  a.button,
  input[type="submit"],
  button,
  input[type="button"] {
    background-color: var(--action);
    border-radius: 5px;
    border: 0px;
    padding: 10px 15px;
    color: white;
    font-weight: bold;
    font-size: 14px;
    cursor: pointer;
    display: inline-block;
    text-decoration: none;
  }
  button[type="reset"] {
    background-color: var(--subtle-text);
  }
  button[disabled] {
    cursor: not-allowed;
    opacity: 50%;
  }
  #breadcrumbs {
    padding-bottom: 4px;
    font-size: 14px;
  }
  #view-rfc {
    display: flex;

    & > article {
      flex: 1 0 auto;
      padding-bottom: 40px;
      max-width: calc(100vw - 350px);
      padding-right: 10px;
    }
    & > aside {
      width: 300px;
      background: var(--main-bg);
      border: 1px solid var(--main-border);
      padding: 10px;
      flex-shrink: 0;

      .one-line {
        line-height: 1.75rem;
      }
      .one-line.right {
        text-align: right;
      }
      h6 {
        font-size: 1rem;
        margin-top: 10px;
        margin-bottom: 0px;
        line-height: 1.75rem;
      }
      table {
        width: 100%;
        border-spacing: 0px;
      }
      td {
        padding: 0 0 4px 0;
      }
      td.right {
        text-align: right;
      }
      .title-pull {
        display: flex;

        h6 {
          height: 28px;
          display: inline-block;
          flex-grow: 1;
          text-align: left;
        }
        .pull {
          height: 28px;
          display: inline-block;
          margin-top: 10px;
          flex-grow: 1;
          text-align: right;
          font-size: 14px;
          line-height: 28px;
        }
      }
      p.mini-note {
        font-size: 80%;
        color: #666;
        font-style: italic;
      }
    }
    h1 {
      font-size: 32px;
    }
    img {
      max-width: 100%;
    }

  }

  table.listing td,
  table.listing th {
    padding: 0 10px 5px 0;
  }

  .required {
    vertical-align: super;
    font-size: 7px;
    text-transform: uppercase;
    color: red;
    font-style: italic;
  }

  /*
  .validate:valid {
    border-color: lime !important;
  }
  .validate:invalid {
    border-color: red !important;
  }
  */
  .validation-error {
    border: 1px solid red;
    padding: 2px 6px;
    background-color: #fff6f6;
    margin: 0 0 10px 0;
  }
  #tags {
    margin: 0 0 10px 0;
  }

  #rfc-markdown {
    & > * {
      position: relative;
    }

    p {
      padding: 0px;
      margin: 0 0 10px 0;
      line-height: 1.5em;
    }
    pre code {
      display: block;
      overflow-x: auto;
      overflow-y: hidden; /* prevents scrolljacking */
    }
    .rcx, .rcc {
      width: 16px;
      height: 16px;
      position: absolute;
      top: calc(50% - 8px);
      cursor: pointer;
      border-radius: 9px;
      border: 1px solid black;
      font-size: 11px;
      text-align: center;
      line-height: 16px;
      font-weight: normal;
      font-family: sans-serif;
    }
    .rcx {
      display: none;
      background-color: lime;
      right: 32px;
    }
    .rcc {
      display: inline-block;
      background-color: pink;
      right: 8px;
    }
    & > *:hover .rcx {
      display: inline-block;
    }
    /* highlight entire block when hovering on (+) */
    & > *:has(.rcx:nth-of-type(1):hover),
    & > *:has(.rcx:nth-of-type(2):hover) {
      background-color: #ffc;
    }
    .show {
      display: inline-block;
    }
  }
}

footer {
  text-align: center;
  color: var(--subtle-text);
  background: var(--main-bg);
  border-top: 1px solid var(--main-border);
  position: fixed;
  bottom: 0;
  width: 100%;
  font-size: 14px;
  height: var(--footer-height);
  line-height: var(--footer-height);
}

dialog {
  padding: 10px 10px 0 10px;
  border-radius: 10px;
  background: var(--main-bg);
  border: 1px solid var(--main-border);
  box-shadow: 0px 5px 20px #0003;

  .row {
    padding-bottom: 10px;
  }
  .row.content {
    line-height: 1.5em;
  }
  textarea {
    width: 400px;
    height: 100px;
  }
  label {
    color: var(--subtle-text);
  }
  .comments {
    width: 400px;
  }
  .when {
    color: var(--subtle-text);
    font-size: 13px;
  }
  .comment-section {
    border-bottom: 1px solid var(--main-border);
    margin-bottom: 10px;
    position: relative;

    &.dismissed {
      opacity: 0.5;
    }

    .dismisser {
      position: absolute;
      top: 10px;
      right: 10px;
      font-size: 10px;
      line-height: 15px;
      cursor: pointer;
    }
  }
}

.rfc-status,
.rfc-visibility {
  border-width: 2px;
  border-style: solid;
  padding: 0 6px;
  border-radius: 14px;
  font-size: 13px;
  font-family: monospace;
  font-weight: bold;
  line-height: 1.5em;
  display: inline-block;
}

.rfc-status {
  color: white;

  &.draft {
    border-color: #d1b514;
    background-color: #d1c169;
  }
  &.review {
    border-color: #d15614;
    background-color: #d18d69;
  }
  &.published {
    border-color: #4fd114;
    background-color: #89d169;
  }
  &.obsolete {
    border-color: #3c14d1;
    background-color: #7f69d1;
  }
  &.deleted {
    border-color: #d11452;
    background-color: #d1698b;
  }
}

.rfc-visibility {
  color: black;

  &.watchers-only {
    border-color: #14d1d0;
    background-color: #69d1d0;
  }
  &.org-wide {
    border-color: #d114bd;
    background-color: #d169c6;
  }
  &.public {
    border-color: #1442d1;
    background-color: #6982d1;
  }
}

p.warning {
  border: 1px solid #d1b514;
  background-color: #d1c169;
  border-radius: 10px;
  padding: 2px 8px;
}
p.attention {
  border: 1px solid #d15614;
  background-color: #d18d69;
  border-radius: 10px;
  padding: 2px 8px;
}
p.ok {
  border: 1px solid #144dd1;
  background-color: #6983d1;
  border-radius: 10px;
  padding: 2px 8px;
}

#flash-messages {
  font-size: 14px;
  .message {
    padding: 5px 10px;
    border-bottom-width: 1px;
    border-bottom-style: solid;
    font-style: italic;
  }
  .warning {
    background-color: #fee;
    color: #f00;
    border-color: #fcc;
  }
  .success {
    background-color: #efe;
    color: #090;
    border-color: #9f9;
  }
  .neutral {
    background-color: #eee;
    color: #666;
    border-color: #ccc;
  }
}

/* parent needs position relative */
.simple-float-create {
  background: var(--main-bg);
  border: 1px solid var(--main-border);
  position: absolute;
  top: 10px;
  right: 10px;
  padding: 10px;
  text-align: right;
  border-radius: 10px;
  button {
    margin-left: 10px;
  }
}

.toolbar {
  text-align: right;
}

/*
 * SCREEN SPECIFIC STYLES
 */

main.screen-home {
  max-width: 800px;
}

main.screen-profile {
  .avatar {
    float: left;
    width: 82px;
    height: 82px;
    margin-right: 10px;
    border-radius: 82px;
  }

  #list-rfcs {
    clear: left;
  }
}

main.screen-rfc-status {
  table.status-change {
    margin-bottom: 100px;

    .current {
      padding-top: 10px;
      font-size: 13px;
    }
    td {
      padding: 0 50px;
      vertical-align: top;
      text-align: center;
    }
    span.rfc-status {
      cursor: not-allowed;
    }
  }
}

main.screen-org-tags,
main.screen-org-view {
  position: relative;
}

main.screen-rfc-new,
main.screen-rfc-editor {
  #input-content,
  #input-name {
    font-family: monospace;
    width: 1000px;
    padding: 2px;
    border: 1px solid #ccc;
  }
  #markdown-wysiwyg {
    position: relative;
    width: 1000px;
    height: 400px;
    padding: 2px;
    border: 1px solid #ccc;
  }
  textarea.hidden {
    display: none;
  }
}
