/* LOOT Polaroid pile — reusable component styles */

/* WayToGo Hand — our generated scratchy-ballpoint handwriting (from the wtg app) */
@font-face {
  font-family: "WayToGo Hand";
  src: url("fonts/WayToGoHand-Regular.ttf") format("truetype");
  font-weight: 400;
  font-display: swap;
}

@font-face {
  font-family: "WayToGo Hand";
  src: url("fonts/WayToGoHand-Bold.ttf") format("truetype");
  font-weight: 700;
  font-display: swap;
}

.lp-stage {
  position: relative;
  width: 100%;
  aspect-ratio: 16 / 10;
  overflow: hidden;
  background: #ffffff;
  user-select: none;
  -webkit-user-select: none;
  --pw: 140px;
}

@media (max-width: 600px) {
  .lp-stage { aspect-ratio: 4 / 3; }
}

.lp-card {
  position: absolute;
  left: 50%;
  top: 50%;
  width: var(--pw);
  will-change: transform;
  cursor: grab;
  touch-action: none;   /* drags never fight page scroll; stage itself still pans */
  perspective: 900px;
}

.lp-card:active { cursor: grabbing; }

/* two-sided print — tap the focused card to flip it over */
.lp-inner {
  position: relative;
  transform-style: preserve-3d;
  transition: transform 0.55s cubic-bezier(0.4, 0.2, 0.2, 1);
}

.lp-card.lp-flip .lp-inner { transform: rotateY(180deg); }

.lp-face {
  backface-visibility: hidden;
  -webkit-backface-visibility: hidden;
}

.lp-face.lp-back {
  position: absolute;
  inset: 0;
  transform: rotateY(180deg);
  pointer-events: none;
}

.lp-card.lp-flip .lp-back { pointer-events: auto; }

.lp-paper {
  background: #ffffff;
  padding: 7% 7% 0;
  border-radius: 2px;
  box-shadow:
    0 1px 2px rgba(17, 17, 17, 0.22),
    0 7px 16px rgba(17, 17, 17, 0.13);
  transition: box-shadow 0.2s;
}

.lp-card.lp-drag .lp-paper {
  box-shadow:
    0 2px 4px rgba(17, 17, 17, 0.2),
    0 18px 34px rgba(17, 17, 17, 0.22);
}

.lp-media {
  position: relative;
  width: 100%;
  aspect-ratio: 1;
  overflow: hidden;
  background: #f4efe6;
}

.lp-media img,
.lp-media video {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  pointer-events: none;
  -webkit-user-drag: none;
}

/* bottom white strip — the handwritten caption area */
.lp-strip {
  min-height: calc(var(--pw) * 0.2);
  padding: 6px 2px 8px;
  font: 400 12px/1.25 "WayToGo Hand", "Bradley Hand", "Marker Felt", "Segoe Print", cursive;
  color: #111111;
  text-align: center;
}

.lp-cap {
  display: block;
  font-weight: 700;
}

/* subheadline scribbles in once the print is selected */
.lp-sub {
  display: none;
  margin-top: 2px;
  font-size: 9px;
  line-height: 1.4;
  color: #111111;
}

.lp-card.lp-focus .lp-sub { display: block; }

/* the back of the print — description scribbled on instant-film white */
.lp-paper-back {
  height: 100%;
  padding: 10% 9%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 7px;
  background: #ffffff;
}

.lp-desc {
  font: 400 9.5px/1.55 "WayToGo Hand", "Bradley Hand", "Marker Felt", "Segoe Print", cursive;
  color: #111111;
  text-align: center;
  transform: rotate(-1.5deg);   /* handwriting never sits straight */
}

/* optional image on the back (e.g. a screenshotted caption) */
.lp-back-img {
  display: block;
  max-width: 100%;
  max-height: 78%;
  object-fit: contain;
  transform: rotate(-1.2deg);
  -webkit-user-drag: none;
}

/* on a linked print, the back's content is the click target */
.lp-card.lp-haslink .lp-back-img,
.lp-card.lp-haslink .lp-desc { cursor: pointer; }

.lp-card.lp-focus { cursor: pointer; }

/* soft vignette so the focused card reads against the pile */
.lp-dim {
  position: absolute;
  inset: 0;
  background: rgba(255, 255, 255, 0.55);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.35s;
  z-index: 150;
}

.lp-stage.lp-has-focus .lp-dim { opacity: 1; }
