/* ── Groups ───────────────────────────────────────────── */

.wp-block-group {
    &.alignfull {
        padding-top: var(--wp--preset--spacing--xxl);
        padding-bottom: var(--wp--preset--spacing--xxl);
        margin-top: 0;
    }

    &.is-layout-constrained {
        > .wp-block-paragraph {
            max-width: 760px;
        }
    }
}

@media (max-width: 781px) {
    .page:not(.home) .entry-content > .wp-block-group.alignfull:first-child {
        padding-bottom: 0 !important;
    }
}

.wp-block-group.is-style-arrow-right-grey {
    --arrow-w: clamp(545px, calc(353px + 51vw), 1090px);
    --arrow-h: calc(var(--arrow-w) * 88 / 95);

    position: relative;
    overflow: hidden;

    > * {
        position: relative;
        z-index: 10;
    }

    &::after {
        content: '';
        position: absolute;
        top: -270px;
        right: -340px;
        width: var(--arrow-w);
        height: var(--arrow-h);
        z-index: 0;
        background-color: var(--wp--preset--color--background);
        opacity: 5%;
        -webkit-mask-image: url('../images/arrow-plain.svg');
        mask-image: url('../images/arrow-plain.svg');
        -webkit-mask-repeat: no-repeat;
        mask-repeat: no-repeat;
        -webkit-mask-size: contain;
        mask-size: contain;
        -webkit-mask-position: center;
        mask-position: center;
        transform: rotate(90deg);
        transform-origin: center;
        pointer-events: none;

        @media (max-width: 781px) {
            top: -160px !important;
            right: -200px !important;
        }
    }
}

.wp-block-group.is-style-arrowhead-accent {
    --arrow-w: clamp(285px, calc(174.1px + 29.58vw), 600px);
    --arrow-h: calc(var(--arrow-w) * 88 / 95);

    position: relative;
    overflow: visible;
  
    & > * { position: relative; z-index: 10; }
  
    &::after {
        content: "";
        position: absolute;
        top: calc(50% - (var(--arrow-h) / 2));
        right: calc(var(--arrow-w) * -0.75);
        width: var(--arrow-w);
        height: var(--arrow-h);
        z-index: 0;
        background-color: var(--wp--preset--color--accent);
        mask-image: url("../images/arrow-outline.svg");
        mask-repeat: no-repeat;
        mask-size: contain;
        mask-position: center center;
    }
  }

.wp-block-group.is-style-arrow-left-bottom-accent {
    --arrow-w: clamp(285px, calc(93.1px + 51.17vw), 830px);
    --arrow-h: calc(var(--arrow-w) * 88 / 95);
  
    position: relative;
    overflow: visible;
  
    & > * { position: relative; z-index: 10; }
  
    &::after {
      content: "";
      position: absolute;
      bottom: 0;
      left: 0;
      width: var(--arrow-w);
      height: var(--arrow-h);
      transform: translate(-36%, -3%) rotate(135deg);
      z-index: 0;
      background-color: var(--wp--preset--color--accent);
      mask-image: url("../images/arrow-outline.svg");
      mask-repeat: no-repeat;
      mask-size: contain;
      mask-position: center center;
    }
  }

.wp-block-group.is-style-arrow-right-accent {
    --arrow-w: clamp(400px, calc(259.15px + 37.56vw), 800px);
    --arrow-h: calc(var(--arrow-w) * 88 / 95);

    position: relative;
    overflow: hidden;

    > * {
        position: relative;
        z-index: 10;
    }

    &::after {
        content: '';
        position: absolute;
        top: -130px;
        right: -70px;
        width: var(--arrow-w);
        height: var(--arrow-h);
        z-index: 0;
        opacity: 50%;
        background-color: var(--wp--preset--color--accent);
        -webkit-mask-image: url('../images/arrow-outline.svg');
        mask-image: url('../images/arrow-outline.svg');
        -webkit-mask-repeat: no-repeat;
        mask-repeat: no-repeat;
        -webkit-mask-size: contain;
        mask-size: contain;
        -webkit-mask-position: center;
        mask-position: center;
        transform: rotate(-90deg);
        transform-origin: center;
        pointer-events: none;
    }
}

