/* G355 — Modal projet desktop rééquilibrée + cartes membres uniformes + motion visible mais discret.
   Desktop only for modal sizing/sticky; mobile keeps native page/scroll behavior. */

@media (min-width:900px){
  #project-modal{
    padding:92px 24px 30px!important;
    align-items:flex-start!important;
    justify-content:center!important;
  }
  #project-modal .modal-box{
    width:min(1250px,94vw)!important;
    max-width:none!important;
    max-height:calc(100dvh - 122px)!important;
    margin:0 auto!important;
    border-radius:28px!important;
    overflow-y:auto!important;
    overflow-x:hidden!important;
    overscroll-behavior:contain!important;
  }
  #project-modal #projectDetail{
    padding:12px 30px 38px!important;
    overflow:visible!important;
  }
  #project-modal .project-detail-head .form-title{
    max-width:820px!important;
  }
  #project-modal .project-premium-layout{
    position:relative!important;
    display:grid!important;
    grid-template-columns:minmax(0,1fr) 330px!important;
    gap:30px!important;
    align-items:start!important;
    overflow:visible!important;
  }
  #project-modal .project-premium-main{
    min-width:0!important;
    overflow:visible!important;
  }
  /* The modal-box is the actual scrolling container. Keep the complete rail pinned
     directly below the sticky close row for the whole project content. */
  #project-modal .project-premium-rail{
    position:-webkit-sticky!important;
    position:sticky!important;
    top:78px!important;
    align-self:start!important;
    z-index:22!important;
    width:100%!important;
    height:max-content!important;
    margin:0!important;
    background:#fff!important;
    box-shadow:0 10px 28px rgba(18,18,18,.035)!important;
    transform:translateZ(0);
  }
  #project-modal .project-hero-photo img{
    height:360px!important;
  }

  /* Four member preferences: exactly the same 2x2 cards on desktop. */
  #project-modal .member-card .member-preferences{
    grid-template-columns:repeat(2,minmax(0,1fr))!important;
    gap:12px!important;
    margin-top:18px!important;
  }
  #project-modal .member-card .member-pref,
  #project-modal .member-card .member-pref:first-child,
  #project-modal .member-card .member-pref:last-child{
    min-height:86px!important;
    padding:15px 16px!important;
    border:1px solid #e9e3dc!important;
    border-radius:16px!important;
    background:#fcfbf9!important;
    box-shadow:none!important;
    display:flex!important;
    flex-direction:column!important;
    justify-content:center!important;
  }
  #project-modal .member-card .member-pref small{
    margin:0 0 7px!important;
  }
}

/* On mobile keep the existing two-column rhythm, but make all four cells visually equal. */
@media (max-width:899px){
  #project-modal .project-premium-rail{
    position:static!important;
    top:auto!important;
    transform:none!important;
  }
  #project-modal .member-card .member-preferences{
    grid-template-columns:repeat(2,minmax(0,1fr))!important;
    gap:10px!important;
  }
  #project-modal .member-card .member-pref,
  #project-modal .member-card .member-pref:first-child,
  #project-modal .member-card .member-pref:last-child{
    min-height:78px!important;
    padding:13px 12px!important;
    border:1px solid #e9e3dc!important;
    border-radius:15px!important;
    background:#fcfbf9!important;
    box-shadow:none!important;
    display:flex!important;
    flex-direction:column!important;
    justify-content:center!important;
  }
}

/* Section reveal. The JS waits two frames before observing so the hidden state is
   actually painted first; this makes the animation visible instead of being skipped. */
html.g355-motion-ready .g355-reveal{
  opacity:.12;
  transform:translate3d(0,28px,0) scale(.994);
  transition:
    opacity .68s cubic-bezier(.2,.72,.2,1),
    transform .68s cubic-bezier(.2,.72,.2,1);
  transition-delay:var(--g355-delay,0ms);
  will-change:opacity,transform;
}
html.g355-motion-ready .g355-reveal.g355-in-view{
  opacity:1;
  transform:translate3d(0,0,0) scale(1);
  will-change:auto;
}

/* Cards: visible premium hover, pointer devices only. */
.card.project-card.open-project,
.beta-property-card,
.admin-beta-property-card{
  transition:
    transform .34s cubic-bezier(.2,.72,.2,1),
    box-shadow .34s ease,
    border-color .34s ease!important;
}
.card.project-card.open-project .listing-photo-user,
.beta-property-card .beta-property-photo img,
.admin-beta-property-card .admin-beta-property-card-photo img{
  transition:transform .52s cubic-bezier(.2,.72,.2,1),opacity .3s ease!important;
  transform-origin:center center;
}
@media (hover:hover) and (pointer:fine){
  .card.project-card.open-project:hover,
  .card.project-card.open-project:focus-within,
  .beta-property-card:hover,
  .beta-property-card:focus-within,
  .admin-beta-property-card:hover,
  .admin-beta-property-card:focus-within{
    transform:translateY(-6px)!important;
    border-color:rgba(255,97,77,.62)!important;
    box-shadow:
      0 22px 48px rgba(22,22,22,.13),
      0 0 0 1px rgba(255,97,77,.20)!important;
  }
  .card.project-card.open-project:hover .listing-photo-user,
  .card.project-card.open-project:focus-within .listing-photo-user,
  .beta-property-card:hover .beta-property-photo img,
  .beta-property-card:focus-within .beta-property-photo img,
  .admin-beta-property-card:hover .admin-beta-property-card-photo img,
  .admin-beta-property-card:focus-within .admin-beta-property-card-photo img{
    transform:scale(1.04);
  }
}

