/* Multi-photo gallery. Overlay and dots stay put; only the photo strip scrolls. */

.photo-frame {
  position: relative;
  border-radius: 24px;
  overflow: hidden;
  /* overflow:hidden misses the scroll layer on iOS. This mask holds the 24px clip. */
  clip-path: inset(0 round 24px);
}

/* One photo never builds the strip, so the cream backing and the clip above
   never reached it. WebKit then paints the corner cutouts white. */
.photo-frame.photo-still {
  background-color: var(--aisle-cream, #F7F1E6);
}

.photo-frame.photo-still::before {
  content: none;
}

.profile-card .photo-still .profile-img {
  border-radius: 0;
}

.photo-strip {
  display: flex;
  overflow-x: auto;
  overflow-y: hidden;
  scroll-snap-type: x mandatory;
  height: 52vh;
  min-height: 380px;
  max-height: 560px;
  scrollbar-width: none;
  -webkit-overflow-scrolling: touch;
  /* WebKit paints a white backing on this scrollport, and the radius does not
     clip it, so the corner cutouts go white. Cream matches the screen. */
  background-color: var(--aisle-cream, #F7F1E6);
}

.photo-strip::-webkit-scrollbar {
  display: none;
}

.profile-card .photo-strip .profile-img {
  flex: 0 0 100%;
  width: 100%;
  height: 100%;
  min-height: 0;
  max-height: none;
  border-radius: 0;
  scroll-snap-align: start;
  scroll-snap-stop: always;
  object-fit: cover;
  pointer-events: none;
}

.photo-dots {
  position: absolute;
  top: 12px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 4;
  display: flex;
  justify-content: center;
  gap: 5px;
  width: max-content;
  padding: 4px 6px;
  border-radius: 999px;
  background: rgba(28, 25, 23, 0.60);
  -webkit-backdrop-filter: blur(8px);
  backdrop-filter: blur(8px);
  pointer-events: none;
}

.photo-frame::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 56px;
  background: linear-gradient(to bottom, rgba(28, 25, 23, 0.28), transparent);
  pointer-events: none;
  z-index: 2;
}

.photo-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.55);
  box-shadow: none;
}

.photo-dot.on {
  background: #FFFFFF;
  box-shadow: none;
}

.profile-card .aisle-card-overlay {
  pointer-events: none;
}

.profile-card.aisle-hero-card:not(.discover-profile-hero) .aisle-card-overlay {
  pointer-events: auto;
  left: 8px;
  right: 8px;
  bottom: 12px;
  padding: 8px;
  box-sizing: border-box;
  -webkit-user-select: none;
  user-select: none;
  touch-action: none;
}

.gm-card-stack {
  position: relative;
}

.gm-card-stack.profile-card.aisle-hero-card {
  background: transparent;
  box-shadow: none;
  margin-bottom: 0;
}

/* The inline .profile-card rule is white and beats #2a2420. That rectangle
   shows in the cutouts outside the 24px photo. The photo keeps #2a2420.
   The same rule's shadow sits in those cutouts; the stack already drops it. */
.gm-card-control.profile-card:not(.is-photo-placeholder) {
  background-color: transparent;
  box-shadow: none;
}

.discover-profile-hero.profile-card:not(.is-photo-placeholder) {
  background-color: transparent;
}

.gm-card-stack > .aisle-card-overlay {
  pointer-events: auto;
  left: 8px;
  right: 8px;
  bottom: 12px;
  padding: 8px;
  box-sizing: border-box;
  z-index: 3;
  -webkit-user-select: none;
  user-select: none;
  touch-action: none;
}

.gm-card-stack > .aisle-card-overlay button,
.gm-card-stack > .aisle-card-overlay a,
.profile-card.aisle-hero-card:not(.discover-profile-hero) .aisle-card-overlay button,
.profile-card.aisle-hero-card:not(.discover-profile-hero) .aisle-card-overlay a {
  touch-action: manipulation;
}

.profile-photos {
  margin: 0 0 16px;
}

