/* Иконките за печата в края на формата (views/schede/_foto-stampa.ejs): малки снимки по раздели с
   отметка в ъгъла — като квадратчетата на формата; отметнатата е и с плътна рамка. Цялата иконка е
   полето за отметката (палец в ръкавица), отметката е бяла с черна рамка — личи на всяка снимка. */

.foto-stampa {
  display: grid;
  gap: 14px;
}

.foto-stampa__azioni {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 10px;
}

.foto-stampa__conteggio {
  font-size: 0.875rem;
  color: var(--muted);
}

.foto-stampa__gruppo {
  display: grid;
  gap: 8px;
}

.foto-stampa__titolo {
  font-weight: 600;
}

/* Разделът не е в листа: снимката пак излиза — белегът го казва (stampa-foto.js го следи на живо). */
.foto-stampa__esclusa {
  font-weight: 400;
  color: var(--muted);
}

.foto-stampa__gruppo:not([data-esclusa]) .foto-stampa__esclusa {
  display: none;
}

.foto-stampa__lista {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.foto-stampa__voce {
  position: relative;
  display: block;
  width: 96px;
  height: 72px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--wash);
}

.foto-stampa__voce img {
  display: block;
  width: 100%;
  height: 100%;
  border-radius: calc(var(--radius) - 1px);
  object-fit: cover;
}

.foto-stampa__voce input {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  margin: 0;
  opacity: 0;
  cursor: pointer;
}

.foto-stampa__segno {
  position: absolute;
  top: 5px;
  right: 5px;
  width: 22px;
  height: 22px;
  border: 2px solid var(--fg);
  border-radius: 4px;
  background: var(--bg);
  pointer-events: none;
}

.foto-stampa__voce input:checked ~ .foto-stampa__segno {
  background: var(--fg);
}

.foto-stampa__voce input:checked ~ .foto-stampa__segno::after {
  content: '';
  position: absolute;
  left: 5px;
  top: 1px;
  width: 7.5px;
  height: 12.5px;
  border: solid var(--bg);
  border-width: 0 3.5px 3.5px 0;
  transform: rotate(45deg);
}

.foto-stampa__voce:has(input:checked) {
  box-shadow: 0 0 0 2px var(--fg);
}

.foto-stampa__voce input:focus-visible ~ .foto-stampa__segno {
  outline: 2px solid var(--fg);
  outline-offset: 2px;
}

/* Редът и големината в печата (собственикът, 10 ноември 2026): радиото за големината, списъкът на
   отметнатите със стрелките и прегледът на страниците на снимките — като в PDF-а (foto-ordine.js,
   foto-righe.js). Две колони от 720 px; на телефон — едно под друго. */
.foto-disposizione {
  display: grid;
  gap: 14px;
  padding-top: 14px;
  border-top: 1px solid var(--line);
}

.foto-disposizione__dimensione {
  min-width: 0;
  margin: 0;
  padding: 0;
  border: 0;
}

.foto-disposizione__dimensione legend {
  margin-bottom: 8px;
  padding: 0;
}

.foto-disposizione__ordine {
  display: grid;
  gap: 16px;
  align-items: start;
}

.foto-disposizione__ordine[hidden] {
  display: none;
}

@media (min-width: 720px) {
  .foto-disposizione__ordine {
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  }
}

.foto-ordine {
  display: grid;
  gap: 6px;
  margin: 8px 0 0;
  padding: 0;
  list-style: none;
}

.foto-ordine__voce {
  display: grid;
  grid-template-columns: 64px minmax(0, 1fr) auto;
  align-items: center;
  gap: 10px;
  padding: 6px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
}

.foto-ordine__voce img {
  display: block;
  width: 64px;
  height: 48px;
  border-radius: calc(var(--radius) - 2px);
  object-fit: cover;
}

.foto-ordine__testo {
  min-width: 0;
  overflow-wrap: anywhere;
}

.foto-ordine__azioni {
  display: flex;
  gap: 4px;
}

.foto-ordine__sposta {
  min-width: 40px;
  font-size: 1.125rem;
}

/* Прегледът: страница A4 в мащаб, снимките на местата си, номерът им в ъгъла. */
.foto-anteprima {
  display: grid;
  gap: 10px;
  max-width: 360px;
  margin-top: 8px;
}

.foto-anteprima__pagina {
  position: relative;
  aspect-ratio: 210 / 297;
  border: 1px solid var(--line);
  background: #ffffff;
  overflow: hidden;
}

.foto-anteprima__numero {
  position: absolute;
  right: 6px;
  bottom: 4px;
  font-size: 0.75rem;
  color: #555555;
}

.foto-anteprima__titolo {
  position: absolute;
  height: 1px;
  background: #000000;
}

.foto-anteprima__foto {
  position: absolute;
  background: #e6e6e6;
}

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

.foto-anteprima__posto {
  position: absolute;
  top: 2px;
  left: 2px;
  min-width: 16px;
  padding: 0 3px;
  border-radius: 3px;
  background: #000000;
  color: #ffffff;
  font-size: 0.6875rem;
  font-weight: 700;
  line-height: 16px;
  text-align: center;
}
