/* ==========================================================================
   Block.
   ========================================================================== */
.block {
  padding-top: var(--space-xl);
  padding-bottom: var(--space-xl);
  box-sizing: border-box;

  &.l-narrow {
    padding-top: 0;
    padding-bottom: 0;
  }

  .block--view {
    margin-bottom: 0;
    padding: 0;
  }
}

.block--view {
  padding: 0;
}

.block--embed-legend {
  padding-bottom: 0;
  font-size: var(--font-size-s);
}

.block-empty {
  margin: 10px;
  padding: 30px;
  font-family: monospace;
  font-size: var(--font-size-s);
  text-align: center;
  text-transform: uppercase;
  background: rgba(255, 255, 255, .75);
  border: 1px dashed var(--color-border);
  border-radius: 2px;

  .empty {
    display: block;

    &:before {
      content: "<";
    }

    &:after {
      content: "/>"
    }

    + .empty {
      margin-top: var(--space-xxs);
    }
  }
}

/* ==========================================================================
   Copyright.
   ========================================================================== */
.block--copyright {
  padding: 0;
  color: var(--color-fg-primary);
  font-family: var(--font-family-secondary-heading);
  font-size: var(--font-size-s);

  a {
    &:active,
    &.is-active,
    &:focus,
    &:hover {
      color: inherit;
    }
  }
}

/* ==========================================================================
   Nav siblings.
   ========================================================================== */
.block--nav-siblings {
  .nav {
    &:before {
      content: "";
      display: block;
      width: 180px;
      height: 2px;
      margin: 0 0 var(--space-xl);
      background-color: var(--color-fg-primary);
    }
  }
}

/* ==========================================================================
   Notifications.
   ========================================================================== */
.block--user-notifications {
  .nav--dropdown {
    .nav-content {
      padding: 0;
      width: 300px;
    }

    .item-header {
      display: flex;
      align-items: center;
      justify-content: space-between;
      padding: 12px 16px;
      background-color: rgb(253, 253, 253);
      border-bottom: 1px solid var(--color-bg-secondary);
    }

    .item-header-title {
      color: var(--color-text-dark);
    }

    .item-header-action {
      color: var(--color-fg-primary);
      font-family: var(--font-family-secondary);
      background: none;

      &:not([disabled]):hover {
        text-decoration: underline;
      }

      &[disabled] {
        opacity: .5;
        cursor: default;
      }
    }

    .nav-menu {
      flex-direction: column;
      padding: 15px 16px 6px;
    }

    .item-unread-count {
      position: absolute;
      top: 0;
      right: 0;
      z-index: 5;
      width: 20px;
      height: 20px;
      line-height: 20px;
      color: var(--color-bg);
      font-size: var(--font-size-xs);
      text-align: center;
      background: var(--color-fg-error);
      border-radius: 50%;
    }

    .notification-message {
      font-size: var(--font-size-m);
      line-height: 1.2;
      margin-bottom: 4px;

      a {
        display: inline;
        font-size: var(--font-size-m);
      }
    }

    .notification-time {
      margin-bottom: var(--space-s);
      color: var(--color-text-light);
      font-size: var(--font-size-xs);
    }
  }
}

/* ==========================================================================
   Space (blank line).
   ========================================================================== */
.block--space {
  position: absolute;
  width: 100%;

  &:before {
    content: "Saut de page";
    display: none;
    position: absolute;
    top: -10px;
    left: 30px;
    padding: 0 10px 0 5px;
    font-style: italic;
    font-size: var(--font-size-s);
    background-color: var(--color-bg);
  }

  &:after {
    content: "";
    display: none;
    border-bottom: 1px dashed var(--color-border);
  }

  /* Quick action button.
     ========================================================================== */
  a[data-action] {
    position: absolute;
    z-index: 5;
    top: -20px;
    right: -30px;
    padding: 10px;

    .icon:before {
      color: var(--color-fg-error);
    }
  }

  /* Layout builder.
     ========================================================================== */
  .layout-builder & {
    position: relative;
    margin-top: var(--space-xl);
    height: var(--space-xxl);
  }

  /* Preview.
     ========================================================================== */
  &.l-preview {
    &:before {
      color: var(--color-fg-error);
    }

    &:after {
      border-color: var(--color-fg-error);
    }
  }

  /* States.
     ========================================================================== */
  .page--print &,
  .layout-builder__section & {
    &:before,
    &:after {
      display: block;
    }
  }
}

