/* Petit Gaudí 2027 · Sistema de imágenes editorial: SOLO / DÚO / TRÍO.
   Proporciones originales, sin falsos fondos horizontales y sin superposiciones. */
.pg-blog-post .pg-prose .pg27-media,
.pg-blog-post .pg-prose .pg27-legacy-gallery,
.pg-blog-post .pg-prose .pg27-curated-gallery,
#post-230 #pg-galardones section div.pg27-media--duo,
#post-230 #pg-galardones section div:has(>figure+figure) {
  display:grid!important;
  grid-template-columns:repeat(2,minmax(0,1fr))!important;
  gap:clamp(12px,1.7vw,20px)!important;
  align-items:start!important;
  position:static!important;
  isolation:isolate;
  max-width:100%;
  width:100%;
  margin:clamp(18px,2.5vw,28px) 0!important;
  clear:both;
}
.pg-blog-post .pg-prose .pg27-media--single {
  grid-template-columns:minmax(0,1fr)!important;
  max-width:860px;
}
.pg-blog-post .pg-prose .pg27-media--trio,
.pg-blog-post .pg-prose .pg27-legacy-gallery:has(>figure:nth-child(3)),
.pg-blog-post .pg-prose .pg27-curated-gallery:has(>figure:nth-child(3)),
#post-230 #pg-galardones section div:has(>figure:nth-child(3)) {
  grid-template-columns:repeat(3,minmax(0,1fr))!important;
}
#post-230 #pg-galardones .pg27-media--duo:has(img.pg27-image-portrait) {
  grid-template-columns:minmax(0,1.16fr) minmax(0,.84fr)!important;
}
/* Una tarjeta = una foto + su pie, sin altura forzada. */
.pg-blog-post .pg-prose .pg27-media>figure,
.pg-blog-post .pg-prose .pg27-legacy-gallery>figure,
.pg-blog-post .pg-prose .pg27-curated-gallery>figure,
#post-230 #pg-galardones section div:has(>figure+figure)>figure {
  position:static!important;
  inset:auto!important;
  transform:none!important;
  float:none!important;
  display:block!important;
  grid-column:auto!important;
  grid-row:auto!important;
  place-self:start stretch!important;
  align-self:start!important;
  width:100%!important;
  max-width:100%!important;
  min-width:0;
  height:auto!important;
  margin:0!important;
  padding:clamp(9px,1.1vw,14px)!important;
  background:#F7F6F1;
  border:1px solid #D9CEBD;
  border-radius:2px;
  box-sizing:border-box;
  overflow:visible;
}
.pg-blog-post .pg-prose .pg27-media>figure img,
.pg-blog-post .pg-prose .pg27-legacy-gallery>figure img,
.pg-blog-post .pg-prose .pg27-curated-gallery>figure img,
#post-230 #pg-galardones section div:has(>figure+figure)>figure img,
.pg-blog-post .pg-prose .pg27-media>figure img.pg27-image-portrait,
.pg-blog-post .pg-prose .pg27-legacy-gallery>figure img.pg27-image-portrait,
.pg-blog-post .pg-prose .pg27-curated-gallery>figure img.pg27-image-portrait,
#post-230 #pg-galardones section div:has(>figure+figure)>figure img.pg27-image-portrait {
  display:block!important;
  width:100%!important;
  max-width:100%!important;
  height:auto!important;
  max-height:none!important;
  aspect-ratio:auto!important;
  object-fit:contain!important;
  object-position:top left;
  background:transparent!important;
  margin:0!important;
  border:0;
  border-radius:1px;
}
.pg-blog-post .pg-prose .pg27-media figcaption,
.pg-blog-post .pg-prose .pg27-legacy-gallery figcaption,
.pg-blog-post .pg-prose .pg27-curated-gallery figcaption,
#post-230 #pg-galardones section div:has(>figure+figure)>figure figcaption {
  font:400 clamp(.72rem,.9vw,.8rem)/1.55 "Work Sans",Arial,sans-serif;
  color:#75685C;
  margin:10px 0 0!important;
  padding:0!important;
  text-align:left!important;
}
/* Foto vertical suelta: tamaño editorial, alineada con el texto; nunca «colgada».
   Una sola imagen destacada conserva su tamaño y proporción originales. */
