/* Filter page (Figma "Wedding filter" + "Apply filter"): maroon dashed cards on the polaroid line. */
.panel.maroon {
  background: var(--bg-2); border: 1px dashed rgba(255, 236, 138, .6); padding: 40px; gap: 25px; align-items: center; text-align: center;
}
@media (min-resolution: 2dppx) { .panel.maroon { border: .5px dashed var(--gold); } }

/* ---- 1. choose a photo ---- */
.choose { cursor: pointer; }
.choose[hidden], .apply[hidden] { display: none; }
.choose-head { display: flex; flex-direction: column; align-items: center; gap: 12px; width: 100%; }
.choose-title { font-family: var(--display-thin); font-weight: 500; font-size: 2.25rem; line-height: 1.258; }
.choose-sub { font-weight: 500; font-size: 0.875rem; }
.sparkles { width: 130px; height: 130px; margin: 10px 0; }
.btn.dashed { background: transparent; border: 1px dashed var(--gold); pointer-events: none; }
.choose:hover .btn.dashed { background: rgba(255, 236, 138, .1); }
.choose:focus-within { outline: 2px solid var(--gold); outline-offset: 3px; }
.note { margin: 0; font-weight: 500; font-size: 1rem; line-height: 1.3; }
.note.small { font-size: 0.8125rem; }

/* ---- 2. apply a filter ---- */
.apply { padding: 40px 30px; }
.apply-head { display: flex; flex-direction: column; gap: 8px; width: 100%; }
.apply-title { margin: 0; font-weight: 400; font-size: 1rem; line-height: 1.258; }
.preview { width: min(100%, 220px); aspect-ratio: 2 / 3; display: grid; place-items: center; }
.preview canvas { display: block; max-width: 100%; max-height: 100%; width: auto; height: auto; border-radius: 2px; box-shadow: 0 6px 22px rgba(0, 0, 0, .35); }

