/**------- L'écran de cadrage d'une photo : plein écran, sombre, posé par-dessus la page. Les couleurs et les polices viennent du thème (voir theme-papier.css) -------*/
.cadrage {
  position: fixed;
  inset: 0;
  z-index: 200;
  display: flex;
  flex-direction: column;
  background: #111111;
  color: #FFFFFF;
  font-family: var(--police-corps);
  font-size: 15px;
  line-height: 1.35;
  -webkit-user-select: none;
  user-select: none;
  -webkit-tap-highlight-color: transparent;
}

/**------- La photo est dessinée dans cette toile, qui couvre tout l'écran : le doigt ne fait jamais défiler ni zoomer la page -------*/
.cadrage__toile {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  display: block;
  touch-action: none;
  cursor: grab;
}

.cadrage__toile:active { cursor: grabbing; }

.cadrage :focus-visible {
  outline: 3px solid #FFFFFF;
  outline-offset: 2px;
}

.cadrage__aide {
  position: relative;
  z-index: 1;
  width: 100%;
  max-width: 480px;
  margin: 0 auto;
  padding: calc(env(safe-area-inset-top, 0px) + 18px) 20px 0;
  box-sizing: border-box;
  text-align: center;
  font-family: var(--police-titre);
  font-size: 17px;
  line-height: 1.25;
  text-shadow: 2px 2px 0 var(--encre);
  pointer-events: none;
}

.cadrage__bas {
  position: relative;
  z-index: 1;
  width: 100%;
  max-width: 480px;
  margin: auto auto 0;
  padding: 0 20px calc(env(safe-area-inset-bottom, 0px) + 18px);
  box-sizing: border-box;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.cadrage__zoom {
  width: 100%;
  height: 36px;
  margin: 0;
  accent-color: var(--recit);
  cursor: pointer;
}

.cadrage__boutons {
  display: flex;
  gap: 14px;
}

.cadrage__boutons .bouton {
  flex: 1;
  width: auto;
}

/**------- Un écran bas (téléphone couché) : plus d'aide, le curseur et les boutons sur une seule ligne -------*/
@media (max-height: 480px) {
  .cadrage__aide { display: none; }
  .cadrage__bas {
    max-width: 640px;
    flex-direction: row;
    align-items: center;
    padding-bottom: calc(env(safe-area-inset-bottom, 0px) + 8px);
  }
  .cadrage__zoom { flex: 1; }
  .cadrage__boutons { flex: none; }
  .cadrage__boutons .bouton { min-height: 46px; font-size: 16px; padding: 0 16px; }
}

/**------- Le champ de fichier de la photo : dans la page pour que le téléphone ne le perde pas, hors de vue et hors d'atteinte -------*/
.champ-photo {
  position: fixed;
  top: 0;
  left: -100vw;
  width: 1px;
  height: 1px;
  opacity: 0;
  pointer-events: none;
}
