/* Article galleries: 3+ photos in a row */
#tema-portal .tp-gallery{position:relative;margin:22px 0}
/* Even tiles: same size and 4:3 shape everywhere; 3 per row (4 photos: 2 per row), a shorter last row is centred */
#tema-portal .tp-gallery-grid{display:flex;flex-wrap:wrap;justify-content:center;gap:8px}
#tema-portal .tp-gallery-item{flex:0 0 calc((100% - 16px) / 3);aspect-ratio:4/3;margin:0;min-width:0;border-radius:10px;overflow:hidden;background:#eee9df}
#tema-portal .tp-gallery-4 .tp-gallery-item{flex-basis:calc((100% - 8px) / 2)}
#tema-portal .tp-gallery-item.is-extra{display:none}
#tema-portal .tp-gallery-open{position:relative;display:block;width:100%;height:100%;padding:0;border:0;background:none;cursor:zoom-in}
#tema-portal .tp-article-content .tp-gallery img.tp-gallery-img,#tema-portal .tp-gallery img.tp-gallery-img{display:block;width:100%!important;height:100%!important;max-width:none;margin:0!important;object-fit:cover;object-position:50% 30%;border-radius:0;transition:transform .4s}
#tema-portal .tp-gallery-open:hover img{transform:scale(1.03)}
#tema-portal .tp-gallery-more{position:absolute;inset:0;display:flex;align-items:center;justify-content:center;background:#20211f99;color:#fff;font-size:26px;font-weight:700;letter-spacing:-.02em}
#tema-portal .tp-gallery-counter{display:none}
@media (max-width:680px){
 #tema-portal .tp-gallery{margin:22px -16px}
 #tema-portal .tp-gallery-grid{display:flex;flex-wrap:nowrap;justify-content:flex-start;gap:8px;overflow-x:auto;scroll-snap-type:x mandatory;scrollbar-width:none;padding:0 16px;scroll-padding:0 16px}
 #tema-portal .tp-gallery-grid::-webkit-scrollbar{display:none}
 #tema-portal .tp-gallery .tp-gallery-item,#tema-portal .tp-gallery .tp-gallery-item.is-extra{display:block;flex:0 0 88%;aspect-ratio:4/3;scroll-snap-align:start}
 #tema-portal .tp-gallery-more{display:none}
 #tema-portal .tp-gallery-counter{display:block;position:absolute;left:24px;top:8px;padding:2px 7px;border-radius:10px;background:#20211f8c;color:#fff;font:600 10px/1.5 Arial,sans-serif;letter-spacing:.02em;-webkit-text-size-adjust:none;text-size-adjust:none;backdrop-filter:blur(4px);-webkit-backdrop-filter:blur(4px);pointer-events:none}
}
/* Fullscreen viewer: slides sit side by side in a scroll-snap track */
html.tp-lb-lock,html.tp-lb-lock body{overflow:hidden}
.tp-lb{position:fixed;inset:0;z-index:100000;background:#0d0d0cf5}
.tp-lb[hidden]{display:none}
.tp-lb-track{position:absolute;inset:0;display:flex;overflow-x:auto;overflow-y:hidden;scroll-snap-type:x mandatory;overscroll-behavior:contain;scrollbar-width:none;-webkit-overflow-scrolling:touch}
.tp-lb-track::-webkit-scrollbar{display:none}
.tp-lb-slide{flex:0 0 100%;height:100%;display:flex;align-items:center;justify-content:center;padding:56px 70px;box-sizing:border-box;scroll-snap-align:center;scroll-snap-stop:always}
.tp-lb-slide img{display:block;max-width:100%;max-height:100%;object-fit:contain;border-radius:4px;box-shadow:0 20px 60px #0008}
.tp-lb-close,.tp-lb-prev,.tp-lb-next{position:absolute;z-index:1;display:flex;align-items:center;justify-content:center;width:46px;height:46px;padding:0;border:0;border-radius:50%;background:#ffffff1f;color:#fff;cursor:pointer;font-size:30px;line-height:1;transition:background .2s,opacity .2s}
.tp-lb-close:hover,.tp-lb-prev:hover,.tp-lb-next:hover{background:#e87b17}
.tp-lb-prev:disabled,.tp-lb-next:disabled{opacity:.25;cursor:default;background:#ffffff1f}
.tp-lb-close{top:14px;right:14px}
.tp-lb-prev{left:14px;top:50%;transform:translateY(-50%)}
.tp-lb-next{right:14px;top:50%;transform:translateY(-50%)}
.tp-lb-prev svg,.tp-lb-next svg{width:22px;height:22px;fill:none;stroke:currentColor;stroke-width:2.2;stroke-linecap:round;stroke-linejoin:round}
.tp-lb.is-single .tp-lb-prev,.tp-lb.is-single .tp-lb-next,.tp-lb.is-single .tp-lb-count{display:none}
.tp-lb-count{position:absolute;z-index:1;left:0;right:0;bottom:18px;text-align:center;color:#c9c9c2;font:600 12px/1 Arial,sans-serif;pointer-events:none}
@media (max-width:680px){.tp-lb-slide{padding:56px 0}.tp-lb-slide img{border-radius:0;box-shadow:none}.tp-lb-prev,.tp-lb-next{display:none}}

/* Article text styles force their font on everything inside the content; keep the counter small */
#tema-portal .tp-article-content .tp-gallery .tp-gallery-counter{font:600 10px/1.5 Arial,sans-serif!important;letter-spacing:.02em}
#tema-portal .tp-article-content .tp-gallery .tp-gallery-more{font-size:26px!important;line-height:1!important}

/* Overrides of the article text styles (they apply to every figure/span inside the content) */
#tema-portal .tp-article-content .tp-gallery figure.tp-gallery-item{margin:0!important}
