/* TSC Member Gallery — override --tscg-accent in your theme to recolour. */
:root {
	--tscg-accent: #0b4f7c;
	--tscg-accent-ink: #fff;
	--tscg-muted: #5f6b76;
	--tscg-tile: #e6ecf1;
	--tscg-radius: 6px;
}

/* ---------- Category page ---------- */
.tscg-archive .tscg-wrap { max-width: 1200px; margin: 0 auto; padding: 32px 16px 56px; }
.tscg-breadcrumb { font-size: .875rem; color: var(--tscg-muted); margin-bottom: 8px; }
.tscg-breadcrumb a { color: inherit; text-decoration: none; }
.tscg-breadcrumb a:hover { text-decoration: underline; }
.tscg-breadcrumb span[aria-hidden] { margin: 0 6px; }
.tscg-head { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: 8px 24px; margin-bottom: 12px; }
.tscg-title { margin: 0; }
.tscg-intro { max-width: 70ch; margin-bottom: 24px; }
.tscg-upload-link { font-weight: 600; color: var(--tscg-accent); text-decoration: none; white-space: nowrap; }
.tscg-upload-link:hover { text-decoration: underline; }

/* ---------- Grid ---------- */
.tscg-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 6px; margin: 0 0 24px; }
@media (min-width: 640px) { .tscg-grid { grid-template-columns: repeat(min(3, var(--tscg-cols, 4)), minmax(0, 1fr)); gap: 10px; } }
@media (min-width: 1024px) { .tscg-grid { grid-template-columns: repeat(var(--tscg-cols, 4), minmax(0, 1fr)); gap: 12px; } }

.tscg-item { position: relative; margin: 0; aspect-ratio: 1 / 1; overflow: hidden; border-radius: var(--tscg-radius); background: var(--tscg-tile); }
.tscg-item > a { display: block; width: 100%; height: 100%; }
.tscg-item img, .tscg-item video { display: block; width: 100%; height: 100%; max-width: none; object-fit: cover; transition: transform .4s ease; }
.tscg-item > a:hover img, .tscg-item > a:hover video, .tscg-item > a:focus-visible img { transform: scale(1.04); }
.tscg-item > a:focus-visible { outline: 3px solid var(--tscg-accent); outline-offset: -3px; }

