/* ==========================================================================
   SITE INTERNET — « Les réalisations » : dossiers en verre + aperçu des sites
   Préfixe : .srea-  (aucune collision avec tokens/base/hero/site/footer/book)

   Mécanique reprise à l'identique de l'ancien site (realisations.css) :
   trois couches par dossier, de l'arrière vers l'avant — un panneau de fond
   découpé en forme de dossier, les fiches (de vrais boutons) et un panneau
   avant en verre dépoli qui floute ce qui passe derrière.
     - au repos      : fermé, à plat ; seul le haut des fiches dépasse.
     - au survol     : le panneau avant bascule sur sa charnière basse.
     - ouvert (clic) : il tombe plus bas, les fiches montent en escalier.
   Mêmes géométries (340 × 272, mêmes clip-path, mêmes durées/ressorts), seules
   les couleurs, les ombres et les typos sont réécrites avec les tokens v2.

   z-index : l'aperçu est à 900 — au-dessus de la navbar (100), EN DESSOUS de
   la modale de réservation (1000, css/book.css).
   ========================================================================== */

.srea {
  --srea-ease:   cubic-bezier(.2, .8, .2, 1);
  --srea-spring: cubic-bezier(.34, 1.36, .5, 1);
  position: relative; isolation: isolate;
  /* la lueur dépasse le bord droit : on la coupe ici, sinon elle élargit la page */
  overflow: clip;
  padding: var(--section-y) 0;
}

.srea .site-head { margin-bottom: clamp(44px, 5vw, 68px); }

.srea-grid {
  /* `min(300px, 100%)` : sous 320 px la colonne de 300 px plus les marges
     dépassait l'écran et poussait toute la page. */
  display: grid; grid-template-columns: repeat(auto-fit, minmax(min(300px, 100%), 1fr));
  gap: clamp(28px, 3.4vw, 52px);
  justify-items: center; align-items: start;
}

/* ---------- le dossier --------------------------------------------------- */

.srea-fold {
  --hinge: 0deg;
  --lift: 42px;
  --spread: 0px;
  --fan: 0deg;
  --stack: 15px;
  position: relative; width: 340px; max-width: 100%;
  height: 382px;              /* 272 de dossier + le ciel où montent les fiches */
  isolation: isolate;
}
.srea-fold:hover, .srea-fold:focus-within {
  --hinge: -11deg; --lift: -34px; --spread: 8px; --fan: 1.4deg; --stack: 10px;
}
/* Ouvert, les fiches montent en escalier : chacune expose sa bande de titre,
   donc chacune est lisible et cliquable. */
.srea-fold.is-open {
  --hinge: -24deg; --lift: -86px; --spread: 6px; --fan: .8deg; --stack: 52px;
  z-index: 3;
}

.srea-stage { position: absolute; left: 0; top: 110px; width: 100%; max-width: 340px; height: 272px; }

.srea-shadow {
  position: absolute; left: 14px; right: 14px; bottom: -10px; height: 70px;
  border-radius: 40px; background: rgba(0, 0, 0, .8); filter: blur(26px);
}

/* le panneau de fond, découpé en forme de dossier.
   Nettement plus clair que la page (#0a0a0a) : le dossier doit se lire comme
   un objet posé dessus, pas se fondre dedans. */
