/* Les six rectos : trois compositions de balade qui ne partagent aucun gabarit. Téléphone d'abord. */

/* Mécanique : décollement (glisse), retournement (feuille), deux faces. */
.js .affiche__glisse { position: absolute; inset: 0; perspective: 900px; transform-origin: 0 100%; }
.js .affiche__feuille { position: relative; height: 100%; transform-style: preserve-3d; }
.js .recto, .js .verso { position: absolute; inset: 0; overflow-y: auto; overflow-x: hidden; overscroll-behavior: contain;
  -webkit-backface-visibility: hidden; backface-visibility: hidden; scrollbar-width: thin; }
.js .verso { transform: rotateY(180deg); }
.js .est-retournee .affiche__feuille { transform: rotateY(180deg); }
@media (min-width: 1024px) { .js .affiche__glisse { perspective: 1600px; } }

.recto { position: relative; }
.a1 .recto, .a6 .recto { background: var(--soleil); color: var(--nuit); }
.a2 .recto { background: var(--chaise); color: var(--blanc); }
.a3 .recto { background: var(--tomate); color: var(--blanc); }
.a4 .recto { background: var(--nuit); color: var(--blanc); }
.a5 .recto { background: var(--blanc); color: var(--nuit); }
.verso { background: var(--blanc); color: var(--nuit); }

.scene { position: relative; container-type: size; overflow: hidden; }
.scene picture, .a3__photo, .a4__frise { display: block; }
.scene picture { position: absolute; inset: 0; z-index: 1; }
.scene img, .a4__frise img { width: 100%; height: 100%; object-fit: cover; }
.soleil { background: var(--blanc); }
.lune { background: var(--blanc); }

/* ——— 1. Le titre ——— */
.a1 .recto { display: flex; flex-direction: column; padding-bottom: var(--barre); }
.a1__titre { position: relative; z-index: 2; margin-top: 8px; font-weight: 400; }
.a1__titre .titre-ajuste { font: 400 clamp(4.2rem, 19.5vw, 21rem)/.82 var(--rozha); margin-left: -.03em; padding-top: .06em; }
.a1__lieu { display: block; font: 400 clamp(1.4rem, 3vw, 3.6rem)/1.1 var(--rozha); margin-top: .25em; }
.a1__infos { position: relative; z-index: 2; margin-top: 14px; order: 3; }
.etat { display: flex; align-items: center; gap: 10px; font-weight: 600; margin-bottom: 8px; }
.etat__point { width: 12px; height: 12px; border-radius: 50%; background: var(--second); flex: none; }
.etat.est-ouvert .etat__point { background: var(--chaise); box-shadow: 0 0 0 4px rgb(21 83 160 / .22); }
.conduite { display: flex; align-items: baseline; gap: 10px; font-size: 18px; line-height: 1.6; }
.conduite span { font: 400 22px/1 var(--rozha); }
.conduite i { flex: 1; height: 3px; transform-origin: 0 50%;
  background: radial-gradient(circle, currentColor 1.4px, transparent 1.6px) 0 50% / 9px 3px repeat-x; }
.conduite b { font-weight: 800; white-space: nowrap; }
.a1__legende { margin-top: 6px; font-size: 16px; color: var(--nuit); }
.a1__legende span { display: block; }
.a1__scene { order: 4; flex: 1 1 0; min-height: 34%; margin: 12px calc(-1 * var(--marge)) 0; }
.a1__photo img { object-position: 72% 0; }
.a1__soleil { width: 66cqw; aspect-ratio: 1; right: -4cqw; top: -12cqw; z-index: 0; }
@media (max-height: 700px) and (max-width: 1023px) { .a1__legende { display: none; } }

@media (min-width: 1024px) {
  .a1 .recto { display: grid; grid-template-rows: 72px auto 1fr; padding-top: 24px; padding-bottom: 0; }
  .a1__titre { grid-column: 1 / -1; grid-row: 2; margin-top: clamp(4px, 2vh, 28px); }
  .a1__scene { grid-column: 6 / -1; grid-row: 2 / 4; margin: 0; min-height: 0; overflow: visible; }
  .a1__photo img { object-position: 100% 0; }
  .a1__soleil { width: 26vw; right: auto; left: -4cqw; top: 6cqh; }
  .a1__infos { grid-column: 1 / 6; grid-row: 3; align-self: end; padding-bottom: clamp(32px, 6vh, 64px); max-width: 520px; }
  .conduite { font-size: 20px; }
  .conduite span { font-size: clamp(26px, 2.2vw, 36px); }
  .etat { font-size: 20px; margin-bottom: 14px; }
  .a1__legende { font-size: 17px; margin-top: 12px; }
}

