/* Avant, après : deux sites d'une même entreprise fictive, superposés dans le cadre .scene.
   Tout se dimensionne sur la largeur du cadre (cqw) : les deux maquettes se réduisent comme une image. */

.mini {
  position: absolute;
  inset: 0;
  overflow: hidden;
  isolation: isolate; /* les plans d'une maquette ne passent jamais au-dessus de l'autre */
}

/* ---------- Après : le site refait. Même entreprise, même bleu, tout le reste change ---------- */
.apres {
  --ex-fond: #f6f8fb;
  --ex-encre: #0d2240;
  --ex-doux: #4a5b73; /* texte secondaire sur le fond clair */
  --ex-accent: #1b56e0;
  display: grid;
  grid-template-rows: minmax(0, 1fr) auto;
  padding: 8.5cqw 5cqw 3cqw;
  background: var(--ex-fond);
  color: var(--ex-encre);
}

.ap-photo {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: 50% 30%;
  transform-origin: 72% 40%;
}

/* Un voile clair sous le texte : la photo reste entière à droite, là où est le technicien. */
.apres::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 1;
  background: linear-gradient(90deg, var(--ex-fond) 0%, color-mix(in srgb, var(--ex-fond) 88%, transparent) 30%, transparent 60%);
}

.apres > :not(.ap-photo) { z-index: 2; }

.ap-nav {
  position: absolute;
  inset: 1.6cqw 3cqw auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.5cqw;
  padding: 0.55cqw 0.55cqw 0.55cqw 1.7cqw;
  border-radius: var(--pilule);
  background: color-mix(in srgb, var(--blanc) 58%, transparent);
  -webkit-backdrop-filter: blur(16px) saturate(1.6);
  backdrop-filter: blur(16px) saturate(1.6);
  box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--blanc) 70%, transparent);
  font-size: clamp(0.6875rem, 1.12cqw, 1rem);
}

.ap-marque {
  display: inline-flex;
  align-items: center;
  gap: 0.5em;
  letter-spacing: -0.02em;
  white-space: nowrap;
}

.apres svg {
  flex: none;
  width: 1.15em;
  height: 1.15em;
  fill: currentColor;
}

.ap-marque svg { color: var(--ex-accent); }

.ap-liens {
  display: flex;
  gap: 2.2em;
  color: var(--ex-doux);
}

.ap-bouton {
  display: inline-flex;
  align-items: center;
  gap: 0.6em;
  min-height: 3em;
  padding: 0 1.4em;
  border-radius: var(--pilule);
  background: color-mix(in srgb, var(--blanc) 70%, transparent);
  box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--ex-encre) 18%, transparent);
  font-weight: 600;
  white-space: nowrap;
}

.ap-bouton.plein {
  background: var(--ex-accent);
  box-shadow: none;
  color: var(--blanc);
}

.ap-nav .ap-bouton { min-height: 2.5em; }

.ap-texte { align-self: center; }

.ap-titre {
  font-size: clamp(1.5rem, 4.7cqw, 5rem);
  font-weight: 600;
  line-height: 1;
  letter-spacing: -0.042em;
}

.ap-titre span { display: block; }

.ap-chapo {
  margin-top: 1.5cqw;
  max-width: 23em;
  font-size: clamp(0.8125rem, 1.5cqw, 1.3125rem);
  line-height: 1.4;
  color: var(--ex-doux);
}

.ap-actions {
  display: flex;
  gap: 0.7em;
  margin-top: 2.3cqw;
  font-size: clamp(0.75rem, 1.2cqw, 1.0625rem);
}

/* Une tuile sous le texte : la photo est à fleur de bord, sans cadre dans le cadre. */
.ap-tuile {
  justify-self: start;
  display: flex;
  align-items: center;
  overflow: hidden;
  border-radius: var(--r);
  background: color-mix(in srgb, var(--blanc) 78%, transparent);
  box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--ex-encre) 10%, transparent);
  font-size: clamp(0.6875rem, 1cqw, 0.875rem);
  line-height: 1.35;
}

.ap-tuile img {
  display: block;
  width: 7cqw;
  height: auto; /* l'attribut height du HTML ne doit donner que la proportion */
  aspect-ratio: 4 / 3;
  object-fit: cover;
}

.ap-tuile p {
  display: grid;
  padding: 0 1.6cqw 0 1.2cqw;
}

.ap-tuile span { color: var(--ex-doux); }

