/* darkroom.css — Darkroom interior scene styles
 * Photo background (darkroom-bg.png) with CSS clothesline photos
 * Depends on: css/tokens.css
 */

/* ============================================================
   Darkroom atmosphere
   ============================================================ */

#darkroom {
  background: var(--color-bg);
}

/* Photographic darkroom background — shelves, bottles, trays */
.darkroom__background {
  position: absolute;
  inset: 0;
  background-image: url('../images/darkroom/darkroom-bg.png');
  background-size: cover;
  background-position: center;
  background-color: var(--color-bg);
  filter: blur(1px) brightness(0.45);
  z-index: 0;
}

/* Red/amber safelight overlay */
.darkroom__safelight {
  position: absolute;
  inset: 0;
  background:
    radial-gradient(
      ellipse at 30% 15%,
      rgba(200, 60, 20, 0.2) 0%,
      rgba(180, 80, 20, 0.1) 30%,
      transparent 65%
    ),
    linear-gradient(
      to bottom,
      rgba(160, 40, 10, 0.08) 0%,
      rgba(120, 30, 10, 0.05) 100%
    );
  pointer-events: none;
  z-index: 1;
}

/* ============================================================
   Clothesline
   ============================================================ */

.clothesline {
  position: absolute;
  left: 0;
  right: 0;
  z-index: 2;
}

.clothesline--top {
  top: 6%;
  height: 46%;
}

.clothesline--bottom {
  top: 52%;
  height: 42%;
}

/* Wire with catenary sag */
.clothesline__wire {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 35px;
  border: none;
  border-bottom: 2px solid rgba(232, 213, 176, 0.45);
  border-radius: 0 0 50% 50% / 0 0 100% 100%;
  filter: drop-shadow(0 1px 2px rgba(0, 0, 0, 0.5));
}

.clothesline__photo {
  position: absolute;
  top: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  cursor: pointer;
  transform-origin: top center;
  margin: 0;
  padding: 0;
  border: none;
  opacity: 0; /* hidden until revealDarkroom animates them in */
}

/* Top clothesline: 5 photos */
.clothesline--top .clothesline__photo:nth-child(2) { left: 5%; }
.clothesline--top .clothesline__photo:nth-child(3) { left: 23%; }
.clothesline--top .clothesline__photo:nth-child(4) { left: 42%; }
.clothesline--top .clothesline__photo:nth-child(5) { left: 60%; }
.clothesline--top .clothesline__photo:nth-child(6) { left: 78%; }

/* Bottom clothesline: 4 photos */
.clothesline--bottom .clothesline__photo:nth-child(2) { left: 10%; }
.clothesline--bottom .clothesline__photo:nth-child(3) { left: 33%; }
.clothesline--bottom .clothesline__photo:nth-child(4) { left: 55%; }
.clothesline--bottom .clothesline__photo:nth-child(5) { left: 76%; }

/* Photos follow the catenary sag */
.clothesline--top .clothesline__photo:nth-child(2) { top: 6px; }
.clothesline--top .clothesline__photo:nth-child(3) { top: 20px; }
.clothesline--top .clothesline__photo:nth-child(4) { top: 30px; }
.clothesline--top .clothesline__photo:nth-child(5) { top: 26px; }
.clothesline--top .clothesline__photo:nth-child(6) { top: 12px; }
.clothesline--bottom .clothesline__photo:nth-child(2) { top: 10px; }
.clothesline--bottom .clothesline__photo:nth-child(3) { top: 26px; }
.clothesline--bottom .clothesline__photo:nth-child(4) { top: 26px; }
.clothesline--bottom .clothesline__photo:nth-child(5) { top: 12px; }

/* ============================================================
   Sway animation
   ============================================================ */

@keyframes sway {
  from { rotate: -1.5deg; }
  to   { rotate: 1.5deg; }
}

.clothesline__photo {
  animation: sway 5s ease-in-out infinite alternate;
  will-change: rotate;
}

