/* Shared gallery widget layout. Every cover fills its fixed ratio and crops overflow. */
.moedes-gallery-widget {
	--gallery-primary: var(--moedes-primary, #f39a07);
	--gallery-secondary: var(--moedes-secondary, #ff7073);
	--gallery-tertiary: var(--moedes-tertiary, #51a2ff);
	--gallery-radius: var(--main-radius, 8px);
	margin: 0 0 18px;
	padding: 16px;
	border: 1px solid var(--main-border-color, rgba(40, 50, 70, .08));
	border-radius: var(--gallery-radius);
	background: var(--main-bg-color, #fff);
	box-shadow: 0 6px 18px rgba(27, 39, 60, .04);
}

.moedes-gallery-widget__header {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 12px;
	min-width: 0;
	margin: 0 0 12px;
}

.moedes-gallery-widget__heading {
	flex: 1 1 auto;
	overflow: hidden;
	min-width: 0;
}

.moedes-gallery-widget__title {
	overflow: hidden;
	margin: 0;
	font-size: 18px;
	line-height: 1.35;
	text-overflow: ellipsis;
	white-space: nowrap;
}

.moedes-gallery-widget__title::before {
	display: inline-block;
	width: 4px;
	height: 18px;
	margin-right: 8px;
	border-radius: 99px;
	background: var(--gallery-primary);
	content: "";
	vertical-align: -2px;
}

.moedes-gallery-widget__actions,
.moedes-gallery-widget__periods {
	display: flex;
	align-items: center;
	gap: 5px;
}

.moedes-gallery-widget__actions {
	flex: 0 1 auto;
	min-width: 0;
	max-width: 70%;
}

.moedes-gallery-widget__periods {
	overflow-x: auto;
	padding: 2px;
	white-space: nowrap;
}

.moedes-gallery-widget__period,
.moedes-gallery-widget__refresh,
.moedes-gallery-widget__more {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	min-height: 28px;
	padding: 4px 9px;
	border: 1px solid transparent;
	border-radius: var(--mini-radius, 6px);
	background: transparent;
	color: var(--muted-2-color, #7a8493);
	font-size: 12px;
	line-height: 1.2;
	white-space: nowrap;
	cursor: pointer;
}

.moedes-gallery-widget__period:hover,
.moedes-gallery-widget__period:focus-visible,
.moedes-gallery-widget__period.is-active {
	border-color: var(--gallery-primary);
	background: var(--gallery-primary);
	color: #fff;
}

.moedes-gallery-widget__refresh {
	gap: 4px;
	border-color: var(--gallery-tertiary);
	color: var(--gallery-tertiary);
}

.moedes-gallery-widget__refresh span:first-child {
	font-size: 16px;
	line-height: 1;
}

.moedes-gallery-widget__refresh:hover,
.moedes-gallery-widget__refresh:focus-visible {
	background: var(--gallery-tertiary);
	color: #fff;
}

.moedes-gallery-widget__more {
	flex: 0 0 auto;
	color: var(--muted-2-color, #7a8493);
	text-decoration: none;
}

.moedes-gallery-widget__more span {
	margin-left: 4px;
	color: var(--gallery-tertiary);
	font-size: 16px;
}

.moedes-gallery-widget__more:hover,
.moedes-gallery-widget__more:focus-visible {
	color: var(--gallery-primary);
}

.moedes-gallery-widget__period-panel[hidden],
.moedes-gallery-feature__category[hidden],
.moedes-gallery-widget__variant[hidden] {
	display: none !important;
}

.moedes-gallery-feature__tabs {
	display: flex;
	gap: 6px;
	margin: 0 0 10px;
	overflow-x: auto;
	padding: 1px 0 2px;
	white-space: nowrap;
}

.moedes-gallery-feature__tab {
	flex: 0 0 auto;
	min-height: 28px;
	padding: 4px 10px;
	border: 1px solid var(--main-border-color, rgba(40, 50, 70, .1));
	border-radius: var(--mini-radius, 6px);
	background: transparent;
	color: var(--muted-2-color, #7a8493);
	font-size: 12px;
	cursor: pointer;
}

.moedes-gallery-feature__tab:hover,
.moedes-gallery-feature__tab:focus-visible,
.moedes-gallery-feature__tab.is-active {
	border-color: var(--gallery-primary);
	background: var(--gallery-primary);
	color: #fff;
}

.moedes-gallery-feature__rail-wrap {
	display: flex;
	align-items: center;
	gap: 6px;
	min-width: 0;
}

.moedes-gallery-feature__rail {
	display: flex;
	flex: 1 1 auto;
	gap: 10px;
	min-width: 0;
	overflow-x: auto;
	scroll-behavior: smooth;
	scroll-snap-type: x proximity;
	overscroll-behavior-x: contain;
	padding: 1px 1px 4px;
	scrollbar-width: thin;
}

.moedes-gallery-feature__card {
	flex: 0 0 calc((100% - 30px) / 4);
	min-width: 0;
	scroll-snap-align: start;
}

.moedes-gallery-feature__arrow {
	display: inline-flex;
	flex: 0 0 28px;
	align-items: center;
	justify-content: center;
	width: 28px;
	height: 28px;
	padding: 0;
	border: 1px solid var(--main-border-color, rgba(40, 50, 70, .12));
	border-radius: 50%;
	background: var(--main-bg-color, #fff);
	color: var(--gallery-primary);
	font-size: 21px;
	line-height: 1;
	cursor: pointer;
}

.moedes-gallery-feature__arrow:hover,
.moedes-gallery-feature__arrow:focus-visible {
	border-color: var(--gallery-primary);
	background: var(--gallery-primary);
	color: #fff;
}

.moedes-gallery-feature a,
.moedes-gallery-square a,
.moedes-gallery-series a {
	display: block;
	color: inherit;
	text-decoration: none;
}

.moedes-gallery-feature__cover,
.moedes-gallery-square__cover,
.moedes-gallery-series__cover {
	display: block;
	position: relative;
	overflow: hidden;
	width: 100%;
	aspect-ratio: 460 / 215;
	border-radius: var(--gallery-radius);
	background: var(--muted-bg-2-color, #f6f7f8);
	font-size: 0;
	line-height: 0;
}

.moedes-gallery-square__cover,
.moedes-gallery-series__cover {
	aspect-ratio: 1;
}

.moedes-gallery-widget--ratio-landscape .moedes-gallery-feature__cover,
.moedes-gallery-widget--ratio-landscape .moedes-gallery-square__cover,
.moedes-gallery-widget--ratio-landscape .moedes-gallery-series__cover {
	aspect-ratio: 16 / 9;
}

.moedes-gallery-widget--ratio-standard .moedes-gallery-feature__cover,
.moedes-gallery-widget--ratio-standard .moedes-gallery-square__cover,
.moedes-gallery-widget--ratio-standard .moedes-gallery-series__cover {
	aspect-ratio: 4 / 3;
}

.moedes-gallery-widget--ratio-square .moedes-gallery-feature__cover,
.moedes-gallery-widget--ratio-square .moedes-gallery-square__cover,
.moedes-gallery-widget--ratio-square .moedes-gallery-series__cover {
	aspect-ratio: 1;
}

.moedes-gallery-widget--ratio-portrait .moedes-gallery-feature__cover,
.moedes-gallery-widget--ratio-portrait .moedes-gallery-square__cover,
.moedes-gallery-widget--ratio-portrait .moedes-gallery-series__cover {
	aspect-ratio: 3 / 4;
}

.moedes-gallery-feature__image,
.moedes-gallery-square__image,
.moedes-gallery-series__image,
.moedes-gallery-widget__placeholder {
	display: block;
	width: 100%;
	height: 100%;
	margin: 0;
	object-fit: cover;
	object-position: center;
	background: var(--muted-bg-2-color, #f6f7f8);
}

.moedes-gallery-widget__placeholder {
	display: flex;
	align-items: center;
	justify-content: center;
	color: var(--muted-2-color, #9aa3ae);
	font-size: 22px;
}

.moedes-gallery-feature__caption,
.moedes-gallery-square__caption,
.moedes-gallery-series__caption {
	display: flex;
	flex-direction: column;
	gap: 3px;
	min-width: 0;
	padding: 7px 2px 1px;
}

.moedes-gallery-feature__caption b,
.moedes-gallery-square__caption b,
.moedes-gallery-series__caption b {
	display: -webkit-box;
	overflow: hidden;
	-webkit-box-orient: vertical;
	-webkit-line-clamp: 2;
	font-size: 14px;
	font-weight: 600;
	line-height: 1.4;
}

.moedes-gallery-feature__caption small,
.moedes-gallery-square__caption small,
.moedes-gallery-series__caption small {
	overflow: hidden;
	color: var(--muted-2-color, #7a8493);
	font-size: 12px;
	line-height: 1.35;
	text-overflow: ellipsis;
	white-space: nowrap;
}

.moedes-gallery-feature a:hover .moedes-gallery-feature__caption b,
.moedes-gallery-feature a:focus-visible .moedes-gallery-feature__caption b,
.moedes-gallery-square a:hover .moedes-gallery-square__caption b,
.moedes-gallery-square a:focus-visible .moedes-gallery-square__caption b,
.moedes-gallery-series a:hover .moedes-gallery-series__caption b,
.moedes-gallery-series a:focus-visible .moedes-gallery-series__caption b {
	color: var(--gallery-primary);
}

.moedes-gallery-feature a:focus-visible,
.moedes-gallery-square a:focus-visible,
.moedes-gallery-series a:focus-visible,
.moedes-gallery-feature__rail:focus-visible {
	outline: 2px solid var(--gallery-tertiary);
	outline-offset: 3px;
}

.moedes-gallery-square__grid,
.moedes-gallery-series__grid {
	display: grid;
	grid-template-columns: repeat(4, minmax(0, 1fr));
	gap: 10px;
}

.moedes-gallery-square__item,
.moedes-gallery-series__item {
	min-width: 0;
}

.moedes-gallery-feature__empty {
	margin: 8px 0 0;
	color: var(--muted-2-color, #7a8493);
	font-size: 13px;
}

@media (max-width: 900px) {
	.moedes-gallery-feature__card {
		flex-basis: calc((100% - 20px) / 3);
	}
	.moedes-gallery-square__grid,
	.moedes-gallery-series__grid {
		grid-template-columns: repeat(3, minmax(0, 1fr));
	}
}

@media (max-width: 767px) {
	.moedes-gallery-widget {
		margin-bottom: 14px;
		padding: 12px;
	}

	.moedes-gallery-widget__header {
		align-items: flex-start;
		flex-wrap: wrap;
		gap: 8px;
	}

	.moedes-gallery-widget__actions {
		flex: 1 1 100%;
		max-width: 100%;
		justify-content: flex-end;
	}

	.moedes-gallery-feature__card {
		flex-basis: calc((100% - 10px) / 2);
	}

	.moedes-gallery-square__grid,
	.moedes-gallery-series__grid {
		grid-template-columns: repeat(2, minmax(0, 1fr));
		gap: 8px;
	}
}

@media (max-width: 390px) {
	.moedes-gallery-feature__card {
		flex-basis: 100%;
	}
	.moedes-gallery-widget__actions {
		justify-content: flex-start;
	}
}
