/* Page Ressources — piste « Les marionnettes » (langage du flyer PUNCH). */

body.page-template-page-ressources { background: var(--punch-rouge, #EB242D); }

.punch-ress,
.punch-ress__scene-wrap {
    --r-rouge: var(--punch-rouge, #EB242D);
    --r-blanc: #FFFFFF;
}
.punch-ress {
    background: var(--r-rouge);
    min-height: 100vh;
    padding-bottom: 60px;
}

.punch-ress__header { color: var(--r-blanc); padding: 60px 0 36px; }
.punch-ress__header-inner,
.punch-ress__scene-wrap { max-width: 1280px; margin: 0 auto; padding: 0 40px; }
.punch-ress__legende {
    font-family: var(--punch-font-base, sans-serif);
    font-size: 13px; letter-spacing: .2em; text-transform: uppercase;
    color: rgba(255,255,255,.75); margin: 0 0 12px; font-weight: 600;
}
.punch-ress__titre {
    font-family: var(--punch-font-display, 'Aldo', sans-serif);
    font-size: clamp(48px, 7vw, 96px); line-height: .9; margin: 0;
    font-weight: 400; color: var(--r-blanc);
}
.punch-ress__content > *:not(.punch-ress__scene-wrap) {
    max-width: 1280px; margin-left: auto; margin-right: auto;
    padding-left: 40px; padding-right: 40px; color: var(--r-blanc);
}
.punch-ress__content > p { font-size: 17px; line-height: 1.5; max-width: calc(62ch + 80px); margin-left: max(0px, calc((100% - 1280px) / 2)); }
.punch-ress__scene-wrap { background: var(--r-rouge); padding-top: 14px; padding-bottom: 14px; }
.punch-ress__vide {
    background: var(--punch-rouge, #EB242D); color: #fff; padding: 24px;
    font-family: var(--punch-font-mono, ui-monospace, monospace); font-size: 13px;
}

/* Scène */
.punch-ress__scene {
    position: relative;
    padding: 0 0 18px;
    overflow-x: auto; overflow-y: hidden;
    touch-action: pan-x;
}
.punch-ress__band {
    background: var(--r-blanc); color: var(--r-rouge);
    font-family: var(--punch-font-display, 'Aldo', sans-serif);
    font-size: clamp(22px, 3vw, 34px); line-height: 1;
    padding: 14px 18px 12px;
    display: flex; justify-content: space-between; align-items: baseline; gap: 12px; flex-wrap: wrap;
    position: sticky; left: 0;
}
.punch-ress__band span:last-child { font-size: clamp(14px, 1.6vw, 19px); }

.punch-ress__row {
    list-style: none; margin: 0; padding: 0 6px;
    display: flex; justify-content: center; gap: clamp(10px, 1.6vw, 22px);
    min-width: max-content;
    min-height: 330px;
}

/* Marionnette */
.pb-pup {
    display: flex; flex-direction: column; align-items: center;
    transform-origin: 50% 0; will-change: transform;
    cursor: pointer; user-select: none; touch-action: pan-x;
}
.pb-pup.is-drag { cursor: grabbing; }
.pb-pup__fil {
    display: block; width: 2px; background: var(--r-blanc);
    height: calc(26px + var(--len));
    transition: height .55s cubic-bezier(.2, .8, .2, 1);
}
.pb-pup.is-open .pb-pup__fil { height: calc(26px + var(--len) - var(--lift, 60px)); }

.pb-pup__carte {
    width: 168px; background: var(--r-blanc); color: var(--r-rouge);
    padding: 16px 14px 40px;
    display: flex; flex-direction: column; gap: 6px;
    clip-path: polygon(0 0, 100% 0, 100% calc(100% - 26px), 50% 100%, 0 calc(100% - 26px));
    outline: none;
}
.pb-pup__num {
    font-family: var(--punch-font-mono, ui-monospace, monospace);
    font-size: 11px; font-weight: 700;
}
.pb-pup__titre {
    font-family: var(--punch-font-display, 'Aldo', sans-serif);
    font-weight: 400; font-size: 23px; line-height: 1.02; margin: 0; color: var(--r-rouge);
    transition: background .2s, color .2s;
}
.pb-pup__fam {
    font-family: var(--punch-font-mono, ui-monospace, monospace);
    font-size: 10px; letter-spacing: .04em; opacity: .7;
}
.pb-pup.is-open .pb-pup__titre,
.pb-pup__carte:focus-visible .pb-pup__titre {
    background: var(--r-rouge); color: var(--r-blanc); box-shadow: 0 0 0 4px var(--r-rouge);
}

/* Données cachées (lues par le JS, accessibles aux lecteurs d'écran) */
.js-ress .pb-pup__data, .js-ress.punch-ress__scene-wrap .pb-pup__data {
    position: absolute; width: 1px; height: 1px; overflow: hidden;
    clip: rect(0 0 0 0); white-space: nowrap;
}
.pb-pup__data p { margin: 6px 0 4px; font-size: 13px; }
.pb-pup__data a { color: inherit; font-size: 12px; }

/* Filtre par famille */
.punch-ress__filtres { display: flex; flex-wrap: wrap; gap: 8px; padding-bottom: 14px; }
.punch-ress__filtres button {
    font-family: var(--punch-font-mono, ui-monospace, monospace); font-size: 13px; font-weight: 700;
    color: var(--r-blanc); background: transparent; border: 2px solid var(--r-blanc);
    padding: 7px 12px; cursor: pointer; border-radius: 0;
}
.punch-ress__filtres button[aria-pressed="true"] { background: var(--r-blanc); color: var(--r-rouge); }
.punch-ress__filtres button:focus-visible { outline: 2px solid #111; outline-offset: 2px; }
.pb-pup.is-off { display: none; }

/* Défilement : flèches et fondu au bord */
.punch-ress__piste { position: relative; }
.punch-ress__fleche {
    position: absolute; top: 55%; transform: translateY(-50%); z-index: 3;
    width: 46px; height: 46px; padding: 0; border: 0; border-radius: 0; cursor: pointer;
    background: var(--r-blanc); color: var(--r-rouge); box-shadow: 0 0 0 3px var(--r-rouge);
    font-family: var(--punch-font-display, 'Aldo', sans-serif); font-size: 34px; line-height: 1;
}
.punch-ress__fleche:hover,
.punch-ress__fleche:focus-visible { background: #111; color: var(--r-blanc); outline: none; }
.punch-ress__fleche[hidden] { display: none; }
.punch-ress__fleche--g { left: -22px; }
.punch-ress__fleche--d { right: -22px; }
.punch-ress__fondu {
    position: absolute; right: 0; top: 70px; bottom: 18px; width: 140px; z-index: 2;
    background: linear-gradient(90deg, rgba(235, 36, 45, 0), var(--r-rouge) 85%);
    pointer-events: none; transition: opacity .3s;
}
.punch-ress__fondu.is-fin { opacity: 0; }

/* Cadre de détail */
.punch-ress__info {
    background: var(--r-blanc); color: var(--r-rouge);
    min-height: 110px; padding: 16px 20px;
    display: grid; grid-template-columns: 96px minmax(0, 1fr) auto; gap: 4px 20px; align-items: center;
}
.punch-ress__hint {
    grid-column: 1 / -1;
    font-family: var(--punch-font-mono, ui-monospace, monospace); font-size: 12px;
}
.punch-ress__info .th {
    grid-row: 1 / 4; width: 96px; height: 72px;
    background: var(--r-rouge) center / cover no-repeat;
}
.punch-ress__info .n,
.punch-ress__info h3 { grid-column: 2; }
.punch-ress__info .n {
    font-family: var(--punch-font-mono, ui-monospace, monospace); font-size: 11px; font-weight: 700;
}
.punch-ress__info h3 {
    margin: 0; font-family: var(--punch-font-display, 'Aldo', sans-serif);
    font-weight: 400; font-size: 30px; line-height: 1; color: var(--r-rouge);
}
.punch-ress__info p { margin: 0; font-size: 14px; color: #7a1a15; grid-column: 2; }
.punch-ress__info .go {
    grid-row: 1 / 4; grid-column: 3;
    font-family: var(--punch-font-mono, ui-monospace, monospace); font-size: 13px;
    background: var(--r-rouge); color: var(--r-blanc); text-decoration: none;
    padding: 10px 14px; white-space: nowrap;
}
.punch-ress__info .go:hover,
.punch-ress__info .go:focus-visible { background: #111; outline: none; }

@media (max-width: 767.98px) {
    .punch-ress__header-inner,
    .punch-ress__scene-wrap { padding: 0 16px; }
    .punch-ress__header { padding: 40px 0 24px; }
    .punch-ress__row { justify-content: flex-start; }
    .pb-pup__carte { width: 148px; }
    .pb-pup__titre { font-size: 20px; }
    .punch-ress__info { grid-template-columns: 72px minmax(0, 1fr); }
    .punch-ress__info .th { width: 72px; height: 54px; }
    .punch-ress__info .go { grid-row: auto; grid-column: 2; justify-self: start; }
    .punch-ress__fleche { width: 38px; height: 38px; font-size: 28px; }
    .punch-ress__fleche--g { left: -8px; }
    .punch-ress__fleche--d { right: -8px; }
    .punch-ress__fondu { width: 70px; }
}

@media (prefers-reduced-motion: reduce) {
    .pb-pup__fil { transition: none; }
}

/* Éditeur : la ligne modèle du répéteur ACF ne doit pas apparaître. */
.acf-repeater .acf-row.acf-clone { display: none !important; }