/* ——— 2. Villefranche : horizontale ——— */
.a2 .recto { grid-template-rows: auto auto auto 1fr; padding-bottom: var(--barre); }
.a2__titre { grid-column: 1 / -1; font: 400 13vw/.86 var(--rozha); margin: 8px 0 18px; }
.a2__chiffres { grid-column: 1 / -1; }
.a2__chiffres .chiffre-cle { color: var(--soleil); }
.a2__slogan { grid-column: 1 / -1; margin: 14px 0 16px; }
.a2__scene { grid-column: 1 / -1; grid-row: 4; margin: 0 calc(-1 * var(--marge)); min-height: 40%; --ar: 1.032; }
.a2__photo img { object-position: 50% 0; }
.a2__soleil { background: var(--soleil); width: max(26cqw, 104px); aspect-ratio: 1; left: 18%;
  top: calc(max(14.3cqh, 14.3cqw / var(--ar)) - max(26cqw, 104px) * .62); }
@media (min-width: 1024px) {
  .a2 .recto { grid-template-rows: auto 1fr; padding-top: 104px; padding-bottom: 112px; }
  .a2__titre { margin: 0 0 clamp(16px, 3vh, 40px); }
  .a2__chiffres { grid-column: 1 / 5; grid-row: 2; align-self: start; }
  .a2__slogan { grid-column: 1 / 5; grid-row: 2; align-self: end; margin: 0; max-width: 12ch; }
  .a2__scene { grid-column: 5 / -1; grid-row: 2; margin: 0 calc(-1 * var(--marge)) -112px 0; min-height: 0; --ar: 1.905; }
  .a2__photo img { object-position: 40% 0; }
  .a2__soleil { width: 15cqw; left: 46%; top: calc(max(14.3cqh, 14.3cqw / var(--ar)) - 15cqw * .62); }
}

/* ——— 3. Èze : diagonale ——— */
.a3 .recto { grid-template-rows: auto auto auto 1fr auto; padding-top: 0; }
.a3__photo { grid-column: 1 / -1; grid-row: 1; margin: 0 calc(-1 * var(--marge)); aspect-ratio: 1000 / 734; position: relative; z-index: 1; }
.a3__photo img { width: 100%; height: 100%; object-fit: cover; }
.a3__soleil { width: 22vw; aspect-ratio: 1; top: 6%; left: 58%; }
.a3__titre { grid-column: 2 / -1; grid-row: 2; justify-self: end; font: 400 38vw/.8 var(--rozha); margin-top: 18px; position: relative; z-index: 2; }
.a3__profil { position: absolute; z-index: 1; overflow: visible; pointer-events: none; }
.a3__profil path { fill: none; stroke: var(--blanc); stroke-width: 6px; stroke-linecap: round; stroke-linejoin: round; vector-effect: non-scaling-stroke; }
.a3__montee { grid-column: 2 / -1; grid-row: 3; justify-self: end; text-align: right; position: relative; z-index: 2; font-weight: 800; font-size: 17px; margin-top: 8px; }
.a3__chiffres { grid-column: 2 / -1; grid-row: 5; text-align: right; margin-bottom: 76px; }
.a3__slogan { grid-column: 2 / -1; grid-row: 4; align-self: end; justify-self: end; text-align: right; margin: 16px 0 8px; }
@media (min-width: 1024px) {
  .a3 .recto { grid-template-rows: auto 1fr auto; padding-top: 104px; padding-bottom: 112px; }
  .a3__titre { grid-column: 1 / 8; grid-row: 1 / 3; justify-self: start; align-self: start; margin: -.08em 0 0 -.04em;
    font-size: min(38vw, 52svh); }
  .a3__photo { grid-column: 8 / -1; grid-row: 1; margin: 0; align-self: start; }
  .a3__soleil { width: 6.5vw; top: 1%; left: 63%; }
  .a3__slogan { grid-column: 8 / -1; grid-row: 2; align-self: start; justify-self: start; text-align: left; margin: clamp(20px, 4vh, 48px) 0 0; max-width: none; }
  .a3__chiffres { grid-column: 8 / 12; grid-row: 3; text-align: left; margin: 0; }
  .a3__montee { position: absolute; grid-area: auto; margin: 0; text-align: left; font-size: 20px; white-space: nowrap; transform-origin: 0 100%; }
}

