/* ==========================================================================
   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 {
  display: none;
}

/* ==========================================================================
   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);
      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 {
  position: relative;
  margin-bottom: var(--space-l);
  overflow: hidden;

  &:before {
    content: "";
    position: absolute;
    bottom: 0;
    right: -11px;
    z-index: 5;
    width: 70px;
    height: 150px;
    background: var(--color-fg-primary);
    transform: skew(-38deg);
  }
  img {
    border-radius: var(--border-radius-xl);
  }
}

/* ==========================================================================
   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;
}

/* ==========================================================================
   Footer.
   ========================================================================== */
.block--footer {
  display: flex;
  align-items: center;
  margin-bottom: var(--space-l);

  .item-logo {
    margin-right: 80px;

    svg {
      display: block;
    }
  }
  .nav-menu {
    display: flex;
    align-items: center;
    margin: 0;
    list-style: none;
  }
  .nav-item {
    + .nav-item {
      margin-left: var(--gutter-m);
    }
  }
}

/* ==========================================================================
   Contact.
   ========================================================================== */
.block--contact {
  a {
    position: relative;
    z-index: 5;
    display: inline-block;
    padding: 0;
    background: var(--color-bg);
    border: 1px solid var(--color-fg-primary);
    border-radius: 50%;

    &:hover,
    &:focus {
      .icon {
        color: var(--color-bg);
        background-color: var(--color-fg-primary);
      }
    }
  }

}

.icon {
  --icon-size: 42px;
  border-radius: 50%;
  transition: .1s;

  &:before {
    background-color: var(--color-fg-primary);
  }
}

/* ==========================================================================
   Block SlideShow.
   ========================================================================== */
.block--slideshow {
  margin-top: calc(var(--space-m) * -1);
  margin-left: calc(var(--gutter-m) * -1);
  margin-right: calc(var(--gutter-m) * -1);
  padding: 0;
}
.route--layout-builder-overrides-node-view .block--slideshow {
  visibility: visible;
}

/* ==========================================================================
   Rich text.
   ========================================================================== */
.block--richtext {
  /* List.
     ========================================================================== */
  & > div > ul.nav-menu,
  ul:not([class]),
  ol:not([class]) {
    /* Responsive.
       ========================================================================== */
    @media screen and (min-width: 48em) {
      margin-left: var(--gutter-l);

    }

    ul,
    ol {
      margin: .5em 0 0 var(--gutter-l);
    }
    li {
      position: relative;
      margin-bottom: .5em;
      list-style: none;

      &:before {
        margin-right: .4em;
        color: var(--color-fg-primary);
      }
    }
  }
  & > div > ul.nav-menu,
  ul:not([class]) {
    list-style: disc inside;

    li {
      &:before {
        content: "•";
      }
    }
  }
  ol:not([class]) {
    list-style: none;
    counter-reset: decimal;

    & > li {
      counter-increment: decimal;

      &:before {
        content: counter(decimal)".";
      }
    }
  }

  /* Media.
     ========================================================================== */
  .item-media {
    position: relative;

    a {
      position: relative;
    }
  }
  .icon {
    margin-right: var(--gutter-xs);
  }

  /* Text.
     ========================================================================== */
  h2,
  h3,
  h4 {
    &:not(:first-child) {
      margin-top: .5em;
    }
  }

  .btn {
    margin: 0;

    + .btn {
      margin-left: var(--gutter-xs);
    }
  }

  /* Table.
     ========================================================================== */
  table {
    max-width: 100%;
    margin: var(--space-l) auto var(--space-xl);
    border-collapse: collapse;
    border-spacing: 0;
    font-size: var(--font-size-s);
    overflow: hidden;

    p {
      margin: 0;
    }

    caption {
      margin-bottom: var(--space-l);
      font-style: italic;
    }

    th,
    td {
      vertical-align: middle;
      padding: var(--space-s) var(--space-xl);

      & + & {
        border-left: 1px solid var(--color-bg);
      }
    }
    th {
      color: var(--color-white);
      vertical-align: bottom;
      background: var(--color-bg-tertiary);
    }
    thead {
      font-family: var(--font-family-heading);
      color: var(--color-white);

      &,
      a {
        color: var(--color-white);
      }
    }
    tbody {
      td {
        background-color: transparent;
      }

      tr:nth-of-type(even) {
        td {
          background-color: var(--color-bg-secondary);
        }
      }
    }
  }

  /* Push.
     ========================================================================== */
  .item-push {
    &.push--primary {
      color: var(--color-text-dark);
      font-size: 24px;
      max-width: 908px;

      &.text-align-center {
        margin: 0 auto 1.6em;
      }
    }
  }

  /* Keynumber
     ========================================================================== */
  .item-keyfacts {
    padding: var(--space-xl) var(--gutter-m);

    strong,
    b {
      margin-bottom: var(--space-l);
      font-family: var(--font-family-heading);
      font-size: 3em;
      line-height: 1.3;
    }

    &.keyfacts--primary {
      color: var(--color-text-dark);
    }
    &.keyfacts--secondary {
      strong,
      b {
        color: var(--color-fg-primary);
      }
    }
  }
}