.clothesline--top .clothesline__photo:nth-child(2) { animation-duration: 4.8s; animation-delay: -0.5s; }
.clothesline--top .clothesline__photo:nth-child(3) { animation-duration: 5.3s; animation-delay: -1.2s; }
.clothesline--top .clothesline__photo:nth-child(4) { animation-duration: 5.0s; animation-delay: -0.3s; }
.clothesline--top .clothesline__photo:nth-child(5) { animation-duration: 4.6s; animation-delay: -2.0s; }
.clothesline--top .clothesline__photo:nth-child(6) { animation-duration: 5.4s; animation-delay: -0.8s; }
.clothesline--bottom .clothesline__photo:nth-child(2) { animation-duration: 5.5s; animation-delay: -1.8s; }
.clothesline--bottom .clothesline__photo:nth-child(3) { animation-duration: 4.9s; animation-delay: -0.3s; }
.clothesline--bottom .clothesline__photo:nth-child(4) { animation-duration: 5.2s; animation-delay: -1.0s; }
.clothesline--bottom .clothesline__photo:nth-child(5) { animation-duration: 4.7s; animation-delay: -2.2s; }

/* ============================================================
   Clothespin
   ============================================================ */

.clothesline__pin {
  width: 12px;
  height: 24px;
  background: linear-gradient(to right, #C4A46A, #A88B50, #C4A46A);
  border-radius: 3px 3px 1px 1px;
  position: relative;
  z-index: 1;
  box-shadow: 1px 1px 2px rgba(0, 0, 0, 0.4);
}

.clothesline__pin::before {
  content: '';
  position: absolute;
  top: 40%;
  left: 20%;
  right: 20%;
  height: 2px;
  background: rgba(80, 60, 30, 0.5);
  border-radius: 1px;
}

.clothesline__pin::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 2px;
  height: 8px;
  background: rgba(20, 15, 10, 0.4);
}

/* ============================================================
   Photo image — white print border, darkroom tint
   Vignette overlay makes gradients feel more photographic
   ============================================================ */

.clothesline__image {
  width: 160px;
  height: 210px;
  border: 6px solid rgba(245, 240, 230, 0.85);
  border-bottom-width: 36px;
  border-radius: 1px;
  box-shadow:
    0 4px 12px rgba(0, 0, 0, 0.6),
    inset 0 0 0 1px rgba(0, 0, 0, 0.1);
  display: flex;
  align-items: flex-end;
  justify-content: center;
  padding-bottom: 0;
  position: relative;
  filter: sepia(0.8) saturate(1.5) hue-rotate(-15deg) brightness(0.7);
  transition: filter 0.8s ease;
}

/* Vignette overlay — darkened edges like a real photograph */
.clothesline__image::before {
  content: '';
  position: absolute;
  inset: 0;
  background: radial-gradient(
    ellipse at 50% 40%,
    transparent 30%,
    rgba(0, 0, 0, 0.35) 100%
  );
  pointer-events: none;
  z-index: 0;
}

.clothesline__photo:hover .clothesline__image {
  filter: sepia(0) saturate(1) hue-rotate(0deg) brightness(1);
}

.clothesline__genre-label {
  font-family: var(--font-serif);
  font-size: 1.2rem;
  color: #000000;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  position: absolute;
  bottom: -30px;
  left: 0;
  right: 0;
  text-align: center;
  white-space: nowrap;
  z-index: 1;
}

/* Shrink longer labels to fit on one line */
.clothesline__genre-label--long {
  font-size: 0.85rem;
}

/* ============================================================
   Decorative photos — no interaction
   ============================================================ */

.clothesline__photo--decorative {
  cursor: default;
}

.clothesline__photo--decorative:hover .clothesline__image {
  filter: sepia(0.8) saturate(1.5) hue-rotate(-15deg) brightness(0.7);
}

/* ============================================================
   Mobile responsive
   ============================================================ */

@media (max-width: 768px) {
  .clothesline__image {
    width: 100px;
    height: 135px;
    border-width: 4px;
    border-bottom-width: 16px;
  }

  .clothesline--top { top: 5%; }
  .clothesline--bottom { top: 50%; }

  .clothesline__genre-label {
    font-size: 0.6rem;
    bottom: -14px;
  }

  .clothesline__pin {
    width: 8px;
    height: 18px;
  }
}