.pg-blog-post .pg-prose figure:has(>img.pg27-image-portrait):not(.pg27-legacy-gallery figure):not(.pg27-curated-gallery figure):not(.pg27-media figure) {
  max-width:min(100%,460px)!important;
  margin-left:0!important;
  margin-right:auto!important;
}
@media(max-width:800px) {
  .pg-blog-post .pg-prose .pg27-media--trio,
  .pg-blog-post .pg-prose .pg27-legacy-gallery:has(>figure:nth-child(3)),
  .pg-blog-post .pg-prose .pg27-curated-gallery:has(>figure:nth-child(3)) {
    grid-template-columns:repeat(2,minmax(0,1fr))!important;
  }
}
@media(max-width:640px) {
  .pg-blog-post .pg-prose .pg27-media,
  .pg-blog-post .pg-prose .pg27-legacy-gallery,
  .pg-blog-post .pg-prose .pg27-curated-gallery,
  #post-230 #pg-galardones section div:has(>figure+figure),
  #post-230 #pg-galardones .pg27-media--duo:has(img.pg27-image-portrait) {
    grid-template-columns:minmax(0,1fr)!important;
  }
  .pg-blog-post .pg-prose figure:has(>img.pg27-image-portrait):not(.pg27-legacy-gallery figure):not(.pg27-curated-gallery figure):not(.pg27-media figure) {
    max-width:100%!important;
  }
}
/* Lectura en 3 columnas: texto ocupa dos y fotografía una. Solo bloques seguros. */
.pg-blog-post .pg-prose .pg27-editorial-pair {
  display:grid!important;
  grid-template-columns:minmax(0,2fr) minmax(0,1fr)!important;
  column-gap:clamp(18px,3.2vw,42px)!important;
  row-gap:0;
  align-items:start!important;
  clear:both;
  width:100%;
  max-width:100%;
}
.pg-blog-post .pg-prose .pg27-editorial-pair>.pg27-editorial-pair__text {
  grid-column:1!important;
  grid-row:1!important;
  min-width:0;
  width:100%;
  max-width:100%;
}
.pg-blog-post .pg-prose .pg27-editorial-pair>.pg27-editorial-pair__text>h2 {
  font:500 clamp(1.45rem,2.2vw,2rem)/1.28 "Playfair Display",Georgia,serif;
  color:#41322B;
  margin:0 0 16px;
}
.pg-blog-post .pg-prose .pg27-editorial-pair>.pg27-editorial-pair__text>p {
  max-width:72ch;
}
.pg-blog-post .pg-prose .pg27-editorial-pair>figure {
  grid-column:2!important;
  grid-row:1!important;
  width:100%!important;
  max-width:100%!important;
  min-width:0;
  height:auto!important;
  margin:0!important;
  padding:0!important;
  align-self:start!important;
  justify-self:stretch!important;
  position:static!important;
  inset:auto!important;
  transform:none!important;
  float:none!important;
  background:transparent!important;
  border:0!important;
}
.pg-blog-post .pg-prose .pg27-editorial-pair>figure img,
.pg-blog-post .pg-prose .pg27-editorial-pair>figure img.pg27-image-portrait {
  width:100%!important;
  max-width:100%!important;
  height:auto!important;
  max-height:none!important;
  aspect-ratio:auto!important;
  object-fit:contain!important;
  object-position:top left!important;
  margin:0!important;
  display:block!important;
  background:transparent!important;
  border-radius:2px;
}
.pg-blog-post .pg-prose .pg27-editorial-pair>figure figcaption {
  margin:9px 0 0!important;
  padding:0;
  text-align:left;
  font:400 .76rem/1.55 "Work Sans",Arial,sans-serif;
  color:#716a62;
}
.pg-blog-post .pg-prose .pg27-translated-feature>.pg27-translated-section {
  margin:0 0 28px;
  padding:20px 0;
  border-top:1px solid #D9CEBD;
}
/* Traducciones 2027: mismos textos, ritmos y pies de foto que el blog original. */
.pg-blog-post .pg-prose .pg27-translated-feature {
  display:block;
  max-width:1100px;
  margin:0 auto;
  color:#41322B;
  font-family:"Work Sans",Arial,sans-serif;
  line-height:1.73;
}
.pg-blog-post .pg-prose .pg27-translated-feature>h2,
.pg-blog-post .pg-prose .pg27-translated-feature>.pg27-translated-section>h2 {
  font:500 clamp(1.45rem,2.2vw,2.05rem)/1.3 "Playfair Display",Georgia,serif;
  color:#41322B;
  margin:32px 0 16px;
}
.pg-blog-post .pg-prose .pg27-translated-feature>p{
  max-width:76ch;
  margin:0 0 17px;
}
.pg-blog-post .pg-prose .pg27-translated-feature>figure {
  max-width:min(100%,850px);
  width:max-content;
  margin:22px 0 28px!important;
}
.pg-blog-post .pg-prose .pg27-translated-feature>figure img {
  display:block;
  width:auto;
  height:auto;
  max-width:100%;
  max-height:570px;
  object-fit:contain;
}
.pg-blog-post .pg-prose .pg27-translated-feature>p:last-child {
  border-top:1px solid #D9CEBD;
  padding-top:14px;
  font-size:.8rem;
  color:#716a62;
}
@media(max-width:820px) {
  .pg-blog-post .pg-prose .pg27-translated-feature>figure{
    width:100%;
  }
}

