/* ── Full-screen live display layout ── */

/* QR box hidden by default; settings.js toggles display when image loads */
#qr-box { display: none; }

/* ── Mobile: natural scroll, single column ── */
html { height: 100%; }
body { height: 100%; }

#photo-grid {
  padding: 3.5rem 0 3.5rem !important;
  display: grid;
  grid-template-columns: 1fr;
  gap: 4rem 1.5rem;
}

/* Mobile: no tilt — tape strip + rotation causes overlap in a single column */
@media (max-width: 767px) {
  #photo-grid .col .photo-card         { transform: none !important; }
  #photo-grid .col .photo-card::before { transform: translateX(-50%) !important; }
}

/* ── Desktop (TV): viewport-locked 3×2 grid ── */
@media (min-width: 768px) {
  html { overflow: hidden; }

  body {
    overflow: hidden;
    display: grid !important;
    grid-template-rows: auto 1fr;
  }

  body > .live-show-container {
    max-width: 100% !important;
    width: 100% !important;
    padding-left: 1.25rem !important;
    padding-right: 1.25rem !important;
    padding-bottom: 0.75rem !important;
    min-height: 0;
    overflow: hidden;
    display: flex !important;
    flex-direction: column;
  }

  body > .live-show-container > .d-flex { flex-shrink: 0; }

  #photo-grid {
    padding: 0 3rem !important;
    flex: 1;
    min-height: 0;
    gap: 1rem 1rem !important;
    grid-template-columns: repeat(3, 1fr);
    grid-template-rows: repeat(2, 1fr);
    align-items: stretch;
    align-content: stretch;
  }

  /* Reduce tilt on live display so rotated corners don't clip neighbours */
  #photo-grid .col:nth-child(5n+1) .photo-card { transform: rotate(-1.5deg); }
  #photo-grid .col:nth-child(5n+2) .photo-card { transform: rotate( 1.2deg); }
  #photo-grid .col:nth-child(5n+3) .photo-card { transform: rotate(-0.8deg); }
  #photo-grid .col:nth-child(5n+4) .photo-card { transform: rotate( 1.5deg); }
  #photo-grid .col:nth-child(5n+5) .photo-card { transform: rotate(-1.0deg); }
}

#photo-grid > .col {
  padding: 0 !important;
  width: auto !important;
  flex: none !important;
  min-width: 0;
  min-height: 0;
  overflow: visible;
}

/* Per-slot fade when content changes */
.col-fade-out { opacity: 0 !important; }

/* ── QR code ── */
.qr-box {
  display: block;
  width: fit-content;
  margin: 2rem auto 2.5rem;
  background: #fff;
  padding: 8px 8px 4px;
  border-radius: 4px;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.30);
  text-align: center;
}

.qr-img {
  display: block;
  width: 110px;
  height: 110px;
}

.qr-label {
  font-family: 'Bebas Neue', sans-serif;
  font-size: 0.58rem;
  letter-spacing: 0.12em;
  color: #222;
  margin: 4px 0 0;
}

@media (min-width: 768px) {
  .qr-box {
    position: fixed;
    bottom: 1.5rem;
    right: 1.5rem;
    margin: 0;
  }

  .qr-img {
    width: 80px;
    height: 80px;
  }
}

/* ── Cards and images ── */

/* Mobile: cap height so photos don't dominate the scroll */
.photo-card img {
  width: 100% !important;
  height: auto !important;
  max-height: 40vh;
  aspect-ratio: unset !important;
  object-fit: cover !important;
  object-position: center 80% !important;
}

/* Desktop: card fills its grid cell via flex column */
@media (min-width: 768px) {
  .photo-card {
    display: flex;
    flex-direction: column;
    width: 100%;
    height: 100%;
  }

  .photo-card img {
    flex: 1;
    width: 100% !important;
    height: 0 !important;
    min-height: 0;
    max-height: none !important;
    aspect-ratio: unset !important;
    object-fit: cover !important;
    object-position: center 80% !important;
  }
}
