/**
 * Listing Fields meta box - admin chrome for the type-driven field editor.
 *
 * The submission-field-renderer outputs `.listora-form__field`-style markup
 * intended for the frontend submission block. Inside wp-admin meta boxes we
 * lift the labels and inputs into a denser, scannable layout that matches
 * WP admin conventions (28-30px input heights, 13px labels, no oversized
 * card chrome). The frontend stylesheet still loads on the frontend; this
 * file only applies when inside .listora-admin-fields.
 */

.listora-admin-fields {
	display: flex;
	flex-direction: column;
	gap: 18px;
}

.listora-admin-fields .listora-form__field,
.listora-admin-fields .listora-submission__field,
.listora-admin-fields > p,
.listora-admin-fields .listora-form-field {
	display: flex;
	flex-direction: column;
	gap: 6px;
	max-width: 100%;
}

.listora-admin-fields label,
.listora-admin-fields .listora-form__label,
.listora-admin-fields .listora-submission__label {
	font-size: 13px;
	font-weight: 600;
	color: #1d2327;
	margin: 0;
}

.listora-admin-fields input[type="text"],
.listora-admin-fields input[type="url"],
.listora-admin-fields input[type="email"],
.listora-admin-fields input[type="tel"],
.listora-admin-fields input[type="number"],
.listora-admin-fields input[type="date"],
.listora-admin-fields input[type="time"],
.listora-admin-fields select,
.listora-admin-fields textarea {
	max-width: 640px;
	width: 100%;
}

.listora-admin-fields textarea {
	min-height: 90px;
}

.listora-admin-fields .listora-form__hint,
.listora-admin-fields .listora-submission__hint,
.listora-admin-fields .listora-form__description {
	font-size: 12px;
	color: #50575e;
	margin: 0;
}

.listora-admin-fields .listora-form__error {
	font-size: 12px;
	color: #b32d2e;
}

/* Composite location field - lay out address grid inside its own subgroup. */
.listora-admin-fields .listora-form__map,
.listora-admin-fields .listora-submission__map {
	display: grid;
	grid-template-columns: 1fr 1fr;
	gap: 12px;
	max-width: 640px;
}

.listora-admin-fields .listora-form__map > div:first-child,
.listora-admin-fields .listora-submission__map > div:first-child {
	grid-column: 1 / -1;
}

/* Checkbox lists (features, amenities, cuisine) - dense grid. */
.listora-admin-fields .listora-form__checkboxes,
.listora-admin-fields .listora-submission__checkboxes {
	display: grid;
	grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
	gap: 6px 18px;
	max-width: 720px;
}

/* Gallery picker - leave button at WP-admin default size, hint text smaller. */
.listora-admin-fields .listora-form__gallery,
.listora-admin-fields .listora-submission__gallery {
	display: flex;
	flex-direction: column;
	gap: 8px;
}

@media (max-width: 600px) {
	.listora-admin-fields .listora-form__map,
	.listora-admin-fields .listora-submission__map {
		grid-template-columns: 1fr;
	}
}

/* ─── Services metabox on a phone ─────────────────────────────────────────
 *
 * The metabox renders a seven-column table with fixed percentage widths: at
 * 390px that is an ~842px table inside ~327px of usable content, so title and
 * description were cut off and editing price/type/duration/status meant
 * panning the whole Gutenberg metabox region sideways. The body itself never
 * reported overflow, which is why it was easy to miss (BC 10208314925).
 *
 * The table scrolls inside ITS OWN container rather than dragging the editor
 * with it, and the fade on the trailing edge is the cue that there is more —
 * the original had no affordance at all, so the offscreen columns simply
 * looked absent.
 *
 * A min-width keeps the columns legible instead of letting seven of them
 * crush into 327px, which is the other way this "fits" while being unusable.
 * ──────────────────────────────────────────────────────────────────────── */
.wb-listora-services-metabox__scroll {
	overflow-x: auto;
	-webkit-overflow-scrolling: touch;
	scrollbar-width: thin;
}

.wb-listora-services-metabox__scroll > table {
	min-width: 720px;
}

@media (max-width: 782px) {

	.wb-listora-services-metabox__scroll {
		/* Trailing-edge fade: the affordance that says "keep going". Uses a
		   logical direction so it follows the writing mode. */
		--listora-svc-fade-dir: to right;
		mask-image: linear-gradient(var(--listora-svc-fade-dir), #000 92%, transparent 100%);
	}

	[dir="rtl"] .wb-listora-services-metabox__scroll {
		--listora-svc-fade-dir: to left;
	}
}
