/* spread-gallery.css
   Selected photos, thumbnails and gallery tiles shared by public/admin screens. */

.spread-selected {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.spread-photo {
  width: 200px;
  border-radius: var(--fx-image-radius);
  background: var(--surface);
  border: 1px solid var(--fx-border);
  box-shadow: var(--fx-image-shadow);
  overflow: hidden;
  position: relative;
}

.spread-photo-img {
  width: 100%;
  height: 130px;
  object-fit: cover;
  display: block;
  border-radius: var(--fx-image-radius);
}

.photo-overlay-actions {
  position: absolute;
  bottom: 8px;
  left: 8px;
  right: 8px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
  pointer-events: none;
}

.photo-overlay-actions > * {
  pointer-events: all;
}

.btn-photo-main,
.btn-photo-remove {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 6px;
  border-radius: var(--fx-radius-pill);
  background: var(--surface);
  border: 1px solid rgba(0, 0, 0, 0.06);
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.06);
  font-size: 0.9rem;
  cursor: pointer;
  transition: transform .12s ease, box-shadow .12s ease;
  font-weight: 600;
  line-height: 1;
  justify-content: center;
}

.btn-photo-main {
  color: var(--bs-body-color);
}

.btn-photo-remove {
  color: var(--bs-danger);
}

.btn-photo-main i {
  margin-right: 6px;
}

.btn-photo-remove i {
  margin-left: 0;
}

.btn-photo-main:hover {
  transform: translateY(-2px);
  color: var(--bs-warning);
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.06);
}

.btn-photo-remove:hover {
  transform: translateY(-2px);
  color: color-mix(in srgb, var(--bs-danger), black 6%);
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.06);
}

.btn-photo-main:disabled,
.btn-photo-remove:disabled {
  opacity: .45;
  cursor: not-allowed;
  transform: none;
}

.turn-thumb-wrap {
  position: relative;
}

.spread-photo-foot {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
  min-width: 72px;
  border-radius: var(--fx-radius-pill);
  background: var(--surface);
  border: 1px solid rgba(0, 0, 0, 0.06);
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.06);
  font-size: 0.95rem;
  cursor: pointer;
  transition: transform .12s ease, box-shadow .12s ease;
  font-weight: 700;
  justify-content: center;
}

.spread-photo-remove {
  opacity: .7;
  color: var(--fx-muted);
}

.spread-photo-remove:hover {
  opacity: 1;
  color: var(--bs-danger);
}

.chosen-row {
  display: flex;
  gap: 10px;
  overflow: auto;
  padding-bottom: 4px;
}

.photo-tile {
  flex: 0 0 auto;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
}

.photo-thumb {
  height: 120px;
  width: auto;
  object-fit: contain;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--fx-image-radius);
}

img.lazy-pending {
  opacity: 0;
  background: color-mix(in srgb, var(--surface), black 4%);
}

img.lazy-loaded {
  opacity: 1;
  transition: opacity .2s ease-in-out;
  background: transparent;
}

.photo-tools {
  display: flex;
  gap: 8px;
  align-items: center;
}

.photo-tools .btn-icon {
  border: 1px solid var(--line);
  background: var(--surface);
  border-radius: var(--fx-radius);
  padding: 6px;
  width: 36px;
  height: 36px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.photo-tools .btn-icon[aria-pressed="true"] {
  border-color: color-mix(in srgb, var(--primary), white 40%);
  box-shadow: 0 0 0 2px color-mix(in srgb, var(--primary), white 82%);
}

.turn-section {
  padding: 16px 0;
  background: var(--bg);
}

.turn-head {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 12px 0;
}

.turn-num {
  width: 44px;
  height: 44px;
  border-radius: var(--fx-radius);
  background: color-mix(in srgb, var(--surface), black 4%);
  border: 1px solid var(--line);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
}

.turn-titles .turn-hint {
  color: var(--muted);
  font-size: .95rem;
}

.turn-actions {
  display: flex;
  flex-wrap: wrap;
  gap: .5rem;
}

.highlight-invalid {
  box-shadow: 0 0 0 4px rgba(220, 53, 69, 0.12) !important;
  transition: box-shadow 0.25s ease, border-color 0.25s ease;
}

.btn-flash {
  animation: btnFlashAnim 0.36s ease-in-out;
}

@keyframes btnFlashAnim {
  0% { transform: translateY(0); box-shadow: none; }
  40% { transform: translateY(-3px); box-shadow: 0 6px 14px rgba(255, 193, 7, 0.45); }
  100% { transform: translateY(0); box-shadow: none; }
}

.turn-thumbs {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: flex-start;
}

.turn-thumb {
  height: 270px;
  width: auto;
  object-fit: cover;
  border-radius: var(--fx-image-radius);
  cursor: pointer;
  max-width: 100%;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
}

.turn-thumb:focus {
  outline: 2px solid rgba(13, 110, 253, 0.6);
  outline-offset: 2px;
}

.tiles {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: .75rem;
}

@media (min-width: 768px) {
  .tiles {
    grid-template-columns: repeat(3, 1fr);
  }
}

@media (min-width: 992px) {
  .tiles {
    grid-template-columns: repeat(4, 1fr);
  }
}

.tile {
  position: relative;
  overflow: hidden;
  border-radius: var(--fx-radius);
  border: 1px solid var(--line);
  background: #000;
}

.tile-img {
  width: 100%;
  height: 100%;
  aspect-ratio: 4 / 5;
  object-fit: cover;
  display: block;
}

.tile-toolbar {
  position: absolute;
  inset: auto 8px 8px 8px;
  display: flex;
  gap: .35rem;
  justify-content: center;
  background: linear-gradient(to top, rgba(0, 0, 0, .45), rgba(0, 0, 0, 0));
  padding: .35rem .4rem;
  border-radius: var(--fx-radius);
}

.tile-caption {
  position: absolute;
  left: 8px;
  top: 8px;
  padding: .2rem .45rem;
  font-size: .85rem;
  color: var(--surface);
  background: rgba(0, 0, 0, .45);
  border-radius: var(--fx-radius);
}

.tile-on-current {
  outline: 6px solid var(--primary);
  outline-offset: -3px;
}

.tile-on-other {
  outline: 3px solid color-mix(in srgb, var(--line), black 40%);
  outline-offset: -3px;
}

.tile-selected-temp {
  outline: 3px dashed var(--primary);
  outline-offset: -3px;
}

#gallery.gallery--select-mode .masonry-item.tile-on-other img {
  opacity: .5 !important;
  transition: none !important;
  -webkit-transition: none !important;
}
