/* ===== 02-comments.css ===== */
/* ===== extrait de index.html : style #4 ===== */
  .comment-action {
    width: auto;
    min-width: 44px;

    display: flex;
    align-items: center;
    gap: 6px;

    padding-left: 8px;
    padding-right: 9px;
  }

  .comment-count {
    font-size: 13px;
    font-weight: 650;
    line-height: 1;
  }

  .comments-panel {
    position: fixed;
    inset: 0;
    z-index: 1700;

    display: none;
    align-items: flex-end;

    background: rgba(0,0,0,.7);
  }

  .comments-panel.open {
    display: flex;
  }

  .comments-sheet {
    width: 100%;
    height: var(--comments-height, 88dvh);
    max-height: var(--comments-height, 88dvh);

    display: flex;
    flex-direction: column;

    background: #0b0b0b;

    border-radius: 20px 20px 0 0;

    overflow: hidden;
  }

  .comments-header {
    min-height: 58px;

    display: grid;
    grid-template-columns: 48px 1fr 48px;
    align-items: center;

    flex: 0 0 auto;

    padding:
      0
      max(8px, env(safe-area-inset-right))
      0
      max(8px, env(safe-area-inset-left));

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

  .comments-header strong {
    text-align: center;
    font-size: 15px;
  }

  .comments-close {
    width: 42px;
    height: 42px;

    border: 0;
    background: transparent;
    color: #fff;

    font-size: 28px;
    font-weight: 300;

    cursor: pointer;
  }

  .comments-list {
    flex: 1;
    min-height: 0;

    overflow-y: auto;
    overscroll-behavior: contain;

    padding: 8px 14px 18px;
  }

  .comments-empty {
    padding: 48px 20px;

    color: var(--muted);
    text-align: center;
    font-size: 14px;
  }

  .comment-row {
    display: flex;
    align-items: flex-start;
    gap: 10px;

    padding: 11px 0;
  }

  .comment-avatar {
    position: relative;

    width: 36px;
    height: 36px;

    flex: 0 0 36px;

    display: grid;
    place-items: center;

    overflow: hidden;

    border: 1px solid #303030;
    border-radius: 50%;

    background: #171717;

    font-size: 12px;
    font-weight: 750;
    text-transform: uppercase;
  }

  .comment-avatar img {
    position: absolute;
    inset: 0;

    width: 100%;
    height: 100%;

    object-fit: cover;
  }

  .comment-content {
    min-width: 0;
    flex: 1;
  }

  .comment-topline {
    display: flex;
    align-items: baseline;
    gap: 7px;

    margin-bottom: 3px;
  }

  .comment-username {
    font-size: 13px;
    font-weight: 750;
  }

  .comment-edited {
    color: var(--muted);
    font-size: 11px;
  }

  .comment-body {
    white-space: pre-wrap;
    overflow-wrap: anywhere;

    font-size: 14px;
    line-height: 1.42;
  }

  .comment-edit {
    margin-top: 7px;

    padding: 0;

    border: 0;
    background: transparent;
    color: var(--muted);

    font-size: 12px;
    font-weight: 650;

    cursor: pointer;
  }

  .comments-editor {
    flex: 0 0 auto;

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

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

    background: #0b0b0b;
  }

  .comments-editor[hidden] {
    display: none !important;
  }

  .comments-editing {
    display: flex;
    align-items: center;
    justify-content: space-between;

    margin-bottom: 8px;

    color: var(--muted);
    font-size: 12px;
  }

  .comments-editing[hidden] {
    display: none;
  }

  .comments-editing button {
    border: 0;
    background: transparent;
    color: #fff;

    font: inherit;
    font-weight: 700;

    cursor: pointer;
  }

  .comments-compose {
    display: flex;
    align-items: flex-end;
    gap: 9px;
  }

  /*
    L'attribut hidden doit toujours gagner sur les
    variantes flex/grid du compositeur de commentaires.
  */
  .comments-compose[hidden] {
    display: none !important;
  }

  #comment-input {
    min-width: 0;
    flex: 1;

    max-height: 120px;

    padding: 11px 13px;

    resize: none;

    border: 1px solid #2c2c2c;
    border-radius: 18px;

    outline: none;

    background: #151515;
    color: #fff;

    font: inherit;
    font-size: 14px;
    line-height: 1.4;
  }

  #comment-send {
    min-height: 40px;

    padding: 8px 12px;

    border: 0;
    background: transparent;
    color: #fff;

    font-weight: 800;

    cursor: pointer;
  }

  #comment-send:disabled {
    opacity: .45;
  }

  @media (min-width: 700px) {
    .comments-panel {
      align-items: center;
      justify-content: center;
    }

    .comments-sheet {
      width: 520px;
      height: min(720px, 85dvh);

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

/* ===== extrait de index.html : style #5 ===== */
  /* ---------- COMMENTAIRES MOBILE ---------- */

  @media (max-width: 699px) {
    .comments-panel {
      position: fixed;
      inset: 0;

      width: 100%;
      height: 100dvh;

      align-items: initial;

      background: #000;

      overflow: hidden;
      overscroll-behavior: none;
    }

    .comments-sheet {
      position: absolute;

      top: var(--comments-top, 0px);
      left: var(--comments-left, 0px);

      width: var(--comments-width, 100%);
      height: var(--comments-height, 100dvh);
      max-height: none;

      min-width: 0;
      max-width: 100%;

      border-radius: 0;

      background: #000;

      overflow: hidden;
    }

    .comments-header {
      width: 100%;
      min-width: 0;

      grid-template-columns:
        44px
        minmax(0, 1fr)
        44px;

      padding-left:
        max(8px, env(safe-area-inset-left));

      padding-right:
        max(8px, env(safe-area-inset-right));
    }

    .comments-list,
    .comments-editor,
    .comments-compose {
      width: 100%;
      max-width: 100%;
      min-width: 0;
    }

    .comments-editor {
      overflow: hidden;
    }

    .comments-compose {
      display: grid;
      grid-template-columns:
        minmax(0, 1fr)
        auto;

      align-items: end;
    }

    #comment-input {
      width: 100%;
      min-width: 0;
      max-width: 100%;
    }

    #comment-send {
      max-width: 32vw;

      padding-left: 10px;
      padding-right: 10px;

      white-space: nowrap;
    }

    .comments-editing {
      width: 100%;
      min-width: 0;
      gap: 12px;
    }

    .comments-editing span {
      min-width: 0;
      overflow: hidden;
      text-overflow: ellipsis;
    }

    .comments-editing button {
      flex: 0 0 auto;
      white-space: nowrap;
    }
  }


  /* ---------- PROFIL / BIO MOBILE ---------- */

  @media (max-width: 699px) {
    .profile-view {
      width: 100%;
      max-width: 100%;

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

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

      overflow-x: hidden;
    }

    #profile-bio,
    #profile-language,
    .profile-save {
      width: 100%;
      max-width: 100%;
      min-width: 0;
    }
  }