.profile-photos-caption {
  margin: 0 0 12px;
  color: var(--rt-muted, #5F5A54);
  font-family: Outfit, "Pretendard", "Noto Sans KR", system-ui, -apple-system, "Apple SD Gothic Neo", sans-serif;
  font-size: 13px;
  font-weight: 500;
  line-height: 1.35;
}

.profile-photos-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
}

.photo-slot {
  position: relative;
  aspect-ratio: 1 / 1.12;
  border-radius: 18px;
  overflow: hidden;
  background: #F3EBDD;
  border: 1px solid rgba(28, 25, 23, 0.04);
}

.photo-slot.photo-slot-placeholder {
  overflow: hidden;
}

.photo-slot img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.photo-slot.is-dragging {
  transform: translateY(-10px) rotate(-4deg) scale(1.04);
  box-shadow: 0 14px 28px rgba(28, 25, 23, 0.2);
  z-index: 3;
  pointer-events: none;
  outline: 2px solid #fff;
}

.photo-slot.is-end-target {
  border: 1.5px dashed #C4B8A4;
  background: transparent;
}

.photo-slot-empty {
  background: #F3EBDD;
}

.photo-add,
.photo-delete,
.photo-grip {
  border: none;
  padding: 0;
  cursor: pointer;
  font-family: inherit;
}

.photo-add {
  width: 100%;
  height: 100%;
  background: transparent;
  color: #1C1917;
  font-size: 28px;
  font-weight: 500;
  line-height: 1;
}

.photo-eye,
.photo-delete,
.photo-grip {
  position: absolute;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(28, 25, 23, 0.55);
  color: #fff;
}

.photo-eye {
  top: 6px;
  left: 6px;
  pointer-events: none;
}

.photo-delete {
  top: 6px;
  right: 6px;
  font-size: 14px;
  line-height: 1;
}

.photo-grip {
  left: 6px;
  bottom: 6px;
  touch-action: none;
  cursor: grab;
}

.photo-grip svg {
  pointer-events: none;
}

.photo-adjust {
  position: absolute;
  inset: 0;
  z-index: 1;
  border: none;
  padding: 0;
  margin: 0;
  background: transparent;
  cursor: pointer;
}

.photo-eye,
.photo-delete,
.photo-grip {
  z-index: 2;
}

