/* Tishri Gallery Manager – front end */
.tgm-gallery { --tgm-cols: 2; --tgm-cols-phone: 2; --tgm-gap: 16px; --tgm-radius: 8px; --tgm-cover: 4 / 3; --tgm-c: var(--tgm-cols); margin: 0 0 1.5em; }
.tgm-gallery img { display: block; width: 100%; height: auto; max-width: 100%; border-radius: var(--tgm-radius); }

/* Album list: two columns */
.tgm-albums { display: grid; grid-template-columns: repeat(var(--tgm-c), minmax(0, 1fr)); gap: var(--tgm-gap); }
.tgm-album { display: block; text-decoration: none !important; color: inherit; border-radius: var(--tgm-radius); background: #fff; box-shadow: 0 1px 3px rgba(0,0,0,.08), 0 4px 14px rgba(0,0,0,.05); overflow: hidden; transition: transform .15s, box-shadow .15s; }
.tgm-album:hover, .tgm-album:focus-visible { transform: translateY(-2px); box-shadow: 0 4px 18px rgba(0,0,0,.12); }
.tgm-album-img { display: block; aspect-ratio: var(--tgm-cover); overflow: hidden; background: #eee; }
.tgm-albums .tgm-album-img img { width: 100%; height: 100%; object-fit: cover; border-radius: 0; }
.tgm-album-text { display: flex; flex-direction: column; gap: 3px; padding: 12px 14px 14px; }
.tgm-album-name { font-weight: 700; font-size: 1.05em; line-height: 1.3; }
.tgm-album-count { font-size: .85em; opacity: .7; }
.tgm-album-desc { font-size: .9em; opacity: .85; line-height: 1.45; }

/* One album: two columns of photos */
.tgm-back { margin: 0 0 .6em; }
.tgm-album-title { margin: 0 0 .3em; }
.tgm-album-description { margin: 0 0 1em; }
.tgm-grid { display: grid; grid-template-columns: repeat(var(--tgm-c), minmax(0, 1fr)); gap: var(--tgm-gap); align-items: start; }
.tgm-shaped .tgm-grid .tgm-photo { aspect-ratio: var(--tgm-shape, 4 / 3); }
.tgm-shaped .tgm-grid .tgm-photo img { width: 100%; height: 100%; object-fit: cover; }
.tgm-item { margin: 0; }
.tgm-open, .tgm-plain { display: block; border-radius: var(--tgm-radius); overflow: hidden; background: #eee; }
.tgm-open { cursor: zoom-in; }
.tgm-open img, .tgm-plain img { border-radius: 0; }
.tgm-open img { transition: transform .25s; }
.tgm-open:hover img { transform: scale(1.02); }
@media (prefers-reduced-motion: reduce) { .tgm-open img, .tgm-album { transition: none; } .tgm-open:hover img { transform: none; } }
.tgm-item figcaption { margin-top: 6px; font-size: .9em; line-height: 1.45; }
.tgm-cap-title { display: block; font-weight: 600; }
.tgm-cap-desc { display: block; opacity: .8; }

@media (max-width: 600px) {
	.tgm-gallery { --tgm-c: var(--tgm-cols-phone); }
	.tgm-gallery .tgm-albums, .tgm-gallery .tgm-grid, .tgm-albums, .tgm-grid { gap: calc(var(--tgm-gap) / 2); }
	.tgm-album-text { padding: 8px 10px 10px; }
	.tgm-album-desc { display: none; }
}

/* Full-screen viewer */
.tgm-lb { position: fixed; inset: 0; z-index: 999999; background: rgba(10,10,12,.95); display: flex; flex-direction: column; color: #fff; }
.tgm-lb[hidden] { display: none; }
.tgm-lb-top { display: flex; justify-content: space-between; align-items: center; padding: 10px 14px; font-size: 14px; }
.tgm-lb-stage { flex: 1; position: relative; display: flex; align-items: center; justify-content: center; min-height: 0; touch-action: pan-y; }
.tgm-lb-img { max-width: calc(100% - 24px); max-height: 100%; object-fit: contain; border-radius: 4px; user-select: none; -webkit-user-drag: none; }
.tgm-lb-cap { padding: 10px 16px 16px; text-align: center; font-size: 14px; line-height: 1.5; min-height: 1.5em; }
.tgm-lb-cap strong { display: block; }
.tgm-lb button { background: rgba(255,255,255,.12); color: #fff; border: 0; border-radius: 999px; cursor: pointer; font-size: 22px; line-height: 1; width: 44px; height: 44px; display: inline-flex; align-items: center; justify-content: center; padding: 0; }
.tgm-lb button:hover, .tgm-lb button:focus-visible { background: rgba(255,255,255,.25); outline: none; }
.tgm-lb-prev, .tgm-lb-next { position: absolute; top: 50%; transform: translateY(-50%); }
.tgm-lb-prev { left: 12px; }
.tgm-lb-next { right: 12px; }
.tgm-lb-loading { position: absolute; width: 34px; height: 34px; border: 3px solid rgba(255,255,255,.25); border-top-color: #fff; border-radius: 50%; animation: tgm-spin .8s linear infinite; }
@keyframes tgm-spin { to { transform: rotate(360deg); } }
@media (max-width: 600px) {
	.tgm-lb-prev, .tgm-lb-next { top: auto; bottom: 8px; transform: none; }
	.tgm-lb-img { max-width: 100%; }
}
html.tgm-lb-open, html.tgm-lb-open body { overflow: hidden !important; }

/* Page links */
.tgm-pager { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px; margin: 14px 0; font-size: .95em; }
.tgm-pager-info { opacity: .75; }
.tgm-pager-links { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.tgm-pg { display: inline-flex; align-items: center; justify-content: center; min-width: 38px; height: 38px; padding: 0 10px; border-radius: 8px; border: 1px solid rgba(0,0,0,.15); text-decoration: none !important; color: inherit; background: #fff; line-height: 1; box-sizing: border-box; }
a.tgm-pg:hover, a.tgm-pg:focus-visible { border-color: currentColor; }
.tgm-pg.is-current { background: #1d2327; border-color: #1d2327; color: #fff; font-weight: 700; }
.tgm-pg-gap { padding: 0 2px; opacity: .6; }
@media (max-width: 600px) {
	.tgm-pager { justify-content: center; }
	.tgm-pager-info { width: 100%; text-align: center; }
	.tgm-pg { min-width: 34px; height: 34px; padding: 0 8px; }
}

/* ---------- Layouts (1.3) ---------- */
.tgm-gallery .tgm-item { margin: 0; }
.tgm-photo { position: relative; }
.tgm-overlay { position: absolute; left: 0; right: 0; bottom: 0; padding: 22px 10px 8px; background: linear-gradient(transparent, rgba(0,0,0,.65)); color: #fff; font-size: .85em; line-height: 1.35; opacity: 0; transition: opacity .2s; pointer-events: none; }
.tgm-photo:hover .tgm-overlay, .tgm-photo:focus-visible .tgm-overlay { opacity: 1; }
@media (hover: none) { .tgm-overlay { opacity: 1; } }

/* Rows: equal-height rows that fill the width. Each photo grows in proportion to its shape. */
.tgm-rows { display: flex; flex-wrap: wrap; gap: var(--tgm-gap); }
.tgm-rows .tgm-item { flex-grow: var(--ar); flex-basis: calc(var(--ar) * var(--tgm-rowh)); max-width: calc(var(--ar) * var(--tgm-rowh) * 1.7); min-width: 0; }
.tgm-rows .tgm-photo { display: block; border-radius: var(--tgm-radius); overflow: hidden; background: #eee; }
.tgm-rows .tgm-photo img { width: 100%; height: auto; aspect-ratio: var(--ar); object-fit: cover; }
.tgm-rows::after { content: ""; flex-grow: 999999; } /* Keeps the last row from stretching. */

/* Brick: columns of different heights. Script places photos left to right; without it, CSS columns. */
.tgm-brick { column-count: var(--tgm-c); column-gap: var(--tgm-gap); }
.tgm-brick .tgm-item { break-inside: avoid; margin: 0 0 var(--tgm-gap); }
.tgm-brick.is-js { column-count: auto; display: flex; align-items: flex-start; gap: var(--tgm-gap); }
.tgm-brick-col { flex: 1 1 0; min-width: 0; display: flex; flex-direction: column; gap: var(--tgm-gap); }
.tgm-brick.is-js .tgm-item { margin: 0; }
.tgm-brick .tgm-photo, .tgm-mosaic .tgm-photo { display: block; border-radius: var(--tgm-radius); overflow: hidden; background: #eee; }

/* Mosaic: repeating pattern of big and small tiles. */
.tgm-mosaic { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); grid-auto-rows: calc(var(--tgm-rowh) * .75); grid-auto-flow: dense; gap: var(--tgm-gap); }
.tgm-mosaic .tgm-item:nth-child(10n+1) { grid-column: span 2; grid-row: span 2; }
.tgm-mosaic .tgm-item:nth-child(10n+6) { grid-column: span 2; }
.tgm-mosaic .tgm-item:nth-child(10n+8) { grid-row: span 2; }
.tgm-mosaic .tgm-item, .tgm-mosaic .tgm-photo { height: 100%; }
.tgm-mosaic .tgm-photo img { width: 100%; height: 100%; object-fit: cover; }

/* Film strip: one large photo and a strip of thumbnails. */
.tgm-film-stage { position: relative; background: #111; border-radius: var(--tgm-radius); overflow: hidden; aspect-ratio: 3 / 2; }
.tgm-film-main { display: block; width: 100%; height: 100%; background: transparent; border-radius: 0; }
.tgm-film-main.tgm-open { cursor: zoom-in; }
.tgm-gallery .tgm-film-main img { width: 100%; height: 100%; object-fit: contain; border-radius: 0; transition: opacity .25s; }
.tgm-film-main img.is-loading { opacity: .35; }
.tgm-film-prev, .tgm-film-next, .tgm-film-play { position: absolute; border: 0; cursor: pointer; background: rgba(0,0,0,.45); color: #fff; border-radius: 999px; display: inline-flex; align-items: center; justify-content: center; padding: 0; line-height: 1; }
.tgm-film-prev, .tgm-film-next { top: 50%; transform: translateY(-50%); width: 44px; height: 44px; font-size: 26px; }
.tgm-film-prev { left: 10px; } .tgm-film-next { right: 10px; }
.tgm-film-prev:hover, .tgm-film-next:hover, .tgm-film-play:hover, .tgm-film-prev:focus-visible, .tgm-film-next:focus-visible, .tgm-film-play:focus-visible { background: rgba(0,0,0,.75); outline: none; }
.tgm-film-bar { position: absolute; right: 10px; bottom: 10px; display: flex; align-items: center; gap: 8px; }
.tgm-film-play { position: static; width: 34px; height: 34px; font-size: 12px; }
.tgm-film-count { background: rgba(0,0,0,.55); color: #fff; font-size: 12px; padding: 4px 9px; border-radius: 999px; }
.tgm-film-cap { margin: 8px 0 0; min-height: 1.4em; font-size: .95em; text-align: center; }
.tgm-film-strip { display: flex; gap: 6px; overflow-x: auto; padding: 8px 2px 6px; scroll-snap-type: x proximity; scrollbar-width: thin; -webkit-overflow-scrolling: touch; }
.tgm-film-thumb { flex: 0 0 auto; width: 96px; height: 72px; border-radius: calc(var(--tgm-radius) / 2 + 2px); overflow: hidden; opacity: .55; outline: 2px solid transparent; outline-offset: -2px; scroll-snap-align: center; transition: opacity .15s; background: #ddd; }
.tgm-film-thumb:hover, .tgm-film-thumb:focus-visible { opacity: .9; }
.tgm-film-thumb.is-active { opacity: 1; outline-color: currentColor; }
.tgm-gallery .tgm-film-thumb img { width: 100%; height: 100%; object-fit: cover; border-radius: 0; }

@media (max-width: 600px) {
	.tgm-rows .tgm-item { flex-basis: calc(var(--ar) * var(--tgm-rowh) * .45); max-width: calc(var(--ar) * var(--tgm-rowh) * .8); }
	.tgm-mosaic { grid-template-columns: repeat(2, minmax(0, 1fr)); grid-auto-rows: calc(var(--tgm-rowh) * .55); }
	.tgm-film-stage { aspect-ratio: 4 / 3; }
	.tgm-film-prev, .tgm-film-next { width: 38px; height: 38px; font-size: 22px; }
	.tgm-film-thumb { width: 72px; height: 54px; }
}
@media (prefers-reduced-motion: reduce) { .tgm-film-main img, .tgm-overlay { transition: none; } }
