/* Before / after photos (js/photos.js) */

/* ---- Carousel: one frame, swipe Before <-> After; each photo whole on a blurred copy of itself ---- */
.car { position: relative; overflow: hidden; background: #111; }
.car-track { display: flex; overflow-x: auto; scroll-snap-type: x mandatory; scrollbar-width: none; overscroll-behavior-x: contain; }
.car-track::-webkit-scrollbar { display: none; }
.car-slide { position: relative; flex: 0 0 100%; aspect-ratio: 4 / 5; max-height: 70vh; margin: 0; padding: 0; border: 0; overflow: hidden; background: #111; scroll-snap-align: center; scroll-snap-stop: always; cursor: zoom-in; }
.car-bg { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; filter: blur(24px) brightness(.75) saturate(1.1); transform: scale(1.2); }
.car-img { position: relative; display: block; width: 100%; height: 100%; object-fit: contain; }
.car .ba-tag { z-index: 1; }
.car-dots { position: absolute; left: 50%; bottom: 10px; transform: translateX(-50%); display: flex; gap: 4px; padding: 3px; border-radius: 999px; background: rgb(0 0 0 / .45); z-index: 1; }
.car-dots button { min-height: 26px; padding: 0 10px; border: 0; border-radius: 999px; background: transparent; color: #fff; font-size: 12px; font-weight: 700; }
.car-dots button.on { background: #fff; color: #111; }
/* Smaller frame in a habit's history */
.car-sm { margin-top: 8px; border-radius: 12px; }
.car-sm .car-slide { aspect-ratio: 4 / 3; max-height: 260px; }
/* In a post sheet */
.in-sheet .car { border-radius: var(--radius-s); }
/* Full screen viewer: no blur, the photo as big as fits */
.car-view { background: transparent; }
.car-view .car-slide { aspect-ratio: auto; height: 78vh; max-height: none; background: transparent; cursor: default; display: grid; place-items: center; }
.car-view .car-img { width: 100%; height: 100%; max-height: 78vh; border-radius: 12px; }

/* ---- Closing: a big ✕ on the full-screen photo and on a post's sheet ---- */
.viewer-x { position: fixed; top: calc(12px + env(safe-area-inset-top)); right: 12px; z-index: 52; width: 44px; height: 44px; border-radius: 50%; border: 0; background: rgb(255 255 255 / .18); color: #fff; font-size: 20px; line-height: 1; display: grid; place-items: center; }
.viewer-x:active { background: rgb(255 255 255 / .35); }
.sheet-top { position: sticky; top: 0; z-index: 3; display: flex; justify-content: flex-end; height: 0; }
.sheet-x { margin-top: -6px; width: 36px; height: 36px; border-radius: 50%; border: 0; background: var(--surface-2); color: var(--text); font-size: 16px; display: grid; place-items: center; box-shadow: var(--shadow); }

/* ---- Done sheet: take the After photo like the Before one ---- */
.match-box { display: flex; flex-direction: column; align-items: flex-start; gap: 6px; margin-top: 10px; padding: 10px 12px; border-radius: var(--radius-s); background: var(--surface-2); }
.match-box.warn { background: color-mix(in srgb, var(--warn) 16%, transparent); color: var(--warn-text); }

/* ---- In-app camera with the Before photo laid over it ---- */
.gcam { position: fixed; inset: 0; z-index: 70; background: #000; display: flex; flex-direction: column; color: #fff; }
.gcam-stage { position: relative; flex: 1; min-height: 0; }
.gcam-stage video, .gcam-ghost { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: contain; }
.gcam-ghost { pointer-events: none; }
.gcam-wait { position: absolute; inset: 0; display: grid; place-items: center; font-size: 14px; opacity: .8; }
.gcam-bar { padding: 12px 16px calc(16px + env(safe-area-inset-bottom)); background: rgb(0 0 0 / .85); }
.gcam-slider { display: flex; align-items: center; gap: 10px; font-size: 13px; }
.gcam-slider input { flex: 1; accent-color: #fff; }
.gcam-btns { display: flex; align-items: center; justify-content: space-between; margin-top: 12px; }
.gcam-side { min-width: 96px; min-height: 40px; border: 1px solid rgb(255 255 255 / .35); border-radius: 999px; background: transparent; color: #fff; font-size: 13px; font-weight: 600; }
.gcam-shutter { width: 72px; height: 72px; border-radius: 50%; border: 5px solid #fff; background: rgb(255 255 255 / .25); }
.gcam-shutter:active { background: #fff; }
.gcam-tip { margin: 10px 0 0; text-align: center; font-size: 12px; opacity: .75; }
