/* =Tiled Gallery Default Styles
-------------------------------------------------------------- */
.tiled-gallery {
	clear: both;
	margin: 0;
	overflow: hidden;
}
.tiled-gallery .gallery-item { 
	position: relative; 
	overflow: hidden; 
	flex: 0 0 auto;
  	min-width: 0;

}
.tiled-gallery .gallery-group {
	float: left;
	position: relative;
}
.tiled-gallery .tiled-gallery-item {
	float: left;
	margin: 0;
	position: relative;
	width: inherit; 
}
.tiled-gallery .gallery-row {
	 overflow: hidden;
	 margin-bottom: 2px;
}
.tiled-gallery .tiled-gallery-item a { 
	background: transparent;
	border: none;
	color: none;
	margin: 0;
	padding: 0;
	text-decoration: none;
	width: auto;
}
.tiled-gallery .tiled-gallery-item img,
.tiled-gallery .tiled-gallery-item img:hover { 
	background: none;
	border: none;
	box-shadow: none;
	max-width: 100%;
	padding: 0;
	vertical-align: middle;
} 

/*--------- Tiled gallery square & landscape -----------------------------*/
/* plugin CSS: core layout only */

/* Flex grid with real gaps so rows/cols are consistent */
.tiled-gallery.type-square,
.tiled-gallery.type-landscape {
  display: flex;
  flex-wrap: wrap;
  align-content: flex-start;
  justify-content: flex-start;
  gap: 4px 4px;          /* ← your desired visible gutter */
}


/* Make sure images don't introduce extra inline spacing */
.tiled-gallery .gallery-icon img {
  display: block;
  width: 100%;
}

.tiled-gallery.type-square .tiled-gallery-item {
  flex: 0 0 auto;
  box-sizing: border-box;
}

/* Mosaic tiles */
/* Fallback: on narrow screens, force full-width tiles and no crop */
@media (max-width: 600px) {
/* .gallery-row, .gallery-group, .tiled-gallery-item, .tiled-gallery-item img { */
  .tiled-gallery.type-mosaic .gallery-row,
  .tiled-gallery.type-mosaic .gallery-group,
  .tiled-gallery.type-mosaic .tiled-gallery-item,
  .tiled-gallery.type-mosaic .tiled-gallery-item img {

    display: grid!important;
    width: 100% !important;
    height: auto !important;
    grid-row-gap: 2px;
	}
}
/*--------- Caption styles ----------------------------------*/
/* Overlay caption (shared) */
.tg-overlay-caption{
	position: absolute; 
	left: 0; 
	right: 0; 
	bottom: 0;
	padding: 6px 8px;
	margin: 0 2px;
	background: rgba(0,0,0,.65); 
	color: #fff;
	font-size: .9em; 
	line-height: 1.35;
	transform: translateY(100%); 
	opacity: 0;
	transition: transform .18s ease,opacity .18s ease;
	pointer-events: none; 
	z-index: 30;
	text-align: center;
}
/* Show on hover (for hover-*) */
.tiled-gallery .gallery-item:hover .tg-overlay-caption:not(.is-visible){
  transform: translateY(0);
  opacity: 1;
}
/* Always on (for overlay-*) */
.tg-overlay-caption.is-visible{
  transform: translateY(0);
  opacity: 1;
}
/* Top variants (for *-top) */
.tg-overlay-caption.pos-top{
  top: 0; bottom: auto;
  transform: translateY(-100%);
}
.tiled-gallery .gallery-item:hover .tg-overlay-caption.pos-top:not(.is-visible){
  transform: translateY(0);
}
.tg-overlay-caption.pos-top.is-visible{
  transform: translateY(0);
}

/* Under-image caption */
.tiled-gallery .gallery-item .tg-caption-under,
.tiled-gallery.type-landscape .tg-caption-under {
	position: static;
	display: block;
	box-sizing:border-box;
	margin: 3px 0 8px;
	font-size: .8em; 
	line-height: 1.35;
	padding: 0;
	background: transparent;
	color: inherit;
	transform: none;
	opacity: 1;
	text-align: center;
}

/* Make sure it starts on a new line even if a theme floats the image */
.tiled-gallery .gallery-item .tg-caption-under { 
	clear: both; 
}
/* (measurable text span, harmless) */
.tg-overlay-caption .tg-overlay-text { 
	display: inline-block; 
}

.screen-reader-text{
  	position: absolute;
	width: 1px;
	height: 1px;
	margin: -1px;
  	overflow: hidden;
	clip:rect(0,0,0,0);
	white-space: nowrap;
	border: 0;
}

/* =Greyscale
-------------------------------------------------------------- 

.tiled-gallery .tiled-gallery-item img.grayscale {
	position: absolute;
		left: 0;
		top: 0;
}
.tiled-gallery .tiled-gallery-item img.grayscale:hover {
	opacity: 0;
}


/* =Circles Layout
-------------------------------------------------------------- */

.tiled-gallery.type-circle .tiled-gallery-item img {
	border-radius: 50% !important; /* Ensure that circles are displayed in themes that add border-radius to all images as a default */
}
.tiled-gallery.type-circle .tiled-gallery-caption {
	display: none;
	opacity: 0;
}