/*
 * This is a manifest file that'll be compiled into application.css, which will include all the files
 * listed below.
 *
 * Any CSS and SCSS file within this directory, lib/assets/stylesheets, vendor/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 styles
 * defined in the other CSS/SCSS files in this directory. It is generally better to create a new
 * file per style scope.
 *
 *= require_tree .
 *= require_self
 */

@import url('https://fonts.googleapis.com/css2?family=Red+Hat+Display&family=Roboto&family=Roboto+Mono&display=swap');
@import 'variables';

h1, h2, h3, h4, h5, h6 {
  font-family: $font-stack-display;
}

.post h1 {
  font-size: 1.7em;
}

.deleted-content {
  background: lighten($danger, 25%);
}

@media all and (min-width: 32rem) {
  .header--brand img {
    max-height: 1em;
  }
}

img {
  max-width: 100%;
}

a {
  overflow-wrap: break-word;
}

a.header--site-name {
  display: flex !important;
}
.header .header--item.is-complex:not(.is-mobile-menu) {
  align-items: center !important;
  display: flex !important;
}

@media all and (max-width: 73.5em) {
  .grid {
    margin-left: 0;
    margin-right: 0;
  }
}

.notice a {
  word-break: break-word;
}

.notice.is-filled a {
  color: white !important;
  font-weight: bold !important;
}

.item-list--item {
  .item-list--text-value {
    margin: 0 !important;
  }
  .item-list--number-value {
    width: 80px !important;
    margin: 0 !important;
    align-self: stretch;
    justify-content: flex-start;

    .meter {
      flex-shrink: 0;
      margin-top: 1.5rem;
    }
  }
}

/* Copied from Co-Design for compatibility purposes */
ul.pagination li.active {
  border-color:#293338;
  background-color:#3f4e56;
  box-shadow:2px 3px 2px -2px #344147;
  color:#fff;
  font-weight:600
}

ul.pagination li.active a:hover {
  background-color:transparent
}

ul.pagination li.disabled {
  box-shadow:none
}
/* *** */

.notice__dev-mode {
  font-size: 14px;
}

header {
  &.header {
    z-index: 5;
    position: relative;
    box-shadow: 0 3px 3px 0 rgba(0, 0, 0, 0.2);
  }
  &.header.sticky {
    position: sticky;
    top: 0;
  }
}

.notice a.has-font-size-larger {
  font-size: 19px;
}

img.codidact-logo {
  height: 32px;
}

hr {
  border: 0;
  border-top: 1px solid $muted-graphic;
  margin: 1.5em 0;
}

.modal {
  position: fixed !important;
  z-index: 8998;
}

.category-header--tabs-container {
  overflow-x: auto;

  @media screen and (min-width: $screen-md) {
    overflow-x: unset;
  }
}

.footnotes-sep + .footnotes {
  border-top: 0;
}

.footnotes {
  border-top: 1px solid $muted-graphic;
  font-size: 0.9em;
}


.dashboard-full-center {
  display: flex;
  justify-content: center;
  align-items: center;

  img {
    height: 1.25em;
  }
}

.inbox {
  max-width: 400px;
}

.inbox--container {
  max-height: 600px;
  overflow-y: scroll;
}

.header--container {
  align-items: center !important;
}

img {
  align-self: flex-start;
}

.droppanel {
  z-index: 3;
}

.widget .widget--body + .widget--header {
  border-top: 1px solid #d0d9dd;
}

.widget.is-tertiary .widget--body + .widget--header {
  border-top: 1px solid #9daeb7;
}

.widget .widget--body .widget--body-extra {
  margin-left: 0.75em;
}

.widget--body, .widget-body p {
  overflow-wrap: break-word;
}

pre {
  background: #f0f0f0;
  border: 0;
}

pre .hljs {
  padding: 0;
  background: inherit;
  overflow-x: unset !important;
}

.audit-log--body {
  white-space: pre-wrap;
  vertical-align: text-top;
}

table {
  border-collapse: collapse;
  padding: 4px;
  max-width: 100%;
  td {
    overflow-wrap: anywhere;
  }
}

table.is-full-width {
  width: 100%
}

table th {
  border-bottom: 3px solid #ccc;
  padding: 6px 10px;
  font-weight: 600;
  text-align: left
}

table td {
  border-bottom: 1px solid #ccc;
  padding: 6px 10px;
  text-align: left
}

table th:not(:last-child), table td:not(:last-child) {
  border-right: 1px solid #ccc
}

table.is-compact th, table.is-compact td {
  padding: 2px 6px
}

table.is-striped tr:nth-of-type(2n+1) td {
  background-color: #f6f6f6
}

table.is-with-hover tr:hover td {
  background-color: #eee
}

/* The default header size (2.5rem) is too huge for small headers. */
.header.is-small .header--brand .header--site-name {
  font-size: 2rem;
}

.notice {
  z-index: 9999;
}

/* Fix header images being stretched - https://meta.codidact.com/posts/278377 */
img.header--item-image {
  object-fit: contain;
}

.widget--header-link {
  margin: 0 0 0 0.5em;
}

mjx-assistive-mml {
  max-width: 100%;
}

mjx-container {
    overflow-x: auto;
    overflow-y: hidden;
}

kbd {
  border: {
    color: $muted-graphic;
    radius: 0.25em;
    style: solid;
    width: 1px;
  };
  font: {
    family: $font-stack-code;
    size: map-get($font-sizes, 'xxs');
  };
  margin: {
    left: 0.15em;
    right: 0.15em;
  };
  padding: {
    top: 0.1em;
    bottom: 0.1em;
    left: 0.25em;
    right: 0.25em;
  };
}
