body {
  overflow-x: hidden;
}

h1.documentFirstHeading {
  border: none;
  &:before {
    content: none;
  }
}
.public-ui {
  h1 {
    @include rem-size(font-size, 48);
  }
  h2 {
    @include rem-size(font-size, 40);
  }

  h5 {
    @include rem-size(font-size, 24);
  }
}

.documentDescription {
  @include rem-size(font-size, 24);
  margin-top: 1.5rem;
  color: $body-color;
  line-height: 2rem;
  white-space: pre-wrap;
}

a {
  cursor: pointer;

  &[href^='mailto'],
  &[target='_blank'],
  &[rel='noopener noreferreer'] {
    word-break: break-word;
  }
}

.icon.external-link {
  fill: currentColor;
  vertical-align: baseline;
}

.font-small {
  @include rem-size(font-size, 16);
}
.listing-item img {
  max-width: unset;
  margin-right: unset;
}

::selection {
  background-color: default;
}

.public-ui {
  a.btn.btn-primary {
    svg {
      fill: $primary-text;
    }
  }
}

iframe {
  max-width: 100%;
  border: none;
}

#text-body {
  .full-width {
    position: static;
    left: auto !important;
    width: 100% !important;
    max-width: 100% !important;
    margin-right: auto !important;
    margin-left: auto !important;
  }
}

.loading {
  .progress-spinner {
    margin-right: auto;
    margin-left: auto;
  }
}

/* SLATE */
.slate-editor-link {
  clear: both;

  &.btn {
    display: inline-block;
    padding: 12px 24px;
    border-radius: $btn-border-radius;
    margin: 0;
    font-weight: 600;
    text-align: center;
    text-decoration: none;
    &:hover,
    &:active {
      font-weight: 600;
    }

    &.btn-primary {
      background-color: $primary;
      color: $primary-text;
      &:hover,
      &:active {
        background-color: darken($primary, 8);
        color: $primary-text;
      }
    }
  }
}

.text-larger {
  //stile applicabile da editor Slate
  font-size: 1.75em;
}

/*icone*/
.public-ui,
* {
  .fa,
  .fas,
  .far,
  .fal,
  .fad,
  .fab {
    display: inline-block;
    -moz-osx-font-smoothing: grayscale;
    -webkit-font-smoothing: antialiased;
    font-style: normal;
    font-variant: normal;
    line-height: 1;
    text-rendering: auto;
  }

  .fa-lg {
    font-size: 1.33333em;
    line-height: 0.75em;
    vertical-align: -0.0667em;
  }

  .fa-xs {
    font-size: 0.75em;
  }

  .fa-sm {
    font-size: 0.875em;
  }

  .fa-1x {
    font-size: 1em;
  }

  .fa-2x {
    font-size: 2em;
  }

  .fa-3x {
    font-size: 3em;
  }

  .fa-4x {
    font-size: 4em;
  }

  .fa-5x {
    font-size: 5em;
  }

  .fa-6x {
    font-size: 6em;
  }

  .fa-7x {
    font-size: 7em;
  }

  .fa-8x {
    font-size: 8em;
  }

  .fa-9x {
    font-size: 9em;
  }

  .fa-10x {
    font-size: 10em;
  }

  svg.fa-icon {
    width: auto;
    fill: currentColor;
  }

  .icon.fa-icon.placeholder {
    //to prevent layout shift
    display: inline-block;
    width: auto;
    height: 1em;
    line-height: 1;
  }
}

/* io-sanita Backgrounds */

.bg-primary-lightest {
  background: var(
    --primary-lightest
  ) !important; //$bg-primary-lightest !important;
}
.bg-primary-lighter {
  background: var(
    --primary-lighter
  ) !important; //$bg-primary-lighter !important;
}

.bg-primary-dark {
  background-color: var(--primary-dark) !important; //$primary-dark !important;
}
.bg-primary-darker {
  background-color: $primary-darker !important;
}

/* Immagini flottate (align left/right): il blocco contiene solo l'immagine
   in float, quindi ha altezza in-flow = 0. In public-ui `.block` ha
   margin-bottom: 1.5rem che spinge in basso il testo che avvolge l'immagine,
   disallineando il top del testo rispetto al top dell'immagine (in edit non
   accade perché la regola è scoped .public-ui). Azzeriamo il margine per
   allineare view ed edit. */
.public-ui {
  .block.image.align.left,
  .block.image.align.right {
    margin-bottom: 0;
  }
}

/*Full-width*/
.full-width,
.ui.image img.full-width,
picture.volto-image.responsive.full-width img,
picture.volto-image.full-width img,
picture.volto-image.responsive img.full-width,
.block.image.align.full img.full-width {
  position: relative;
  right: 50%;
  left: 50%;
  width: 100vw !important;
  max-width: initial !important;
  height: auto;
  margin-right: -50vw !important;
  margin-left: -50vw !important;
  object-fit: cover;

  $toolbar-width: 80px;
  $toolbar-collapsed-width: 20px;
  $sidebar-width: 375px;
  $sidebar-collapsed-width: 20px;

  .has-toolbar & {
    left: calc(50% + calc($toolbar-width / 2));
    width: calc(100vw - $toolbar-width) !important;
  }

  .has-toolbar.has-sidebar & {
    $toolbars-width: calc($toolbar-width + $sidebar-width);
    left: calc(50% + calc($toolbars-width / 2));
    width: calc(100vw - $toolbars-width) !important;
  }

  .has-toolbar.has-sidebar-collapsed & {
    $toolbars-width: calc($toolbar-width + $sidebar-collapsed-width);
    left: calc(50% + calc($toolbars-width / 2));
    width: calc(100vw - $toolbars-width) !important;
  }

  .has-toolbar-collapsed & {
    left: calc(50% + calc($toolbar-collapsed-width / 2));
    width: calc(100vw - $toolbar-collapsed-width) !important;
  }

  .has-toolbar-collapsed.has-sidebar & {
    $toolbars-width: calc($toolbar-collapsed-width + $sidebar-width);
    left: calc(50% + calc($toolbars-width / 2));
    width: calc(100vw - $toolbars-width) !important;
  }

  .has-toolbar-collapsed.has-sidebar-collapsed & {
    $toolbars-width: calc($toolbar-collapsed-width + $sidebar-collapsed-width);
    left: calc(50% + calc($toolbars-width / 2));
    width: calc(100vw - $toolbars-width) !important;
  }
}

//table overflow mobile
@media (max-width: #{map-get($grid-breakpoints, lg)}) {
  .public-ui table.ui.table {
    display: block;
    overflow: auto;

    th {
      white-space: nowrap;
    }
  }
}

//callout (remove volto's styles)
.callout {
  max-width: none;
  padding: 0; //override volto's style
  border: none;
  border-radius: unset;
  margin: 0;
  box-shadow: none;
}

//error 404
body.page-not-found {
  .search-bar-container {
    position: relative;
  }

  #customer-satisfaction-form {
    display: none;
  }

  @media (min-width: #{map-get($grid-breakpoints, lg)}) {
    .view-wrapper {
      max-width: 50vw;
    }
  }
}

.blockquote-card.dark a {
  &,
  &:hover {
    color: $primary-text;
  }
}
