/* ==========================================================================
   Drawings in Text-block tables (loaded only on the product pages listed in
   index.php $__RT_GALLERY_PRODUCTS, which also put class="rt-gallery" on <body>)

   The first cell of each table (<td rowspan>) holds the profile drawing. With
   auto table layout that column got whatever was left: ~325px in a 10-column
   table, ~182px in a 12-column one, 46px in a 14-column one. Here it gets one
   fixed width on every table, and the other cells a narrower side padding so
   the widest table (14 columns, long unbreakable codes) still fits 1152px.
   ========================================================================== */

body.rt-gallery .rich-text table td[rowspan]:has(img) {
	width: 240px;
	min-width: 240px;
	vertical-align: middle;
}

body.rt-gallery .rich-text table td[rowspan]:has(img) p {
	margin: 0;
}

/* The editor leaves empty paragraphs (&nbsp; / <br>) above the picture; they
   only push it off centre. */
body.rt-gallery .rich-text table td[rowspan]:has(img) p:not(:has(img)),
body.rt-gallery .rich-text table td[rowspan]:has(img) > br {
	display: none;
}

body.rt-gallery .rich-text table td[rowspan] a.rt-zoom {
	display: block;
}

body.rt-gallery .rich-text table td[rowspan] img {
	display: block;
	width: 100%;
	max-width: 100%;
	height: auto;
	cursor: zoom-in;
}

body.rt-gallery .rich-text table:has(td[rowspan] img) :is(td, th) {
	padding-left: 8px;
	padding-right: 8px;
}

/* rt-gallery.js wraps each such table: on a narrow screen the table scrolls
   inside this box instead of widening the page. The table stays a table here
   (style.css turns it into a scrolling block below 720px), so there is one
   scroller, not two. */
body.rt-gallery .rich-text .rt-table-scroll {
	overflow-x: auto;
	margin: 0 0 20px;
}

body.rt-gallery .rich-text .rt-table-scroll > table {
	display: table;
	margin-bottom: 0;
}

@media (max-width: 767px) {
	body.rt-gallery .rich-text table td[rowspan]:has(img) {
		width: 140px;
		min-width: 140px;
	}
}

/* Picture counter in the lightbox ("3 / 11"), added by rt-gallery.js */
.rt-gallery-counter {
	position: absolute;
	top: 18px;
	left: 20px;
	z-index: 99999;
	padding: 4px 10px;
	border-radius: 999px;
	background: rgba(0, 0, 0, .45);
	color: #fff;
	font: 600 13px/1.4 Roboto, system-ui, sans-serif;
	letter-spacing: .5px;
	pointer-events: none;
}