.srea-back {
  position: absolute; inset: 0; overflow: hidden;
  background: linear-gradient(170deg, #3a3024 0%, #2b2419 56%, #211b13 100%);
  clip-path: path('M0 56A22 22 0 0 1 22 34L146 34C170 34 172 0 198 0L318 0A22 22 0 0 1 340 22L340 250A22 22 0 0 1 318 272L22 272A22 22 0 0 1 0 250Z');
}
.srea-back::after {
  content: ''; position: absolute; inset: 0;
  background:
    linear-gradient(180deg, rgba(255,255,255,.1) 0%, rgba(255,255,255,0) 26%),
    radial-gradient(120% 80% at 78% 0%, rgba(var(--orange-rgb),.26), rgba(var(--orange-rgb),0) 62%);
}

/* Le liseré : la forme découpée n'accepte pas de bordure, on la retrace. */
.srea-rim {
  position: absolute; left: 0; top: 0;
  max-width: none; overflow: visible; pointer-events: none; fill: none;
}
.srea-rim-back { width: 340px; height: 272px; z-index: 1; }
.srea-rim-back path { stroke: rgba(var(--orange-rgb), .3); stroke-width: 1.2; }
.srea-rim-front { width: 340px; height: 198px; z-index: 3; }
.srea-rim-front path { stroke: rgba(var(--orange-rgb), .45); stroke-width: 1.4; }

/* les fiches */
.srea-files {
  position: absolute; inset: 0; z-index: 5; pointer-events: none;
  clip-path: inset(-400px -400px 10px -400px);   /* rien ne dépasse par le bas */
}
.srea-file {
  all: unset; box-sizing: border-box;
  position: absolute; left: 34px; top: 96px; width: 272px; height: 184px;
  border-radius: 16px; overflow: hidden; cursor: pointer; pointer-events: auto;
  background: #141414;
  font-family: var(--font-body);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, .14),
    0 0 0 .5px rgba(255, 255, 255, .1),
    0 12px 28px -8px rgba(0, 0, 0, .8);
  transform-origin: 50% 100%;
  transform:
    translate(calc(var(--jx) + var(--slot) * var(--spread)),
              calc(var(--lift) + var(--depth) * var(--stack) * -1))
    rotate(calc(var(--jr) + var(--slot) * var(--fan)));
  transition:
    transform .75s var(--srea-spring) calc(var(--depth) * 40ms),
    box-shadow .4s var(--srea-ease);
}
.srea-fold.is-open .srea-file:hover,
.srea-fold.is-open .srea-file:focus-visible {
  transform:
    translate(calc(var(--jx) + var(--slot) * var(--spread)),
              calc(var(--lift) + var(--depth) * var(--stack) * -1 - 18px))
    rotate(calc(var(--slot) * var(--fan) * .6));
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, .2),
    0 0 0 1px rgba(var(--orange-rgb), .6),
    0 24px 44px -12px rgba(0, 0, 0, .9);
  transition-delay: 0s;
}
.srea-file:focus-visible { outline: 2px solid var(--orange); outline-offset: 3px; }
.srea-file img {
  position: absolute; inset: 0; width: 100%; height: 100%;
  object-fit: cover; object-position: top center; display: block;
}
.srea-file::after {
  content: ''; position: absolute; inset: 0; border-radius: inherit;
  background: linear-gradient(180deg, rgba(10,10,10,.93) 0%, rgba(10,10,10,.74) 52px, rgba(10,10,10,.12) 58%, rgba(10,10,10,.5) 100%);
  pointer-events: none;
}
.srea-file b, .srea-file i {
  position: absolute; left: 14px; right: 46px; z-index: 1;
  font-style: normal; white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.srea-file b {
  top: 12px; font-size: 13.5px; font-weight: 600; color: #fff;
  letter-spacing: -.01em;
}
.srea-file i {
  top: 31px; font-size: 11.5px; color: rgba(255, 255, 255, .78);
}
/* la flèche ne se révèle qu'une fois le dossier ouvert */
.srea-file u {
  position: absolute; right: 12px; top: 14px; z-index: 2;
  display: grid; place-items: center;
  width: 26px; height: 26px; border-radius: 50%;
  text-decoration: none; color: #0a0a0a; background: var(--orange);
  box-shadow: 0 6px 16px -6px rgba(var(--orange-rgb), .8);
  opacity: 0; transform: scale(.6);
  transition: opacity .3s var(--srea-ease), transform .4s var(--srea-spring);
}
.srea-fold.is-open .srea-file u { opacity: 1; transform: none; transition-delay: .2s; }
.srea-file u svg { width: 12px; height: 12px; fill: none; stroke: currentColor; stroke-width: 2; }

/* le panneau avant, en verre, charnière sur son bord bas */
.srea-front {
  position: absolute; left: 0; top: 74px; width: 340px; height: 198px; z-index: 10;
  -webkit-backdrop-filter: blur(22px) saturate(1.4);
  backdrop-filter: blur(22px) saturate(1.4);
  transform-origin: 50% 100%;
  transform: perspective(760px) rotateX(var(--hinge));
  transition: transform .8s var(--srea-spring);
  clip-path: path('M0 22A22 22 0 0 1 22 0L118 0C144 0 146 32 172 32L318 32A22 22 0 0 1 340 54L340 176A22 22 0 0 1 318 198L22 198A22 22 0 0 1 0 176Z');
}
/* le verre reste au-dessus du ton de la page sur toute sa hauteur, sinon la
   moitié basse du dossier disparaît dans le noir */
.srea-front::before {
  content: ''; position: absolute; inset: 0;
  background: linear-gradient(180deg, rgba(94,78,56,.55) 0%, rgba(62,51,37,.88) 46%, rgba(46,38,28,.96) 100%);
}
.srea-front::after {
  content: ''; position: absolute; inset: 0;
  background: radial-gradient(260px 200px at 50% 26%, rgba(255,255,255,.14), rgba(255,255,255,0) 72%);
  pointer-events: none;
}

.srea-hit { all: unset; position: absolute; inset: 0; z-index: 2; cursor: pointer; }
.srea-hit:focus-visible { outline: 2px solid var(--orange); outline-offset: -4px; border-radius: 22px; }

.srea-label {
  position: absolute; left: 28px; bottom: 30px; z-index: 1;
  display: flex; flex-direction: column; gap: 6px;
  max-width: 230px; pointer-events: none;
}
.srea-label b {
  font-family: var(--font-display); font-weight: 600;
  font-size: 16.5px; line-height: 1.15; letter-spacing: -.035em; color: #fff;
}
.srea-label span { font-family: var(--font-body); font-size: 12.5px; color: rgba(255, 255, 255, .72); }

/* la poignée : elle tourne quand le dossier s'ouvre */
.srea-key {
  position: absolute; right: 22px; bottom: 22px; z-index: 12;
  width: 50px; height: 50px; border-radius: 16px;
  display: grid; place-items: center; pointer-events: none;
  background: linear-gradient(180deg, rgba(10,10,10,.44) 0%, rgba(10,10,10,.26) 100%);
  border: 1px solid rgba(var(--orange-rgb), .34);
  -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px);
  transition: transform .5s var(--srea-spring), background .4s var(--srea-ease), box-shadow .4s var(--srea-ease);
}
.srea-fold.is-open .srea-key {
  transform: rotate(45deg);
  background: rgba(var(--orange-rgb), .24);
  box-shadow: 0 0 0 1px rgba(var(--orange-rgb), .5), 0 10px 28px -10px rgba(var(--orange-rgb), .7);
}
.srea-peep {
  position: absolute; left: 50%; bottom: 128px; z-index: 1;
  width: 252px; transform: translateX(-50%) translateY(14px) rotate(-1.6deg);
  border-radius: 10px 10px 4px 4px; overflow: hidden;
  background: #141414; box-shadow: 0 -8px 24px -10px rgba(0,0,0,.8), 0 0 0 1px rgba(255,255,255,.1);
  transition: transform .6s cubic-bezier(.34,1.36,.5,1), opacity .4s ease;
}
.srea-peep img { display: block; width: 100%; height: 124px; object-fit: cover; object-position: top; }
.srea-peep-n {
  position: absolute; top: 8px; right: 8px; padding: 4px 9px; border-radius: 999px;
  background: var(--orange); color: #0a0a0a; font: 700 11px/1 var(--font-body);
}
.srea-fold:hover .srea-peep, .srea-fold.is-open .srea-peep { opacity: 0; transform: translateX(-50%) translateY(-30px) rotate(-1.6deg); }
.srea-fold:not(.is-in) .srea-peep { opacity: 0; transform: translateX(-50%) translateY(40px); }
[data-theme="light"] .srea-peep { background: #fff; box-shadow: 0 -8px 24px -12px rgba(90,50,10,.5), 0 0 0 1px rgba(60,40,20,.12); }
.srea-key svg {
  width: 22px; height: 22px; fill: none; stroke: #fff;
  stroke-width: 1.6; stroke-linecap: round;
}

/* l'assemblage à l'arrivée à l'écran (classe .is-in posée par site-rea.js) */
.srea-fold:not(.is-in) .srea-back  { transform: translateY(22px); opacity: 0; }
.srea-fold:not(.is-in) .srea-file  { opacity: 0; }
.srea-fold:not(.is-in) .srea-front { transform: translateY(46px); opacity: 0; }
.srea-fold:not(.is-in) .srea-key   { opacity: 0; transform: scale(.6); }
.srea-fold:not(.is-in) .srea-shadow { opacity: 0; }
.srea-back, .srea-shadow { transition: transform 1s var(--srea-ease), opacity .9s var(--srea-ease); }
.srea-fold.is-in .srea-file { transition-delay: calc(var(--depth) * 40ms); }
.srea-fold.is-in .srea-front { transition: transform .8s var(--srea-spring) .3s, opacity .8s var(--srea-ease) .3s; }

/* ---------- la ligne de rappel + les boutons ----------------------------- */
.srea-after {
  display: flex; flex-direction: column; align-items: center; gap: 22px;
  margin-top: clamp(40px, 5vw, 64px); text-align: center;
}
.srea-after-line { max-width: 44ch; color: var(--site-ink-2, rgba(255,255,255,.72)); font-size: 16px; line-height: 1.6; }
.srea-actions { display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: 14px; }

/* ==========================================================================
   L'APERÇU : le vrai site, par-dessus la page
   Le site est chargé par son adresse et fonctionne entièrement. S'il refuse
   le cadre (ou ne répond pas en 9 s), sa capture pleine page prend le relais.
   Fermable : bouton de retour, touche Échap, clic sur le fond.
   ========================================================================== */

.srea-peek {
  position: fixed; inset: 0; z-index: 900;
  display: grid; place-items: stretch;
  padding: clamp(10px, 2.2vw, 26px);
  background: rgba(4, 4, 4, .82);
  -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px);
  opacity: 0; visibility: hidden;
  transition: opacity .28s var(--srea-ease, ease), visibility 0s .28s;
}
.srea-peek.is-on { opacity: 1; visibility: visible; transition-delay: 0s; }
html.srea-lock { overflow: hidden; }