/* ——— 4. Saint-Paul : nocturne centré ——— */
.a4 .recto { grid-template-rows: auto auto auto auto 1fr; justify-items: center; text-align: center; padding-bottom: var(--barre); }
.a4__lune { position: relative; grid-column: 1 / -1; width: 22vw; aspect-ratio: 1; margin: 12px 0 18px; }
.a4__titre { grid-column: 1 / -1; position: relative; z-index: 1; color: var(--soleil); font: 400 15vw/.9 var(--rozha); white-space: nowrap; }
.a4__chiffres, .a4__slogan { position: relative; z-index: 1; }
.a4__chiffres { grid-column: 1 / -1; margin-top: 14px; }
.a4__chiffres .chiffre-cle { font-size: clamp(1.9rem, 4.6vw, 4.6rem); line-height: 1; }
.a4__slogan { grid-column: 1 / -1; margin-top: 14px; color: var(--soleil); max-width: 16ch; }
.a4__frise { grid-column: 1 / -1; grid-row: 5; align-self: end; width: calc(100% + 2 * var(--marge)); margin: 16px calc(-1 * var(--marge)) 0;
  height: clamp(150px, 34svh, 440px); }
.a4__frise img { object-position: 38% 0; }
@media (min-width: 1024px) {
  .a4 .recto { padding-top: 96px; padding-bottom: 0; }
  .a4__lune { width: clamp(64px, 6vw, 120px); margin: 0 0 clamp(12px, 2.4vh, 28px); }
  .a4__chiffres { margin-top: clamp(12px, 2.4vh, 28px); }
  .a4__frise { height: clamp(220px, 36svh, 470px); margin-top: 20px; }
  .a4__frise img { object-position: 50% 0; }
}

/* ——— 5. Le permis ——— */
.a5 .recto { grid-template-rows: auto auto auto auto; align-content: start; }
.a5__titre { grid-column: 1 / -1; font: 400 11vw/.95 var(--rozha); margin: 4px 0 8px; }
.permis { grid-column: 1 / -1; }
.permis legend { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); }
.permis__ne, .permis__liste { display: grid; grid-template-columns: 1fr 1fr; column-gap: 12px; }
.permis__ne legend, .permis__liste legend { grid-column: 1 / -1; }
.permis__liste { margin-top: 8px; }
.permis .case { min-height: 48px; font-size: 15px; }
.permis__ne { border-bottom: 2px solid rgb(10 42 82 / .2); padding-bottom: 4px; }
.verdicts { grid-column: 1 / -1; margin-top: 14px; border-top: 3px solid var(--nuit); }
.verdict { position: relative; display: grid; grid-template-columns: 1fr; align-items: center;
  min-height: 60px; padding: 7px 104px 7px 0; border-bottom: 2px solid var(--nuit); }