/* ==========================================================================
   Media: image.
   ========================================================================== */
.block--image {
  margin-bottom: var(--space-l);

  img {
    border-radius: 4px;
  }
}

/* ==========================================================================
   Media: documents.
   ========================================================================== */
.block--documents {
  .l-wrapper {
    justify-content: center;
  }

  .media {
    padding-left: var(--gutter-xs);
    padding-right: var(--gutter-xs);
    margin-bottom: var(--space-l);
    width: 220px;
  }


  /* Responsive.
     ========================================================================== */
  @media screen and (min-width: 48em) {
    .l-wrapper {
      justify-content: flex-start;
    }
  }
}

/* ==========================================================================
   Media: video.
   ========================================================================== */
.block--video {
  position: relative;

  .item-image {
    cursor: pointer;

    &:hover,
    &:focus {
      .icon {
        transform: translate(-50%, -50%) scale(1.1);
      }
    }

    .icon {
      display: block;
      position: absolute;
      z-index: 5;
      top: 50%;
      left: 50%;
      transform: translate(-50%, -50%);
      --icon-size: 48px;
      width: 80px;
      height: 80px;
      background-color: rgba(0, 0, 0, .5);
      border-radius: 50%;
      transition: transform .3s;

      &:before {
        position: absolute;
        z-index: 5;
        top: 50%;
        left: 56%;
        transform: translate(-50%, -50%);
        width: var(--icon-size);
        height: var(--icon-size);
        background-color: var(--color-white);
      }
    }

    img {
      width: 100%;
    }
  }
}

/* ==========================================================================
   Global search.
   ========================================================================== */
.block--search-global {
  .nav--dropdown {
    .nav-content {
      position: fixed;
      z-index: 200;
      top: 0;
      right: 0;
      bottom: 0;
      left: 0;
      padding: 0;
      width: 100%;
      height: 100%;
      max-height: none;
      background: rgba(0, 0, 0, .3);
      transform: none;
      transition: background-color .25s ease-out;
      box-shadow: none;
      transition: .6s;
    }

    &.is-open {
      .search-sidebar {
        transform: translateX(-100%);
      }
    }
  }

  .search-sidebar {
    position: absolute;
    top: 0;
    left: 100%;
    bottom: 0;
    background: var(--color-bg);
    transform: translateX(0);
    min-width: 400px;
    width: 33vw;
    box-shadow: 0 10px 20px rgba(0, 0, 0, .1);
    transition: transform .3s;

    .toolbar-fixed & {
      padding-top: 78px;
    }
  }

  .search-result {
    overflow: auto;
    height: calc(100% - 173px);
  }
}

/* ==========================================================================
   Last events.
   ========================================================================== */
.block--last-events {
  .item-footer {
    margin-bottom: var(--space-l);
    text-align: center;

    a {
      min-width: 200px;
    }
  }
}

/* ==========================================================================
   Page summary.
   ========================================================================== */
.block--nav-summary {
  display: none;

  /* Responsive.
     ========================================================================== */
  @media screen and (min-width: 100em) {
    display: block;
    position: fixed;
    top: 50vh;
    left: var(--gutter-xl);
    z-index: 20;
    transform: translateY(-50%);
    margin-top: var(--header-height);
    width: 12%;
    max-height: 58vh;
    font-size: var(--font-size-s);
    overflow-y: auto;
    transition: left .2s;

    .l-menu-dashboard & {
      left: calc(var(--sidebar-width) + var(--gutter-xl));
    }
    .l-menu-dashboard-open & {
      left: calc(var(--sidebar-width-open) + var(--gutter-m));
    }
    .l-wide-page & {
      display: none;
    }
  }
}

/* ==========================================================================
   User login.
   ========================================================================== */
.block--user-login {
  .form {
    padding: var(--space-l) 0 var(--space-xl);
  }

  .form-actions,
  .form-secondary-link {
    text-align: center;
  }
}

/* ==========================================================================
   Menu reference.
   ========================================================================== */
.block--menu-reference {
  margin-bottom: var(--space-m);
}

/* ==========================================================================
   Sticky events.
   ========================================================================== */
.block--sticky-event {
  padding: 0;
}