.wp-block-group.is-style-arrow-center-accent {
    --arrow-w: clamp(400px, calc(259.15px + 37.56vw), 800px);
    --arrow-h: calc(var(--arrow-w) * 88 / 95);

    position: relative;
    isolation: isolate;
    overflow: visible;

    > * {
        position: relative;
        z-index: 10;
    }

    &::after {
        content: '';
        position: absolute;
        top: 300px;
        left: 50%;
        right: auto;
        width: var(--arrow-w);
        height: var(--arrow-h);
        z-index: 0;
        background-color: var(--wp--preset--color--accent);
        -webkit-mask-image: url('../images/arrow-outline.svg');
        mask-image: url('../images/arrow-outline.svg');
        -webkit-mask-repeat: no-repeat;
        mask-repeat: no-repeat;
        -webkit-mask-size: contain;
        mask-size: contain;
        -webkit-mask-position: center;
        mask-position: center;
        transform: translate(-50%, -50%) rotate(-90deg);
        transform-origin: center;
        pointer-events: none;
    }
}

/* ── Bloc étapes ─────────────────────────────────────────────── */

.wp-block-group.is-style-etape {
    counter-increment: etapes;
    position: relative;
    background: var(--wp--preset--color--primary-800);
    padding: var(--wp--preset--spacing--l) !important;
    padding-top: calc(var(--wp--preset--spacing--l) + 48px + var(--wp--preset--spacing--m)) !important;
    margin-left: var(--wp--preset--spacing--xl);
}

.wp-block-group.is-style-etape:first-child {
    counter-reset: etapes;
}

.wp-block-group.is-style-etape:not(:first-child) {
    margin-top: var(--wp--preset--spacing--xl);
}

/* Badge numéroté */
.wp-block-group.is-style-etape::before {
    --etape-badge-size: 48px;
    content: counter(etapes);
    position: absolute;
    top: var(--wp--preset--spacing--l);
    width: var(--etape-badge-size);
    height: var(--etape-badge-size);
    border-radius: 50%;
    background: var(--wp--preset--color--accent);
    color: var(--wp--preset--color--text);
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: var(--wp--preset--font-family--font-heading);
    font-weight: 700;
    font-size: var(--wp--preset--font-size--md);
    z-index: 1;
}

/* Ligne + point */
.wp-block-group.is-style-etape::after {
    --etape-badge-size: 48px;
    content: '';
    position: absolute;
    top: calc(var(--wp--preset--spacing--l) + var(--etape-badge-size) / 2);
    bottom: calc(-1 * var(--wp--preset--spacing--xl) - var(--wp--preset--spacing--l) - (var(--etape-badge-size) / 2));
    left: calc((-2 * var(--wp--preset--spacing--l)) + 4px);
    width: 12px;
    background:
        radial-gradient(circle closest-side, var(--wp--preset--color--accent) 100%, transparent 100%) top center / 12px 12px no-repeat,
        linear-gradient(var(--wp--preset--color--accent), var(--wp--preset--color--accent)) center / 1px 100% no-repeat;
}

.wp-block-group.is-style-etape:last-child::after {
    bottom: auto;
    height: 12px;
}

/* ── Details (Accordéon FAQ) ────────────────────────────── */

.wp-block-details summary {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: var(--wp--preset--spacing--m);
    padding: var(--wp--preset--spacing--m) 0;
    cursor: pointer;
    list-style: none;
    border-bottom: 1px solid var(--wp--preset--color--text);
}

.wp-block-details summary::-webkit-details-marker {
    display: none;
}

.wp-block-details summary::after {
    content: '+';
    flex-shrink: 0;
    font-family: var(--wp--preset--font-family--font-heading);
    font-size: var(--wp--preset--font-size--md);
    line-height: 1;
}

.wp-block-details[open] summary::after {
    content: '\2212'; /* − */
}

.wp-block-details p {
    padding-bottom: var(--wp--preset--spacing--m);
}

/* ── Contact Form 7 ──────────────────────────────────────── */

.wpcf7-form {
    display: flex;
    flex-direction: column;

    @media (max-width: 781px) {
        gap: var(--wp--preset--spacing--l);
    }
}

.wpcf7-form .form-row {
    display: flex;
    gap: var(--wp--preset--spacing--l);

    @media (max-width: 781px) {
        flex-direction: column;
    }
}

.wpcf7-form > p,
.wpcf7-form .form-row > p {
    flex: 1 1 0;
    min-width: 240px;
    margin: 0 !important;
}

.wpcf7-form label {
    display: block;
    color: var(--wp--preset--color--text);
}

.wpcf7-form-control {
    box-sizing: border-box;
    display: block;
    width: 100%;
    margin-top: var(--wp--preset--spacing--s);
    padding: var(--wp--preset--spacing--m);
    background: transparent;
    border: 1px solid var(--wp--preset--color--accent);
    border-radius: 10px;
    color: var(--wp--preset--color--text);
    font-family: var(--wp--preset--font-family--font-body);
    font-size: var(--wp--preset--font-size--md);

    @media (max-width: 781px) {
       margin-top: 0;
    }
}