/* La prise de rendez-vous flotte au-dessus de la photo : c'est elle que le site met en avant. */
.ap-resa {
  position: absolute;
  right: 4cqw;
  bottom: 3cqw;
  display: grid;
  gap: 1cqw;
  width: 21.5cqw;
  padding: 1.4cqw;
  border-radius: var(--r);
  background: var(--blanc);
  box-shadow: var(--ombre);
  font-size: clamp(0.625rem, 0.95cqw, 0.875rem);
  line-height: 1.3;
}

.ap-resa-tete {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 1em;
}

.ap-resa-tete strong {
  font-size: 1.25em;
  letter-spacing: -0.015em;
}

.ap-resa-tete span { color: var(--ex-doux); }

.ap-jours,
.ap-heures {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 0.5cqw;
  text-align: center;
}

.ap-jours span {
  display: grid;
  padding: 0.55cqw 0;
  border-radius: var(--r);
  box-shadow: inset 0 0 0 1px var(--filet);
  color: var(--ex-doux);
}

.ap-jours b {
  font-size: 1.4em;
  font-weight: 600;
  line-height: 1.15;
  color: var(--ex-encre);
}

.ap-heures span {
  padding: 0.5cqw 0;
  border-radius: var(--pilule);
  box-shadow: inset 0 0 0 1px var(--filet);
  font-weight: 600;
  white-space: nowrap;
}

.ap-jours .choisi {
  background: var(--ex-encre);
  box-shadow: none;
  color: color-mix(in srgb, var(--blanc) 70%, transparent);
}

.ap-jours .choisi b { color: var(--blanc); }

.ap-heures .choisi {
  background: var(--ex-accent);
  box-shadow: none;
  color: var(--blanc);
}

.ap-confirme {
  display: flex;
  align-items: center;
  gap: 0.55em;
  font-weight: 600;
}

.ap-confirme svg { color: var(--ex-accent); }

/* En découvrant le nouveau site, la photo se pose et la réservation glisse à sa place : la coupe pilote tout. */
@media (prefers-reduced-motion: no-preference) {
  .ap-photo { scale: calc(1.02 + var(--c) * 0.06); }
  .ap-resa { translate: calc(var(--c) * 3cqw) 0; }
  .ap-tuile { translate: calc(var(--c) * -1.5cqw) 0; }
}

/* ---------- Avant : un site de 2011 comme il en existe encore. Largeur fixe, petit texte, aucun bouton.
   Ses polices et ses bleus ne servent qu'ici ; --px vaut un pixel de la page d'origine, large de 960. ---------- */
.avant {
  --px: calc(70cqw / 960);
  --av-page: #ffffff;
  --av-fond: #e6e8eb;
  --av-bleu: #1d4f8f;
  --av-bleu-clair: #3b7cc4;
  --av-bleu-nuit: #163a69;
  --av-texte: #333333;
  --av-gris: #777777;
  --av-trait: #c5ccd6;
  --av-boite: #eef2f7;
  clip-path: inset(0 calc((1 - var(--c)) * 100%) 0 0);
  background: var(--av-fond);
  color: var(--av-texte);
  font-family: Verdana, Geneva, Tahoma, sans-serif;
  font-size: calc(11 * var(--px));
  line-height: 1.5;
}

.av-page {
  display: flex;
  flex-direction: column;
  width: calc(960 * var(--px));
  height: 100%;
  margin: 0 auto;
  border-inline: 1px solid var(--av-trait);
  background: var(--av-page);
}

.av-tete {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: calc(22 * var(--px)) calc(24 * var(--px));
  background: linear-gradient(var(--av-bleu-clair), var(--av-bleu));
  color: var(--av-page);
}

.av-nom {
  font-family: "Trebuchet MS", Arial, Helvetica, sans-serif;
  font-size: calc(30 * var(--px));
  font-weight: bold;
  line-height: 1.1;
}

.av-nom small {
  display: block;
  margin-top: calc(4 * var(--px));
  font-family: Verdana, Geneva, Tahoma, sans-serif;
  font-size: calc(11 * var(--px));
  font-weight: normal;
}

.av-tel {
  font-family: Arial, Helvetica, sans-serif;
  font-size: calc(17 * var(--px));
  font-weight: bold;
}

.av-menu {
  display: flex;
  background: var(--av-bleu-nuit);
  color: var(--av-page);
  font-family: Arial, Helvetica, sans-serif;
  font-size: calc(12 * var(--px));
  font-weight: bold;
}

