/* =========================================================================
   UniversalMenu Gallery — front-end styles
   Mobile-first, Instagram-identical grid.
   Accent inherits the Listeo theme; liked heart is Instagram red.
   ========================================================================= */

:root {
	/* Inherit Listeo accent where possible; fall back to a neutral teal.
	   The plugin can inject --um-accent via wp_add_inline_style (settings override). */
	--um-accent: var(--listeo-primary-color, #1d9e75);
	--um-heart: #ed4956; /* Instagram red — fixed */
	--um-gap: 2px;
	--um-radius: 4px;
}

/* ----- Icon glyphs (lightweight inline font via data attributes) ---------- */
.umg-icon-heart::before { content: "\2665"; }            /* ♥ */
.umg-icon-pin::before { content: "\1F4CC"; }             /* 📌 */
.umg-icon-play::before { content: "\25B6"; }             /* ▶ */
.umg-icon-search::before { content: "\1F50D"; }          /* 🔍 */
.umg-icon-camera::before { content: "\1F4F7"; }          /* 📷 */
.umg-icon-upload::before { content: "\2601"; }           /* ☁ */
.umg-icon-x::before { content: "\2715"; }                /* ✕ */
.umg-icon-bolt::before { content: "\26A1"; }             /* ⚡ */
.umg-icon-photo::before { content: "\1F5BC"; }           /* 🖼 */
.umg-icon-trophy::before { content: "\1F3C6"; }          /* 🏆 */
.umg-icon-sparkle::before { content: "\2728"; }          /* ✨ */

/* ----- Search bar --------------------------------------------------------- */
.umg-search-form {
	display: flex;
	align-items: center;
	gap: 8px;
	margin: 14px 0;
	padding: 0 12px;
	height: 42px;
	border: 1px solid rgba(0, 0, 0, .12);
	border-radius: 22px;
	background: #fff;
}
.umg-search-form .umg-icon-search { opacity: .5; font-size: 15px; }
.umg-search-input {
	flex: 1;
	border: 0 !important;
	background: transparent !important;
	box-shadow: none !important;
	font-size: 15px;
	outline: none;
	padding: 0;
}

/* ----- Filter chips (Most popular / Vibe Check) --------------------------- */
.umg-chips {
	display: flex;
	gap: 8px;
	margin: 0 0 14px;
	flex-wrap: wrap;
}
.umg-chip {
	display: inline-flex;
	align-items: center;
	gap: 6px;
	height: 34px;
	padding: 0 15px;
	border: 1px solid rgba(0, 0, 0, .12);
	border-radius: 20px;
	background: #fff;
	color: inherit;
	font-size: 13px;
	font-weight: 500;
	cursor: pointer;
	transition: background .15s ease, color .15s ease, border-color .15s ease;
}
.umg-chip .umg-icon-trophy,
.umg-chip .umg-icon-sparkle { font-size: 14px; }
.umg-chip:hover { border-color: rgba(0, 0, 0, .25); }
.umg-chip.is-active {
	background: var(--um-accent);
	border-color: var(--um-accent);
	color: #fff;
}

/* Fade used while re-filtering the grid */
.umg-gallery-grid.is-filtering { opacity: 0; transition: opacity .2s ease; }
.umg-gallery-grid { transition: opacity .2s ease; }
.umg-tile.umg-hidden { display: none !important; }

/* ----- The grid (Instagram: 3 equal square columns, tight gaps) ----------- */
.umg-gallery-grid {
	display: grid;
	grid-template-columns: repeat(3, 1fr);
	gap: var(--um-gap);
	margin: 0 0 24px;
}

.umg-tile {
	position: relative;
	margin: 0;
	aspect-ratio: 1 / 1;
	overflow: hidden;
	border-radius: var(--um-radius);
	background: #ece9e4;
	cursor: pointer;
}
.umg-tile-img {
	width: 100%;
	height: 100%;
	object-fit: cover;
	display: block;
}

/* Pin badge (top-right) */
.umg-pin {
	position: absolute;
	top: 5px;
	right: 5px;
	display: inline-flex;
	align-items: center;
	gap: 3px;
	padding: 2px 6px;
	font-size: 11px;
	line-height: 1;
	color: #fff;
	background: rgba(0, 0, 0, .55);
	border-radius: 10px;
}

/* Video play glyph (center) + duration (bottom-right) */
.umg-play {
	position: absolute;
	top: 50%;
	left: 50%;
	transform: translate(-50%, -50%);
	color: #fff;
	font-size: 30px;
	opacity: .92;
	text-shadow: 0 1px 6px rgba(0, 0, 0, .5);
	pointer-events: none;
}
.umg-duration {
	position: absolute;
	bottom: 5px;
	right: 6px;
	font-size: 10px;
	color: #fff;
	text-shadow: 0 1px 3px rgba(0, 0, 0, .6);
}

/* Heart like button (bottom-left) */
.umg-like {
	position: absolute;
	bottom: 4px;
	left: 4px;
	display: inline-flex;
	align-items: center;
	gap: 4px;
	padding: 4px 7px;
	border: 0;
	background: transparent;
	color: #fff;
	font-size: 12px;
	line-height: 1;
	cursor: pointer;
	text-shadow: 0 1px 3px rgba(0, 0, 0, .6);
	z-index: 2;
}
.umg-like .umg-icon-heart { font-size: 19px; transition: transform .15s ease, color .15s ease; }
.umg-like.is-liked .umg-icon-heart { color: var(--um-heart); transform: scale(1.15); }
.umg-like:active .umg-icon-heart { transform: scale(1.3); }
.umg-like-count { font-weight: 500; }

/* Site-wide result: café link overlay (appears on the tile) */
.umg-tile-listing {
	position: absolute;
	bottom: 4px;
	right: 6px;
	max-width: 70%;
	font-size: 10px;
	color: #fff;
	text-decoration: none;
	text-shadow: 0 1px 3px rgba(0, 0, 0, .7);
	overflow: hidden;
	white-space: nowrap;
	text-overflow: ellipsis;
	z-index: 2;
}

.umg-empty {
	grid-column: 1 / -1;
	text-align: center;
	color: #888;
	padding: 28px 12px;
	font-size: 14px;
}

/* ----- "Add photo/video" button (full-width accent) ----------------------- */
.umg-submit-open {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	gap: 8px;
	width: 100%;
	height: 44px;
	margin: 16px 0 16px;
	border: 0;
	border-radius: 10px;
	background: var(--um-accent);
	color: #fff;
	font-size: 15px;
	font-weight: 600;
	cursor: pointer;
	transition: transform .15s ease, filter .15s ease;
}
.umg-submit-open:hover { filter: brightness(0.95); transform: translateY(-1px); }
.umg-submit-open:active { transform: translateY(0); }
/* Icon removed from the label per design; hide if present in older markup. */
.umg-submit-open .umg-icon-camera { display: none; }

/* ----- Submission modal --------------------------------------------------- */
.umg-modal { position: fixed; inset: 0; z-index: 99999; display: none; }
.umg-modal.is-open { display: block; }
.umg-modal-backdrop { position: absolute; inset: 0; background: rgba(0, 0, 0, .55); }
.umg-modal-card {
	position: relative;
	margin: 6vh auto;
	max-width: 380px;
	width: calc(100% - 24px);
	max-height: 88vh;
	overflow-y: auto;
	background: #fff;
	border-radius: 16px;
}
.umg-modal-head {
	position: sticky;
	top: 0;
	display: flex;
	align-items: center;
	justify-content: space-between;
	padding: 14px 16px;
	background: #fff;
	border-bottom: 1px solid rgba(0, 0, 0, .08);
}
.umg-modal-title { font-size: 15px; }
.umg-modal-x { border: 0; background: transparent; font-size: 18px; cursor: pointer; color: #666; }

.umg-form { padding: 16px; }

.umg-dropzone {
	display: flex;
	flex-direction: column;
	align-items: center;
	gap: 4px;
	padding: 22px 12px;
	border: 1px dashed rgba(0, 0, 0, .25);
	border-radius: 8px;
	background: #fafafa;
	text-align: center;
	cursor: pointer;
}
.umg-dropzone.is-drag { border-color: var(--um-accent); background: #f3fbf8; }
.umg-dropzone .umg-icon-upload { font-size: 28px; opacity: .55; }
.umg-dz-title { font-size: 14px; font-weight: 500; }
.umg-dz-hint { font-size: 11px; color: #999; }
.umg-file-input { display: none; }

.umg-preview {
	display: flex;
	align-items: center;
	gap: 10px;
	margin-top: 14px;
	padding: 8px;
	background: #f6f6f6;
	border-radius: 8px;
}
.umg-preview-thumb {
	width: 54px; height: 54px; border-radius: 6px; flex-shrink: 0;
	background-size: cover; background-position: center; background-color: #ddd;
	position: relative;
}
.umg-preview-thumb.is-video::after {
	content: "\25B6"; position: absolute; inset: 0;
	display: flex; align-items: center; justify-content: center;
	color: #fff; font-size: 16px; text-shadow: 0 1px 4px rgba(0,0,0,.6);
}
.umg-preview-meta { min-width: 0; flex: 1; }
.umg-preview-name { display: block; font-size: 13px; font-weight: 500; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.umg-preview-sub { font-size: 11px; color: #888; }
.umg-preview-remove { border: 0; background: transparent; color: #999; cursor: pointer; font-size: 15px; }

.umg-thumb-picker { margin-top: 16px; }
.umg-thumb-options { display: flex; gap: 8px; margin-top: 6px; }
.umg-thumb-opt {
	flex: 1;
	display: flex;
	flex-direction: column;
	align-items: center;
	gap: 4px;
	padding: 10px;
	border: 1px solid rgba(0, 0, 0, .15);
	border-radius: 8px;
	font-size: 12px;
	font-weight: 500;
	cursor: pointer;
	text-align: center;
}
.umg-thumb-opt.is-selected { border: 2px solid var(--um-accent); }
.umg-thumb-opt input { display: none; }
.umg-thumb-opt .umg-icon-bolt,
.umg-thumb-opt .umg-icon-photo { font-size: 17px; }

.umg-field-label { display: block; margin: 16px 0 6px; font-size: 13px; font-weight: 500; }
.umg-optional { color: #aaa; font-weight: 400; }
.umg-form input[type="text"],
.umg-form input[type="search"],
.umg-form select {
	width: 100%;
	height: 40px;
	padding: 0 12px;
	border: 1px solid rgba(0, 0, 0, .18);
	border-radius: 8px;
	font-size: 14px;
	box-sizing: border-box;
}
.umg-form input:focus,
.umg-form select:focus { outline: none; border-color: var(--um-accent); }

.umg-form-submit {
	width: 100%;
	height: 46px;
	margin-top: 18px;
	border: 0;
	border-radius: 8px;
	background: #111;
	color: #fff;
	font-size: 15px;
	font-weight: 500;
	cursor: pointer;
}
.umg-form-submit:disabled { opacity: .6; cursor: default; }
.umg-form-note { margin: 10px 0 0; font-size: 11px; color: #aaa; text-align: center; }
.umg-form-result { margin: 12px 0 0; font-size: 14px; text-align: center; }
.umg-form-result.is-ok { color: #1a7f4b; }
.umg-form-result.is-err { color: #c0392b; }

/* ----- Tablet / desktop: keep Instagram 3-up, just widen the canvas ------- */
@media (min-width: 768px) {
	:root { --um-gap: 4px; }
	.umg-modal-card { margin: 8vh auto; }
}
