/* Button */

.button__link {
  position: relative;
  width: fit-content;
  display: block;
  align-items: center;
  gap: 14px;
  margin: 20px auto;
  padding: 10px 15px;
  color: var(--ublo-grey-000, #ffffff);
  font-size: 16px;
  font-weight: 700;
  text-align: center;
  background-color: var(--ublo-secondary-color, #4177f6);
  border-radius: var(--ublo-radius-200, 8px);
  cursor: pointer;
  user-select: none;
  transition: background-color 160ms cubic-bezier(0.4, 0, 0.2, 1);
}

.button__link .button__text {
  color: var(--ublo-grey-000, #ffffff);
}

.button__link:is(:disabled, [disabled]) {
  background-color: var(--ublo-grey-500, #383838);
  cursor: not-allowed;
}

.button__link:not(:disabled, [disabled]):hover {
  background-color: var(--ublo-primary-color, #073ff8);
}

.button:not(.button--with-icon) .button__link .button__icon {
  display: none;
}

/* Iframe */

.iframe {
  grid-column: 1 / -1;
  margin: 25px 0;
}

.iframe__inner {
  position: relative;
  min-height: 30px;
  border-radius: var(--ublo-radius-200, 8px);
  overflow: hidden;
}

.iframe--16-9 .iframe__inner {
  padding-bottom: 56.25%;
}

.iframe--16-9 iframe {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
}

/* Image */

.image {
  width: 100%;
  clear: both;
}

.image img {
  width: 100%;
  border: 1px solid var(--ublo-grey-200, #ededed);
  border-radius: var(--ublo-radius-200, 8px);
  vertical-align: middle;
}

/* Rich text */

.rich-text {
  color: var(--ublo-grey-600, #1b1b1b);
}

.rich-text__inner {
  line-height: 1.6;
}

.rich-text--with-image .rich-text__inner {
  display: inline;
}

.rich-text__inner :is(ul, ol) {
  margin: 8px 0 8px 20px;
}

.rich-text__inner li {
  margin-bottom: 4px;
}

.rich-text__image {
  float: left;
  margin-right: 18px;
}

.rich-text--right-aligned-image .rich-text__image {
  float: right;
  margin-left: 18px;
}

.rich-text--one-third-image .rich-text__image {
  width: 33.33%;
}

.rich-text--half-image .rich-text__image {
  width: 50%;
}

.rich-text__image img {
  width: 100%;
  max-width: 100%;
  border: 1px solid var(--ublo-grey-200, #ededed);
  border-radius: var(--ublo-radius-200, 8px);
  vertical-align: middle;
}

/* Spacer */

.spacer {
  clear: both;
  grid-column: 1 / -1;
  position: relative;
  width: 100%;
  height: 25px;
  margin: 0 auto;

  @media (width >= 992px) {
    height: 50px;
  }
}

.cms--editing .spacer:hover::after {
  content: "Bloc vide : 25px de hauteur sur téléphone, 50px sur ordinateur";
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  line-height: 1;
  color: hsl(var(--grey-700));
  text-align: center;
  background: linear-gradient(
    135deg,
    rgba(0, 0, 0, 0.1) 12.5%,
    transparent 0,
    transparent 50%,
    rgba(0, 0, 0, 0.1) 0,
    rgba(0, 0, 0, 0.1) 62.5%,
    transparent 0,
    transparent
  );
  background-size: 5.66px 5.66px;
  box-sizing: border-box;
  pointer-events: none;
}

.spacer--small {
  height: 10px;

  @media (width >= 992px) {
    height: 20px;
  }
}

.cms--editing .spacer--small:hover::after {
  content: "Petit bloc vide : 10px de hauteur sur téléphone, 20px sur ordinateur";
}

.spacer--big {
  height: 50px;

  @media (width >= 992px) {
    height: 100px;
  }
}

.cms--editing .spacer--big:hover::after {
  content: "Grand bloc vide : 50px de hauteur sur téléphone, 100px sur ordinateur";
}

/* Title */

.title-2 {
  font-size: 26px;
  font-weight: 700;
  color: var(--ublo-grey-600, #1b1b1b);
  margin-top: 10px;
  margin-bottom: 10px;
}

.title-3 {
  font-size: 22px;
  font-weight: 400;
  color: var(--ublo-grey-600, #1b1b1b);
  margin-top: 6px;
  margin-bottom: 6px;
}

:is(.title-2, .title-3) {
  clear: both;
}

:is(.title-2, .title-3):first-child {
  margin-top: 0;
}

:is(.title-2, .title-3):last-child {
  margin-bottom: 0;
}

/* Video */

.video {
  grid-column: 1 / -1;
  width: 100%;

  @supports (aspect-ratio: 16 / 9) {
    aspect-ratio: 16 / 9;
  }
}

.video__content {
  position: relative;
  height: 100%;

  @supports not (aspect-ratio: 16 / 9) {
    position: relative;
    height: 0;
    padding-bottom: calc(9 / 16 * 100%);
  }
}

.video__content:empty {
  background-color: var(--ublo-grey-200, #ededed);
  border-radius: var(--ublo-radius-200, 8px);
}

.video__content:empty::before {
  content: "";
  position: absolute;
  top: calc(50% - 30px);
  left: calc(50% - 30px);
  width: 60px;
  height: 60px;
  background-color: var(--ublo-primary-color, #073ff8);
  border-radius: 50%;
}

.video__content:empty::after {
  content: "";
  position: absolute;
  top: calc(50% - 8px);
  left: calc(50% - 4px);
  width: 0;
  height: 0;
  border-top: 8px solid transparent;
  border-bottom: 8px solid transparent;
  border-left: 10px solid #fff;
}

.video__content iframe {
  width: 100%;
  height: 100%;
  border-radius: var(--ublo-radius-200, 8px);

  @supports not (aspect-ratio: 16 / 9) {
    position: absolute;
    top: 0;
    left: 0;
  }
}