.wpcf7-form-control::placeholder {
    color: var(--wp--preset--color--text);
}

.wpcf7-form-control:focus {
    outline: none;
    border-color: var(--wp--preset--color--text);
}

textarea.wpcf7-form-control {
    min-height: 320px;
    resize: vertical;
}

select.wpcf7-form-control {
    appearance: none;
    -webkit-appearance: none;
    padding-right: calc(var(--wp--preset--spacing--l) * 2);
    background-repeat: no-repeat;
    background-position: right 25px center;
    background-image: url("../images/chevron.svg");
}

.wpcf7-form input.wpcf7-submit {
    display: block;
    width: auto;
    margin: var(--wp--preset--spacing--l) auto 0;
    padding: var(--wp--preset--spacing--s) var(--wp--preset--spacing--l);
    background: var(--wp--preset--color--accent);
    color: var(--wp--preset--color--text);
    border: 1px solid transparent;
    border-radius: 40px;
    font-family: var(--wp--preset--font-family--font-body);
    font-size: var(--wp--preset--font-size--md);
    font-weight: 400;
    line-height: 1.2;
    cursor: pointer;
    transition: background-color 0.4s ease, color 0.4s ease, border-color 0.4s ease;
}

.wpcf7-form input.wpcf7-submit:hover {
    background-color: var(--wp--preset--color--background);
    color: var(--wp--preset--color--text);
}

.wpcf7-not-valid-tip {
    margin-top: var(--wp--preset--spacing--s);
}

/* Radio / checkbox */
.wpcf7-form-control.wpcf7-radio,
.wpcf7-form-control.wpcf7-checkbox {
    box-sizing: content-box;
    display: block;
    width: auto;
    margin-top: 0;
    padding: 0;
    background: none;
    border: none;
}

.wpcf7-list-item {
    margin: 0 var(--wp--preset--spacing--m) 0 0;
}

.wpcf7-form input[type="radio"],
.wpcf7-form input[type="checkbox"] {
    accent-color: var(--wp--preset--color--accent);
}

/* Date */
.wpcf7-form input[type="date"]::-webkit-calendar-picker-indicator {
    filter: invert(1);
}

/* classe présente dans les options avancées du bloc advice-banner en bas de page */
.advice-banner {
    @media (max-width: 781px) {
        .wp-block-buttons.is-content-justification-right {
            justify-content: flex-start;
        }
    }
}

/* ── Buttons ──────────────────────────────────────────── */

.wp-block-button .wp-block-button__link {
    color: var(--wp--preset--color--text);
    transition: background-color 0.4s ease, color 0.4s ease, border-color 0.4s ease !important;
}

.wp-block-button .wp-block-button__link:hover {
    background-color: var(--wp--preset--color--background) !important;
    color: var(--wp--preset--color--text);
}

.wp-block-button .wp-block-button__link.has-text-background-color,
.wp-block-button.is-style-neutral .wp-block-button__link {
    background-color: var(--wp--preset--color--text);
    color: var(--wp--preset--color--background);
}

.wp-block-button .wp-block-button__link.has-text-background-color:hover,
.wp-block-button.is-style-neutral .wp-block-button__link:hover {
    background-color: var(--wp--preset--color--background) !important;
    color: var(--wp--preset--color--text);
}

.wp-block-button .wp-block-button__link.has-background-background-color,
.wp-block-button.is-style-negative .wp-block-button__link {
    background-color: var(--wp--preset--color--background);
    color: var(--wp--preset--color--text);
}

.wp-block-button .wp-block-button__link.has-background-background-color:hover,
.wp-block-button.is-style-negative .wp-block-button__link:hover {
    background-color: var(--wp--preset--color--accent) !important;
    color: var(--wp--preset--color--text);
}

.wp-block-button .wp-block-button__link.has-accent-background-color {
    color: var(--wp--preset--color--text);
}

.wp-block-button .wp-block-button__link.has-accent-background-color:hover {
    background-color: var(--wp--preset--color--background) !important;
    color: var(--wp--preset--color--text);
}

.wp-block-button.is-style-outline .wp-block-button__link:hover {
    background-color: var(--wp--preset--color--text) !important;
    color: var(--wp--preset--color--background);
}

