/*
 * Idasso CSS preparation.
 * Module de theme charge pendant la recette IdAsso.
 */

/* Dashboard home, summary cards and status blocks. */

.idasso {
  /* FLAG: Tableau de bord */

  #tableau-de-bord .header {
    display: flex;
    flex-direction: column;
    gap: 2rem;
  }
  #tableau-de-bord .header .subblock {
    display: flex;
    flex-direction: column;
    gap: 1.25rem;
  }
  #tableau-de-bord .header .subblock .title-subtitle {
    display: flex;
    flex-direction: column;
    gap: 0.625rem;
  }

  #tableau-de-bord .header .subblock .grp-work {
    font-size: 1.125rem;
    font-style: normal;
    font-weight: 500;
    line-height: 1.6875rem;
  }
  #tableau-de-bord .header .subblock .grp-work span {
    font-weight: 700;
  }
  #tableau-de-bord .header .subblock:nth-last-of-type(1) {
    flex-direction: row;
    align-items: center;
    gap: 2.625rem;
    color: var(--color-error);
    font-style: italic;
  }
  /* Gutenberg or legacy plugin styles may set a color directly on paragraphs. */
  #tableau-de-bord .header .subblock:nth-last-of-type(1) > :not(.icon-alert),
  #tableau-de-bord
    .header
    .subblock:nth-last-of-type(1)
    > :not(.icon-alert)
    :is(p, span, strong, em) {
    /* The Gutenberg IdAsso - Texte block deliberately uses !important so
     * its configured typography survives the legacy cascade. The warning
     * message is semantic and must always keep the IdAsso error colour. */
    color: var(--color-error) !important;
  }
  #tableau-de-bord .header .icon-alert {
    width: 2.1875rem;
    height: 2.1875rem;
    position: relative;
  }
  #tableau-de-bord .header .icon-alert::after {
    content: "";
    width: 2.1875rem;
    height: 2.1875rem;
    background: url(../../icons/icon-attention.svg);
    position: absolute;
    top: 0;
    background-size: cover;
    background-repeat: no-repeat;
    background-position: center;
  }

  #tableau-de-bord h2,
  #tableau-de-bord h2 a {
    position: relative;
    display: flex;
    align-items: center;
    gap: 1.5rem;
    transition: all 0.3s ease-in-out;
  }

  #tableau-de-bord h2 a:hover {
    color: var(--color-hover);
  }
  #tableau-de-bord h2 a::after {
    content: "";
    display: inline-block;
    width: 1.5rem;
    height: 1rem;
    -webkit-mask: url("../../icons/icon-fleche-lien.svg") center / contain
      no-repeat;
    mask: url("../../icons/icon-fleche-lien.svg") center / contain no-repeat;
    background-color: var(--color-bouton);
    transition: background-color 0.3s ease-in-out;
  }
  #tableau-de-bord h2 a:hover::after {
    background-color: var(--color-hover);
  }
  #tableau-de-bord .block {
    display: flex;
    flex-direction: column;
    gap: 1.75rem;
    padding: 0;
    margin-top: 3.5rem;
  }
  #tableau-de-bord .block:has(.status),
  #tableau-de-bord .header.block {
    margin-top: 0;
  }

  /* A status is also a .block in the plugin markup. Restore the alert layout
   * after the dashboard's generic .block rule has set a column direction. */
  #tableau-de-bord .block.status {
    display: flex;
    flex-direction: row;
    align-items: center;
    gap: 2rem;
    padding: 2rem 2.75rem;
  }

  #tableau-de-bord .block.status .info-text {
    flex: 1 1 20rem;
  }

  #tableau-de-bord .block.status > .btn {
    flex: 0 0 auto;
  }

  @media (max-width: 61.1875rem) {
    #tableau-de-bord .block.status {
      flex-direction: column;
      align-items: center;
    }

    #tableau-de-bord .block.status .info-text {
      flex-basis: auto;
    }
  }

  #tableau-de-bord .second-block {
    display: flex;
    flex-direction: column;
    gap: 1.75rem;
    padding: 0;
    margin-top: 3.5rem;
  }

  #tableau-de-bord .grid-custom {
    display: grid;
    grid-template-columns: repeat(1, 1fr);
    grid-template-rows: auto;
    grid-column-gap: 42px;
    grid-row-gap: 42px;
    grid-auto-rows: minmax(100px, auto);
  }
  #tableau-de-bord .grid-custom .subblock {
    border-radius: var(--border-radius);
    border: 1px solid var(--color-border);
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    gap: 1.5rem;
    padding: 4rem 2rem 3rem;
  }

  @media (hover: hover) and (pointer: fine) {
    /* Dashboard cards use the same interaction as the public home cards. */
    #tableau-de-bord .grid-custom .subblock,
    #tableau-de-bord :is(.media, .event, .swiper-slide.annonce) {
      position: relative;
      transform-origin: center;
      transition:
        filter 220ms ease,
        transform 220ms ease;
    }

    /* #tableau-de-bord
      .grid-custom
      .subblock:hover:not(
        :has(:is(.media, .event, .swiper-slide.annonce):hover)
      ), */
    #tableau-de-bord :is(.media, .event, .swiper-slide.annonce):hover {
      filter: brightness(1.025);
      transform: scale(1.03);
      z-index: 2;
    }
  }
  #tableau-de-bord .grid-custom .subblock .header {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    align-items: flex-start;
    padding: 0;
    position: relative;
  }
  #tableau-de-bord .grid-custom .subblock .header .state {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    width: 100%;
  }

  @media (min-width: 455px) {
    #tableau-de-bord .grid-custom .subblock .header .state {
      position: absolute;
      top: 25%;
      right: 0;
      transform: translateY(-50%);
    }
  }
  #tableau-de-bord .grid-custom .subblock .header .state .online {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.25rem 1.5rem;
    background: var(--idasso-color-surface-muted);
    border-radius: 1.5625rem;
    font-size: 1rem;
    font-style: normal;
    font-weight: 400;
    line-height: 1.6875rem;
  }
  #tableau-de-bord .grid-custom .subblock .header .state .online::after {
    content: "";
    display: block;
    width: 1.125rem;
    height: 1.125rem;
    background: var(--color-success);
    border-radius: 1.5625rem;
  }
  #tableau-de-bord .grid-custom .subblock .header .state .online span {
    display: block;
    width: 1.125rem;
    height: 1.125rem;
    background: var(--color-success);
    border-radius: 1.5625rem;
  }
  #tableau-de-bord .grid-custom .subblock .header .state .offline {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.25rem 1.5rem;
    background: var(--idasso-color-surface-muted);
    border-radius: 1.5625rem;
    font-size: 1rem;
    font-style: normal;
    font-weight: 400;
    line-height: 1.6875rem;
  }
  #tableau-de-bord .grid-custom .subblock .header .state .offline::after {
    content: "";
    display: block;
    width: 1.125rem;
    height: 1.125rem;
    background: var(--color-error);
    border-radius: 1.5625rem;
  }
  #tableau-de-bord .grid-custom .subblock .header .state .offline span {
    display: block;
    width: 1.125rem;
    height: 1.125rem;
    background: var(--color-error);
    border-radius: 1.5625rem;
  }
  #tableau-de-bord .grid-custom .subblock .grp-btn {
    display: flex;
    flex-direction: column-reverse;
    gap: 1rem;
    align-items: flex-start;
  }
  #tableau-de-bord .grid-custom .subblock:first-of-type .btn-fill-bleu::before {
    content: "";
    width: 1.125rem;
    height: 1.125rem;
    -webkit-mask: url("../../icons/icon-modifier-blanc.svg") center / contain no-repeat;
    mask: url("../../icons/icon-modifier-blanc.svg") center / contain no-repeat;
    background-color: currentColor;
  }
  #tableau-de-bord
    .grid-custom
    .subblock:first-of-type
    .btn-outline-bleu::before {
    content: "";
    display: inline-block;
    width: 1.125rem;
    height: 1.125rem;
    -webkit-mask: url("../../icons/icon-voir.svg") center / contain no-repeat;
    mask: url("../../icons/icon-voir.svg") center / contain no-repeat;
    background-color: currentColor;
    transition: background-color 0.3s ease-in-out;
  }

  #tableau-de-bord
    .grid-custom
    .subblock:nth-of-type(2)
    .btn-fill-bleu::before {
    content: "";
    width: 1.125rem;
    height: 1.125rem;
    -webkit-mask: url("../../icons/icon-modifier-blanc.svg") center / contain no-repeat;
    mask: url("../../icons/icon-modifier-blanc.svg") center / contain no-repeat;
    background-color: currentColor;
  }
  #tableau-de-bord
    .grid-custom
    .subblock:nth-of-type(2)
    .btn-outline-bleu::before {
    content: "";
    display: inline-block;
    width: 1.125rem;
    height: 1.125rem;
    -webkit-mask: url("../../icons/icon-telechargement-bleu.svg") center /
      contain no-repeat;
    mask: url("../../icons/icon-telechargement-bleu.svg") center / contain
      no-repeat;
    background-color: currentColor;
    transition: background-color 0.3s ease-in-out;
  }

  #tableau-de-bord
    .grid-custom
    .subblock:nth-of-type(3)
    .btn-fill-bleu::before {
    content: "";
    width: 1.125rem;
    height: 1.125rem;
    -webkit-mask: url("../../icons/icon-modifier-blanc.svg") center / contain no-repeat;
    mask: url("../../icons/icon-modifier-blanc.svg") center / contain no-repeat;
    background-color: currentColor;
  }
  #tableau-de-bord
    .grid-custom
    .subblock:nth-of-type(4)
    .btn-fill-bleu::before {
    content: "";
    width: 1.125rem;
    height: 1.125rem;
    -webkit-mask: url("../../icons/icon-modifier-blanc.svg") center / contain no-repeat;
    mask: url("../../icons/icon-modifier-blanc.svg") center / contain no-repeat;
    background-color: currentColor;
  }

  /* ---- Slides ---- */
  #tableau-de-bord .swiper-slide {
    display: flex;
    height: auto;
    opacity: 0;
    border-radius: var(--border-radius);
    border: 1px solid var(--color-border);
    overflow: hidden;
    transition: all 300ms ease;
  }
  #tableau-de-bord .swiper-slide.swiper-slide-active {
    opacity: 1;
  }

  #tableau-de-bord .swiper-slide.swiper-slide-next,
  #tableau-de-bord .swiper-slide.swiper-slide-next + .swiper-slide {
    opacity: 0;
  }

  #tableau-de-bord .swiper-slide h3 {
    padding-bottom: 0;
    transition: all 300ms ease;
    text-transform: none;
  }

  .swiper-button-next,
  .swiper-button-prev {
    position: absolute;
    top: 50%;
    width: calc(var(--swiper-navigation-size) / 44 * 27);
    height: var(--swiper-navigation-size);
    margin-top: calc(-1 * var(--swiper-navigation-size) / 2);
    z-index: 10;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50px;
  }

  #tableau-de-bord .swiper-button-next,
  #tableau-de-bord .swiper-button-prev {
    transform: translateY(-5%);
    color: var(--idasso-color-on-emphasis);
  }

  #tableau-de-bord .swiper-button-next {
    right: -32px;
  }
  #tableau-de-bord .swiper-button-prev {
    left: -32px;
  }

  #tableau-de-bord .swiper-button-next::after,
  #tableau-de-bord .swiper-button-prev::after {
    content: "";
    display: inline-block;
    width: 8px;
    height: 24px;
    -webkit-mask: url("../../icons/arrow-swiper.svg") center / contain no-repeat;
    mask: url("../../icons/arrow-swiper.svg") center / contain no-repeat;
    background-color: var(--idasso-paragraph-color);
    transition: background-color 0.3s ease-in-out;
  }

  #tableau-de-bord .swiper-button-prev::after {
    transform: rotate(180deg);
  }

  /* ---- Swiper container ---- */
  #tableau-de-bord .swiper {
    width: 100%;
    position: relative;
    overflow: visible;
    /* padding: 0 1rem; */
  }
  @media (min-width: 767px) {
    #tableau-de-bord .swiper {
      padding: 0;
    }
  }

  #tableau-de-bord .swiper .block {
    padding: 0;
  }

  #tableau-de-bord .swiper-wrapper {
    align-items: stretch;
  }

    /* Contenu des slides */
  #tableau-de-bord .swiper-slide .main {
    padding: 0.5rem 0.75rem;
  }



  /* Listes dans les slides (et dans .annonce) */
  #tableau-de-bord .swiper-slide ul,
  .swiper-slide ul {
    padding: 0 !important;
  }

  #tableau-de-bord .swiper-slide ul li,
  .swiper-slide ul li {
    list-style: none;
    display: flex;
    align-items: center;
    gap: 4px;
  }

  #tableau-de-bord .swiper-wrapper .block {
    margin-top: 0;
  }

  #tableau-de-bord .swiper-slide .text-end,
  .swiper-slide.annonce .text-end {
    /* position: absolute;
    bottom: 1rem;
    right: 1.5rem; */
    font-size: 0.875rem;
    font-weight: 400;
    color: var(--idasso-paragraph-color, var(--idasso-paragraph-color, #000));
    text-align: left;
  }

  .swiper-button-lock {
    display: none;
  }

  /* Optionnel : quand un bouton est disabled, on l’ignore visuellement */
  .swiper-button-disabled {
    opacity: 0;
    pointer-events: none;
  }

  .swiper:has(.swiper-wrapper > .swiper-slide:nth-child(n + 4))
    .swiper-button-lock {
    display: flex;
  }

  @media (max-width: 767px) {
    .swiper:has(.swiper-wrapper > .swiper-slide:nth-child(n + 2))
      .swiper-button-lock {
      display: flex;
    }
  }

   @media (min-width: 980px) {
    #tableau-de-bord .header {
      flex-direction: row;
      justify-content: space-between;
      align-items: start;
    }
    #tableau-de-bord .header .subblock:nth-last-of-type(1) {
      max-width: 30%;
    }
    #tableau-de-bord .grid-custom {
      grid-template-columns: repeat(2, 1fr);
      grid-template-rows: auto;
      grid-auto-rows: minmax(100px, auto);
    }
    #tableau-de-bord .grid-custom .subblock {
      padding: 3rem 2rem;
    }
    #tableau-de-bord .grid-custom .subblock .header .state {
      top: -5px;
      transform: translateY(0);
    }

    #tableau-de-bord .swiper-slide.swiper-slide-active,
    #tableau-de-bord .swiper-slide.swiper-slide-next,
    #tableau-de-bord .swiper-slide.swiper-slide-next + .swiper-slide {
      opacity: 1;
    }
    #tableau-de-bord .swiper-button-next {
      right: -40px;
      color: var(--idasso-paragraph-color, var(--idasso-paragraph-color, #000));
    }
    #tableau-de-bord .swiper-button-prev {
      left: -40px;
      color: var(--idasso-paragraph-color, var(--idasso-paragraph-color, #000));
    }
  }

    #tableau-de-bord .media a {
    padding: 1.75rem;
    color: var(--idasso-paragraph-color, var(--idasso-paragraph-color, #000));
  }

  @media (min-width: 980px) {
    #form_search_annuaire .element-2 {
      width: calc(100% - 1rem);
    }
  }
  .swiper-wrapper:has(.pills-grpwork) .media.swiper-slide a {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
  }
  .swiper-wrapper:has(.pills-grpwork) .media.swiper-slide .text-end {
    order: 99;
  }


 #tableau-de-bord .actupro img {
    width: 100%;
    height: 14.6875rem;
    object-fit: cover;
    object-position: center;
    margin-bottom: 0.75rem;
  }

   #tableau-de-bord .event .event-date {
    text-align: right;
    font-size: 1.5625rem;
    font-weight: 800;
    color: var(--color-declinaison1);
    padding: 0 1.375rem;
    width: 110px;
    height: auto;
    display: flex;
    align-items: center;
    border-right: 1px solid var(--color-border);
  }
  #tableau-de-bord .event .event-content {
    padding: 1rem 1rem 1rem 1.375rem;
  }
  #tableau-de-bord .event .event-content div {
    display: block;
    position: relative;
    padding-left: 24px;
  }
  #tableau-de-bord .event .event-content div i {
    position: absolute;
    left: 0;
    top: 50%;
    transform: translateY(-50%);
    width: 16px;
    height: 16px;
    background-size: cover;
  }
  @media (min-width: 767px) {
    #tableau-de-bord .swiper-slide.swiper-slide-active,
    #tableau-de-bord .swiper-slide.swiper-slide-next {
      opacity: 1;
    }
  }

    #tableau-de-bord .actupro .main {
    padding: 0 1.5rem 1.25rem;
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
  }

}