@media(max-width:820px) {
  .pg-blog-post .pg-prose .pg27-editorial-pair {
    display:block!important;
  }
  .pg-blog-post .pg-prose .pg27-editorial-pair>figure {
    max-width:min(100%,540px)!important;
    margin:18px 0 0!important;
  }
}

/* Prueba controlada · galerías editoriales de 3+ fotos; no afecta imágenes sueltas, dúos ni producto. */
.pg-blog-post .pg-prose :is(.pg27-curated-gallery,.pg27-legacy-gallery,.wp-block-gallery):has(>figure:nth-child(3)){
  display:block!important;
  columns:3 220px!important;
  column-gap:clamp(12px,1.7vw,20px)!important;
}
.pg-blog-post .pg-prose :is(.pg27-curated-gallery,.pg27-legacy-gallery,.wp-block-gallery):has(>figure:nth-child(3))>figure{
  display:inline-block!important;
  break-inside:avoid!important;
  page-break-inside:avoid!important;
  width:100%!important;
  margin:0 0 clamp(12px,1.7vw,20px)!important;
  vertical-align:top;
}
.pg-blog-post .pg-prose :is(.pg27-curated-gallery,.pg27-legacy-gallery,.wp-block-gallery):has(>figure:nth-child(3))>figure img{
  width:100%!important;
  height:auto!important;
  max-height:none!important;
  aspect-ratio:auto!important;
  object-fit:contain!important;
}
@media(max-width:640px){
  .pg-blog-post .pg-prose :is(.pg27-curated-gallery,.pg27-legacy-gallery,.wp-block-gallery):has(>figure:nth-child(3)){
    columns:1!important;
  }
}

/* Norma editorial universal: una galería de exactamente tres fotos
   ocupa tres celdas iguales en una fila, nunca columnas CSS autoajustables.
   También vale para galerías curatoriales y legacy con tres figuras.
   Las galerías de cuatro o más mantienen su composición propia. */
@media(min-width:761px){
  body.pg2027-body .pg-blog-post .pg-prose
  :is(.pg27-curated-gallery,.pg27-legacy-gallery,.wp-block-gallery):has(>figure:nth-child(3):last-child){
    display:grid!important;
    columns:auto!important;
    grid-template-columns:repeat(3,minmax(0,1fr))!important;
    gap:clamp(12px,1.7vw,20px)!important;
    align-items:start!important;
  }
  body.pg2027-body .pg-blog-post .pg-prose
  :is(.pg27-curated-gallery,.pg27-legacy-gallery,.wp-block-gallery):has(>figure:nth-child(3):last-child)>figure{
    display:block!important;
    width:100%!important;
    min-width:0!important;
    margin:0!important;
    break-inside:auto!important;
  }
}
@media(max-width:760px){
  body.pg2027-body .pg-blog-post .pg-prose
  :is(.pg27-curated-gallery,.pg27-legacy-gallery,.wp-block-gallery):has(>figure:nth-child(3):last-child){
    display:grid!important;
    columns:auto!important;
    grid-template-columns:minmax(0,1fr)!important;
    gap:clamp(12px,1.7vw,20px)!important;
  }
  body.pg2027-body .pg-blog-post .pg-prose
  :is(.pg27-curated-gallery,.pg27-legacy-gallery,.wp-block-gallery):has(>figure:nth-child(3):last-child)>figure{
    display:block!important;
    width:100%!important;
    margin:0!important;
  }
}

/* Taller Carlos: tres fotos con proporción visual uniforme,
   sin cajas altas ni huecos; sin alterar los archivos originales. */
body.pg2027-body .pg-blog-post .pg27-editorial-body
.wp-block-gallery:has(>figure img.wp-image-21304)>figure{
  align-self:start!important;
  height:auto!important;
  min-height:0!important;
  aspect-ratio:auto!important;
  overflow:hidden;
}
body.pg2027-body .pg-blog-post .pg27-editorial-body
.wp-block-gallery:has(>figure img.wp-image-21304)>figure img{
  display:block!important;
  width:100%!important;
  height:auto!important;
  aspect-ratio:4/3!important;
  object-fit:cover!important;
  object-position:center!important;
  max-height:none!important;
}

