/*
 * The picture widget (core/widgets.py) and the rows of picture cards on the band pages
 * (templates/admin/home/tile.html), on Unfold's colour variables like admin-home.css.
 */
.eb-row-media {
	display: flex;
	flex: none;
	flex-direction: column;
	gap: 0 1rem;
	width: 240px;
}

.eb-row-media:not(:has(*)) {
	display: none;
}

.eb-picture {
	display: flex;
	flex-direction: column;
	gap: 0.625rem;
}

.eb-picture-frame {
	align-items: center;
	aspect-ratio: 16 / 10;
	background: var(--color-base-100);
	border-radius: 0.625rem;
	display: flex;
	justify-content: center;
	overflow: hidden;
}

.eb-picture-frame img,
.eb-picture-frame video {
	height: 100%;
	object-fit: cover;
	width: 100%;
}

/* A video slot is only a button until it has a video. */
.eb-picture-video .eb-picture-frame:has(> [data-picture-preview][hidden]) {
	display: none;
}

.eb-picture-empty {
	color: var(--color-base-400);
	font-size: 40px;
}

.eb-picture-actions {
	align-items: center;
	display: flex;
	gap: 0.75rem;
}

.eb-picture-button {
	align-items: center;
	background: #fff;
	border: 1px solid var(--color-base-200);
	border-radius: 0.5rem;
	cursor: pointer;
	display: inline-flex;
	font-weight: 600;
	gap: 0.375rem;
	padding: 0.5rem 0.875rem;
}

.eb-picture-button:hover {
	background: var(--color-base-50);
}

/* The button holds its hidden input, so a card scrolled off to the side cannot stretch the page with it. */
.eb-picture-button {
	position: relative;
}

/* The real file input stays in the form but out of sight; the label opens it. */
.eb-picture-button input {
	height: 1px;
	opacity: 0;
	position: absolute;
	width: 1px;
}

.eb-picture-button:focus-within {
	outline: 2px solid var(--color-primary-500);
	outline-offset: 2px;
}

/* The band pages use the whole width, so more cards fit side by side. */
.eb-home.eb-wide {
	max-width: none;
}

.eb-tiles-wrap {
	position: relative;
}

.eb-tiles {
	display: flex;
	gap: 1.25rem;
	overflow-x: auto;
	padding: 0 0 1rem;
	scroll-snap-type: x proximity;
	scrollbar-color: var(--color-base-300) transparent;
	scrollbar-width: thin;
}

.eb-tiles > .eb-tile {
	scroll-snap-align: start;
}

.eb-scroll {
	align-items: center;
	background: #fff;
	border: 1px solid var(--color-base-200);
	border-radius: 999px;
	box-shadow: 0 2px 6px rgb(0 0 0 / 0.12);
	display: flex;
	font-size: 28px;
	height: 44px;
	justify-content: center;
	position: absolute;
	top: 40%;
	width: 44px;
	z-index: 1;
}

.eb-scroll:hover {
	background: var(--color-base-50);
}

.eb-scroll-back {
	left: -22px;
}

.eb-scroll-next {
	right: -22px;
}

.dark .eb-scroll {
	background: var(--color-base-800);
	border-color: var(--color-base-700);
}

.eb-tile {
	background: var(--color-base-50);
	border-radius: 0.75rem;
	display: flex;
	flex: none;
	flex-direction: column;
	gap: 0.25rem;
	padding: 1.25rem;
	width: 380px;
}

.eb-tile-top {
	align-items: center;
	display: flex;
	justify-content: space-between;
	margin-bottom: 0.25rem;
}

.eb-tile-media {
	display: flex;
	flex-direction: column;
	gap: 0.5rem;
	margin-bottom: 1rem;
}

/* A card that opens its own page (link_tile.html): picture, name, and Edit. */
.eb-link-tile {
	gap: 0.625rem;
	transition: box-shadow 0.15s;
}

.eb-link-tile:hover {
	box-shadow: 0 4px 14px rgb(0 0 0 / 0.1);
}

.eb-link-tile-title {
	color: var(--color-base-900);
	font-size: 1rem;
	font-weight: 600;
}

.eb-link-tile-edit {
	align-items: center;
	color: var(--color-primary-600);
	display: inline-flex;
	font-weight: 600;
	gap: 0.25rem;
}

.eb-link-tile-edit .material-symbols-outlined {
	font-size: 18px;
}

.dark .eb-link-tile-title {
	color: var(--color-base-100);
}

/* A card's fields: the first and any text box across the card, short ones two to a line. */
.eb-tile-fields {
	display: grid;
	gap: 0 0.75rem;
	grid-template-columns: 1fr 1fr;
}

.eb-tile-fields > * {
	min-width: 0;
}

.eb-tile-fields > :first-child,
.eb-tile-fields > :has(textarea),
.eb-tile-fields > :has([data-icon-input]):last-child {
	grid-column: 1 / -1;
}

.eb-tile-label {
	font-weight: 600;
}

.dark .eb-picture-button {
	background: var(--color-base-800);
	border-color: var(--color-base-700);
}

.dark .eb-picture-frame {
	background: var(--color-base-800);
}
