/* ===== 15-post-edit.css ===== */
/* ===== extrait de index.html : style #32 ===== */
  .post-edit-overlay {
    position: fixed;
    inset: 0;
    z-index: 1950;

    display: flex;
    align-items: flex-end;
    justify-content: center;

    padding:
      12px
      max(12px, env(safe-area-inset-right))
      max(12px, env(safe-area-inset-bottom))
      max(12px, env(safe-area-inset-left));

    background: rgba(0,0,0,.72);
    overscroll-behavior: none;
  }

  .post-edit-overlay[hidden] {
    display: none;
  }

  .post-edit-sheet {
    width: 100%;
    max-width: 520px;
    max-height: calc(100dvh - 24px);

    overflow-y: auto;

    border: 1px solid var(--border);
    border-radius: 20px;

    background: #0b0b0b;
  }

  .post-edit-header {
    padding: 18px;

    border-bottom: 1px solid var(--border);

    font-size: 17px;
    font-weight: 800;
  }

  .post-edit-actions {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;

    padding: 12px 18px 18px;
  }

  .post-edit-save {
    background: #fff;
    color: #000;
  }

  @media (min-width: 700px) {
    .post-edit-overlay {
      align-items: center;
    }
  }


/*
  ============================================================
  POST EDIT — MOBILE VISUAL VIEWPORT
  ============================================================

  Le zoom natif Safari/iOS reste autorisé.

  La modale suit simplement le visual viewport afin que les
  contrôles restent réellement sous le doigt lorsque le
  clavier et/ou le zoom sont actifs.
*/

@media (max-width: 699px) {

  .post-edit-overlay {
    top:
      var(--post-edit-top, 0px);

    left:
      var(--post-edit-left, 0px);

    right: auto;
    bottom: auto;

    width:
      var(--post-edit-width, 100%);

    height:
      var(--post-edit-height, 100dvh);

    box-sizing: border-box;
  }


  .post-edit-sheet {
    max-height:
      calc(100% - 24px);
  }


  /*
    Les actions restent accessibles même lorsque le clavier
    réduit fortement la hauteur visible.
  */

  .post-edit-actions {
    position: sticky;

    left: 0;
    right: 0;
    bottom: 0;

    z-index: 3;

    padding-bottom:
      max(
        18px,
        env(safe-area-inset-bottom)
      );

    border-top:
      1px solid var(--border);

    background: #0b0b0b;
  }

}