/* Hero disclosures: the entire label remains clickable; text + icon clearly react together. */
.hero-v3033 .g345-buyer-toggle,
.hero-v3033 .g341-home-disclosure-seller summary{
  transition:transform .28s cubic-bezier(.2,.72,.2,1),opacity .25s ease!important;
}
.hero-v3033 .g345-buyer-toggle-copy,
.hero-v3033 .g341-home-disclosure-seller .g341-home-disclosure-summary-copy{
  transition:transform .28s cubic-bezier(.2,.72,.2,1),opacity .25s ease!important;
}
.hero-v3033 .g345-buyer-toggle .g341-home-disclosure-icon,
.hero-v3033 .g341-home-disclosure-seller .g341-home-disclosure-icon{
  transition:
    background .25s ease,
    border-color .25s ease,
    color .25s ease,
    transform .38s cubic-bezier(.2,.75,.2,1),
    box-shadow .25s ease!important;
}
.hero-v3033 .g345-buyer-details[open] .g341-home-disclosure-content,
.hero-v3033 .g341-home-disclosure-seller[open] .g341-home-disclosure-content{
  animation:g355DisclosureIn .34s cubic-bezier(.2,.72,.2,1) both;
}
@keyframes g355DisclosureIn{
  from{opacity:0;transform:translate3d(0,-7px,0)}
  to{opacity:1;transform:translate3d(0,0,0)}
}
@media (hover:hover) and (pointer:fine){
  .hero-v3033 .g345-buyer-toggle:hover .g345-buyer-toggle-copy,
  .hero-v3033 .g345-buyer-toggle:focus-visible .g345-buyer-toggle-copy,
  .hero-v3033 .g341-home-disclosure-seller summary:hover .g341-home-disclosure-summary-copy,
  .hero-v3033 .g341-home-disclosure-seller summary:focus-visible .g341-home-disclosure-summary-copy{
    transform:translateX(3px);
    opacity:.82;
  }
  .hero-v3033 .g345-buyer-toggle:hover .g341-home-disclosure-icon,
  .hero-v3033 .g345-buyer-toggle:focus-visible .g341-home-disclosure-icon,
  .hero-v3033 .g341-home-disclosure-seller summary:hover .g341-home-disclosure-icon,
  .hero-v3033 .g341-home-disclosure-seller summary:focus-visible .g341-home-disclosure-icon{
    transform:translateY(-2px) rotate(90deg)!important;
    border-color:rgba(255,97,77,.52)!important;
    background:rgba(255,97,77,.10)!important;
    box-shadow:0 8px 20px rgba(255,97,77,.12)!important;
  }
  .hero-v3033 .g345-buyer-toggle.is-open:hover .g341-home-disclosure-icon,
  .hero-v3033 .g345-buyer-toggle.is-open:focus-visible .g341-home-disclosure-icon,
  .hero-v3033 .g341-home-disclosure-seller[open] summary:hover .g341-home-disclosure-icon,
  .hero-v3033 .g341-home-disclosure-seller[open] summary:focus-visible .g341-home-disclosure-icon{
    transform:translateY(-2px) rotate(270deg)!important;
  }
}
.hero-v3033 .g345-buyer-toggle.is-open .g341-home-disclosure-icon,
.hero-v3033 .g341-home-disclosure-seller[open] .g341-home-disclosure-icon{
  transform:rotate(180deg);
}

@media (max-width:899px){
  html.g355-motion-ready .g355-reveal{
    transform:translate3d(0,18px,0);
    transition-duration:.52s;
  }
  .card.project-card.open-project,
  .beta-property-card,
  .admin-beta-property-card{
    transform:none;
  }
}

@media (prefers-reduced-motion:reduce){
  html.g355-motion-ready .g355-reveal,
  .card.project-card.open-project,
  .beta-property-card,
  .admin-beta-property-card,
  .card.project-card.open-project .listing-photo-user,
  .beta-property-card .beta-property-photo img,
  .admin-beta-property-card .admin-beta-property-card-photo img,
  .hero-v3033 .g345-buyer-toggle,
  .hero-v3033 .g341-home-disclosure-seller summary,
  .hero-v3033 .g345-buyer-toggle-copy,
  .hero-v3033 .g341-home-disclosure-summary-copy,
  .hero-v3033 .g341-home-disclosure-icon,
  .hero-v3033 .g341-home-disclosure-content{
    transition:none!important;
    animation:none!important;
    transform:none!important;
    opacity:1!important;
  }
}
