:root {
  --nm-radius: 18px;
}

.wp-block-button__link {
  border-radius: 14px;
}

a {
  text-underline-offset: 0.18em;
}

/* =========================
   NEG’ MAWON — Layout Styles
   ========================= */

/* HEADER & FOOTER */

/* Header fixe */

header {
  position: fixed;
  top: 0;
  z-index: 5;
  background-color: var(--wp--preset--color--creme);
  width: 100%;
  height: fit-content;
  box-shadow: 0px 0px 10px rgba(0, 0, 0, 0.2);

  a {
    text-decoration: none;
  }

  .wp-block-group.is-style-nm-brand {
    gap: unset !important;

    .wp-block-group:last-child p {
      font-weight: 900;

      mark:last-child {
        font-size: 25px;
      }

      @media (max-width: 960px) {
        display: none;
      }
    }
  }

  .wp-block-navigation.is-style-nm-header-nav {
    a {
      position: relative;
      display: inline-block;
      text-decoration: none;

      &::after {
        content: "";
        position: absolute;
        left: 0px;
        background-color: var(--wp--preset--color--corail);
        opacity: 0.5;
        display: block;
        height: 0.1rem;
        transition: width 0.5s;
        width: 0;
      }

      &:hover::after {
        width: 100%;
      }
    }
  }
}

/* Footer ajuste espacement */

footer {
  margin-block-start: unset !important;

  .wp-block-cover {
    min-height: fit-content;

    .wp-block-cover__inner-container > .wp-block-group {
      min-width: 100%;

      .wp-block-columns .wp-block-column:not(:last-child) {
        border-right: 1px solid rgba(255, 251, 242, 0.25);
      }

      .wp-block-columns .wp-block-column:first-child p:first-child {
        font-weight: 900;

        mark:last-child {
          font-size: 25px;
        }
      }
    }
  }
}

:where(.wp-site-blocks) > :last-child {
  margin-block-start: 0 !important;
}

:where(.wp-site-blocks) > :nth-child(2) {
  margin-block-start: 100px !important;
}

/* =========================
   NEG’ MAWON — Block Styles
   ========================= */

/* COVER — Hero musée */
.wp-block-cover.is-style-nm-hero-musee {
  border: 1px solid rgba(35, 31, 32, 0.12);
  overflow: hidden;
  min-height: fit-content;

  @media (max-width: 782px) {
    .wp-block-column:first-child {
      display: none;
    }
  }
}

.wp-block-cover__inner-container {
  width: 100%;
  height: 100%;
}

.wp-block-cover.is-style-nm-hero-musee
  > .wp-block-cover__inner-container.has-global-padding {
  padding-top: 0 !important;
  padding-bottom: 0 !important;
}

/* COVER — Bannière musée */
.wp-block-cover.is-style-nm-banner-musee {
  overflow: hidden;

  .wp-block-group {
    .wp-block-group:first-child {
      min-width: 100%;
    }

    .wp-block-columns {
      min-width: 100%;

      .wp-block-group.is-style-nm-event .wp-block-columns {
        gap: unset !important;
      }
    }

    .wp-block-group.is-style-nm-event {
      box-shadow: 0px 0px 10px rgba(0, 0, 0, 0.2);
    }
  }

  .wp-block-column.is-style-nm-event-date {
    flex-basis: 20%;

    p {
      position: relative;
      top: -20px;
    }

    mark:first-child {
      font-size: 55px;
    }

    mark:last-child {
      margin-left: 0.5rem;
    }
  }

  .wp-block-column.is-style-nm-event-body {
    flex-basis: 80%;

    .wp-block-group p {
      margin-block-start: unset !important;
    }
  }
}

/* GROUP — Section crème */
.wp-block-group.is-style-nm-section-creme {
  padding-top: 64px;
  padding-bottom: 64px;
  background: var(--wp--preset--color--creme);
}

/* GROUP — Ruban */
.wp-block-group.is-style-nm-ruban {
  margin-block-end: -4rem;
  margin-top: 4rem;
  padding: 14px 18px;
  border-top: 1px solid rgba(35, 31, 32, 0.18);
  background: rgba(255, 251, 242, 0.65);
  /* léger voile crème */
  backdrop-filter: blur(2px);

  p::before {
    content: "";
    position: absolute;
    inset: 0;
    top: 44%;
    left: 1%;
    width: 5px;
    height: 5px;
    background-color: var(--wp--preset--color--charbon);
    transform: rotate(45deg);
  }
}