.tscg-play { position: absolute; inset: 0; margin: auto; width: 54px; height: 54px; border-radius: 50%; background: rgba(0, 0, 0, .55); pointer-events: none; }
.tscg-play::after { content: ""; position: absolute; left: 21px; top: 16px; border-style: solid; border-width: 11px 0 11px 18px; border-color: transparent transparent transparent #fff; }

.tscg-caption { position: absolute; left: 0; right: 0; bottom: 0; padding: 28px 10px 8px; font-size: .8rem; line-height: 1.3; color: #fff; background: linear-gradient(transparent, rgba(0, 0, 0, .7)); opacity: 0; transition: opacity .2s; pointer-events: none; }
.tscg-item:hover .tscg-caption, .tscg-item:focus-within .tscg-caption { opacity: 1; }
@media (hover: none) { .tscg-caption { opacity: 1; } }

.tscg-empty, .tscg-notice { padding: 16px 18px; background: var(--tscg-tile); border-radius: var(--tscg-radius); color: #1d2933; }
.tscg-more-wrap { text-align: center; margin: 8px 0 0; }

/* Buttons: high specificity so theme/Elementor button styles don't bleed in. */
.tscg-gallery .tscg-more, .tscg-upload .tscg-submit {
	display: inline-block; padding: 12px 28px; border: 0; border-radius: 999px;
	background: var(--tscg-accent); color: var(--tscg-accent-ink); font: inherit; font-weight: 600; cursor: pointer; line-height: 1.2;
}
.tscg-gallery .tscg-more:hover, .tscg-gallery .tscg-more:focus, .tscg-upload .tscg-submit:hover, .tscg-upload .tscg-submit:focus { background: var(--tscg-accent); color: var(--tscg-accent-ink); filter: brightness(1.12); }
.tscg-upload .tscg-submit[disabled], .tscg-gallery .tscg-more[disabled] { opacity: .45; cursor: default; filter: none; }

/* ---------- Category cards ---------- */
.tscg-cats { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 240px), 1fr)); gap: 16px; margin: 0 0 32px; }
@media (min-width: 1024px) { .tscg-cats { grid-template-columns: repeat(var(--tscg-cat-cols, 3), minmax(0, 1fr)); } }
.tscg-cat, .tscg-cat-main { display: flex; flex-direction: column; text-decoration: none !important; color: inherit; }
.tscg-cat { border-radius: 8px; overflow: hidden; background: #fff; box-shadow: 0 1px 3px rgba(16, 32, 48, .14); transition: box-shadow .2s, transform .2s; }
.tscg-cat:hover, .tscg-cat:focus-visible { box-shadow: 0 6px 18px rgba(16, 32, 48, .18); transform: translateY(-2px); }
.tscg-cat-img { display: block; aspect-ratio: 4 / 3; background: var(--tscg-tile); overflow: hidden; }
.tscg-cat-img img { display: block; width: 100%; height: 100%; max-width: none; object-fit: cover; }
.tscg-cat-body { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; padding: 12px 14px; }
.tscg-cat-name { font-weight: 600; font-size: 1.05rem; color: #1d2933; }
.tscg-cat-count { font-size: .85rem; color: var(--tscg-muted); white-space: nowrap; }

/* ---------- Lightbox ---------- */
body.tscg-lock { overflow: hidden; }
.tscg-lb { position: fixed; inset: 0; z-index: 100000; display: none; align-items: center; justify-content: center; background: rgba(6, 12, 18, .95); }
.tscg-lb.is-open { display: flex; }
.tscg-lb-stage { display: flex; align-items: center; justify-content: center; width: 100%; height: 100%; padding: 56px 12px 64px; box-sizing: border-box; }
.tscg-lb-stage img, .tscg-lb-stage video { display: block; max-width: 100%; max-height: 100%; width: auto; height: auto; object-fit: contain; border-radius: 2px; }
.tscg-lb-cap { position: absolute; left: 0; right: 0; bottom: 14px; padding: 0 64px; text-align: center; color: #dfe6ec; font-size: .9rem; line-height: 1.4; }
.tscg-lb-count { position: absolute; top: 18px; left: 18px; color: #9fb0bf; font-size: .85rem; }
.tscg-lb .tscg-lb-btn {
	position: absolute; display: flex; align-items: center; justify-content: center; width: 46px; height: 46px; padding: 0; margin: 0;
	border: 0; border-radius: 50%; background: rgba(255, 255, 255, .12); color: #fff; font: 400 26px/1 sans-serif; cursor: pointer; box-shadow: none;
}
.tscg-lb .tscg-lb-btn:hover, .tscg-lb .tscg-lb-btn:focus-visible { background: rgba(255, 255, 255, .26); color: #fff; outline: none; }
.tscg-lb .tscg-lb-close { top: 10px; right: 10px; }
.tscg-lb .tscg-lb-prev { left: 10px; top: 50%; transform: translateY(-50%); }
.tscg-lb .tscg-lb-next { right: 10px; top: 50%; transform: translateY(-50%); }
@media (max-width: 639px) { .tscg-lb .tscg-lb-prev, .tscg-lb .tscg-lb-next { top: auto; bottom: 6px; transform: none; } .tscg-lb-cap { bottom: 62px; padding: 0 16px; } }

/* ---------- Upload form ---------- */
.tscg-upload { max-width: 760px; }
.tscg-label { display: block; font-weight: 600; margin-bottom: 6px; }
.tscg-upload .tscg-select { width: 100%; max-width: 420px; padding: 10px; font: inherit; }
.tscg-drop { position: relative; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px; min-height: 150px; margin: 18px 0 12px; padding: 24px; border: 2px dashed #aab8c4; border-radius: 10px; background: #f6f9fb; text-align: center; cursor: pointer; transition: border-color .2s, background .2s; }
.tscg-drop:hover, .tscg-drop.is-over, .tscg-drop:focus-within { border-color: var(--tscg-accent); background: #eef4f9; }
.tscg-drop input[type=file] { position: absolute; inset: 0; width: 100%; height: 100%; opacity: 0; cursor: pointer; }
.tscg-drop-title { font-weight: 600; font-size: 1.05rem; color: var(--tscg-accent); }
.tscg-drop-sub { font-size: .875rem; color: var(--tscg-muted); }
.tscg-hint { font-size: .875rem; color: var(--tscg-muted); margin: 0 0 16px; }

.tscg-queue { list-style: none; margin: 0 0 12px; padding: 0; }
.tscg-q { display: grid; grid-template-columns: 64px 1fr auto; gap: 4px 12px; align-items: center; padding: 10px 0; border-bottom: 1px solid #e3e9ee; }
.tscg-q-thumb { grid-row: span 2; width: 64px; height: 64px; border-radius: 4px; overflow: hidden; background: var(--tscg-tile); }
.tscg-q-thumb img, .tscg-q-thumb video { width: 100%; height: 100%; object-fit: cover; display: block; }
.tscg-q-name { font-size: .85rem; color: var(--tscg-muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; }
.tscg-upload .tscg-q-cap { grid-column: 2 / 4; width: 100%; padding: 8px 10px; font: inherit; font-size: .95rem; border: 1px solid #c6d1da; border-radius: 4px; box-sizing: border-box; }
.tscg-upload .tscg-q-remove { padding: 0 6px; border: 0; background: none; color: var(--tscg-muted); font-size: 22px; line-height: 1; cursor: pointer; }
.tscg-q-status { grid-column: 2 / 4; font-size: .85rem; }
.tscg-q-bar { height: 4px; background: #e3e9ee; border-radius: 2px; overflow: hidden; margin-top: 4px; }
.tscg-q-bar > span { display: block; height: 100%; width: 0; background: var(--tscg-accent); transition: width .2s; }
.tscg-q.is-done .tscg-q-status { color: #1b7a3d; }
.tscg-q.is-error .tscg-q-status { color: #b42318; }
.tscg-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 12px 18px; }
.tscg-msg { font-size: .95rem; }
.tscg-msg.is-error { color: #b42318; }

.tscg-mine { margin-top: 40px; }
.tscg-mine-title { margin: 0 0 12px; font-size: 1.1rem; }
.tscg-mine-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(120px, 1fr)); gap: 10px; }
.tscg-mine-item { position: relative; border-radius: var(--tscg-radius); overflow: hidden; background: var(--tscg-tile); }
.tscg-mine-item img, .tscg-mine-item video { display: block; width: 100%; aspect-ratio: 1 / 1; height: auto; object-fit: cover; }
.tscg-mine-meta { display: flex; flex-direction: column; gap: 2px; padding: 6px 8px; font-size: .75rem; background: #fff; }
.tscg-mine-cat { color: var(--tscg-muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tscg-badge { font-weight: 600; }
.tscg-badge.is-publish { color: #1b7a3d; }
.tscg-badge.is-pending { color: #a15c00; }
.tscg-upload .tscg-del { position: absolute; top: 4px; right: 4px; width: 28px; height: 28px; padding: 0; border: 0; border-radius: 50%; background: rgba(0, 0, 0, .6); color: #fff; font-size: 18px; line-height: 28px; cursor: pointer; }
.tscg-upload .tscg-del:hover { background: #b42318; color: #fff; }

/* ---------- Slideshow ---------- */
.tscg-tools { display: flex; justify-content: flex-end; margin: 0 0 10px; }
.tscg-gallery .tscg-slideshow {
	display: inline-flex; align-items: center; gap: 8px; padding: 9px 20px; border: 2px solid var(--tscg-accent); border-radius: 999px;
	background: transparent; color: var(--tscg-accent); font: inherit; font-weight: 600; line-height: 1.2; cursor: pointer;
}
.tscg-gallery .tscg-slideshow:hover, .tscg-gallery .tscg-slideshow:focus-visible { background: var(--tscg-accent); color: var(--tscg-accent-ink); }
.tscg-gallery .tscg-slideshow[disabled] { opacity: .6; cursor: default; }
.tscg-lb .tscg-lb-play { top: 10px; right: 64px; font-size: 18px; letter-spacing: -2px; }
.tscg-lb .tscg-lb-fs { top: 10px; right: 118px; font-size: 22px; }
.tscg-lb-progress { position: absolute; left: 0; right: 0; top: 0; height: 3px; background: transparent; pointer-events: none; }
.tscg-lb-progress > span { display: block; height: 100%; width: 0; background: rgba(255, 255, 255, .7); }
.tscg-lb.is-playing .tscg-lb-stage img { animation: tscg-fade .6s ease; }
@keyframes tscg-fade { from { opacity: 0; } to { opacity: 1; } }
@media (prefers-reduced-motion: reduce) { .tscg-lb.is-playing .tscg-lb-stage img { animation: none; } }

/* ---------- Sub-categories on cards; images fill their tiles even when the theme sets img height:auto ---------- */
.tscg-cat-main { flex: 1 1 auto; }
.tscg-cat-subs { display: flex; flex-wrap: wrap; gap: 6px; list-style: none; margin: 0; padding: 0 14px 14px; }
.tscg-cat-subs li { margin: 0; padding: 0; }
.tscg-cat-subs a { display: inline-flex; align-items: center; gap: 6px; padding: 5px 12px; border-radius: 999px; background: var(--tscg-tile); color: #1d2933; font-size: .85rem; font-weight: 600; line-height: 1.3; text-decoration: none !important; }
.tscg-cat-subs a:hover, .tscg-cat-subs a:focus-visible { background: var(--tscg-accent); color: var(--tscg-accent-ink); }
.tscg-cat-subcount { font-weight: 400; opacity: .75; }
.tscg-cat-img img, .tscg-item img, .tscg-item video { height: 100% !important; }