/* Full-screen crop editor. Top bar 56 + bottom stack 170 = EDITOR_CHROME 226. */
.photo-crop-editor {
  position: fixed;
  inset: 0;
  height: 100vh;
  height: 100dvh;
  z-index: 300;
  display: flex;
  flex-direction: column;
  background: var(--aisle-ink, #1C1917);
  color: var(--aisle-cream, #F7F1E6);
  font-family: Outfit, "Pretendard", "Noto Sans KR", system-ui, -apple-system, "Apple SD Gothic Neo", sans-serif;
  -webkit-user-select: none;
  user-select: none;
}

.photo-crop-top {
  flex: 0 0 56px;
  height: 56px;
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  padding: 0 8px;
}

.photo-crop-cancel {
  justify-self: start;
  background: none;
  border: none;
  padding: 8px 12px;
  cursor: pointer;
  color: var(--aisle-cream, #F7F1E6);
  font-family: Outfit, "Pretendard", "Noto Sans KR", system-ui, -apple-system, "Apple SD Gothic Neo", sans-serif;
  font-weight: 600;
  font-size: 16px;
}

.photo-crop-title {
  margin: 0;
  text-align: center;
  font-family: Outfit, "Pretendard", "Noto Sans KR", system-ui, -apple-system, "Apple SD Gothic Neo", sans-serif;
  font-weight: 600;
  font-size: 17px;
  line-height: 1.2;
  color: var(--aisle-cream, #F7F1E6);
}

.photo-crop-stage {
  flex: 1 1 auto;
  min-height: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}

.photo-crop-frame {
  position: relative;
  overflow: hidden;
  touch-action: none;
  background: #000;
}

.photo-crop-frame img {
  position: absolute;
  max-width: none;
  user-select: none;
  -webkit-user-drag: none;
  pointer-events: none;
}

.photo-crop-thirds {
  position: absolute;
  inset: 0;
  pointer-events: none;
  background:
    linear-gradient(rgba(247, 241, 230, 0.55), rgba(247, 241, 230, 0.55)) 33.333% 0 / 1px 100% no-repeat,
    linear-gradient(rgba(247, 241, 230, 0.55), rgba(247, 241, 230, 0.55)) 66.666% 0 / 1px 100% no-repeat,
    linear-gradient(rgba(247, 241, 230, 0.55), rgba(247, 241, 230, 0.55)) 0 33.333% / 100% 1px no-repeat,
    linear-gradient(rgba(247, 241, 230, 0.55), rgba(247, 241, 230, 0.55)) 0 66.666% / 100% 1px no-repeat;
}

.photo-crop-thumb {
  position: absolute;
  box-sizing: border-box;
  border: 1.5px dashed var(--aisle-cream, #F7F1E6);
  pointer-events: none;
}

.photo-crop-bracket {
  position: absolute;
  width: 22px;
  height: 22px;
  pointer-events: none;
  border: 0 solid var(--aisle-cream, #F7F1E6);
}

.photo-crop-bracket-tl { top: 0; left: 0; border-top-width: 2.5px; border-left-width: 2.5px; }
.photo-crop-bracket-tr { top: 0; right: 0; border-top-width: 2.5px; border-right-width: 2.5px; }
.photo-crop-bracket-bl { bottom: 0; left: 0; border-bottom-width: 2.5px; border-left-width: 2.5px; }
.photo-crop-bracket-br { bottom: 0; right: 0; border-bottom-width: 2.5px; border-right-width: 2.5px; }

.photo-crop-chip {
  position: absolute;
  top: 8px;
  left: 8px;
  z-index: 2;
  box-sizing: border-box;
  max-width: calc(100% - 16px);
  margin: 0;
  padding: 4px 10px;
  border-radius: 999px;
  background: rgba(28, 25, 23, 0.72);
  color: var(--aisle-cream, #F7F1E6);
  font-family: Outfit, "Pretendard", "Noto Sans KR", system-ui, -apple-system, "Apple SD Gothic Neo", sans-serif;
  font-size: 12px;
  font-weight: 500;
  line-height: 16px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  pointer-events: none;
}

.photo-crop-bottom {
  flex: 0 0 auto;
  padding: 12px 20px calc(16px + env(safe-area-inset-bottom, 0px));
}

.photo-crop-zoom-row {
  display: flex;
  align-items: center;
  gap: 12px;
  height: 44px;
}

.photo-crop-zoom-label {
  flex: 0 0 auto;
  font-family: Outfit, "Pretendard", "Noto Sans KR", system-ui, -apple-system, "Apple SD Gothic Neo", sans-serif;
  font-size: 13px;
  font-weight: 500;
  line-height: 1;
  color: var(--rt-muted, #5F5A54);
}

.photo-crop-zoom {
  flex: 1 1 auto;
  width: 100%;
  height: 28px;
  border: 0;
  padding: 0;
  margin: 0;
  background: transparent;
  accent-color: var(--aisle-cream, #F7F1E6);
  -webkit-appearance: none;
  appearance: none;
}

.photo-crop-zoom::-webkit-slider-runnable-track {
  height: 3px;
  background: linear-gradient(to right, var(--aisle-cream, #F7F1E6) 0, var(--aisle-cream, #F7F1E6) var(--zoom-pct, 0%), #8A837A var(--zoom-pct, 0%), #8A837A 100%);
  border: none;
  border-radius: 999px;
}

.photo-crop-zoom::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 28px;
  height: 28px;
  margin-top: -12.5px;
  border: none;
  border-radius: 50%;
  background: var(--aisle-cream, #F7F1E6);
}

.photo-crop-zoom::-moz-range-track {
  height: 3px;
  background: linear-gradient(to right, var(--aisle-cream, #F7F1E6) 0, var(--aisle-cream, #F7F1E6) var(--zoom-pct, 0%), #8A837A var(--zoom-pct, 0%), #8A837A 100%);
  border: none;
  border-radius: 999px;
}

.photo-crop-zoom::-moz-range-thumb {
  width: 28px;
  height: 28px;
  border: none;
  border-radius: 50%;
  background: var(--aisle-cream, #F7F1E6);
}

.photo-crop-rotate {
  flex: 0 0 44px;
  width: 44px;
  height: 44px;
  border: none;
  border-radius: 12px;
  background: transparent;
  color: var(--aisle-cream, #F7F1E6);
  padding: 0;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
}

.photo-crop-hint {
  margin: 8px 0 0;
  height: 18px;
  text-align: center;
  font-family: Outfit, "Pretendard", "Noto Sans KR", system-ui, -apple-system, "Apple SD Gothic Neo", sans-serif;
  font-weight: 400;
  font-size: 13px;
  line-height: 18px;
  color: var(--rt-muted, #5F5A54);
}

.photo-crop-use {
  display: block;
  width: 100%;
  height: 56px;
  margin-top: 16px;
  border: none;
  border-radius: 16px;
  background: var(--tomato);
  color: var(--aisle-cream, #F7F1E6);
  font-family: Outfit, "Pretendard", "Noto Sans KR", system-ui, -apple-system, "Apple SD Gothic Neo", sans-serif;
  font-weight: 600;
  font-size: 17px;
  cursor: pointer;
  box-shadow: none;
}

.photo-crop-use:disabled {
  opacity: 0.55;
  cursor: not-allowed;
}

/* Sage holds the photo's own box until the file fades in. No-photo initials stay separate. */
.gm-photo-fade {
  position: relative;
  display: block;
  width: 100%;
  overflow: hidden;
  border-radius: inherit;
  background: #D7E6D4;
  line-height: 0;
  pointer-events: none;
}

.gm-photo-blur {
  position: absolute;
  inset: 0;
  z-index: 1;
  border-radius: inherit;
  background:
    radial-gradient(circle at 42% 38%, #eef6ec 0%, #D7E6D4 58%, #c5d9c1 100%);
  filter: blur(18px);
  -webkit-filter: blur(18px);
  transform: none;
  pointer-events: none;
}

.gm-photo-fade img,
.gm-photo-fade .profile-img {
  opacity: 0;
  transition: opacity 200ms ease-out;
  pointer-events: none;
}

.gm-photo-fade.is-loaded .gm-photo-blur {
  opacity: 0;
}

.gm-photo-fade.is-loaded img,
.gm-photo-fade.is-loaded .profile-img {
  position: relative;
  z-index: 2;
  opacity: 1;
}

.gm-photo-fade.is-instant img,
.gm-photo-fade.is-instant .profile-img,
.gm-photo-fade.is-instant .gm-photo-blur {
  transition: none;
}

@media (prefers-reduced-motion: reduce) {
  .gm-photo-fade img,
  .gm-photo-fade .profile-img,
  .gm-photo-fade .gm-photo-blur {
    transition: none;
  }
}

.aisle-hero-card .gm-photo-fade,
.discover-profile-hero .gm-photo-fade,
.discover-photo-slot .gm-photo-fade {
  border-radius: 24px;
}

.photo-frame .gm-photo-fade {
  border-radius: 0;
}

.photo-slot .gm-photo-fade {
  height: 100%;
  border-radius: 18px;
}

.liked-you-photo .gm-photo-fade {
  height: 100%;
  border-radius: 16px;
}

.profile-card .photo-strip > .gm-photo-fade {
  flex: 0 0 100%;
  width: 100%;
  height: 100%;
  min-height: 0;
  scroll-snap-align: start;
  scroll-snap-stop: always;
}

.profile-card .photo-strip > .gm-photo-fade .profile-img {
  flex: none;
  width: 100%;
  height: 100%;
}

body:not(.discover-profile-open) .screen.active.discover-deck .gm-photo-fade {
  height: 100%;
  min-height: 0;
  max-height: none;
}

.discover-profile-hero .gm-photo-fade,
.discover-photo-slot .gm-photo-fade {
  height: 100%;
}

.screen.active.discover-deck > .discover-card-queued {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: 0;
  padding: 0;
  overflow: hidden;
  clip-path: inset(50%);
  flex: 0 0 auto;
  pointer-events: none;
}