.av-menu span {
  padding: calc(8 * var(--px)) calc(20 * var(--px));
  border-right: 1px solid var(--av-bleu);
}

.av-menu .ici { background: var(--av-bleu); }

.av-corps {
  flex: 1;
  display: grid;
  grid-template-columns: minmax(0, 1fr) calc(220 * var(--px));
  gap: calc(22 * var(--px));
  padding: calc(20 * var(--px)) calc(24 * var(--px));
  overflow: hidden;
}

.av-h {
  margin-bottom: calc(10 * var(--px));
  padding-bottom: calc(4 * var(--px));
  border-bottom: 1px dotted var(--av-trait);
  color: var(--av-bleu);
  font-family: Arial, Helvetica, sans-serif;
  font-size: calc(18 * var(--px));
  font-weight: bold;
  line-height: 1.2;
}

.av-h.second {
  clear: both;
  margin-top: calc(16 * var(--px));
  font-size: calc(15 * var(--px));
}

.av-texte img {
  float: left;
  width: calc(208 * var(--px));
  height: auto;
  margin: calc(3 * var(--px)) calc(14 * var(--px)) calc(8 * var(--px)) 0;
  padding: calc(3 * var(--px));
  border: 1px solid var(--av-trait);
}

.av-texte p:not(.av-h) {
  margin-bottom: calc(9 * var(--px));
  text-align: justify;
}

.av-lien {
  color: var(--av-bleu);
  text-decoration: underline;
}

.av-cote {
  display: grid;
  align-content: start;
  gap: calc(14 * var(--px));
}

.av-boite {
  border: 1px solid var(--av-trait);
  background: var(--av-boite);
}

.av-boite b {
  display: block;
  padding: calc(5 * var(--px)) calc(9 * var(--px));
  background: linear-gradient(var(--av-bleu-clair), var(--av-bleu));
  color: var(--av-page);
  font-family: Arial, Helvetica, sans-serif;
  font-size: calc(12 * var(--px));
}

.av-boite span {
  display: block;
  padding: calc(7 * var(--px)) calc(9 * var(--px));
}

.av-pied {
  padding: calc(9 * var(--px));
  border-top: 1px solid var(--av-trait);
  color: var(--av-gris);
  font-size: calc(10 * var(--px));
  text-align: center;
}

/* ---------- Les deux étiquettes voyagent avec la coupe, chacune de son côté ---------- */
.etiquette {
  position: absolute;
  bottom: 1rem;
  padding: 0.35em 0.85em;
  border-radius: var(--pilule);
  background: var(--encre);
  color: var(--blanc);
  font-size: var(--t-1);
  font-weight: 600;
  letter-spacing: 0.01em;
  white-space: nowrap;
}

.cote-avant { right: calc(50% + 0.75rem); }
.cote-apres { left: calc(50% + 0.75rem); }

/* ---------- Cadre étroit (téléphone) : le nouveau site passe en colonne, l'ancien reste une page de bureau réduite ---------- */
@container (max-width: 40rem) {
  .apres {
    grid-template-rows: auto;
    align-content: start;
    padding: 19cqw 6cqw 0;
  }

  .ap-photo {
    top: auto;
    height: 54%;
    object-position: 76% 20%;
  }

  .apres::before {
    background: linear-gradient(180deg, var(--ex-fond) 46%, transparent 62%);
  }

  .ap-nav {
    inset: 3cqw 3cqw auto;
    padding: 1.4cqw 1.4cqw 1.4cqw 4cqw;
    font-size: 3.5cqw;
  }

  .ap-liens,
  .ap-tuile,
  .ap-resa,
  .ap-actions .ap-bouton:not(.plein) { display: none; }

  .ap-texte { align-self: start; }
  .ap-titre { font-size: 8.4cqw; }

  .ap-chapo {
    margin-top: 3cqw;
    font-size: 3.9cqw;
  }

  .ap-actions {
    margin-top: 4.5cqw;
    font-size: 3.8cqw;
  }

  .avant { --px: calc(100cqw / 960); }
}

@media (prefers-reduced-transparency: reduce) {
  .ap-nav,
  .ap-bouton:not(.plein),
  .ap-tuile {
    -webkit-backdrop-filter: none;
    backdrop-filter: none;
    background: var(--blanc);
  }
}