.srea-box {
  position: relative; min-width: 0; min-height: 0;
  display: flex; flex-direction: column; overflow: hidden;
  border-radius: 16px;
  background: #0d0d0d;
  border: 1px solid rgba(255, 255, 255, .12);
  box-shadow: 0 60px 120px -40px rgba(0, 0, 0, .9), 0 0 0 1px rgba(var(--orange-rgb), .1);
  transform: scale(.985) translateY(10px);
  transition: transform .34s var(--srea-spring, ease);
}
.srea-peek.is-on .srea-box { transform: none; }

/* le bandeau : la flèche de retour, le nom du client, le lien vers le site */
.srea-bar {
  flex: none; display: flex; align-items: center; gap: 14px;
  padding: 9px 12px;
  border-bottom: 1px solid rgba(255, 255, 255, .1);
  background: linear-gradient(180deg, #181818 0%, #101010 100%);
}
.srea-back-btn {
  flex: none; display: inline-flex; align-items: center; gap: 9px;
  padding: 9px 16px 9px 11px; border-radius: var(--radius-pill); cursor: pointer;
  background: rgba(255, 255, 255, .06);
  border: 1px solid rgba(255, 255, 255, .16);
  color: #fff; font-family: var(--font-body); font-size: 13.5px; font-weight: 600;
  transition: background .2s var(--srea-ease), border-color .2s var(--srea-ease);
}
.srea-back-btn:hover { background: rgba(255, 255, 255, .14); border-color: rgba(var(--orange-rgb), .5); }
.srea-back-btn svg {
  width: 17px; height: 17px; flex: none;
  fill: none; stroke: currentColor; stroke-width: 2.1;
  stroke-linecap: round; stroke-linejoin: round;
}

.srea-who { min-width: 0; display: grid; gap: 1px; }
.srea-who b {
  font-family: var(--font-display); font-weight: 600;
  font-size: 13.5px; letter-spacing: -.03em; color: #fff;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.srea-who span {
  font-size: 12px; color: rgba(255, 255, 255, .62);
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.srea-open { margin-left: auto; flex: none; }

/* le site lui-même, vivant et entier */
.srea-vue { flex: 1; min-height: 0; position: relative; background: #fff; }
.srea-vue iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; display: block; }

/* le repli : la capture pleine page, à sa largeur de rendu réelle */
.srea-repli {
  position: absolute; inset: 0; z-index: 2; display: none;
  overflow: hidden auto; overscroll-behavior: contain;
  background: #0d0d0d;
  justify-content: center; align-items: flex-start;
}
.srea-box.is-repli .srea-repli { display: flex; }
.srea-box.is-repli .srea-vue iframe { display: none; }
.srea-page { flex: none; display: block; max-width: none; height: auto; background: #fff; }

.srea-wait {
  position: absolute; inset: 0; z-index: 3;
  display: grid; place-items: center; gap: 14px;
  color: rgba(255, 255, 255, .7); font-size: 14px;
  background: #0d0d0d;
}
.srea-wait[hidden] { display: none; }
.srea-wait::before {
  content: ''; width: 26px; height: 26px; border-radius: 50%;
  border: 2px solid rgba(var(--orange-rgb), .25); border-top-color: var(--orange);
  animation: srea-spin .8s linear infinite;
}
@keyframes srea-spin { to { transform: rotate(360deg) } }

/* ---------- petits écrans ------------------------------------------------- */
@media (max-width: 860px) {
  /* écran étroit : l'escalier se resserre pour rester dans le cadre du dossier */
  .srea-fold.is-open { --lift: -62px; --stack: 48px; }
}

@media (max-width: 620px) {
  /* plein écran pile : la capture de repli est prise à 390 px, aucune marge
     latérale ne doit la rogner. Échap et le bouton ferment l'aperçu. */
  .srea-peek { padding: 0; }
  .srea-box { border-radius: 0; border: 0; }
  .srea-back-btn span { display: none; }
  .srea-back-btn { padding: 10px; }
  .srea-open .btn-label { padding: 0 14px; }
}

@media (max-width: 380px) {
  /* Le dossier est dessiné en coordonnées fixes — 340 × 272, découpes
     comprises : on ne peut pas l'étirer sans casser la forme. Sur un petit
     écran on le réduit en bloc, et on rattrape la hauteur perdue. */
  .srea-fold { transform: scale(.86); transform-origin: top left; margin-bottom: -54px; }
}

@media (prefers-reduced-motion: reduce) {
  .srea-fold, .srea-fold *, .srea-peek, .srea-peek * {
    transition-duration: .001ms !important;
    transition-delay: 0s !important;
    animation: none !important;
  }
}

/* ==========================================================================
   MODE CLAIR — overrides seulement (le sombre est inchangé)
   Le dossier passe en carton/papier chaud, le verre en blanc laiteux.
   ========================================================================== */
[data-theme="light"] .srea-shadow { background: rgba(90, 52, 14, .34); }
[data-theme="light"] .srea-back { background: linear-gradient(170deg, #f0e1ca 0%, #e8d5b7 56%, #dfc9a7 100%); }
[data-theme="light"] .srea-back::after {
  background:
    linear-gradient(180deg, rgba(255,255,255,.5) 0%, rgba(255,255,255,0) 30%),
    radial-gradient(120% 80% at 78% 0%, rgba(var(--orange-rgb),.3), rgba(var(--orange-rgb),0) 62%);
}
[data-theme="light"] .srea-rim-back path { stroke: rgba(15, 15, 15, .14); }
[data-theme="light"] .srea-rim-front path { stroke: rgba(15, 15, 15, .2); }

[data-theme="light"] .srea-front::before {
  background: linear-gradient(180deg, rgba(255,253,249,.72) 0%, rgba(255,250,241,.93) 46%, rgba(250,242,229,.97) 100%);
}
[data-theme="light"] .srea-front::after {
  background: radial-gradient(260px 200px at 50% 26%, rgba(255,255,255,.7), rgba(255,255,255,0) 72%);
}
[data-theme="light"] .srea-label b { color: var(--text); }
[data-theme="light"] .srea-label span { color: #5e584f; }
[data-theme="light"] .srea-key {
  background: linear-gradient(180deg, rgba(255,255,255,.75) 0%, rgba(255,255,255,.45) 100%);
  border-color: rgba(15, 15, 15, .18);
}
[data-theme="light"] .srea-key svg { stroke: #0f0f0f; }
[data-theme="light"] .srea-fold.is-open .srea-key {
  background: var(--orange);
  box-shadow: 0 0 0 1px rgba(217, 96, 0, .4), 0 10px 26px -10px rgba(217, 96, 0, .6);
}
[data-theme="light"] .srea-fold.is-open .srea-key svg { stroke: #0a0a0a; }

[data-theme="light"] .srea-file {
  background: #fffdf9;
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, .9),
    0 0 0 .5px rgba(15, 15, 15, .1),
    0 14px 30px -10px rgba(90, 52, 14, .4);
}
[data-theme="light"] .srea-fold.is-open .srea-file:hover,
[data-theme="light"] .srea-fold.is-open .srea-file:focus-visible {
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, .9),
    0 0 0 1px rgba(217, 96, 0, .55),
    0 24px 44px -12px rgba(90, 52, 14, .5);
}

[data-theme="light"] .srea-peek { background: rgba(60, 40, 18, .5); }
[data-theme="light"] .srea-box {
  background: var(--surface); border-color: rgba(15, 15, 15, .12);
  box-shadow: 0 60px 110px -44px rgba(90, 52, 14, .55), 0 0 0 1px rgba(15, 15, 15, .05);
}
[data-theme="light"] .srea-bar {
  background: linear-gradient(180deg, #fffdf9 0%, #f6f0e6 100%);
  border-bottom-color: rgba(15, 15, 15, .1);
}
[data-theme="light"] .srea-back-btn {
  background: rgba(255, 255, 255, .8); border-color: rgba(15, 15, 15, .16); color: var(--text);
}
[data-theme="light"] .srea-back-btn:hover { background: #fff; border-color: rgba(217, 96, 0, .45); }
[data-theme="light"] .srea-who b { color: var(--text); }
[data-theme="light"] .srea-who span { color: #5e584f; }
[data-theme="light"] .srea-repli, [data-theme="light"] .srea-wait { background: #f3eee6; }
[data-theme="light"] .srea-wait { color: #5e584f; }

/* le + devient un indice d'ouverture : au survol, le dossier s'ouvre seul */
@media (hover: hover) and (pointer: fine){ .srea-hit{cursor:default} }