/* GROUP - A la une */
.wp-block-group.is-style-nm-a-la-une {
  overflow: hidden;

  .wp-block-columns {
    min-width: 100%;
    gap: unset !important;
    @media (max-width: 782px) {
      flex-direction: column-reverse;
    }

    .wp-block-column > .wp-block-group {
      padding-left: var(--wp--style--root--padding-left);
    }
  }
}

/* GROUP - Regard sur nos actions */
.wp-block-group.is-style-nm-regard-sur-nos-actions {
  .wp-block-group,
  .wp-block-columns {
    min-width: 100%;
    max-width: var(--wp--style--global--wide-size);
  }

  .wp-block-group.is-style-nm-timeline__item {
    border-right: 1px solid rgba(0, 0, 0, 0.25);

    .wp-block-group.is-style-nm-timeline__year {
      font-size: 32px;
    }
  }
}

/* BUTTON — contour */
.wp-block-button.is-style-nm-btn-outline {
  transition: all 0.3s ease-in-out;

  &:hover {
    flex-grow: 0.8;
  }

  .wp-block-button__link {
    background: transparent;
    color: var(--wp--preset--color--charbon);
    border: 1px solid rgba(35, 31, 32, 0.22);
    border-radius: 10px;
    transition: all 0.5s ease-in-out;

    &:hover {
      background: var(--wp--preset--color--corail);
      border-radius: 10px;
      color: var(--wp--preset--color--creme);
    }
  }
}

.wp-block-button__link {
  background: transparent;
  color: var(--wp--preset--color--charbon);
  border: 1px solid rgba(35, 31, 32, 0.22);
  border-radius: 10px;
  transition: all 0.3s ease-in-out;

  &:hover {
    background: var(--wp--preset--color--corail);
    border-radius: 10px;
    color: var(--wp--preset--color--creme);
  }
}

/* IMAGE — arrondie */
.wp-block-image.is-style-nm-image-rounded img {
  border-radius: 18px;
}

/* QUERY — grille*/
.wp-block-query.is-style-nm-grid .wp-block-post-template {
  gap: 22px;
}

/* COLUMN - Dégradé G-D Crème*/
.wp-block-column.is-style-nm-fade-l-r::before {
  content: "";
  position: absolute;
  inset: 0;
  left: 50%;
  width: 100px;
  height: 100%;
  background: linear-gradient(
    270deg,
    rgba(255, 251, 242, 0) 0%,
    rgba(255, 251, 242, 0.51) 50%,
    rgba(255, 251, 242, 1) 100%
  );

  @media (max-width: 782px) {
    content: none;
  }
}

/* COLUMN - Dégradé G-D Vert */
.wp-block-column.is-style-nm-fade-l-r-green::before {
  content: "";
  position: absolute;
  inset: 0;
  left: 50%;
  width: 100px;
  height: 100%;
  background: linear-gradient(
    90deg,
    rgba(3, 148, 70, 1) 0%,
    rgba(3, 148, 70, 0.5) 50%,
    rgba(3, 148, 70, 0) 100%
  );

  @media (max-width: 782px) {
    content: none;
  }
}

/* COLUMN - Dégradé D-G */
.wp-block-column.is-style-nm-fade-r-l::after {
  content: "";
  position: absolute;
  inset: 0;
  left: calc(50% - 100px);
  width: 100px;
  height: 100%;
  background: linear-gradient(
    90deg,
    rgba(255, 251, 242, 0) 0%,
    rgba(255, 251, 242, 0.51) 50%,
    rgba(255, 251, 242, 1) 100%
  );

  @media (max-width: 782px) {
    content: none;
  }
}

/* COLUMN - Show more */
.wp-block-column.is-style-nm-show-more {
  .wp-block-group.is-style-nm-show-more__item p {
    max-height: 0;
    opacity: 0;
    overflow: hidden;
    transition:
      max-height 0.5s ease,
      opacity 0.4s ease;
  }

  .wp-block-group.is-style-nm-show-more__item::before {
    content: "...";
    display: inline-block;
    padding: 2px 10px;
    color: var(--wp--preset--color--corail);
    border: 1px solid rgba(35, 31, 32, 0.22);
    border-radius: 10px;
    position: absolute;
    left: 50%;
    top: 100%;
    transform: translate(-50%, -50%);
    transition: opacity 0.3s ease;
  }

  &:hover .wp-block-group.is-style-nm-show-more__item p {
    max-height: 500px;
    opacity: 1;
  }

  &:hover .wp-block-group.is-style-nm-show-more__item::before {
    opacity: 0;
  }
}
