/* TBP Party Gallery. Colours inherit the site's theme (Extendable / theme.json presets) with safe fallbacks. */
.tbp-gallery {
	--tbp-accent: var(--wp--preset--color--primary, #7b2d8e);
	--tbp-accent-ink: var(--wp--preset--color--background, #ffffff);
	--tbp-ink: var(--wp--preset--color--foreground, #1f1f1f);
	--tbp-soft: color-mix(in srgb, var(--tbp-accent) 10%, transparent);
	--tbp-radius: 14px;
	--tbp-gap: clamp(8px, 1.6vw, 16px);
	margin-block: 1.5rem;
}

.tbp-gallery__heading { margin-block-end: 1rem; }

/* Filters */
.tbp-filters { display: grid; gap: .6rem; margin-block-end: 1.25rem; }
.tbp-filters__group { display: flex; flex-wrap: wrap; gap: .4rem; align-items: center; }
.tbp-filters__label { font-weight: 700; margin-inline-end: .25rem; font-size: .95rem; }
.tbp-chip {
	font: inherit; font-size: .92rem; line-height: 1.2;
	padding: .5rem .9rem; min-height: 40px;
	border: 2px solid var(--tbp-accent); border-radius: 999px;
	background: transparent; color: var(--tbp-ink); cursor: pointer;
	transition: background-color .15s, color .15s;
}
.tbp-chip:hover { background: var(--tbp-soft); }
.tbp-chip[aria-pressed="true"] { background: var(--tbp-accent); color: var(--tbp-accent-ink); }
.tbp-chip:focus-visible, .tbp-open:focus-visible, .tbp-lb-btn:focus-visible { outline: 3px solid var(--tbp-accent); outline-offset: 3px; }
.tbp-extra { display: contents; }
.tbp-extra[hidden] { display: none; }
.tbp-more-toggle { font: inherit; font-size: .92rem; min-height: 40px; padding: .5rem .9rem; border: 0; background: none; color: var(--tbp-accent); text-decoration: underline; cursor: pointer; }
.tbp-count { margin: 0; font-size: .9rem; opacity: .8; }

/* Grid: CSS columns keep each photo's original shape (no cropping). */
.tbp-grid { list-style: none; margin: 0; padding: 0; columns: 2; column-gap: var(--tbp-gap); }
@media (min-width: 600px) { .tbp-grid { columns: 3; } }
@media (min-width: 1024px) { .tbp-grid { columns: 4; } }
.tbp-item { break-inside: avoid; margin: 0 0 var(--tbp-gap); }
.tbp-item[hidden] { display: none; }
.tbp-figure { margin: 0; }
.tbp-open { display: block; border-radius: var(--tbp-radius); overflow: hidden; background: var(--tbp-soft); }
.tbp-thumb { display: block; width: 100%; height: auto; transition: transform .25s ease; }
.tbp-open:hover .tbp-thumb { transform: scale(1.03); }
.tbp-caption { font-size: .85rem; line-height: 1.35; margin-top: .35rem; }

/* Crawlable theme links */
.tbp-more { margin-top: 1.5rem; }
.tbp-more__title { font-size: 1.1rem; margin-block-end: .5rem; }
.tbp-more ul { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: .4rem 1rem; }

/* Lightbox */
.tbp-lightbox { border: 0; padding: 0; width: 100vw; height: 100dvh; max-width: none; max-height: none; background: rgba(10, 6, 20, .94); color: #fff; }
.tbp-lightbox::backdrop { background: rgba(10, 6, 20, .94); }
.tbp-lightbox__inner { position: relative; height: 100%; display: grid; grid-template-columns: auto 1fr auto; grid-template-rows: 1fr auto; align-items: center; }
.tbp-lightbox__figure { grid-column: 2; grid-row: 1; margin: 0; height: 100%; display: flex; flex-direction: column; align-items: center; justify-content: center; padding: 3.5rem .5rem .5rem; min-width: 0; }
.tbp-lightbox__img { max-width: 100%; max-height: calc(100dvh - 9rem); width: auto; height: auto; object-fit: contain; border-radius: 8px; }
.tbp-lightbox__caption { margin-top: .6rem; text-align: center; max-width: 60ch; font-size: .95rem; }
.tbp-lightbox__actions { grid-column: 1 / -1; grid-row: 2; display: flex; gap: .75rem; justify-content: center; flex-wrap: wrap; padding: .75rem 1rem 1.25rem; }
.tbp-lightbox__actions a, .tbp-lb-share { font: inherit; background: none; cursor: pointer; color: #fff; text-decoration: none; border: 2px solid #fff; border-radius: 999px; padding: .5rem 1rem; font-weight: 700; }
.tbp-lb-book { background: var(--tbp-accent); border-color: var(--tbp-accent) !important; }
.tbp-lb-btn { background: rgba(255, 255, 255, .12); color: #fff; border: 0; border-radius: 999px; width: 48px; height: 48px; font-size: 2rem; line-height: 1; cursor: pointer; margin: .5rem; }
.tbp-lb-btn:hover { background: rgba(255, 255, 255, .25); }
.tbp-lb-close { position: absolute; top: .25rem; right: .25rem; z-index: 2; }
.tbp-lb-prev { grid-column: 1; grid-row: 1; }
.tbp-lb-next { grid-column: 3; grid-row: 1; }
@media (max-width: 599px) {
	.tbp-lb-prev, .tbp-lb-next { position: absolute; bottom: 4.5rem; z-index: 2; }
	.tbp-lb-prev { left: .25rem; } .tbp-lb-next { right: .25rem; }
}
@media (prefers-reduced-motion: reduce) { .tbp-thumb, .tbp-chip { transition: none; } .tbp-open:hover .tbp-thumb { transform: none; } }

/* Phones: each filter row scrolls sideways instead of filling the screen. */
@media (max-width: 599px) {
	.tbp-filters__group { flex-wrap: nowrap; overflow-x: auto; padding-bottom: .35rem; scrollbar-width: thin; -webkit-overflow-scrolling: touch; }
	.tbp-chip, .tbp-more-toggle, .tbp-filters__label { flex: 0 0 auto; white-space: nowrap; }
}
