.pg-hero { margin: 2rem 0; }

.pg-hero-stage{
  position:relative;
  display:flex;
  align-items:center;
  justify-content:center;
  min-height:60vh;
}

.pg-hero-link{
  display:block;
  max-width:min(900px, 92vw);
}

.pg-hero-img{
  width:100%;
  height:auto;
  display:block;
}

.pg-hero-nav{
  position:absolute;
  top:50%;
  transform:translateY(-50%);
  border:0;
  background:transparent;
  font-size:56px;
  line-height:1;
  padding:0.25rem 0.75rem;
  cursor:pointer;
  opacity:.65;
}
.pg-hero-nav:hover{ opacity:1; }
.pg-hero-prev{ left:2vw; }
.pg-hero-next{ right:2vw; }

.pg-hero-caption{
  text-align:center;
  margin:1rem 0 .5rem;
  opacity:.85;
}

.pg-hero-strip{
  display:flex;
  gap:12px;
  overflow-x:auto;
  padding:12px 2px;
  scroll-snap-type:x mandatory;
  -webkit-overflow-scrolling:touch;
}

.pg-hero-thumb{
  flex:0 0 auto;
  border:0;
  background:transparent;
  padding:0;
  cursor:pointer;
  scroll-snap-align:center;
  opacity:.75;
}
.pg-hero-thumb.is-active{ opacity:1; }

.pg-hero-thumb img{
  height:90px;
  width:auto;
  display:block;
}

/* Limite la taille de la grande image (sans la couper) */
.pg-hero-stage{
  min-height: auto;            /* si tu veux enlever le grand vide */
  padding: 1rem 0;
}

.pg-hero-link{
  max-width: 900px;            /* largeur max */
}

.pg-hero-img{
  max-height: 70vh;            /* hauteur max en % de l’écran */
  width: auto;
  max-width: 100%;
  height: auto;
  object-fit: contain;
  display: block;
  margin: 0 auto;
}



/* Liste des noms en bas */
.pg-cat-names{
  margin-top: 18px;
  font-size: 0.95rem;
  line-height: 1.4;
}
.pg-cat-names a{
  text-decoration: none;
}
.pg-cat-names a:hover{
  text-decoration: underline;
}


/* Hover subtil (optionnel mais chic) */
.pg-cat-tile:hover .pg-cat-img{
  transform: scale(1.03);
}

@media (max-width: 600px){
  .pg-cat-tile{ height: 160px; }
}


/* 1) Grille dense qui remplit bien */
.pg-cat-mosaic{
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  gap: 1px;
  align-items: stretch;
}

/* 2) Tuiles : hauteur fixe */
.pg-cat-tile{
  display: block;
  width: 100%;
  height: 160px;              /* ajuste ici: 220/240/260 */
  overflow: hidden;
  background: #f4f4f4;
}

/* 3) Image : remplit + recadre (FULL-BLEED) */
.pg-cat-mosaic .pg-cat-img{
  width: 100% !important;
  height: 100% !important;
  max-width: none !important;
  max-height: none !important;
  object-fit: cover;
  object-position: center;
  display: block;
}

/* Optionnel: hover léger */
.pg-cat-tile:hover .pg-cat-img{
  transform: scale(1.02);
  transition: transform .25s ease;
}

/* Mobile: un poil moins haut */
@media (max-width: 600px){
  .pg-cat-tile{ height: 180px; }
  .pg-cat-mosaic{ grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); }
}

/* === Phoca / template: casser les cases carrées === */
.pg-cat-mosaic .pg-cat-tile{
  height: 160px !important;       /* ✅ hauteur fixe */
  width: auto !important;
  aspect-ratio: auto !important;  /* ✅ annule un éventuel 1/1 */
}

/* Si un parent force un ratio par pseudo-element */
.pg-cat-mosaic .pg-cat-tile::before,
.pg-cat-mosaic .pg-cat-tile::after{
  content: none !important;
  display: none !important;
}

/* Image = full bleed */
.pg-cat-mosaic .pg-cat-img{
  width: 100% !important;
  height: 100% !important;
  object-fit: cover !important;
  object-position: center !important;
  max-width: none !important;
}

/* Conteneur Justified */
.pg-cat-mosaic.pg-justified{
  display: flex;
  flex-wrap: wrap;
  gap: 1px;
  align-items: flex-start;
}

/* Chaque tuile: la taille sera pilotée par JS */
.pg-cat-mosaic.pg-justified .pg-cat-tile{
  display: block;
  overflow: hidden;
  background: #f4f4f4;
}

/* L'image remplit sa tuile */
.pg-cat-mosaic.pg-justified .pg-cat-img{
  width: 100%;
  height: 100%;
  display: block;
  object-fit: cover;
  object-position: center;
}

.pg-cat-tile{
  position: relative;
}

/* voile */
.pg-cat-overlay{
  position:absolute;
  inset:0;
  display:flex;
  align-items:flex-end;
  padding:12px;
  opacity:0;
  transition: opacity .2s ease;
  background: linear-gradient(to top, rgba(0,0,0,.55), rgba(0,0,0,0));
}

/* texte */
.pg-cat-title{
  color:#fff;
  font-size: 14px;
  letter-spacing: .02em;
  text-shadow: 0 1px 2px rgba(0,0,0,.6);
}

/* hover */
.pg-cat-tile:hover .pg-cat-overlay{
  opacity:1;
}

/* mobile: afficher au tap/always? (optionnel) */
@media (hover: none){
  .pg-cat-overlay{ opacity: 1; }
}


/* Panneau description (mode hero) */
.pg-hero-desc{
  position: fixed;
  top: 120px;                 /* ajuste selon ton header */
  left: 60px;                 /* ajuste (menu/burger) */
  width: 420px;
  max-width: calc(100vw - 120px);
  max-height: calc(100vh - 180px);
  overflow: auto;
  padding: 18px 18px 14px;
  background: rgba(255,255,255,.96);
  box-shadow: 0 10px 30px rgba(0,0,0,.12);
  border-radius: 6px;
  z-index: 9999;
  transform: translateX(0);
  opacity: 1;
  transition: transform .25s ease, opacity .25s ease;
}

.pg-hero-desc:not(.is-open){
  transform: translateX(-18px);
  opacity: 0;
  pointer-events: none;
}

.pg-hero-desc-title{
  margin: 0 28px 10px 0;
  font-size: 18px;
}

.pg-hero-desc-close{
  position: absolute;
  top: 6px;
  right: 10px;
  width: 34px;
  height: 34px;
  border: 0;
  background: transparent;
  font-size: 28px;
  line-height: 34px;
  cursor: pointer;
  opacity: .65;
}

.pg-hero-desc-close:hover{ opacity: 1; }

.pg-hero-desc-open{
  position: fixed;
  top: 140px;
  left: 16px;
  width: 36px;
  height: 36px;
  border-radius: 999px;
  border: 0;
  background: rgba(255,255,255,.9);
  box-shadow: 0 6px 18px rgba(0,0,0,.12);
  cursor: pointer;
  z-index: 9999;
  display: none; /* affiché uniquement quand panneau fermé */
}

/* Mobile */
@media (max-width: 768px){
  .pg-hero-desc{
    top: 90px;
    left: 12px;
    width: calc(100vw - 24px);
    max-height: 45vh;
  }
  .pg-hero-desc-open{
    top: 90px;
    left: 12px;
  }
}

.com_phocagallery .pagination {
  display:none;
}
