/* Mammoth Galleries front end. Colors come from the theme when it sets --ymg-* variables. */
.ymg, .ymg-trips, .ymg-upload, .ymg-gate {
	--_fg: var(--ymg-fg, #1d2327);
	--_muted: var(--ymg-muted, #646970);
	--_surface: var(--ymg-surface, #f0f0f1);
	--_line: var(--ymg-line, rgba(0, 0, 0, .12));
	--_accent: var(--ymg-accent, #1f7a72);
	--_on-accent: var(--ymg-on-accent, #fff);
	--_radius: var(--ymg-radius, 6px);
}

/* ---------- Buttons ---------- */
.ymg-btn {
	display: inline-flex; align-items: center; gap: .4em;
	font: inherit; font-weight: 600; font-size: .95rem; line-height: 1;
	padding: .7em 1.1em; border-radius: 999px; border: 1px solid var(--_accent);
	background: var(--_accent); color: var(--_on-accent); cursor: pointer; text-decoration: none;
	transition: filter .15s, transform .15s;
}
.ymg-btn:hover { filter: brightness(1.08); }
.ymg-btn:active { transform: translateY(1px); }
.ymg-btn:disabled { opacity: .45; cursor: not-allowed; filter: none; }
.ymg-btn svg { width: 1.1em; height: 1.1em; fill: currentColor; }
.ymg-btn-quiet { background: transparent; color: var(--_fg); border-color: var(--_line); }

/* ---------- Gallery grid (justified rows, every photo at its real shape) ---------- */
.ymg { margin: 1.5rem 0 2.5rem; --ymg-row: 230px; }
.ymg-bar { display: flex; align-items: center; justify-content: space-between; gap: 1rem; flex-wrap: wrap; margin-bottom: .9rem; }
.ymg-count { color: var(--_muted); font-size: .9rem; letter-spacing: .02em; }
.ymg-actions { display: flex; gap: .5rem; flex-wrap: wrap; }
.ymg-grid { display: flex; flex-wrap: wrap; gap: 6px; }
.ymg-grid::after { content: ""; flex: 999 1 0; }
.ymg-item {
	position: relative; display: block; overflow: hidden;
	flex: var(--r) 1 calc(var(--r) * var(--ymg-row));
	aspect-ratio: var(--r);
	background: var(--_surface); border-radius: 3px;
	max-width: 100%;
}
.ymg-item img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; display: block; transition: transform .5s cubic-bezier(.2, .7, .2, 1), filter .3s; }
.ymg-item:hover img { transform: scale(1.035); filter: brightness(1.05); }
.ymg-place {
	position: absolute; left: 0; right: 0; bottom: 0; padding: 1.6em .7em .5em;
	font-size: .78rem; font-weight: 600; line-height: 1.2; color: #fff;
	background: linear-gradient(to top, rgba(0,0,0,.7), rgba(0,0,0,0));
	white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
	opacity: 0; transform: translateY(4px); transition: opacity .2s, transform .2s; pointer-events: none;
}
.ymg-place::before { content: ""; display: inline-block; width: .8em; height: 1em; margin-right: .35em; vertical-align: -.12em; background: currentColor; -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M12 2a7 7 0 0 0-7 7c0 5.25 7 13 7 13s7-7.75 7-13a7 7 0 0 0-7-7zm0 9.5A2.5 2.5 0 1 1 12 6.5a2.5 2.5 0 0 1 0 5z'/%3E%3C/svg%3E") center / contain no-repeat; mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M12 2a7 7 0 0 0-7 7c0 5.25 7 13 7 13s7-7.75 7-13a7 7 0 0 0-7-7zm0 9.5A2.5 2.5 0 1 1 12 6.5a2.5 2.5 0 0 1 0 5z'/%3E%3C/svg%3E") center / contain no-repeat; }
.ymg-item:hover .ymg-place, .ymg-item:focus-visible .ymg-place { opacity: 1; transform: none; }
@media (hover: none) { .ymg-place { display: none; } }
.ymg-item:focus-visible { outline: 3px solid var(--_accent); outline-offset: 2px; }
@media (max-width: 640px) { .ymg { --ymg-row: 120px; } .ymg-grid { gap: 3px; } }
.ymg-empty { color: var(--_muted); }

/* ---------- Viewer / slideshow ---------- */
html.ymg-lb-open { overflow: hidden; }
.ymg-lb {
	position: fixed; inset: 0; z-index: 100000; display: none;
	background: #0b0d0e; color: #f2f2f2; outline: none;
	font-family: system-ui, -apple-system, "Segoe UI", sans-serif;
	-webkit-tap-highlight-color: transparent; touch-action: none;
}
.ymg-lb.is-open { display: block; animation: ymg-in .2s ease-out; }
@keyframes ymg-in { from { opacity: 0; } to { opacity: 1; } }
.ymg-lb-stage { position: absolute; inset: 56px 0 64px; }
.ymg-lb-img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: contain; opacity: 0; transition: opacity .45s ease; pointer-events: none; }
.ymg-lb-img.is-front { opacity: 1; }
.ymg-lb-stage { touch-action: none; cursor: zoom-in; -webkit-user-select: none; user-select: none; }
.ymg-lb-img { transform-origin: 50% 50%; will-change: transform; }
.ymg-lb.is-zoomed .ymg-lb-stage { cursor: grab; }
.ymg-lb.is-dragging .ymg-lb-stage { cursor: grabbing; }
.ymg-lb.is-zoomed .ymg-lb-nav, .ymg-lb.is-zoomed .ymg-lb-bottom { opacity: 0; pointer-events: none; }
.ymg-lb-spin { position: absolute; left: 50%; top: 50%; width: 34px; height: 34px; margin: -17px; border-radius: 50%; border: 3px solid rgba(255,255,255,.18); border-top-color: #fff; opacity: 0; transition: opacity .2s .25s; animation: ymg-spin .8s linear infinite; }
.ymg-lb.is-loading .ymg-lb-spin { opacity: 1; }
@keyframes ymg-spin { to { transform: rotate(360deg); } }
.ymg-lb-top { position: absolute; top: 0; left: 0; right: 0; height: 56px; display: flex; align-items: center; justify-content: space-between; padding: 0 8px 0 18px; }
.ymg-lb-count { font-size: .85rem; letter-spacing: .04em; opacity: .8; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ymg-lb-tools { display: flex; gap: 2px; }
.ymg-lb-btn, .ymg-lb-nav { display: grid; place-items: center; border: 0; background: transparent; color: inherit; cursor: pointer; border-radius: 50%; padding: 0; }
.ymg-lb-btn { width: 44px; height: 44px; }
.ymg-lb-btn svg, .ymg-lb-nav svg { width: 24px; height: 24px; fill: currentColor; }
.ymg-lb-btn:hover, .ymg-lb-nav:hover { background: rgba(255,255,255,.12); }
.ymg-lb-nav { position: absolute; top: 50%; width: 56px; height: 56px; margin-top: -28px; background: rgba(0,0,0,.35); }
.ymg-lb-nav svg { width: 32px; height: 32px; }
.ymg-lb-prev { left: 12px; }
.ymg-lb-next { right: 12px; }
.ymg-lb-bottom { position: absolute; left: 0; right: 0; bottom: 0; min-height: 64px; display: flex; flex-direction: column; justify-content: center; padding: 8px 20px; text-align: center; }
.ymg-lb-cap { margin: 0; font-size: .95rem; line-height: 1.4; opacity: .9; }
.ymg-lb-place { display: inline-flex; align-items: center; justify-content: center; gap: .3em; align-self: center; margin-top: .25rem; font-size: .85rem; color: #f2f2f2; opacity: .75; text-decoration: none; padding: .2em .6em; border-radius: 999px; transition: opacity .2s, background .2s; }
.ymg-lb-place:hover { opacity: 1; background: rgba(255,255,255,.1); }
.ymg-lb-place svg { width: 15px; height: 15px; fill: currentColor; flex: none; }
.ymg-lb-bar { position: absolute; left: 0; right: 0; bottom: 0; height: 3px; background: rgba(255,255,255,.08); opacity: 0; transition: opacity .2s; }
.ymg-lb-bar span { display: block; height: 100%; width: 0; background: var(--ymg-accent, #4cc3b4); }
.ymg-lb.is-playing .ymg-lb-bar { opacity: 1; }
.ymg-lb-top, .ymg-lb-nav, .ymg-lb-cap { transition: opacity .3s; }
.ymg-lb.is-idle .ymg-lb-top, .ymg-lb.is-idle .ymg-lb-nav, .ymg-lb.is-idle .ymg-lb-cap, .ymg-lb.is-idle .ymg-lb-place { opacity: 0; }
.ymg-lb.is-idle { cursor: none; }
.ymg-lb:fullscreen .ymg-lb-stage, .ymg-lb.is-playing .ymg-lb-stage { inset: 0; }
@media (max-width: 640px) {
	.ymg-lb-stage { inset: 56px 0 56px; }
	.ymg-lb-nav { display: none; }
	.ymg-lb-full { display: none; }
}

/* ---------- Trip index ---------- */
.ymg-trips { margin: 1rem 0 3rem; }
.ymg-feature {
	position: relative; display: block; overflow: hidden; border-radius: var(--_radius);
	aspect-ratio: 21 / 9; min-height: 300px; margin-bottom: 2rem; background: #111; color: #fff; text-decoration: none;
}
.ymg-feature img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; transition: transform 1.2s cubic-bezier(.2, .7, .2, 1); }
.ymg-feature:hover img { transform: scale(1.03); }
.ymg-feature::after { content: ""; position: absolute; inset: 0; background: linear-gradient(to top, rgba(0,0,0,.78) 0%, rgba(0,0,0,.25) 45%, rgba(0,0,0,0) 70%); }
.ymg-feature-text { position: absolute; left: 0; right: 0; bottom: 0; z-index: 1; padding: clamp(1.1rem, 3vw, 2.2rem); display: flex; flex-direction: column; gap: .35rem; max-width: 52rem; }
.ymg-kicker { font-size: .75rem; letter-spacing: .16em; text-transform: uppercase; opacity: .85; }
.ymg-feature-title { font-family: var(--ymg-display, inherit); font-size: clamp(1.8rem, 5vw, 3.6rem); line-height: .95; font-weight: 800; letter-spacing: -.01em; text-transform: uppercase; }
.ymg-feature-excerpt { font-size: 1rem; line-height: 1.45; opacity: .92; }
.ymg-feature .ymg-meta { color: rgba(255,255,255,.75); }
.ymg-cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 1.6rem 1.2rem; }
.ymg-card { display: flex; flex-direction: column; gap: .3rem; color: var(--_fg); text-decoration: none; }
.ymg-card-img { position: relative; display: block; aspect-ratio: 4 / 3; overflow: hidden; border-radius: var(--_radius); background: var(--_surface); margin-bottom: .35rem; }
.ymg-card-img img { width: 100%; height: 100%; object-fit: cover; display: block; transition: transform .6s cubic-bezier(.2, .7, .2, 1); }
.ymg-card:hover .ymg-card-img img { transform: scale(1.05); }
.ymg-card-count { position: absolute; right: 8px; bottom: 8px; font-size: .75rem; font-weight: 600; padding: .25em .6em; border-radius: 999px; background: rgba(0,0,0,.6); color: #fff; backdrop-filter: blur(4px); }
.ymg-card-title { font-weight: 700; font-size: 1.05rem; line-height: 1.2; }
.ymg-card:hover .ymg-card-title { color: var(--_accent); }
.ymg-meta { font-size: .85rem; color: var(--_muted); }
@media (max-width: 640px) {
	.ymg-cards { grid-template-columns: repeat(2, 1fr); gap: 1.1rem .7rem; }
	.ymg-feature { aspect-ratio: 4 / 5; min-height: 0; }
	.ymg-card-title { font-size: .95rem; }
}

/* ---------- Add Photos page ---------- */
.ymg-upload { max-width: 760px; margin: 1rem 0 3rem; }
.ymg-up-head { display: flex; justify-content: space-between; gap: 1rem; font-size: .9rem; color: var(--_muted); margin-bottom: 1rem; }
.ymg-step { border: 1px solid var(--_line); border-radius: var(--_radius); padding: 1.1rem 1.2rem 1.3rem; margin-bottom: 1rem; }
.ymg-step h2 { display: flex; align-items: center; gap: .6rem; font-size: 1.15rem; margin: 0 0 .9rem; }
.ymg-num { display: inline-grid; place-items: center; width: 1.7em; height: 1.7em; border-radius: 50%; background: var(--_accent); color: var(--_on-accent); font-size: .85rem; }
.ymg-upload label, .ymg-form label { display: flex; flex-direction: column; gap: .3rem; font-size: .9rem; font-weight: 600; margin-bottom: .8rem; }
.ymg-upload input[type=text], .ymg-upload input[type=number], .ymg-upload select, .ymg-upload textarea,
.ymg-gate input[type=text], .ymg-gate input[type=email], .ymg-gate input[type=password] {
	font: inherit; font-weight: 400; font-size: 1rem; width: 100%; box-sizing: border-box;
	padding: .65em .8em; border-radius: calc(var(--_radius) - 2px); border: 1px solid var(--_line);
	background: var(--ymg-field, #fff); color: var(--_fg);
}
.ymg-trip-select { font-weight: 600; }
.ymg-new-trip { margin-top: 1rem; }
.ymg-row { display: grid; grid-template-columns: 2fr 1fr; gap: .8rem; }
.ymg-opt { font-weight: 400; color: var(--_muted); }
.ymg-drop {
	display: flex !important; flex-direction: column; align-items: center; justify-content: center; gap: .3rem !important;
	padding: 2.2rem 1rem; border: 2px dashed var(--_line); border-radius: var(--_radius);
	text-align: center; cursor: pointer; transition: border-color .15s, background .15s; margin: 0 !important;
}
.ymg-drop:hover, .ymg-drop:focus-visible, .ymg-drop.is-over { border-color: var(--_accent); background: color-mix(in srgb, var(--_accent) 8%, transparent); outline: none; }
.ymg-drop svg { width: 44px; height: 44px; fill: var(--_accent); }
.ymg-drop strong { font-size: 1.1rem; }
.ymg-drop span { font-weight: 400; color: var(--_muted); }
.ymg-queue { list-style: none; margin: 1rem 0 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(96px, 1fr)); gap: 6px; }
.ymg-queue:empty { display: none; }
.ymg-tile { position: relative; aspect-ratio: 1; border-radius: 4px; overflow: hidden; background: var(--_surface); margin: 0; }
.ymg-tile img { width: 100%; height: 100%; object-fit: cover; display: block; transition: opacity .2s; }
.ymg-tile-name { position: absolute; inset: 0; display: grid; place-items: center; padding: 6px; font-size: .7rem; word-break: break-all; text-align: center; color: var(--_muted); }
.ymg-tile.is-ready img, .ymg-tile.is-prep img, .ymg-tile.is-up img { opacity: .55; }
.ymg-tile-bar { position: absolute; left: 0; right: 0; bottom: 0; height: 4px; background: rgba(0,0,0,.25); }
.ymg-tile-bar span { display: block; height: 100%; width: 0; background: var(--_accent); transition: width .2s; }
.ymg-tile.is-ready .ymg-tile-bar, .ymg-tile.is-done .ymg-tile-bar { display: none; }
.ymg-tile-msg { position: absolute; left: 0; right: 0; top: 50%; transform: translateY(-50%); text-align: center; font-size: .75rem; font-weight: 700; color: #fff; text-shadow: 0 1px 3px rgba(0,0,0,.8); padding: 0 4px; }
.ymg-tile.is-done .ymg-tile-msg { top: auto; bottom: 4px; left: auto; right: 6px; transform: none; width: 22px; height: 22px; line-height: 22px; border-radius: 50%; background: var(--_accent); text-shadow: none; padding: 0; }
.ymg-tile.is-error { outline: 3px solid #d63638; outline-offset: -3px; cursor: pointer; }
.ymg-tile.is-error .ymg-tile-msg { font-size: .7rem; }
.ymg-tile-x { position: absolute; top: 4px; right: 4px; width: 24px; height: 24px; border-radius: 50%; border: 0; background: rgba(0,0,0,.6); color: #fff; font-size: 16px; line-height: 1; cursor: pointer; padding: 0; }
.ymg-tile.is-prep .ymg-tile-x, .ymg-tile.is-up .ymg-tile-x { display: none; }
.ymg-tile-pin { position: absolute; top: 4px; left: 4px; width: 24px; height: 24px; border-radius: 50%; border: 0; padding: 0; display: grid; place-items: center; background: var(--_accent); color: var(--_on-accent); cursor: pointer; }
.ymg-tile-pin svg { width: 14px; height: 14px; fill: currentColor; }
.ymg-tile.no-geo .ymg-tile-pin { background: rgba(0,0,0,.6); color: #fff; }
.ymg-tile.no-geo .ymg-tile-pin::after { content: ""; position: absolute; width: 18px; height: 2px; background: #ff6b6b; transform: rotate(-45deg); }
.ymg-go-row { display: flex; align-items: center; gap: 1rem; flex-wrap: wrap; position: sticky; bottom: 0; padding: .8rem 0; background: var(--ymg-bg, #fff); }
.ymg-go { font-size: 1.05rem; padding: .9em 1.4em; }
.ymg-status { font-size: .95rem; }
.ymg-status a { color: var(--_accent); font-weight: 700; }

.ymg-gate { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 1.2rem; max-width: 820px; margin: 1rem 0 3rem; }
.ymg-panel { border: 1px solid var(--_line); border-radius: var(--_radius); padding: 1.2rem 1.4rem; }
.ymg-panel h2 { font-size: 1.2rem; margin: 0 0 .8rem; }
.ymg-panel #loginform p { margin: 0 0 .8rem; }
.ymg-panel #loginform label { display: block; font-weight: 600; font-size: .9rem; margin-bottom: .3rem; }
.ymg-panel #loginform .login-remember label { font-weight: 400; }
.ymg-panel #wp-submit { font: inherit; font-weight: 600; padding: .7em 1.3em; border-radius: 999px; border: 0; background: var(--_accent); color: var(--_on-accent); cursor: pointer; }
.ymg-small { font-size: .85rem; color: var(--_muted); }
.ymg-error { color: #d63638; font-weight: 600; }
.ymg-hp { position: absolute !important; left: -9999px; }

/* Videos moved below a trip's photos */
.entry-content > .ymg-videos { max-width: none; display: grid; gap: 2rem; margin: 2.5rem 0; }
.ymg-videos > .wp-block-embed, .ymg-videos > p { margin: 0; }
