/* Next.io Field Blocks — shared front-end styles */

.nextio-fb-repeater--grid,
.nextio-fb-repeater--masonry,
.nextio-fb-loop--grid {
	display: grid;
	grid-template-columns: repeat( var( --nextio-fb-columns, 3 ), 1fr );
	gap: 1.5rem;
	list-style: none;
	padding: 0;
	margin: 0;
}

.nextio-fb-repeater--masonry {
	grid-template-rows: masonry;
}

@media ( max-width: 780px ) {
	.nextio-fb-repeater--grid,
	.nextio-fb-repeater--masonry,
	.nextio-fb-loop--grid {
		grid-template-columns: repeat( min( var( --nextio-fb-columns, 3 ), 2 ), 1fr );
	}
}

@media ( max-width: 480px ) {
	.nextio-fb-repeater--grid,
	.nextio-fb-repeater--masonry,
	.nextio-fb-loop--grid {
		grid-template-columns: 1fr;
	}
}

.nextio-fb-repeater--list,
.nextio-fb-loop--list {
	list-style: none;
	padding: 0;
	margin: 0;
	display: flex;
	flex-direction: column;
	gap: 1rem;
}

.nextio-fb-repeater__row,
.nextio-fb-loop__item {
	border: 1px solid rgba( 0, 0, 0, 0.08 );
	border-radius: 6px;
	padding: 1rem;
}

/* Carousel */
.nextio-fb-repeater--carousel,
.nextio-fb-loop--carousel {
	position: relative;
}

.nextio-fb-carousel__track {
	display: flex;
	gap: 1rem;
	overflow-x: auto;
	scroll-snap-type: x mandatory;
	scrollbar-width: thin;
	padding-bottom: 0.5rem;
}

.nextio-fb-carousel__slide {
	flex: 0 0 auto;
	width: min( 320px, 85vw );
	scroll-snap-align: start;
}

.nextio-fb-carousel__prev,
.nextio-fb-carousel__next {
	position: absolute;
	top: 50%;
	transform: translateY( -50% );
	background: #fff;
	border: 1px solid rgba( 0, 0, 0, 0.15 );
	border-radius: 50%;
	width: 2.25rem;
	height: 2.25rem;
	cursor: pointer;
	font-size: 1.1rem;
	line-height: 1;
}

.nextio-fb-carousel__prev {
	left: -0.75rem;
}

.nextio-fb-carousel__next {
	right: -0.75rem;
}

/* Gallery */
.nextio-fb-gallery__item {
	margin: 0;
}

.nextio-fb-gallery__item img {
	display: block;
	width: 100%;
	height: auto;
	border-radius: 4px;
}

.nextio-fb-lightbox-trigger {
	display: block;
	width: 100%;
	padding: 0;
	border: 0;
	background: none;
	cursor: zoom-in;
}

.nextio-fb-lightbox {
	position: fixed;
	inset: 0;
	display: none;
	align-items: center;
	justify-content: center;
	background: rgba( 0, 0, 0, 0.85 );
	z-index: 100000;
	flex-direction: column;
	padding: 2rem;
}

.nextio-fb-lightbox.is-open {
	display: flex;
}

.nextio-fb-lightbox__image {
	max-width: 90vw;
	max-height: 80vh;
	object-fit: contain;
}

.nextio-fb-lightbox__caption {
	color: #fff;
	margin-top: 0.75rem;
	text-align: center;
}

.nextio-fb-lightbox__close {
	position: absolute;
	top: 1rem;
	right: 1.5rem;
	background: none;
	border: none;
	color: #fff;
	font-size: 2rem;
	cursor: pointer;
	line-height: 1;
}

/* Accordion / Tabs */
.nextio-fb-accordion__row {
	border-bottom: 1px solid rgba( 0, 0, 0, 0.1 );
	padding: 0.5rem 0;
}

.nextio-fb-accordion__row summary {
	cursor: pointer;
	font-weight: 600;
}

.nextio-fb-tabs__nav {
	display: flex;
	gap: 0.5rem;
	border-bottom: 1px solid rgba( 0, 0, 0, 0.1 );
	margin-bottom: 1rem;
}

.nextio-fb-tabs__tab {
	padding: 0.5rem 1rem;
	background: none;
	border: none;
	border-bottom: 2px solid transparent;
	cursor: pointer;
}

.nextio-fb-tabs__tab.is-active {
	border-bottom-color: currentColor;
	font-weight: 600;
}

.nextio-fb-tabs__panel {
	display: none;
}

.nextio-fb-tabs__panel.is-active {
	display: block;
}

/* Cards (entity loop) */
.nextio-fb-card__thumb {
	max-width: 100%;
	border-radius: 4px;
	margin-bottom: 0.5rem;
}

.nextio-fb-card__title {
	margin: 0 0 0.5rem;
}

/* Group field */
.nextio-fb-group {
	margin: 0;
}

.nextio-fb-group__row {
	display: flex;
	gap: 0.5rem;
	margin-bottom: 0.35rem;
}

.nextio-fb-group__row dt {
	font-weight: 600;
	min-width: 8rem;
}

.nextio-fb-swatch {
	display: inline-block;
	width: 1rem;
	height: 1rem;
	border-radius: 3px;
	background: var( --nextio-fb-color, transparent );
	vertical-align: middle;
	margin-right: 0.35rem;
}

.nextio-fb-link--button {
	display: inline-block;
	padding: 0.5em 1em;
	border-radius: 4px;
	background: currentColor;
	color: #fff !important;
	text-decoration: none;
}