.verdict__nom { font: 400 21px/1.05 var(--rozha); }
.verdict__prix { font-weight: 800; font-size: 14px; white-space: nowrap; grid-row: 3; }
.verdict__pourquoi { grid-column: 1 / -1; grid-row: 2; font-size: 14px; line-height: 1.3; color: var(--second); }
.tampon { position: absolute; right: 0; top: 50%; width: 92px; height: 42px; margin-top: -21px; display: grid; place-items: center; transform: rotate(-6deg); }
.tampon svg { position: absolute; inset: 0; width: 100%; height: 100%; }
.tampon b { position: relative; font: 400 24px/1 var(--rozha); text-transform: uppercase; letter-spacing: .04em; }
.tampon--oui { color: var(--chaise); } .tampon--non { color: var(--tomate); }
.tampon.tombe { animation: tombe .18s cubic-bezier(.5, 0, .9, .4) both; }
@keyframes tombe { from { transform: scale(2.2) rotate(-14deg); opacity: 0; } to { transform: rotate(-6deg); opacity: 1; } }
.tressaille { animation: tressaille .16s linear; }
@keyframes tressaille { 25% { transform: translate(2px, 1px); } 50% { transform: translate(-2px, -1px); } 75% { transform: translate(1px, -2px); } }
.a5__pied { grid-column: 1 / -1; margin: 12px 0 70px; font-size: 15px; line-height: 1.35; }
.a5__caution { font-weight: 600; }
.a5__note { margin-top: 6px; font-size: 13px; color: var(--second); }
@media (min-width: 1024px) {
  .a5 .recto { grid-template-rows: auto auto 1fr; padding-top: 104px; padding-bottom: 112px; align-content: stretch; }
  .permis legend { position: static; width: auto; height: auto; clip-path: none; font-weight: 600; font-size: 15px; color: var(--second); margin-bottom: 2px; }
  .permis__ne { border: 0; }
  .verdict { grid-template-columns: 1fr auto; column-gap: 12px; }
  .verdict__nom { grid-column: 1; grid-row: 1; }
  .verdict__prix { grid-column: 2; grid-row: 1; }
  .a5__titre { grid-column: 1 / 7; font-size: clamp(2.8rem, 5.4vw, 6.4rem); margin: 0 0 clamp(16px, 3vh, 40px); }
  .permis { grid-column: 1 / 7; grid-row: 2; }
  .permis__ne { grid-template-columns: repeat(2, max-content); column-gap: 40px; }
  .permis__liste { grid-template-columns: repeat(2, minmax(0, 1fr)); margin-top: clamp(10px, 2vh, 24px); }
  .permis .case { font-size: clamp(17px, 1.25vw, 22px); min-height: clamp(48px, 6.4vh, 72px); }
  .permis .case span::before { width: 28px; height: 28px; }
  .permis legend { font-size: clamp(15px, 1.1vw, 19px); }
  .verdicts { grid-column: 8 / -1; grid-row: 1 / 3; align-self: start; margin-top: 0; }
  .verdict { min-height: clamp(96px, 14vh, 140px); padding-right: 150px; }
  .verdict__nom { font-size: clamp(26px, 2.4vw, 40px); }
  .verdict__prix { font-size: 17px; }
  .verdict__pourquoi { font-size: 16px; }
  .tampon { width: 132px; height: 60px; margin-top: -30px; }
  .tampon b { font-size: 34px; }
  .a5__pied { grid-column: 1 / 10; grid-row: 3; align-self: start; margin: clamp(28px, 5vh, 56px) 0 0; font-size: 16px; }
  .a5__note { font-size: 14px; }
}

/* ——— Ouverture et astres (mouvement permis seulement) ——— */
@media (prefers-reduced-motion: no-preference) {
  .js .a1__soleil { animation: leve 1.4s cubic-bezier(.2, .7, .2, 1) both; }
  @keyframes leve { from { translate: 0 60%; } }
  .js .a1 .conduite i { animation: tire .9s .6s cubic-bezier(.3, .7, .2, 1) both; }
  @keyframes tire { from { transform: scaleX(0); } }
  .lettre { display: inline-block; overflow: hidden; vertical-align: top; padding: 0 .02em; margin: 0 -.02em; }
  .lettre > span { display: inline-block; animation: monte .8s cubic-bezier(.2, .8, .2, 1) both; animation-delay: calc(var(--i) * 40ms + 150ms); }
  @keyframes monte { from { transform: translateY(110%); } }

  @supports (animation-timeline: view()) {
    .js .affiche { view-timeline: --aff block; }
    .js .affiche:not(:last-child) .affiche__glisse { animation: decolle linear both; animation-timeline: --aff; animation-range: exit 0% exit 100%; }
    @keyframes decolle { to { transform: rotate(-6deg); } }
    .js .a1__scene .soleil { animation: leve 1.4s cubic-bezier(.2, .7, .2, 1) both, arc1 linear both; animation-timeline: auto, --aff; animation-range: normal, exit 0% exit 100%; }
    @keyframes arc1 { to { transform: translate(18%, -30%); } }
    .js .a2__soleil { animation: arc2 linear both; animation-timeline: --aff; animation-range: entry 0% exit 100%; }
    @keyframes arc2 { 0% { transform: translate(-60%, 40%); } 50% { transform: none; } 100% { transform: translate(40%, 30%); } }
    .js .a3__soleil { animation: arc3 linear both; animation-timeline: --aff; animation-range: entry 0% exit 100%; }
    @keyframes arc3 { 0% { transform: translate(-260%, 120%); } 50% { transform: none; } 100% { transform: translate(260%, 120%); } }
    .js .a4__lune { animation: arc4 linear both; animation-timeline: --aff; animation-range: entry 0% exit 100%; }
    @keyframes arc4 { 0% { transform: translate(-180%, 140%); } 50% { transform: none; } 100% { transform: translate(120%, -60%); } }
  }
}
