/* V26 — Période + description sur deux lignes, V25 conserve fond blanc. */
/* V25 — Fond BLANC sous les photographies, sans cartouches beiges. */
/* V23 — Galerie : formats portrait et paysage homogènes, albums chronologiques.
   Photos inchangées dans la Médiathèque. Les albums restent alimentés par les
   titres/images de la page Photos dans WordPress. */
body.refuge-photos-page {background:#f5e8d8}
body.refuge-photos-page .ri-photos-albums-section{
  max-width:1180px;
  margin:0 auto;
  padding:20px clamp(14px,3vw,34px) 54px!important;
}
body.refuge-photos-page .ri-photos-filtres{
  display:flex;align-items:center;flex-wrap:wrap;gap:10px;
  margin:8px 0 25px;position:relative;
}
body.refuge-photos-page .ri-photos-filtre{
  appearance:none;min-width:64px;min-height:36px;
  padding:8px 18px;border-radius:999px;
  border:1px solid #e5d1b7;background:#ecdbc3;
  color:#4b3827;font:650 14px/1.2 system-ui,-apple-system,sans-serif;
  box-shadow:none;cursor:pointer;transition:background .15s,color .15s,border .15s;
}
body.refuge-photos-page .ri-photos-filtre:hover,
body.refuge-photos-page .ri-photos-filtre:focus-visible{border-color:#c88139;background:#f5c36e}
body.refuge-photos-page .ri-photos-filtre.is-active,
body.refuge-photos-page .ri-photos-filtre[aria-pressed="true"]{
  color:#fff;border-color:#194533;background:#194533;
}
body.refuge-photos-page .ri-photos-filtre:not([data-photo-year="all"]).is-active{background:#dfa338;border-color:#dfa338;color:#20392a}
body.refuge-photos-page .ri-photos-albums-section .gallery-section{
  background:#ffffff;border:1px solid #e8dfd2;border-radius:18px;
  padding:clamp(17px,2.4vw,30px);margin:0 0 22px;
  box-shadow:0 5px 16px rgba(63,48,30,.075);
  scroll-margin-top:130px;
}
body.refuge-photos-page .ri-photos-albums-section .gallery-section[hidden]{display:none!important}
body.refuge-photos-page .ri-photos-albums-section .gallery-section h2{
  color:#173f33;font:700 clamp(21px,2.2vw,29px)/1.28 system-ui,-apple-system,sans-serif;
  margin:0 0 20px;letter-spacing:-.02em;
}
/* Période en haut, description sur une ligne distincte, lisible et discrète. */
body.refuge-photos-page .ri-photos-albums-section .gallery-section h2 .gallery-date-line{
  display:block;
}
body.refuge-photos-page .ri-photos-albums-section .gallery-section h2 .gallery-title-line{
  display:block;font-weight:500;font-size:clamp(16px,1.58vw,19px);
  line-height:1.35;margin:6px 0 0;letter-spacing:normal;
  overflow-wrap:break-word;
}
body.refuge-photos-page .ri-photos-albums-section .gallery{
  display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:15px;align-items:start;
}
body.refuge-photos-page .ri-photos-albums-section .gallery.gallery-single{
  grid-template-columns:repeat(3,minmax(0,1fr));
}
/* Chaque cellule de grille possède une surface identique. Le visuel à l'intérieur
   reste en PORTRAIT (3:4) ou PAYSAGE (4:3) avec un recadrage contenu dans le
   cadre uniquement. Les originaux dans Médias ne sont jamais modifiés. */
body.refuge-photos-page .ri-photos-albums-section .gallery .photo-card{
  display:flex;flex-direction:column;min-width:0;min-height:0;align-self:start;
  border:none!important;border-radius:10px;box-shadow:none!important;
  background:transparent!important;overflow:visible;
}
body.refuge-photos-page .ri-photos-albums-section .gallery .photo-card .ri-photo-frame{
  display:flex;justify-content:center;align-items:center;
  width:100%;aspect-ratio:5/4;overflow:hidden;
  border-radius:0;background:#fff!important;
  background-image:none!important;border:0!important;box-shadow:none!important;
}
body.refuge-photos-page .ri-photos-albums-section .gallery .photo-card .ri-photo-frame img{
  display:block!important;padding:0!important;border:0!important;
  max-width:100%;max-height:100%;margin:0 auto;
  border-radius:8px;object-position:center;object-fit:cover!important;
  mix-blend-mode:normal!important;background:transparent!important;
  transition:none!important;
}
/* Toutes les photos paysage sont affichées dans le même rectangle 4:3. */
body.refuge-photos-page .ri-photos-albums-section .gallery .photo-card .ri-photo-landscape img{
  width:100%!important;height:auto!important;aspect-ratio:4/3!important;
}
/* Toutes les photos portrait sont affichées dans le même rectangle vertical 3:4. */
body.refuge-photos-page .ri-photos-albums-section .gallery .photo-card .ri-photo-portrait img{
  width:auto!important;height:100%!important;aspect-ratio:3/4!important;
}
/* Les rares photos carrées ne sont pas étirées en paysage ou portrait. */
body.refuge-photos-page .ri-photos-albums-section .gallery .photo-card .ri-photo-square img{
  width:auto!important;height:100%!important;aspect-ratio:1/1!important;
}
body.refuge-photos-page .ri-photos-albums-section .gallery .photo-card .caption{
  display:block;background:none!important;padding:8px 2px 0!important;
  min-height:0;color:#334d3f;font-size:12px;
}
body.refuge-photos-page .ri-photos-albums-section .refuge-video-historique{
  border-top:1px solid #ece2d3;padding-top:22px;margin-top:23px;
}
@media(max-width:780px){
  body.refuge-photos-page .ri-photos-albums-section .gallery,
  body.refuge-photos-page .ri-photos-albums-section .gallery.gallery-single{grid-template-columns:repeat(2,minmax(0,1fr))}
  body.refuge-photos-page .ri-photos-albums-section .gallery .photo-card .ri-photo-frame{aspect-ratio:1/1}
}
@media(max-width:520px){
  body.refuge-photos-page .ri-photos-albums-section{padding:14px 12px 34px!important}
  body.refuge-photos-page .ri-photos-albums-section .gallery,
  body.refuge-photos-page .ri-photos-albums-section .gallery.gallery-single{gap:10px;grid-template-columns:repeat(2,minmax(0,1fr))}
  body.refuge-photos-page .ri-photos-albums-section .gallery .photo-card .ri-photo-frame{aspect-ratio:1/1}
  body.refuge-photos-page .ri-photos-albums-section .gallery-section{padding:14px;margin-bottom:16px}
  body.refuge-photos-page .ri-photos-albums-section .gallery-section h2{font-size:19px;margin-bottom:14px}
  body.refuge-photos-page .ri-photos-filtres{gap:7px;margin:5px 0 16px}
  body.refuge-photos-page .ri-photos-filtre{font-size:12px;min-height:33px;padding:7px 12px;min-width:0}
}
