/* Bandeau du cursus Bricks. */
.brxe-section:has(.abra-periodes-grille) > .brxe-heading {
    margin-block: 0 0.45rem !important;
    color: #343434 !important;
    font-size: clamp(1.35rem, 2.2vw, 1.75rem) !important;
    font-weight: 400 !important;
    line-height: 1.15;
}

.brxe-div:has(> .brxe-heading .abra-cursus-badges) {
    width: 100%;
    margin-block: 0 1.5rem !important;
    padding: 0 !important;
    border-radius: 0 !important;
    background: transparent !important;
}

.brxe-heading:has(.abra-cursus-badges) {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 0.65rem;
    margin: 0 0 1rem !important;
    color: #343434 !important;
    font-family: inherit;
    font-size: 28px !important;
    font-weight: 400 !important;
    line-height: 1.3;
}

.abra-cursus-badges {
    display: inline-flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 0.55rem;
}

.abra-cursus-badge {
    display: inline-flex;
    min-height: 2rem;
    align-items: center;
    justify-content: center;
    padding: 0.25rem 0.9rem;
    border-radius: 999px;
    background: #292929;
    font-family: inherit;
    font-size: 14px;
    font-weight: 600;
    line-height: 1;
    white-space: nowrap;
}

.abra-cursus-badge.is-cycle { color: #e1b34e; }
.abra-cursus-badge.is-zone { color: #b9ebc5; }
.abra-cursus-badge.is-age { color: #66c8df; }

.brxe-block:has(> .brxe-shortcode .abra-periodes-grille),
.brxe-shortcode:has(> .abra-periodes-grille) {
    width: 100% !important;
    max-width: none !important;
    margin-inline: 0 !important;
}

.brxe-shortcode:has(> .abra-periodes-grille) {
    display: block;
    align-self: stretch;
}

/* Navigateur à deux niveaux : périodes puis semaines. */
.abra-periodes-grille {
    --abra-cursus-surface: transparent;
    --abra-cursus-text: #292929;
    --abra-cursus-muted: #566178;
    --abra-cursus-border: rgb(67 76 99 / 12%);
    --abra-cursus-blue: #279ce7;
    --abra-cursus-yellow: #ffd326;
    --abra-cursus-green: #43ba75;
    width: 100%;
    max-width: none;
    margin: 0 auto 1.4rem;
    color: var(--abra-cursus-text);
}

/* Le titre reste disponible pour les lecteurs d'écran sans alourdir le bandeau. */
.abra-periodes-title {
    position: absolute !important;
    width: 1px !important;
    height: 1px !important;
    padding: 0 !important;
    overflow: hidden !important;
    clip: rect(0, 0, 0, 0) !important;
    white-space: nowrap !important;
    border: 0 !important;
}

.abra-periodes-tabs-shell,
.abra-periodes-panels {
    position: relative;
    min-width: 0;
    overflow: hidden;
    border: 0;
    border-radius: 16px;
    background: var(--abra-cursus-surface);
    box-shadow: 0 5px 13px rgb(38 45 61 / 12%);
}

.abra-periodes-tabs-shell {
    margin-bottom: 2rem;
    padding: 0.65rem 1rem;
}

.abra-periodes-tabs {
    position: relative;
    z-index: 0;
    display: grid;
    grid-template-columns: repeat(5, minmax(0, 1fr));
    min-width: 0;
}

.abra-periode-tab {
    position: relative;
    display: flex;
    min-width: 0;
    min-height: 8.5rem;
    align-items: center;
    justify-content: center;
    flex-direction: column;
    gap: 0.55rem;
    padding: 0.8rem 0.6rem;
    border: 1px solid transparent;
    border-radius: 15px;
    background: transparent;
    color: #283456;
    font: inherit;
    text-align: center;
    cursor: pointer;
    transition: background-color 180ms ease, border-color 180ms ease, transform 180ms ease;
}

.abra-periode-tab:hover { transform: translateY(-1px); }

/* Un segment distinct entre chaque titre : aucun trait sous les libelles. */
.abra-periode-tab:not(:last-child)::before {
    position: absolute;
    z-index: -1;
    top: calc(2.55rem - 3px);
    left: calc(50% + 4.2rem);
    width: calc(100% - 8.4rem);
    height: 6px;
    background: radial-gradient(circle, #cbd7e8 0 1px, transparent 1.5px) 0 50% / 7px 6px repeat-x;
    content: "";
    pointer-events: none;
}

/* Etoiles legerement irregulieres, placees hors des libelles. */
.abra-periode-tab::after,
.abra-periode-tab:last-child::before {
    position: absolute;
    z-index: 2;
    content: "\2605";
    font-family: Georgia, serif;
    line-height: 1;
    pointer-events: none;
    text-shadow: 0 0 1.25px currentColor;
}

.abra-periode-tab:first-child::after {
    top: 2rem;
    left: 0.3rem;
    color: #84a9e8;
    font-size: 1.69rem;
    transform: rotate(-9deg);
}

.abra-periode-tab:nth-child(2)::after {
    top: 0.5rem;
    right: 0.65rem;
    color: #71cba0;
    font-size: 0.94rem;
    transform: rotate(12deg);
}

.abra-periode-tab:nth-child(3)::after {
    top: 0.95rem;
    right: 0.1rem;
    color: #a783ea;
    font-size: 1.17rem;
    transform: rotate(-6deg);
}

.abra-periode-tab:nth-child(4)::after {
    top: 0.4rem;
    right: 0.6rem;
    color: #7258df;
    font-size: 0.88rem;
    transform: rotate(10deg);
}

.abra-periode-tab:last-child::after {
    top: 0.05rem;
    right: 0.8rem;
    color: #ffe19a;
    font-size: 1.63rem;
    transform: rotate(8deg);
}

.abra-periode-tab:last-child::before {
    right: 0.15rem;
    bottom: 1.35rem;
    color: #f7cf70;
    font-size: 1.01rem;
    transform: rotate(-12deg);
}

.abra-periode-tab-numero {
    color: var(--abra-cursus-blue);
    font-size: clamp(15px, 1.25vw, 18px);
    font-weight: 750;
    line-height: 1.1;
}

.abra-periode-tab-numero::before { content: "Période "; }
.abra-periode-tab:nth-child(2) .abra-periode-tab-numero { color: var(--abra-cursus-green); }
.abra-periode-tab:nth-child(3) .abra-periode-tab-numero { color: #e87837; }
.abra-periode-tab:nth-child(4) .abra-periode-tab-numero { color: #e8514d; }
.abra-periode-tab:nth-child(5) .abra-periode-tab-numero { color: #6950e8; }

.abra-periode-tab-label {
    display: block;
    width: 100%;
    color: #2d385a;
    font-size: clamp(14px, 1.14vw, 17px);
    font-weight: 650;
    line-height: 1.2;
    text-wrap: balance;
}

.abra-periode-tab-semaines {
    color: #46516b;
    font-size: clamp(13px, 1vw, 15px);
    font-weight: 600;
    line-height: 1.2;
    font-variant-numeric: tabular-nums;
}

.abra-periode-tab.is-active {
    border-color: rgb(232 192 67 / 22%);
    background: rgb(255 239 184 / 52%);
    box-shadow: inset 0 0 22px rgb(255 223 121 / 18%);
}

.abra-periodes-arrow {
    display: none;
    position: absolute;
    z-index: 4;
    top: 50%;
    width: 2.25rem;
    height: 2.25rem;
    align-items: center;
    justify-content: center;
    padding: 0;
    border: 1px solid var(--abra-cursus-border);
    border-radius: 50%;
    background: #fff;
    box-shadow: 0 3px 10px rgb(40 55 89 / 12%);
    color: #34404d;
    font: 700 1.45rem/1 sans-serif;
    cursor: pointer;
    transform: translateY(-50%);
}

.abra-periodes-arrow.is-prev { left: 0.4rem; }
.abra-periodes-arrow.is-next { right: 0.4rem; }
.abra-periodes-arrow:disabled { visibility: hidden; }

.abra-periode-tab:focus-visible,
.abra-periodes-arrow:focus-visible,
.abra-semaine-pill:focus-visible,
.abra-semaine-arrow:focus-visible {
    outline: 3px solid var(--abra-cursus-blue);
    outline-offset: 3px;
}

.abra-periode-panel {
    display: grid;
    grid-template-columns: clamp(318px, 27vw, 370px) minmax(0, 1fr) clamp(318px, 27vw, 370px);
    align-items: center;
    min-height: 8.75rem;
    padding: 0;
}

.abra-periode-panel[hidden] { display: none; }

.abra-periode-resume {
    display: grid;
    min-width: 0;
    min-height: 5.6rem;
    grid-template-columns: 3.8rem minmax(0, 1fr);
    gap: 0.75rem;
    align-items: center;
    padding: 0.8rem 1rem;
    border-right: 1px solid var(--abra-cursus-border);
}

.abra-periode-objectif-icone {
    display: inline-flex;
    width: 3.8rem;
    height: 3.8rem;
    align-items: center;
    justify-content: center;
    color: #5a27d6;
}

.abra-periode-objectif-icone svg {
    width: 100%;
    height: 100%;
    overflow: visible;
    fill: none;
    stroke: currentColor;
    stroke-linecap: round;
    stroke-linejoin: round;
    stroke-width: 2.8;
}

.abra-periode-objectif-icone svg circle:last-of-type { fill: currentColor; }
.abra-periode-objectif-icone .abra-objectif-fleche-plume {
    fill: var(--abra-cursus-yellow);
    stroke: var(--abra-cursus-yellow);
}
.abra-periode-resume-texte { min-width: 0; }

.abra-periode-resume-kicker {
    display: block;
    margin-bottom: 0.55rem;
    color: #6a39df;
    font-size: clamp(14px, 1.1vw, 17px);
    font-weight: 650;
    line-height: 1.2;
}

.abra-periode-objectif {
    display: block;
    margin: 0;
    color: #252525;
    font-family: inherit;
    font-size: clamp(16px, 1.3vw, 20px);
    font-weight: 750;
    line-height: 1.25;
    text-wrap: balance;
}

.abra-periode-objectif.is-empty { visibility: hidden; }
.abra-periode-contenu { min-width: 0; padding: 0.9rem clamp(0.7rem, 1.4vw, 1.25rem); }

.abra-semaines-navigation {
    display: flex;
    min-width: 0;
    gap: clamp(0.28rem, 0.55vw, 0.55rem);
    align-items: center;
    justify-content: center;
}

.abra-semaines-grille {
    display: flex;
    min-width: 0;
    align-items: center;
    justify-content: center;
    flex-wrap: nowrap;
    gap: clamp(0.2rem, 0.48vw, 0.48rem);
}

.abra-semaine-arrow {
    display: inline-flex;
    width: 2.7rem;
    height: 2.7rem;
    flex: 0 0 2.7rem;
    align-items: center;
    justify-content: center;
    border: 1px solid var(--abra-cursus-border);
    border-radius: 50%;
    background: rgb(255 255 255 / 58%);
    color: #344063;
    font: 700 1.5rem/1 sans-serif;
    text-decoration: none;
    transition: border-color 160ms ease, background-color 160ms ease, transform 160ms ease;
}

.abra-semaine-arrow:hover {
    border-color: #aebcd3;
    background: #fff;
    transform: translateY(-1px);
}

.abra-semaine-arrow.is-disabled { opacity: 0.3; }

.abra-semaine-pill {
    display: inline-flex;
    width: 2.9rem;
    min-width: 2.9rem;
    height: 2.7rem;
    flex: 0 0 2.9rem;
    align-items: center;
    justify-content: center;
    padding: 0 0.35rem;
    border: 1px solid transparent;
    border-radius: 999px;
    background: transparent;
    color: #384567;
    font-family: inherit;
    font-size: clamp(13px, 1vw, 15px);
    font-weight: 650;
    line-height: 1;
    text-decoration: none;
    font-variant-numeric: tabular-nums;
    transition: transform 160ms ease, background-color 160ms ease, border-color 160ms ease;
}

.abra-semaine-pill:hover {
    border-color: var(--abra-cursus-border);
    background: rgb(255 255 255 / 55%);
    transform: translateY(-1px);
}

.abra-semaine-pill.is-fait { background: rgb(185 235 197 / 48%); color: #285f36; }
.abra-semaine-pill.is-selectionnee { border-color: #ead766; background: #fff5b8; }

.abra-semaine-pill.is-courante {
    width: auto;
    min-width: 7.9rem;
    flex-basis: auto;
    border-color: #e6bd15;
    border-radius: 999px;
    background: var(--abra-cursus-yellow);
    box-shadow: 0 4px 10px rgb(201 159 0 / 13%);
    color: #342f18;
}

.abra-semaine-pill.is-courante.is-selectionnee,
.abra-semaine-pill.is-fait.is-courante { background: var(--abra-cursus-yellow); color: #3a351c; }

.abra-periode-illustration {
    width: clamp(115px, 11vw, 165px);
    height: 8.75rem;
    align-self: stretch;
    margin: 0;
    overflow: hidden;
    border-left: 1px solid rgb(235 216 178 / 45%);
    border-radius: 45% 0 0 45%;
    background: rgb(255 250 240 / 58%);
    justify-self: end;
}

.abra-periode-illustration img {
    display: block;
    width: 142%;
    max-width: none;
    height: 142%;
    object-fit: cover;
    object-position: 50% 51%;
    transform: translate(-14.8%, -14.8%);
}

@media (max-width: 1299px) {
    .abra-periodes-tabs-shell::before,
    .abra-periodes-tabs-shell::after {
        position: absolute;
        z-index: 2;
        top: 0;
        bottom: 0;
        width: 3.1rem;
        pointer-events: none;
        content: "";
        transition: opacity 160ms ease;
    }

    .abra-periodes-tabs-shell::before { left: 0; background: linear-gradient(90deg, #f8fafc 25%, transparent); }
    .abra-periodes-tabs-shell::after { right: 0; background: linear-gradient(270deg, #f8fafc 25%, transparent); }
    .abra-periodes-grille.is-tabs-start .abra-periodes-tabs-shell::before,
    .abra-periodes-grille.is-tabs-end .abra-periodes-tabs-shell::after { opacity: 0; }

    .abra-periodes-tabs {
        display: flex;
        padding-inline: 3rem;
        overflow-x: auto;
        overscroll-behavior-inline: contain;
        scroll-behavior: smooth;
        scroll-snap-type: x mandatory;
        scrollbar-width: none;
        -webkit-overflow-scrolling: touch;
    }

    .abra-periodes-tabs::-webkit-scrollbar { display: none; }
    .abra-periode-tab { flex: 0 0 clamp(12.5rem, 25vw, 15rem); scroll-snap-align: center; }
    .abra-periodes-arrow { display: inline-flex; }

    .abra-periode-panel { grid-template-columns: 332px minmax(0, 1fr) 332px; }
    .abra-periode-resume { grid-template-columns: 3.8rem minmax(0, 1fr); gap: 0.75rem; }
    .abra-periode-objectif-icone { width: 3.8rem; height: 3.8rem; }
    .abra-semaine-pill { width: 2.55rem; min-width: 2.55rem; flex-basis: 2.55rem; }
    .abra-semaine-pill.is-courante { width: auto; min-width: 7rem; flex-basis: auto; }
}

@media (max-width: 1000px) {
    .abra-periode-panel { grid-template-columns: 230px minmax(0, 1fr) 230px; }
    .abra-periode-resume { grid-template-columns: 3rem minmax(0, 1fr); padding-inline: 1rem; }
    .abra-periode-objectif-icone { width: 3rem; height: 3rem; }
    .abra-semaines-grille { overflow-x: auto; justify-content: flex-start; scrollbar-width: none; }
    .abra-semaines-grille::-webkit-scrollbar { display: none; }
}

@media (max-width: 767px) {
    .brxe-heading:has(.abra-cursus-badges) { align-items: flex-start; flex-direction: column; }
    .abra-cursus-badge { min-height: 1.8rem; padding-inline: 0.72rem; font-size: 14px; }
    .abra-periodes-tabs-shell { margin-bottom: 1rem; padding-block: 0.4rem; border-radius: 13px; }
    .abra-periode-tab { min-height: 7.5rem; flex-basis: min(62vw, 13rem); }
    .abra-periode-tab-label { font-size: 14px; }

    .abra-periode-panel {
        grid-template-columns: minmax(0, 1fr) 82px;
        min-height: 0;
    }

    .abra-periode-resume {
        grid-column: 1 / -1;
        min-height: 4.8rem;
        grid-template-columns: 3rem minmax(0, 1fr);
        border-right: 0;
        border-bottom: 1px solid var(--abra-cursus-border);
    }

    .abra-periode-resume-kicker { margin-bottom: 0.3rem; }
    .abra-periode-contenu { padding: 0.75rem 0.6rem; }
    .abra-periode-illustration { width: 100%; height: 4.9rem; border-radius: 48% 0 0 48%; }
    .abra-semaines-navigation { gap: 0.25rem; }
    .abra-semaine-arrow { width: 2.25rem; height: 2.25rem; flex-basis: 2.25rem; }
    .abra-semaine-pill { width: 2.65rem; min-width: 2.65rem; height: 2.35rem; flex-basis: 2.65rem; font-size: 13px; }
    .abra-semaine-pill.is-courante { width: auto; min-width: 6.8rem; flex-basis: auto; }
}
