/* ============================================================
   SG ATELIER — Projets hors normes (index + page détail)
   Chargé uniquement sur la page concernée (mu-plugin).
   Tout est préfixé .sg-projets* pour ne rien casser du thème.
   ============================================================ */
.sg-projets-index,
.sg-projet-detail{
  --sg-accent:#5f7a6e;        /* vert-de-gris / patine */
  --sg-accent-dk:#3f564c;
  --sg-ink:#232019;
  --sg-muted:#6c675c;
  --sg-line:#d8d3c8;
  --sg-surface:#f6f4ef;
  --sg-serif:Georgia,"Times New Roman",serif;
  margin:1.5em 0 0;
}

/* ---------------------------------------------------------------
   INDEX : une couverture par projet (grille 3 → 2 → 1 colonnes)
   --------------------------------------------------------------- */
.sg-proj-grid{
  display:grid; grid-template-columns:repeat(3,1fr); gap:22px; align-items:start;
}
@media (max-width:860px){ .sg-proj-grid{grid-template-columns:repeat(2,1fr); gap:16px} }
@media (max-width:520px){ .sg-proj-grid{grid-template-columns:1fr} }

.sg-proj-card{
  display:flex; flex-direction:column; text-decoration:none; color:var(--sg-ink);
  background:var(--sg-surface); border:1px solid var(--sg-line); position:relative;
  transition:box-shadow .18s, transform .18s;
}
.sg-proj-card:hover{ box-shadow:0 10px 30px rgba(0,0,0,.12); }
.sg-proj-cover{ display:block; overflow:hidden; aspect-ratio:4/3; background:#e9e5dc; }
.sg-proj-cover img{
  display:block; width:100%; height:100%; object-fit:cover; margin:0;
  transition:transform .4s ease;
}
.sg-proj-card:hover .sg-proj-cover img{ transform:scale(1.04); }
.sg-proj-meta{ display:block; padding:14px 16px 16px; }
.sg-proj-title{
  display:block; font-family:var(--sg-serif); font-size:1.2rem; line-height:1.25; color:var(--sg-ink);
}
.sg-proj-more{
  display:block; margin-top:9px; font-size:11px; letter-spacing:.14em; text-transform:uppercase;
  color:var(--sg-accent-dk);
}
.sg-proj-card::after{
  content:""; position:absolute; inset:0; pointer-events:none;
  box-shadow:inset 0 0 0 0 transparent; transition:box-shadow .18s;
}
.sg-proj-card:hover::after{ box-shadow:inset 0 0 0 2px var(--sg-accent); }

/* ---------------------------------------------------------------
   PAGE DÉTAIL : retour + titre + descriptif + galerie
   --------------------------------------------------------------- */
.sg-proj-back{
  display:inline-flex; align-items:center; gap:7px; text-decoration:none;
  font-size:12px; letter-spacing:.12em; text-transform:uppercase;
  color:var(--sg-accent-dk); border:1px solid var(--sg-line); background:var(--sg-surface);
  padding:8px 14px; border-radius:999px; transition:background .18s,border-color .18s;
}
.sg-proj-back:hover{ background:var(--sg-accent); border-color:var(--sg-accent); color:#fff; }
.sg-projet-title{
  font-family:var(--sg-serif); color:var(--sg-ink); margin:18px 0 0; line-height:1.2;
}
.sg-projet-desc{
  margin:14px 0 6px; max-width:68ch;
  font-family:var(--sg-serif); font-size:1.08rem; line-height:1.55; color:var(--sg-ink);
}
.sg-projet-desc p{ margin:0 0 .8em; }
.sg-projet-empty{ color:var(--sg-muted); font-style:italic; }

.sg-projet-gallery{
  display:grid; grid-template-columns:repeat(3,1fr); gap:18px; align-items:start; margin-top:22px;
}
@media (max-width:860px){ .sg-projet-gallery{grid-template-columns:repeat(2,1fr); gap:14px} }
@media (max-width:520px){ .sg-projet-gallery{grid-template-columns:1fr} }

.sg-projet-gallery figure.sg-item{
  margin:0; padding:0; position:relative; display:flex; flex-direction:column;
  background:var(--sg-surface); border:1px solid var(--sg-line); cursor:zoom-in;
}
.sg-projet-gallery figure.sg-item > a{ display:block; overflow:hidden; background:var(--sg-surface); }
.sg-projet-gallery figure.sg-item img{ display:block; width:100%; height:auto; object-fit:contain; margin:0; }
.sg-projet-gallery figure.sg-item figcaption{ padding:10px 13px 13px; text-align:left; }
.sg-projet-gallery .sg-cap{ font-family:var(--sg-serif); font-size:1rem; line-height:1.25; color:var(--sg-ink); }
.sg-projet-gallery figure.sg-item::after{
  content:""; position:absolute; inset:0; pointer-events:none;
  box-shadow:inset 0 0 0 0 transparent; transition:box-shadow .18s;
}
.sg-projet-gallery figure.sg-item:hover::after{ box-shadow:inset 0 0 0 2px var(--sg-accent); }

/* ---------------------------------------------------------------
   Visionneuse plein écran (lightbox)
   --------------------------------------------------------------- */
.sg-plb{
  position:fixed; inset:0; z-index:100000; display:none;
  align-items:center; justify-content:center; flex-direction:column;
  background:rgba(14,12,9,.94); padding:24px 16px;
}
.sg-plb.is-open{ display:flex; }
.sg-plb img{
  max-width:min(94vw,1200px); max-height:80vh; width:auto; height:auto; object-fit:contain;
  box-shadow:0 20px 60px rgba(0,0,0,.5);
}
.sg-plb .sg-plbcap{ color:#eee; font-family:Georgia,serif; font-size:1.15rem; margin-top:12px; text-align:center; max-width:60ch; }
.sg-plb button{
  position:absolute; background:rgba(255,255,255,.08); border:1px solid rgba(255,255,255,.25);
  color:#fff; width:48px; height:48px; border-radius:50%; cursor:pointer; font-size:22px; line-height:1;
  display:flex; align-items:center; justify-content:center;
}
.sg-plb button:hover{ background:rgba(255,255,255,.2); }
.sg-plb .sg-plb-close{ top:16px; right:16px; font-size:20px; }
.sg-plb .sg-plb-prev{ left:12px; top:50%; transform:translateY(-50%); }
.sg-plb .sg-plb-next{ right:12px; top:50%; transform:translateY(-50%); }
@media (max-width:520px){ .sg-plb button{width:42px;height:42px} }

@media (prefers-reduced-motion:reduce){
  .sg-projets-index *,.sg-projet-detail *,.sg-plb *{transition:none !important}
}