.wp-block-post .wp-block-post-excerpt__more-link {
    display: inline-block;
    box-sizing: border-box;
    width: 31px;
    height: 31px;
    padding: 0;
    border: none;
    border-radius: 50%;
    background-color: transparent;
    background-repeat: no-repeat;
    background-position: center;
    background-size: contain;
    background-image: url("../images/button-arrow.svg");
    text-indent: -9999px;
    white-space: nowrap;
    transition: width .2s ease, height .2s ease, margin .2s ease;

    &:after {
        content: '';
        position: absolute;
        inset: 0;
        z-index: 1;
        cursor: pointer;
    }
}

.wp-block-post .wp-block-post-excerpt__more-link:hover {
    background-image: url("../images/button-arrow-neutral.svg");
}

/* Éditeur : texte du lien doit rester visible/éditable, pas d'icône ronde */
.editor-styles-wrapper .wp-block-post .wp-block-post-excerpt__more-link {
    width: auto;
    height: auto;
    text-indent: 0;
    background-image: none;
    white-space: normal;
}

/* ── Columns ──────────────────────────────────────────── */

.wp-block-columns.is-style-reversed-order {

    @media (max-width: 781px) {
        .wp-block-column:nth-child(2) {
            order: 1;
            > .wp-block-image  {
                float: left;
                margin: 0;
            }
        }
        .wp-block-column:nth-child(1) {
            order: 2;
        }

        > .wp-block-column:nth-child(2) > .wp-block-image img[src*=".svg"] {
            width: 100px !important;
        }
    }
}


/* ── Table ──────────────────────────────────────────── */

.wp-block-table {
    overflow-x: auto;

    table,
    thead,
    tbody,
    tfoot,
    tr {
        border: none;
    }

    table {
        width: 100%;
        border-collapse: collapse;
    }

    th,
    td {
        padding: var(--wp--preset--spacing--m) var(--wp--preset--spacing--s);
        text-align: left;
        border: none;
        border-bottom: 1px solid var(--wp--preset--color--accent);
    }
}

/* ── Query Loop (cards) ──────────────────────────────────── */

.wp-block-query .is-layout-grid.columns-2 { 
    @media (max-width: 781px) {
        grid-template-columns: repeat(1, minmax(0, 1fr));
    }
}

.wp-block-query .is-layout-grid.columns-3 { 
    @media (max-width: 1024px) {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    @media (max-width: 781px) {
        grid-template-columns: repeat(1, minmax(0, 1fr));
    }
}

.wp-block-post {
    position: relative;
}

.wp-block-post > .wp-block-group {
    position: static;
}

.wp-block-post .wp-block-read-more::after {
    content: '';
    position: absolute;
    inset: 0;
    z-index: 1;
    cursor: pointer;
}

/* Pagination : numéro courant en rond plein, les autres en texte simple */
.wp-block-query-pagination {
    margin-top: var(--wp--preset--spacing--l);
}

.wp-block-query-pagination-numbers {
    display: flex;
    align-items: center;
    gap: var(--wp--preset--spacing--m);
}

.wp-block-query-pagination-numbers .page-numbers {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 41px;
    height: 41px;
    border-radius: 50%;
    color: var(--wp--preset--color--text);
    text-decoration: none;
    font-family: var(--wp--preset--font-family--font-body);
    font-size: var(--wp--preset--font-size--base);
}

.wp-block-query-pagination-numbers .page-numbers.current {
    background-color: var(--wp--preset--color--accent);
}

/* ── Filtres Réalisations ─────────────────────────────────── */

.realisations-filtres {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: var(--wp--preset--spacing--l);

    @media (max-width: 1024px) {
        flex-direction: column;
        align-items: flex-start;
        gap: var(--wp--preset--spacing--m);
    }
}

.realisations-filtres__label {
    color: var(--wp--preset--color--text);
    font-family: var(--wp--preset--font-family--font-body);
    font-size: var(--wp--preset--font-size--base);
}

.realisations-filtres__select {
    appearance: none;
    -webkit-appearance: none;
    box-sizing: border-box;
    min-width: 300px;
    padding: var(--wp--preset--spacing--s) var(--wp--preset--spacing--m);
    padding-right: calc(var(--wp--preset--spacing--l) * 2);
    background-color: transparent;
    background-repeat: no-repeat;
    background-position: right 15px center;
    background-image: url("../images/chevron.svg");
    background-size: 10px auto;
    border: 1px solid var(--wp--preset--color--text);
    border-radius: 999px;
    color: var(--wp--preset--color--text);
    font-family: var(--wp--preset--font-family--font-body);
    font-size: var(--wp--preset--font-size--base);
    cursor: pointer;
}

.realisations-filtres__select:focus {
    outline: none;
    border-color: var(--wp--preset--color--accent);
}