/* swipeable filter rail: native scroll-snap, the item in the middle (under the dashed ring) is the chosen one */
.rail-wrap { position: relative; width: min(100%, 325px); height: 60px; flex: none; }
.ring { position: absolute; left: 50%; top: 50%; width: 60px; height: 60px; translate: -50% -50%; pointer-events: none; z-index: 2; }
.rail {
  display: flex; align-items: center; gap: 25px; height: 100%; margin: 0; padding: 0 calc(50% - 20px); list-style: none;
  overflow-x: auto; scroll-snap-type: x mandatory; scrollbar-width: none; overscroll-behavior-x: contain; touch-action: pan-x; cursor: grab;
  -webkit-mask-image: linear-gradient(90deg, transparent, #000 16%, #000 84%, transparent); mask-image: linear-gradient(90deg, transparent, #000 16%, #000 84%, transparent);
}
.rail::-webkit-scrollbar { display: none; }
.rail:focus-visible { outline: 2px solid var(--gold); outline-offset: 2px; border-radius: 30px; }
.rail.dragging { scroll-snap-type: none; cursor: grabbing; }
.rail li { flex: none; scroll-snap-align: center; scroll-snap-stop: always; }
.opt {
  position: relative; display: grid; place-items: center; width: 40px; height: 40px; padding: 0; overflow: hidden; border-radius: 99px;
  border: 1px solid #6f1515; background-color: var(--maroon); color: #fff; font: 500 0.5rem/1 var(--sans); cursor: pointer;
  transform: scale(var(--s, 1)); opacity: var(--o, 1); -webkit-tap-highlight-color: transparent;
}
.opt span { position: relative; z-index: 1; text-shadow: 0 1px 2px rgba(0, 0, 0, .55); white-space: nowrap; }
.opt.film { background: radial-gradient(circle at 35% 28%, #d8b48a, #8a5f3f 55%, #3b2a22); }
.opt.confetti { background: var(--maroon) url(/img/filters/confetti-thumb.webp) center bottom / cover no-repeat; }
.opt.classic { background: linear-gradient(#2a2220, #2a2220) center 42% / 66% 60% no-repeat, #fbf9f4; }
.opt.gold { background: radial-gradient(circle at 50% 28%, #fff1a8, #dfc025 55%, #8a6a12); color: #2a1f00; }
.opt.gold span { text-shadow: none; }

.apply-actions { display: flex; flex-wrap: wrap; justify-content: center; align-items: center; gap: 10px; }
.btn.outline { background: transparent; border: 1px solid var(--gold); gap: 10px; }
.btn.outline:hover { background: rgba(255, 236, 138, .12); }
.btn.outline img { width: 16px; height: 16px; padding: 1.7px 2.5px; }
@media (max-width: 420px) { .apply-actions .btn { padding: 10px 14px; } }
.apply .error { margin: -8px 0 0; }

@media (max-width: 899px) {
  .panel.maroon { padding: 36px 24px; }
  .apply { padding: 36px 20px; }
  .choose-title { font-size: 2rem; }
  .note { font-size: 0.9375rem; }
}


/* v2: 44px filter circles; names move out of the 8px circle labels into a readable caption */
.opt { width: 44px; height: 44px; }
.opt span { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.rail { padding: 0 calc(50% - 22px); }
.rail-wrap { height: 64px; }
.ring { width: 64px; height: 64px; }
.filter-name { margin: -8px 0 0; font-weight: 500; font-size: .875rem; letter-spacing: .12em; text-transform: uppercase; }
.rail:focus-visible, .choose:focus-within { outline-color: #fff; }

/* 2026-11-17 card colours from Figma 50:630: same card fill, the dashed outline and dashed button in dusty rose instead of gold */
.panel.maroon { background: #321d23; border: 1px dashed rgba(220, 161, 161, .6); }
@media (min-resolution: 2dppx) { .panel.maroon { border: .5px dashed #dca1a1; } }
.btn.dashed { border-color: #dca1a1; }
.choose:hover .btn.dashed { background: rgba(220, 161, 161, .12); }

/* ---------- live camera (2026-11-18) ----------
   A full-screen dialog: close and switch-camera on top, a 3:4 viewfinder with the filter artwork pinned to the bottom
   exactly as it is drawn on the saved photo, then the same filter rail and a shutter. */
.choose-btns { display: flex; flex-wrap: wrap; justify-content: center; gap: 10px; }
.choose-btns .btn { gap: 10px; }
.choose-btns .btn img { width: 18px; height: 18px; }
#cam-note:empty { display: none; }

.cam {
  width: 100%; height: 100dvh; max-width: none; max-height: none; margin: 0; padding: env(safe-area-inset-top) 0 env(safe-area-inset-bottom);
  border: 0; background: #0f080a; color: #fff; overflow: hidden;
}
.cam[open] { display: flex; flex-direction: column; }
.cam::backdrop { background: #0f080a; }
.cam-top { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 8px 12px; flex: none; }
.cam-title { margin: 0; font-family: var(--display); font-size: 1.125rem; }
.cam-icon {
  display: grid; place-items: center; width: 44px; height: 44px; padding: 0; border: 0; border-radius: 99px; cursor: pointer;
  color: #fff; background: rgba(255, 255, 255, .1);
}
.cam-icon:hover { background: rgba(255, 255, 255, .18); }
.cam-icon[hidden] { visibility: hidden; display: grid; }
.cam-stage { flex: 1; min-height: 0; display: grid; place-items: center; padding: 0 12px; container-type: size; }
.cam-view {
  position: relative; width: min(100cqw, 100cqh * 3 / 4); aspect-ratio: 3 / 4; overflow: hidden; border-radius: 4px;
  background: #1c1013; container-type: inline-size;
}
.cam-view video { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; background: #1c1013; }
.cam-view.mirror video { transform: scaleX(-1); }
/* the colour looks, approximated live (the saved photo gets the exact grade) */
.cam-view.look-film video { filter: sepia(.16) saturate(.88) contrast(1.06) brightness(1.03); }
.cam-view.look-gold video { filter: sepia(.32) saturate(1.12) hue-rotate(-6deg) contrast(1.05) brightness(1.03); }
.cam-vig { position: absolute; inset: 0; pointer-events: none; opacity: 0; background: radial-gradient(ellipse at center, transparent 55%, rgba(0, 0, 0, .38)); }
.cam-view.look-film .cam-vig, .cam-view.look-gold .cam-vig { opacity: 1; }
.cam-art { position: absolute; left: 0; bottom: 0; width: 100%; height: auto; aspect-ratio: 1000 / 1400; pointer-events: none; }
/* the "Classic" ivory frame: the photo sits inside an ivory border with the names along the bottom */
.cam-cap { display: none; }
.cam-view.framed { background: #fbf9f4; }
.cam-view.framed video { inset: 4.5cqw 4.5cqw auto; width: 91cqw; height: calc(100% - 24.5cqw); }
.cam-view.framed::after { content: ""; position: absolute; inset: 2cqw; border: max(1px, .3cqw) solid #c9a227; pointer-events: none; }
.cam-view.framed .cam-cap {
  position: absolute; left: 0; right: 0; bottom: 0; height: 20cqw; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2cqw;
  color: #2a1f1a; text-align: center;
}
.cam-cap b { font: italic 400 7cqw/1 "Iowan Old Style", Palatino, Georgia, serif; }
.cam-cap small { font: 400 3.2cqw/1 system-ui, sans-serif; color: #7a5c1e; letter-spacing: .02em; }
.cam-flash { position: absolute; inset: 0; background: #fff; opacity: 0; pointer-events: none; }
.cam-flash.go { animation: camflash .32s ease-out; }
@keyframes camflash { 0% { opacity: .85; } 100% { opacity: 0; } }
.cam-msg { position: absolute; inset: auto 16px 50%; margin: 0; translate: 0 50%; text-align: center; font-size: .9375rem; line-height: 1.45; }
.cam-msg:empty { display: none; }

.cam-bottom { flex: none; display: flex; flex-direction: column; align-items: center; gap: 10px; padding: 14px 16px 18px; }
.cam-bottom .rail-wrap { width: min(100%, 360px); }
.cam-bottom .filter-name { margin: 0; }
.shutter {
  display: grid; place-items: center; width: 74px; height: 74px; padding: 0; border: 4px solid #fff; border-radius: 99px;
  background: transparent; cursor: pointer; transition: transform .15s;
}
.shutter span { width: 58px; height: 58px; border-radius: 99px; background: #fff; transition: transform .15s, background .15s; }
.shutter:active span { transform: scale(.9); background: #f7d2d2; }
.shutter:disabled { opacity: .4; cursor: default; }
.shutter:focus-visible, .cam-icon:focus-visible { outline: 2px solid var(--gold); outline-offset: 3px; }
@media (prefers-reduced-motion: reduce) { .cam-flash.go { animation: none; } }
html.cam-on { overflow: hidden; }
.cam-view.framed .cam-art { left: 4.5cqw; bottom: 20cqw; width: 91cqw; }

/* 2026-11-18 owner: the "edited on your device" notes in regular weight */
.note, .choose-sub { font-weight: 400; }

/* 2026-11-18 owner: "Choose a Photo" in Prata (the site title face) instead of Megrim */
.choose-title { font-family: var(--display); font-weight: 400; line-height: 1.2; }

/* 2026-11-18 "Add a Photo" card after the design review:
   one emblem, a title and one line, then two stacked full-width actions. The card itself is no longer a tap target,
   so each action is a real, keyboard-reachable button. The maroon primary gets a dusty-rose edge: its fill alone is
   1.05:1 against the card and read as a hole. The secondary is a solid outline, so only the card is dashed. */
.choose { cursor: default; gap: 18px; }
.choose .sparkles { width: 76px; height: 76px; margin: 4px 0 2px; }
.choose-head { gap: 10px; }
.choose-title { margin: 0; font-size: 2rem; }
.choose-sub { max-width: 30ch; line-height: 1.45; color: rgba(255, 255, 255, .82); }
.choose-btns { flex-direction: column; flex-wrap: nowrap; align-items: stretch; width: min(100%, 290px); gap: 10px; margin-top: 10px; }
.choose-btns .btn { width: 100%; justify-content: center; }
#cam-open { background: #470101; border: 1px solid rgba(220, 161, 161, .55); box-shadow: inset 0 1px 0 rgba(255, 255, 255, .08); }
#cam-open:hover { background: #581110; }
.btn.line { background: transparent; border: 1px solid #dca1a1; }
.btn.line:hover { background: rgba(220, 161, 161, .12); }
.choose:focus-within { outline: none; }