/* ===== extrait de index.html : style #6 ===== */
  .latest-comment {
    padding:
      0
      14px
      16px;

    margin-top: -8px;

    font-size: 13px;
    line-height: 1.4;

    color: #d8d8d8;

    overflow-wrap: anywhere;
  }

  .latest-comment[hidden] {
    display: none;
  }

  .latest-comment-user {
    font-weight: 750;
    color: var(--text);
  }

  .latest-comment-body {
    color: #d0d0d0;
  }

  .latest-comment-edited {
    color: var(--muted);
    font-size: 11px;
  }



/* GRFTSH COMMENTS HASHTAG SUGGESTIONS V1 */

.comments-editor {
  position: relative;
}

.comment-hashtag-suggestions {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;

  margin-bottom: 9px;
  padding: 9px;

  border:
    1px solid #292929;

  border-radius:
    14px;

  background:
    #111;
}

.comment-hashtag-suggestions[hidden] {
  display: none;
}

.comment-hashtag-suggestion {
  padding:
    7px
    10px;

  border:
    1px solid
    rgba(255,255,255,.11);

  border-radius:
    999px;

  background:
    rgba(255,255,255,.05);

  color:
    #fff;

  font:
    inherit;

  font-size:
    12px;

  font-weight:
    700;

  cursor:
    pointer;
}

.comment-hashtag-suggestion:hover,
.comment-hashtag-suggestion:focus-visible {
  background:
    rgba(255,255,255,.10);

  outline:
    none;
}

@media (max-width: 699px) {
  .comment-hashtag-suggestions {
    max-height:
      116px;

    overflow-y:
      auto;

    overscroll-behavior:
      contain;
  }
}


/* GRFTSH_COMMENTS_POST_PREVIEW_V1 */

.comments-post-preview {
  display: flex;
  align-items: center;
  gap: 12px;

  width: 100%;
  min-width: 0;

  padding: 11px 14px;

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

  background: #111;
  color: #fff;

  font: inherit;
  text-align: left;
  cursor: pointer;

  flex: 0 0 auto;
}

.comments-post-preview[hidden] {
  display: none !important;
}

.comments-post-preview-image {
  display: block;

  width: 76px;
  height: 76px;

  flex: 0 0 76px;

  object-fit: cover;
  object-position: center;

  border-radius: 9px;
  background: #1a1a1a;
}

.comments-post-preview-content {
  display: flex;
  flex-direction: column;
  gap: 5px;

  flex: 1;
  min-width: 0;

  font-size: 13px;
  line-height: 1.4;
}

.comments-post-preview-content strong {
  font-size: 14px;
  font-weight: 750;
}

.comments-post-preview-content > span {
  display: -webkit-box;

  overflow: hidden;
  overflow-wrap: anywhere;

  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;

  color: #bbb;
}

.comments-post-preview-arrow {
  flex: 0 0 auto;

  color: #999;
  font-size: 28px;
  line-height: 1;
}

.comments-post-preview:focus-visible {
  outline: 2px solid #fff;
  outline-offset: -3px;
}

@media (max-width: 699px) {
  .comments-post-preview {
    padding-left:
      max(14px, env(safe-area-inset-left));

    padding-right:
      max(14px, env(safe-area-inset-right));
  }

  .comments-post-preview-image {
    width: 68px;
    height: 68px;
    flex-basis: 68px;
  }
}
